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) {}
This commit is contained in:
Stephen Heumann 2022-10-21 18:51:53 -05:00
parent bdf212ec6b
commit 946c6c1d55

View File

@ -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}