class Haml::Parser

def parse_old_attributes(text)

Returns:
  • (Integer) - last_line
  • (String) - rest
  • (String) - attributes_hash - Hash literal starting with `{` and ending with `}`
def parse_old_attributes(text)
  text = text.dup
  last_line = @line.index + 1
  begin
    attributes_hash, rest = balance(text, ?{, ?})
  rescue SyntaxError => e
    if text.strip[-1] == ?, && e.message == Error.message(:unbalanced_brackets)
      text << "\n#{@next_line.text}"
      last_line += 1
      next_line
      retry
    end
    raise e
  end
  return attributes_hash, rest, last_line
end