Don't infinite loop on bad keys
This commit is contained in:
parent
34aaa5f384
commit
885db13d09
|
@ -220,7 +220,7 @@ impl<'a> Parser<'a> {
|
|||
_ => break,
|
||||
}
|
||||
}
|
||||
None => {}
|
||||
None => break
|
||||
}
|
||||
}
|
||||
Some(ret)
|
||||
|
@ -1135,4 +1135,9 @@ trimmed in raw strings.
|
|||
assert!(table.lookup("f f").is_some());
|
||||
assert!(table.lookup("\"").is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn invalid_bare_numeral() {
|
||||
assert!(Parser::new("4").parse().is_none());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue