Commit e93d277
committed
ParseXS: refactor: rationalise parse-fail action
Now that the XS parser builds a parse tree (AST), it spends most of its
time doing recursive-descent $some_node_object->parse() calls.
There is a common idiom within the current code along the lines of
$some_node_object->parse()
or return;
This makes a parse failure in a node propagate its way back up the call
chain. Note that many parse failures don't immediately croak; they
call blurt() which only warns, but also increments the error count;
parsing can continue.
During my big refactoring I haven't been entirely consistent here; this
commit adds a bunch of 'or return's that I missed. It also does a few
'or next's at higher levels, to get behaviour along the lines of:
"this XSUB had a syntax error, but continue trying to parse other XSUBs,
and only error out at the end."
This is all a bit going on gut feelings; in the final analysis it
doesn't matter too much how much more parsing gets done before xsubpp
finally croaks out.1 parent 64d7e86 commit e93d277
1 file changed
+13
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
552 | 552 | | |
553 | 553 | | |
554 | 554 | | |
555 | | - | |
| 555 | + | |
| 556 | + | |
556 | 557 | | |
557 | 558 | | |
558 | 559 | | |
| |||
1092 | 1093 | | |
1093 | 1094 | | |
1094 | 1095 | | |
1095 | | - | |
| 1096 | + | |
| 1097 | + | |
1096 | 1098 | | |
1097 | 1099 | | |
1098 | 1100 | | |
| |||
1121 | 1123 | | |
1122 | 1124 | | |
1123 | 1125 | | |
1124 | | - | |
| 1126 | + | |
1125 | 1127 | | |
1126 | 1128 | | |
1127 | 1129 | | |
| |||
1910 | 1912 | | |
1911 | 1913 | | |
1912 | 1914 | | |
1913 | | - | |
| 1915 | + | |
| 1916 | + | |
1914 | 1917 | | |
1915 | 1918 | | |
1916 | 1919 | | |
| |||
2306 | 2309 | | |
2307 | 2310 | | |
2308 | 2311 | | |
2309 | | - | |
| 2312 | + | |
| 2313 | + | |
2310 | 2314 | | |
2311 | 2315 | | |
2312 | 2316 | | |
| |||
4351 | 4355 | | |
4352 | 4356 | | |
4353 | 4357 | | |
4354 | | - | |
| 4358 | + | |
| 4359 | + | |
4355 | 4360 | | |
4356 | 4361 | | |
4357 | 4362 | | |
| |||
5048 | 5053 | | |
5049 | 5054 | | |
5050 | 5055 | | |
5051 | | - | |
| 5056 | + | |
| 5057 | + | |
5052 | 5058 | | |
5053 | 5059 | | |
5054 | 5060 | | |
| |||
0 commit comments