[Top][All Lists]

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

Re: [Nano-devel] [PATCH] syntax: perl: don't color the character after a

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] syntax: perl: don't color the character after a variable name
Date: Tue, 6 Aug 2019 20:09:25 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

Op 04-08-19 om 14:24 schreef Brand Huntsman:
> On Sun,  4 Aug 2019 12:53:25 +0200 Benno Schulenberg <address@hidden>
> wrote:
>> This fixes
>> +color cyan "[$@%][0-9A-Za-z_]+"
> The following is more correct, but doesn't include support for ::, ' or
> unicode identifiers.
> "[$@%&*]\$?(\^[][A-Z^_?\]|[0-9]+|[A-Za-z_][0-9A-Za-z_]*|[][`~!@#$%&*-=+;:'",.\\|/?()<>])|\{(\^_?[0-9A-Za-z]+|[0-9]+|[A-Za-z_][0-9A-Za-z_]*)\})"

What do the & and * sigils do?

Why is the "\$?" there?

The $# and $* and $[ variables are deprecated, so I don't think
those should be colored.

The "*-=" fragment is a range that includes all digits.  When "-"
should be taken literally, it needs to be first or last in the set.
But instead of enumerating all possible characters, I would use a
few short ranges: "[][!-/:-?\`|~]".

And to keep things readable I would move the stuff between braces
to a separate regex.

But thanks for the suggested improvements.


Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

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