Fix inf loop in parser (#4803)
This commit is contained in:
parent
c382fa158d
commit
fd0fbc7934
2 changed files with 12 additions and 0 deletions
|
@ -185,6 +185,8 @@ impl Parser<'_> {
|
|||
if let Some(x) = self.parse_graph_idiom(ctx, &mut res, Dir::Both).await? {
|
||||
return Ok(x);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
t!("..") => {
|
||||
|
|
|
@ -47,6 +47,16 @@ fn glued_identifiers() {
|
|||
assert_eq!(res, expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn less_then_idiom() {
|
||||
let src = r#"
|
||||
if ($param.foo < 2){
|
||||
return 1
|
||||
}
|
||||
"#;
|
||||
test_parse!(parse_query, src).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn escaped_params() {
|
||||
let src = r#"LET $⟨R-_fYU8Wa31kg7tz0JI6Kme⟩ = 5;
|
||||
|
|
Loading…
Reference in a new issue