diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-04-02 11:03:14 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-04-02 11:03:14 +0200 |
commit | 40a33a3cb711f894ac61691c03cc13e58bc38145 (patch) | |
tree | 27fcb032eb04a20bd57b412b2120d357f28ab7fa /lisp/progmodes/perl-mode.el | |
parent | 59191cd0cbe8463f9095a71cb4048bb138d6e446 (diff) | |
parent | a184a7edc58e1e053aa317a0f162df7e225597e1 (diff) | |
download | emacs-40a33a3cb711f894ac61691c03cc13e58bc38145.tar.gz |
Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs
Diffstat (limited to 'lisp/progmodes/perl-mode.el')
-rw-r--r-- | lisp/progmodes/perl-mode.el | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el index a516f07e72f..b75f32ee200 100644 --- a/lisp/progmodes/perl-mode.el +++ b/lisp/progmodes/perl-mode.el @@ -255,9 +255,11 @@ ;; format statements ("^[ \t]*format.*=[ \t]*\\(\n\\)" (1 (prog1 "\"" (perl-syntax-propertize-special-constructs end)))) - ;; Funny things in `sub' arg-specs like `sub myfun ($)' or `sub ($)'. - ;; Be careful not to match "sub { (...) ... }". - ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([^)]+\\))" + ;; Propertize perl prototype chars `$%&*;+@\[]' as punctuation + ;; in `sub' arg-specs like `sub myfun ($)' and `sub ($)'. But + ;; don't match subroutine signatures like `sub add ($a, $b)', or + ;; anonymous subs like "sub { (...) ... }". + ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;+@\\]+\\))" (1 ".")) ;; Turn __DATA__ trailer into a comment. ("^\\(_\\)_\\(?:DATA\\|END\\)__[ \t]*\\(?:\\(\n\\)#.-\\*-.*perl.*-\\*-\\|\n.*\\)" |