diff -r 46e053eda5dd -r 61dc7d5d150a src/Pure/Thy/thy_load.scala --- a/src/Pure/Thy/thy_load.scala Wed Aug 22 12:47:49 2012 +0200 +++ b/src/Pure/Thy/thy_load.scala Wed Aug 22 15:53:17 2012 +0200 @@ -27,13 +27,6 @@ def append(dir: String, source_path: Path): String = (Path.explode(dir) + source_path).expand.implode - def read_header(name: Document.Node.Name): Thy_Header = - { - val path = Path.explode(name.node) - if (!path.is_file) error("No such file: " + path.toString) - Thy_Header.read(path.file) - } - /* theory files */ @@ -49,8 +42,9 @@ } } - def check_header(name: Document.Node.Name, header: Thy_Header): Document.Node.Header = + def check_thy_text(name: Document.Node.Name, text: CharSequence): Document.Node.Header = { + val header = Thy_Header.read(text) val name1 = header.name val imports = header.imports.map(import_name(name.dir, _)) // FIXME val uses = header.uses.map(p => (append(name.dir, Path.explode(p._1)), p._2)) @@ -62,6 +56,10 @@ } def check_thy(name: Document.Node.Name): Document.Node.Header = - check_header(name, read_header(name)) + { + val path = Path.explode(name.node) + if (!path.is_file) error("No such file: " + path.toString) + check_thy_text(name, File.read(path)) + } }