make ParserError a struct with an enum kind field
This commit is contained in:
@@ -1952,7 +1952,7 @@ impl MachineState {
|
||||
) -> Result<Stream, ParserError> {
|
||||
match stream.peek_char() {
|
||||
None => Ok(stream), // empty stream is handled gracefully by Lexer::eof
|
||||
Some(Err(e)) => Err(ParserError::IO(e)),
|
||||
Some(Err(e)) => Err(ParserError::from(e)),
|
||||
Some(Ok(c)) => {
|
||||
if c == '\u{feff}' {
|
||||
// skip UTF-8 BOM
|
||||
|
||||
@@ -1016,7 +1016,7 @@ impl MachineState {
|
||||
self.unify_fixnum(n, nx);
|
||||
}
|
||||
_ => {
|
||||
let err = ParserError::ParseBigInt(parser.lexer.location.clone());
|
||||
let err = parser.lexer.parse_big_int_error();
|
||||
let err = self.syntax_error(err);
|
||||
|
||||
return Err(self.error_form(err, stub_gen()));
|
||||
@@ -1026,7 +1026,7 @@ impl MachineState {
|
||||
return Ok(());
|
||||
}
|
||||
Ok(c) => {
|
||||
let err = ParserError::UnexpectedChar(c, lexer.location);
|
||||
let err = lexer.unexpected_char(c);
|
||||
let err = self.syntax_error(err);
|
||||
|
||||
return Err(self.error_form(err, stub_gen()));
|
||||
|
||||
Reference in New Issue
Block a user