comparison src/corify.sml @ 461:5c9606deacb6

Cookies through shake2
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 10:48:02 -0500
parents 1a4fa157fedd
children 40c737913075
comparison
equal deleted inserted replaced
460:d34834af4512 461:5c9606deacb6
979 ([(L'.DSequence (x, n, s), loc)], st) 979 ([(L'.DSequence (x, n, s), loc)], st)
980 end 980 end
981 981
982 | L.DDatabase s => ([(L'.DDatabase s, loc)], st) 982 | L.DDatabase s => ([(L'.DDatabase s, loc)], st)
983 983
984 | L.DCookie (_, x, n, c) =>
985 let
986 val (st, n) = St.bindVal st x n
987 val s = doRestify (mods, x)
988 in
989 ([(L'.DCookie (x, n, corifyCon st c, s), loc)], st)
990 end
991
984 and corifyStr mods ((str, _), st) = 992 and corifyStr mods ((str, _), st) =
985 case str of 993 case str of
986 L.StrConst ds => 994 L.StrConst ds =>
987 let 995 let
988 val st = St.enter (st, mods) 996 val st = St.enter (st, mods)
1032 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str)) 1040 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str))
1033 | L.DFfiStr (_, n', _) => Int.max (n, n') 1041 | L.DFfiStr (_, n', _) => Int.max (n, n')
1034 | L.DExport _ => n 1042 | L.DExport _ => n
1035 | L.DTable (_, _, n', _) => Int.max (n, n') 1043 | L.DTable (_, _, n', _) => Int.max (n, n')
1036 | L.DSequence (_, _, n') => Int.max (n, n') 1044 | L.DSequence (_, _, n') => Int.max (n, n')
1037 | L.DDatabase _ => n) 1045 | L.DDatabase _ => n
1046 | L.DCookie (_, _, n', _) => Int.max (n, n'))
1038 0 ds 1047 0 ds
1039 1048
1040 and maxNameStr (str, _) = 1049 and maxNameStr (str, _) =
1041 case str of 1050 case str of
1042 L.StrConst ds => maxName ds 1051 L.StrConst ds => maxName ds