Replies: 1 comment 1 reply
-
|
Okay so I was able to get it to unblock by doing let operation = number.foldl(op.then(number).repeated(), |lhs, (op, rhs)| {
Expression::Operation(Box::new(lhs), op, Box::new(rhs))
});which probably means that a repeated fold inside a recursive parser, on itself is not supported? The problem that I have is that my arithmetic expressions are performed between two expressions themselves, and folding over the expression itself seems to be locking things up. pub enum Expression {
...
Arithmetic(Box<Expression>, ArithmeticOp, Box<Expression>),
...
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been fighting this back and forth on my CEL-parser so here's a minimal reproducible example. I'm trying to parse the string "2+2" but the parser blocks indefinitely. This seems like undesirable behavior. Is this a "me" problem or a bug?
Beta Was this translation helpful? Give feedback.
All reactions