bugGNU nano - Bugs: bug #30962, Incorrect syntax highlighting for...

 
 

bug #30962: Incorrect syntax highlighting for c/c++

Submitted by:  Danil Ilinykh <woodroof>
Submitted on:  Sat 04 Sep 2010 05:01:54 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: None
Privacy: PublicAssigned to: None
Open/Closed: OpenRelease: None

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 24 Feb 2014 11:10:41 AM UTC, comment #3:

No, it isn't fixed. Try this, for example:

some_function(param1, "/some/words/*",
param2, param3);
/* Some comment. */

This is due to the simple way nano colours things: it doesn't see that the first "/*" is within a string and therefore cannot be a comment starter.

You can avoid this particular case by demanding that any comment starts with a space. For example in the c.nanorc file:

color brightblue start="/\* " end=" \*/"

Benno Schulenberg <bens>
Project Member
Sat 19 Oct 2013 05:40:40 PM UTC, comment #2:

You get this also in PHP. (everything from the /* inside the $accept string to the */ before "lala" is highlighted as a multiple line comment. (GNU nano version 2.2.6 (compiled 20:32:12, Dec 3 2010)) Ubuntu 12.04

<?php
$accept="text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8";
$somecode="lala";
...
...

/*
multiple
line
comments
*/
lala
?>

Anonymous
Wed 22 Dec 2010 11:52:13 AM UTC, comment #1:

Looks like it works fine in 2.2.4

Original bug was for nano in Ubuntu 10.04.

Danil Ilinykh <woodroof>
Sat 04 Sep 2010 05:01:54 AM UTC, original submission:

some_function(param1, "/some/words/*",
param2, param3); <-- this line is highlighting as a comment

Danil Ilinykh <woodroof>

 

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

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bens (Posted a comment)
  • -unavailable- added by woodroof (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 24 Feb 2014 11:10:41 AM UTCbensSummaryIncorrect syntax highlighting for c++=>Incorrect syntax highlighting for c/c++

    Back to the top


    Powered by Savane 3.1-cleanup