Skip to content
Open
10 changes: 5 additions & 5 deletions toke.c
Original file line number Diff line number Diff line change
Expand Up @@ -4811,8 +4811,11 @@ S_intuit_more(pTHX_ char *s, char *e,


case '\\':
if (s[1]) {
if (memCHRs("wds]", s[1])) {
if (s[1] == '\0') {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally: great change, maybe even add break into then branches and get rid of else if branches

Curious question: common pattern is condition if (s[1]), so why not use if (! s[1] as well

/* \ followed by NUL strongly indicates character class */
weight += 100;
}
else if (memCHRs("wds]", s[1])) {
weight += 100; /* \w \d \s => strongly charclass */
/* khw: \] can't happen, as any ']' is beyond our search.
* Why not \W \D \S \h \v, etc as well? Should they have
Expand Down Expand Up @@ -4866,9 +4869,6 @@ S_intuit_more(pTHX_ char *s, char *e,
* purposes of the 'seen' array. Whatever is matched by these
* backslashed sequences should not be added to 'seen'. That
* includes the backslash. */
}
else /* \ followed by NUL strongly indicates character class */
weight += 100;
break;

case '-':
Expand Down