syntax: python: colorize backslash escapes, such as \n and \xef

Reference: https://docs.python.org/3/reference/lexical_analysis.html
master
Benno Schulenberg 2021-11-15 15:28:18 +01:00
parent 2cbd4d29a0
commit 06ad77895f
1 changed files with 4 additions and 0 deletions

View File

@ -32,6 +32,10 @@ color brightred "(^|[[:blank:]])#.*"
color brightgreen start="'''([^'),]|$)" end="(^|[^(\])'''"
color brightgreen start=""""([^"),]|$)" end="(^|[^(\])""""
# Backslash escapes.
color peach "\\($|[\'"abfnrtv]|[0-3]?[0-7]?[0-7]|x[[:xdigit:]]{2})"
color peach "\\(N\{[[:alpha:]]+\}|u[[:xdigit:]]{4}|U[[:xdigit:]]{8})"
# Reminders.
color brightwhite,yellow "\<(FIXME|TODO|XXX)\>"