Skip to main content

HIGHLIGHTS_QUERY

Constant HIGHLIGHTS_QUERY 

Source
pub const HIGHLIGHTS_QUERY: &str = "(identifier) @variable\n\n((identifier) @constant\n (#match? @constant \"^[A-Z][A-Z\\\\d_]*$\"))\n\n((storage_class_specifier) @keyword\n (#eq? @keyword \"auto\"))\n\"_Generic\" @keyword\n\"_Thread_local\" @keyword\n\"break\" @keyword\n\"case\" @keyword\n\"const\" @keyword\n\"continue\" @keyword\n\"default\" @keyword\n\"do\" @keyword\n\"else\" @keyword\n\"enum\" @keyword\n\"extern\" @keyword\n\"for\" @keyword\n\"goto\" @keyword\n\"if\" @keyword\n\"inline\" @keyword\n\"return\" @keyword\n\"sizeof\" @keyword\n\"static\" @keyword\n\"struct\" @keyword\n\"switch\" @keyword\n\"typedef\" @keyword\n\"union\" @keyword\n\"volatile\" @keyword\n\"while\" @keyword\n\n\"#define\" @keyword\n\"#elif\" @keyword\n\"#elifdef\" @keyword\n\"#elifndef\" @keyword\n\"#else\" @keyword\n\"#endif\" @keyword\n\"#if\" @keyword\n\"#ifdef\" @keyword\n\"#ifndef\" @keyword\n\"#include\" @keyword\n(preproc_directive) @keyword\n\n\"--\" @operator\n\"-\" @operator\n\"-=\" @operator\n\"->\" @operator\n\"=\" @operator\n\"!=\" @operator\n\"*\" @operator\n\"&\" @operator\n\"&&\" @operator\n\"+\" @operator\n\"++\" @operator\n\"+=\" @operator\n\"<\" @operator\n\"==\" @operator\n\">\" @operator\n\"||\" @operator\n\"*=\" @operator\n\"/=\" @operator\n\"%=\" @operator\n\"<<=\" @operator\n\">>=\" @operator\n\"&=\" @operator\n\"|=\" @operator\n\"^=\" @operator\n\"/\" @operator\n\"%\" @operator\n\"<=\" @operator\n\">=\" @operator\n\"<<\" @operator\n\">>\" @operator\n\"|\" @operator\n\"^\" @operator\n\"~\" @operator\n\"!\" @operator\n\n(conditional_expression\n  [\"?\" \":\"] @operator)\n\n(field_expression\n  operator: \".\" @operator)\n\n(field_designator \".\" @delimiter)\n\";\" @delimiter\n\n(string_literal) @string\n(system_lib_string) @string\n\n(null) @constant\n(number_literal) @number\n(char_literal) @number\n\n(field_identifier) @property\n(statement_identifier) @label\n(type_identifier) @type\n(primitive_type) @type\n(sized_type_specifier) @type\n\n(call_expression\n  function: (identifier) @function)\n(call_expression\n  function: (field_expression\n    field: (field_identifier) @function))\n(function_declarator\n  declarator: (identifier) @function)\n(preproc_function_def\n  name: (identifier) @function.special)\n\n(comment) @comment\n\n(typeof_specifier\n  [\"typeof\" \"typeof_unqual\" \"__typeof__\" \"__typeof\" \"__typeof_unqual\" \"__typeof_unqual__\"] @keyword)\n(bit_int_specifier \"_BitInt\" @type)\n(pragma_operator) @keyword\n\n(va_arg_expression [\"va_arg\" \"__builtin_va_arg\"] @keyword)\n\n; inherits: c\n\n; Functions\n\n(call_expression\n  function: (qualified_identifier\n    name: (identifier) @function))\n\n(template_function\n  name: (identifier) @function)\n\n(template_method\n  name: (field_identifier) @function)\n\n(template_function\n  name: (identifier) @function)\n\n(function_declarator\n  declarator: (qualified_identifier\n    name: (identifier) @function))\n\n(function_declarator\n  declarator: (field_identifier) @function)\n\n(operator_argument \".\" @operator)\n\n; Types\n\n((namespace_identifier) @type\n (#match? @type \"^[A-Z]\"))\n\n(auto) @type\n\n; Constants\n\n(this) @variable.builtin\n(null \"nullptr\" @constant)\n\n; Modules\n(module_name\n  (identifier) @module)\n\n(module_name \".\" @delimiter)\n\n; Keywords\n\n[\n \"catch\"\n \"class\"\n \"co_await\"\n \"co_return\"\n \"co_yield\"\n \"constexpr\"\n \"constinit\"\n \"consteval\"\n \"delete\"\n \"explicit\"\n \"final\"\n \"friend\"\n \"mutable\"\n \"namespace\"\n \"noexcept\"\n \"new\"\n \"override\"\n \"pre\"\n \"post\"\n \"private\"\n \"protected\"\n \"public\"\n \"template\"\n \"throw\"\n \"try\"\n \"typename\"\n \"using\"\n \"concept\"\n \"requires\"\n \"virtual\"\n \"import\"\n \"export\"\n \"module\"\n] @keyword\n\n[(operator_name \"operator\" @keyword)\n (operator_cast \"operator\" @keyword)]\n\n; Operators\n\n[\n \".*\" \"->*\" \"<=>\"\n \"and\" \"and_eq\" \"bitand\" \"bitor\" \"compl\" \"not\" \"not_eq\" \"or\" \"or_eq\" \"xor\" \"xor_eq\"\n] @operator\n\n; Strings\n\n(raw_string_literal) @string\n\n[\"static_cast\" \"dynamic_cast\" \"const_cast\" \"reinterpret_cast\" \"typeid\"] @keyword\n\n((call_expression\n  function: (identifier) @keyword)\n (#eq? @keyword \"noexcept\"))\n";
Expand description

The combined C and C++ syntax-highlighting query, with inherited C patterns first.