Method: Liquid::Parser#consume

Defined in:
lib/liquid/parser.rb

#consume(type = nil) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/liquid/parser.rb', line 15

def consume(type = nil)
  token = @tokens[@p]
  if type && token[0] != type
    raise SyntaxError, "Expected #{type} but found #{@tokens[@p].first}"
  end
  @p += 1
  token[1]
end