Unfinished if statement parser.

This commit is contained in:
Tristan Hume
2013-07-26 09:32:08 -04:00
parent 17d818b453
commit 673826630c
2 changed files with 47 additions and 17 deletions
+9
View File
@@ -31,6 +31,15 @@ module Liquid
token.contents
end
# Like consume? Except for an :id token of a certain name
def id?(str)
token = @tokens[@p]
return false unless token && token.type == :id
return false unless token.contents == str
@p += 1
token.contents
end
def cur_token()
tok = @tokens[@p]
raise SyntaxError, 'Expected more input.' unless tok