liquid/lib/liquid/parser.rb
2013-07-24 11:41:47 -04:00

15 lines
325 B
Ruby

module Liquid
# This class is used by tags to parse themselves
# it provides helpers and encapsulates state
class Parser
def initialize(input)
@tokens = tokenize(input)
@p = 0 # pointer to current location
end
def tokenize(input)
input.split(/\b/).map {|tok| tok.strip}
end
end
end