mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-10 21:03:04 +00:00
style: clarify the use of symbol_lists' locations
symbol_list features a 'location' and a 'sym_loc' member. The former is expected to be set only for symbol_lists that denote a symbol (not a type name), and the latter should only denote the location of the symbol/type name. Yet both are set, and the name "location" is too unprecise. * src/symlist.h, src/symlist.c (symbol_list::location): Rename as rhs_loc for clarity. Move it to the "section" of data valid only for rules. * src/reader.c, src/scan-code.l: Adjust.
This commit is contained in:
@@ -507,12 +507,12 @@ parse_ref (char *cp, symbol_list *rule, int rule_length,
|
||||
dollar_or_at);
|
||||
}
|
||||
else if (midrule_rhs_index)
|
||||
complain_indent (&rule->location, complaint, &indent,
|
||||
complain_indent (&rule->rhs_loc, complaint, &indent,
|
||||
_("symbol not found in production before $%d: "
|
||||
"%.*s"),
|
||||
midrule_rhs_index, len, cp);
|
||||
else
|
||||
complain_indent (&rule->location, complaint, &indent,
|
||||
complain_indent (&rule->rhs_loc, complaint, &indent,
|
||||
_("symbol not found in production: %.*s"),
|
||||
len, cp);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user