src/Pure/PIDE/resources.scala
changeset 64657 6209e0f7a4e8
parent 64656 65c8a7780538
child 64673 b5965890e54d
     1.1 --- a/src/Pure/PIDE/resources.scala	Thu Dec 22 11:20:59 2016 +0100
     1.2 +++ b/src/Pure/PIDE/resources.scala	Thu Dec 22 11:38:16 2016 +0100
     1.3 @@ -53,6 +53,30 @@
     1.4  
     1.5  
     1.6  
     1.7 +  /* source files of Isabelle/ML bootstrap */
     1.8 +
     1.9 +  def source_file(raw_name: String): Option[String] =
    1.10 +  {
    1.11 +    if (Path.is_wellformed(raw_name)) {
    1.12 +      if (Path.is_valid(raw_name)) {
    1.13 +        def check(p: Path): Option[Path] = if (p.is_file) Some(p) else None
    1.14 +
    1.15 +        val path = Path.explode(raw_name)
    1.16 +        val path1 =
    1.17 +          if (path.is_absolute || path.is_current) check(path)
    1.18 +          else {
    1.19 +            check(Path.explode("~~/src/Pure") + path) orElse
    1.20 +              (if (Isabelle_System.getenv("ML_SOURCES") == "") None
    1.21 +               else check(Path.explode("$ML_SOURCES") + path))
    1.22 +          }
    1.23 +        Some(File.platform_path(path1 getOrElse path))
    1.24 +      }
    1.25 +      else None
    1.26 +    }
    1.27 +    else Some(raw_name)
    1.28 +  }
    1.29 +
    1.30 +
    1.31    /* theory files */
    1.32  
    1.33    def loaded_files(syntax: Outer_Syntax, text: String): List[String] =