src/Pure/Thy/thy_output.ML
changeset 48927 ef462b5558eb
parent 48918 6e5fd4585512
child 48992 0518bf89c777
equal deleted inserted replaced
48926:8d7778a19857 48927:ef462b5558eb
   530   let val Type (name, _) = Proof_Context.read_type_name_proper ctxt false s
   530   let val Type (name, _) = Proof_Context.read_type_name_proper ctxt false s
   531   in Pretty.str (Proof_Context.extern_type ctxt name) end;
   531   in Pretty.str (Proof_Context.extern_type ctxt name) end;
   532 
   532 
   533 fun pretty_prf full ctxt = Proof_Syntax.pretty_proof_of ctxt full;
   533 fun pretty_prf full ctxt = Proof_Syntax.pretty_proof_of ctxt full;
   534 
   534 
   535 fun pretty_theory ctxt name =
   535 fun pretty_theory ctxt (name, pos) =
   536   (Theory.requires (Proof_Context.theory_of ctxt) name "presentation"; Pretty.str name);
   536   (case find_first (fn thy => Context.theory_name thy = name)
       
   537       (Theory.nodes_of (Proof_Context.theory_of ctxt)) of
       
   538     NONE => error ("No ancestor theory " ^ quote name ^ Position.str_of pos)
       
   539   | SOME thy => (Position.report pos (Theory.get_markup thy); Pretty.str name));
   537 
   540 
   538 
   541 
   539 (* default output *)
   542 (* default output *)
   540 
   543 
   541 val str_of_source = space_implode " " o map Token.unparse o #2 o #1 o Args.dest_src;
   544 val str_of_source = space_implode " " o map Token.unparse o #2 o #1 o Args.dest_src;
   589     basic_entity (Binding.name "class") (Scan.lift Args.name_source) pretty_class #>
   592     basic_entity (Binding.name "class") (Scan.lift Args.name_source) pretty_class #>
   590     basic_entity (Binding.name "type") (Scan.lift Args.name) pretty_type #>
   593     basic_entity (Binding.name "type") (Scan.lift Args.name) pretty_type #>
   591     basic_entity (Binding.name "text") (Scan.lift Args.name) pretty_text #>
   594     basic_entity (Binding.name "text") (Scan.lift Args.name) pretty_text #>
   592     basic_entities (Binding.name "prf") Attrib.thms (pretty_prf false) #>
   595     basic_entities (Binding.name "prf") Attrib.thms (pretty_prf false) #>
   593     basic_entities (Binding.name "full_prf") Attrib.thms (pretty_prf true) #>
   596     basic_entities (Binding.name "full_prf") Attrib.thms (pretty_prf true) #>
   594     basic_entity (Binding.name "theory") (Scan.lift Args.name) pretty_theory #>
   597     basic_entity (Binding.name "theory") (Scan.lift (Parse.position Args.name)) pretty_theory #>
   595     basic_entities_style (Binding.name "thm_style")
   598     basic_entities_style (Binding.name "thm_style")
   596       (Term_Style.parse_bare -- Attrib.thms) pretty_thm_style #>
   599       (Term_Style.parse_bare -- Attrib.thms) pretty_thm_style #>
   597     basic_entity (Binding.name "term_style")
   600     basic_entity (Binding.name "term_style")
   598       (Term_Style.parse_bare -- Args.term) pretty_term_style));
   601       (Term_Style.parse_bare -- Args.term) pretty_term_style));
   599 
   602