From ff44279401d71c061f2dc315a381ce2aeeb33a61 Mon Sep 17 00:00:00 2001 From: Akim Demaille Date: Sat, 29 Dec 2001 14:17:18 +0000 Subject: [PATCH] * src/reader.c (readgram): Bind the initial rule's lineno to that of the first rule. * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts): (Solved SR Conflicts): Adjust rule 0's line number. --- ChangeLog | 8 ++++++++ src/reader.c | 4 +++- tests/regression.at | 6 +++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index df65ef2f..be33f467 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2001-12-29 Akim Demaille + + * src/reader.c (readgram): Bind the initial rule's lineno to that + of the first rule. + * tests/regression.at (Rule Line Numbers, Unresolved SR Conflicts): + (Solved SR Conflicts): Adjust rule 0's line number. + + 2001-12-29 Akim Demaille Fix the `GAWK Grammar' failure. diff --git a/src/reader.c b/src/reader.c index 5ee5093d..fcfb2c94 100644 --- a/src/reader.c +++ b/src/reader.c @@ -1451,10 +1451,12 @@ readgram (void) t = lex (); } - /* Insert the initial rule: + /* Insert the initial rule, which line is that of the first rule + (not that of the start symbol): axiom: %start EOF. */ p = symbol_list_new (axiom); + p->line = grammar->line; p->next = symbol_list_new (startval); p->next->next = symbol_list_new (eoftoken); p->next->next->next = symbol_list_new (NULL); diff --git a/tests/regression.at b/tests/regression.at index f6d8f102..78e607b6 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -67,7 +67,7 @@ AT_CHECK([cat input.output], [], Grammar Number, Line, Rule - 0 4 $axiom -> exp $ + 0 3 $axiom -> exp $ 1 3 exp -> exp OP exp 2 3 exp -> NUM @@ -171,7 +171,7 @@ AT_CHECK([cat input.output], [], Grammar Number, Line, Rule - 0 5 $axiom -> exp $ + 0 4 $axiom -> exp $ 1 4 exp -> exp OP exp 2 4 exp -> NUM @@ -296,7 +296,7 @@ AT_CHECK([cat input.output], [], [[Grammar Number, Line, Rule - 0 28 $axiom -> expr $ + 0 2 $axiom -> expr $ 1 2 @1 -> /* empty */ 2 2 expr -> 'a' @1 'b' 3 15 @2 -> /* empty */ -- 2.45.2