explicit Outer_Syntax.Decl;
authorwenzelm
Thu, 15 Mar 2012 10:16:21 +0100
changeset 46940 a40be2f10ca9
parent 46939 5b67ac48b384
child 46941 c0f776b661fa
explicit Outer_Syntax.Decl;
src/Pure/Isar/outer_syntax.scala
src/Pure/PIDE/document.scala
src/Pure/Thy/thy_header.scala
--- a/src/Pure/Isar/outer_syntax.scala	Thu Mar 15 09:55:42 2012 +0100
+++ b/src/Pure/Isar/outer_syntax.scala	Thu Mar 15 10:16:21 2012 +0100
@@ -34,6 +34,7 @@
     result.toString
   }
 
+  type Decl = (String, Option[(String, List[String])])
   def init(): Outer_Syntax = new Outer_Syntax()
 }
 
@@ -51,8 +52,12 @@
       if (Keyword.control(kind)) completion else completion + (name, replace))
 
   def + (name: String, kind: String): Outer_Syntax = this + (name, kind, name)
-
   def + (name: String): Outer_Syntax = this + (name, Keyword.MINOR)
+  def + (decl: Outer_Syntax.Decl): Outer_Syntax =
+    decl match {
+      case ((name, Some((kind, _)))) => this + (name, kind)
+      case ((name, None)) => this + name
+    }
 
   def is_command(name: String): Boolean =
     keyword_kind(name) match {
--- a/src/Pure/PIDE/document.scala	Thu Mar 15 09:55:42 2012 +0100
+++ b/src/Pure/PIDE/document.scala	Thu Mar 15 10:16:21 2012 +0100
@@ -41,7 +41,7 @@
   {
     sealed case class Deps(
       imports: List[Name],
-      keywords: List[(String, Option[(String, List[String])])],
+      keywords: List[Outer_Syntax.Decl],
       uses: List[(String, Boolean)])
 
     object Name
--- a/src/Pure/Thy/thy_header.scala	Thu Mar 15 09:55:42 2012 +0100
+++ b/src/Pure/Thy/thy_header.scala	Thu Mar 15 10:16:21 2012 +0100
@@ -113,7 +113,7 @@
 
 sealed case class Thy_Header(
   name: String, imports: List[String],
-  keywords: List[(String, Option[(String, List[String])])],
+  keywords: List[Outer_Syntax.Decl],
   uses: List[(String, Boolean)])
 {
   def map(f: String => String): Thy_Header =