equal
deleted
inserted
replaced
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 |