   (let ((index-alist '()) (case-fold-search nil)
 	name next pos decl sing)
     (goto-char beg)
-    (while (re-search-forward "^\\s *\\(\\(def class\\>\\(\\s *<<\\)?\\|module\\>\\)\\s *\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\>\\s *\\([^\(\n ]+\\)\\)" end t)
+    (while (re-search-forward "^\\s *\\(\\(class\\>\\(\\s *<<\\)?\\|module\\>\\)\\s *\\([^\(<\n ]+\\)\\|\\(def\\|alias\\)\\>\\s *\\([^\(\n ]+\\)\\)" end t)
       (setq sing (match-beginning 3))
       (setq decl (match-string 5))
       (setq next (match-end 0))

	  (while (and (> indent 0)
		      (re-search-backward
		       (concat
			"^[ \t]*\\(def class\\|module\\)[ \t]+"
			"\\([A-Z]" fancy-symbol-re "+\\)")
		       nil t))
	    (goto-char (match-beginning 1))

	       "catch"
               "finally"
               "retry"
	       "class"
	       "def"
               "return_local"
	       "return"
