                   (/= end shm-last-parse-end))
           (setq shm-last-parse-start start)
           (setq shm-last-parse-end end)
-          (let ((parsed-ast (shm-get-ast "decl" start end)))
+          (let ((parsed-ast (shm-get-ast (if (bound-and-true-p structured-haskell-repl-mode)
+                                             "stmt"
+                                           "decl")
+                                         start end)))
             (cl-flet ((bail ()
-                         (when shm-display-quarantine
-                           (shm-quarantine-overlay start end))
-                         (setq shm-lighter " SHM!")
-                         nil))
+                            (when shm-display-quarantine
+                              (shm-quarantine-overlay start end))
+                            (setq shm-lighter " SHM!")
+                            nil))
               (if parsed-ast
                   (progn
                     (when (bound-and-true-p structured-haskell-repl-mode)

  "Fontify TEXT as MODE, returning the fontified text."
  (with-temp-buffer
    (funcall mode)
    (insert text)
    (font-lock-fontify-buffer)
    (buffer-substring (point-min) (point-max))))

(defun shm-get-ast (type start end)
  "Get the AST for the given region at START and END. Parses with TYPE.

imagine."
  (let ((message-log-max nil)
        (buffer (current-buffer)))
    (when (> end start)
      (with-temp-buffer
        (let ((temp-buffer (current-buffer)))
          (with-current-buffer buffer
