Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 42 additions & 1 deletion Source/SimpleParser/SimpleParser.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -5588,7 +5589,7 @@ procedure TmwSimplePasPar.AnonymousMethod;
FormalParameterList;
end;
end;
Block;
AnonymousMethodBlock;
end;

procedure TmwSimplePasPar.AnonymousMethodType;
Expand All @@ -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);
Expand Down Expand Up @@ -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.