mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-22 12:51:23 +03:00
syntax: python: avoid miscoloring stuff between two empty strings
The quotes of an empty string ('' or "") should be colored just like those of a non-empty string, because otherwise the text *between* two empty strings on the same line gets colored. Add an extra rule to discolor triple quotes again to not make them look like valid by themselves. Also, remove six superfluous backslashes. This addresses https://savannah.gnu.org/patch/?9801. Reported-by: Ryan Westlund <rlwestlund@gmail.com>
This commit is contained in:
parent
4fb9f298c9
commit
8f1cd50f1e
@ -22,14 +22,15 @@ color brightcyan "\<(exec|print)([[:blank:]]|$)"
|
||||
# Special values.
|
||||
color brightmagenta "\<(False|None|True)\>"
|
||||
|
||||
# Single-quoted strings.
|
||||
color brightgreen "'([^'\]|\\.)+'"
|
||||
color brightgreen ""([^"\]|\\.)+""
|
||||
# Mono-quoted strings.
|
||||
color brightgreen "'([^'\]|\\.)*'|'''"
|
||||
color brightgreen ""([^"\]|\\.)*"|""""
|
||||
color normal "'''|""""
|
||||
# Comments.
|
||||
color brightred "(^|[[:blank:]])#.*"
|
||||
# Triple-quoted strings.
|
||||
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
|
||||
color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(\])\"\"\""
|
||||
color brightgreen start=""""([^"),]|$)" end="(^|[^(\])""""
|
||||
|
||||
# Reminders.
|
||||
color brightwhite,yellow "(FIXME|TODO|XXX)"
|
||||
|
Loading…
Reference in New Issue
Block a user