syntax/lua: highlight '\\' escape (and similar) properly

The following example breaks highlighting to the end of file:
    local a = "\\"
    local b = 1
    ...

Added escape handling for simplest cases both for
single-quoted and double-quoted literals:
    '\\', '\n' (and similar), '\d', '\dd', '\ddd'

Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
This commit is contained in:
Sergei Trofimovich 2011-11-16 08:44:33 +03:00
parent 2a19255069
commit a4fbaf95ff

View File

@ -205,8 +205,7 @@ context exclusive -- \n brown
context linestart # \n brown
# Strings
context " " brightgreen
# can't find good color for the patterns highlight.
context " " green
keyword %a brightgreen
keyword %c brightgreen
keyword %d brightgreen
@ -217,8 +216,31 @@ context " " brightgreen
keyword %w brightgreen
keyword %x brightgreen
keyword %z brightgreen
keyword \\\\ brightgreen
keyword \\" brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\{01234567\}\{01234567\} brightgreen
keyword \\\{01234567\} brightgreen
spellcheck
context ' ' brightgreen
context ' ' green
keyword %a brightgreen
keyword %c brightgreen
keyword %d brightgreen
keyword %l brightgreen
keyword %p brightgreen
keyword %s brightgreen
keyword %u brightgreen
keyword %w brightgreen
keyword %x brightgreen
keyword %z brightgreen
keyword \\\\ brightgreen
keyword \\" brightgreen
keyword \\' brightgreen
keyword \\\{abtnvfr\} brightgreen
keyword \\\{0123\}\{01234567\}\{01234567\} brightgreen
keyword \\\{01234567\}\{01234567\} brightgreen
keyword \\\{01234567\} brightgreen
spellcheck