summaryrefslogtreecommitdiff
path: root/CompilerMacros.hs
diff options
context:
space:
mode:
Diffstat (limited to 'CompilerMacros.hs')
-rw-r--r--CompilerMacros.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/CompilerMacros.hs b/CompilerMacros.hs
index a2d9600..086ad2e 100644
--- a/CompilerMacros.hs
+++ b/CompilerMacros.hs
@@ -13,6 +13,9 @@ process (VList [VName "define", VName name, VList args, body])
process (VList [VName "define", VName name, value]) = VDefine name (process value)
process (VList (VName "define" : _)) = error "Invalid 'define' syntax"
+process (VList [VName "declare", VName name]) = process (VDeclare name)
+process (VList (VName "declare" : _)) = error "Invalid 'declare' syntax"
+
process (VList [VName "lambda", VList args, body])
| Just names <- mapM fromVName args = process (VLambda names body)
| otherwise = error "Invalid 'lambda' syntax: Invalid argument list"
@@ -44,6 +47,7 @@ process (VList [VName "cond"]) = error "Invalid 'cond' syntax: Even number of ar
process (VList values) = VList (map process values)
+process (VDeclare name) = VDeclare name
process (VDefine name body) = VDefine name (process body)
process (VLambda args body) = VLambda args (process body)
process (VLambdaRec recname args body) = VLambdaRec recname args (process body)