summaryrefslogtreecommitdiff
path: root/lisp/progmodes/perl-mode.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2007-11-30 19:21:33 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2007-11-30 19:21:33 +0000
commita0e3c626e8bbbf06d0c3da0011ab71986c6ee073 (patch)
tree7b36b5f98a3cc4894055811878a5608b7cc06539 /lisp/progmodes/perl-mode.el
parent40632cf37d267f920eaff09a1187227e50bafae4 (diff)
downloademacs-a0e3c626e8bbbf06d0c3da0011ab71986c6ee073.tar.gz
(perl-font-lock-syntactic-keywords): Don't match "sub { (...) ... }".
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r--lisp/progmodes/perl-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
index 809ed7a9f36..ee14100f56d 100644
--- a/lisp/progmodes/perl-mode.el
+++ b/lisp/progmodes/perl-mode.el
@@ -266,7 +266,9 @@ The expansion is entirely correct because it uses the C preprocessor."
;; format statements
("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 '(7)))
;; Funny things in sub arg specifications like `sub myfunc ($$)'
- ("\\<sub\\s-+\\S-+\\s-*(\\([^)]+\\))" 1 '(1))
+ ;; Be careful not to match "sub { (...) ... }".
+ ("\\<sub[[:space:]]+[^{}[:punct:][:space:]]+[[:space:]]*(\\([^)]+\\))"
+ 1 '(1))
;; Regexp and funny quotes.
("\\(?:[?:.,;=!~({[]\\|\\(^\\)\\)[ \t\n]*\\(/\\)"
(2 (if (and (match-end 1)