File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,7 @@ private static function processTokens(array $tokens): array
128
128
{
129
129
$ resolved = [];
130
130
$ escaped = false ;
131
+ $ brackets = [];
131
132
for ($ offset = 0 ; $ offset < count ($ tokens ); $ offset ++) {
132
133
[$ type , $ char ] = $ tokens [$ offset ];
133
134
@@ -171,8 +172,18 @@ private static function processTokens(array $tokens): array
171
172
continue ;
172
173
}
173
174
175
+ if ($ type === self ::T_BRACKET_OPEN ) {
176
+ $ brackets [] = $ offset ;
177
+ }
178
+ if ($ type === self ::T_BRACKET_CLOSE ) {
179
+ array_pop ($ brackets );
180
+ }
181
+
174
182
$ resolved [] = [$ type , $ char ];
175
183
}
184
+ foreach ($ brackets as $ unterminatedBracket ) {
185
+ $ resolved [$ unterminatedBracket ] = [self ::T_CHAR , '[ ' ];
186
+ }
176
187
return $ resolved ;
177
188
}
178
189
}
You can’t perform that action at this time.
0 commit comments