258 |> fold Token.declare_maxidx src |
258 |> fold Token.declare_maxidx src |
259 |> Variable.declare_maxidx (Variable.maxidx_of lthy3)); |
259 |> Variable.declare_maxidx (Variable.maxidx_of lthy3)); |
260 |
260 |
261 val text' = (Method.map_source o map) (Token.transform morphism) text; |
261 val text' = (Method.map_source o map) (Token.transform morphism) text; |
262 val term_args' = map (Morphism.term morphism) term_args; |
262 val term_args' = map (Morphism.term morphism) term_args; |
|
263 val full_name = Local_Theory.full_name lthy name; |
263 in |
264 in |
264 lthy3 |
265 lthy3 |
265 |> Local_Theory.close_target |
266 |> Local_Theory.close_target |
266 |> Proof_Context.restore_naming lthy |
267 |> Proof_Context.restore_naming lthy |
267 |> put_closure name |
268 |> put_closure name |
268 {vars = term_args', named_thms = named_thms, methods = method_args, body = text'} |
269 {vars = term_args', named_thms = named_thms, methods = method_args, body = text'} |
269 |> Method.local_setup name (parser term_args' (recursive_method term_args' text')) "" |
270 |> Method.local_setup name |
270 |> pair (Local_Theory.full_name lthy name) |
271 (Args.context :|-- (fn ctxt => |
|
272 let val {body, vars, ...} = get_closure ctxt full_name in |
|
273 parser vars (recursive_method vars body) end)) "" |
|
274 |> pair full_name |
271 end; |
275 end; |
272 |
276 |
273 in |
277 in |
274 |
278 |
275 val method = gen_method Proof_Context.add_fixes; |
279 val method = gen_method Proof_Context.add_fixes; |