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>master
parent
a18b48f0f7
commit
bf5949395d
|
@ -5,12 +5,15 @@
|
||||||
|
|
||||||
syntax lua "\.lua$"
|
syntax lua "\.lua$"
|
||||||
magic "Lua script"
|
magic "Lua script"
|
||||||
|
linter "luacheck --no-color"
|
||||||
comment "--"
|
comment "--"
|
||||||
|
|
||||||
color brightwhite "\[\[.*\]\]"
|
color brightwhite "\[\[.*\]\]"
|
||||||
|
|
||||||
# Operators
|
# Operators
|
||||||
color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>"
|
color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|#|\<(not|and|or)\>"
|
||||||
|
# Don't partially color ... as an operator
|
||||||
|
color normal "\.\.\."
|
||||||
|
|
||||||
# Statements
|
# Statements
|
||||||
color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>"
|
color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>"
|
||||||
|
@ -49,9 +52,9 @@ color brightmagenta "\(|\)|\[|\]|\{|\}"
|
||||||
# Shebang
|
# Shebang
|
||||||
color brightcyan "^#!.*"
|
color brightcyan "^#!.*"
|
||||||
|
|
||||||
|
# Strings
|
||||||
|
color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
||||||
|
|
||||||
# Simple comments and multiline comments
|
# Simple comments and multiline comments
|
||||||
color green "--.*"
|
color green "--.*"
|
||||||
color green start="--\[\[" end="\]\]"
|
color green start="--\[\[" end="\]\]"
|
||||||
|
|
||||||
# Strings
|
|
||||||
color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'"
|
|
||||||
|
|
Loading…
Reference in New Issue