diff options
author | Aaron Crane <arc@cpan.org> | 2019-10-20 11:51:17 +0200 |
---|---|---|
committer | Aaron Crane <arc@users.noreply.github.com> | 2019-10-21 11:43:36 +0200 |
commit | 17b42099bd4ec443cc2990482d0646bc4eb53fad (patch) | |
tree | b0251721e065a5524bee21450e587c297a193770 /toke.c | |
parent | e45d26ee9d217505dd65cec0821439f1995b16b6 (diff) | |
download | perl-17b42099bd4ec443cc2990482d0646bc4eb53fad.tar.gz |
toke.c: factor out static yyl_sglquote()
Diffstat (limited to 'toke.c')
-rw-r--r-- | toke.c | 26 |
1 files changed, 16 insertions, 10 deletions
@@ -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); |