Description
I've been running across what I think is the same bug several times in the last couple of months while working on a pretty big grammar. Here are some more extreme things I've witnessed that seem to indicate the code generated is incorrect:
- moving a production (for example to the top of the file) changes the behaviour of the generated code
- the presence or absence of a production (that is used nowhere!) changes the behaviour of the generated code
I've made a branch here which is as reduced an example as I've managed to get. There is one test suite included which has exactly one test case. Right now, I think the code generated by Happy (1.19.5 and HEAD) is incorrect (the test should pass). However, commenting out the pat_slice
production (which is used nowhere) makes the test pass again. In fact, as I've tried to reduce this grammar over the past weeks, I'm now finding it difficult to comment out anything without the test passing again.
I realize this is a huge test case, but I am at a complete loss at what to do to reduce the grammar since doing so seems to remove the bug.