From d7d1f3bb948bbfdb1473fac33f9426dc6667ea49 Mon Sep 17 00:00:00 2001 From: civilian7 Date: Wed, 10 Jun 2026 16:51:33 +0900 Subject: [PATCH] Support calling convention on anonymous / reference-to-function types --- Source/SimpleParser/SimpleParser.pas | 4 ++++ Test/Snippets/anonymousmethodcallingconvention.pas | 11 +++++++++++ 2 files changed, 15 insertions(+) create mode 100644 Test/Snippets/anonymousmethodcallingconvention.pas diff --git a/Source/SimpleParser/SimpleParser.pas b/Source/SimpleParser/SimpleParser.pas index d7efd2c..9cc030f 100644 --- a/Source/SimpleParser/SimpleParser.pas +++ b/Source/SimpleParser/SimpleParser.pas @@ -5588,6 +5588,8 @@ procedure TmwSimplePasPar.AnonymousMethod; FormalParameterList; end; end; + while ExID in [ptCdecl, ptPascal, ptRegister, ptSafeCall, ptStdCall] do + ProceduralDirective; Block; end; @@ -5611,6 +5613,8 @@ procedure TmwSimplePasPar.AnonymousMethodType; ReturnType; end; end; + while ExID in [ptCdecl, ptPascal, ptRegister, ptSafeCall, ptStdCall] do + ProceduralDirective; end; procedure TmwSimplePasPar.AddDefine(const ADefine: string); diff --git a/Test/Snippets/anonymousmethodcallingconvention.pas b/Test/Snippets/anonymousmethodcallingconvention.pas new file mode 100644 index 0000000..5eea0fa --- /dev/null +++ b/Test/Snippets/anonymousmethodcallingconvention.pas @@ -0,0 +1,11 @@ +unit anonymousmethodcallingconvention; + +interface + +type + TStdFunc = reference to function(const A: Integer): HRESULT stdcall; + TCdeclProc = reference to procedure(P: Pointer) cdecl; + +implementation + +end. \ No newline at end of file