b569383bbd
The specification of the preprocessor in C99 says that when we see a macro name that we are already expanding that we refuse to expand it now, (which we've done for a while), but also that we refuse to ever expand it later if seen in other contexts at which it would be legitimate to expand. We add a test case for that here, and fix it to work. The fix takes advantage of a new token_t value for tokens and argument words along with the recently added IDENTIFIER_FINALIZED token type which instructs the parser to not even look for another expansion.
4 lines
68 B
C
4 lines
68 B
C
#define expand(x) expand(x once)
|
|
#define foo(x) x
|
|
foo(expand(just))
|