pub const HIGHLIGHTS_QUERY: &str = "; Preproc\n(hash_bang_line) @keyword.directive\n\n; Keywords\n\"return\" @keyword.return\n\n[\n  \"local\"\n  \"type\"\n  \"export\"\n] @keyword\n\n(do_statement\n  [\n    \"do\"\n    \"end\"\n  ] @keyword)\n\n(while_statement\n  [\n    \"while\"\n    \"do\"\n    \"end\"\n  ] @keyword.repeat)\n\n(repeat_statement\n  [\n    \"repeat\"\n    \"until\"\n  ] @keyword.repeat)\n\n[\n  (break_statement)\n  (continue_statement)\n] @keyword.repeat\n\n(if_statement\n  [\n    \"if\"\n    \"elseif\"\n    \"else\"\n    \"then\"\n    \"end\"\n  ] @keyword.conditional)\n\n(if_expression\n  [\n    \"if\"\n    \"then\"\n  ] @keyword.conditional)\n\n(elseif_statement\n  [\n    \"elseif\"\n    \"then\"\n    \"end\"\n  ] @keyword.conditional)\n\n(elseif_clause\n  [\n    \"elseif\"\n    \"then\"\n  ] @keyword.conditional)\n\n(else_statement\n  [\n    \"else\"\n    \"end\"\n  ] @keyword.conditional)\n\n(else_clause\n  \"else\" @keyword.conditional)\n\n(for_statement\n  [\n    \"for\"\n    \"do\"\n    \"end\"\n  ] @keyword.repeat)\n\n(function_declaration\n  [\n    \"function\"\n    \"end\"\n  ] @keyword.function)\n\n(function_definition\n  [\n    \"function\"\n    \"end\"\n  ] @keyword.function)\n\n; Operators\n[\n  \"and\"\n  \"not\"\n  \"or\"\n  \"in\"\n  \"typeof\"\n] @keyword.operator\n\n[\n  \"+\"\n  \"-\"\n  \"*\"\n  \"/\"\n  \"%\"\n  \"^\"\n  \"#\"\n  \"==\"\n  \"~=\"\n  \"<=\"\n  \">=\"\n  \"<\"\n  \">\"\n  \"=\"\n  \"&\"\n  \"|\"\n  \"?\"\n  \"//\"\n  \"..\"\n  \"+=\"\n  \"-=\"\n  \"*=\"\n  \"/=\"\n  \"%=\"\n  \"^=\"\n  \"..=\"\n] @operator\n\n; Variables\n(identifier) @variable\n\n; Types\n(type\n  (identifier) @type)\n\n(type\n  (generic_type\n    (identifier) @type))\n\n(builtin_type) @type.builtin\n\n((identifier) @type\n  (#lua-match? @type \"^[A-Z]\"))\n\n; Typedefs\n(type_definition\n  \"type\"\n  .\n  (type) @type.definition\n  \"=\")\n\n; Constants\n((identifier) @constant\n  (#lua-match? @constant \"^[A-Z][A-Z_0-9]+$\"))\n\n; Builtins\n((identifier) @constant.builtin\n  (#eq? @constant.builtin \"_VERSION\"))\n\n((identifier) @variable.builtin\n  (#eq? @variable.builtin \"self\"))\n\n((identifier) @module.builtin\n  (#any-of? @module.builtin \"_G\" \"debug\" \"io\" \"jit\" \"math\" \"os\" \"package\" \"string\" \"table\" \"utf8\"))\n\n((identifier) @keyword.coroutine\n  (#eq? @keyword.coroutine \"coroutine\"))\n\n; Tables\n(field\n  name: (identifier) @variable.member)\n\n(dot_index_expression\n  field: (identifier) @variable.member)\n\n(object_type\n  (identifier) @variable.member)\n\n(table_constructor\n  [\n    \"{\"\n    \"}\"\n  ] @constructor)\n\n; Functions\n(parameter\n  .\n  (identifier) @variable.parameter)\n\n(function_type\n  (identifier) @variable.parameter)\n\n(function_call\n  name: (identifier) @function.call)\n\n(function_declaration\n  name: (identifier) @function)\n\n(function_call\n  name:\n    (dot_index_expression\n      field: (identifier) @function.call))\n\n(function_declaration\n  name:\n    (dot_index_expression\n      field: (identifier) @function))\n\n(method_index_expression\n  method: (identifier) @function.method.call)\n\n(function_call\n  (identifier) @function.builtin\n  ; format-ignore\n  (#any-of? @function.builtin\n    ; built-in functions in Lua 5.1\n    \"assert\" \"collectgarbage\" \"dofile\" \"error\" \"getfenv\" \"getmetatable\" \"ipairs\"\n    \"load\" \"loadfile\" \"loadstring\" \"module\" \"next\" \"pairs\" \"pcall\" \"print\"\n    \"rawequal\" \"rawget\" \"rawlen\" \"rawset\" \"require\" \"select\" \"setfenv\" \"setmetatable\"\n    \"tonumber\" \"tostring\" \"type\" \"unpack\" \"xpcall\" \"typeof\"\n    \"__add\" \"__band\" \"__bnot\" \"__bor\" \"__bxor\" \"__call\" \"__concat\" \"__div\" \"__eq\" \"__gc\"\n    \"__idiv\" \"__index\" \"__le\" \"__len\" \"__lt\" \"__metatable\" \"__mod\" \"__mul\" \"__name\" \"__newindex\"\n    \"__pairs\" \"__pow\" \"__shl\" \"__shr\" \"__sub\" \"__tostring\" \"__unm\"))\n\n; Literals\n(number) @number\n\n(string) @string\n\n(nil) @constant.builtin\n\n(vararg_expression) @variable.builtin\n\n[\n  (false)\n  (true)\n] @boolean\n\n; Punctuations\n[\n  \";\"\n  \":\"\n  \"::\"\n  \",\"\n  \".\"\n  \"->\"\n] @punctuation.delimiter\n\n[\n  \"(\"\n  \")\"\n  \"[\"\n  \"]\"\n  \"{\"\n  \"}\"\n] @punctuation.bracket\n\n(variable_list\n  attribute:\n    (attribute\n      ([\n        \"<\"\n        \">\"\n      ] @punctuation.bracket\n        (identifier) @attribute)))\n\n(generic_type\n  [\n    \"<\"\n    \">\"\n  ] @punctuation.bracket)\n\n(generic_type_list\n  [\n    \"<\"\n    \">\"\n  ] @punctuation.bracket)\n\n; Comments\n(comment) @comment @spell\n\n((comment) @comment.documentation\n  (#lua-match? @comment.documentation \"^[-][-][-]\"))\n\n((comment) @comment.documentation\n  (#lua-match? @comment.documentation \"^[-][-](%s?)@\"))\n\n; string.match(\"123\", \"%d+\")\n(function_call\n  (dot_index_expression\n    field: (identifier) @_method\n    (#any-of? @_method \"find\" \"format\" \"match\" \"gmatch\" \"gsub\"))\n  arguments:\n    (arguments\n      .\n      (_)\n      .\n      (string\n        content: _ @string.regexp)))\n\n; (\"123\"):match(\"%d+\")\n(function_call\n  (method_index_expression\n    method: (identifier) @_method\n    (#any-of? @_method \"find\" \"format\" \"match\" \"gmatch\" \"gsub\"))\n  arguments:\n    (arguments\n      .\n      (string\n        content: _ @string.regexp)))\n";
Expand description

The syntax highlighting query for this language.