mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-11 07:50:07 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
c13e28f894
commit
2c8f2f2fad
829 changed files with 4905 additions and 8010 deletions
115
runtime/queries/tiger/highlights.scm
Normal file
115
runtime/queries/tiger/highlights.scm
Normal file
|
|
@ -0,0 +1,115 @@
|
|||
; Built-ins {{{
|
||||
((function_call
|
||||
function: (identifier) @function.builtin)
|
||||
(#any-of? @function.builtin "chr" "concat" "exit" "flush" "getchar" "not" "ord" "print" "print_err" "print_int" "size" "strcmp" "streq" "substring")
|
||||
)
|
||||
|
||||
((type_identifier) @type.builtin
|
||||
(#any-of? @type.builtin "int" "string" "Object")
|
||||
)
|
||||
|
||||
((identifier) @variable.builtin
|
||||
(#eq? @variable.builtin "self")
|
||||
)
|
||||
; }}}
|
||||
|
||||
; Keywords {{{
|
||||
[
|
||||
"function"
|
||||
"primitive"
|
||||
"method"
|
||||
] @keyword.function
|
||||
|
||||
[
|
||||
"do"
|
||||
"for"
|
||||
"to"
|
||||
"while"
|
||||
] @repeat
|
||||
|
||||
"new" @keyword.operator
|
||||
|
||||
"import" @include
|
||||
|
||||
[
|
||||
"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
|
||||
name: (identifier) @parameter)
|
||||
; }}}
|
||||
|
||||
; Declarations {{{
|
||||
(import_declaration
|
||||
file: (string_literal) @string.special)
|
||||
; }}}
|
||||
|
||||
; Literals {{{
|
||||
(nil_literal) @constant.builtin
|
||||
(integer_literal) @number
|
||||
(string_literal) @string
|
||||
(escape_sequence) @string.escape
|
||||
; }}}
|
||||
|
||||
; Misc {{{
|
||||
(comment) @comment
|
||||
|
||||
(type_identifier) @type
|
||||
(field_identifier) @property
|
||||
(identifier) @variable
|
||||
; }}}
|
||||
|
||||
; vim: sw=2 foldmethod=marker
|
||||
Loading…
Add table
Add a link
Reference in a new issue