Skip to content

Commit 069cf82

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

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

toke.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10996,7 +10996,17 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, U32 flags)
1099610996

1099710997
/* Expect to find a closing '}' after consuming any trailing
1099810998
* whitespace. */
10999-
if (*s2 == '}') { /* Now increment line numbers if applicable. */
10999+
if (*s2 != '}') {
11000+
/* Didn't find the closing '}' at the point we expected, so
11001+
* restore the state such that the next thing to process is the
11002+
* opening '{' and let the parser handle it */
11003+
s = SvPVX(PL_linestr) + bracket;
11004+
CopLINE_set(PL_curcop, orig_copline);
11005+
PL_parser->herelines = herelines;
11006+
*dest = '\0';
11007+
PL_parser->sub_no_recover = TRUE;
11008+
}
11009+
else { /* Now increment line numbers if applicable. */
1100011010
if (skip)
1100111011
s = skipspace(s);
1100211012
s++;
@@ -11024,16 +11034,6 @@ S_scan_ident(pTHX_ char *s, char *dest, char *dest_end, U32 flags)
1102411034
}
1102511035
}
1102611036
}
11027-
else {
11028-
/* Didn't find the closing '}' at the point we expected, so
11029-
* restore the state such that the next thing to process is the
11030-
* opening '{" and let the parser handle it */
11031-
s = SvPVX(PL_linestr) + bracket;
11032-
CopLINE_set(PL_curcop, orig_copline);
11033-
PL_parser->herelines = herelines;
11034-
*dest = '\0';
11035-
PL_parser->sub_no_recover = TRUE;
11036-
}
1103711037
}
1103811038

1103911039
return s;

0 commit comments

Comments
 (0)