@@ -1111,15 +1111,57 @@ do
1111
1111
tcode ++ ;
1112
1112
break ;
1113
1113
1114
- /* For a positive lookahead assertion, inspect what immediately follows.
1115
- If the next item is one that sets a mandatory character, skip this
1116
- assertion. Otherwise, treat it the same as other bracket groups. */
1114
+ /* For a positive lookahead assertion, inspect what immediately follows,
1115
+ ignoring intermediate assertions and callouts. If the next item is one
1116
+ that sets a mandatory character, skip this assertion. Otherwise, treat it
1117
+ the same as other bracket groups. */
1117
1118
1118
1119
case OP_ASSERT :
1119
1120
case OP_ASSERT_NA :
1120
1121
ncode = tcode + GET (tcode , 1 );
1121
1122
while (* ncode == OP_ALT ) ncode += GET (ncode , 1 );
1122
1123
ncode += 1 + LINK_SIZE ;
1124
+
1125
+ /* Skip irrelevant items */
1126
+
1127
+ for (BOOL done = FALSE; !done ;)
1128
+ {
1129
+ switch (* ncode )
1130
+ {
1131
+ case OP_ASSERT :
1132
+ case OP_ASSERT_NOT :
1133
+ case OP_ASSERTBACK :
1134
+ case OP_ASSERTBACK_NOT :
1135
+ case OP_ASSERT_NA :
1136
+ case OP_ASSERTBACK_NA :
1137
+ ncode += GET (ncode , 1 );
1138
+ while (* ncode == OP_ALT ) ncode += GET (ncode , 1 );
1139
+ ncode += 1 + LINK_SIZE ;
1140
+ break ;
1141
+
1142
+ case OP_WORD_BOUNDARY :
1143
+ case OP_NOT_WORD_BOUNDARY :
1144
+ case OP_UCP_WORD_BOUNDARY :
1145
+ case OP_NOT_UCP_WORD_BOUNDARY :
1146
+ ncode ++ ;
1147
+ break ;
1148
+
1149
+ case OP_CALLOUT :
1150
+ ncode += PRIV (OP_lengths )[OP_CALLOUT ];
1151
+ break ;
1152
+
1153
+ case OP_CALLOUT_STR :
1154
+ ncode += GET (ncode , 1 + 2 * LINK_SIZE );
1155
+ break ;
1156
+
1157
+ default :
1158
+ done = TRUE;
1159
+ break ;
1160
+ }
1161
+ }
1162
+
1163
+ /* Now check the next significant item. */
1164
+
1123
1165
switch (* ncode )
1124
1166
{
1125
1167
default :
1149
1191
case OP_WHITESPACE :
1150
1192
case OP_NOT_WHITESPACE :
1151
1193
tcode = ncode ;
1152
- continue ; /* With the following opcode */
1194
+ continue ; /* With the following significant opcode */
1153
1195
}
1154
1196
/* Fall through */
1155
1197
0 commit comments