# HG changeset patch # User haftmann # Date 1171095967 -3600 # Node ID 41ce4f5c97c9ea8c35b4af29ff348bd14b500e3e # Parent c565f33ec70f8667b2aca8fe0de0d413138609fe added antiquotation for exceptions diff -r c565f33ec70f -r 41ce4f5c97c9 doc-src/IsarImplementation/style.sty --- a/doc-src/IsarImplementation/style.sty Sat Feb 10 09:26:06 2007 +0100 +++ b/doc-src/IsarImplementation/style.sty Sat Feb 10 09:26:07 2007 +0100 @@ -19,6 +19,7 @@ %% index \newcommand{\indexml}[1]{\index{\emph{#1}|bold}} +\newcommand{\indexmlexception}[1]{\index{\emph{#1} (exception)|bold}} \newcommand{\indexmltype}[1]{\index{\emph{#1} (type)|bold}} \newcommand{\indexmlstructure}[1]{\index{\emph{#1} (structure)|bold}} \newcommand{\indexmlfunctor}[1]{\index{\emph{#1} (functor)|bold}} diff -r c565f33ec70f -r 41ce4f5c97c9 doc-src/antiquote_setup.ML --- a/doc-src/antiquote_setup.ML Sat Feb 10 09:26:06 2007 +0100 +++ b/doc-src/antiquote_setup.ML Sat Feb 10 09:26:07 2007 +0100 @@ -16,7 +16,10 @@ fun ml_type (txt1, "") = "val _ = NONE : (" ^ txt1 ^ ") option;" | ml_type (txt1, txt2) = "val _ = [NONE : (" ^ txt1 ^ ") option, NONE : (" ^ txt2 ^ ") option];"; - + +fun ml_exc (txt1, "") = "fn _ => (" ^ txt1 ^ ": exn);" + | ml_exc (txt1, txt2) = "fn _ => (" ^ txt1 ^ ": " ^ txt2 ^ " -> exn);"; + fun ml_structure (txt, _) = "functor DUMMY_FUNCTOR() = struct structure DUMMY = " ^ txt ^ " end;" fun ml_functor _ = "val _ = ();"; (*no check!*) @@ -28,12 +31,15 @@ val txt = if txt2 = "" then txt1 else if kind = "type" then txt1 ^ " = " ^ txt2 - else txt1 ^ ": " ^ txt2; + else if kind = "exception" + then txt1 ^ " of " ^ txt2 + else txt1 ^ ": " ^ txt2; val txt' = if kind = "" then txt else kind ^ " " ^ txt; + val _ = writeln (ml (txt1, txt2)); val _ = ML_Context.use_mltext (ml (txt1, txt2)) false (SOME (Context.Proof ctxt)); in "\\indexml" ^ kind ^ enclose "{" "}" - (translate_string (fn "_" => "-" | ">" => "$>$" | c => c) txt1) ^ + (translate_string (fn "_" => "-" | ">" => "$>$" | "#" => "\\#" | c => c) txt1) ^ ((if ! O.source then str_of_source src else txt') |> (if ! O.quotes then quote else I) |> (if ! O.display then enclose "\\begin{verbatim}\n" "\n\\end{verbatim}" @@ -51,6 +57,7 @@ val _ = O.add_commands [("index_ML", arguments (index_ml "" ml_val)), ("index_ML_type", arguments (index_ml "type" ml_type)), + ("index_ML_exc", arguments (index_ml "exception" ml_exc)), ("index_ML_structure", arguments (index_ml "structure" ml_structure)), ("index_ML_functor", arguments (index_ml "functor" ml_functor)), ("ML_functor", O.args (Scan.lift Args.name) output_verbatim),