From 7706a4a0d8b67b943c31d0c5f7b00d357b5d838d Mon Sep 17 00:00:00 2001 From: pancake Date: Sat, 28 May 2022 21:46:10 +0200 Subject: Add Vlang tree-sitter in the languages.toml (#2526) Co-authored-by: pancake Co-authored-by: Michael Davis --- runtime/queries/v/highlights.scm | 150 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 runtime/queries/v/highlights.scm (limited to 'runtime/queries') diff --git a/runtime/queries/v/highlights.scm b/runtime/queries/v/highlights.scm new file mode 100644 index 00000000..c71245dc --- /dev/null +++ b/runtime/queries/v/highlights.scm @@ -0,0 +1,150 @@ +(parameter_declaration + name: (identifier) @variable.parameter) +(function_declaration + name: (identifier) @function) +(function_declaration + receiver: (parameter_list) + name: (identifier) @function.method) + +(call_expression + function: (identifier) @function) +(call_expression + function: (selector_expression + field: (identifier) @function.method)) + +(field_identifier) @variable.other.member +(selector_expression + field: (identifier) @variable.other.member) + +(int_literal) @constant.numeric.integer +(interpreted_string_literal) @string +(rune_literal) @string +(escape_sequence) @constant.character.escape + +[ + (type_identifier) + (builtin_type) + (pointer_type) + (array_type) +] @type + +[ + (identifier) + (module_identifier) + (import_path) +] @variable + +[ + "as" + "asm" + "assert" + ;"atomic" + ;"break" + "const" + ;"continue" + "defer" + "else" + "enum" + "fn" + "for" + "$for" + "go" + "goto" + "if" + "$if" + "import" + "in" + "!in" + "interface" + "is" + "!is" + "lock" + "match" + "module" + "mut" + "or" + "pub" + "return" + "rlock" + "select" + ;"shared" + ;"static" + "struct" + "type" + ;"union" + "unsafe" +] @keyword + +[ + (true) + (false) +] @boolean + +[ + "." + "," + ":" + ";" +] @punctuation.delimiter + +[ + "(" + ")" + "{" + "}" + "[" + "]" +] @punctuation.bracket + +(array) @punctuation.bracket + +[ + "++" + "--" + + "+" + "-" + "*" + "/" + "%" + + "~" + "&" + "|" + "^" + + "!" + "&&" + "||" + "!=" + + "<<" + ">>" + + "<" + ">" + "<=" + ">=" + + "+=" + "-=" + "*=" + "/=" + "&=" + "|=" + "^=" + "<<=" + ">>=" + + "=" + ":=" + "==" + + "?" + "<-" + "$" + ".." + "..." +] @operator + +(comment) @comment \ No newline at end of file -- cgit v1.2.3-70-g09d2