summaryrefslogtreecommitdiffstats
path: root/Keyword.xs
diff options
context:
space:
mode:
Diffstat (limited to 'Keyword.xs')
-rw-r--r--Keyword.xs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Keyword.xs b/Keyword.xs
index 7f70222..b52f98c 100644
--- a/Keyword.xs
+++ b/Keyword.xs
@@ -22,12 +22,17 @@
static SV *parser_fn(OP *(fn)(pTHX_ U32), bool named)
{
I32 floor;
+ OP *parsed;
CV *code;
REENTER_PARSER;
floor = start_subparse(0, named ? 0 : CVf_ANON);
- code = newATTRSUB(floor, NULL, NULL, NULL, fn(aTHX_ 0));
+ parsed = fn(aTHX_ 0);
+ if (PL_parser->error_count) {
+ return newSV(0);
+ }
+ code = newATTRSUB(floor, NULL, NULL, NULL, parsed);
LEAVE_PARSER;