diff options
author | Akim Demaille <akim.demaille@gmail.com> | 2019-02-03 14:26:37 +0100 |
---|---|---|
committer | Akim Demaille <akim.demaille@gmail.com> | 2019-02-09 08:23:50 +0100 |
commit | 51861998c7fc262bd7a56f111b0bbe6356d87fc6 (patch) | |
tree | 4c970f06498b79ebfd8e7204b615fc9894de7272 /tests/regression.at | |
parent | e346210c038bc5c6ab2aca99e04f8452181406e1 (diff) | |
download | bison-51861998c7fc262bd7a56f111b0bbe6356d87fc6.tar.gz |
report: clean up its format
The format is inconsistent. For instance most sections are
indented (including "Terminals unused in grammar" for instance), but
the sections "Terminals, with rules where they appear" and
"Nonterminals, with rules where they appear" are not. Let's indent
them. Also, these two sections try to wrap the output to avoid lines
too long. Yet we don't do that in the rest of the file, for instance
when listing the lookaheads of an item.
For instance in the case of Bison's parse-gram.output we go from:
Terminals, with rules where they appear
"end of file" (0) 0
error (256) 28 88
"string" <char*> (258) 9 13 16 17 20 23 24 109 116
[...]
Nonterminals, with rules where they appear
$accept (58)
on left: 0
input (59)
on left: 1, on right: 0
prologue_declarations (60)
on left: 2 3, on right: 1 3
prologue_declaration (61)
on left: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24
25 26 27 28 29, on right: 3
[...]
to
Terminals, with rules where they appear
"end of file" (0) 0
error (256) 28 88
"string" <char*> (258) 9 13 16 17 20 23 24 109 116
[...]
Nonterminals, with rules where they appear
$accept (58)
on left: 0
input (59)
on left: 1
on right: 0
prologue_declarations (60)
on left: 2 3
on right: 1 3
prologue_declaration (61)
on left: 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 22 23 24 25 26 27 28 29
on right: 3
[...]
* src/print.c (END_TEST): Remove.
(print_terminal_symbols): Don't try to wrap the output.
(print_nonterminal_symbols): Likewise.
Make two different lines for occurrences on the left, and occurrence
on the rhs of the rules.
Indent by 4 and 8, not 3.
* src/reduce.c (reduce_output): Indent by 4, not 3.
* tests/conflicts.at, tests/existing.at, tests/reduce.at,
* tests/regression.at, tests/report.at:
Adjust.
Diffstat (limited to 'tests/regression.at')
-rw-r--r-- | tests/regression.at | 65 |
1 files changed, 36 insertions, 29 deletions
diff --git a/tests/regression.at b/tests/regression.at index b3173021..c897e708 100644 --- a/tests/regression.at +++ b/tests/regression.at @@ -247,23 +247,26 @@ AT_CHECK([cat input.output], [], Terminals, with rules where they appear -$end (0) 0 -'a' (97) 2 -'b' (98) 2 -'c' (99) 4 -error (256) + $end (0) 0 + 'a' (97) 2 + 'b' (98) 2 + 'c' (99) 4 + error (256) Nonterminals, with rules where they appear -$accept (6) - on left: 0 -expr (7) - on left: 2 4, on right: 0 -$@1 (8) - on left: 1, on right: 2 -$@2 (9) - on left: 3, on right: 4 + $accept (6) + on left: 0 + expr (7) + on left: 2 4 + on right: 0 + $@1 (8) + on left: 1 + on right: 2 + $@2 (9) + on left: 3 + on right: 4 State 0 @@ -554,26 +557,30 @@ AT_CHECK([cat input.output], 0, Terminals, with rules where they appear -$end (0) 0 -';' (59) 5 -'=' (61) 5 -error (256) -undef_id_tok (258) 5 -const_id_tok (259) 5 + $end (0) 0 + ';' (59) 5 + '=' (61) 5 + error (256) + undef_id_tok (258) 5 + const_id_tok (259) 5 Nonterminals, with rules where they appear -$accept (7) - on left: 0 -CONST_DEC_PART (8) - on left: 1, on right: 0 -CONST_DEC_LIST (9) - on left: 2 3, on right: 1 3 -CONST_DEC (10) - on left: 5, on right: 2 3 -$@1 (11) - on left: 4, on right: 5 + $accept (7) + on left: 0 + CONST_DEC_PART (8) + on left: 1 + on right: 0 + CONST_DEC_LIST (9) + on left: 2 3 + on right: 1 3 + CONST_DEC (10) + on left: 5 + on right: 2 3 + $@1 (11) + on left: 4 + on right: 5 State 0 |