diff options
author | Tom Smeding <tom.smeding@gmail.com> | 2019-11-21 23:23:23 +0100 |
---|---|---|
committer | Tom Smeding <tom.smeding@gmail.com> | 2019-11-21 23:23:23 +0100 |
commit | 206689c943ba93ad48ce2b41166ca1902ed920a9 (patch) | |
tree | 6158a8e74c4b822a87bb104df2946238db039ffb /CompilerMacros.hs | |
parent | 8114c68b9f42a9273109ad95cf1a76544ceb52a1 (diff) |
cons, cond, exit
Diffstat (limited to 'CompilerMacros.hs')
-rw-r--r-- | CompilerMacros.hs | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CompilerMacros.hs b/CompilerMacros.hs index 610e659..ce7974c 100644 --- a/CompilerMacros.hs +++ b/CompilerMacros.hs @@ -37,6 +37,10 @@ process (VList [VName "let", VList args, body]) = error "Invalid 'let' syntax: Invalid variable list (not all pairs)" process (VList (VName "let" : _)) = error "Invalid 'let' syntax: Invalid argument list" +process (VList [VName "cond", defval]) = process defval +process (VList (VName "cond" : cond1 : val1 : rest)) = + process (VList [VName "if", cond1, val1, VList (VName "cond" : rest)]) + process (VList values) = VList (map process values) process (VDefine name body) = VDefine name (process body) |