From: Kenneth Graunke Date: Wed, 16 Jun 2010 19:53:19 +0000 (-0700) Subject: glcpp: Handle missing newline at EOF. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f82d6736487c45ec92596729b004b5a291e9abb6;p=mesa.git glcpp: Handle missing newline at EOF. Fixes CorrectFuncOverload.vert. --- diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l index c28f2f6269e..933d9f449a6 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. */ +<> { + BEGIN DONE; /* Don't keep matching this rule forever. */ + yyextra->lexing_if = 0; + return NEWLINE; +} + %% void