@@ -40,12 +40,12 @@ abstract class Positioned(implicit @transientParam src: SourceInfo) extends Prod
40
40
// assert(id != 2067, getClass)
41
41
}
42
42
43
- /** Destructively update `mySpan` to given span. Also, set any missing
44
- * spans in children.
43
+ /** Destructively update `mySpan` to given span and potentially update `id` so that
44
+ * it refers to `file`. Also, set any missing positions in children.
45
45
*/
46
46
protected def setPos (span : Span , file : AbstractFile ): Unit = {
47
- setOneSpan (span, file)
48
- if (span.exists) setChildSpans (span.toSynthetic, file)
47
+ setOnePos (span, file)
48
+ if (span.exists) setChildPositions (span.toSynthetic, file)
49
49
}
50
50
51
51
/** A positioned item like this one with given `span`.
@@ -82,7 +82,7 @@ abstract class Positioned(implicit @transientParam src: SourceInfo) extends Prod
82
82
/** Set span of this tree only, without updating children spans.
83
83
* Called from Unpickler when entering positions.
84
84
*/
85
- private [dotc] def setOneSpan (span : Span , file : AbstractFile = this .srcfile): Unit = {
85
+ private [dotc] def setOnePos (span : Span , file : AbstractFile = this .srcfile): Unit = {
86
86
if (file != this .srcfile) setId(TreeIds .nextIdFor(file))
87
87
mySpan = span
88
88
}
@@ -98,7 +98,7 @@ abstract class Positioned(implicit @transientParam src: SourceInfo) extends Prod
98
98
* But since mutual tail recursion is not supported in Scala, we express it instead
99
99
* as a while loop with a termination by return in the middle.
100
100
*/
101
- private def setChildSpans (span : Span , file : AbstractFile ): Unit = {
101
+ private def setChildPositions (span : Span , file : AbstractFile ): Unit = {
102
102
var n = productArity // subnodes are analyzed right to left
103
103
var elems : List [Any ] = Nil // children in lists still to be considered, from right to left
104
104
var end = span.end // the last defined offset, fill in spans up to this offset
0 commit comments