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
|
|
|
|
(#match? @type.builtin "^(int|string)$")
|
|
|
|
(#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-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"
|
|
|
|
] @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)
|
|
|
|
; }}}
|
|
|
|
|
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
|