feat(grammar): added support for map types, nested packages, external-ids, and fallible constructors - #30
Merged
Merged
Conversation
3 tasks
mkatychev
added a commit
to topiary/topiary
that referenced
this pull request
Jul 21, 2026
…1298) References bytecodealliance/tree-sitter-wit#30 ## Description Update the WIT formatter queries and test cases to handle grammar introduced in tree-sitter-wit 1.4.0, this includes new additions such as: * map types https://github.com/topiary/topiary/blob/5b9f3038db13d7cbe610b87eb098503781991e34/topiary-cli/tests/samples/expected/wit.wit#L218 * nested packages https://github.com/topiary/topiary/blob/5b9f3038db13d7cbe610b87eb098503781991e34/topiary-cli/tests/samples/expected/wit.wit#L208 * external-ids https://github.com/topiary/topiary/blob/5b9f3038db13d7cbe610b87eb098503781991e34/topiary-cli/tests/samples/expected/wit.wit#L235 * fallible constructors https://github.com/topiary/topiary/blob/5b9f3038db13d7cbe610b87eb098503781991e34/topiary-cli/tests/samples/expected/wit.wit#L223
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.
Created
decl_headfor thepackage_declcontents without semicolon.This pattern, though not following the spec, makes it easier to reconcile with nested packages:
tree-sitter-wit/grammar.js
Lines 78 to 85 in c858306
Named interfaces and exports:
tree-sitter-wit/test/corpus/world.txt
Lines 303 to 314 in 00bea4a