src/Pure/Isar/attrib.ML
changeset 69187 d8849cfad60f
parent 68823 5e7b1ae10eb8
child 69216 1a52baa70aed
equal deleted inserted replaced
69186:573b7fbd96a8 69187:d8849cfad60f
   212   let val (a, context') = Token.syntax_generic scan src context in a (context', th) end;
   212   let val (a, context') = Token.syntax_generic scan src context in a (context', th) end;
   213 
   213 
   214 fun setup binding scan comment = define_global binding (attribute_syntax scan) comment #> snd;
   214 fun setup binding scan comment = define_global binding (attribute_syntax scan) comment #> snd;
   215 fun local_setup binding scan comment = define binding (attribute_syntax scan) comment #> snd;
   215 fun local_setup binding scan comment = define binding (attribute_syntax scan) comment #> snd;
   216 
   216 
   217 fun attribute_setup name source comment =
   217 fun attribute_setup (name, pos) source comment =
   218   ML_Lex.read_source source
   218   ML_Lex.read_source source
   219   |> ML_Context.expression (Input.range_of source) "parser" "Thm.attribute context_parser"
   219   |> ML_Context.expression ("parser", pos) "Thm.attribute context_parser"
   220     ("Context.map_proof (Attrib.local_setup " ^ ML_Syntax.atomic (ML_Syntax.make_binding name) ^
   220     ("Context.map_proof (Attrib.local_setup " ^
       
   221       ML_Syntax.atomic (ML_Syntax.make_binding (name, pos)) ^
   221       " parser " ^ ML_Syntax.print_string comment ^ ")")
   222       " parser " ^ ML_Syntax.print_string comment ^ ")")
   222   |> Context.proof_map;
   223   |> Context.proof_map;
   223 
   224 
   224 
   225 
   225 (* internal attribute *)
   226 (* internal attribute *)