360
361
public match(token: string): ThemeTrieElementRule {
363
>
return this._mainRule;
364
>
}
365
>
366
>
const dotIndex = token.indexOf('.');
367
>
let head: string;
368
>
let tail: string;
369
>
if (dotIndex === -1) {
370
>
head = token;
371
>
tail = '';
372
>
} else {
373
>
head = token.substring(0, dotIndex);
374
>
tail = token.substring(dotIndex + 1);
375
>
}
376
>
377
>
const child = this._children.get(head);
378
>
if (typeof child !== 'undefined') {
379
>
return child.match(tail);
380
>
}
381
382
return this._mainRule;
384
385
public insert(token: string, fontStyle: FontStyle, foreground: ColorId, background: ColorId): void {