summaryrefslogtreecommitdiff
path: root/src/mono_util.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 13:47:20 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-04-16 13:47:20 -0400
commit6ada30a32e69cf288e50ee0ca2963e031c588ee0 (patch)
treed0d08dc15edc8e7dc1f916a592160f8c9e561bd2 /src/mono_util.sml
parente65c023309173aa291952143537f174888a8de86 (diff)
Some client-side error handling
Diffstat (limited to 'src/mono_util.sml')
-rw-r--r--src/mono_util.sml28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/mono_util.sml b/src/mono_util.sml
index 238f65d3..c7309df4 100644
--- a/src/mono_util.sml
+++ b/src/mono_util.sml
@@ -325,15 +325,19 @@ fun mapfoldB {typ = fc, exp = fe, bind} =
fn t' =>
(EUnurlify (e', t'), loc)))
| EJavaScript (m, e, NONE) =>
- S.map2 (mfe ctx e,
- fn e' =>
- (EJavaScript (m, e', NONE), loc))
+ S.bind2 (mfmode ctx m,
+ fn m' =>
+ S.map2 (mfe ctx e,
+ fn e' =>
+ (EJavaScript (m', e', NONE), loc)))
| EJavaScript (m, e, SOME e2) =>
- S.bind2 (mfe ctx e,
- fn e' =>
- S.map2 (mfe ctx e2,
- fn e2' =>
- (EJavaScript (m, e', SOME e2'), loc)))
+ S.bind2 (mfmode ctx m,
+ fn m' =>
+ S.bind2 (mfe ctx e,
+ fn e' =>
+ S.map2 (mfe ctx e2,
+ fn e2' =>
+ (EJavaScript (m, e', SOME e2'), loc))))
| ESignalReturn e =>
S.map2 (mfe ctx e,
@@ -372,6 +376,14 @@ fun mapfoldB {typ = fc, exp = fe, bind} =
S.map2 (mfe ctx ek,
fn ek' =>
(ESleep (s', ek'), loc)))
+
+ and mfmode ctx mode =
+ case mode of
+ Attribute => S.return2 mode
+ | Script => S.return2 mode
+ | Source t =>
+ S.map2 (mft t,
+ fn t' => Source t')
in
mfe
end