Skip to content

Commit

Permalink
Warn the user where an incomplete action started, not finished.
Browse files Browse the repository at this point in the history
Previously this warning always said "Incomplete action at <end of
file>". This change now tells you where the incomplete action started,
which is much easier to debug!
  • Loading branch information
ltratt committed May 27, 2024
1 parent 1cbbd2a commit 3fed871
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cfgrammar/src/lib/yacc/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ impl YaccParser {
j += ch.len_utf8();
}
if c > 0 {
Err(self.mk_error(YaccGrammarErrorKind::IncompleteAction, j))
Err(self.mk_error(YaccGrammarErrorKind::IncompleteAction, i))
} else {
debug_assert!(self.lookahead_is("}", j).is_some());
let s = self.src[i + '{'.len_utf8()..j].trim().to_string();
Expand Down

0 comments on commit 3fed871

Please sign in to comment.