(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:
Paul Eggert
2003-03-13 07:07:17 +00:00
parent 4a99c66490
commit 379f0ac840

View File

@@ -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, "{}");
}