nvim-treesitter/queries/tiger/highlights.scm

122 lines
1.8 KiB
Scheme
Raw Normal View History

2022-06-14 17:24:28 +02:00
; Built-ins {{{
((function_call
function: (identifier) @function.builtin)
2023-04-21 04:06:20 -04:00
(#any-of? @function.builtin "chr" "concat" "exit" "flush" "getchar" "not" "ord" "print" "print_err" "print_int" "size" "strcmp" "streq" "substring")
2022-06-14 20:01:12 +02:00
; FIXME: not supported by neovim
; (#is-not? local)
)
2022-06-14 17:24:28 +02:00
((type_identifier) @type.builtin
2023-04-21 04:06:20 -04:00
(#any-of? @type.builtin "int" "string" "Object")
2022-06-14 20:01:12 +02:00
; FIXME: not supported by neovim
; (#is-not? local)
)
2022-06-14 17:24:28 +02:00
((identifier) @variable.builtin
2023-04-21 04:06:20 -04:00
(#eq? @variable.builtin "self")
2022-06-14 20:01:12 +02:00
; FIXME: not supported by neovim
; (#is-not? local)
)
2022-06-14 17:24:28 +02:00
; }}}
; Keywords {{{
[
"function"
"primitive"
2022-10-22 18:19:44 +03:00
"method"
2022-06-14 17:24:28 +02:00
] @keyword.function
[
"do"
"for"
"to"
"while"
2022-06-14 20:01:12 +02:00
] @repeat
2022-06-14 17:24:28 +02:00
2022-10-22 18:19:44 +03:00
"new" @keyword.operator
2022-06-14 17:24:28 +02:00
2022-10-22 18:19:44 +03:00
"import" @include
2022-06-14 17:24:28 +02:00
[
"array"
(break_expression)
"else"
"end"
"if"
"in"
"let"
"of"
"then"
"type"
"var"
"class"
"extends"
"_cast"
"_chunks"
"_exp"
"_lvalue"
"_namety"
] @keyword
; }}}
; Operators {{{
(operator) @operator
[
","
";"
":"
"."
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
; }}}
; Functions and methods {{{
(function_call
function: (identifier) @function)
(function_declaration
name: (identifier) @function)
(primitive_declaration
name: (identifier) @function)
(method_call
method: (identifier) @method)
(method_declaration
name: (identifier) @method)
(parameters
2022-06-14 20:01:12 +02:00
name: (identifier) @parameter)
2022-06-14 17:24:28 +02:00
; }}}
; Declarations {{{
(import_declaration
2022-06-14 20:01:12 +02:00
file: (string_literal) @string.special)
2022-06-14 17:24:28 +02:00
; }}}
; Literals {{{
(nil_literal) @constant.builtin
(integer_literal) @number
(string_literal) @string
(escape_sequence) @string.escape
; }}}
; Misc {{{
2023-09-13 00:25:01 +09:00
(comment) @comment @spell
2022-06-14 17:24:28 +02:00
(type_identifier) @type
(field_identifier) @property
(identifier) @variable
; }}}
; vim: sw=2 foldmethod=marker