R7b batch 4 #1 (docs/design/r-kernel-port-checklist.md is the authoritative quirk list; survey + probe record therein). The lightest-shared-surface, heaviest-hook port: languages/r.ts works entirely through the visitNode hook (every type list empty except callTypes:['call']), so the walker is a file node + a faithful hook transcription + the generic extractCall + pre-order recursion — four shared machineries (value-refs, static-member reads, type annotations, fn-ref capture) are dead by language gates and stay dead. Grammar prep is the first true no-op of the arc: the crates.io tree-sitter-r 1.2.0 tarball ships parser.c AND scanner.c sha-identical to the r-lib v1.2.0 tag the vendored wasm was built from — crate pin only, no wasm change, no bump gate; kernel-grammar-parity gains the r row (ABI 14, same-revision). Preserved bug-for-bug (all probe-pinned): calls "return" on every return(x) (named node in v1.2.0), the import quintet's silent dynamic-arg consumption vs class/generic fall-through asymmetry, library(help = pkg) importing the named arg, class-idiom variable suppression by callee name, chained/right- assign/precedence-ghost gaps, env$fn body-leak-to-file, raw-text callees verbatim (pkg::fn, obj$meth, "strfn" quotes kept, (handler) conversion), duplicate same-(kind,name,line) ids, roxygen dropped entirely, UTF-16 columns/slices. Gates: parity sweeps first-run 0-diff on AnomalyDetection/dplyr/ggplot2/ shiny (838 files; deferrals exactly 0/0/0/1 — the 1 is the moustache- template pseudo-R file, both-arm) — kernel-parity.mjs gained lowercased- extension matching so .R files sweep (matches detectLanguage routing); full-init dumps byte-identical kernel-vs-wasm on dplyr/ggplot2/shiny; kernel-r-parity suite (torture fixture + in-memory CRLF + BOM variants + defer pin + kernel-arm quirk pins); full suite 2,638 green ×2 with CODEGRAPH_KERNEL_EXPECT=1. DEFAULT_ROUTED += r (16 langs). Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
68 lines
2.7 KiB
TOML
68 lines
2.7 KiB
TOML
[package]
|
|
name = "codegraph-kernel"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
license = "MIT"
|
|
publish = false
|
|
description = "Native extraction kernel for CodeGraph — tree-sitter parse+extract with one JS boundary crossing per file"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib"]
|
|
|
|
[dependencies]
|
|
napi = { version = "3", default-features = false, features = ["napi8"] }
|
|
napi-derive = "3"
|
|
tree-sitter = "0.25"
|
|
sha2 = "0.10"
|
|
regex = "1"
|
|
|
|
# Grammars — MUST stay revision-matched with the wasm grammars the fallback
|
|
# path loads (tree-sitter-wasms npm package / src/extraction/wasm/). The
|
|
# kernel-grammar-parity test asserts node-kind-table equality at test time;
|
|
# bump these together with the wasm side or that gate fails.
|
|
tree-sitter-typescript = "0.23"
|
|
tree-sitter-javascript = "0.25"
|
|
tree-sitter-java = "0.23"
|
|
tree-sitter-python = "0.23"
|
|
tree-sitter-go = "0.23"
|
|
# Pinned exact: the vendored wasm (src/extraction/wasm/) was built from these
|
|
# tags' checked-in parser.c, sha-matched against these registry tarballs
|
|
# (R7a prep, #1345). A patch bump here without re-vendoring breaks the match.
|
|
tree-sitter-c = "=0.24.2"
|
|
tree-sitter-cpp = "=0.23.4"
|
|
tree-sitter-rust = "=0.24.2"
|
|
# csharp: the vendored wasm (#717) predates the kernel and was verified
|
|
# table-identical to this crate's tarball (ABI 15, STATE_COUNT 8053, node-kind
|
|
# and field tables — csharp checklist header). Bump crate + wasm together.
|
|
tree-sitter-c-sharp = "=0.23.5"
|
|
# ruby: content bump, ABI stays 14 (the v0.23.1 tag predates the ABI-15
|
|
# generator) — kernel-grammar-parity asserts same-revision, not same-ABI.
|
|
tree-sitter-ruby = "=0.23.1"
|
|
# php: the walker calls LANGUAGE_PHP (the full HTML-interleaving variant the
|
|
# wasm ships) — NEVER LANGUAGE_PHP_ONLY, which errors on leading HTML.
|
|
tree-sitter-php = "=0.24.2"
|
|
# swift: the vendored wasm is built from THIS crate's tarball src/ (the tag's
|
|
# checked-in parser.c is an older ABI-14 generation that can never sha-match;
|
|
# grammar.json rules are JSON-equal — swift checklist header). parser.c is
|
|
# ~20MB generated — expect slow compiles.
|
|
tree-sitter-swift = "=0.7.3"
|
|
# r: the vendored wasm IS r-lib v1.2.0 and this crate's tarball ships both
|
|
# generated artifacts sha-identical to the tag (parser.c 6221657347…,
|
|
# scanner.c 1209d11076… — r checklist §Grammar prep). ABI 14 (the tag
|
|
# predates the ABI-15 generator) — parity asserts same-revision, not
|
|
# same-ABI (ruby precedent). Bump crate + wasm together.
|
|
tree-sitter-r = "=1.2.0"
|
|
|
|
# tree-sitter-language: the version-agnostic LanguageFn shim for the vendored
|
|
# kotlin grammar C (see build.rs — no kotlin crate dep is possible).
|
|
tree-sitter-language = "0.1"
|
|
|
|
[build-dependencies]
|
|
napi-build = "2"
|
|
cc = "1"
|
|
|
|
[profile.release]
|
|
lto = true
|
|
codegen-units = 1
|
|
strip = "symbols"
|