Vendor libtree-sitter.so (v0.26.8, wasmtime 44.0 statically linked) and call its C API through dart:ffi. Grammar WASM files are loaded by tree-sitter's embedded wasmtime engine via ts_wasm_store_load_language. 48 grammars compiled with tree-sitter build --wasm, 48 highlight queries (42 from upstream repos, 6 written in-house for comment, erlang, gdscript, gitignore, hcl, hlsl, swift). SQLite grammar replaces full SQL (974K-line parser exhausted RAM at compile time). Removes wasm_run and wasm_run_flutter — they downloaded a 22 MB binary from GitHub at first launch, violating the no-network-on- default-launch-path policy. Co-Authored-By: Claude <noreply@anthropic.com>
107 lines
1.5 KiB
Scheme
107 lines
1.5 KiB
Scheme
(comment) @comment @spell
|
|
(annot_atom doc: (static_string) @spell)
|
|
|
|
[
|
|
"forall"
|
|
"in"
|
|
"let"
|
|
"default"
|
|
"doc"
|
|
"rec"
|
|
"optional"
|
|
"priority"
|
|
"force"
|
|
"not_exported"
|
|
] @keyword
|
|
|
|
"fun" @keyword.function
|
|
|
|
"import" @include
|
|
|
|
[ "if" "then" "else" ] @keyword.conditional
|
|
"match" @keyword.conditional
|
|
|
|
(types) @type
|
|
"Array" @type.builtin
|
|
|
|
; BUILTIN Constants
|
|
(bool) @boolean
|
|
"null" @constant.builtin
|
|
(enum_tag) @constant
|
|
|
|
|
|
(num_literal) @number
|
|
[
|
|
(infix_op)
|
|
"|>"
|
|
"="
|
|
"&"
|
|
"=="
|
|
"/"
|
|
"!="
|
|
"<"
|
|
">"
|
|
] @operator
|
|
|
|
(type_atom) @type
|
|
|
|
(chunk_literal_single) @string
|
|
(chunk_literal_multi) @string
|
|
|
|
(str_esc_char) @string.escape
|
|
|
|
[
|
|
"{" "}"
|
|
"(" ")"
|
|
"[|" "|]"
|
|
"[" "]"
|
|
] @punctuation.bracket
|
|
|
|
[
|
|
","
|
|
"."
|
|
":"
|
|
"|"
|
|
"->"
|
|
"+"
|
|
"-"
|
|
"*"
|
|
] @punctuation.delimiter
|
|
|
|
(multstr_start) @punctuation.bracket
|
|
(multstr_end) @punctuation.bracket
|
|
(interpolation_start) @punctuation.special
|
|
(interpolation_end) @punctuation.special
|
|
|
|
|
|
(builtin) @function.builtin
|
|
|
|
(fun_expr
|
|
(pattern_fun
|
|
(ident) @parameter
|
|
)
|
|
)
|
|
|
|
; application where the head terms is an identifier: function arg1 arg2 arg3
|
|
(applicative t1:
|
|
(applicative . (record_operand (atom (ident))) @function)
|
|
)
|
|
|
|
; application where the head terms is a record field path: foo.bar.function arg1 arg2 arg3
|
|
(applicative t1:
|
|
(applicative . (record_operand (record_operation_chain)) @function)
|
|
)
|
|
(str_chunks) @string
|
|
|
|
(_
|
|
(interpolation_start)
|
|
(term) @string.special
|
|
)
|
|
|
|
(field_path_elem) @property
|
|
|
|
(infix_expr
|
|
op: (infix_b_op_6)
|
|
t2: (infix_expr (applicative . (record_operand (record_operation_chain) @function )))
|
|
)
|