diff options
author | 2009-12-25 10:48:02 -0500 | |
---|---|---|
committer | 2009-12-25 10:48:02 -0500 | |
commit | 4300120544123e9dfb262eb8b4e3d0a0f17ff9bc (patch) | |
tree | fc5d02dd23fa570c31c1070e88ffbc372a5a66e3 | |
parent | 0d909d67d931ab05fe4ca3db9f6dc9d13118556e (diff) |
Catch attempts to mention multiple versions of the same rooted module
-rw-r--r-- | src/compiler.sml | 12 |
1 files changed, 11 insertions, 1 deletions
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 |