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

Add async / await #77

Merged
merged 1 commit into from
Dec 31, 2021
Merged

Add async / await #77

merged 1 commit into from
Dec 31, 2021

Conversation

alex-pinkus
Copy link
Owner

Allows async in function declarations and type signatures. async must
always come before throws. This keyword also has to go in the semi
suppressor for the same reason throws and rethrows are there.

Also allows await before any expression. Gives it the same special
behavior that try gets, where it has an affinity for function calls
and ternary operators, but can be placed before any expression.

Special cases the for try await syntax that Swift added for async
sequences. That doesn't appear to have made it into the grammar yet.
Usage makes it seem like it must be either for await or
for try await, not permiting just for try alone, but without an
official reference it seems best to simply allow for try.

Allows async in function declarations and type signatures. `async` must
always come before `throws`. This keyword also has to go in the semi
suppressor for the same reason `throws` and `rethrows` are there.

Also allows `await` before any expression. Gives it the same special
behavior that `try` gets, where it has an affinity for function calls
and ternary operators, but can be placed before any expression.

Special cases the `for try await` syntax that Swift added for async
sequences. That doesn't appear to have made it into the grammar yet.
Usage makes it seem like it must be either `for await` or
`for try await`, not permiting just `for try` alone, but without an
official reference it seems best to simply allow `for try`.
@alex-pinkus alex-pinkus merged commit dffa551 into main Dec 31, 2021
@alex-pinkus alex-pinkus deleted the async-await branch December 31, 2021 20:47
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.

1 participant