syntax: lua: require at least one digit for hexadecimal numbers

Since a "0x" by itself is invalid.  Also add word boundaries, so that
e.g. "00x1" (which is invalid) does not get partial highlighting.

Also remove some redundant backslashes from the strings regex.

Signed-off-by: Tom Levy <tomlevy93@gmail.com>
master
Tom Levy 2017-12-31 03:51:26 +00:00 committed by Benno Schulenberg
parent d8ea89f6a6
commit 091e8faf6d
1 changed files with 2 additions and 2 deletions

View File

@ -57,8 +57,8 @@ color green "\-\-.*$"
color green start="\-\-\[\[" end="\]\]" color green start="\-\-\[\[" end="\]\]"
# Strings # Strings
color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'" color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
##color red start="\[\[" end="\]\]" ##color red start="\[\[" end="\]\]"
# Hex literals # Hex literals
color red "0x[0-9a-fA-F]*" color red "\<0x[0-9a-fA-F]+\>"