From 946c6c1d55d61604c729227df76871fb34643177 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Fri, 21 Oct 2022 18:51:53 -0500 Subject: [PATCH] Always end preprocessor expression processing at end of line. In certain error cases, tokens from subsequent lines could get treated as part of a preprocessor expression, causing subsequent code to be essentially ignored and producing strange error messages. Here is an example (with an error) affected by this: #pragma optimize 0 0 int main(void) {} --- Scanner.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scanner.pas b/Scanner.pas index 7dd0032..d6ffcdb 100644 --- a/Scanner.pas +++ b/Scanner.pas @@ -2342,7 +2342,7 @@ var begin {NumericDirective} doingPPExpression := true; NextToken; {skip the directive name} - Expression(preprocessorExpression, []); {evaluate the expression} + Expression(preprocessorExpression, [eolsy]); {evaluate the expression} doingPPExpression := false; end; {NumericDirective}