Repository navigation
Commit 9ed68d8
committed
Unified: Add locations for blocks
Blocks are slightly awkward, since we destructure them (as codeBlock) in
the query, and then reconstruct them (as `block`) in the rule body,
meaning the location of the block is (by default) assigned to the wrong
place by the heuristic.
To get around this, I added a helper function that updates the location
appropriately, including handling cases where we only optionally match a
block. (Also, in some cases we can fix this by just not destructuring
`codeBlock`s in the first place -- there's already a rule that maps
`codeBlock` to `block`.)1 parent 7cc7408 commit 9ed68d8
8 files changed
Lines changed: 49 additions & 18 deletions
File tree
- unified/extractor
- src/languages/swift
- tests
- corpus/swift
- expressions
- types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | 76 | | |
| |||
301 | 312 | | |
302 | 313 | | |
303 | 314 | | |
304 | | - | |
| 315 | + | |
305 | 316 | | |
306 | 317 | | |
307 | 318 | | |
308 | 319 | | |
309 | 320 | | |
310 | | - | |
311 | | - | |
| 321 | + | |
| 322 | + | |
312 | 323 | | |
313 | 324 | | |
314 | 325 | | |
| |||
564 | 575 | | |
565 | 576 | | |
566 | 577 | | |
567 | | - | |
| 578 | + | |
568 | 579 | | |
569 | 580 | | |
570 | 581 | | |
571 | 582 | | |
572 | 583 | | |
573 | 584 | | |
574 | 585 | | |
575 | | - | |
| 586 | + | |
576 | 587 | | |
577 | 588 | | |
578 | 589 | | |
| |||
747 | 758 | | |
748 | 759 | | |
749 | 760 | | |
750 | | - | |
| 761 | + | |
751 | 762 | | |
752 | 763 | | |
753 | 764 | | |
754 | 765 | | |
755 | 766 | | |
756 | 767 | | |
757 | | - | |
| 768 | + | |
758 | 769 | | |
759 | 770 | | |
760 | 771 | | |
| |||
1277 | 1288 | | |
1278 | 1289 | | |
1279 | 1290 | | |
1280 | | - | |
| 1291 | + | |
1281 | 1292 | | |
1282 | 1293 | | |
1283 | 1294 | | |
1284 | 1295 | | |
1285 | | - | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
1286 | 1308 | | |
1287 | 1309 | | |
1288 | 1310 | | |
1289 | 1311 | | |
1290 | 1312 | | |
1291 | | - | |
| 1313 | + | |
1292 | 1314 | | |
1293 | 1315 | | |
1294 | 1316 | | |
1295 | | - | |
| 1317 | + | |
1296 | 1318 | | |
1297 | 1319 | | |
1298 | 1320 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
64 | | - | |
| 64 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
57 | | - | |
| 57 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
71 | 71 | | |
72 | 72 | | |
73 | 73 | | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
74 | 83 | | |
75 | 84 | | |
76 | 85 | | |
| |||
0 commit comments