         (forward-char -1)
         (looking-at "\\(\\)"))
       t)))
+
+(defun haml-move (re)
+  "Try matching and moving to the end of a regular expression."
+  (when (looking-at re)
+    (goto-char (match-end 0))
+    t))
 
 (defun haml-highlight-interpolation (limit)
   "Highlight Ruby interpolation (#{foo})."

  (save-excursion
    (while t
      (beginning-of-line)
      (if (looking-at "^ *\\(?:[.#%][a-z0-9_:\\-]+\\)+{")
          (progn
            (goto-char (- (match-end 0) 1))
            (haml-limited-forward-sexp (save-excursion (end-of-line) (point)))
            (return-from haml-parse-multiline-attr-hash
              (if (eq (char-before) ?,)
                  `((indent . ,(current-indentation))
                    (hash-indent . ,(- (match-end 0) (match-beginning 0)))
                    (point . ,(match-beginning 0)))
                nil)))
        (forward-line -1)
        (end-of-line)
        (when (not (eq (char-before) ?,))
          (return-from haml-parse-multiline-attr-hash nil))))))

(defun haml-compute-indentation ()
  "Calculate the maximum sensible indentation for the current line."

  "Returns t if the current line can have lines nested beneath it."
  (let ((attr-props (haml-parse-multiline-attr-hash)))
    (when attr-props
      (return-from haml-indent-p
        (if (haml-unclosed-attr-hash-p) (cdr (assq 'hash-indent attr-props))
          (list (+ (cdr (assq 'indent attr-props)) haml-indent-offset) nil)))))
  (loop for opener in haml-block-openers
        if (looking-at opener) return t
