equal
deleted
inserted
replaced
213 error("Cannot load theory " + quote(name.theory)) |
213 error("Cannot load theory " + quote(name.theory)) |
214 else error ("Cannot load theory file " + path) |
214 else error ("Cannot load theory file " + path) |
215 } |
215 } |
216 |
216 |
217 def check_thy(node_name: Document.Node.Name, reader: Reader[Char], |
217 def check_thy(node_name: Document.Node.Name, reader: Reader[Char], |
218 start: Token.Pos = Token.Pos.command, 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, start = start, strict = strict) |
222 val header = Thy_Header.read(node_name, reader, command = command, strict = strict) |
223 |
223 |
224 val imports_pos = |
224 val imports_pos = |
225 header.imports_pos.map({ case (s, pos) => |
225 header.imports_pos.map({ case (s, pos) => |
226 val name = import_name(node_name, s) |
226 val name = import_name(node_name, s) |
227 if (Sessions.exclude_theory(name.theory_base_name)) |
227 if (Sessions.exclude_theory(name.theory_base_name)) |
333 if (initiators.contains(name)) error(Dependencies.cycle_msg(initiators)) |
333 if (initiators.contains(name)) error(Dependencies.cycle_msg(initiators)) |
334 |
334 |
335 progress.expose_interrupt() |
335 progress.expose_interrupt() |
336 val header = |
336 val header = |
337 try { |
337 try { |
338 val start = Token.Pos.file(name.node) |
338 with_thy_reader(name, check_thy(name, _, command = false)).cat_errors(message) |
339 with_thy_reader(name, check_thy(name, _, start = start)).cat_errors(message) |
|
340 } |
339 } |
341 catch { case ERROR(msg) => cat_error(msg, message) } |
340 catch { case ERROR(msg) => cat_error(msg, message) } |
342 val entry = Document.Node.Entry(name, header) |
341 val entry = Document.Node.Entry(name, header) |
343 dependencies1.require_thys(adjunct, header.imports_pos, |
342 dependencies1.require_thys(adjunct, header.imports_pos, |
344 initiators = name :: initiators, progress = progress).cons(entry) |
343 initiators = name :: initiators, progress = progress).cons(entry) |