class Crass::Parser
def consume_component_value(input = @tokens)
tokens.
Consumes a component value and returns it, or `nil` if there are no more
def consume_component_value(input = @tokens) return nil unless token = input.consume case token[:node] when :'{', :'[', :'(' consume_simple_block(input) when :function if token.key?(:name) # This is a parsed function, not a function token. This step isn't # mentioned in the spec, but it's necessary to avoid re-parsing # functions that have already been parsed. token else consume_function(input) end else token end end