summaryrefslogtreecommitdiff
path: root/tests/sets.at
diff options
context:
space:
mode:
authorAkim Demaille <akim.demaille@gmail.com>2019-01-29 18:53:35 +0100
committerAkim Demaille <akim.demaille@gmail.com>2019-01-30 07:08:09 +0100
commit781d2b02dee9486350e55405f0c8fab1d954ff44 (patch)
treed01d7fa03e8397108eaf1c31bc02d407bf392858 /tests/sets.at
parent8b5fc2143f9a640e7e5fee33b0d3d56a28f11a3e (diff)
downloadbison-781d2b02dee9486350e55405f0c8fab1d954ff44.tar.gz
gram: detect and report (in debug traces) useless chain rules
A rule is a useless chain iff it's a chain (aka unit, or injection) rule (i.e., the RHS has length 1), and it's useless (it has no used defined semantic action). * src/gram.h, src/gram.c (rule_useless_chain_p): New. (grammar_dump): Report useless chain rules. * tests/sets.at: Check the traces.
Diffstat (limited to 'tests/sets.at')
-rw-r--r--tests/sets.at12
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/sets.at b/tests/sets.at
index 01339c22..c9feb9d8 100644
--- a/tests/sets.at
+++ b/tests/sets.at
@@ -337,12 +337,12 @@ Rules
-----
Num (Num, Prec, Assoc, Useful, UselessChain, Ritem Range) Lhs -> Rhs (Ritem range)
- 0 ( 0, 0, 0, t, 0- 1) 6 -> 7 0
- 1 ( 1, 0, 0, t, 3- 5) 7 -> 7 3 8
- 2 ( 2, 0, 0, t, 7- 7) 7 -> 8
- 3 ( 3, 0, 0, t, 9-11) 8 -> 8 4 9
- 4 ( 4, 0, 0, t, 13-13) 8 -> 9
- 5 ( 5, 0, 0, t, 15-15) 9 -> 5
+ 0 ( 0, 0, 0, t, f, 0- 1) 6 -> 7 0
+ 1 ( 1, 0, 0, t, f, 3- 5) 7 -> 7 3 8
+ 2 ( 2, 0, 0, t, t, 7- 7) 7 -> 8
+ 3 ( 3, 0, 0, t, f, 9-11) 8 -> 8 4 9
+ 4 ( 4, 0, 0, t, t, 13-13) 8 -> 9
+ 5 ( 5, 0, 0, t, t, 15-15) 9 -> 5
Rules interpreted