diff --git a/components/codetools/keywordfunclists.pas b/components/codetools/keywordfunclists.pas index 4c29b5fa7c..d2e847462f 100644 --- a/components/codetools/keywordfunclists.pas +++ b/components/codetools/keywordfunclists.pas @@ -778,6 +778,7 @@ begin Add('EXPERIMENTAL' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('LIBRARY' ,{$ifdef FPC}@{$endif}AllwaysTrue); Add('FINAL' ,{$ifdef FPC}@{$endif}AllwaysTrue); + Add('ENUMERATOR' ,{$ifdef FPC}@{$endif}AllwaysTrue); end; IsKeyWordProcedureSpecifier:=TKeyWordFunctionList.Create; diff --git a/components/codetools/pascalparsertool.pas b/components/codetools/pascalparsertool.pas index 80617256f0..92c4f2a246 100644 --- a/components/codetools/pascalparsertool.pas +++ b/components/codetools/pascalparsertool.pas @@ -1113,7 +1113,8 @@ function TPascalParserTool.KeyWordFuncClassMethod: boolean; proc specifiers with parameters: message dispid -} + enumerator + } var IsFunction, HasForwardModifier: boolean; ParseAttr: TParseProcHeadAttributes; begin @@ -1493,6 +1494,7 @@ function TPascalParserTool.ReadTilProcedureHeadEnd( [external name ] [internconst:in_const_round, external name 'FPC_ROUND']; dispid ; + enumerator } procedure RaiseKeyWordExampleExpected; @@ -1590,7 +1592,8 @@ begin CurPos.StartPos,CurPos.EndPos-CurPos.StartPos); if IsSpecifier then begin // read specifier - if UpAtomIs('MESSAGE') or UpAtomIs('DISPID') then begin + if UpAtomIs('MESSAGE') or UpAtomIs('DISPID') or UpAtomIs('ENUMERATOR') + then begin ReadNextAtom; ReadConstant(true,false,[]); end else if UpAtomIs('EXTERNAL') or UpAtomIs('PUBLIC') then begin @@ -1960,13 +1963,13 @@ function TPascalParserTool.KeyWordFuncClassProperty: boolean; property Items[Index1, Index2: integer]: integer read GetItems; default; property X: integer index 1 read GetCoords write SetCoords stored IsStored; deprecated; property Col8: ICol8 read FCol8 write FCol8 implements ICol8, IColor; + property Value: Integer read FCurrent; enumerator Current; - property specifiers without parameters: - default, nodefault - - property specifiers with parameters: - index , read , write , stored , default , - implements [,...] + property specifiers before semicolon: + index , read , write , stored , default , + implements [,...], nodefault + property modifiers after semicolon: + default, deprecated, enumerator } procedure RaiseSemicolonAfterPropSpecMissing(const s: string); @@ -1998,6 +2001,7 @@ begin ReadNextAtom; end; if CurPos.Flag=cafSemicolon then begin + // read modifiers ReadNextAtom; if UpAtomIs('DEFAULT') then begin ReadNextAtom; @@ -2011,6 +2015,12 @@ begin ReadNextAtom; if CurPos.Flag<>cafSemicolon then RaiseSemicolonAfterPropSpecMissing('deprecated'); + end else if UpAtomIs('ENUMERATOR') then begin + ReadNextAtom; + AtomIsIdentifier(true); + ReadNextAtom; + if CurPos.Flag<>cafSemicolon then + RaiseSemicolonAfterPropSpecMissing('enumerator'); end else UndoReadNextAtom; end else