in reply to Re^2: Better way than tail-recursion in Parse::RecDescent?
in thread Better way than tail-recursion in Parse::RecDescent?
DDL_statement will now "succeed" until the end of the input. But you get to keep every error you encounter along the way.{ my @stmterrs; } DDL_stmtlist: DDL_statement(s? /;/) { if (@stmterrs) { push(@{$thisparser->{errors}}, @stmterrs); undef; } else { 1; } } DDL_statement: whatever | { push(@stmterrs, ["something fishy", $thisline]); } <resync: /[^;]*/s >
|
|---|