src/Pure/Isar/attrib.ML
changeset 60242 3a8501876dba
parent 59917 9830c944670f
child 60243 5901cb4db0ae
equal deleted inserted replaced
60241:cde717a55db7 60242:3a8501876dba
    16     string -> local_theory -> string * local_theory
    16     string -> local_theory -> string * local_theory
    17   val check_name_generic: Context.generic -> xstring * Position.T -> string
    17   val check_name_generic: Context.generic -> xstring * Position.T -> string
    18   val check_name: Proof.context -> xstring * Position.T -> string
    18   val check_name: Proof.context -> xstring * Position.T -> string
    19   val check_src: Proof.context -> Token.src -> Token.src
    19   val check_src: Proof.context -> Token.src -> Token.src
    20   val pretty_attribs: Proof.context -> Token.src list -> Pretty.T list
    20   val pretty_attribs: Proof.context -> Token.src list -> Pretty.T list
       
    21   val pretty_binding: Proof.context -> binding -> string -> Pretty.T list
    21   val attribute: Proof.context -> Token.src -> attribute
    22   val attribute: Proof.context -> Token.src -> attribute
    22   val attribute_global: theory -> Token.src -> attribute
    23   val attribute_global: theory -> Token.src -> attribute
    23   val attribute_cmd: Proof.context -> Token.src -> attribute
    24   val attribute_cmd: Proof.context -> Token.src -> attribute
    24   val attribute_cmd_global: theory -> Token.src -> attribute
    25   val attribute_cmd_global: theory -> Token.src -> attribute
    25   val map_specs: ('a list -> 'att list) ->
    26   val map_specs: ('a list -> 'att list) ->
   156 (* pretty printing *)
   157 (* pretty printing *)
   157 
   158 
   158 fun pretty_attribs _ [] = []
   159 fun pretty_attribs _ [] = []
   159   | pretty_attribs ctxt srcs = [Pretty.enum "," "[" "]" (map (Token.pretty_src ctxt) srcs)];
   160   | pretty_attribs ctxt srcs = [Pretty.enum "," "[" "]" (map (Token.pretty_src ctxt) srcs)];
   160 
   161 
       
   162 fun pretty_binding ctxt (b, atts) sep =
       
   163   if is_empty_binding (b, atts) then []
       
   164   else if Binding.is_empty b then
       
   165     [Pretty.block (pretty_attribs ctxt atts @ [Pretty.str sep])]
       
   166   else
       
   167     [Pretty.block (Binding.pretty b :: Pretty.brk 1 :: pretty_attribs ctxt atts @ [Pretty.str sep])];
       
   168 
   161 
   169 
   162 (* get attributes *)
   170 (* get attributes *)
   163 
   171 
   164 fun attribute_generic context =
   172 fun attribute_generic context =
   165   let val table = Attributes.get context
   173   let val table = Attributes.get context