src/Pure/Isar/expression.ML
changeset 56723 a8f71445c265
parent 56057 ad6bd8030d88
child 56809 b60009672a65
equal deleted inserted replaced
56722:ba1ac087b3a7 56723:a8f71445c265
   919     Local_Theory.notes_kind (activate lthy) expression raw_eqns lthy;
   919     Local_Theory.notes_kind (activate lthy) expression raw_eqns lthy;
   920 
   920 
   921 
   921 
   922 (* second dimension: relation to underlying target *)
   922 (* second dimension: relation to underlying target *)
   923 
   923 
   924 fun subscribe lthy =
       
   925   if Named_Target.is_theory lthy
       
   926   then Generic_Target.theory_registration
       
   927   else Generic_Target.locale_dependency (Named_Target.the_name lthy);
       
   928 
       
   929 fun subscribe_or_activate lthy =
   924 fun subscribe_or_activate lthy =
   930   if Named_Target.is_theory lthy
   925   if Named_Target.is_theory lthy
   931   then subscribe lthy
   926   then Local_Theory.subscription
   932   else Local_Theory.activate;
   927   else Local_Theory.activate;
   933 
   928 
   934 fun subscribe_locale_only lthy =
   929 fun subscribe_locale_only lthy =
   935   let
   930   let
   936     val _ =
   931     val _ =
   937       if Named_Target.is_theory lthy
   932       if Named_Target.is_theory lthy
   938       then error "Not possible on level of global theory"
   933       then error "Not possible on level of global theory"
   939       else ();
   934       else ();
   940   in subscribe lthy end;
   935   in Local_Theory.subscription end;
   941 
   936 
   942 
   937 
   943 (* special case: global sublocale command *)
   938 (* special case: global sublocale command *)
   944 
   939 
   945 fun gen_sublocale_global prep_loc prep_interpretation
   940 fun gen_sublocale_global prep_loc prep_interpretation
   962 
   957 
   963 fun interpret x = gen_interpret cert_interpretation x;
   958 fun interpret x = gen_interpret cert_interpretation x;
   964 fun interpret_cmd x = gen_interpret read_interpretation x;
   959 fun interpret_cmd x = gen_interpret read_interpretation x;
   965 
   960 
   966 fun permanent_interpretation x =
   961 fun permanent_interpretation x =
   967   gen_local_theory_interpretation cert_interpretation subscribe x;
   962   gen_local_theory_interpretation cert_interpretation (K Local_Theory.subscription) x;
   968 
   963 
   969 fun ephemeral_interpretation x =
   964 fun ephemeral_interpretation x =
   970   gen_local_theory_interpretation cert_interpretation (K Local_Theory.activate) x;
   965   gen_local_theory_interpretation cert_interpretation (K Local_Theory.activate) x;
   971 
   966 
   972 fun interpretation x =
   967 fun interpretation x =