Mercurial > urweb
comparison src/corify.sml @ 271:42dfb0d61cf0
'database' declaration threaded through compiler
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 02 Sep 2008 10:51:41 -0400 |
parents | 326fb4686f60 |
children | 4260ad920c36 |
comparison
equal
deleted
inserted
replaced
270:b9b02613c0c2 | 271:42dfb0d61cf0 |
---|---|
861 val s = x | 861 val s = x |
862 in | 862 in |
863 ([(L'.DTable (x, n, corifyCon st c, s), loc)], st) | 863 ([(L'.DTable (x, n, corifyCon st c, s), loc)], st) |
864 end | 864 end |
865 | 865 |
866 | L.DDatabase s => ([(L'.DDatabase s, loc)], st) | |
867 | |
866 and corifyStr ((str, _), st) = | 868 and corifyStr ((str, _), st) = |
867 case str of | 869 case str of |
868 L.StrConst ds => | 870 L.StrConst ds => |
869 let | 871 let |
870 val st = St.enter st | 872 val st = St.enter st |
911 | L.DValRec vis => foldl (fn ((_, n', _, _), n) => Int.max (n, n)) n vis | 913 | L.DValRec vis => foldl (fn ((_, n', _, _), n) => Int.max (n, n)) n vis |
912 | L.DSgn (_, n', _) => Int.max (n, n') | 914 | L.DSgn (_, n', _) => Int.max (n, n') |
913 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str)) | 915 | L.DStr (_, n', _, str) => Int.max (n, Int.max (n', maxNameStr str)) |
914 | L.DFfiStr (_, n', _) => Int.max (n, n') | 916 | L.DFfiStr (_, n', _) => Int.max (n, n') |
915 | L.DExport _ => n | 917 | L.DExport _ => n |
916 | L.DTable (_, _, n', _) => Int.max (n, n')) | 918 | L.DTable (_, _, n', _) => Int.max (n, n') |
919 | L.DDatabase _ => n) | |
917 0 ds | 920 0 ds |
918 | 921 |
919 and maxNameStr (str, _) = | 922 and maxNameStr (str, _) = |
920 case str of | 923 case str of |
921 L.StrConst ds => maxName ds | 924 L.StrConst ds => maxName ds |