|
From: | npostavs |
Subject: | bug#26037: 25.1; perl-mode add syntax support for subroutine signatures |
Date: | Sun, 26 Mar 2017 14:04:45 -0400 |
User-agent: | Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) |
Евгени Колев <evgenysw@gmail.com> writes: > The regex is now updated to include all the chars $%&*;@[\] > > I got the list of chars from here > http://perldoc.perl.org/perlsub.html#Prototypes It looks like "+" is another possible character: The + prototype is a special alternative to $ that will act like \[@%] when given a literal array or hash variable, but will otherwise force scalar context on the argument. This is useful for functions which should accept either a literal array or an array reference as the argument: sub mypush (+@) { > > This is the diff, please let me if it can be improved: > > ;; 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]*(\\([^)]+\\))" > + > ("\\<sub\\(?:[\s\t\n]+\\(?:\\sw\\|\\s_\\)+\\)?[\s\t\n]*(\\([][$%&*;@\\]+\\))" Please update the comment too. And if it's not too much trouble could you add a commit message as described in CONTRIBUTE? (And then post the output from 'git format-patch' instead of 'git diff')
[Prev in Thread] | Current Thread | [Next in Thread] |