summaryrefslogtreecommitdiff
path: root/toke.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-08-22 06:01:45 -0700
committerFather Chrysostomos <sprout@cpan.org>2014-08-24 19:02:57 -0700
commita49203fdc35b175db76cae4906baaa8c2e43f3ee (patch)
treee9d3d64bfb3b840ce049de0f7eed82d226652a7c /toke.c
parentc5e7362b9fa800205fbbf248000e4baf621d7bec (diff)
downloadperl-a49203fdc35b175db76cae4906baaa8c2e43f3ee.tar.gz
toke.c: Consolidate some PL_expect assignments
The previous commit allows these settings of PL_expect to be combined. We no longer need one before force_next in each instance.
Diffstat (limited to 'toke.c')
-rw-r--r--toke.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/toke.c b/toke.c
index 3595570b53..d1325b3acc 100644
--- a/toke.c
+++ b/toke.c
@@ -218,10 +218,9 @@ static const char* const lex_state_names[] = {
#define PREREF(retval) return (PL_expect = XREF,PL_bufptr = s, REPORT(retval))
#define TERM(retval) return (CLINE, PL_expect = XOPERATOR, PL_bufptr = s, REPORT(retval))
#define POSTDEREF(f) return (PL_bufptr = s, S_postderef(aTHX_ REPORT(f),s[1]))
-#define LOOPX(f) return (PL_expect = XOPERATOR, \
- PL_bufptr = force_word(s,WORD,TRUE,FALSE), \
+#define LOOPX(f) return (PL_bufptr = force_word(s,WORD,TRUE,FALSE), \
pl_yylval.ival=f, \
- (void)(PL_nexttoke || (PL_expect = XTERM)), \
+ PL_expect = PL_nexttoke ? XOPERATOR : XTERM, \
REPORT((int)LOOPEX))
#define FTST(f) return (pl_yylval.ival=f, PL_expect=XTERMORDORDOR, PL_bufptr=s, REPORT((int)UNIOP))
#define FUN0(f) return (pl_yylval.ival=f, PL_expect=XOPERATOR, PL_bufptr=s, REPORT((int)FUNC0))
@@ -7611,7 +7610,6 @@ Perl_yylex(pTHX)
case KEY_require:
s = SKIPSPACE1(s);
- PL_expect = XOPERATOR;
if (isDIGIT(*s)) {
s = force_version(s, FALSE);
}
@@ -7632,7 +7630,7 @@ Perl_yylex(pTHX)
}
else
pl_yylval.ival = 0;
- if (!PL_nexttoke) PL_expect = XTERM;
+ PL_expect = PL_nexttoke ? XOPERATOR : XTERM;
PL_bufptr = s;
PL_last_uni = PL_oldbufptr;
PL_last_lop_op = OP_REQUIRE;