# HG changeset patch # User Adam Chlipala # Date 1261756082 18000 # Node ID 6f4b05fc43617649cd4b1e63f1b3a48e003f6462 # Parent 6e5463a53c3c25b82e1f30f3e8f9147c3d47f020 Catch attempts to mention multiple versions of the same rooted module diff -r 6e5463a53c3c -r 6f4b05fc4361 src/compiler.sml --- a/src/compiler.sml Fri Dec 25 09:24:21 2009 -0500 +++ b/src/compiler.sml Fri Dec 25 10:48:02 2009 -0500 @@ -431,7 +431,9 @@ rewrites = #rewrites old @ #rewrites new, filterUrl = #filterUrl old @ #filterUrl new, filterMime = #filterMime old @ #filterMime new, - sources = #sources new @ #sources old, + sources = #sources new + @ List.filter (fn s => List.all (fn s' => s' <> s) (#sources new)) + (#sources old), protocol = mergeO #2 (#protocol old, #protocol new), dbms = mergeO #2 (#dbms old, #dbms new) } @@ -681,6 +683,7 @@ end val defed = ref SS.empty + val fulls = ref SS.empty fun parseOne fname = let @@ -716,6 +719,7 @@ andalso Char.isAlpha (String.sub (s, 0))) pieces val pieces = map capitalize pieces + val full = String.concatWith "." pieces fun makeD prefix pieces = case pieces of @@ -738,6 +742,12 @@ loc) end in + if SS.member (!fulls, full) then + ErrorMsg.error ("Rooted module " ^ full ^ " has multiple versions.") + else + (); + fulls := SS.add (!fulls, full); + makeD "" pieces end in