src/Pure/PIDE/line.scala
changeset 66605 261dcd52c5a0
parent 65903 692e428803c8
child 66923 914935f8a462
equal deleted inserted replaced
66604:1af360d1cad2 66605:261dcd52c5a0
    24   /* position */
    24   /* position */
    25 
    25 
    26   object Position
    26   object Position
    27   {
    27   {
    28     val zero: Position = Position()
    28     val zero: Position = Position()
       
    29     val offside: Position = Position(line = -1)
    29 
    30 
    30     object Ordering extends scala.math.Ordering[Position]
    31     object Ordering extends scala.math.Ordering[Position]
    31     {
    32     {
    32       def compare(p1: Position, p2: Position): Int = p1 compare p2
    33       def compare(p1: Position, p2: Position): Int = p1 compare p2
    33     }
    34     }
    74       else start.print + ".." + stop.print
    75       else start.print + ".." + stop.print
    75   }
    76   }
    76 
    77 
    77 
    78 
    78   /* positions within document node */
    79   /* positions within document node */
       
    80 
       
    81   object Node_Position
       
    82   {
       
    83     def offside(name: String): Node_Position = Node_Position(name, Position.offside)
       
    84   }
    79 
    85 
    80   sealed case class Node_Position(name: String, pos: Position = Position.zero)
    86   sealed case class Node_Position(name: String, pos: Position = Position.zero)
    81   {
    87   {
    82     def line: Int = pos.line
    88     def line: Int = pos.line
    83     def column: Int = pos.column
    89     def column: Int = pos.column