refactor Lexer to only take StringScanner

This commit is contained in:
Michael Go
2025-01-07 14:32:46 -04:00
parent 253ec81b56
commit 04bd9dbe90
5 changed files with 8 additions and 10 deletions
+2 -2
View File
@@ -3,8 +3,8 @@
module Liquid
class Parser
def initialize(input)
input = input.is_a?(StringScanner) ? input : StringScanner.new(input.to_s)
@tokens = Lexer.tokenize(input, string_scanner)
ss = input.is_a?(StringScanner) ? input : StringScanner.new(input)
@tokens = Lexer.tokenize(ss)
@p = 0 # pointer to current location
end