nano-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Fix syntax highlighting regex of C labels


From: Benno Schulenberg
Subject: Re: [PATCH] Fix syntax highlighting regex of C labels
Date: Sat, 13 Mar 2021 14:29:06 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0

Op 12-03-2021 om 23:58 schreef Hussam al-Homsi:
> With this patch, a valid label like label1 in the following C code will now be
> highlighted:
> 
>     puts("skipped"); label1 : puts("reached");

Nano's syntaxes do not color everything that is valid in the relevant
language, because otherwise the regexes would also color things that
you do not want to have colored, or they would eat too much CPU time.
That's why the Python syntax requires a space before # (if # is not
at the start of the line), and the C syntax does not color multiline
strings, and other things like that.

Putting a label in the middle of a line is really poor style, so I
don't think the syntax needs to colorize it.  And a space between
label and colon... better not.  A patch to allow digits is welcome.

Benno

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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