From 0b2cf1f2fb0cac5cae40f86b930656955759b549 Mon Sep 17 00:00:00 2001 From: Tom Levy Date: Sun, 31 Dec 2017 03:51:26 +0000 Subject: [PATCH 1/6] syntax: lua: hex literals: require 1+ digits, add word boundaries Use "+" instead of "*" in digits regex because "0x" by itself is invalid. Suggested by Benno Schulenberg on the mailing list: https://lists.gnu.org/archive/html/nano-devel/2017-12/msg00112.html Add word boundaries so that e.g. "00x1" (which is invalid) does not get partial highlighting. Signed-off-by: Tom Levy --- syntax/lua.nanorc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index 73a22996..25f51c4d 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -61,4 +61,4 @@ color red "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'" ##color red start="\[\[" end="\]\]" # Hex literals -color red "0x[0-9a-fA-F]*" +color red "\<0x[0-9a-fA-F]+\>" -- 2.11.0