@@ -96,7 +96,7 @@ public static Tree firstAncestorOfKind(Tree tree, Kind... kinds) {
96
96
}
97
97
98
98
public static Comparator <Tree > getTreeByPositionComparator () {
99
- return Comparator .comparing ((Tree t ) -> t .firstToken ().pythonLine ()).thenComparing ((Tree t ) -> t .firstToken ().pythonColumn ());
99
+ return Comparator .comparing ((Tree t ) -> t .firstToken ().pythonLine (). line () ).thenComparing ((Tree t ) -> t .firstToken ().pythonColumn ());
100
100
}
101
101
102
102
public static List <Token > tokens (Tree tree ) {
@@ -256,7 +256,7 @@ public static int findIndentationSize(Tree tree) {
256
256
var treeToken = tree .firstToken ();
257
257
var parentToken = parent .firstToken ();
258
258
259
- if (treeToken .pythonLine () != parentToken .pythonLine ()) {
259
+ if (treeToken .pythonLine (). line () != parentToken .pythonLine (). line ()) {
260
260
return treeToken .pythonColumn () - parentToken .pythonColumn ();
261
261
} else {
262
262
return findIndentationSize (parent );
@@ -270,7 +270,7 @@ private static int findIndentDownTree(Tree parent) {
270
270
.map (child -> {
271
271
272
272
var childToken = child .firstToken ();
273
- if (childToken .pythonLine () > parentToken .pythonLine () && childToken .pythonColumn () > parentToken .pythonColumn ()) {
273
+ if (childToken .pythonLine (). line () > parentToken .pythonLine (). line () && childToken .pythonColumn () > parentToken .pythonColumn ()) {
274
274
return childToken .pythonColumn () - parentToken .pythonColumn ();
275
275
} else {
276
276
return findIndentDownTree (child );
@@ -477,8 +477,8 @@ public static Optional<Tree> firstChild(Tree tree, Predicate<Tree> filter) {
477
477
478
478
public static String treeToString (Tree tree , boolean renderMultiline ) {
479
479
if (!renderMultiline ) {
480
- var firstLine = tree .firstToken ().pythonLine ();
481
- var lastLine = tree .lastToken ().pythonLine ();
480
+ var firstLine = tree .firstToken ().pythonLine (). line () ;
481
+ var lastLine = tree .lastToken ().pythonLine (). line () ;
482
482
483
483
// We decided to not support multiline default parameters
484
484
// because it requires indents calculation for place where the value should be copied.
0 commit comments