src/Pure/General/position.scala
changeset 56532 3da244bc02bd
parent 56473 5b5c750e9763
child 56746 d37a5d09a277
equal deleted inserted replaced
56531:ec4cd116844b 56532:3da244bc02bd
    97   }
    97   }
    98 
    98 
    99   def purge(props: T): T = props.filterNot(p => Markup.POSITION_PROPERTIES(p._1))
    99   def purge(props: T): T = props.filterNot(p => Markup.POSITION_PROPERTIES(p._1))
   100 
   100 
   101 
   101 
   102   /* here: inlined formal markup */
   102   /* here: user output */
   103 
   103 
   104   def here(pos: T): String =
   104   def here(pos: T): String =
   105     (Line.unapply(pos), File.unapply(pos)) match {
   105     (Line.unapply(pos), File.unapply(pos)) match {
   106       case (Some(i), None) => " (line " + i.toString + ")"
   106       case (Some(i), None) => " (line " + i.toString + ")"
   107       case (Some(i), Some(name)) => " (line " + i.toString + " of " + quote(name) + ")"
   107       case (Some(i), Some(name)) => " (line " + i.toString + " of " + quote(name) + ")"
   108       case (None, Some(name)) => " (file " + quote(name) + ")"
   108       case (None, Some(name)) => " (file " + quote(name) + ")"
   109       case _ => ""
   109       case _ => ""
   110     }
   110     }
       
   111 
       
   112   def here_undelimited(pos: T): String =
       
   113     (Line.unapply(pos), File.unapply(pos)) match {
       
   114       case (Some(i), None) => "line " + i.toString
       
   115       case (Some(i), Some(name)) => "line " + i.toString + " of " + quote(name)
       
   116       case (None, Some(name)) => "file " + quote(name)
       
   117       case _ => ""
       
   118     }
   111 }
   119 }