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

Fix/nested splat syntax #80

Merged

Conversation

josh-barker
Copy link
Contributor

@josh-barker josh-barker commented Sep 30, 2021

As per Hashicorp's documentation, [*] is the recommended way of using a splat operator.

This PR is an attempt to parse nested splat operators.

As this is my first contribution and first time using lark, please review the change carefully.
The tests are passing, but I could be missing something.

You may find it easier to review this by looking at each commit.

Cheers

Addresses #81

josh-barker and others added 8 commits September 30, 2021 09:44
It's possible to have a full splat with multiple get_attr or index elements after it. Such as foo[*][0].bar.baz[0]

We also weren't handling regular splats correctly with multiple elements such as foo.*.bar.baz

Update lark file and transformer to handle those cases
@aoskotsky-amplify
Copy link
Member

Thanks for the PR! Sorry for the long delay getting it reviewed. I committed a few additional changes because I realized there are other cases we aren't handling. Added tests for those cases which are now passing so will merge and release this fix.

@aoskotsky-amplify aoskotsky-amplify merged commit fa78026 into amplify-education:master Feb 21, 2022
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