Skip to content

Commit

Permalink
update exception format for lr1
Browse files Browse the repository at this point in the history
  • Loading branch information
bastiscode committed Oct 15, 2024
1 parent 8088c01 commit 281bbd9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion text-utils-grammar/src/lr1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,8 @@ impl LR1GrammarParser {
Action::Error => {
let (t_start, t_end) = span;
return Err(format!(
"parse error from position {t_start} for token {t_name} ({la_tidx:?}) with content '{}'",
"parse error at position {t_start} for token {t_name} with content '{}' \
(the input most likely does not follow the grammar)",
String::from_utf8_lossy(&input[t_start..t_end])
)
.into());
Expand Down

0 comments on commit 281bbd9

Please sign in to comment.