summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2019-10-20 11:53:03 +0200
committerAaron Crane <arc@users.noreply.github.com>2019-10-21 11:43:36 +0200
commit6c920f78a734d4239366642a6417c98e9fbc64c9 (patch)
tree7224961a54563fd932877815c80adc2bac1caab0 /toke.c
parent45f129a221de822c4792411af018bc92ef1286e0 (diff)
downloadperl-6c920f78a734d4239366642a6417c98e9fbc64c9.tar.gz
toke.c: factor out static yyl_backslash()
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/toke.c b/toke.c
index be7529c577..d54919f315 100644
--- a/toke.c
+++ b/toke.c
@@ -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) {