Closed kivikakk closed 7 years ago
Thanks for looking at this! I went ahead and fixed the issue myself --- see 8632645a9fef06bc75bbf8600c42c22e4560e327. The idea here is that lr1_machine
is generic over the type T
of terminals, so we can change its type to a struct that records both the identifier and whether it is a unit-like variant.
That's way better. I didn't even realise it was generic over the terminal until it came to writing 63dbbb5, but by then I was too far into my solution to see how that might make a much better result.
Thank you for the learning experience! 🙇🏼♀️
I don't love this 'solution' at all and feel free to just ditch this, but it's some food for thought, anyway. I couldn't work out a way to include some out-of-band information about the identifier so that we could pick it up in the
to_pat
stage, because all we have there is the table and no way to get back to the specific rule/action, so I just shoved it into the identifier itself.I probably missed something obvious. I'm also a total noob to Rust, so my style may be grade A Awful — any critique is appreciated, and I also understand if you don't have the time for this. :)
Refs #9.