Skip to content

Commit

Permalink
Invoke PL_infix_plugin for identifier-named custom infix operators
Browse files Browse the repository at this point in the history
  • Loading branch information
leonerd committed Apr 23, 2021
1 parent 5192409 commit 7e1c11e
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions toke.c
Expand Up @@ -8640,6 +8640,22 @@ yyl_keylookup(pTHX_ char *s, GV *gv)
}
}

/* Check for plugged-in named operator */
{
struct Perl_custom_infix *def;
int result;
result = PL_infix_plugin(aTHX_ PL_tokenbuf, len, &def);
if(result) {
if((STRLEN)result != len)
Perl_croak(aTHX_ "Bad infix plugin result (%d) - did not consume entire identifier <%s>\n",
result, PL_tokenbuf);
PL_bufptr = s = d;
pl_yylval.pval = (char *)def;
CLINE;
return REPORT(PLUGRELOP);
}
}

/* Is this a label? */
if (!anydelim && PL_expect == XSTATE
&& d < PL_bufend && *d == ':' && *(d + 1) != ':') {
Expand Down

0 comments on commit 7e1c11e

Please sign in to comment.