glcpp: Handle missing newline at EOF.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 16 Jun 2010 19:53:19 +0000 (12:53 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Jun 2010 18:31:55 +0000 (11:31 -0700)
Fixes CorrectFuncOverload.vert.

glcpp/glcpp-lex.l

index c28f2f6269eea9ceba3c4b409cdfe83643166b46..933d9f449a6a6327ee178f68ee636364ae348a1c 100644 (file)
@@ -33,6 +33,8 @@
 %option extra-type="glcpp_parser_t *"
 %option prefix="glcpp_"
 
+%x DONE
+
 SPACE          [[:space:]]
 NONSPACE       [^[:space:]]
 NEWLINE                [\n]
@@ -207,6 +209,13 @@ NON_STARS_THEN_STARS       [^*]*[*]+
        return NEWLINE;
 }
 
+       /* Handle missing newline at EOF. */
+<INITIAL><<EOF>> {
+       BEGIN DONE; /* Don't keep matching this rule forever. */
+       yyextra->lexing_if = 0;
+       return NEWLINE;
+}
+
 %%
 
 void