From: Kenneth Graunke Date: Wed, 16 Jun 2010 19:53:19 +0000 (-0700) Subject: glcpp: Handle missing newline at EOF. X-Git-Tag: 062012170305~10660^2~625^2~90 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f82d6736487c45ec92596729b004b5a291e9abb6;p=profile%2Fivi%2Fmesa.git glcpp: Handle missing newline at EOF. Fixes CorrectFuncOverload.vert. --- diff --git a/glcpp/glcpp-lex.l b/glcpp/glcpp-lex.l index c28f2f6..933d9f4 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