From f82d6736487c45ec92596729b004b5a291e9abb6 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 16 Jun 2010 12:53:19 -0700 Subject: [PATCH] glcpp: Handle missing newline at EOF. Fixes CorrectFuncOverload.vert. --- glcpp/glcpp-lex.l | 9 +++++++++ 1 file changed, 9 insertions(+) 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 -- 2.7.4