src/Pure/pure_syn.ML
author wenzelm
Wed, 30 Dec 2015 21:57:52 +0100
changeset 62002 f1599e98c4d0
parent 61464 d35ff80f27fb
child 62453 b93cc7d73431
permissions -rw-r--r--
isabelle update_cartouches -c -t;

(*  Title:      Pure/pure_syn.ML
    Author:     Makarius

Outer syntax for bootstrapping: commands that are accessible outside a
regular theory context.
*)

signature PURE_SYN =
sig
  val bootstrap_thy: theory
end;

structure Pure_Syn: PURE_SYN =
struct

val _ =
  Outer_Syntax.command ("header", @{here}) "theory header"
    (Parse.document_source >> Thy_Output.old_header_command);

val _ =
  Outer_Syntax.command ("chapter", @{here}) "chapter heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("section", @{here}) "section heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("subsection", @{here}) "subsection heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("subsubsection", @{here}) "subsubsection heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("paragraph", @{here}) "paragraph heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("subparagraph", @{here}) "subparagraph heading"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = false});

val _ =
  Outer_Syntax.command ("text", @{here}) "formal comment (primary style)"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true});

val _ =
  Outer_Syntax.command ("txt", @{here}) "formal comment (secondary style)"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true});

val _ =
  Outer_Syntax.command ("text_raw", @{here}) "LaTeX text (without surrounding environment)"
    (Parse.opt_target -- Parse.document_source >> Thy_Output.document_command {markdown = true});

val _ =
  Outer_Syntax.command ("theory", @{here}) "begin theory"
    (Thy_Header.args >>
      (fn _ => Toplevel.init_theory (fn () => error "Missing theory initialization")));


val bootstrap_thy = ML_Context.the_global_context ();

val _ = Theory.setup (Config.put_global Outer_Syntax.bootstrap false);

end;