Admin/isatest/annomaly.ML
author gagern
Tue, 20 Mar 2007 21:21:38 +0100
changeset 22489 52a5277d0489
parent 22488 415098eece94
child 23207 769f7762f531
permissions -rw-r--r--
Better documentation path rewriting for src dir, used in tarball build.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
22488
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     1
use "ML-Systems/smlnj.ML";                                      
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     2
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     3
local
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     4
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     5
  val smlnj_use_text = use_text
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     6
22489
52a5277d0489 Better documentation path rewriting for src dir, used in tarball build.
gagern
parents: 22488
diff changeset
     7
  fun strip ([], "src" :: name, _) = name
22488
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
     8
    | strip (["Distribution"], name, _) = name
22489
52a5277d0489 Better documentation path rewriting for src dir, used in tarball build.
gagern
parents: 22488
diff changeset
     9
    | strip ([], name, _) = name
22488
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    10
    | strip (h1 :: t1, h2 :: t2, def) =
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    11
      if h1 = h2 then strip (t1, t2, def) else def
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    12
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    13
  fun rewrite (NONE, name) = "use_text" :: name
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    14
    | rewrite (SOME home, name) =
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    15
      strip (#arcs (OS.Path.fromString home), name, "use_text" :: name)
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    16
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    17
in
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    18
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    19
  fun use_text name p v t = 
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    20
      let val name = case name of "" => "unnamed" | name => name
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    21
	  val arcs = rewrite (OS.Process.getEnv "ISABELLE_HOME",
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    22
			      #arcs (OS.Path.fromString name))
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    23
	  val _    = AnnoMaLy.nameNextStream ("isabelle" :: arcs)
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    24
      in  smlnj_use_text name p v t
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    25
      end
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    26
415098eece94 Changed AnnoMaLy build process from CVS to tarball sources.
gagern
parents:
diff changeset
    27
end;