Skip to content

Commit

Permalink
Update lalrpop
Browse files Browse the repository at this point in the history
  • Loading branch information
elkowar committed Feb 17, 2024
1 parent 4385782 commit efea885
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
21 changes: 14 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ jaq-parse = "1.0.2"
jaq-std = {version = "1.2.1", features = ["bincode"]}
jaq-interpret = "1.2.1"
jaq-syn = "1.1.0"
lalrpop = "0.19.5"
lalrpop-util = "0.19.5"
lalrpop = { version = "0.20.0", features = ["unicode"] }
lalrpop-util = { version = "0.20.0", features = ["unicode"] }
libc = "0.2"
log = "0.4"
maplit = "1"
Expand Down
2 changes: 1 addition & 1 deletion crates/simplexpr/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ impl Spanned for ParseError {
fn span(&self) -> Span {
match &self.source {
lalrpop_util::ParseError::InvalidToken { location } => Span(*location, *location, self.file_id),
lalrpop_util::ParseError::UnrecognizedEOF { location, expected: _ } => Span(*location, *location, self.file_id),
lalrpop_util::ParseError::UnrecognizedEof { location, expected: _ } => Span(*location, *location, self.file_id),
lalrpop_util::ParseError::UnrecognizedToken { token, expected: _ } => Span(token.0, token.2, self.file_id),
lalrpop_util::ParseError::ExtraToken { token } => Span(token.0, token.2, self.file_id),
lalrpop_util::ParseError::User { error: LexicalError(span) } => *span,
Expand Down
2 changes: 1 addition & 1 deletion crates/yuck/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub fn get_parse_error_span<T, E: Spanned>(file_id: usize, err: &lalrpop_util::P
use lalrpop_util::ParseError::*;
match err {
InvalidToken { location } => Span(*location, *location, file_id),
UnrecognizedEOF { location, .. } => Span(*location, *location, file_id),
UnrecognizedEof { location, .. } => Span(*location, *location, file_id),
UnrecognizedToken { token, .. } => Span(token.0, token.2, file_id),
ExtraToken { token } => Span(token.0, token.2, file_id),
User { error } => error.span(),
Expand Down
2 changes: 1 addition & 1 deletion crates/yuck/src/format_diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ pub fn lalrpop_error_to_diagnostic<T: std::fmt::Display, E: Spanned + ToDiagnost
use lalrpop_util::ParseError::*;
match error {
InvalidToken { location } => gen_diagnostic!("Invalid token", Span::point(*location, file_id)),
UnrecognizedEOF { location, expected: _ } => gen_diagnostic! {
UnrecognizedEof { location, expected: _ } => gen_diagnostic! {
msg = "Input ended unexpectedly. Check if you have any unclosed delimiters",
label = Span::point(*location, file_id),
},
Expand Down

0 comments on commit efea885

Please sign in to comment.