mirror of
https://github.com/DeusData/codebase-memory-mcp.git
synced 2026-11-22 17:30:49 +08:00
Vendors harumiWeb/tree-sitter-vba (MIT, (c) 2026 harumiWeb) at
83c5c3c3c721 (tag v0.14.5, upstream HEAD), its vba dialect, as a
self-maintained fork in tools/tree-sitter-vba/. This is the precondition
for VB6/VBA extraction (#2564, ported after #1179); it registers no
language yet.
Why generated here: upstream does not track its generated parser (its
ADR 0002), so the fork carries upstream's grammar source in upstream's
layout with no local patch, and parser.c is generated in this repository
with tree-sitter-cli 0.25.10 (ABI 15), the generator every fork here
uses. Upstream's own copy is generated by 0.26.9.
Why this pin: v0.13.0 (the pin #2564 carried) exposes the same procedures
but misreads statements without an ERROR node. On the three corpora
below it yields 1,276 expression_statement nodes where v0.14.5 yields 56
(`Err.Raise a, b, c` after a label loses its callee), and it leaves an
ERROR at `Case obj Is Nothing`.
Why the vba dialect rather than upstream's vb6 one: measured with the
CLI on kellyethridge/VBCorLib @ 100acbbae0c0 (655 VB6 files),
Kr00l/VBCCR @ 4b86c5c2c075 (161 VB6 files, 70 .ctl) and upstream's 481
VBA examples, procedures outside ERROR nodes are 14,084/14,084,
12,385/1,552 and 8,104/6,573 (vba/vb6). vb6 rejects the PtrSafe/LongPtr
forms dual-target VB6 keeps inside #If VBA7 blocks and then loses whole
files; vba never sees fewer procedures in any file. vb6's parser.c is
also 75.8 MB against 48.3 MB.
Provenance by hash: common/define-grammar.js is upstream's blob
5e1f7d758ce1; vba/grammar.js minus its 40-line provenance header is
upstream's blob 9247dbbfe166. Two independent generations are
byte-identical, and identical to a generation from upstream's own layout
and tree-sitter.json. The generated node-types.json is upstream's
checked-in file byte-identical (500e635610), and the parse-table counts
equal upstream's own generated parser. Review: 0 non-ASCII bytes, 0
unmatched characters on full tokenization, one comment (the generator
stamp), no string literal with a space, no external scanner, no call
outside the tree-sitter macros. No upstream script, package hook or
binary was run or vendored.
- internal/cbm/vendored/grammars/vba/: the generated parser.c, the
tree_sitter/ headers (byte-identical to copies already vendored) and
upstream's MIT LICENSE byte-identical.
- internal/cbm/grammar_vba.c: compiles and links tree_sitter_vba. No
CBMLanguage, extension or alias routes to it yet; extraction adds them
under the vb6/vba names (vb and visualbasic mean VB.NET).
- MANIFEST.md (fork note with the measurements and known gaps, forks
table, 164 grammars, ABI recount), THIRD_PARTY.md (fork list and a vba
section), scripts/vendored-checksums.txt, and the FORKS entry in
scripts/audit-license-provenance.py.
- README.md and the Chocolatey nuspec say 164 languages: the
language-count contract defines the count as the vendored grammar
directories.
- tests/test_parse_coverage.c: a dual-target VB6 class module (IDE class
header, Declare in both #If VBA7 branches, Property Get/Let/Set,
Implements, events, a label, bare calls) parses with no ERROR node and
every bare call keeps its callee; a CRLF VB6 form parses clean; broken
source is still flagged. The class case fails on v0.13.0 and on the vb6
dialect.
Refs #721, #2564
Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>