Mercurial > lcfOS
diff python/baselex.py @ 357:818be710e13d
Added acceptance function to burg
author | Windel Bouwman |
---|---|
date | Fri, 14 Mar 2014 15:14:29 +0100 |
parents | 8d07a4254f04 |
children | 0c44e494ef58 |
line wrap: on
line diff
--- a/python/baselex.py Fri Mar 14 13:02:16 2014 +0100 +++ b/python/baselex.py Fri Mar 14 15:14:29 2014 +0100 @@ -1,6 +1,6 @@ import re -from ppci import Token +from ppci import Token, CompilerError def tokenize(tok_spec, txt): tok_re = '|'.join('(?P<{}>{})'.format(pair[0], pair[1]) for pair in tok_spec) @@ -21,4 +21,4 @@ pos = mo.end() mo = gettok(line, pos) if len(line) != pos: - raise ParserException('Lex fault at {}'.format(line[pos:])) + raise CompilerError('Lex fault at {}'.format(line[pos:]))