Cleanup. Improvements to lexer pattern decorator
This commit is contained in:
@@ -86,11 +86,12 @@ class CalcParser(Parser):
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
lexer = CalcLexer()
|
||||
parser = CalcParser()
|
||||
while True:
|
||||
try:
|
||||
s = input('calc > ')
|
||||
text = input('calc > ')
|
||||
except EOFError:
|
||||
break
|
||||
if s:
|
||||
parser.parse(CalcLexer(s))
|
||||
if text:
|
||||
parser.parse(lexer.tokenize(text))
|
||||
|
Reference in New Issue
Block a user