Debian Codegraph @

runtime/queries/bass/highlights.scm

raw symbols SCIP
1 ; GENERATED VIA https://github.com/vito/tree-sitter-bass
2
3 ;;; comments
4
5 (comment) @comment.line
6
7 ;;; punctuation
8
9 ["(" ")" "[" "]" "{" "}"] @punctuation.bracket
10
11 ;;; constants
12
13 [(ignore) (null)] @constant.builtin
14
15 (bool) @constant.builtin.boolean
16
17 (int) @constant.numeric.integer
18
19 ;;; strings
20
21 ;; string literals
22
23 (string) @string
24 (string (string_escape) @constant.character.escape)
25
26 ;; keywords (symbol literals)
27
28 (keyword) @string.special.symbol
29
30 ;; paths
31
32 (dot) @string.special.path
33 (dotdot) @string.special.path
34 (command) @string.special.path
35 (subpath (symbol) @string.special.path)
36
37 ; slashes in a path denote a combiner call
38 (subpath (slash) @function)
39
40
41 ;;; generic highlighting for all forms
42
43 ; first symbol in a list form is a combiner call
44 (list . (symbol) @function)
45
46 ; highlight symbols as vars only when they're clearly vars
47 (cons (symbol) @variable)
48 (scope (symbol) @variable)
49 (path form: (symbol) @variable)
50 (symbind form: (symbol) @variable)
51
52
53 ;;; specific highlighting for builtins & special forms
54
55 ;; symbol classification based highlighting
56
57 (list . (symbol) @keyword.control.conditional (#match? @keyword.control.conditional "^(if|case|cond|when)$"))
58 (cons . (symbol) @keyword.control.conditional (#match? @keyword.control.conditional "^(if|case|cond|when)$"))
59
60 (list . (symbol) @keyword.control.repeat (#match? @keyword.control.repeat "^(each)$"))
61 (cons . (symbol) @keyword.control.repeat (#match? @keyword.control.repeat "^(each)$"))
62
63 (list . (symbol) @label (#match? @label "^(def|defop|defn)$"))
64 (cons . (symbol) @label (#match? @label "^(def|defop|defn)$"))
65
66 (list . (symbol) @function.builtin (#match? @function.builtin "^(dump|mkfs|json|log|error|now|cons|wrap|unwrap|eval|make-scope|bind|meta|with-meta|null\\?|ignore\\?|boolean\\?|number\\?|string\\?|symbol\\?|scope\\?|sink\\?|source\\?|list\\?|pair\\?|applicative\\?|operative\\?|combiner\\?|path\\?|empty\\?|thunk\\?|\\+|\\*|quot|-|max|min|=|>|>=|<|<=|list->source|across|emit|next|reduce-kv|assoc|symbol->string|string->symbol|str|substring|trim|scope->list|string->fs-path|string->cmd-path|string->dir|subpath|path-name|path-stem|with-image|with-dir|with-args|with-cmd|with-stdin|with-env|with-insecure|with-label|with-port|with-tls|with-mount|thunk-cmd|thunk-args|resolve|start|addr|wait|read|cache-dir|binds\\?|recall-memo|store-memo|mask|list|list\\*|first|rest|length|second|third|map|map-pairs|foldr|foldl|append|filter|conj|list->scope|merge|apply|id|always|vals|keys|memo|succeeds\\?|run|last|take|take-all|insecure!|from|cd|wrap-cmd|mkfile|path-base|not)$"))
67 (cons . (symbol) @function.builtin (#match? @function.builtin "^(dump|mkfs|json|log|error|now|cons|wrap|unwrap|eval|make-scope|bind|meta|with-meta|null\\?|ignore\\?|boolean\\?|number\\?|string\\?|symbol\\?|scope\\?|sink\\?|source\\?|list\\?|pair\\?|applicative\\?|operative\\?|combiner\\?|path\\?|empty\\?|thunk\\?|\\+|\\*|quot|-|max|min|=|>|>=|<|<=|list->source|across|emit|next|reduce-kv|assoc|symbol->string|string->symbol|str|substring|trim|scope->list|string->fs-path|string->cmd-path|string->dir|subpath|path-name|path-stem|with-image|with-dir|with-args|with-cmd|with-stdin|with-env|with-insecure|with-label|with-port|with-tls|with-mount|thunk-cmd|thunk-args|resolve|start|addr|wait|read|cache-dir|binds\\?|recall-memo|store-memo|mask|list|list\\*|first|rest|length|second|third|map|map-pairs|foldr|foldl|append|filter|conj|list->scope|merge|apply|id|always|vals|keys|memo|succeeds\\?|run|last|take|take-all|insecure!|from|cd|wrap-cmd|mkfile|path-base|not)$"))
68
69 (list . (symbol) @function.macro (#match? @function.macro "^(op|fn|current-scope|quote|let|provide|module|or|and|->|curryfn|for|\\$|linux)$"))
70 (cons . (symbol) @function.macro (#match? @function.macro "^(op|fn|current-scope|quote|let|provide|module|or|and|->|curryfn|for|\\$|linux)$"))
71
72 (list . (symbol) @keyword (#match? @keyword "^(do|doc)$"))
73 (cons . (symbol) @keyword (#match? @keyword "^(do|doc)$"))
74
75 (list . (symbol) @keyword.control.import (#match? @keyword.control.import "^(use|import|load)$"))
76 (cons . (symbol) @keyword.control.import (#match? @keyword.control.import "^(use|import|load)$"))
77
78
79 ;; special cases
80
81 ; [a & b] highlights & as operator rather than a regular symbol
82 (list (symbol) @operator (#match? @operator "&"))
83 (cons (symbol) @operator (#match? @operator "&"))
84
85 ; (-> x y z) highlights first x as var, y z as function
86 (list
87 .
88 (symbol) @function.macro
89 (#eq? @function.macro "->")
90 .
91 (symbol) @variable.parameter
92 (symbol) @function)
93
94 ; (-> 42 x y) highlights 42 as regular number
95 (list
96 .
97 (symbol) @function.macro
98 (#eq? @function.macro "->")
99 .
100 (_)
101 (symbol) @function)