Browse Source

Another error message cleanup

master
Jacob Alexander 8 years ago
parent
commit
274dd6c17b
1 changed files with 4 additions and 4 deletions
  1. 4
    4
      kll.py

+ 4
- 4
kll.py View File

data = file.read() data = file.read()
try: try:
tokenSequence = tokenize( data ) tokenSequence = tokenize( data )
except LexerError as e:
print ( "{0} Tokenization error in '{1}' - {2}".format( ERROR, filename, e ) )
except LexerError as err:
print ( "{0} Tokenization error in '{1}' - {2}".format( ERROR, filename, err ) )
sys.exit( 1 ) sys.exit( 1 )
#print ( pformat( tokenSequence ) ) # Display tokenization #print ( pformat( tokenSequence ) ) # Display tokenization
try: try:
tree = parse( tokenSequence ) tree = parse( tokenSequence )
except NoParseError as e:
print ( "{0} Parsing error in '{1}' - {2}".format( ERROR, filename, e ) )
except (NoParseError, KeyError) as err:
print ( "{0} Parsing error in '{1}' - {2}".format( ERROR, filename, err ) )
sys.exit( 1 ) sys.exit( 1 )