## Syntax highlighting for Lua. # ## Author: Matthew Wild ## License: GPL 3 or later ## Version: 2011-05-05 syntax "lua" "\.lua$" magic "Lua script" comment "--" color brightwhite "\[\[.*\]\]" # Operators color brightyellow ":|\*|/|%|\+|-|\^|>|>=|<|<=|~=|=|\.\.|\<(not|and|or)\>" # Statements color brightblue "\<(do|end|while|repeat|until|if|elseif|then|else|for|in|function|local|return|break)\>" # Keywords color brightyellow "\<(_G|_VERSION|assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|load|loadfile|module|next|pairs|pcall|print|rawequal|rawget|rawlen|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\s*\(" # Standard library color brightyellow "\" color brightyellow "\" color brightyellow "\" 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)\>" # false, nil, true color brightmagenta "\<(false|nil|true)\>" # External files color brightgreen "\<(dofile|require)\>" # Numbers color red "\<[0-9]+(\.[0-9]*)?([Ee][+-]?[0-9]+)?\>" # Symbols color brightmagenta "(\(|\)|\[|\]|\{|\})" # Shebang color brightcyan "^#!.*" # Simple comments color green "\-\-.*$" # Multiline comments color green start="\-\-\[\[" end="\]\]" # Strings color red ""(\\.|[^"\])*"|'(\\.|[^'\])*'" ##color red start="\[\[" end="\]\]" # Hex literals icolor red "\<0x[0-9a-f]+(\.[0-9a-f]*)?(p[+-]?[0-9]+)?\>"