Files
clide/app/assets/queries/swift.scm
T
jpmschweitzerandClaude ce8529e424 add tree-sitter syntax highlighting via dart:ffi
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>
2026-04-22 22:08:00 +02:00

63 lines
1.4 KiB
Scheme

[
"if" "else" "guard"
"for" "while" "repeat"
"switch" "case" "default" "fallthrough"
"break" "continue" "return" "throw"
"do" "catch" "try" "defer"
"import"
"class" "struct" "enum" "protocol" "extension" "typealias" "associatedtype"
"func" "init" "deinit" "subscript" "operator"
"var" "let"
"static" "override" "mutating" "nonmutating"
"public" "private" "fileprivate" "internal" "open"
"final" "required" "convenience" "lazy" "weak" "unowned"
"async" "await"
"where" "in" "is" "as"
"self" "super" "Self"
"nil"
"true" "false"
"inout" "some" "any"
"get" "set" "willSet" "didSet"
"throws" "rethrows"
"indirect"
"precedencegroup" "infix" "prefix" "postfix"
] @keyword
(function_declaration (identifier) @function)
(initializer_declaration "init" @function)
(class_declaration (identifier) @type)
(struct_declaration (identifier) @type)
(enum_declaration (identifier) @type)
(protocol_declaration (identifier) @type)
(typealias_declaration (identifier) @type)
(type_identifier) @type
(standard_type) @type.builtin
(string) @string
(static_string_literal) @string
(number) @number
(boolean_literal) @boolean
(identifier) @variable
(modifier) @keyword
[
"(" ")" "[" "]" "{" "}"
] @punctuation.bracket
[
"," "." ":" ";" "->" "=>"
] @punctuation.delimiter
[
"=" "+" "-" "*" "/" "%"
"==" "!=" "<" ">" "<=" ">="
"&&" "||" "!"
"&" "|" "^" "~"
"?" "??"
"..<" "..."
] @operator