bugGNU nano - Bugs: bug #61694, [Wish] let the Python syntax...

 
 

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

bug #61694: [Wish] let the Python syntax decolorize stuff between braces in f-strings

Submitter:  Joshua <joshix>
Submitted:  Fri 17 Dec 2021 10:09:59 PM UTC
 
Severity:  1 - Wish Status:  Wont Fix
Assigned to:  None Open/Closed:  Closed

Wed 05 Jan 2022 03:04:47 PM UTC, comment #2: 

Can't fix.  Decolorizing anything between braces would also decolorize the elements of a dictionary.  Now, maybe dictionaries aren't used very often, but the people that do would be quite miffed if we started to decolorize all their elements.

The extended regular expressions that nano uses do not know lookbehind nor lookahead, so there is no way to determine whether a pair of braces is inside a string or not, so there is no way to distinguish between dictionaries and the braces in a formatted string literal.  If you think this selective decoloring is possible, provide a patch.

https://docs.python.org/3/reference/lexical_analysis.html#f-strings

Benno Schulenberg <bens>
Project Administrator
Thu 23 Dec 2021 01:32:59 PM UTC, comment #1: 

Provide a patch.  And add in the commit message a URL to the documentation section that explains f-strings.

Benno Schulenberg <bens>
Project Administrator
Fri 17 Dec 2021 10:09:59 PM UTC, original submission:  

Nano currently doesn't support syntax highlighting for f-strings in python.
Example f string: f"Date: {datetime.datetime.now():%y-%m-%d}"

Joshua <joshix>

 

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

Attached Files
file #52523:  2021-12-17_23-08.png added by joshix (5KiB - image/png - How it is displayed in PyCharm)

 

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)
  • -email is unavailable- added by joshix (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 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-01-20 bens Open/ClosedOpen Closed
    2022-01-05 bens StatusNone Wont Fix
        Summary[Wish] add support for f-strings in Python syntax [Wish] let the Python syntax decolorize stuff between braces in f-strings
    2021-12-23 bens Severity3 - Normal 1 - Wish
        SummaryPython syntax highlighting add support for f-strings [Wish] add support for f-strings in Python syntax
    2021-12-17 joshix Attached File- Added 2021-12-17_23-08.png, #52523

    Back to the top


    Powered by Savane 3.9