Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge aggregate, structure shape grammar/parsing #1790

Merged

Conversation

milesziemer
Copy link
Contributor

This commit combines aggregate shapes (list, map, union) and structure shapes in the grammar and parser. Previously, the way these shapes were defined only differed by aggregate shapes not allowing for <resource> syntax. With this change, aggregate shapes can now use for <resource> syntax and elide resource identifiers/properties.

Tests making sure for <resource> couldn't be used with non structure shapes were removed, and tests were added for verifying for <resource> behavior with lists, maps, and unions. The tests added for list/map/union elided members in elided-members.smithy mirror the tests for structure shapes in the same file.

This also updates the naming of shape productions in the grammar.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@milesziemer milesziemer requested a review from a team as a code owner May 25, 2023 14:06
This commit combines aggregate shapes (list, map, union) and
structure shapes in the grammar and parser. Previously, the way
these shapes were defined only differed by aggregate shapes not
allowing `for <resource>` syntax. With this change, aggregate
shapes can now use `for <resource>` syntax and elide resource
identifiers/properties.

The parser was also updated so parsing inline structures uses
the same method of parsing aggregate shapes.

Tests making sure `for <resource>` couldn't be used with non
structure shapes were removed, and tests were added for verifying
`for <resource>` behavior with lists, maps, and unions. The tests
added for list/map/union elided members in elided-members.smithy
mirror the tests for structure shapes in the same file.

This also updates the naming of shape productions in the grammar.
@milesziemer milesziemer force-pushed the merge-aggregate-shape-parsing branch from 91f9658 to 1ed12eb Compare May 25, 2023 14:19
@milesziemer milesziemer merged commit 4784858 into smithy-lang:main May 25, 2023
syall pushed a commit to Xtansia/smithy that referenced this pull request Aug 11, 2023
This commit combines aggregate shapes (list, map, union) and
structure shapes in the grammar and parser. Previously, the way
these shapes were defined only differed by aggregate shapes not
allowing `for <resource>` syntax. With this change, aggregate
shapes can now use `for <resource>` syntax and elide resource
identifiers/properties.

The parser was also updated so parsing inline structures uses
the same method of parsing aggregate shapes.

Tests making sure `for <resource>` couldn't be used with non
structure shapes were removed, and tests were added for verifying
`for <resource>` behavior with lists, maps, and unions. The tests
added for list/map/union elided members in elided-members.smithy
mirror the tests for structure shapes in the same file.

This also updates the naming of shape productions in the grammar.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants