From 49f62d435f355e822155a993dc2c7715077cd542 Mon Sep 17 00:00:00 2001 From: Mark-Weston Date: Sun, 5 Aug 2018 14:38:52 +0300 Subject: [PATCH] Fix Lua syntax 1. Add missing unary operator: # 2. Do not color ... as an operator, because it is not 3. Color strings before comments 4. Add linter Lua syntax: lua.org/manual/5.3/manual.html#3.4 Signed-off-by: Mark-Weston --- syntax/lua.nanorc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/syntax/lua.nanorc b/syntax/lua.nanorc index a125d1bd..3ca5f2b4 100644 --- a/syntax/lua.nanorc +++ b/syntax/lua.nanorc @@ -10,7 +10,9 @@ comment "--" color brightwhite "\[\[.*\]\]" # Operators -color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>" +color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|#|\<(not|and|or)\>" +# Do not color ... as an operator, because it is not an operator +color white "\.\.\." # Statements color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>" @@ -49,9 +51,12 @@ color brightmagenta "\(|\)|\[|\]|\{|\}" # Shebang color brightcyan "^#!.*" +# Strings +color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'" + # Simple comments and multiline comments color green "--.*" color green start="--\[\[" end="\]\]" -# Strings -color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'" +# Linter +linter "luacheck --no-color" -- 2.18.0