mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-17 01:40:42 -07:00
Replace hand-coded lexer with faster hacky lexer.
This commit is contained in:
@@ -3,8 +3,12 @@ module Liquid
|
||||
# it provides helpers and encapsulates state
|
||||
class Parser
|
||||
def initialize(input)
|
||||
@input = input
|
||||
@tokens = tokenize(input)
|
||||
@p = 0 # pointer to current location
|
||||
end
|
||||
|
||||
def tokenize(input)
|
||||
input.split(/\b/).map {|tok| tok.strip}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user