Open conradz opened 3 years ago
This issue is likely caused by the parser not distinguishing reserved words from identifiers, e.g., the parser would also not error on if(true);
.
Additionally, it is possible to parse code that uses reserved words as a method or variable name when running with the -d
flag(void while(bool b) { }
or int if = 1;
).
Since a
;
is not an empty statement in C0, the parser should error onwhile(true);
. Currently it parses this as a method invocation.while
is a reserved word, so it can never be a method name. See thefp-basic/semi.c0
test case.