lib/liquid/context.rb
# Look up variable, either resolve directly after considering the name. We can directly handle 
# Strings, digits, floats and booleans (true,false). If no match is made we lookup the variable in the current scope and 
# later move up to the parent blocks to see if we can resolve the variable somewhere up the tree.
# Some special keywords return symbols. Those symbols are to be called on the rhs object in expressions
#
# Example: 
#
#   products == empty #=> products.empty?
#
Look up variable, either resolve directly after considering the name. We can directly handle
Strings, digits, floats and booleans (true,false). If no match is made we lookup the variable in the current scope and
later move up to the parent blocks to see if we can resolve the variable somewhere up the tree.
Some special keywords return symbols. Those symbols are to be called on the rhs object in expressions




Look up variable either resolve directly after considering the name . We can directly handle Strings digits floats and booleans ( true false ) . If no match is made we lookup the variable in the current scope and later move up to the parent blocks to see if we can resolve the variable somewhere up the tree . Some special keywords return symbols . Those symbols are to be called on the rhs object in expressions
def resolve(key)    
      case key
      when nil
        nil
      when 'true'
        true
      when 'false'
        false
      when 'empty'
        :empty?
      when 'nil', 'null'
        nil
      when /^'(.*)'$/
        $1.to_s
      when /^"(.*)"$/
        $1.to_s        
      when /^(\d+)$/ 
        $1.to_i
      when /^(\d[\d\.]+)$/ 
        $1.to_f
      else
        variable(key)
      end
    end
def resolve ( key ) case key when nil nil when 'true' true when 'false' false when 'empty' :empty? when 'nil' , 'null' nil when / ^'(.*)'$ / $1 . to_s when / ^"(.*)"$ / $1 . to_s when / ^( \d +)$ / $1 . to_i when / ^( \d [ \d \. ]+)$ / $1 . to_f else variable ( key ) end end
Look up variable, either resolve directly after considering the name.
Look up variable either resolve directly after considering the name .
# Single quoted strings # Double quoted strings # Integer and floats
key
<not_specific>