From: Carl Worth Date: Sat, 29 May 2010 12:07:24 +0000 (-0700) Subject: Fix pass-through of '=' and add a test for it. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=631016946ca8134244c4e58bef6863d204b1119b;p=mesa.git Fix pass-through of '=' and add a test for it. Previously '=' was not included in our PUNCTUATION regeular expression, but it *was* excldued from our OTHER regular expression, so we were getting the default (and hamful) lex action of just printing it. The test we add here is named "punctuator" with the idea that we can extend it as needed for other punctuator testing. --- diff --git a/glcpp-lex.l b/glcpp-lex.l index 70d47d24975..52269c6b306 100644 --- a/glcpp-lex.l +++ b/glcpp-lex.l @@ -38,7 +38,7 @@ NEWLINE [\n] HSPACE [ \t] HASH ^{HSPACE}*#{HSPACE}* IDENTIFIER [_a-zA-Z][_a-zA-Z0-9]* -PUNCTUATION [][(){}.&*~!/%<>^|;,+-] +PUNCTUATION [][(){}.&*~!/%<>^|;,=+-] OTHER [^][(){}.&*~!/%<>^|;,=#[:space:]+-]+ DECIMAL_INTEGER [1-9][0-9]*[uU]? diff --git a/glcpp-parse.y b/glcpp-parse.y index c89d7bf159c..01ca08ec740 100644 --- a/glcpp-parse.y +++ b/glcpp-parse.y @@ -426,6 +426,7 @@ operator: | OR { $$ = OR; } | ';' { $$ = ';'; } | ',' { $$ = ','; } +| '=' { $$ = '='; } | PASTE { $$ = PASTE; } | DEFINED { $$ = DEFINED; } ; diff --git a/tests/071-punctuator.c b/tests/071-punctuator.c new file mode 100644 index 00000000000..959d6825988 --- /dev/null +++ b/tests/071-punctuator.c @@ -0,0 +1 @@ +a = b