summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorYves Orton <demerphq@gmail.com>2022-09-25 15:09:52 +0200
committerYves Orton <demerphq@gmail.com>2023-02-20 11:34:22 +0800
commit21938ae5a278f0b48443561333c47714921e7566 (patch)
tree62b372c8d2ea947696beeafc9b88be11ad909042 /toke.c
parent8a8491416c79dc8f491c402c013844437c0643eb (diff)
downloadperl-21938ae5a278f0b48443561333c47714921e7566.tar.gz
perl.h, pp_ctl.c - switch to standard way of terminating compilation
I did not fully understand the use of yyquit() when I implemented the SYNTAX_ERROR related stuff. It is not needed, and switching to this makes eval compile error messages more consistent.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c10
1 files changed, 1 insertions, 9 deletions
diff --git a/toke.c b/toke.c
index a4454fe010..60b17f040a 100644
--- a/toke.c
+++ b/toke.c
@@ -6218,6 +6218,7 @@ yyl_leftcurly(pTHX_ char *s, const U8 formbrack)
/* This hack is to get the ${} in the message. */
PL_bufptr = s+1;
yyerror("syntax error");
+ yyquit();
break;
}
OPERATOR(HASHBRACK);
@@ -12951,15 +12952,6 @@ Perl_yyerror_pvn(pTHX_ const char *const s, STRLEN len, U32 flags)
Perl_croak(aTHX_ "%s has too many errors.\n", name);
}
}
- else {
- /* This is a syntax error, and we should stop compiling. */
- assert(PERL_PARSE_IS_SYNTAX_ERROR(PL_error_count));
- if (errsv) {
- Perl_croak_sv(aTHX_ errsv);
- } else {
- abort_execution(errsv, name);
- }
- }
}
PL_in_my = 0;
PL_in_my_stash = NULL;