summaryrefslogtreecommitdiffstats
path: root/Keyword.xs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-07-23 11:46:07 -0400
committerJesse Luehrs <doy@tozt.net>2013-07-23 11:46:07 -0400
commit310ba62c846379ad914942e36b9111084a364899 (patch)
treeba10e262aa8df6ab3601298e6e0c50dd63b0ac36 /Keyword.xs
parent61549ba2da59230f7eb8b53745ea25729f7b1eb9 (diff)
downloadparse-keyword-310ba62c846379ad914942e36b9111084a364899.tar.gz
parse-keyword-310ba62c846379ad914942e36b9111084a364899.zip
actually, throw an exception on parse errors
Diffstat (limited to 'Keyword.xs')
-rw-r--r--Keyword.xs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Keyword.xs b/Keyword.xs
index a68af05..8cfb87a 100644
--- a/Keyword.xs
+++ b/Keyword.xs
@@ -23,16 +23,21 @@ static SV *parser_fn(OP *(fn)(pTHX_ U32), bool named)
{
I32 floor;
CV *code;
+ U8 errors;
REENTER_PARSER;
+ SAVEI8(PL_parser->error_count);
+ PL_parser->error_count = 0;
floor = start_subparse(0, named ? 0 : CVf_ANON);
code = newATTRSUB(floor, NULL, NULL, NULL, fn(aTHX_ 0));
+ errors = PL_parser->error_count;
+
LEAVE_PARSER;
- if (PL_parser->error_count) {
- return newSV(0);
+ if (errors) {
+ croak_sv(ERRSV);
}
else {
if (CvCLONE(code)) {