refactor: delay creation of operatorsTrie and hide this implementation

BREAKING CHANGE: use `operators` instead of `operatorsTrie` as Tokenizer constructor argument, #500
This commit is contained in:
Jun Yang
2022-11-27 14:04:01 +08:00
parent ff112a4750
commit bb58d3e549
21 changed files with 86 additions and 96 deletions
+1 -1
View File
@@ -22,7 +22,7 @@ export class LiquidTagToken extends DelimitedToken {
this.name = ''
this.args = ''
} else {
const tokenizer = new Tokenizer(this.content, options.operatorsTrie)
const tokenizer = new Tokenizer(this.content, options.operators)
this.name = tokenizer.readTagName()
if (!this.name) throw new TokenizationError(`illegal liquid tag syntax`, this)
+1 -1
View File
@@ -18,7 +18,7 @@ export class TagToken extends DelimitedToken {
const value = input.slice(begin + tagDelimiterLeft.length, end - tagDelimiterRight.length)
super(TokenKind.Tag, value, input, begin, end, trimTagLeft, trimTagRight, file)
const tokenizer = new Tokenizer(this.content, options.operatorsTrie)
const tokenizer = new Tokenizer(this.content, options.operators)
this.name = tokenizer.readTagName()
if (!this.name) throw new TokenizationError(`illegal tag syntax`, this)