summaryrefslogtreecommitdiff
path: root/glcpp/glcpp-lex.l
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2010-06-16 12:53:19 -0700
committerKenneth Graunke <kenneth@whitecape.org>2010-06-21 11:31:55 -0700
commitf82d6736487c45ec92596729b004b5a291e9abb6 (patch)
treef770859147589fd5596c5ed2f06d8126d5a4d442 /glcpp/glcpp-lex.l
parent739ba06680c762ff0a2e93027fefe0ab84ab6adc (diff)
glcpp: Handle missing newline at EOF.
Fixes CorrectFuncOverload.vert.
Diffstat (limited to 'glcpp/glcpp-lex.l')
-rw-r--r--glcpp/glcpp-lex.l9
1 files changed, 9 insertions, 0 deletions
diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l
index c28f2f6269..933d9f449a 100644
--- a/glcpp/glcpp-lex.l
+++ b/glcpp/glcpp-lex.l
@@ -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