File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -176,11 +176,16 @@ private static function processTokens(array $tokens): array
176176 }
177177
178178 // complementation - only parse BANG if it is at the start of a character group
179- if ($ type === self ::T_BANG && isset ($ resolved [array_key_last ($ resolved ) - 1 ]) && $ resolved [array_key_last ($ resolved ) - 1 ][0 ] === self ::T_BRACKET_OPEN ) {
179+ if ($ type === self ::T_BANG && isset ($ resolved [array_key_last ($ resolved )]) && $ resolved [array_key_last ($ resolved )][0 ] === self ::T_BRACKET_OPEN ) {
180180 $ resolved [] = [self ::T_BANG , '! ' ];
181181 continue ;
182182 }
183183
184+ if ($ type === self ::T_BANG ) {
185+ $ resolved [] = [self ::T_CHAR , $ char ];
186+ continue ;
187+ }
188+
184189 if ($ type === self ::T_BRACKET_OPEN ) {
185190 $ brackets [] = $ offset ;
186191 $ resolved [] = [$ type , $ char ];
You can’t perform that action at this time.
0 commit comments