src/Pure/PIDE/command.scala
changeset 48599 5e64b7770f35
parent 47459 373e456149cc
child 48718 73e6c22e2d94
equal deleted inserted replaced
48598:7f4561d43d39 48599:5e64b7770f35
   126 {
   126 {
   127   /* classification */
   127   /* classification */
   128 
   128 
   129   def is_defined: Boolean = id != Document.no_id
   129   def is_defined: Boolean = id != Document.no_id
   130 
   130 
   131   val is_ignored: Boolean = span.forall(_.is_ignored)
   131   val is_ignored: Boolean = !span.exists(_.is_proper)
   132   val is_malformed: Boolean = !is_ignored && (!span.head.is_command || span.exists(_.is_unparsed))
   132   val is_malformed: Boolean = !is_ignored && (!span.head.is_command || span.exists(_.is_unparsed))
   133   def is_command: Boolean = !is_ignored && !is_malformed
   133   def is_command: Boolean = !is_ignored && !is_malformed
   134 
   134 
   135   def name: String =
   135   def name: String =
   136     span.find(_.is_command) match { case Some(tok) => tok.content case _ => "" }
   136     span.find(_.is_command) match { case Some(tok) => tok.content case _ => "" }