comparison src/corify.sml @ 1294:b4480a56cab7

Server-side 'onError'
author Adam Chlipala <adam@chlipala.net>
date Tue, 07 Sep 2010 08:28:07 -0400
parents c316ca3c9ec6
children 6c2e565adca6
comparison
equal deleted inserted replaced
1293:acabf3935060 1294:b4480a56cab7
1081 ([(L'.DTask (corifyExp st e1, corifyExp st e2), loc)], st) 1081 ([(L'.DTask (corifyExp st e1, corifyExp st e2), loc)], st)
1082 1082
1083 | L.DPolicy e1 => 1083 | L.DPolicy e1 =>
1084 ([(L'.DPolicy (corifyExp st e1), loc)], st) 1084 ([(L'.DPolicy (corifyExp st e1), loc)], st)
1085 1085
1086 | L.DOnError (m, ms, x) =>
1087 let
1088 val st = St.lookupStrById st m
1089 val st = foldl St.lookupStrByName st ms
1090 in
1091 case St.lookupValByName st x of
1092 St.ENormal n => ([(L'.DOnError n, loc)], st)
1093 | _ => (ErrorMsg.errorAt loc "Wrong type of identifier for 'onError'";
1094 ([], st))
1095 end
1096
1086 and corifyStr mods ((str, _), st) = 1097 and corifyStr mods ((str, _), st) =
1087 case str of 1098 case str of
1088 L.StrConst ds => 1099 L.StrConst ds =>
1089 let 1100 let
1090 val st = St.enter (st, mods) 1101 val st = St.enter (st, mods)
1139 | L.DView (_, _, n', _, _) => Int.max (n, n') 1150 | L.DView (_, _, n', _, _) => Int.max (n, n')
1140 | L.DDatabase _ => n 1151 | L.DDatabase _ => n
1141 | L.DCookie (_, _, n', _) => Int.max (n, n') 1152 | L.DCookie (_, _, n', _) => Int.max (n, n')
1142 | L.DStyle (_, _, n') => Int.max (n, n') 1153 | L.DStyle (_, _, n') => Int.max (n, n')
1143 | L.DTask _ => n 1154 | L.DTask _ => n
1144 | L.DPolicy _ => n) 1155 | L.DPolicy _ => n
1156 | L.DOnError _ => n)
1145 0 ds 1157 0 ds
1146 1158
1147 and maxNameStr (str, _) = 1159 and maxNameStr (str, _) =
1148 case str of 1160 case str of
1149 L.StrConst ds => maxName ds 1161 L.StrConst ds => maxName ds