summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorAaron Crane <arc@cpan.org>2019-10-20 11:51:17 +0200
committerAaron Crane <arc@users.noreply.github.com>2019-10-21 11:43:36 +0200
commit17b42099bd4ec443cc2990482d0646bc4eb53fad (patch)
treeb0251721e065a5524bee21450e587c297a193770 /toke.c
parente45d26ee9d217505dd65cec0821439f1995b16b6 (diff)
downloadperl-17b42099bd4ec443cc2990482d0646bc4eb53fad.tar.gz
toke.c: factor out static yyl_sglquote()
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/toke.c b/toke.c
index 9441effac3..84444735a6 100644
--- a/toke.c
+++ b/toke.c
@@ -6466,6 +6466,21 @@ yyl_rightpointy(pTHX_ char *s)
}
static int
+yyl_sglquote(pTHX_ char *s)
+{
+ s = scan_str(s,FALSE,FALSE,FALSE,NULL);
+ if (!s)
+ missingterm(NULL, 0);
+ COPLINE_SET_FROM_MULTI_END;
+ DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
+ if (PL_expect == XOPERATOR) {
+ no_op("String",s);
+ }
+ pl_yylval.ival = OP_CONST;
+ TERM(sublex_start());
+}
+
+static int
yyl_dblquote(pTHX_ char *s, STRLEN len)
{
char *d;
@@ -7510,16 +7525,7 @@ Perl_yylex(pTHX)
TERM(THING);
case '\'':
- s = scan_str(s,FALSE,FALSE,FALSE,NULL);
- if (!s)
- missingterm(NULL, 0);
- COPLINE_SET_FROM_MULTI_END;
- DEBUG_T( { printbuf("### Saw string before %s\n", s); } );
- if (PL_expect == XOPERATOR) {
- no_op("String",s);
- }
- pl_yylval.ival = OP_CONST;
- TERM(sublex_start());
+ return yyl_sglquote(aTHX_ s);
case '"':
return yyl_dblquote(aTHX_ s, len);