diff --git a/Source/SimpleParser/SimpleParser.pas b/Source/SimpleParser/SimpleParser.pas index d7efd2c..0839a3a 100644 --- a/Source/SimpleParser/SimpleParser.pas +++ b/Source/SimpleParser/SimpleParser.pas @@ -568,6 +568,7 @@ TmwSimplePasPar = class(TObject) procedure NamedArgument; virtual; procedure AttributeArgumentName; virtual; procedure AttributeArgumentExpression; virtual; + procedure AnonymousMethodBlock; virtual; property ExID: TptTokenKind read GetExID; property GenID: TptTokenKind read GetGenID; @@ -5588,7 +5589,7 @@ procedure TmwSimplePasPar.AnonymousMethod; FormalParameterList; end; end; - Block; + AnonymousMethodBlock; end; procedure TmwSimplePasPar.AnonymousMethodType; @@ -5611,6 +5612,14 @@ procedure TmwSimplePasPar.AnonymousMethodType; ReturnType; end; end; + while ExID in [ptCdecl, ptFar, + ptNear, ptPascal, ptRegister, + ptSafeCall, ptStdCall, + ptPlatform, ptAssembler, ptStatic, ptInline, + ptExperimental, ptDeprecated, ptNoreturn] do + begin + ProceduralDirective; + end; end; procedure TmwSimplePasPar.AddDefine(const ADefine: string); @@ -5915,4 +5924,36 @@ procedure TmwSimplePasPar.CustomAttribute; AttributeSections; end; +procedure TmwSimplePasPar.AnonymousMethodBlock; +var + HasBlock: Boolean; +begin + HasBlock := True; + if TokenID = ptSemiColon then Semicolon; + + while ExID in [ptCdecl, ptFar, + ptNear, ptPascal, ptRegister, + ptSafeCall, ptStdCall, + ptPlatform, ptAssembler, ptStatic, ptInline, + ptExperimental, ptDeprecated, ptNoreturn] do + begin + ProceduralDirective; + if TokenID = ptSemiColon then Semicolon; + end; + + if HasBlock then + begin + case TokenID of + ptAsm: + begin + AsmStatement; + end; + else + begin + Block; + end; + end; + end; +end; + end. \ No newline at end of file