@@ -11,12 +11,12 @@ import language.implicitConversions
11
11
*/
12
12
object Positions {
13
13
14
- private val StartEndBits = 26
15
- val StartEndMask : Long = (1L << StartEndBits ) - 1
16
- private val SyntheticPointDelta = (1 << (64 - StartEndBits * 2 )) - 1
14
+ private final val StartEndBits = 26
15
+ private final val StartEndMask = (1L << StartEndBits ) - 1
16
+ private final val SyntheticPointDelta = (1 << (64 - StartEndBits * 2 )) - 1
17
17
18
18
/** The maximal representable offset in a position */
19
- val MaxOffset = StartEndMask
19
+ private final val MaxOffset = StartEndMask
20
20
21
21
/** Convert offset `x` to an integer by sign extending the original
22
22
* field of `StartEndBits` width.
@@ -134,18 +134,13 @@ object Positions {
134
134
}
135
135
136
136
/** A synthetic position with given start and end */
137
- def Position (start : Int , end : Int ): Position = {
138
- val pos = fromOffsets(start, end, SyntheticPointDelta )
139
- assert(pos.isSynthetic)
140
- pos
141
- }
137
+ def Position (start : Int , end : Int ): Position =
138
+ fromOffsets(start, end, SyntheticPointDelta )
142
139
143
140
/** A source-derived position with given start, end, and point delta */
144
141
def Position (start : Int , end : Int , point : Int ): Position = {
145
142
val pointDelta = (point - start) max 0
146
- val pos = fromOffsets(start, end, if (pointDelta >= SyntheticPointDelta ) 0 else pointDelta)
147
- assert(pos.isSourceDerived)
148
- pos
143
+ fromOffsets(start, end, if (pointDelta >= SyntheticPointDelta ) 0 else pointDelta)
149
144
}
150
145
151
146
/** A synthetic zero-extent position that starts and ends at given `start`. */
0 commit comments