From 652ca797f5c9de9adc198df0c0e8a706807328a6 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sun, 31 Aug 2008 09:00:28 -0400 Subject: Corify tables --- src/core_util.sml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/core_util.sml') diff --git a/src/core_util.sml b/src/core_util.sml index 3403a9d1..609152ec 100644 --- a/src/core_util.sml +++ b/src/core_util.sml @@ -621,6 +621,10 @@ fun mapfoldB {kind = fk, con = fc, exp = fe, decl = fd, bind} = (DValRec vis', loc)) end | DExport _ => S.return2 dAll + | DTable (x, n, c, s) => + S.map2 (mfc ctx c, + fn c' => + (DTable (x, n, c', s), loc)) and mfvi ctx (x, n, t, e, s) = S.bind2 (mfc ctx t, @@ -703,6 +707,12 @@ fun mapfoldB (all as {bind, ...}) = foldl (fn ((x, n, t, e, s), ctx) => bind (ctx, NamedE (x, n, t, NONE, s))) ctx vis | DExport _ => ctx + | DTable (x, n, c, s) => + let + val t = (CApp ((CFfi ("Basis", "table"), #2 d'), c), #2 d') + in + bind (ctx, NamedE (x, n, t, NONE, s)) + end in S.map2 (mff ctx' ds', fn ds' => @@ -750,7 +760,8 @@ val maxName = foldl (fn ((d, _) : decl, count) => | DDatatype (_, n, _, _) => Int.max (n, count) | DVal (_, n, _, _, _) => Int.max (n, count) | DValRec vis => foldl (fn ((_, n, _, _, _), count) => Int.max (n, count)) count vis - | DExport _ => count) 0 + | DExport _ => count + | DTable (_, n, _, _) => Int.max (n, count)) 0 end -- cgit v1.2.3