bugGNU nano - Bugs: bug #61389, several syntaxes colorize...


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

bug #61389: several syntaxes colorize "this\" as a valid string

Submitted by:  Benno Schulenberg <bens>
Submitted on:  Tue 26 Oct 2021 12:30:20 PM UTC  
Severity:  2 - Minor Status:  Fixed
Assigned to:  Benno Schulenberg <bens> Open/Closed:  Open

Tue 26 Oct 2021 12:44:09 PM UTC, comment #1: 

Fixed in git, commit 7bd68365, by changing [^"] to [^"\] for each relevant syntax.

(There are a few syntaxes that do not OR the [^"] with \\. but with \\", and I'm not sure if the latter can be changed to \\. -- maybe it can, so possibly there is still some room for improvement.)

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Tue 26 Oct 2021 12:30:20 PM UTC, original submission:  

To reproduce run 'src/nano -Ysh' and type: "This\".
See that "This\" is colored bright yellow, as if it were a valid string.  This is wrong.  A bunch of other syntaxes have the same problem, for example those for Go, Guile, HTML, PHP.

The problem is that those syntaxes allow any character except the relevant quote between the quotes.

Those negated ranges should, however, exclude also the backslash character.  This is possible when the negated range is ORed with "\\.", which allows the backslash everywhere except in the last position of the string (unless itself escaped).

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.


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 (Submitted the item)

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

    Only logged-in users can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-10-26 bens StatusNone => Fixed

    Back to the top

    Powered by Savane 3.7