REPL: catch more

This commit is contained in:
Loic Nageleisen 2014-01-26 13:05:32 +01:00
parent 32978d0273
commit 457e24fb31

View file

@ -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()