Replies: 1 comment 1 reply
-
|
It works if you inline it into one rule: #[cache_left_rec]
pub rule expression() -> TestExpression =
callee:expression() lparen() arg:(expression() ** ",") rparen() {
TestExpression::FunctionCall { callee: Box::new(callee), arguments: arg }
}
/ identifier()I think the issue is the mutual recursion with Here, that injected failure of |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm having some issues using the
#[cache_left_rec]attribute.Here's my code:
When I try to match the string
abc()with the rulefunction_callit works fine, returningOk(FunctionCall { callee: Identifier("abc"), arguments: [] }).But when I try to match the same string with the
expressionrule it doesn't work.Here's the trace:
It looks as if it just discards the possibility of the
expressionbeing afunction_callat the very beginning and just matchesabcas anidentifier, leaving()which then causes the error.I would really appreciate some help, as I have banged my head against this for like 2 days.
Beta Was this translation helpful? Give feedback.
All reactions