From 86cef7e654c284c44bafb4ef57bd934dbb7b82a2 Mon Sep 17 00:00:00 2001 From: Erez Shinan Date: Sun, 5 Aug 2018 15:36:06 +0300 Subject: [PATCH] Fix for issue #188 --- lark/load_grammar.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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, {