src/Pure/Isar/attrib.ML
changeset 53044 be27b6be8027
parent 52709 0e4bacf21e77
child 53168 d998de7f0efc
equal deleted inserted replaced
53043:8cbfbeb566a4 53044:be27b6be8027
     9   type src = Args.src
     9   type src = Args.src
    10   type binding = binding * src list
    10   type binding = binding * src list
    11   val empty_binding: binding
    11   val empty_binding: binding
    12   val is_empty_binding: binding -> bool
    12   val is_empty_binding: binding -> bool
    13   val print_attributes: theory -> unit
    13   val print_attributes: theory -> unit
       
    14   val check: theory -> xstring * Position.T -> string
    14   val intern: theory -> xstring -> string
    15   val intern: theory -> xstring -> string
    15   val intern_src: theory -> src -> src
    16   val intern_src: theory -> src -> src
    16   val pretty_attribs: Proof.context -> src list -> Pretty.T list
    17   val pretty_attribs: Proof.context -> src list -> Pretty.T list
    17   val defined: theory -> string -> bool
       
    18   val attribute: Proof.context -> src -> attribute
    18   val attribute: Proof.context -> src -> attribute
    19   val attribute_global: theory -> src -> attribute
    19   val attribute_global: theory -> src -> attribute
    20   val attribute_cmd: Proof.context -> src -> attribute
    20   val attribute_cmd: Proof.context -> src -> attribute
    21   val attribute_cmd_global: theory -> src -> attribute
    21   val attribute_cmd_global: theory -> src -> attribute
    22   val map_specs: ('a list -> 'att list) ->
    22   val map_specs: ('a list -> 'att list) ->
   112   |> Attributes.map (Name_Space.define (Context.Theory thy) true (name, (att, comment)) #> snd);
   112   |> Attributes.map (Name_Space.define (Context.Theory thy) true (name, (att, comment)) #> snd);
   113 
   113 
   114 
   114 
   115 (* name space *)
   115 (* name space *)
   116 
   116 
       
   117 fun check thy = #1 o Name_Space.check (Context.Theory thy) (Attributes.get thy);
       
   118 
   117 val intern = Name_Space.intern o #1 o Attributes.get;
   119 val intern = Name_Space.intern o #1 o Attributes.get;
   118 val intern_src = Args.map_name o intern;
   120 val intern_src = Args.map_name o intern;
   119 
   121 
   120 fun extern ctxt = Name_Space.extern ctxt (#1 (Attributes.get (Proof_Context.theory_of ctxt)));
   122 fun extern ctxt = Name_Space.extern ctxt (#1 (Attributes.get (Proof_Context.theory_of ctxt)));
   121 
   123 
   126   | pretty_attribs ctxt srcs =
   128   | pretty_attribs ctxt srcs =
   127       [Pretty.enum "," "[" "]" (map (Args.pretty_src ctxt o Args.map_name (extern ctxt)) srcs)];
   129       [Pretty.enum "," "[" "]" (map (Args.pretty_src ctxt o Args.map_name (extern ctxt)) srcs)];
   128 
   130 
   129 
   131 
   130 (* get attributes *)
   132 (* get attributes *)
   131 
       
   132 val defined = Symtab.defined o #2 o Attributes.get;
       
   133 
   133 
   134 fun attribute_generic context =
   134 fun attribute_generic context =
   135   let
   135   let
   136     val thy = Context.theory_of context;
   136     val thy = Context.theory_of context;
   137     val (space, tab) = Attributes.get thy;
   137     val (space, tab) = Attributes.get thy;