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

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

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>
Group administrator
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>
Group administrator

 

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

    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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2021-12-16 bens Open/ClosedOpen Closed
    2021-10-26 bens StatusNone Fixed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code