summaryrefslogtreecommitdiff
path: root/src/corify.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2010-09-07 08:28:07 -0400
committerGravatar Adam Chlipala <adam@chlipala.net>2010-09-07 08:28:07 -0400
commit5545969f485ef2fb944db8e7b0237acbabeb8d4c (patch)
treeab4a39c6f88b3e8719c9e41dfcd7f147126ef790 /src/corify.sml
parentee175ea1f9151123e47d9cbfee0c6329b2e5d934 (diff)
Server-side 'onError'
Diffstat (limited to 'src/corify.sml')
-rw-r--r--src/corify.sml14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/corify.sml b/src/corify.sml
index 88473455..27e6c4c7 100644
--- a/src/corify.sml
+++ b/src/corify.sml
@@ -1083,6 +1083,17 @@ fun corifyDecl mods (all as (d, loc : EM.span), st) =
| L.DPolicy e1 =>
([(L'.DPolicy (corifyExp st e1), loc)], st)
+ | L.DOnError (m, ms, x) =>
+ let
+ val st = St.lookupStrById st m
+ val st = foldl St.lookupStrByName st ms
+ in
+ case St.lookupValByName st x of
+ St.ENormal n => ([(L'.DOnError n, loc)], st)
+ | _ => (ErrorMsg.errorAt loc "Wrong type of identifier for 'onError'";
+ ([], st))
+ end
+
and corifyStr mods ((str, _), st) =
case str of
L.StrConst ds =>
@@ -1141,7 +1152,8 @@ fun maxName ds = foldl (fn ((d, _), n) =>
| L.DCookie (_, _, n', _) => Int.max (n, n')
| L.DStyle (_, _, n') => Int.max (n, n')
| L.DTask _ => n
- | L.DPolicy _ => n)
+ | L.DPolicy _ => n
+ | L.DOnError _ => n)
0 ds
and maxNameStr (str, _) =