X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/255227393f15ba5b593070f19d99fabbc96499b8..464c692789eba089bb21ebd3983ebeaa4a8d3312:/src/scan-gram.l diff --git a/src/scan-gram.l b/src/scan-gram.l index 502fabaa..a2c61fd6 100644 --- a/src/scan-gram.l +++ b/src/scan-gram.l @@ -154,10 +154,15 @@ splice (\\[ \f\t\v]*\n)* { [ \f\n\t\v] ; + "," warn_at (*loc, _("stray `,' treated as white space")); /* Comments. */ - "/*" token_start = loc->start; context_state = YY_START; BEGIN SC_YACC_COMMENT; "//".* ; + "/*" { + token_start = loc->start; + context_state = YY_START; + BEGIN SC_YACC_COMMENT; + } /* #line directives are not documented, and may be withdrawn or modified in future versions of Bison. */ @@ -215,10 +220,6 @@ splice (\\[ \f\t\v]*\n)* "|" rule_length = 0; return PIPE; ";" return SEMICOLON; - "," { - warn_at (*loc, _("stray `,' treated as white space")); - } - {id} { val->symbol = symbol_get (yytext, *loc); id_loc = *loc; @@ -558,7 +559,7 @@ splice (\\[ \f\t\v]*\n)* should also diagnose other Bison extensions like %yacc. Perhaps there should also be a GCC-style --pedantic-errors option, so that such warnings are diagnosed as errors. */ - if (outer_brace && ! yacc_flag) + if (outer_brace && token_type == BRACED_CODE && ! yacc_flag) obstack_1grow (&obstack_for_string, ';'); obstack_1grow (&obstack_for_string, '}');