sharpened criterion: bare named target is only at the bottom level
authorhaftmann
Thu, 05 Jun 2014 19:39:38 +0200
changeset 57177 dce365931721
parent 57176 88739947cc73
child 57178 276befcd90d9
sharpened criterion: bare named target is only at the bottom level
src/Pure/Isar/named_target.ML
--- a/src/Pure/Isar/named_target.ML	Thu Jun 05 19:39:35 2014 +0200
+++ b/src/Pure/Isar/named_target.ML	Thu Jun 05 19:39:38 2014 +0200
@@ -40,12 +40,13 @@
   fun init _ = NONE;
 );
 
-val peek =
-  Data.get #> Option.map (fn Target {target, is_locale, is_class, ...} =>
-    {target = target, is_locale = is_locale, is_class = is_class});
+fun peek lthy =
+  if Local_Theory.level lthy = 1
+  then Option.map (fn Target {target, is_locale, is_class, ...} =>
+    {target = target, is_locale = is_locale, is_class = is_class}) (Data.get lthy)
+  else NONE;
 
-fun is_theory lthy =
-  Option.map #target (peek lthy) = SOME "" andalso Local_Theory.level lthy = 1;
+fun is_theory lthy = Option.map #target (peek lthy) = SOME "";
 
 
 (* define *)