module Haml::AttributeParser

def parse(exp)

Returns:
  • (Hash, nil) - - Return parsed attribute Hash whose values are Ruby literals, or return nil if argument is not a single Hash literal.

Parameters:
  • exp (String) -- - Old attributes literal or Hash literal generated from new attributes.
def parse(exp)
  return nil unless hash_literal?(exp)
  hash = {}
  each_attribute(exp) do |key, value|
    hash[key] = value
  end
  hash
rescue UnexpectedTokenError, UnexpectedKeyError
  nil
end