Unnamed repository; edit this file 'description' to name the repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
;; Keywords
[ "if" "prog" ] @keyword

;; Let binding
[ "let" ] @keyword

(let_bindings name: (symbol) @variable)

;; Apply
(apply_stmt . (symbol) @function)

;; Use module
[ "use" ] @keyword

(use_module_global (quote) . (symbol) @namespace)
(use_module_select (quote) . (symbol) @namespace)

;; Val definition
[ "val" ] @keyword

(val_definition name: (symbol) @constant)

;; External definitions
[ "ext" ] @keyword

(external_definition name: (symbol) @function)
(external_definition signature: (signature (symbol) @variable.parameter (dot) (external_type) @type.builtin))
(external_definition docstring: (string) @comment)
(external_definition return_type: (external_type) @type.builtin)

;; Function definitions
[ "def" ] @keyword

(function_definition name: (symbol) @function)
(function_definition parameters: (parameters (symbol) @variable.parameter))
(function_definition docstring: (string) @comment)

;; Macro definitions
[ "mac" ] @keyword

(macro_definition name: (symbol) @function)
(macro_definition parameters: (parameters (symbol) @variable.parameter))
(macro_definition docstring: (string) @comment)

;; Lambda 
[ "\\" ] @keyword

(lambda_stmt parameters: (parameters (symbol) @variable.parameter))

;; Atoms
(char) @constant.character
(comment) @comment
(number) @constant.numeric
(string) @string

;; Punctuation
[ "(" ")" ] @punctuation.bracket

;; Operators
(dot) @operator
(tilde) @operator
(backquote) @operator
(quote) @operator
(unquote) @operator
(unquote_splice) @operator

;; Highlight nil t as constant
[ "nil" ] @constant.builtin

;; Highlight as t as boolean constant
[ "T" ] @constant.builtin.boolean

;; Highlight variable names used in anamorphic macros.
[ "it" ] @variable.builtin