X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/d236ad946b61526197a5e20322416ad99b045d97..847480ae0f5f105ae86d8990729916c589427552:/src/scan-code.l diff --git a/src/scan-code.l b/src/scan-code.l index e3e6b653..c13f8805 100644 --- a/src/scan-code.l +++ b/src/scan-code.l @@ -85,7 +85,7 @@ splice (\\[ \f\t\v]*\n)* named symbol references. Shall be kept synchronized with scan-gram.l "letter" and "id". */ letter [.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_] -id -*(-|{letter}({letter}|[-0-9])*) +id {letter}({letter}|[-0-9])* ref -?[0-9]+|{id}|"["{id}"]"|"$" %% @@ -620,7 +620,17 @@ parse_ref (char *cp, symbol_list *rule, int rule_length, complain_at_indent (text_loc, &indent, _("invalid reference: %s"), quote (text)); indent += SUB_INDENT; - if (midrule_rhs_index) + if (len == 0) + { + location sym_loc = text_loc; + sym_loc.start.column += 1; + sym_loc.end = sym_loc.start; + const char *format = + _("syntax error after `%c', expecting integer, letter," + " `_', `[', or `$'"); + complain_at_indent (sym_loc, &indent, format, dollar_or_at); + } + else if (midrule_rhs_index) { const char *format = _("symbol not found in production before $%d: %.*s");