comparison src/corify.sml @ 246:3aa010e97db9

Explify tables
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 08:46:22 -0400
parents 766b5475477f
children 5c50b17f5e4a
comparison
equal deleted inserted replaced
245:1e24a3e6d614 246:3aa010e97db9
804 (ds, st) 804 (ds, st)
805 end 805 end
806 end 806 end
807 | _ => raise Fail "Non-const signature for 'export'") 807 | _ => raise Fail "Non-const signature for 'export'")
808 808
809 | L.DTable _ => raise Fail "Corify DTable"
810
809 and corifyStr ((str, _), st) = 811 and corifyStr ((str, _), st) =
810 case str of 812 case str of
811 L.StrConst ds => 813 L.StrConst ds =>
812 let 814 let
813 val st = St.enter st 815 val st = St.enter st
853 | L.DVal (_, n', _, _) => Int.max (n, n') 855 | L.DVal (_, n', _, _) => Int.max (n, n')
854 | L.DValRec vis => foldl (fn ((_, n', _, _), n) => Int.max (n, n)) n vis 856 | L.DValRec vis => foldl (fn ((_, n', _, _), n) => Int.max (n, n)) n vis
855 | L.DSgn (_, n', _) => Int.max (n, n') 857 | L.DSgn (_, n', _) => Int.max (n, n')
856 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str)) 858 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str))
857 | L.DFfiStr (_, n', _) => Int.max (n, n') 859 | L.DFfiStr (_, n', _) => Int.max (n, n')
858 | L.DExport _ => n) 860 | L.DExport _ => n
861 | L.DTable (_, _, n', _) => Int.max (n, n'))
859 0 ds 862 0 ds
860 863
861 and maxNameStr (str, _) = 864 and maxNameStr (str, _) =
862 case str of 865 case str of
863 L.StrConst ds => maxName ds 866 L.StrConst ds => maxName ds