equal
deleted
inserted
replaced
46 val provide_parse_file: (theory -> Token.file * theory) parser |
46 val provide_parse_file: (theory -> Token.file * theory) parser |
47 val loaded_files_current: theory -> bool |
47 val loaded_files_current: theory -> bool |
48 val check_path: Proof.context -> Path.T option -> Input.source -> Path.T |
48 val check_path: Proof.context -> Path.T option -> Input.source -> Path.T |
49 val check_file: Proof.context -> Path.T option -> Input.source -> Path.T |
49 val check_file: Proof.context -> Path.T option -> Input.source -> Path.T |
50 val check_dir: Proof.context -> Path.T option -> Input.source -> Path.T |
50 val check_dir: Proof.context -> Path.T option -> Input.source -> Path.T |
|
51 val check_session_dir: Proof.context -> Path.T option -> Input.source -> Path.T |
51 end; |
52 end; |
52 |
53 |
53 structure Resources: RESOURCES = |
54 structure Resources: RESOURCES = |
54 struct |
55 struct |
55 |
56 |
385 |
386 |
386 val check_path = formal_check I; |
387 val check_path = formal_check I; |
387 val check_file = formal_check File.check_file; |
388 val check_file = formal_check File.check_file; |
388 val check_dir = formal_check File.check_dir; |
389 val check_dir = formal_check File.check_dir; |
389 |
390 |
|
391 fun check_session_dir ctxt opt_dir s = |
|
392 let |
|
393 val dir = Path.expand (check_dir ctxt opt_dir s); |
|
394 val ok = |
|
395 File.is_file (dir + Path.explode("ROOT")) orelse |
|
396 File.is_file (dir + Path.explode("ROOTS")); |
|
397 in |
|
398 if ok then dir |
|
399 else |
|
400 error ("Bad session root directory (missing ROOT or ROOTS): " ^ |
|
401 Path.print dir ^ Position.here (Input.pos_of s)) |
|
402 end; |
|
403 |
390 |
404 |
391 (* antiquotations *) |
405 (* antiquotations *) |
392 |
406 |
393 local |
407 local |
394 |
408 |