From 379f0ac840fa8b04eacbfdd7d19394f86574031e Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Thu, 13 Mar 2003 07:07:17 +0000 Subject: [PATCH] (YY_USER_INIT): Initialize code_start, too. (<>, <>): Set *loc to the scanner cursor, instead of leaving it undefined. This fixes a bug reported by Tim Van Holder in . --- src/scan-gram.l | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/scan-gram.l b/src/scan-gram.l index a31cd02e..77fe5beb 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -43,6 +43,7 @@ scanner_cursor.file = current_file; \ scanner_cursor.line = 1; \ scanner_cursor.column = 1; \ + code_start = scanner_cursor; \ } \ while (0) @@ -279,6 +280,11 @@ splice (\\[ \f\t\v]*\n)* . { complain_at (*loc, _("invalid character: %s"), quote (yytext)); } + + <> { + loc->start = loc->end = scanner_cursor; + yyterminate (); + } } @@ -529,6 +535,8 @@ splice (\\[ \f\t\v]*\n)* return token_type; } } + + <> unexpected_end_of_file (scanner_cursor, "{}"); } -- 2.50.0