From bf5949395d6039a694b4a0feeaa1777e433c1196 Mon Sep 17 00:00:00 2001 From: Mark-Weston Date: Sun, 5 Aug 2018 14:38:52 +0300 Subject: [PATCH] syntax: lua: do not color strings inside comments, and add a linter Also, don't partially color "..." as an operator, because it isn't, and color also the unary operator "#". Signed-off-by: Mark-Weston --- syntax/lua.nanorc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index a125d1bd..79685090 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -5,12 +5,15 @@ syntax lua "\.lua$" magic "Lua script" +linter "luacheck --no-color" comment "--" color brightwhite "\[\[.*\]\]" # Operators -color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>" +color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|#|\<(not|and|or)\>" +# Don't partially color ... as an operator +color normal "\.\.\." # Statements color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>" @@ -49,9 +52,9 @@ color brightmagenta "\(|\)|\[|\]|\{|\}" # Shebang color brightcyan "^#!.*" +# Strings +color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'" + # Simple comments and multiline comments color green "--.*" color green start="--\[\[" end="\]\]" - -# Strings -color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"