mirror of
https://github.com/fluencelabs/lalrpop
synced 2025-03-16 17:00:53 +00:00
Ignore the possible expected token when we find an unrecognized token
This will at least print an error message with the location, rather than panicking, which is a lot more user-friendly :)
This commit is contained in:
parent
92055a1e2c
commit
b50124ea54
@ -209,7 +209,7 @@ fn parse_and_normalize_grammar(session: &Session, file_text: &FileText) -> io::R
|
||||
}
|
||||
|
||||
Err(ParseError::UnrecognizedToken { token: Some((lo, _, hi)), expected }) => {
|
||||
assert!(expected.is_empty()); // didn't implement this yet :)
|
||||
let _ = expected; // didn't implement this yet :)
|
||||
let text = &file_text.text()[lo..hi];
|
||||
report_error(&file_text,
|
||||
pt::Span(lo, hi),
|
||||
|
Loading…
x
Reference in New Issue
Block a user