X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/cd3684cfa8e5b6faa2ce00330a6d84bd04d165d4..0ced3098fd97e1483b4ac938bdce99bfc7942539:/src/scan-gram.l diff --git a/src/scan-gram.l b/src/scan-gram.l index 56e65cfe..742d54e8 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -182,6 +182,7 @@ splice (\\[ \f\t\v]*\n)* { "%binary" return PERCENT_NONASSOC; "%debug" return PERCENT_DEBUG; + "%default"[-_]"prec" return PERCENT_DEFAULT_PREC; "%define" return PERCENT_DEFINE; "%defines" return PERCENT_DEFINES; "%destructor" token_type = PERCENT_DESTRUCTOR; BEGIN SC_PRE_CODE; @@ -197,6 +198,7 @@ splice (\\[ \f\t\v]*\n)* "%locations" return PERCENT_LOCATIONS; "%merge" return PERCENT_MERGE; "%name"[-_]"prefix" return PERCENT_NAME_PREFIX; + "%no"[-_]"default"[-_]"prec" return PERCENT_NO_DEFAULT_PREC; "%no"[-_]"lines" return PERCENT_NO_LINES; "%nonassoc" return PERCENT_NONASSOC; "%nondeterministic-parser" return PERCENT_NONDETERMINISTIC_PARSER; @@ -369,6 +371,7 @@ splice (\\[ \f\t\v]*\n)* return STRING; } + \0 complain_at (*loc, _("invalid null character")); .|\n STRING_GROW; <> unexpected_eof (token_start, "\""); BEGIN INITIAL; } @@ -395,6 +398,7 @@ splice (\\[ \f\t\v]*\n)* return ID; } + \0 complain_at (*loc, _("invalid null character")); .|\n STRING_GROW; <> unexpected_eof (token_start, "'"); BEGIN INITIAL; } @@ -410,6 +414,8 @@ splice (\\[ \f\t\v]*\n)* unsigned long c = strtoul (yytext + 1, 0, 8); if (UCHAR_MAX < c) complain_at (*loc, _("invalid escape sequence: %s"), quote (yytext)); + else if (! c) + complain_at (*loc, _("invalid null character: %s"), quote (yytext)); else obstack_1grow (&obstack_for_string, c); } @@ -420,6 +426,8 @@ splice (\\[ \f\t\v]*\n)* c = strtoul (yytext + 2, 0, 16); if (UCHAR_MAX < c || get_errno ()) complain_at (*loc, _("invalid escape sequence: %s"), quote (yytext)); + else if (! c) + complain_at (*loc, _("invalid null character: %s"), quote (yytext)); else obstack_1grow (&obstack_for_string, c); } @@ -439,6 +447,8 @@ splice (\\[ \f\t\v]*\n)* int c = convert_ucn_to_byte (yytext); if (c < 0) complain_at (*loc, _("invalid escape sequence: %s"), quote (yytext)); + else if (! c) + complain_at (*loc, _("invalid null character: %s"), quote (yytext)); else obstack_1grow (&obstack_for_string, c); }