203
*/
204
parse(input: string): ContextKeyExpression | undefined {
206
>
if (input === '') {
207
this._parsingErrors.push({ message: errorEmptyString, offset: 0, lexeme: '', additionalInfo: hintEmptyString });
208
return undefined;
209
}
211
>
this._tokens = this._scanner.reset(input).scan();
212
>
// @ulugbekna: we do not stop parsing if there are lexing errors to be able to reconstruct regexes with unescaped slashes; TODO@ulugbekna: make this respect config option for recovery
213
>
214
>
this._current = 0;
215
>
this._parsingErrors = [];
216
>
217
>
try {
218
>
const expr = this._expr();
219
>
if (!this._isAtEnd()) {
220
const peek = this._peek();
221
const additionalInfo = peek.type === TokenType.Str ? hintUnexpectedToken : undefined;