summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
Diffstat (limited to 'src/jscomp.sml')
-rw-r--r--src/jscomp.sml21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/jscomp.sml b/src/jscomp.sml
index 3edb670f..e162aa7f 100644
--- a/src/jscomp.sml
+++ b/src/jscomp.sml
@@ -625,16 +625,17 @@ fun process file =
str ":",
succ,
str ")"]
- | PSome (t, p) => strcat (str ("(d" ^ Int.toString depth ^ "?")
- :: (if isNullable t then
- [str ("d" ^ Int.toString depth
- ^ "=d" ^ Int.toString depth ^ ".v")]
- else
- [])
- @ [jsPat depth inner p succ fail,
- str ":",
- fail,
- str ")"])
+ | PSome (t, p) => strcat [str ("(d" ^ Int.toString depth ^ "?(d" ^ Int.toString (depth+1)
+ ^ "=d" ^ Int.toString depth
+ ^ (if isNullable t then
+ ".v"
+ else
+ "")
+ ^ ","),
+ jsPat (depth+1) inner p succ fail,
+ str "):",
+ fail,
+ str ")"]
val jsifyString = String.translate (fn #"\"" => "\\\""
| #"\\" => "\\\\"