@@ -69,19 +69,19 @@ object Parsers {
69
69
/* ------------- POSITIONS ------------------------------------------- */
70
70
71
71
/** Positions tree.
72
- * If `t` does not have a position yet, set its position to the given one.
72
+ * If `t` does not have a span yet, set its span to the given one.
73
73
*/
74
74
def atSpan [T <: Positioned ](span : Span )(t : T ): T =
75
75
if (t.span.isSourceDerived) t else t.withSpan(span)
76
76
77
77
def atSpan [T <: Positioned ](start : Offset , point : Offset , end : Offset )(t : T ): T =
78
78
atSpan(Span (start, end, point))(t)
79
79
80
- /** If the last read offset is strictly greater than `start`, position tree
81
- * to position spanning from `start` to last read offset, with given point.
80
+ /** If the last read offset is strictly greater than `start`, assign tree
81
+ * the span from `start` to last read offset, with given point.
82
82
* If the last offset is less than or equal to start, the tree `t` did not
83
- * consume any source for its construction. In this case, don't position it yet,
84
- * but wait for its position to be determined by `setChildSpans` when the
83
+ * consume any source for its construction. In this case, don't assign a span yet,
84
+ * but wait for its span to be determined by `setChildSpans` when the
85
85
* parent node is positioned.
86
86
*/
87
87
def atSpan [T <: Positioned ](start : Offset , point : Offset )(t : T ): T =
@@ -128,9 +128,9 @@ object Parsers {
128
128
lastErrorOffset = in.offset
129
129
}
130
130
131
- /** Unconditionally issue an error at given position , without
132
- * updating lastErrorOffset.
133
- */
131
+ /** Unconditionally issue an error at given span , without
132
+ * updating lastErrorOffset.
133
+ */
134
134
def syntaxError (msg : => Message , span : Span ): Unit =
135
135
ctx.error(msg, source.atSpan(span))
136
136
}
@@ -1559,7 +1559,7 @@ object Parsers {
1559
1559
}
1560
1560
1561
1561
/** Block ::= BlockStatSeq
1562
- * @note Return tree does not carry source position .
1562
+ * @note Return tree does not have a defined span .
1563
1563
*/
1564
1564
def block (): Tree = {
1565
1565
val stats = blockStatSeq()
@@ -1892,7 +1892,7 @@ object Parsers {
1892
1892
/** Wrap annotation or constructor in New(...).<init> */
1893
1893
def wrapNew (tpt : Tree ): Select = Select (New (tpt), nme.CONSTRUCTOR )
1894
1894
1895
- /** Adjust start of annotation or constructor to position of preceding @ or new */
1895
+ /** Adjust start of annotation or constructor to offset of preceding @ or new */
1896
1896
def adjustStart (start : Offset )(tree : Tree ): Tree = {
1897
1897
val tree1 = tree match {
1898
1898
case Apply (fn, args) => cpy.Apply (tree)(adjustStart(start)(fn), args)
@@ -2101,7 +2101,7 @@ object Parsers {
2101
2101
val offset = accept(IMPORT )
2102
2102
commaSeparated(importExpr) match {
2103
2103
case t :: rest =>
2104
- // The first import should start at the position of the keyword.
2104
+ // The first import should start at the start offset of the keyword.
2105
2105
val firstPos =
2106
2106
if (t.span.exists) t.span.withStart(offset)
2107
2107
else Span (offset, in.lastOffset)
@@ -2155,8 +2155,8 @@ object Parsers {
2155
2155
val to = termIdentOrWildcard()
2156
2156
val toWithPos =
2157
2157
if (to.name == nme.ERROR )
2158
- // error identifiers don't consume any characters, so atSpan(start)(id) wouldn't set a position .
2159
- // Some testcases would then fail in Positioned.checkPos. Set a position anyway!
2158
+ // error identifiers don't consume any characters, so atSpan(start)(id) wouldn't set a span .
2159
+ // Some testcases would then fail in Positioned.checkPos. Set a span anyway!
2160
2160
atSpan(start, start, in.lastOffset)(to)
2161
2161
else
2162
2162
to
0 commit comments