348
349
while (!this._isAtEnd() && followingToken.type !== TokenType.And && followingToken.type !== TokenType.Or) {
351
>
case TokenType.LParen:
352
>
parenBalance++;
353
>
break;
354
>
case TokenType.RParen:
355
>
parenBalance--;
356
>
break;
357
>
case TokenType.RegexStr:
358
>
case TokenType.QuotedStr:
359
>
for (let i = 0; i < followingToken.lexeme.length; i++) {
360
>
if (followingToken.lexeme.charCodeAt(i) === CharCode.OpenParen) {
361
parenBalance++;
362
>
} else if (expr.lexeme.charCodeAt(i) === CharCode.CloseParen) {
contextkey.ts
363
parenBalance--;
364
}
366
>
}
367
>
if (parenBalance < 0) {
368
break;
369
}
370
>
lexemeReconstruction.push(Scanner.getLexeme(followingToken));
contextkey.ts
371
>
this._advance();
372
>
followingToken = this._peek();
373
>
}
374
375
const regexLexeme = lexemeReconstruction.join('');