From 3fed871535ed3991358c76db2c2edc41add38c07 Mon Sep 17 00:00:00 2001 From: Laurence Tratt Date: Mon, 27 May 2024 12:19:44 +0100 Subject: [PATCH] Warn the user where an incomplete action started, not finished. Previously this warning always said "Incomplete action at ". This change now tells you where the incomplete action started, which is much easier to debug! --- cfgrammar/src/lib/yacc/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cfgrammar/src/lib/yacc/parser.rs b/cfgrammar/src/lib/yacc/parser.rs index 31410da95..9f02aacc5 100644 --- a/cfgrammar/src/lib/yacc/parser.rs +++ b/cfgrammar/src/lib/yacc/parser.rs @@ -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();