2022-06-03 21:04:40 +02:00
|
|
|
; 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))
|
2022-06-03 22:04:28 +02:00
|
|
|
|
|
|
|
((type_identifier) @type.builtin
|
2022-06-04 21:31:43 +02:00
|
|
|
(#match? @type.builtin "^(int|string|Object)$")
|
2022-06-03 22:04:28 +02:00
|
|
|
(#is-not? local))
|
2022-06-04 21:38:21 +02:00
|
|
|
|
|
|
|
((identifier) @variable.builtin
|
|
|
|
(#match? @variable.builtin "^self$")
|
|
|
|
(#is-not? local))
|
2022-06-03 21:04:40 +02:00
|
|
|
; }}}
|
|
|
|
|
2022-06-02 22:27:42 +02:00
|
|
|
; Keywords {{{
|
2022-06-03 20:15:09 +02:00
|
|
|
[
|
|
|
|
"function"
|
|
|
|
"primitive"
|
|
|
|
] @keyword.function
|
|
|
|
|
2022-06-03 20:16:14 +02:00
|
|
|
[
|
|
|
|
"do"
|
|
|
|
"for"
|
|
|
|
"to"
|
|
|
|
"while"
|
|
|
|
] @keyword.repeat
|
|
|
|
|
2022-06-04 21:35:14 +02:00
|
|
|
[
|
|
|
|
"new"
|
|
|
|
] @keyword.constructor
|
|
|
|
|
2022-06-04 21:35:31 +02:00
|
|
|
[
|
|
|
|
"method"
|
|
|
|
] @keyword.method
|
|
|
|
|
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"
|
2022-06-04 20:31:54 +02:00
|
|
|
|
2022-06-04 21:27:09 +02:00
|
|
|
"class"
|
|
|
|
"extends"
|
|
|
|
"method"
|
|
|
|
"new"
|
|
|
|
|
2022-06-04 20:31:54 +02:00
|
|
|
"_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-04 21:29:27 +02:00
|
|
|
; Functions and methods {{{
|
2022-06-03 19:59:56 +02:00
|
|
|
(function_call
|
|
|
|
function: (identifier) @function)
|
|
|
|
(function_declaration
|
|
|
|
name: (identifier) @function)
|
|
|
|
(primitive_declaration
|
|
|
|
name: (identifier) @function)
|
|
|
|
|
2022-06-04 21:29:27 +02:00
|
|
|
(method_call
|
|
|
|
method: (identifier) @method)
|
|
|
|
(method_declaration
|
|
|
|
name: (identifier) @method)
|
|
|
|
|
2022-06-03 19:59:56 +02:00
|
|
|
(parameters
|
|
|
|
name: (identifier) @variable.parameter)
|
|
|
|
; }}}
|
|
|
|
|
2022-06-03 20:32:06 +02:00
|
|
|
; Declarations {{{
|
|
|
|
(import_declaration
|
|
|
|
file: (string_literal) @string.special.path)
|
|
|
|
; }}}
|
|
|
|
|
2022-06-03 20:30:45 +02:00
|
|
|
; Literals {{{
|
|
|
|
(nil_literal) @constant.builtin
|
|
|
|
(integer_literal) @number
|
|
|
|
(string_literal) @string
|
|
|
|
(escape_sequence) @string.escape
|
|
|
|
; }}}
|
|
|
|
|
2022-06-03 19:58:16 +02:00
|
|
|
; Misc {{{
|
|
|
|
(comment) @comment
|
|
|
|
|
|
|
|
(type_identifier) @type
|
|
|
|
(field_identifier) @property
|
|
|
|
(identifier) @variable
|
|
|
|
; }}}
|
|
|
|
|
2022-06-02 17:25:31 +02:00
|
|
|
; vim: sw=2 foldmethod=marker
|