GNU bug report logs -
#26037
25.1; perl-mode add syntax support for subroutine signatures
Previous Next
Reported by: Evgeni Kolev <evgeni.d.kolev <at> gmail.com>
Date: Thu, 9 Mar 2017 17:25:02 UTC
Severity: wishlist
Tags: fixed, patch
Found in version 25.1
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
Message #10 received at control <at> debbugs.gnu.org (full text, mbox):
severity 26037 wishlist
quit
Evgeni Kolev <evgeni.d.kolev <at> gmail.com> writes:
> perl 5.20 (released May 2014) added experimental support for subroutine
> signatures. So this is valid perl code:
>
> sub test ($param) {
> ...
> }
>
> However, perl-mode's syntax rules treat everything between ( and ) as
> punctuation (syntax class "."). As a result (thing-at-point 'word)
> doesn't return $param when the point is on $param because $param is
> considered punctuation. The patch below tries to address this by
> using syntax class "@" inside the parens.
>
> diff --git a/lisp/progmodes/perl-mode.el b/lisp/progmodes/perl-mode.el
> index a516f07..2b9d9ad 100644
> --- a/lisp/progmodes/perl-mode.el
> +++ b/lisp/progmodes/perl-mode.el
> @@ -258,7 +258,7 @@
> ;; 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]*(\\([^)]+\\))"
> - (1 "."))
> + (1 "@"))
Don't we still want 'sub ($)' and such to be marked with punctuation
syntax?
This bug report was last modified 8 years and 52 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.