src/Pure/Isar/token.scala
changeset 59122 c1dbcde94cd2
parent 59083 88b0b1f28adc
child 59671 9715eb8e9408
     1.1 --- a/src/Pure/Isar/token.scala	Tue Dec 09 20:00:45 2014 +0100
     1.2 +++ b/src/Pure/Isar/token.scala	Tue Dec 09 21:14:11 2014 +0100
     1.3 @@ -194,6 +194,9 @@
     1.4  sealed case class Token(val kind: Token.Kind.Value, val source: String)
     1.5  {
     1.6    def is_command: Boolean = kind == Token.Kind.COMMAND
     1.7 +  def is_command_kind(keywords: Keyword.Keywords, pred: String => Boolean): Boolean =
     1.8 +    is_command &&
     1.9 +      (keywords.command_kind(source) match { case Some(k) => pred(k) case None => false })
    1.10    def is_keyword: Boolean = kind == Token.Kind.KEYWORD
    1.11    def is_delimiter: Boolean = is_keyword && !Symbol.is_ascii_identifier(source)
    1.12    def is_ident: Boolean = kind == Token.Kind.IDENT