src/Pure/Isar/isar_syn.ML
changeset 14223 0ee05eef881b
parent 13802 ebed89f74e59
child 14508 859b11514537
equal deleted inserted replaced
14222:1e61f23fd359 14223:0ee05eef881b
   129 
   129 
   130 val constsP =
   130 val constsP =
   131   OuterSyntax.command "consts" "declare constants" K.thy_decl
   131   OuterSyntax.command "consts" "declare constants" K.thy_decl
   132     (Scan.repeat1 P.const >> (Toplevel.theory o Theory.add_consts));
   132     (Scan.repeat1 P.const >> (Toplevel.theory o Theory.add_consts));
   133 
   133 
       
   134 val opt_overloaded =
       
   135   Scan.optional (P.$$$ "(" |-- P.!!! ((P.$$$ "overloaded" >> K true) --| P.$$$ ")")) false;
       
   136 
       
   137 val finalconstsP =
       
   138   OuterSyntax.command "finalconsts" "declare constants as final" K.thy_decl
       
   139     (opt_overloaded -- Scan.repeat1 P.term >> (uncurry (Toplevel.theory oo Theory.add_finals)));
   134 
   140 
   135 val mode_spec =
   141 val mode_spec =
   136   (P.$$$ "output" >> K ("", false)) || P.name -- Scan.optional (P.$$$ "output" >> K false) true;
   142   (P.$$$ "output" >> K ("", false)) || P.name -- Scan.optional (P.$$$ "output" >> K false) true;
   137 
   143 
   138 val opt_mode = Scan.optional (P.$$$ "(" |-- P.!!! (mode_spec --| P.$$$ ")")) ("", true);
   144 val opt_mode = Scan.optional (P.$$$ "(" |-- P.!!! (mode_spec --| P.$$$ ")")) ("", true);
   164 (* axioms and definitions *)
   170 (* axioms and definitions *)
   165 
   171 
   166 val axiomsP =
   172 val axiomsP =
   167   OuterSyntax.command "axioms" "state arbitrary propositions (axiomatic!)" K.thy_decl
   173   OuterSyntax.command "axioms" "state arbitrary propositions (axiomatic!)" K.thy_decl
   168     (Scan.repeat1 P.spec_name >> (Toplevel.theory o IsarThy.add_axioms));
   174     (Scan.repeat1 P.spec_name >> (Toplevel.theory o IsarThy.add_axioms));
   169 
       
   170 val opt_overloaded =
       
   171   Scan.optional (P.$$$ "(" |-- P.!!! ((P.$$$ "overloaded" >> K true) --| P.$$$ ")")) false;
       
   172 
   175 
   173 val defsP =
   176 val defsP =
   174   OuterSyntax.command "defs" "define constants" K.thy_decl
   177   OuterSyntax.command "defs" "define constants" K.thy_decl
   175     (opt_overloaded -- Scan.repeat1 P.spec_name >> (Toplevel.theory o IsarThy.add_defs));
   178     (opt_overloaded -- Scan.repeat1 P.spec_name >> (Toplevel.theory o IsarThy.add_defs));
   176 
   179 
   738   (*markup commands*)
   741   (*markup commands*)
   739   headerP, chapterP, sectionP, subsectionP, subsubsectionP, textP,
   742   headerP, chapterP, sectionP, subsectionP, subsubsectionP, textP,
   740   text_rawP, sectP, subsectP, subsubsectP, txtP, txt_rawP,
   743   text_rawP, sectP, subsectP, subsubsectP, txtP, txt_rawP,
   741   (*theory sections*)
   744   (*theory sections*)
   742   classesP, classrelP, defaultsortP, typedeclP, typeabbrP, nontermP,
   745   classesP, classrelP, defaultsortP, typedeclP, typeabbrP, nontermP,
   743   aritiesP, judgmentP, constsP, syntaxP, translationsP, axiomsP,
   746   aritiesP, judgmentP, constsP, finalconstsP, syntaxP, translationsP,
   744   defsP, constdefsP, theoremsP, lemmasP, declareP, globalP, localP,
   747   axiomsP, defsP, constdefsP, theoremsP, lemmasP, declareP, globalP,
   745   hideP, useP, mlP, ml_commandP, ml_setupP, setupP, method_setupP,
   748   localP, hideP, useP, mlP, ml_commandP, ml_setupP, setupP,
   746   parse_ast_translationP, parse_translationP, print_translationP,
   749   method_setupP, parse_ast_translationP, parse_translationP,
   747   typed_print_translationP, print_ast_translationP,
   750   print_translationP, typed_print_translationP,
   748   token_translationP, oracleP, localeP,
   751   print_ast_translationP, token_translationP, oracleP, localeP,
   749   (*proof commands*)
   752   (*proof commands*)
   750   theoremP, lemmaP, corollaryP, showP, haveP, thusP, henceP, fixP,
   753   theoremP, lemmaP, corollaryP, showP, haveP, thusP, henceP, fixP,
   751   assumeP, presumeP, defP, obtainP, letP, caseP, thenP, fromP, withP,
   754   assumeP, presumeP, defP, obtainP, letP, caseP, thenP, fromP, withP,
   752   noteP, usingP, beginP, endP, nextP, qedP, terminal_proofP,
   755   noteP, usingP, beginP, endP, nextP, qedP, terminal_proofP,
   753   default_proofP, immediate_proofP, done_proofP, skip_proofP,
   756   default_proofP, immediate_proofP, done_proofP, skip_proofP,