bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#26037: 25.1; perl-mode add syntax support for subroutine signatures


From: npostavs
Subject: bug#26037: 25.1; perl-mode add syntax support for subroutine signatures
Date: Sat, 11 Mar 2017 09:26:21 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

severity 26037 wishlist
quit

Evgeni Kolev <evgeni.d.kolev@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?





reply via email to

[Prev in Thread] Current Thread [Next in Thread]