summaryrefslogtreecommitdiff
path: root/src/jscomp.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-05-30 13:29:00 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-05-30 13:29:00 -0400
commit54276f5a38163eb7997c574810faed0cc6dea35c (patch)
treeff01535ec8b49034e5cb39f0be1e36261bea9d8b /src/jscomp.sml
parent581a2290590268039cacfbe0762b343f710c3116 (diff)
Substring functions; fix a nasty MonoReduce pattern match substitution bug
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 #"\"" => "\\\""
| #"\\" => "\\\\"