Commit 9f265a6
committed
mbe: Factor out a helper to parse and only keep spans on success
`try_match_macro` does a careful dance of saving the parser's spans,
restoring them on failure, and merging them on success.
Wrap this in a function, so we can easily reuse it.1 parent e3fccdd commit 9f265a6
File tree
2 files changed
+33
-21
lines changed- compiler/rustc_expand/src/mbe
2 files changed
+33
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| 76 | + | |
76 | 77 | | |
77 | 78 | | |
78 | 79 | | |
| |||
689 | 690 | | |
690 | 691 | | |
691 | 692 | | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
692 | 723 | | |
693 | 724 | | |
694 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
318 | 318 | | |
319 | 319 | | |
320 | 320 | | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
| 321 | + | |
333 | 322 | | |
334 | 323 | | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | 324 | | |
340 | 325 | | |
341 | 326 | | |
| |||
353 | 338 | | |
354 | 339 | | |
355 | 340 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | 341 | | |
361 | 342 | | |
362 | 343 | | |
| |||
0 commit comments