src/Pure/Isar/locale.ML
changeset 63723 dacc380ab327
parent 63352 4eaf35781b23
child 66188 bd841164592f
equal deleted inserted replaced
63722:b9c8da46443b 63723:dacc380ab327
   401 fun all_registrations_of context = get_registrations context I;
   401 fun all_registrations_of context = get_registrations context I;
   402 
   402 
   403 
   403 
   404 (*** Activate context elements of locale ***)
   404 (*** Activate context elements of locale ***)
   405 
   405 
       
   406 fun activate_err msg (name, morph) context =
       
   407   cat_error msg ("The above error(s) occurred while activating locale instance\n" ^
       
   408     (pretty_reg (Context.proof_of context) Morphism.identity (name, morph) |>
       
   409       Pretty.string_of));
       
   410 
   406 (* Declarations, facts and entire locale content *)
   411 (* Declarations, facts and entire locale content *)
   407 
   412 
   408 fun activate_syntax_decls (name, morph) context =
   413 fun activate_syntax_decls (name, morph) context =
   409   let
   414   let
   410     val thy = Context.theory_of context;
   415     val thy = Context.theory_of context;
   411     val {syntax_decls, ...} = the_locale thy name;
   416     val {syntax_decls, ...} = the_locale thy name;
   412   in
   417   in
   413     context
   418     context
   414     |> fold_rev (fn (decl, _) => decl morph) syntax_decls
   419     |> fold_rev (fn (decl, _) => decl morph) syntax_decls
       
   420       handle ERROR msg => activate_err msg (name, morph) context
   415   end;
   421   end;
   416 
   422 
   417 fun activate_notes activ_elem transfer context export' (name, morph) input =
   423 fun activate_notes activ_elem transfer context export' (name, morph) input =
   418   let
   424   let
   419     val thy = Context.theory_of context;
   425     val thy = Context.theory_of context;