Replace hand-coded lexer with faster hacky lexer.

This commit is contained in:
Tristan Hume
2013-07-24 11:41:47 -04:00
parent 2332d86156
commit ee14775f83
3 changed files with 5 additions and 63 deletions
+5 -1
View File
@@ -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