@@ -0,0 +1,101 @@
1+; GENERATED VIA https://github.com/vito/tree-sitter-bass
5+(comment) @comment.line
9+["(" ")" "[" "]" "{" "}"] @punctuation.bracket
13+[(ignore) (null)] @constant.builtin
15+(bool) @constant.builtin.boolean
17+(int) @constant.numeric.integer
24+(string (string_escape) @constant.character.escape)
26+;; keywords (symbol literals)
28+(keyword) @string.special.symbol
32+(dot) @string.special.path
33+(dotdot) @string.special.path
34+(command) @string.special.path
35+(subpath (symbol) @string.special.path)
37+; slashes in a path denote a combiner call
38+(subpath (slash) @function)
42+;;; specific highlighting for builtins & special forms
44+;; symbol classification based highlighting
46+(list . (symbol) @keyword.control.conditional (#match? @keyword.control.conditional "^(if|case|cond|when)$"))
47+(cons . (symbol) @keyword.control.conditional (#match? @keyword.control.conditional "^(if|case|cond|when)$"))
49+(list . (symbol) @keyword.control.repeat (#match? @keyword.control.repeat "^(each)$"))
50+(cons . (symbol) @keyword.control.repeat (#match? @keyword.control.repeat "^(each)$"))
52+(list . (symbol) @label (#match? @label "^(def|defop|defn)$"))
53+(cons . (symbol) @label (#match? @label "^(def|defop|defn)$"))
55+(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)$"))
56+(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)$"))
58+(list . (symbol) @function.macro (#match? @function.macro "^(op|fn|current-scope|quote|let|provide|module|or|and|->|curryfn|for|\\$|linux)$"))
59+(cons . (symbol) @function.macro (#match? @function.macro "^(op|fn|current-scope|quote|let|provide|module|or|and|->|curryfn|for|\\$|linux)$"))
61+(list . (symbol) @keyword.builtin (#match? @keyword.builtin "^(do|doc)$"))
62+(cons . (symbol) @keyword.builtin (#match? @keyword.builtin "^(do|doc)$"))
64+(list . (symbol) @keyword.control.import (#match? @keyword.control.import "^(use|import|load)$"))
65+(cons . (symbol) @keyword.control.import (#match? @keyword.control.import "^(use|import|load)$"))
70+; [a & b] highlights & as operator rather than a regular symbol
71+(list (symbol) @operator (#match? @operator "&"))
72+(cons (symbol) @operator (#match? @operator "&"))
74+; (-> x y z) highlights first x as var, y z as function
77+ (symbol) @function.macro
78+ (#eq? @function.macro "->")
80+ (symbol) @variable.parameter
83+; (-> 42 x y) highlights 42 as regular number
86+ (symbol) @function.macro
87+ (#eq? @function.macro "->")
92+;;; generic highlighting for all forms
94+; first symbol in a list form is a combiner call
95+(list . (symbol) @function)
97+; highlight symbols as vars only when they're clearly vars
98+(cons (symbol) @variable)
99+(scope (symbol) @variable)
100+(path form: (symbol) @variable)
101+(symbind form: (symbol) @variable)