diff --git a/lark/load_grammar.py b/lark/load_grammar.py index 455116f..5896f9f 100644 --- a/lark/load_grammar.py +++ b/lark/load_grammar.py @@ -599,8 +599,8 @@ class GrammarLoader: tree = self.canonize_tree.transform( self.parser.parse(grammar_text+'\n') ) except UnexpectedCharacters as e: context = e.get_context(grammar_text) - raise GrammarError("Unexpected input %r at line %d column %d in %s" % - (context, e.line, e.column, grammar_name)) + raise GrammarError("Unexpected input at line %d column %d in %s: \n\n%s" % + (e.line, e.column, grammar_name, context)) except UnexpectedToken as e: context = e.get_context(grammar_text) error = e.match_examples(self.parser.parse, {