001 update cst types#1
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR updates the gram CST type definitions to align with tree-sitter-gram@0.2.0, introducing a new stringifyCst utility for s-expression output and comprehensive corpus-based regression tests.
Key Changes:
- Updated CST type definitions to match tree-sitter-gram@0.2.0 grammar (renamed arrow types, new node types like
symbol,annotation,tagged_string) - Added
stringifyCstfunction for deterministic s-expression output matching tree-sitter CLI conventions - Implemented corpus-based regression test suites covering positive and error cases
Reviewed Changes
Copilot reviewed 87 out of 90 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
packages/gram/src/lib/parser/cst-types.ts |
Complete rewrite aligning CST types with updated grammar, replacing old arrow types with new taxonomy |
packages/gram/src/lib/parser/cst-stringify.ts |
New stringifier implementation for CST → s-expression conversion |
packages/gram/src/lib/parser/corpus-loader.ts |
Corpus fixture loader for regression testing |
packages/gram/src/lib/parser/corpus-positive.spec.ts |
Positive corpus case validation tests |
packages/gram/src/lib/parser/corpus-errors.spec.ts |
Error corpus case validation tests |
packages/gram/src/lib/parser/grammar-metadata.ts |
Grammar metadata accessor for node type validation |
packages/gram/src/lib/parser/parser.ts |
Updated to use new CST type taxonomy and handle renamed fields |
packages/gram/README.md |
Added stringifier usage examples and upgrade notes |
packages/gram/package.json |
Updated dependencies including tree-sitter and effect versions |
package.json |
Updated Nx toolchain and dependencies to v22 |
tsconfig.base.json |
Removed deprecated gram-old package path, added @gram-data/data |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Andreas Kollegger <akollegger@gmail.com>
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.
brings this project up-to-date with tree-sitter-gram@0.2.0