mirror of
git://git.sv.gnu.org/nano.git
synced 2024-11-26 14:51:36 +03:00
syntax: python: do not highlight 'print' and 'exec' in Python 3
Assume that 'print' and 'exec' are statements when they are followed by whitespace, and are functions otherwise. This does not highlight "print'x'" nor "print{x}", but these statements are poor style. Signed-off-by: Benjamin Mintz <bmintz@protonmail.com> Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
This commit is contained in:
parent
d718ed4fc3
commit
790f98560b
@ -10,9 +10,14 @@ comment "#"
|
||||
icolor brightblue "def [0-9A-Z_]+"
|
||||
# Keywords.
|
||||
color brightcyan "\<(and|as|assert|async|await|break|class|continue)\>"
|
||||
color brightcyan "\<(def|del|elif|else|except|exec|finally|for|from)\>"
|
||||
color brightcyan "\<(def|del|elif|else|except|finally|for|from)\>"
|
||||
color brightcyan "\<(global|if|import|in|is|lambda|nonlocal|not|or)\>"
|
||||
color brightcyan "\<(pass|print|raise|return|try|while|with|yield)\>"
|
||||
color brightcyan "\<(pass|raise|return|try|while|with|yield)\>"
|
||||
|
||||
# These two are keywords in Python 2, but functions in Python 3,
|
||||
# so only color them when they are followed by whitespace, assuming
|
||||
# that print(x) is a function invocation and print (x) is a statement.
|
||||
color brightcyan "\<(exec|print)([[:blank:]]|$)"
|
||||
|
||||
# Special values.
|
||||
color brightmagenta "\<(False|None|True)\>"
|
||||
|
Loading…
Reference in New Issue
Block a user