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:
Akim Demaille
2019-05-03 08:30:02 +02:00
parent 5bb44cca81
commit 365b4d95a4
4 changed files with 22 additions and 19 deletions

View File

@@ -50,7 +50,6 @@ typedef struct symbol_list
*/
semantic_type *sem_type;
} content;
location location;
/* Named reference. */
named_ref *named_ref;
@@ -74,6 +73,9 @@ typedef struct symbol_list
| when several RHSs are bound to a single lhs via "|"). |
`--------------------------------------------------------------*/
/* Location of the RHS. */
location rhs_loc;
/* Precedence/associativity. */
symbol *ruleprec;