                            for class-style in filtered-class-styles
                            if (and (memq syntactic-context
                                          (plist-get class-style :contexts))
-                                   (looking-at (plist-get class-style :class-decl)))
+                                   (looking-at (plist-get class-style
+                                                          :class-decl)))
                            do (goto-char (match-end 0))
                            and return
                            (make-espresso--pitem

      (widen)
      (goto-char (point-max))
      (espresso--ensure-cache)
      (assert (eq espresso--last-parse-pos (point)))
      (let ((state espresso--state-at-last-parse-pos)
            (unknown-ctr (cons -1 nil)))

         ;; Make sure everything is closed
        (while (cdr state)
          (setq state
            (cons (espresso--pitem-add-child (second state) (car state))
                  (cddr state))))

        (assert (= (length state) 1))

        ;; Convert the new-finalized state into what imenu expects
        (espresso--pitems-to-imenu
         (car (espresso--pitem-children state))
         unknown-ctr)))))

(defun espresso--which-func-joiner (parts)
  (mapconcat #'identity parts "."))

;;; Main Function



  ;; Important to fontify the whole buffer syntactically! If we don't,
  ;; then we might have regular expression literals that aren't marked
  ;; as strings, which will screw up parse-partial-sexp, scan-lists,
  ;; etc. and and produce maddening "unbalanced parenthesis" errors.
  ;; When we attempt to find the error and scroll to the portion of
  ;; the buffer containing the problem, JIT-lock will apply the
  ;; correct syntax to the regular expresion literal and the problem
  ;; will mysteriously disappear.
  (font-lock-set-defaults)

  (let (font-lock-keywords) ; leaves syntactic keywords intact
