mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-09 12:23:04 +00:00
(YY_USER_INIT): Initialize code_start, too.
(<INITIAL><<EOF>>, <SC_PRE_CODE><<EOF>>): Set *loc to the scanner cursor, instead of leaving it undefined. This fixes a bug reported by Tim Van Holder in <http://mail.gnu.org/archive/html/bug-bison/2003-03/msg00023.html>.
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
<<EOF>> {
|
||||
loc->start = loc->end = scanner_cursor;
|
||||
yyterminate ();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -529,6 +535,8 @@ splice (\\[ \f\t\v]*\n)*
|
||||
return token_type;
|
||||
}
|
||||
}
|
||||
|
||||
<<EOF>> unexpected_end_of_file (scanner_cursor, "{}");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user