From 091e8faf6da2a9f90ae83d7f0ae3945552011e4a Mon Sep 17 00:00:00 2001 From: Tom Levy Date: Sun, 31 Dec 2017 03:51:26 +0000 Subject: [PATCH] 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 --- syntax/lua.nanorc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index 73a22996..28d922a8 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -57,8 +57,8 @@ color green "\-\-.*$" color green start="\-\-\[\[" end="\]\]" # Strings -color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'" +color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'" ##color red start="\[\[" end="\]\]" # Hex literals -color red "0x[0-9a-fA-F]*" +color red "\<0x[0-9a-fA-F]+\>"