mirror of
https://github.com/lloeki/wasp.git
synced 2025-12-06 10:44:39 +01:00
REPL: catch more
This commit is contained in:
parent
32978d0273
commit
457e24fb31
1 changed files with 6 additions and 2 deletions
8
repl.py
8
repl.py
|
|
@ -36,10 +36,14 @@ if __name__ == "__main__":
|
||||||
try:
|
try:
|
||||||
ptree = wasp.parser.parse(line)
|
ptree = wasp.parser.parse(line)
|
||||||
except ValueError, e:
|
except ValueError, e:
|
||||||
print e.message
|
print "Parse error:", e.message
|
||||||
continue
|
continue
|
||||||
|
|
||||||
print " ^ %s" % ptree
|
print " ^ %s" % ptree
|
||||||
ast = ptree.ast()
|
try:
|
||||||
|
ast = ptree.ast()
|
||||||
|
except ValueError, e:
|
||||||
|
print "AST error:", e.message
|
||||||
|
continue
|
||||||
print " ‡ %r" % ast
|
print " ‡ %r" % ast
|
||||||
#ast.eval()
|
#ast.eval()
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue