module Haml::Precompiler
def parse_static_hash(text)
def parse_static_hash(text) return {} unless text attributes = {} text.split(',').each do |attrib| key, value, more = attrib.split('=>') # Make sure the key and value and only the key and value exist # Otherwise, it's too complicated or dynamic and we'll defer it to the actual Ruby parser key = parse_literal_value key value = parse_literal_value value return nil if more || key.nil? || value.nil? attributes[key] = value end attributes end