You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm just opening this up for some feedback on another example of node fields. It's currently in an unfinished state. I'm curious what you think of the test changes. Some highlights:
I added a new visible block node to represent blocks of statements. I think this makes rules like if_statement look more similar to other languages.
If statements now have exactly one condition, exactly one consequence, and zero or more alternatives (which can either be else_clauses or elif_clauses.
I added several other fields to several other types of nodes, and updated a bunch of the tests to assert about the fields.
I added a new visible block node to represent blocks of statements. I think this makes rules like if_statement look more similar to other languages.
I haven't done any special treatment for blocks of statements; should I introduce something to handle block as a new record field, or is the shape of data types fine as is? I don't have my head deep enough in this space to tell by skimming, so I'd need to actually test it out...
If statements now have exactly one condition, exactly one consequence, and zero or more alternatives (which can either be else_clauses or elif_clauses).
This closely lines up with the tests I've been using to date; the only thing I'd update in my test JSON file is the alternative to make multiple true instead of false.
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
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.
Depends on tree-sitter/tree-sitter#271
I'm just opening this up for some feedback on another example of node fields. It's currently in an unfinished state. I'm curious what you think of the test changes. Some highlights:
blocknode to represent blocks of statements. I think this makes rules likeif_statementlook more similar to other languages.condition, exactly oneconsequence, and zero or morealternatives(which can either beelse_clausesorelif_clauses./cc @rewinfrey @robrix @aymannadeem