Skip to content

Commit 68eafa2

Browse files
committed
S_scan_ident: Swap conditionals order
It's clearer to handle the short case first, and put the much longer case afterwards.
1 parent af8856a commit 68eafa2

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

toke.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10909,7 +10909,13 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, U32 flags)
1090910909
* 4) *d is NUL for anything else.
1091010910
*/
1091110911

10912-
if (bracket != NO_BRACE) { /* Found a '{' */
10912+
if (bracket == NO_BRACE) {
10913+
if ( PL_lex_state == LEX_INTERPNORMAL
10914+
&& ! PL_lex_brackets
10915+
&& ! intuit_more(s, PL_bufend, FROM_IDENT, NULL, 0))
10916+
PL_lex_state = LEX_INTERPEND;
10917+
}
10918+
else { /* Found a '{' */
1091310919
bool skip;
1091410920
char *s2;
1091510921

@@ -11029,10 +11035,6 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, U32 flags)
1102911035
PL_parser->sub_no_recover = TRUE;
1103011036
}
1103111037
}
11032-
else if ( PL_lex_state == LEX_INTERPNORMAL
11033-
&& !PL_lex_brackets
11034-
&& !intuit_more(s, PL_bufend, FROM_IDENT, NULL, 0))
11035-
PL_lex_state = LEX_INTERPEND;
1103611038

1103711039
return s;
1103811040
}

0 commit comments

Comments
 (0)