## Syntax highlighting for Lua. ## Original author: Matthew Wild ## License: GPL version 3 or newer syntax lua "\.lua$" magic "Lua script" comment "--" linter luacheck --no-color # Operators color brightyellow "#|%|&|\*|\+|-|/|:|<|<=|==|>=|>|\^|\||~|~=|\.\.|\<(and|or|not)\>" # Don't partially color ... as an operator color normal "\.\.\." # Statements color brightblue "\<(do|end|for|in|if|then|elseif|else|repeat|until|while|break|goto|return|function|global|local)\>" # Basic functions color brightyellow "\<(assert|collectgarbage|dofile|error|(get|set)metatable|load(file)?|next|i?pairs|x?pcall|print|raw(equal|get|len|set)|require|select|tonumber|tostring|type|warn)[[:blank:]]*\(" # Standard library color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" color brightyellow "\" # File handle methods color brightyellow ":(close|flush|lines|read|seek|setvbuf|write)\>" # External files color brightgreen "\<(dofile|require)\>" # Special words color brightmagenta "\<(false|nil|true)\>" color lime "(_G|_ENV|_VERSION)\>" # Decimal and hexadecimal numbers color orange "\<[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?\>" color orange "\<0[Xx][[:xdigit:]]+(\.[[:xdigit:]]*)?([Pp][+-]?[0-9]+)?\>" # Brackets color brightmagenta "\(|\)|\[|\]|\{|\}" # Shebang color brightcyan "^#!.*" # Labels color pink "::[[:alnum:]_]+::" # Strings color orange ""([^"\]|\\.)*"|'([^'\]|\\.)*'" color orange start="\[\[" end="\]\]" # Backslash escapes color mauve "\\([abfnrtvz\"']|[0-9]{1,3}|x[[:xdigit:]]{2}|u\{[[:xdigit:]]{1,6}\})" # Simple comments and multiline comments color green "--.*" color green start="--\[\[" end="\]\]"