Skip to content

Commit

Permalink
Band-Aid: fix one of the left recursion bugs (fixes #1047)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tartasprint committed Oct 18, 2024
1 parent 105e45e commit e264d69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion meta/src/validator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ fn left_recursion<'a, 'i: 'a>(rules: HashMap<String, &'a ParserNode<'i>>) -> Vec
None
}
ParserExpr::Seq(ref lhs, ref rhs) => {
if is_non_failing(&lhs.expr, rules, &mut vec![trace.last().unwrap().clone()]) {
if is_non_failing(&lhs.expr, rules, &mut vec![trace.last().unwrap().clone()]) || is_non_progressing(&lhs.expr, rules, &mut vec![trace.last().unwrap().clone()]){
check_expr(rhs, rules, trace)
} else {
check_expr(lhs, rules, trace)
Expand Down

0 comments on commit e264d69

Please sign in to comment.