From 5c5a524cd4319de877afa875fd2755737c4c5d59 Mon Sep 17 00:00:00 2001 From: Mattias Gaertner Date: Tue, 25 Dec 2018 07:18:12 +0000 Subject: [PATCH] fcl-passrc: parse property dispid only in dispinterface git-svn-id: trunk@40638 - --- packages/fcl-passrc/src/pparser.pp | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/fcl-passrc/src/pparser.pp b/packages/fcl-passrc/src/pparser.pp index 9833624b77..e1203395ba 100644 --- a/packages/fcl-passrc/src/pparser.pp +++ b/packages/fcl-passrc/src/pparser.pp @@ -5233,13 +5233,14 @@ function TPasParser.ParseProperty(Parent: TPasElement; const AName: String; end; var - isArray , ok: Boolean; + isArray , ok, IsClass: Boolean; ObjKind: TPasObjKind; begin Result:=TPasProperty(CreateElement(TPasProperty,AName,Parent,AVisibility)); if IsClassField then Include(Result.VarModifiers,vmClass); - if (Parent<>nil) and (Parent.ClassType=TPasClassType) then + IsClass:=(Parent<>nil) and (Parent.ClassType=TPasClassType); + if IsClass then ObjKind:=TPasClassType(Parent).ObjKind else ObjKind:=okClass; @@ -5272,17 +5273,20 @@ begin Result.WriteAccessorName := GetAccessorName(Result,Result.WriteAccessor); NextToken; end; - if CurTokenIsIdentifier('READONLY') then + if IsClass and (ObjKind=okDispInterface) then begin - Result.DispIDReadOnly:=True; - NextToken; + if CurTokenIsIdentifier('READONLY') then + begin + Result.DispIDReadOnly:=True; + NextToken; + end; + if CurTokenIsIdentifier('DISPID') then + begin + NextToken; + Result.DispIDExpr := DoParseExpression(Result,Nil); + end; end; - if CurTokenIsIdentifier('DISPID') then - begin - NextToken; - Result.DispIDExpr := DoParseExpression(Result,Nil); - end; - if (ObjKind in [okClass]) and CurTokenIsIdentifier('IMPLEMENTS') then + if IsClass and (ObjKind=okClass) and CurTokenIsIdentifier('IMPLEMENTS') then ParseImplements; if CurTokenIsIdentifier('STORED') then begin