You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because the code generation determines that there are two version of p in the second case: one which produces (), and the other that produces no result. In the former case, top will drop the result of p and return its own (), which means across the whole parser p only exists in a result-dropping state.
While this could reasonably be considered a mere "quirk", it might be possible to avoid this by recognising that p has a constant output. In this case, result-demanding locations for p can be translated to p.as(c), and result-dropping locations use p directly. This would eliminate the duplication here. This transformation is done manually above via top, which serves as p.as(()). This may or may not be possible to do...
The text was updated successfully, but these errors were encountered:
j-mie6
added
bug
Something isn't working
low priority
This bug is mainly cosmetic or easy to avoid
quirk
Something that's not quite a bug, but could be improved
and removed
bug
Something isn't working
low priority
This bug is mainly cosmetic or easy to avoid
labels
Jan 3, 2025
Consider the following parser:
If you look at the instructions for
top
, you'll see there are less instructions than there are forp
:vs
This is because the code generation determines that there are two version of
p
in the second case: one which produces()
, and the other that produces no result. In the former case,top
will drop the result ofp
and return its own()
, which means across the whole parserp
only exists in a result-dropping state.While this could reasonably be considered a mere "quirk", it might be possible to avoid this by recognising that
p
has a constant output. In this case, result-demanding locations forp
can be translated top.as(c)
, and result-dropping locations usep
directly. This would eliminate the duplication here. This transformation is done manually above viatop
, which serves asp.as(())
. This may or may not be possible to do...The text was updated successfully, but these errors were encountered: