15 | ml_val (txt1, txt2) = "fn _ => (" ^ txt1 ^ ": " ^ txt2 ^ ");"; |
15 | ml_val (txt1, txt2) = "fn _ => (" ^ txt1 ^ ": " ^ txt2 ^ ");"; |
16 |
16 |
17 fun ml_type (txt1, "") = "val _ = NONE : (" ^ txt1 ^ ") option;" |
17 fun ml_type (txt1, "") = "val _ = NONE : (" ^ txt1 ^ ") option;" |
18 | ml_type (txt1, txt2) = "val _ = [NONE : (" ^ txt1 ^ ") option, NONE : (" ^ txt2 ^ ") option];"; |
18 | ml_type (txt1, txt2) = "val _ = [NONE : (" ^ txt1 ^ ") option, NONE : (" ^ txt2 ^ ") option];"; |
19 |
19 |
20 fun ml_exc (txt1, "") = "fn _ => (" ^ txt1 ^ ": exn);" |
20 fun ml_exn (txt1, "") = "fn _ => (" ^ txt1 ^ ": exn);" |
21 | ml_exc (txt1, txt2) = "fn _ => (" ^ txt1 ^ ": " ^ txt2 ^ " -> exn);"; |
21 | ml_exn (txt1, txt2) = "fn _ => (" ^ txt1 ^ ": " ^ txt2 ^ " -> exn);"; |
22 |
22 |
23 fun ml_structure (txt, _) = "functor DUMMY_FUNCTOR() = struct structure DUMMY = " ^ txt ^ " end;" |
23 fun ml_structure (txt, _) = "functor DUMMY_FUNCTOR() = struct structure DUMMY = " ^ txt ^ " end;" |
24 |
24 |
25 fun ml_functor _ = "val _ = ();"; (*no check!*) |
25 fun ml_functor _ = "val _ = ();"; (*no check!*) |
26 |
26 |
55 in |
55 in |
56 |
56 |
57 val _ = O.add_commands |
57 val _ = O.add_commands |
58 [("index_ML", arguments (index_ml "" ml_val)), |
58 [("index_ML", arguments (index_ml "" ml_val)), |
59 ("index_ML_type", arguments (index_ml "type" ml_type)), |
59 ("index_ML_type", arguments (index_ml "type" ml_type)), |
60 ("index_ML_exc", arguments (index_ml "exception" ml_exc)), |
60 ("index_ML_exn", arguments (index_ml "exception" ml_exn)), |
61 ("index_ML_structure", arguments (index_ml "structure" ml_structure)), |
61 ("index_ML_structure", arguments (index_ml "structure" ml_structure)), |
62 ("index_ML_functor", arguments (index_ml "functor" ml_functor)), |
62 ("index_ML_functor", arguments (index_ml "functor" ml_functor)), |
63 ("ML_functor", O.args (Scan.lift Args.name) output_verbatim), |
63 ("ML_functor", O.args (Scan.lift Args.name) output_verbatim), |
64 ("verbatim", O.args (Scan.lift Args.name) output_verbatim), |
64 ("verbatim", O.args (Scan.lift Args.name) output_verbatim), |
65 ("thy_file", O.args (Scan.lift Args.name) (O.output (K pretty_thy_file)))]; |
65 ("thy_file", O.args (Scan.lift Args.name) (O.output (K pretty_thy_file)))]; |