summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorBranislav ZahradnĂ­k <barney@cpan.org>2020-12-11 17:19:05 +0100
committerKarl Williamson <khw@cpan.org>2020-12-27 09:46:09 -0700
commit25a505006bae8916ab7e2625092a90ef093fac01 (patch)
tree04fde53e7c8840a16e9d9a9f2b0f64de49d15464 /toke.c
parentdb83e45c10af8c06705fef1c3bd933ffa6a5e3f0 (diff)
downloadperl-25a505006bae8916ab7e2625092a90ef093fac01.tar.gz
Distinguish C- and perly- literals - PERLY_AMPERSAND
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index bec8f4d822..39da4651f0 100644
--- a/toke.c
+++ b/toke.c
@@ -386,6 +386,7 @@ static struct debug_tokens {
{ OROP, TOKENTYPE_IVAL, "OROP" },
{ OROR, TOKENTYPE_NONE, "OROR" },
{ PACKAGE, TOKENTYPE_NONE, "PACKAGE" },
+ DEBUG_TOKEN (IVAL, PERLY_AMPERSAND),
DEBUG_TOKEN (IVAL, PERLY_BRACE_CLOSE),
DEBUG_TOKEN (IVAL, PERLY_BRACE_OPEN),
DEBUG_TOKEN (IVAL, PERLY_BRACKET_CLOSE),
@@ -2039,7 +2040,7 @@ S_force_next(pTHX_ I32 type)
static int
S_postderef(pTHX_ int const funny, char const next)
{
- assert(funny == DOLSHARP || memCHRs("$@%&*", funny));
+ assert(funny == DOLSHARP || memCHRs("$@%&*", funny) || funny == PERLY_AMPERSAND);
if (next == '*') {
PL_expect = XOPERATOR;
if (PL_lex_state == LEX_INTERPNORMAL && !PL_lex_brackets) {
@@ -6242,7 +6243,7 @@ static int
yyl_ampersand(pTHX_ char *s)
{
if (PL_expect == XPOSTDEREF)
- POSTDEREF('&');
+ POSTDEREF(PERLY_AMPERSAND);
s++;
if (*s++ == '&') {
@@ -6288,9 +6289,9 @@ yyl_ampersand(pTHX_ char *s)
if (PL_tokenbuf[1])
force_ident_maybe_lex('&');
else
- PREREF('&');
+ PREREF(PERLY_AMPERSAND);
- TERM('&');
+ TERM(PERLY_AMPERSAND);
}
static int
@@ -7514,7 +7515,7 @@ yyl_just_a_word(pTHX_ char *s, STRLEN len, I32 orig_keyword, struct code c)
op_free(pl_yylval.opval), force_next(PRIVATEREF);
else op_free(c.rv2cv_op), force_next(BAREWORD);
pl_yylval.ival = 0;
- TOKEN('&');
+ TOKEN(PERLY_AMPERSAND);
}
/* If followed by var or block, call it a method (unless sub) */