summaryrefslogtreecommitdiff
path: root/src/compiler.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-12-25 10:48:02 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-12-25 10:48:02 -0500
commit4300120544123e9dfb262eb8b4e3d0a0f17ff9bc (patch)
treefc5d02dd23fa570c31c1070e88ffbc372a5a66e3 /src/compiler.sml
parent0d909d67d931ab05fe4ca3db9f6dc9d13118556e (diff)
Catch attempts to mention multiple versions of the same rooted module
Diffstat (limited to 'src/compiler.sml')
-rw-r--r--src/compiler.sml12
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