test(c): grammar evaluation and fixture scaffold (M9 1/3)#401
Merged
Conversation
Adds tests/fixtures/c_simple/: point.h/point.c (named-and-typedef'd struct, anonymous-typedef struct, static helper, function prototypes vs definitions), list.h/list.c (self-referential struct, pointer-returning function, cross-file quoted include), platform.h/platform.c (the extern "C" + #ifdef C++-interop idiom), and main.c (entry point tying every header together). No adapter code in this commit. Stack-Id: m9-c-full-tier-20260704 Stack-Position: 1/3
Confirms tree-sitter/tree-sitter-c (official org grammar, bundled via tree-sitter-language-pack) handles every construct M9 needs -- function definitions, function prototypes, typedef'd and bare structs, and both #include forms -- with zero ERROR nodes and correct independent sibling boundaries. Documents one contained, non-cascading parser diagnostic (the extern "C" + #ifdef __cplusplus idiom, undecidable without running the preprocessor) and the design decisions it drove: prototype declarations count as FUNCTION symbols (a .h file is almost entirely prototypes), struct naming prefers a typedef alias over the bare tag, and symbol extraction/#include parsing both recurse through preprocessor-conditional and extern "C" wrapper nodes since those nest their contents rather than flattening to top-level siblings. Stack-Id: m9-c-full-tier-20260704 Stack-Position: 1/3
80a12bc to
d238176
Compare
This was referenced Jul 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stack
Stack-Id:
m9-c-full-tier-20260704Base:
mainPosition: 1/3
feat/m9-c-fixtures-> this PRfeat/m9-c-adapter-> nextfeat/m9-c-full-tier-> nextDepends on: (none — root)
Summary
M9 (DEVELOPMENT_PLAN.md Section D) PR 1/3: grammar-quality evaluation for C
plus a fixture corpus, zero adapter code.
tests/fixtures/c_simple/:point.h/point.c(typedef'd and barestructs, static helper, prototypes vs. definitions),
list.h/list.c(self-referential struct, pointer-returning function, cross-file include),
platform.h/platform.c(theextern "C"+#ifdef __cplusplusinterop idiom),
main.c(entry point).tests/fixtures/c_simple/GRAMMAR_EVALUATION.md: documents the proberesults against the bundled
tree-sitter/tree-sitter-cgrammar — zeroERRORnodes, one contained (non-cascading) parser diagnostic on theextern "C"/#ifdefidiom (undecidable without preprocessing, verifiednot to corrupt sibling boundaries), and the design decisions the probe
drove (prototype declarations count as
FUNCTION, typedef alias preferredfor struct naming, extraction recurses through preprocessor-conditional
and
extern "C"wrapper nodes).Validation
tree_sitter_language_pack.get_language("c")during evaluation; all constructs required by this milestone produce zero
ERRORnodes with independently correct boundaries (seeGRAMMAR_EVALUATION.mdfor the full probe log).uv run pytest,ruff,pyrightunaffectedby this PR (new fixture-only files under
tests/fixtures/).