218 command: Boolean = true, strict: Boolean = true): Document.Node.Header = |
218 command: Boolean = true, strict: Boolean = true): Document.Node.Header = |
219 { |
219 { |
220 if (node_name.is_theory && reader.source.length > 0) { |
220 if (node_name.is_theory && reader.source.length > 0) { |
221 try { |
221 try { |
222 val header = Thy_Header.read(node_name, reader, command = command, strict = strict) |
222 val header = Thy_Header.read(node_name, reader, command = command, strict = strict) |
223 |
223 val imports = |
224 val imports_pos = |
224 header.imports.map({ case (s, pos) => |
225 header.imports_pos.map({ case (s, pos) => |
|
226 val name = import_name(node_name, s) |
225 val name = import_name(node_name, s) |
227 if (Sessions.exclude_theory(name.theory_base_name)) |
226 if (Sessions.exclude_theory(name.theory_base_name)) |
228 error("Bad theory name " + quote(name.theory_base_name) + Position.here(pos)) |
227 error("Bad theory name " + quote(name.theory_base_name) + Position.here(pos)) |
229 (name, pos) |
228 (name, pos) |
230 }) |
229 }) |
231 Document.Node.Header(imports_pos, header.keywords, header.abbrevs) |
230 Document.Node.Header(imports, header.keywords, header.abbrevs) |
232 } |
231 } |
233 catch { case exn: Throwable => Document.Node.bad_header(Exn.message(exn)) } |
232 catch { case exn: Throwable => Document.Node.bad_header(Exn.message(exn)) } |
234 } |
233 } |
235 else Document.Node.no_header |
234 else Document.Node.no_header |
236 } |
235 } |