]> git.donarmstrong.com Git - kiibohd-kll.git/blobdiff - kll.py
Die gracefully
[kiibohd-kll.git] / kll.py
diff --git a/kll.py b/kll.py
index 57fd37aa37ce39783f7ae4d442601782d009fbdf..401d22e1f5b0de76b39812d3749a1d8538c4ccc6 100755 (executable)
--- a/kll.py
+++ b/kll.py
@@ -552,9 +552,11 @@ def processKLLFile( filename ):
                data = file.read()
                tokenSequence = tokenize( data )
                #print ( pformat( tokenSequence ) ) # Display tokenization
-               tree = parse( tokenSequence )
-
-
+               try:
+                       tree = parse( tokenSequence )
+               except NoParseError as e:
+                       print("Error parsing %s. %s" % (filename, e.msg), file=sys.stderr)
+                       sys.exit(1)
 
 ### Main Entry Point ###