Closed kvrabec closed 4 years ago
The following line can't be parsed by SimpleParser:
Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl varargs;
Even though Delphi allowes it and compiles. It works as intended when semicolon (";") is added between directives like in following example:
Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl; varargs;
In our case, 2nd example doesn't compile.
Workaround:
{$IFNDEF CUSTOM_TAG } Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl varargs; {$ENDIF}
{$IFNDEF CUSTOM_TAG }
{$ENDIF}
builder := TPasSyntaxTreeBuilder.Create(); builder.AddDefine('CUSTOM_TAG');
builder := TPasSyntaxTreeBuilder.Create();
builder.AddDefine('CUSTOM_TAG');
Related issue where it was allegedly solved: #246
The following line can't be parsed by SimpleParser:
Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl varargs;
Even though Delphi allowes it and compiles. It works as intended when semicolon (";") is added between directives like in following example:
Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl; varargs;
In our case, 2nd example doesn't compile.
Workaround:
{$IFNDEF CUSTOM_TAG }
Tzstr_sendx_fn = function(dest : Winapi.Windows.PVOID; const &string : System.PAnsiChar) : System.Int32; cdecl varargs;
{$ENDIF}
builder := TPasSyntaxTreeBuilder.Create();
builder.AddDefine('CUSTOM_TAG');
Related issue where it was allegedly solved: #246