bugGNU nano - Bugs: bug #49945, syntax coloring of C files does...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #49945: syntax coloring of C files does not show that // annuls /*

Submitter:  None
Submitted:  Wed 28 Dec 2016 03:07:06 PM UTC
   
 
Severity:  2 - Minor Status:  Wont Fix
Assigned to:  bens Open/Closed:  Closed

Fri 24 Feb 2017 11:40:04 AM UTC, comment #3: 

Can't fix, thus closing.  Thanks for reporting anyway.

Benno Schulenberg <bens>
Group administrator
Fri 30 Dec 2016 10:17:56 AM UTC, comment #2: 

The 'start="(^|[^/])/\*"' is a small improvement,
but it only covers the case of '//*', not the case
of '// /*', for example.  Also, above regex would
color the charater that is immediately before the
'/*'.  Mostly this will be whitespace, but if it
is a semicolon...

So, in fact I'm not going to change this.  The power of regexes is limited; can't be helped.

Benno Schulenberg <bens>
Group administrator
Wed 28 Dec 2016 04:40:41 PM UTC, comment #1: 

Good point.  Thanks!

I would shorten it to this, though:

color brightblue start="(^|[^/])/\*" end="\*/"

Can I add a Suggested-by tag with your name on it?  Or do you prefer to stay nameless?  :)  Or maybe you want to produce a full signed-off patch yourself?

Benno Schulenberg <bens>
Group administrator
Wed 28 Dec 2016 03:07:06 PM UTC, original submission:  

This is a suggestion about the use of comments in c and c++ of type /* ... */.

In c and c++ a double "//" annuls this type of comments. Something like this is not a comment in gcc:
//*
...
valid code
...
*/

while this is a comment:
/*
...
comment
...
*/

This behaviour is not produced by the line in c.nanorc, which colours both cases:
color brightblue start="/\*" end="\*/"

I rather use this:
color brightblue start="([^/]/\*|^/\*)" end="\*/"

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2017-02-24 bens Open/ClosedOpen Closed
        Summarybehaviour of comments of type /* ... */ in c and c++ files, after c.nanorc syntax coloring of C files does not show that // annuls /*
    2016-12-30 bens Severity3 - Normal 2 - Minor
        StatusIn Progress Wont Fix
    2016-12-28 bens StatusNone In Progress
        Assigned toNone bens

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code