glcpp: Support #if(expression) with no intervening space.

And add a test case to ensure that this works.
This commit is contained in:
Carl Worth
2010-07-20 13:16:17 -07:00
committed by Ian Romanick
parent 61ebc01dfe
commit 17f9beb6c3
3 changed files with 8 additions and 1 deletions

View File

@@ -99,7 +99,7 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
return HASH_IFNDEF;
}
{HASH}if{HSPACE}/.*\n {
{HASH}if{HSPACE}*/[^_a-zA-Z0-9].*\n {
yyextra->lexing_if = 1;
yyextra->space_tokens = 0;
return HASH_IF;

View File

@@ -0,0 +1,3 @@
#if(1)
success
#endif

View File

@@ -0,0 +1,4 @@
success