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

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

bug#46024: Perl mode colors the word "argument" funny


From: Harald Jörg
Subject: bug#46024: Perl mode colors the word "argument" funny
Date: Fri, 22 Jan 2021 01:33:55 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)

積丹尼 Dan Jacobson <jidanni@jidanni.org> writes:

> Perl mode colors the word "argument" funny:
> for ( $r[$v] ) {
>         $_->{argument}  = 0 + shift;
> }
> Cperl mode doesn't.
> emacs-version "27.1"

"argument" as a keyword in Perl mode came as a patch for Bug#27613 -
together with a couple of other keywords: anon, has, our, state,
supersede, let, and temp.

However, only 'our' and 'state' are part of Perl 5.  A keyword 'has' is
available with popular Perl extensions (Moose, Moo etc.), so arguably
fontification as a declarator is acceptable... though slightly
inaccurate.

The keywords 'anon', 'has', 'supersede', 'let' and 'temp' are part of
the Raku language, which started as "Perl 6", as described in the
language docs:
https://docs.raku.org/language/variables#Variable_declarators_and_scope.
'argument' apparently didn't make it into the language at all, but Raku
also has 'augment' and 'constant', and Perl's 'local' is called 'temp'
in Raku.

CPerl mode has caught only a few keywords from non-core Perl, these are
also available with popular extensions ('try','catch','finally').  Perl
mode seems to have adopted some more Raku-stuff (e.g. it registers
variable names like "my $amazing-variable" to imenu, but fontifies only
the $amazing-part).

So I wonder: What is the ambition of Emacs to support Raku?  The
languages Perl (Perl 5) and Raku (Perl 6) have diverged in their syntax,
so robably it is rather cumbersome to support both with any of the Perl
modes.  In my opionion, randomly adding Raku features to the modes
brings more confusion than productivity, and in any case keywords which
are no longer part of either language should be eliminated, in
particular: 'argument', which is the topic of this bug report.
-- 
Cheers,
haj





reply via email to

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