Add look-ahead to custom syntax parser.

This commit is contained in:
Stephen Chung
2020-12-15 19:23:30 +08:00
parent 17310ef576
commit f8c14ba1c4
4 changed files with 16 additions and 12 deletions

View File

@@ -93,7 +93,7 @@ fn test_custom_syntax_raw() -> Result<(), Box<EvalAltResult>> {
engine.register_custom_syntax_raw(
"hello",
|stream| match stream.len() {
|stream, _| match stream.len() {
0 => unreachable!(),
1 => Ok(Some("$ident$".into())),
2 => match stream[1].as_str() {