Skip to content

Commit e2bd541

Browse files
authored
Merge pull request #1510 from sanxiyn/update-lalrpop
Update lalrpop to 0.17
2 parents ef25264 + 97069c8 commit e2bd541

File tree

3 files changed

+41
-34
lines changed

3 files changed

+41
-34
lines changed

Cargo.lock

+31-19
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parser/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ license = "MIT"
99
edition = "2018"
1010

1111
[build-dependencies]
12-
lalrpop="0.16.3"
12+
lalrpop="0.17"
1313

1414
[dependencies]
15-
lalrpop-util="0.16.3"
15+
lalrpop-util="0.17"
1616
log="0.4.1"
1717
regex = "1"
1818
num-bigint = "0.2"

parser/src/error.rs

+8-13
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,14 @@ impl From<LalrpopError<Location, Tok, LexicalError>> for ParseError {
143143
error: ParseErrorType::Lexical(error.error),
144144
location: error.location,
145145
},
146-
LalrpopError::UnrecognizedToken { token, expected } => {
147-
match token {
148-
Some(tok) => ParseError {
149-
error: ParseErrorType::UnrecognizedToken(tok.1, expected),
150-
location: tok.0,
151-
},
152-
// EOF was observed when it was unexpected
153-
None => ParseError {
154-
error: ParseErrorType::EOF,
155-
location: Default::default(),
156-
},
157-
}
158-
}
146+
LalrpopError::UnrecognizedToken { token, expected } => ParseError {
147+
error: ParseErrorType::UnrecognizedToken(token.1, expected),
148+
location: token.0,
149+
},
150+
LalrpopError::UnrecognizedEOF { location, .. } => ParseError {
151+
error: ParseErrorType::EOF,
152+
location,
153+
},
159154
}
160155
}
161156
}

0 commit comments

Comments
 (0)