(defconst cperl--package-for-imenu-rx
`(sequence symbol-start
(group-n 1 "package")
- ,cperl--ws*-rx
+ ,cperl--ws+-rx
(group-n 2 ,cperl--normal-identifier-rx)
(optional (sequence ,cperl--ws+-rx
(regexp ,cperl--version-regexp)))
;; (e.g. ":isa(Parent)") while packages don't. We skip over it, but
;; like for "package" we capture the following ";" or "{".
(defconst cperl--class-for-imenu-rx
- `(sequence symbol-start
+ `(sequence (or space line-start)
(group-n 1 "class")
- ,cperl--ws*-rx
+ ,cperl--ws+-rx
(group-n 2 ,cperl--normal-identifier-rx)
(optional (sequence ,cperl--ws+-rx
(regexp ,cperl--version-regexp)))
;; -------- various stuff calling for a package name
;; (matcher (subexp facespec) (subexp facespec))
`(,(rx (sequence
- (or (sequence symbol-start
+ (or (sequence (or line-start space "{" )
(or "package" "require" "use" "import"
"no" "bootstrap" "class")
(eval cperl--ws+-rx))
"With::Readers::auto_reader"
"With::Readers::named")))
(dolist (sub expected)
- (should (assoc-string sub index)))))))
+ (should (assoc-string sub index))))
+ (should-not (assoc-string "_false" index)))))
;;; Tests for issues reported in the Bug Tracker