diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-05-03 08:30:02 +0200 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-05-03 16:28:28 +0200 |
commit | 365b4d95a49dabdc08d271a31ca3eb9c6591ba91 (patch) | |
tree | ce7e4803c21b8873aa9d6b8c1cf92b7ea61a8cc6 /src/symlist.c | |
parent | 5bb44cca813e4ca109626b85265ed015c116bffb (diff) | |
download | bison-365b4d95a49dabdc08d271a31ca3eb9c6591ba91.tar.gz |
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.
Diffstat (limited to 'src/symlist.c')
-rw-r--r-- | src/symlist.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/symlist.c b/src/symlist.c index 79277e27..d594ddbe 100644 --- a/src/symlist.c +++ b/src/symlist.c @@ -34,7 +34,7 @@ symbol_list_sym_new (symbol *sym, location loc) res->content_type = SYMLIST_SYMBOL; res->content.sym = sym; - res->location = res->sym_loc = loc; + res->sym_loc = loc; res->named_ref = NULL; res->midrule = NULL; @@ -42,6 +42,7 @@ symbol_list_sym_new (symbol *sym, location loc) res->midrule_parent_rhs_index = 0; /* Members used for LHS only. */ + res->rhs_loc = empty_location; res->ruleprec = NULL; res->percent_empty_loc = empty_location; code_props_none_init (&res->action_props); @@ -73,7 +74,7 @@ symbol_list_type_new (uniqstr type_name, location loc) res->content.sem_type->location = loc; res->content.sem_type->status = undeclared; - res->location = res->sym_loc = loc; + res->sym_loc = loc; res->named_ref = NULL; res->next = NULL; |