feat(extraction): vendor current C/C++ grammars (R7a prep) — c v0.24.2 + cpp v0.23.4, sha-matched (#1345)
tree-sitter-wasms shipped 2023-era C/C++ grammars; the kernel walker must compile the crates.io versions, so production wasm upgrades FIRST and in isolation (the R2 pattern). Built with tree-sitter-cli 0.25.10 from each tag's CHECKED-IN parser.c: tree-sitter-c v0.24.2 (b780e47, parser.c f2883ff9), tree-sitter-cpp v0.23.4 (f41e1a0, parser.c 2a35a43b, scanner.c cf60387d) — sha-matched against the crates.io tarballs. .metal/.cu map to language 'cpp' so the dialects ride the same coherent grammar. Full suite green with the upgraded grammars (2,490; one unrelated daemon idle-timeout flake passed solo 9/9) — incl. the UE-macro, misparse-guard, Metal, and CUDA coverage. Checklist updated with the vendored revs and the metal/cuda routing correction. Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
34ad0801aa
commit
44561b6aad
@@ -1,6 +1,12 @@
|
|||||||
# C/C++ kernel port (R7a) — the bug-for-bug checklist
|
# C/C++ kernel port (R7a) — the bug-for-bug checklist
|
||||||
|
|
||||||
**Status:** survey COMPLETE (2026-07-17); grammars + walker + gates not started.
|
**Status:** survey COMPLETE; grammars VENDORED + suite-green (2026-07-17):
|
||||||
|
tree-sitter-c v0.24.2 (`b780e47`, parser.c `f2883ff9…`) + tree-sitter-cpp
|
||||||
|
v0.23.4 (`f41e1a0`, parser.c `2a35a43b…`, scanner.c `cf60387d…`), built with
|
||||||
|
ts-cli 0.25.10 from checked-in parser.c, in `src/extraction/wasm/` +
|
||||||
|
VENDORED_WASM_LANGS. The walker PR adds the SAME-version crates + kernel
|
||||||
|
grammar registry (kernel-grammar-parity then pins the alignment). Walker +
|
||||||
|
gates not started.
|
||||||
This is §0a-recipe step 1's output for c/cpp: every TS-side branch the walker
|
This is §0a-recipe step 1's output for c/cpp: every TS-side branch the walker
|
||||||
must mirror, with file:line anchors into the reference implementation. Read it
|
must mirror, with file:line anchors into the reference implementation. Read it
|
||||||
WITH `docs/design/rust-kernel-migration-plan.md` (§0a recipe, §5 gates).
|
WITH `docs/design/rust-kernel-migration-plan.md` (§0a recipe, §5 gates).
|
||||||
@@ -17,11 +23,12 @@ dialect module), `java.rs`, `go.rs` (receiver QNs), `python.rs`.
|
|||||||
blanked bytes — all seven blanking passes (`preParseCppSource` /
|
blanked bytes — all seven blanking passes (`preParseCppSource` /
|
||||||
`preParseCSource`, `languages/c-cpp.ts:698/750`) then need NO Rust port,
|
`preParseCSource`, `languages/c-cpp.ts:698/750`) then need NO Rust port,
|
||||||
and every offset survives (they're all equal-length-space replacements).
|
and every offset survives (they're all equal-length-space replacements).
|
||||||
2. **Metal + CUDA are NOT routed this round.** They are separate `Language`
|
2. **Metal + CUDA ride the cpp route** (corrected from the first draft):
|
||||||
values riding the cpp grammar; leaving them off `DEFAULT_ROUTED` keeps them
|
`.metal`/`.cu` map to language `'cpp'` at detectLanguage (grammars.ts:135),
|
||||||
on wasm — zero risk, tiny file counts. (CUDA blanking still applies to
|
so there is no separate routing decision — when cpp routes to the kernel,
|
||||||
c/cpp-detected files via the content gate inside preParse — that rides the
|
those files come along as blanked cpp. The preParse hoist MUST pass
|
||||||
hoist for free.)
|
`filePath` (the extension gates Metal-attribute blanking) and the CUDA
|
||||||
|
content gate rides for free. Their suite tests are the parity insurance.
|
||||||
3. **One walker module, dual language** (`codegraph-kernel/src/ccpp/`), flagged
|
3. **One walker module, dual language** (`codegraph-kernel/src/ccpp/`), flagged
|
||||||
c vs cpp like `tsjs/` flags its four dialects. Grammars: tree-sitter-c +
|
c vs cpp like `tsjs/` flags its four dialects. Grammars: tree-sitter-c +
|
||||||
tree-sitter-cpp crates, wasm vendored from the SAME tags (sha-matched
|
tree-sitter-cpp crates, wasm vendored from the SAME tags (sha-matched
|
||||||
|
|||||||
@@ -292,6 +292,11 @@ const VENDORED_WASM_LANGS: ReadonlySet<GrammarLanguage> = new Set([
|
|||||||
'pascal', 'scala', 'lua', 'luau', 'csharp', 'r', 'cfml', 'cfscript', 'cfquery',
|
'pascal', 'scala', 'lua', 'luau', 'csharp', 'r', 'cfml', 'cfscript', 'cfquery',
|
||||||
'cobol', 'vbnet', 'erlang', 'terraform', 'arkts', 'nix',
|
'cobol', 'vbnet', 'erlang', 'terraform', 'arkts', 'nix',
|
||||||
'typescript', 'tsx', 'javascript', 'jsx', 'java', 'python', 'go',
|
'typescript', 'tsx', 'javascript', 'jsx', 'java', 'python', 'go',
|
||||||
|
// R7a (C/C++ kernel port prep): tree-sitter-c v0.24.2 (b780e47) +
|
||||||
|
// tree-sitter-cpp v0.23.4 (f41e1a0), parser.c/scanner.c sha-matched against
|
||||||
|
// the crates.io tarballs. `.metal`/`.cu` map to language 'cpp', so the
|
||||||
|
// dialects ride the same (single, coherent) upgraded grammar.
|
||||||
|
'c', 'cpp',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
/** Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms). */
|
/** Absolute path of a language's grammar WASM (vendored or tree-sitter-wasms). */
|
||||||
|
|||||||
Executable
BIN
Binary file not shown.
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user