                      (haml-limited-forward-sexp eol))))
 
                (haml-fontify-region-as-ruby (+ 1 beg) (point))))
-            (t (return-from loop)))))
-
-      ;; Move past end chars
-      (when (looking-at "[<>&!]+") (goto-char (match-end 0)))
-      ;; Highlight script
-      (if (looking-at "\\([=~]\\) \\(.*\\)$")
-          (haml-fontify-region-as-ruby (match-beginning 2) (match-end 2))
-        ;; Give font-lock something to highlight
-        (forward-char -1)
-        (looking-at "\\(\\)"))
-      t)))
+            (t (return-from loop))))))
+
+    ;; Move past end chars
+    (when (looking-at "[<>&!]+") (goto-char (match-end 0)))
+    ;; Highlight script
+    (if (looking-at "\\([=~]\\) \\(.*\\)$")
+        (haml-fontify-region-as-ruby (match-beginning 2) (match-end 2))
+      ;; Give font-lock something to highlight
+      (forward-char -1)
+      (looking-at "\\(\\)"))
+    t))
 
 (defun haml-move (re)
   "Try matching and moving to the end of a regular expression."

            ;; Highlight new attr hashes
            (?\(
             (forward-char 1)
             (while (haml-parse-new-attr-hash
                     (lambda (type beg end)
                       (case type
                         (name (put-text-property beg end 'face font-lock-constant-face))
                         (value (haml-fontify-region-as-ruby beg end)))))
               (end-of-line)
               (when (eobp) (return-from loop))
               (forward-line 1)
               (beginning-of-line)))
            ;; Highlight old attr hashes

TYPE is the type of text parsed ('name or 'value)
and BEG and END delimit that text in the buffer."
  (let ((eol (save-excursion (end-of-line) (point))))
    (while (not (haml-move ")"))
      (haml-move " *")
      (unless (haml-move "[a-z0-9_:\\-]+")
        (return-from haml-parse-new-attr-hash (haml-move " *$")))
      (funcall fn 'name (match-beginning 0) (match-end 0))
      (haml-move " *")
      (when (haml-move "=")
        (haml-move " *")
        (unless (looking-at "[\"'@a-z]") (return-from haml-parse-new-attr-hash))
        (let ((beg (point)))
          (haml-limited-forward-sexp eol)
          (funcall fn 'value beg (point)))
        (haml-move " *")))
    nil))

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