summaryrefslogtreecommitdiff
path: root/AST.hs
diff options
context:
space:
mode:
authortomsmeding <tom.smeding@gmail.com>2019-11-26 13:46:29 +0100
committertomsmeding <tom.smeding@gmail.com>2019-11-26 13:46:29 +0100
commit5f86130930c19277fbf0ef3433cc43ab93aacf3f (patch)
tree22c11dc678a6262c44a34630076824f941193043 /AST.hs
parent9de16e245424e62318cdce4909e33c256f585cb6 (diff)
declare defines for top-level mutual recursion
Diffstat (limited to 'AST.hs')
-rw-r--r--AST.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/AST.hs b/AST.hs
index 5fd2518..2953227 100644
--- a/AST.hs
+++ b/AST.hs
@@ -13,6 +13,7 @@ data Value
| VString String
| VName Name
| VQuoted Value
+ | VDeclare Name
| VDefine Name Value
| VLambda [Name] Value
| VLambdaRec Name [Name] Value
@@ -31,6 +32,7 @@ instance Show Value where
show (VString s) = show s
show (VName n) = n
show (VQuoted e) = '\'' : show e
+ show (VDeclare n) = "(declare " ++ n ++ ")"
show (VDefine n v) = "(define " ++ n ++ " " ++ show v ++ ")"
show (VLambda as v) = "(lambda (" ++ intercalate " " as ++ ") " ++ show v ++ ")"
show (VLambdaRec rn as v) = "(lambdarec " ++ rn ++ " (" ++ intercalate " " as ++ ") " ++ show v ++ ")"