Unused states
Open
- Dominant language
- Haskell
- Stars
- 322
- Forks
- 86
- PR merge metrics
- No merged PRs in 30d
Description
With the grammar file below, and running with `-i`, happy produces two unused states (1 and 2). I don't know enough about how happy parsers run to know if these slow the parser down, but it seems these states can be trimmed. Initially discovered by @sdepew97.
```
%expect 0
%name parse
%tokentype { Token }
%error { (error . show) }
%token
NUMBER { NUMBER $$ }
'+' { PLUS }
'*' { TIMES }
'(' { LPAREN }
')' { RPAREN }
%%
sum : sum '+' prod { () }
| prod { () }
prod : prod '*' factor { () }
| factor { () }
factor : '(' sum ')' { () }
| NUMBER { () }
Contributor guide
Assessment
This issue has not been assessed yet.