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:
Nick Fitzgerald 2017-07-02 09:55:04 -07:00
parent 92055a1e2c
commit b50124ea54

View File

@ -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),