diff options
author | Aaron Crane <arc@cpan.org> | 2019-10-20 11:53:03 +0200 |
---|---|---|
committer | Aaron Crane <arc@users.noreply.github.com> | 2019-10-21 11:43:36 +0200 |
commit | 6c920f78a734d4239366642a6417c98e9fbc64c9 (patch) | |
tree | 7224961a54563fd932877815c80adc2bac1caab0 /toke.c | |
parent | 45f129a221de822c4792411af018bc92ef1286e0 (diff) | |
download | perl-6c920f78a734d4239366642a6417c98e9fbc64c9.tar.gz |
toke.c: factor out static yyl_backslash()
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -6530,6 +6530,17 @@ yyl_backtick(pTHX_ char *s) TERM(sublex_start()); } +static int +yyl_backslash(pTHX_ char *s) +{ + if (PL_lex_inwhat == OP_SUBST && PL_lex_repl == PL_linestr && isDIGIT(*s)) + Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX),"Can't use \\%c to mean $%c in expression", + *s, *s); + if (PL_expect == XOPERATOR) + no_op("Backslash",s); + OPERATOR(REFGEN); +} + /* yylex @@ -7553,14 +7564,7 @@ Perl_yylex(pTHX) return yyl_backtick(aTHX_ s); case '\\': - s++; - if (PL_lex_inwhat == OP_SUBST && PL_lex_repl == PL_linestr - && isDIGIT(*s)) - Perl_ck_warner(aTHX_ packWARN(WARN_SYNTAX),"Can't use \\%c to mean $%c in expression", - *s, *s); - if (PL_expect == XOPERATOR) - no_op("Backslash",s); - OPERATOR(REFGEN); + return yyl_backslash(aTHX_ s + 1); case 'v': if (isDIGIT(s[1]) && PL_expect != XOPERATOR) { |