aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorJoel Martin <github@martintribe.org>2015-03-07 09:04:07 -0600
committerJoel Martin <github@martintribe.org>2015-03-07 09:04:07 -0600
commit10b07148ba8efec543ded60a4b7916960709ce1e (patch)
tree43c10dbc3c6bd2035c34cabf5aca3aa08e37a2f6 /python
parent64574360c510d644f5b8c175dbe3114f1f2d7b68 (diff)
downloadmal-10b07148ba8efec543ded60a4b7916960709ce1e.tar.gz
mal-10b07148ba8efec543ded60a4b7916960709ce1e.zip
All step0: add test, fix bugs, remove step0 eval.
Diffstat (limited to 'python')
-rw-r--r--python/step0_repl.py8
-rw-r--r--python/step1_read_print.py1
2 files changed, 3 insertions, 6 deletions
diff --git a/python/step0_repl.py b/python/step0_repl.py
index d915989..3e5801b 100644
--- a/python/step0_repl.py
+++ b/python/step0_repl.py
@@ -7,12 +7,8 @@ def READ(str):
# eval
def EVAL(ast, env):
- # try it as an expression then a statement
- try:
- return eval(ast)
- except SyntaxError:
- exec(compile(ast, '', 'single'), globals())
- return None
+ #print("EVAL %s" % printer._pr_str(ast))
+ return ast
# print
def PRINT(exp):
diff --git a/python/step1_read_print.py b/python/step1_read_print.py
index 3c2e4ac..c167e38 100644
--- a/python/step1_read_print.py
+++ b/python/step1_read_print.py
@@ -12,6 +12,7 @@ def EVAL(ast, env):
#print("EVAL %s" % printer._pr_str(ast))
return ast
+# print
def PRINT(exp):
return printer._pr_str(exp)