380 yield ((name, options), known.theories(name.theory).header.imports) |
380 yield ((name, options), known.theories(name.theory).header.imports) |
381 |
381 |
382 val dir_errors = |
382 val dir_errors = |
383 { |
383 { |
384 val ok = (for { (dir, _) <- info.dirs } yield dir.canonical_file).toSet |
384 val ok = (for { (dir, _) <- info.dirs } yield dir.canonical_file).toSet |
385 (for { |
385 val bad = |
|
386 (for { |
386 ((name, _), _) <- used_theories.iterator |
387 ((name, _), _) <- used_theories.iterator |
387 if imports_base.theory_qualifier(name) == session_name |
388 if imports_base.theory_qualifier(name) == session_name |
388 val path = name.master_dir_path |
389 val path = name.master_dir_path |
389 if !ok(path.canonical_file) |
390 if !ok(path.canonical_file) |
390 } yield { |
391 path1 = File.relative_path(info.dir.canonical, path).getOrElse(path) |
391 val path1 = File.relative_path(info.dir.canonical, path).getOrElse(path) |
392 } yield (path1, name)).toList |
392 "Implicit use of directory " + path1 + " for theory " + quote(name.toString) |
393 val bad_dirs = (for { (path1, _) <- bad } yield path1.toString).toSet.toList.sorted |
393 } |
394 |
394 ).toList |
395 val errs1 = |
|
396 for { (path1, name) <- bad } |
|
397 yield "Implicit use of directory " + path1 + " for theory " + quote(name.toString) |
|
398 val errs2 = |
|
399 if (bad_dirs.isEmpty) Nil |
|
400 else List("Implicit use of session directories: " + commas(bad_dirs)) |
|
401 errs1 ::: errs2 |
395 } |
402 } |
396 |
403 |
397 val sources_errors = |
404 val sources_errors = |
398 for (p <- session_files if !p.is_file) yield "No such file: " + p |
405 for (p <- session_files if !p.is_file) yield "No such file: " + p |
399 |
406 |