summaryrefslogtreecommitdiffstats
path: root/syntax.sml
diff options
context:
space:
mode:
authorRose Hogenson <rosehogenson@posteo.net>2024-05-17 16:16:49 -0700
committerRose Hogenson <rosehogenson@posteo.net>2024-05-17 16:16:49 -0700
commit92baa4f6bf99efe229abf2ab895cec8fd7a8936d (patch)
treea98c55ed4e8399a31911f0dc944b60894249ea26 /syntax.sml
parentc39c43e144733973ebf9cd6842df75b5a5ceee0b (diff)
downloadsml-92baa4f6bf99efe229abf2ab895cec8fd7a8936d.tar.zst
Fix case on datatype.
Diffstat (limited to 'syntax.sml')
-rw-r--r--syntax.sml4
1 files changed, 2 insertions, 2 deletions
diff --git a/syntax.sml b/syntax.sml
index 767851d..aa94b09 100644
--- a/syntax.sml
+++ b/syntax.sml
@@ -57,7 +57,7 @@ struct
| LRecord of lexp list
| LSelect of int * lexp
| LPrim of primop
- | LSwitch of lexp * (int * lexp) list * lexp
+ | LSwitch of lexp * (int * lexp) list * lexp option
(* CPS *)
datatype value =
@@ -173,7 +173,7 @@ struct
| LRecord l => "LRecord " ^ listToString lexpToString l
| LSelect (i, r) => "LSelect (" ^ Int.toString i ^ ", " ^ lexpToString r ^ ")"
| LPrim p => "LPrim " ^ primopToString p
- | LSwitch (e, arms, otherwise) => "LSwitch (" ^ lexpToString e ^ ", " ^ listToString (fn (x, e) => "(" ^ Int.toString x ^ ", " ^ lexpToString e ^ ")") arms ^ ", " ^ lexpToString otherwise ^ ")"
+ | LSwitch (e, arms, otherwise) => "LSwitch (" ^ lexpToString e ^ ", " ^ listToString (fn (x, e) => "(" ^ Int.toString x ^ ", " ^ lexpToString e ^ ")") arms ^ ", " ^ optionToString lexpToString otherwise ^ ")"
fun valueToString (x : value) : string =
case x of