Add parser tests

This commit is contained in:
Tristan Hume
2013-07-26 13:09:36 -04:00
parent 83e71ace99
commit 1b43bf5686
2 changed files with 75 additions and 7 deletions
+1 -7
View File
@@ -40,12 +40,6 @@ module Liquid
token.contents
end
def cur_token()
tok = @tokens[@p]
raise SyntaxError, 'Expected more input.' unless tok
tok
end
def look(type, ahead = 0)
tok = @tokens[@p + ahead]
return false unless tok
@@ -55,7 +49,7 @@ module Liquid
# === General Liquid parsing functions ===
def expression
token = cur_token
token = @tokens[@p]
if token.type == :id
variable_signature
elsif [:string, :integer, :float].include? token.type