GNU nano - Bugs: bug #50355, "/*" inside a string is...
You are not allowed to post comments on this tracker with your current authentication level.
bug #50355: "/*" inside a string is treated as start of comment block
Submitter: | None | ||
Submitted: | Sun 19 Feb 2017 06:57:04 PM UTC | ||
Severity: | 2 - Minor | Status: | Wont Fix |
Assigned to: | None | Open/Closed: | Closed |
Tue 21 Feb 2017 12:46:58 PM UTC, comment #1: |
Benno Schulenberg <bens> |
Sun 19 Feb 2017 06:57:04 PM UTC, original submission:
When opening the following minimal example in nano (representing a string containing "/*", followed by an empty comment block), it is highlighted incorrectly, as if the comment block began in the middle of the string.
|
Anonymous |
No files currently attached
Depends on the following items: None found
Items that depend on this one: None found
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 4 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-02-24 | bens | Severity | 3 - Normal | 2 - Minor | |
Open/Closed | Open | Closed | |||
2017-02-21 | bens | Status | None | Wont Fix | |
Summary | "/*" in string is treated as comment block | "/*" inside a string is treated as start of comment block |
Powered by Savane 3.13-758e.
Corresponding source code
Sorry, can't be helped. Nano applies the color regexes one after the other, to the whole text of the file. So either strings inside comments would get colored as strings, or comments inside strings get colored as comments. The latter case seems to occur the least frequently (it does not occur in nano's source, whereas the former occurs some fifty times), so that is why the order is as it is. If you don't mind strings inside comments standing out, you could swap the order of the regexes in c.nanorc and javascript.nanorc.
Maybe someday the coloring code will be retwritten to understand that some things are strings and that there contents should not be interpreted in any way. But that is a long way off.