summaryrefslogtreecommitdiffstats
path: root/cps.sml
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-05-05 21:12:16 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-05-05 21:12:16 -0700
commit457c482397e2ca745067e5a3ef2c7d71d7daf187 (patch)
treeaef2b8d88421829105a3c6b8887d8ffde39d5e1e /cps.sml
parent048895eb0c85b591b2dd338dd06514bc1b18bacb (diff)
downloadsml-457c482397e2ca745067e5a3ef2c7d71d7daf187.tar.zst
Add tuples.
Diffstat (limited to 'cps.sml')
-rw-r--r--cps.sml4
1 files changed, 4 insertions, 0 deletions
diff --git a/cps.sml b/cps.sml
index cd61a7a..894c57e 100644
--- a/cps.sml
+++ b/cps.sml
@@ -47,6 +47,10 @@ struct
| Syntax.LInt i => cont (Syntax.VInt i)
| Syntax.LString s => cont (Syntax.VString s)
| Syntax.LRecord [] => cont (Syntax.VInt 0)
+ | Syntax.LSelect (i, expr) =>
+ let val temp = Gensym.new ()
+ in toCPS expr (fn x => Syntax.CSelect (i, x, temp, cont (Syntax.VVar temp)))
+ end
| Syntax.LRecord exprs =>
let
fun go [] vars =