src/Pure/Thy/thy_output.ML
changeset 68182 fa3cf61121ee
parent 68178 e3dd94d04eee
child 68194 796f2585c7ee
equal deleted inserted replaced
68181:34592bf86424 68182:fa3cf61121ee
     8 sig
     8 sig
     9   val output_document: Proof.context -> {markdown: bool} -> Input.source -> Latex.text list
     9   val output_document: Proof.context -> {markdown: bool} -> Input.source -> Latex.text list
    10   val check_comments: Proof.context -> Symbol_Pos.T list -> unit
    10   val check_comments: Proof.context -> Symbol_Pos.T list -> unit
    11   val output_token: Proof.context -> Token.T -> Latex.text list
    11   val output_token: Proof.context -> Token.T -> Latex.text list
    12   val output_source: Proof.context -> string -> Latex.text list
    12   val output_source: Proof.context -> string -> Latex.text list
    13   type segment = {span: Command_Span.span, tr: Toplevel.transition, result_state: Toplevel.state}
    13   type segment = {span: Command_Span.span, command: Toplevel.transition, state: Toplevel.state}
    14   val present_thy: theory -> segment list -> Latex.text list
    14   val present_thy: theory -> segment list -> Latex.text list
    15   val pretty_term: Proof.context -> term -> Pretty.T
    15   val pretty_term: Proof.context -> term -> Pretty.T
    16   val pretty_thm: Proof.context -> thm -> Pretty.T
    16   val pretty_thm: Proof.context -> thm -> Pretty.T
    17   val lines: Latex.text list -> Latex.text list
    17   val lines: Latex.text list -> Latex.text list
    18   val items: Latex.text list -> Latex.text list
    18   val items: Latex.text list -> Latex.text list
   336   Scan.option ((Parse.$$$ "(" -- improper -- Parse.$$$ "in") |--
   336   Scan.option ((Parse.$$$ "(" -- improper -- Parse.$$$ "in") |--
   337     Parse.!!! (improper |-- Parse.name --| (improper -- Parse.$$$ ")")));
   337     Parse.!!! (improper |-- Parse.name --| (improper -- Parse.$$$ ")")));
   338 
   338 
   339 in
   339 in
   340 
   340 
   341 type segment = {span: Command_Span.span, tr: Toplevel.transition, result_state: Toplevel.state};
   341 type segment = {span: Command_Span.span, command: Toplevel.transition, state: Toplevel.state};
   342 
   342 
   343 fun present_thy thy (segments: segment list) =
   343 fun present_thy thy (segments: segment list) =
   344   let
   344   let
   345     val keywords = Thy_Header.get_keywords thy;
   345     val keywords = Thy_Header.get_keywords thy;
   346 
   346 
   413       |> Source.source' 0 Token.stopper (Scan.error (Scan.bulk tokens >> flat))
   413       |> Source.source' 0 Token.stopper (Scan.error (Scan.bulk tokens >> flat))
   414       |> Source.source stopper (Scan.error (Scan.bulk span))
   414       |> Source.source stopper (Scan.error (Scan.bulk span))
   415       |> Source.exhaust;
   415       |> Source.exhaust;
   416 
   416 
   417     val command_results =
   417     val command_results =
   418       segments |> map_filter (fn {tr, result_state, ...} =>
   418       segments |> map_filter (fn {command, state, ...} =>
   419         if Toplevel.is_ignored tr then NONE else SOME (tr, result_state));
   419         if Toplevel.is_ignored command then NONE else SOME (command, state));
   420 
   420 
   421 
   421 
   422     (* present commands *)
   422     (* present commands *)
   423 
   423 
   424     val document_tags = space_explode "," (Options.default_string \<^system_option>\<open>document_tags\<close>);
   424     val document_tags = space_explode "," (Options.default_string \<^system_option>\<open>document_tags\<close>);