src/Pure/sign.ML
changeset 42360 da8817d01e7c
parent 42359 6ca5407863ed
child 42375 774df7c59508
equal deleted inserted replaced
42359:6ca5407863ed 42360:da8817d01e7c
   348 
   348 
   349 (* modify syntax *)
   349 (* modify syntax *)
   350 
   350 
   351 fun gen_syntax change_gram parse_typ mode args thy =
   351 fun gen_syntax change_gram parse_typ mode args thy =
   352   let
   352   let
   353     val ctxt = ProofContext.init_global thy;
   353     val ctxt = Proof_Context.init_global thy;
   354     fun prep (c, T, mx) = (c, certify_typ_mode Type.mode_syntax thy (parse_typ ctxt T), mx)
   354     fun prep (c, T, mx) = (c, certify_typ_mode Type.mode_syntax thy (parse_typ ctxt T), mx)
   355       handle ERROR msg => cat_error msg ("in syntax declaration " ^ quote c);
   355       handle ERROR msg => cat_error msg ("in syntax declaration " ^ quote c);
   356   in thy |> map_syn (change_gram (is_logtype thy) mode (map prep args)) end;
   356   in thy |> map_syn (change_gram (is_logtype thy) mode (map prep args)) end;
   357 
   357 
   358 fun gen_add_syntax x = gen_syntax (Syntax.update_const_gram true) x;
   358 fun gen_add_syntax x = gen_syntax (Syntax.update_const_gram true) x;
   385 
   385 
   386 local
   386 local
   387 
   387 
   388 fun gen_add_consts parse_typ raw_args thy =
   388 fun gen_add_consts parse_typ raw_args thy =
   389   let
   389   let
   390     val ctxt = ProofContext.init_global thy;
   390     val ctxt = Proof_Context.init_global thy;
   391     val prepT = Type.no_tvars o Term.no_dummyT o certify_typ thy o parse_typ ctxt;
   391     val prepT = Type.no_tvars o Term.no_dummyT o certify_typ thy o parse_typ ctxt;
   392     fun prep (b, raw_T, mx) =
   392     fun prep (b, raw_T, mx) =
   393       let
   393       let
   394         val c = full_name thy b;
   394         val c = full_name thy b;
   395         val T = (prepT raw_T handle TYPE (msg, _, _) => error msg) handle ERROR msg =>
   395         val T = (prepT raw_T handle TYPE (msg, _, _) => error msg) handle ERROR msg =>