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 inline io parsing with mixins #1756

Merged

Conversation

milesziemer
Copy link
Contributor

When there was no space between the := and with tokens when parsing an inline io statement, for example:

operation Foo {
  input :=with [Bar] {}
}

the parser would skip the with and so not realize its parsing a mixin, failing when it sees a [ instead of a {. This was due to an extra call to tokenizer.next(), which skipped the with. Usually the next() would just skip the space before the with, but when the space wasn't present it skipped the with.

The inline-io test was updated to include this case.

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 April 26, 2023 14:06
When there was no space between the `:=` and `with` tokens when
parsing an inline io statement, for example:
```
operation Foo {
  input :=with [Bar] {}
}
```
the parser would skip the `with` and so not realize its parsing a
mixin, failing when it sees a `[` instead of a `{`. This was due
to an extra call to `tokenizer.next()`, which skipped the `with`.
Usually the `next()` would just skip the space before the `with`,
but when the space wasn't present it skipped the `with`.

The inline-io test was updated to include this case.
@milesziemer milesziemer force-pushed the fix-inline-io-mixin-parsing branch from 72b87a5 to 5cddecc Compare April 26, 2023 14:13
@milesziemer milesziemer merged commit 2b647ab into smithy-lang:main Apr 27, 2023
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.

4 participants