signature DOCUMENT_ANTIQUOTATION = sig val thy_output_display: bool Config.T val thy_output_cartouche: bool Config.T val thy_output_quotes: bool Config.T val thy_output_margin: int Config.T val thy_output_indent: int Config.T val thy_output_source: bool Config.T val thy_output_source_cartouche: bool Config.T val thy_output_break: bool Config.T val thy_output_modes: string Config.T val trim_blanks: Proof.context -> string -> string val trim_lines: Proof.context -> string -> string val indent_lines: Proof.context -> string -> string val prepare_lines: Proof.context -> string -> string val delimit: Proof.context -> Pretty.T -> Pretty.T val indent: Proof.context -> Pretty.T -> Pretty.T val format: Proof.context -> Pretty.T -> string val output: Proof.context -> Pretty.T -> Output.output val print_antiquotations: bool -> Proof.context -> unit val check: Proof.context -> xstring * Position.T -> string val check_option: Proof.context -> xstring * Position.T -> string val setup: binding -> 'a context_parser ->
({context: Proof.context, source: Token.src, argument: 'a} -> Latex.text) -> theory -> theory val setup_embedded: binding -> 'a context_parser ->
({context: Proof.context, source: Token.src, argument: 'a} -> Latex.text) -> theory -> theory val setup_option: binding -> (string -> Proof.context -> Proof.context) -> theory -> theory val boolean: string -> bool val integer: string -> int val evaluate: (Symbol_Pos.T list -> Latex.text) -> Proof.context ->
Antiquote.text_antiquote -> Latex.text val approx_content: Proof.context -> string -> string end;
fun evaluate eval_text ctxt antiq =
(case antiq of
Antiquote.Text ss => eval_text ss
| Antiquote.Control {name, body, ...} =>
eval ctxt Position.none
([], Token.make_src name (if null body then [] else [Token.read_cartouche body]))
| Antiquote.Antiq antiq => eval ctxt (#1 (#range antiq)) (read_antiq ctxt antiq));
end;
(* approximative content, e.g. for index entries *)
local
val strip_symbols = [Symbol.open_, Symbol.close, "'", "\"", "`"];
fun strip_symbol sym = if member (op =) strip_symbols sym then"" else
(case Symbol.decode sym of
Symbol.Char s => s
| Symbol.UTF8 s => s
| Symbol.Sym s => s
| Symbol.Control s => s
| _ => "");
fun strip_antiq _ (Antiquote.Text body) = map Symbol_Pos.symbol body
| strip_antiq _ (Antiquote.Control {body, ...}) = map Symbol_Pos.symbol body
| strip_antiq ctxt (Antiquote.Antiq antiq) =
read_antiq ctxt antiq |> #2 |> tl
|> maps (Symbol.explode o Token.content_of);
in
fun approx_content ctxt =
Symbol_Pos.explode0
#> trim (Symbol.is_blank o Symbol_Pos.symbol)
#> Antiquote.parse_comments Position.none
#> maps (strip_antiq ctxt)
#> map strip_symbol
#> implode;
fun integer s = let fun int ss =
(case Library.read_int ss of (i, []) => i
| _ => error ("Bad integer value: " ^ Library.quote s)); in (case Symbol.explode s of"-" :: ss => ~ (int ss) | ss => int ss) end;
val _ = Theory.setup
(setup_option \<^binding>\<open>show_types\<close> (Config.put show_types o boolean) #>
setup_option \<^binding>\<open>show_sorts\<close> (Config.put show_sorts o boolean) #>
setup_option \<^binding>\<open>show_structs\<close> (Config.put show_structs o boolean) #>
setup_option \<^binding>\<open>show_question_marks\<close> (Config.put show_question_marks o boolean) #>
setup_option \<^binding>\<open>show_abbrevs\<close> (Config.put show_abbrevs o boolean) #>
setup_option \<^binding>\<open>names_long\<close> (Config.put Name_Space.names_long o boolean) #>
setup_option \<^binding>\<open>names_short\<close> (Config.put Name_Space.names_short o boolean) #>
setup_option \<^binding>\<open>names_unique\<close> (Config.put Name_Space.names_unique o boolean) #>
setup_option \<^binding>\<open>eta_contract\<close> (Config.put Syntax_Trans.eta_contract o boolean) #>
setup_option \<^binding>\<open>display\<close> (Config.put thy_output_display o boolean) #>
setup_option \<^binding>\<open>break\<close> (Config.put thy_output_break o boolean) #>
setup_option \<^binding>\<open>cartouche\<close> (Config.put thy_output_cartouche o boolean) #>
setup_option \<^binding>\<open>quotes\<close> (Config.put thy_output_quotes o boolean) #>
setup_option \<^binding>\<open>mode\<close> (Config.put thy_output_modes) #>
setup_option \<^binding>\<open>margin\<close> (Config.put thy_output_margin o integer) #>
setup_option \<^binding>\<open>indent\<close> (Config.put thy_output_indent o integer) #>
setup_option \<^binding>\<open>source\<close> (Config.put thy_output_source o boolean) #>
setup_option \<^binding>\<open>source_cartouche\<close> (Config.put thy_output_source_cartouche o boolean) #>
setup_option \<^binding>\<open>goals_limit\<close> (Config.put Goal_Display.goals_limit o integer));
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.