mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-12 05:43:03 +00:00
* src/parse-gram.y (YYLLOC_DEFAULT, current_lhs_location): New.
(input): Don't try to initialize yylloc here, do it in the scanner. * src/scan-gram.l (YY_USER_INIT): Initialize yylloc. * src/gram.h (rule_t): Change line and action_line into location and action_location, of location_t type. Adjust all dependencies. * src/location.h, src/location.c (empty_location): New. * src/reader.h, src/reader.c (grammar_start_symbol_set) (grammar_symbol_append, grammar_rule_begin, grammar_rule_end) (grammar_current_rule_symbol_append) (grammar_current_rule_action_append): Expect a location as argument. * src/reader.c (grammar_midrule_action): Adjust to attach an action's location as dummy symbol location. * src/symtab.h, src/symtab.c (startsymbol_location): New. * tests/regression.at (Web2c Report, Rule Line Numbers): Adjust the line numbers.
This commit is contained in:
@@ -149,10 +149,10 @@ AT_CHECK([cat input.output], [],
|
||||
[[Grammar
|
||||
|
||||
Number, Line, Rule
|
||||
0 2 $axiom -> expr $
|
||||
1 2 @1 -> /* empty */
|
||||
0 5 $axiom -> expr $
|
||||
1 5 @1 -> /* empty */
|
||||
2 2 expr -> 'a' @1 'b'
|
||||
3 15 @2 -> /* empty */
|
||||
3 18 @2 -> /* empty */
|
||||
4 15 expr -> @2 'c'
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ AT_CHECK([sed -n 's/ *$//;/^$/!p' input.output], 0,
|
||||
1 6 CONST_DEC_PART -> CONST_DEC_LIST
|
||||
2 10 CONST_DEC_LIST -> CONST_DEC
|
||||
3 12 CONST_DEC_LIST -> CONST_DEC_LIST CONST_DEC
|
||||
4 15 @1 -> /* empty */
|
||||
4 16 @1 -> /* empty */
|
||||
5 15 CONST_DEC -> @1 undef_id_tok '=' const_id_tok ';'
|
||||
Terminals, with rules where they appear
|
||||
$ (0) 0
|
||||
|
||||
Reference in New Issue
Block a user