Don't silently swallow lexer errors.

This commit is contained in:
Dan Gohman
2017-10-03 10:05:46 -07:00
parent d857aacec3
commit d585f09423

View File

@@ -807,6 +807,11 @@ impl<'a> Parser<'a> {
while self.token().is_some() {
list.push(self.parse_function(unique_isa)?);
}
if let Some(err) = self.lex_error {
return match err {
lexer::Error::InvalidChar => err!(self.loc, "invalid character"),
};
}
Ok(list)
}