Open chfont opened 1 year ago
The end_of_input
error you get in the arith <|> app
case isn't caused by the expr_parser
not succeeding, but by succeeding without consuming the whole input with ~consume:All
. (This is the case, because the arith
parser succeeds by consuming only the first x
in the input, resulting in <|>
succeeding. I.e. the order matters, because both parser succeed.)
Hello,
While working on parser, I've run into a scenario where
<|>
results in an error when I runa <|> b
, but gives a result when runningb <|> a
, ifb
recognizes the string given.Below is a small example to reproduce this:
With the above,
parse "x x"
fails, but when flippingarith <|> app
toapp <|> arith
,parse "x x"
succeeds, rather than both working as expected.