You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dfd2b90
Browse filesBrowse the repository at this point in the historyBrowse files
feat(extraction): index Metal (.metal) and CUDA (.cu/.cuh) via the C++ grammar (#147)
Ports the Metal and CUDA language support from upstream colby 1.2.0..1.4.1 (the
two cheapest additions, since both dialects are close enough to C++ that the
existing tree-sitter-cpp grammar extracts them). Both map to Language::Cpp — no
new language variant, no new grammar crate, no new dependency, and the golden
.schema is unchanged.
- Metal (#1121): .metal maps to the C++ grammar. MSL puts attributes after the
declarator (`float4 pos [[position]];`), a shape tree-sitter-cpp misparses
into a spurious inheritance edge from the struct to a field's type. An
offset-preserving pre-parse pass blanks `[[attribute]]` annotations, gated to
.metal files only — in regular C++ the pre-declarator `[[nodiscard]]` position
is legal syntax the grammar parses natively and is left byte-identical.
- CUDA (#1172, language parts only — the namespace-qualified-name and
template-argument-call work from the same upstream commit already shipped in
v0.31.0 and is not re-ported here): .cu/.cuh map to the C++ grammar, and CUDA
in a plain .h/.hpp is recognized by content. The host->kernel call edge now
survives the `<<<grid, block>>>` launch syntax — an offset-preserving,
brace-balanced pre-parse blank of the launch config leaves `kernel(args)` as
an ordinary resolvable call (templated launches ride the existing template-arg
stripping). Kernels defined through a name-in-first-argument macro
(`DEFINE_FLASH_FORWARD_KERNEL(name, ...)`) are indexed under their real name,
with the macro-name recovery tightly gated so gtest-style `TEST(...)` and
ordinary macro calls are untouched. The `<<<>>>` and CUDA-construct blanks fire
only for CUDA files/content, so non-CUDA C++ is byte-identical.
New dedicated `metal` and `cuda` golden fixtures guard the behavior; the
existing cpp/godot/ruby/mini goldens and the .schema are byte-identical (no
regen). Local function-pointer launch dispatch is deferred.
0 commit comments