From 4300120544123e9dfb262eb8b4e3d0a0f17ff9bc Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Fri, 25 Dec 2009 10:48:02 -0500 Subject: Catch attempts to mention multiple versions of the same rooted module --- src/compiler.sml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/compiler.sml b/src/compiler.sml index 0acd23dc..10fc66f0 100644 --- a/src/compiler.sml +++ b/src/compiler.sml @@ -431,7 +431,9 @@ fun parseUrp' accLibs fname = 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 @@ val parse = { end val defed = ref SS.empty + val fulls = ref SS.empty fun parseOne fname = let @@ -716,6 +719,7 @@ val parse = { 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 @@ val parse = { 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 -- cgit v1.2.3