commit bf5949395d6039a694b4a0feeaa1777e433c1196
parent a18b48f0f76590aa0b2775ecae82f1beca18703f
Author: Mark-Weston <markweston@cock.li>
Date: Sun, 5 Aug 2018 14:38:52 +0300
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 <markweston@cock.li>
Diffstat:
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git 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 ""(\\.|[^"\])*"|'(\\.|[^'\])*'"