src/Pure/Tools/thy_deps.ML
changeset 62848 e4140efe699e
parent 60948 b710a5087116
child 65491 7fb81fa1d668
equal deleted inserted replaced
62847:1bd1d8492931 62848:e4140efe699e
    40     let val thy0 = Proof_Context.theory_of ctxt
    40     let val thy0 = Proof_Context.theory_of ctxt
    41     in if Context.subthy (thy, thy0) then thy else raise THEORY ("Bad theory", [thy, thy0]) end);
    41     in if Context.subthy (thy, thy0) then thy else raise THEORY ("Bad theory", [thy, thy0]) end);
    42 
    42 
    43 val thy_deps_cmd = Graph_Display.display_graph oo gen_thy_deps Theory.check;
    43 val thy_deps_cmd = Graph_Display.display_graph oo gen_thy_deps Theory.check;
    44 
    44 
    45 val theory_bounds =
       
    46   Parse.position Parse.theory_xname >> single ||
       
    47   (@{keyword "("} |-- Parse.enum "|" (Parse.position Parse.theory_xname) --| @{keyword ")"});
       
    48 
       
    49 val _ =
       
    50   Outer_Syntax.command @{command_keyword thy_deps} "visualize theory dependencies"
       
    51     (Scan.option theory_bounds -- Scan.option theory_bounds >>
       
    52       (fn args => Toplevel.keep (fn st => thy_deps_cmd (Toplevel.context_of st) args)));
       
    53 
       
    54 end;
    45 end;