Commit 9e4ed57
committed
ParseXS: refactor: remove $ExtUtils::ParseXS::END
(This commit is part of a series which will extend the AST parse tree
from just representing individual XSUBs to representing the whole XS
file.)
The parser, when parsing an XSUB (but not any other parts of an XS file),
pushes a special token onto the end of the list of lines in
@{$pxs->{line}} which make up the current paragraph. This token,
$ExtUtils::ParseXS::END = "!End!\n\n";
(along with a trailing ':') is designed to look like an impossible
keyword which can't actually appear in the source code (due to the
multiple newlines).
It looks like it was originally added in perl5.002 to make the parsing
code easier, but I don't really understand why. It just makes the
parser harder to understand.
So this commit removes it, and just relies on @{$pxs->{line}} being zero
to detect the end of the paragraph. This change doesn't alter the C code
generated from any of the XS files bundled with perl.1 parent 0bed57b commit 9e4ed57
File tree
2 files changed
+7
-21
lines changed- dist/ExtUtils-ParseXS/lib/ExtUtils
- ParseXS
2 files changed
+7
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
107 | | - | |
108 | 106 | | |
109 | | - | |
| 107 | + | |
110 | 108 | | |
111 | 109 | | |
112 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1210 | 1210 | | |
1211 | 1211 | | |
1212 | 1212 | | |
1213 | | - | |
1214 | | - | |
1215 | | - | |
1216 | | - | |
1217 | | - | |
1218 | | - | |
| 1213 | + | |
| 1214 | + | |
1219 | 1215 | | |
1220 | 1216 | | |
1221 | 1217 | | |
| |||
1786 | 1782 | | |
1787 | 1783 | | |
1788 | 1784 | | |
1789 | | - | |
1790 | | - | |
1791 | | - | |
1792 | | - | |
1793 | | - | |
1794 | | - | |
1795 | | - | |
1796 | 1785 | | |
1797 | 1786 | | |
1798 | 1787 | | |
| |||
1810 | 1799 | | |
1811 | 1800 | | |
1812 | 1801 | | |
1813 | | - | |
| 1802 | + | |
1814 | 1803 | | |
1815 | 1804 | | |
1816 | 1805 | | |
| |||
1830 | 1819 | | |
1831 | 1820 | | |
1832 | 1821 | | |
1833 | | - | |
1834 | 1822 | | |
1835 | 1823 | | |
1836 | | - | |
| 1824 | + | |
| 1825 | + | |
1837 | 1826 | | |
1838 | 1827 | | |
1839 | 1828 | | |
| |||
5701 | 5690 | | |
5702 | 5691 | | |
5703 | 5692 | | |
5704 | | - | |
5705 | | - | |
| 5693 | + | |
5706 | 5694 | | |
5707 | 5695 | | |
5708 | 5696 | | |
| |||
0 commit comments