Skip to content

Commit 25b56cc

Browse files
committed
toke.c: factor out static yyl_rightparen()
1 parent 03ebc77 commit 25b56cc

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

toke.c

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6371,6 +6371,19 @@ yyl_leftparen(pTHX_ char *s)
63716371
TOKEN('(');
63726372
}
63736373

6374+
static int
6375+
yyl_rightparen(pTHX_ char *s)
6376+
{
6377+
if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_CLOSING)
6378+
TOKEN(0);
6379+
s++;
6380+
PL_lex_allbrackets--;
6381+
s = skipspace(s);
6382+
if (*s == '{')
6383+
PREBLOCK(')');
6384+
TERM(')');
6385+
}
6386+
63746387
/*
63756388
yylex
63766389
@@ -7174,15 +7187,9 @@ Perl_yylex(pTHX)
71747187
s++;
71757188
PL_expect = XSTATE;
71767189
TOKEN(';');
7190+
71777191
case ')':
7178-
if (!PL_lex_allbrackets && PL_lex_fakeeof >= LEX_FAKEEOF_CLOSING)
7179-
TOKEN(0);
7180-
s++;
7181-
PL_lex_allbrackets--;
7182-
s = skipspace(s);
7183-
if (*s == '{')
7184-
PREBLOCK(')');
7185-
TERM(')');
7192+
return yyl_rightparen(aTHX_ s);
71867193

71877194
case ']':
71887195
return yyl_rightsquare(aTHX_ s);

0 commit comments

Comments
 (0)