src/Pure/Isar/keyword.scala
changeset 59701 8ab877c91992
parent 59700 d887abcc7c24
child 60624 5b6552e12421
--- a/src/Pure/Isar/keyword.scala	Sun Mar 15 12:49:20 2015 +0100
+++ b/src/Pure/Isar/keyword.scala	Sun Mar 15 14:46:01 2015 +0100
@@ -53,6 +53,8 @@
   val theory_begin = Set(THY_BEGIN)
   val theory_end = Set(THY_END)
 
+  val theory_load = Set(THY_LOAD)
+
   val theory = Set(THY_BEGIN, THY_END, THY_LOAD, THY_DECL, THY_DECL_BLOCK, THY_GOAL)
 
   val theory_block = Set(THY_BEGIN, THY_DECL_BLOCK)
@@ -142,6 +144,12 @@
 
     def command_kind(name: String): Option[String] = commands.get(name).map(_._1)
 
+    def is_command_kind(name: String, pred: String => Boolean): Boolean =
+      command_kind(name) match {
+        case Some(kind) => pred(kind)
+        case None => false
+      }
+
 
     /* load commands */
 
@@ -158,4 +166,3 @@
       load_commands.exists({ case (cmd, _) => text.containsSlice(cmd) })
   }
 }
-