Repository navigation
rust: parse attributes on struct pattern fields - #319
Open
ssmith-synaptixs wants to merge 1 commit into
Open
ssmith-synaptixs wants to merge 1 commit into
ssmith-synaptixs wants to merge 1 commit into
Conversation
|
Since external pull requests are rarely integrated in this repository, we have been maintaining a community-owned fork of this repository, Your contribution doesn't need porting because we already support such attributes. We also bundle them together with the syntactic element they annotate, making the AST structure more useful for downstream users. If you encounter any issue switching to this grammar (as a user or contributor), let me know. |
This branch has not been deployed
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.
Summary
Allow outer attributes before fields in a struct pattern. Rust permits constructs such as:
The current grammar produces an
ERRORnode over the attributed field. This occurs in the pinned Synaptreesittermastersource atcrates/generate/src/generate.rs(commit867aa6d14418163560bf89f12c48107098b1ec8f).Change
Add
repeat($.attribute_item)tofield_pattern, regenerate the parser and node types with the repository's Tree-sitter CLI 0.26.7, and add a corpus regression case.Validation
tree-sitter test: 152/152 corpus cases pass, including the new case.ERRORfiles and 0 error lines (63,981 source lines).1577ed901354d0d7448ac162328f9dbf5183124cwith 0 error lines (630 source lines).