Context: https://discord.com/channels/944706562948231188/944706563401211946/1226641177554456626 – thanks @notYuriy for bringing this up!
Due to the state merging performed by the LALR algorithm, the expected symbols list may contain errors. To present an accurate list to the user, we can attempt reducing each symbol and include only the symbols where the reduction succeeded.
This resembles GNU Bison's LAC (Lookahead Correction) feature, which I would like to eventually add to Farkle as well. As described in Bison's documentation, LAC's exploratory reductions have no memory overhead, and I am not concerned with any time overhead, since the work scoped in this issue will happen only in error cases.
There will be some complications with default reductions, once that gets added in Farkle, but I believe it will be manageable.
One final question is whether it should be enabled by default and if so, if we want to add an option to switch to the previous behavior. At the moment I am inclined to say yes and no respectively.
Context: https://discord.com/channels/944706562948231188/944706563401211946/1226641177554456626 – thanks @notYuriy for bringing this up!
Due to the state merging performed by the LALR algorithm, the expected symbols list may contain errors. To present an accurate list to the user, we can attempt reducing each symbol and include only the symbols where the reduction succeeded.
This resembles GNU Bison's LAC (Lookahead Correction) feature, which I would like to eventually add to Farkle as well. As described in Bison's documentation, LAC's exploratory reductions have no memory overhead, and I am not concerned with any time overhead, since the work scoped in this issue will happen only in error cases.
There will be some complications with default reductions, once that gets added in Farkle, but I believe it will be manageable.
One final question is whether it should be enabled by default and if so, if we want to add an option to switch to the previous behavior. At the moment I am inclined to say yes and no respectively.