From: Carl Worth Date: Sat, 15 May 2010 00:29:24 +0000 (-0700) Subject: Fix two whitespace bugs in the lexer. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e36a4d5be9a9fa3abc4fb5d0b6c3601934f7a343;p=mesa.git Fix two whitespace bugs in the lexer. The first bug was not allowing whitespace between '#' and the directive name. The second bug was swallowing a terminating newline along with any trailing whitespace on a line. With these two fixes, and the previous commit to stop emitting SPACE tokens, the recently added extra-whitespace test now passes. --- diff --git a/glcpp-lex.l b/glcpp-lex.l index 3c9dda46d47..97ff1175f1b 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -39,7 +39,7 @@ SPACE [[:space:]] NONSPACE [^[:space:]] NEWLINE [\n] HSPACE [ \t] -HASH ^{HSPACE}*# +HASH ^{HSPACE}*#{HSPACE}* IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* TOKEN [^[:space:](),]+ @@ -109,6 +109,6 @@ TOKEN [^[:space:](),]+ return NEWLINE; } -{SPACE}+ +{HSPACE}+ %%