tree-sitter-tiger/queries/highlights.scm

106 lines
1.4 KiB
Scheme
Raw Normal View History

; Built-ins {{{
((function_call
function: (identifier) @function.builtin)
(#match? @function.builtin "^(chr|concat|exit|flush|getchar|not|ord|print|print_err|print_int|size|strcmp|streq|substring)$")
(#is-not? local))
((type_identifier) @type.builtin
(#match? @type.builtin "^(int|string)$")
(#is-not? local))
; }}}
2022-06-02 22:27:42 +02:00
; Keywords {{{
[
"function"
"primitive"
] @keyword.function
[
"do"
"for"
"to"
"while"
] @keyword.repeat
2022-06-02 22:27:42 +02:00
[
"array"
(break_expression)
"do"
"else"
"end"
"for"
"function"
"if"
"import"
"in"
"let"
"of"
"primitive"
"then"
"to"
"type"
"var"
"while"
"_cast"
"_chunks"
"_exp"
"_lvalue"
"_namety"
2022-06-02 22:27:42 +02:00
] @keyword
; }}}
2022-06-03 10:08:58 +02:00
; Operators {{{
(operator) @operator
[
","
";"
2022-06-03 11:43:43 +02:00
":"
2022-06-03 10:08:58 +02:00
"."
] @punctuation.delimiter
[
"("
")"
"["
"]"
"{"
"}"
] @punctuation.bracket
; }}}
2022-06-03 19:59:56 +02:00
; Functions {{{
(function_call
function: (identifier) @function)
(function_declaration
name: (identifier) @function)
(primitive_declaration
name: (identifier) @function)
(parameters
name: (identifier) @variable.parameter)
; }}}
; Declarations {{{
(import_declaration
file: (string_literal) @string.special.path)
; }}}
; 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
; }}}
2022-06-02 17:25:31 +02:00
; vim: sw=2 foldmethod=marker