405 else info.groups.mkString(" (", " ", ")") |
405 else info.groups.mkString(" (", " ", ")") |
406 progress.echo("Session " + name + groups) |
406 progress.echo("Session " + name + groups) |
407 } |
407 } |
408 |
408 |
409 val thy_deps = |
409 val thy_deps = |
410 thy_info.dependencies(inlined_files, |
410 thy_info.dependencies( |
411 info.theories.map(_._2).flatten. |
411 info.theories.map(_._2).flatten. |
412 map(thy => Thy_Load.path_node_name(info.dir + Thy_Load.thy_path(thy)))) |
412 map(thy => Thy_Load.path_node_name(info.dir + Thy_Load.thy_path(thy)))) |
413 |
413 |
414 val loaded_theories = thy_deps.loaded_theories |
414 val loaded_theories = thy_deps.loaded_theories |
415 val syntax = thy_deps.make_syntax |
415 val syntax = thy_deps.syntax |
|
416 |
|
417 val body_files = if (inlined_files) thy_deps.load_files else Nil |
416 |
418 |
417 val all_files = |
419 val all_files = |
418 (thy_deps.deps.map({ case dep => |
420 (thy_deps.deps.map(dep => Path.explode(dep.name.node)) ::: body_files ::: |
419 val thy = Path.explode(dep.name.node) |
421 info.files.map(file => info.dir + file)).map(_.expand) |
420 val files = dep.join_header.files.map(file => |
|
421 Path.explode(dep.name.dir) + Path.explode(file)) |
|
422 thy :: files |
|
423 }).flatten ::: info.files.map(file => info.dir + file)).map(_.expand) |
|
424 |
422 |
425 if (list_files) |
423 if (list_files) |
426 progress.echo(cat_lines(all_files.map(_.implode).sorted.map(" " + _))) |
424 progress.echo(cat_lines(all_files.map(_.implode).sorted.map(" " + _))) |
427 |
425 |
428 val sources = |
426 val sources = |
430 catch { |
428 catch { |
431 case ERROR(msg) => |
429 case ERROR(msg) => |
432 error(msg + "\nThe error(s) above occurred in session " + |
430 error(msg + "\nThe error(s) above occurred in session " + |
433 quote(name) + Position.here(info.pos)) |
431 quote(name) + Position.here(info.pos)) |
434 } |
432 } |
435 val errors = parent_errors ::: thy_deps.deps.map(dep => dep.join_header.errors).flatten |
433 val errors = parent_errors |
436 |
434 |
437 deps + (name -> Session_Content(loaded_theories, syntax, sources, errors)) |
435 deps + (name -> Session_Content(loaded_theories, syntax, sources, errors)) |
438 })) |
436 })) |
439 |
437 |
440 def session_content(inlined_files: Boolean, dirs: List[Path], session: String): Session_Content = |
438 def session_content(inlined_files: Boolean, dirs: List[Path], session: String): Session_Content = |