Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 6629fad

Browse files
authored
Merge pull request #153 from juanjux/fix/importfrom_pos
Fix position from ImportFrom nodes
2 parents 4c54de8 + 9174161 commit 6629fad

31 files changed

+700
-169
lines changed

fixtures/issue62.py.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"body": [
99
{
1010
"ast_type": "ImportFrom",
11-
"col_offset": 6,
11+
"col_offset": 1,
1212
"end_col_offset": 7,
1313
"end_lineno": 1,
1414
"level": 0,

fixtures/issue62.py.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Module {
88
. . 0: ImportFrom {
99
. . . Roles: Import,Declaration,Statement
1010
. . . StartPosition: {
11-
. . . . Offset: 5
11+
. . . . Offset: 0
1212
. . . . Line: 1
13-
. . . . Col: 6
13+
. . . . Col: 1
1414
. . . }
1515
. . . EndPosition: {
1616
. . . . Offset: 6

fixtures/issue62_b.py.native

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"body": [
99
{
1010
"ast_type": "ImportFrom",
11-
"col_offset": 6,
11+
"col_offset": 1,
1212
"end_col_offset": 16,
1313
"end_lineno": 1,
1414
"level": 0,

fixtures/issue62_b.py.uast

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ Module {
88
. . 0: ImportFrom {
99
. . . Roles: Import,Declaration,Statement
1010
. . . StartPosition: {
11-
. . . . Offset: 5
11+
. . . . Offset: 0
1212
. . . . Line: 1
13-
. . . . Col: 6
13+
. . . . Col: 1
1414
. . . }
1515
. . . EndPosition: {
1616
. . . . Offset: 15

fixtures/issue94.py.native

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"ast_type": "ImportFrom",
47-
"col_offset": 6,
47+
"col_offset": 1,
4848
"end_col_offset": 9,
4949
"end_lineno": 4,
5050
"level": 0,
@@ -74,7 +74,7 @@
7474
},
7575
{
7676
"ast_type": "ImportFrom",
77-
"col_offset": 6,
77+
"col_offset": 1,
7878
"end_col_offset": 9,
7979
"end_lineno": 6,
8080
"level": 0,

fixtures/issue94.py.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Module {
7878
. . 3: ImportFrom {
7979
. . . Roles: Import,Declaration,Statement
8080
. . . StartPosition: {
81-
. . . . Offset: 61
81+
. . . . Offset: 56
8282
. . . . Line: 4
83-
. . . . Col: 6
83+
. . . . Col: 1
8484
. . . }
8585
. . . EndPosition: {
8686
. . . . Offset: 64
@@ -141,9 +141,9 @@ Module {
141141
. . 5: ImportFrom {
142142
. . . Roles: Import,Declaration,Statement
143143
. . . StartPosition: {
144-
. . . . Offset: 114
144+
. . . . Offset: 109
145145
. . . . Line: 6
146-
. . . . Col: 6
146+
. . . . Col: 1
147147
. . . }
148148
. . . EndPosition: {
149149
. . . . Offset: 117

fixtures/issue96.py.native

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"ast_type": "ImportFrom",
47-
"col_offset": 6,
47+
"col_offset": 1,
4848
"end_col_offset": 9,
4949
"end_lineno": 4,
5050
"level": 0,
@@ -74,7 +74,7 @@
7474
},
7575
{
7676
"ast_type": "ImportFrom",
77-
"col_offset": 6,
77+
"col_offset": 1,
7878
"end_col_offset": 9,
7979
"end_lineno": 6,
8080
"level": 0,

fixtures/issue96.py.uast

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ Module {
7878
. . 3: ImportFrom {
7979
. . . Roles: Import,Declaration,Statement
8080
. . . StartPosition: {
81-
. . . . Offset: 61
81+
. . . . Offset: 56
8282
. . . . Line: 4
83-
. . . . Col: 6
83+
. . . . Col: 1
8484
. . . }
8585
. . . EndPosition: {
8686
. . . . Offset: 64
@@ -141,9 +141,9 @@ Module {
141141
. . 5: ImportFrom {
142142
. . . Roles: Import,Declaration,Statement
143143
. . . StartPosition: {
144-
. . . . Offset: 114
144+
. . . . Offset: 109
145145
. . . . Line: 6
146-
. . . . Col: 6
146+
. . . . Col: 1
147147
. . . }
148148
. . . EndPosition: {
149149
. . . . Offset: 117

fixtures/issue_server101.py.native

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@
184184
},
185185
{
186186
"ast_type": "ImportFrom",
187-
"col_offset": 6,
187+
"col_offset": 1,
188188
"end_col_offset": 10,
189189
"end_lineno": 32,
190190
"level": 0,
@@ -215,7 +215,7 @@
215215
},
216216
{
217217
"ast_type": "ImportFrom",
218-
"col_offset": 6,
218+
"col_offset": 1,
219219
"end_col_offset": 11,
220220
"end_lineno": 34,
221221
"level": 0,
@@ -25459,7 +25459,7 @@
2545925459
"body": [
2546025460
{
2546125461
"ast_type": "ImportFrom",
25462-
"col_offset": 10,
25462+
"col_offset": 5,
2546325463
"end_col_offset": 23,
2546425464
"end_lineno": 1009,
2546525465
"level": 0,
@@ -25666,7 +25666,7 @@
2566625666
},
2566725667
{
2566825668
"ast_type": "ImportFrom",
25669-
"col_offset": 10,
25669+
"col_offset": 5,
2567025670
"end_col_offset": 23,
2567125671
"end_lineno": 1016,
2567225672
"level": 0,
@@ -25697,7 +25697,7 @@
2569725697
},
2569825698
{
2569925699
"ast_type": "ImportFrom",
25700-
"col_offset": 10,
25700+
"col_offset": 5,
2570125701
"end_col_offset": 23,
2570225702
"end_lineno": 1017,
2570325703
"level": 0,

fixtures/issue_server101.py.uast

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -374,9 +374,9 @@ special value types.
374374
. . 4: ImportFrom {
375375
. . . Roles: Import,Declaration,Statement
376376
. . . StartPosition: {
377-
. . . . Offset: 1003
377+
. . . . Offset: 998
378378
. . . . Line: 32
379-
. . . . Col: 6
379+
. . . . Col: 1
380380
. . . }
381381
. . . EndPosition: {
382382
. . . . Offset: 1007
@@ -439,9 +439,9 @@ special value types.
439439
. . 5: ImportFrom {
440440
. . . Roles: Import,Declaration,Statement
441441
. . . StartPosition: {
442-
. . . . Offset: 1042
442+
. . . . Offset: 1037
443443
. . . . Line: 34
444-
. . . . Col: 6
444+
. . . . Col: 1
445445
. . . }
446446
. . . EndPosition: {
447447
. . . . Offset: 1047
@@ -50912,9 +50912,9 @@ pyid to C{bool}."
5091250912
. . . . 0: ImportFrom {
5091350913
. . . . . Roles: Import,Declaration,Statement
5091450914
. . . . . StartPosition: {
50915-
. . . . . . Offset: 39434
50915+
. . . . . . Offset: 39429
5091650916
. . . . . . Line: 1009
50917-
. . . . . . Col: 10
50917+
. . . . . . Col: 5
5091850918
. . . . . }
5091950919
. . . . . EndPosition: {
5092050920
. . . . . . Offset: 39447
@@ -51322,9 +51322,9 @@ pyid to C{bool}."
5132251322
. . . . 4: ImportFrom {
5132351323
. . . . . Roles: Import,Declaration,Statement
5132451324
. . . . . StartPosition: {
51325-
. . . . . . Offset: 39709
51325+
. . . . . . Offset: 39704
5132651326
. . . . . . Line: 1016
51327-
. . . . . . Col: 10
51327+
. . . . . . Col: 5
5132851328
. . . . . }
5132951329
. . . . . EndPosition: {
5133051330
. . . . . . Offset: 39722
@@ -51397,9 +51397,9 @@ pyid to C{bool}."
5139751397
. . . . 5: ImportFrom {
5139851398
. . . . . Roles: Import,Declaration,Statement
5139951399
. . . . . StartPosition: {
51400-
. . . . . . Offset: 39776
51400+
. . . . . . Offset: 39771
5140151401
. . . . . . Line: 1017
51402-
. . . . . . Col: 10
51402+
. . . . . . Col: 5
5140351403
. . . . . }
5140451404
. . . . . EndPosition: {
5140551405
. . . . . . Offset: 39789

0 commit comments

Comments
 (0)