[Top][All Lists]

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

Re: [Nano-devel] [PATCH] Some improvements to the c syntax

From: Benno Schulenberg
Subject: Re: [Nano-devel] [PATCH] Some improvements to the c syntax
Date: Sun, 10 Dec 2017 15:38:24 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

Op 10-12-17 om 14:50 schreef Liu Hao:
On 2017/12/10 21:11, Benno Schulenberg wrote:
I think #define should not color what comes after it.

This does not seem practically possible. I tried moving the rule for MACROs
after this rule but it turned out that every occurrence got colored - not only
those following `#define` immediately, but those inside the macro body.

I don't understand what you mean.  Do you mean #define inside a macro
body gets colored and you don't want it to be?

Anyway, to test the patch, I look at these two locations:

   nano +52 src/nano.h
   nano +797 src/global.c

For the first one, the stuff after the #define is valid C, so it
should be colored as C.  And thus it should be this way for all
#defines.  For the second case, both lines of the #if should be
colored.  The symbols used in the #ifs, #ifdefs and #ifndefs are
not really part of the program, they are configuration, so I like
it when they are not colored as if they were program symbols.

Together with #else and #endif it should be in a single-line color command.
Maybe also #include should be in the single-line one?

This will require two rules, one of which is for the single-line and the other
is multiple-line. I have attached an alternative patch for this.

Yes.  I propose instead the upcoming patch.


reply via email to

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