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