src/Pure/General/position.scala
changeset 55555 9c16317c91d1
parent 55490 9b0fb0e2c9f5
child 55884 f2c0eaedd579
equal deleted inserted replaced
55554:d77090e07000 55555:9c16317c91d1
    48       }
    48       }
    49   }
    49   }
    50 
    50 
    51   object Range
    51   object Range
    52   {
    52   {
    53     def apply(range: Text.Range): T = Offset(range.start) ++ Offset(range.stop)
    53     def apply(range: Text.Range): T = Offset(range.start) ::: Offset(range.stop)
    54     def unapply(pos: T): Option[Text.Range] =
    54     def unapply(pos: T): Option[Text.Range] =
    55       (pos, pos) match {
    55       (pos, pos) match {
    56         case (Offset(start), End_Offset(stop)) if start <= stop => Some(Text.Range(start, stop))
    56         case (Offset(start), End_Offset(stop)) if start <= stop => Some(Text.Range(start, stop))
    57         case (Offset(start), _) => Some(Text.Range(start, start + 1))
    57         case (Offset(start), _) => Some(Text.Range(start, start + 1))
    58         case _ => None
    58         case _ => None