store StringScanner in ParseContext and reuse it through parsing

This commit is contained in:
Michael Go
2025-01-07 14:32:45 -04:00
parent 002e4caea7
commit 7c592c1c00
18 changed files with 126 additions and 98 deletions
+6 -1
View File
@@ -50,8 +50,13 @@ class ThemeRunner
# `tokenize` will just test the tokenizen portion of liquid without any templates
def tokenize
ss = StringScanner.new("")
@tests.each do |test_hash|
tokenizer = Liquid::Tokenizer.new(test_hash[:liquid], true)
tokenizer = Liquid::Tokenizer.new(
source: test_hash[:liquid],
string_scanner: ss,
line_numbers: true,
)
while tokenizer.shift; end
end
end