def parse_static_hash(text)
      attributes = {}
      return attributes if text.empty?

      text = text[1...-1] # strip brackets
      scanner = StringScanner.new(text)
      scanner.scan(/\s+/)
      until scanner.eos?
        return unless key = scanner.scan(LITERAL_VALUE_REGEX)
        return unless scanner.scan(/\s*=>\s*/)
        return unless value = scanner.scan(LITERAL_VALUE_REGEX)
        return unless scanner.scan(/\s*(?:,|$)\s*/)
        attributes[eval(key).to_s] = eval(value).to_s
      end
      attributes
    end
def parse_static_hash(text)
      attributes = {}
      return attributes if text.empty?

      text = text[1...-1] # strip brackets
      scanner = StringScanner.new(text)
      scanner.scan(/\s+/)
      until scanner.eos?
        return unless key = scanner.scan(LITERAL_VALUE_REGEX)
        return unless scanner.scan(/\s*=>\s*/)
        return unless value = scanner.scan(LITERAL_VALUE_REGEX)
        return unless scanner.scan(/\s*(?:,|$)\s*/)
        attributes[eval(key).to_s] = eval(value).to_s
      end
      attributes
    end
This method doesn't use Haml::AttributeParser because currently it depends on Ripper and Rubinius doesn't provide it.
 Ideally this logic should be placed in Haml::AttributeParser instead of here and this method should use it.

 @param  [String] text - Hash literal or text inside old attributes
 @return [Hash,nil] - Return nil if text is not static Hash literal