X-Git-Url: https://git.hcoop.net/hcoop/domtool2.git/blobdiff_plain/525183a2c03bec98373a081d5989eee1431f9e6d..0e0442b0650ceb74175905578054db8877b1bbbd:/src/order.sml diff --git a/src/order.sml b/src/order.sml index 14bd01e..117a0ea 100644 --- a/src/order.sml +++ b/src/order.sml @@ -1,5 +1,6 @@ (* HCoop Domtool (http://hcoop.sourceforge.net/) * Copyright (c) 2006, Adam Chlipala + * Copyright (c) 2014 Clinton Ebadi * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -134,6 +135,11 @@ fun declNeeded G (d, _, _) = NONE => expNeeded G e | SOME t => unionCTE ((typNeeded G t, SS.empty), expNeeded G e)) + | DEnv (name, to, e) => (Env.bindInitialDynEnvVal G (name, dt, (Ast.ESkip, ErrorMsg.dummyLoc)), + case to of + NONE => expNeeded G e + | SOME t => unionCTE ((typNeeded G t, SS.empty), + expNeeded G e)) | DContext name => (Env.bindContext G name, empty) fun fileSig (_, ds, eo) = @@ -300,24 +306,24 @@ fun order basisOpt fnames = order basisOpt (List.filter (fn fname => not (SS.member (!naughtyFiles, fname))) fnames) end -fun order basisOpt fnames = - let - val (providers, fnames) = order basisOpt fnames - - val (hasLib, fnames) = foldl (fn (fname, (hasLib, fnames)) => - if OS.Path.file fname = "lib.dtl" then - (SOME fname, fnames) - else - (hasLib, fname :: fnames)) - (NONE, []) fnames - - val fnames = rev fnames - val fnames = case hasLib of - NONE => fnames - | SOME hasLib => hasLib :: fnames - in - (providers, fnames) - end +val order = fn basisOpt => fn fnames => + let + val (providers, fnames) = order basisOpt fnames + + val (hasLib, fnames) = foldl (fn (fname, (hasLib, fnames)) => + if OS.Path.file fname = "lib.dtl" then + (SOME fname, fnames) + else + (hasLib, fname :: fnames)) + (NONE, []) fnames + + val fnames = rev fnames + val fnames = case hasLib of + NONE => fnames + | SOME hasLib => hasLib :: fnames + in + (providers, fnames) + end type providers = {provideC : string SM.map, provideT : string SM.map,