enforce strict nesting of local theories
authorhaftmann
Thu, 22 Oct 2020 11:37:19 +0000
changeset 72502 ff181cd78bb7
parent 72501 70b420065a07
child 72503 05d0977ec706
enforce strict nesting of local theories
src/Pure/Isar/local_theory.ML
src/Pure/Isar/target_context.ML
--- a/src/Pure/Isar/local_theory.ML	Thu Oct 22 08:39:08 2020 +0200
+++ b/src/Pure/Isar/local_theory.ML	Thu Oct 22 11:37:19 2020 +0000
@@ -361,7 +361,7 @@
 
 val exit_of = #exit o bottom_of;
 
-fun exit lthy = exit_of lthy lthy;
+fun exit lthy = exit_of lthy (assert_bottom lthy);
 val exit_global = Proof_Context.theory_of o exit;
 
 fun exit_result decl (x, lthy) =
--- a/src/Pure/Isar/target_context.ML	Thu Oct 22 08:39:08 2020 +0200
+++ b/src/Pure/Isar/target_context.ML	Thu Oct 22 11:37:19 2020 +0000
@@ -21,7 +21,7 @@
 fun context_begin_named_cmd ("-", _) thy = Named_Target.theory_init thy
   | context_begin_named_cmd target thy = Named_Target.init (Locale.check thy target) thy;
 
-val end_named_cmd = Local_Theory.assert_bottom #> Local_Theory.exit_global;
+val end_named_cmd = Local_Theory.exit_global;
 
 fun switch_named_cmd NONE (Context.Theory thy) =
       (Context.Theory o end_named_cmd, Named_Target.theory_init thy)