Skip to content

[5.1 ]Parser: properly handle token receiver in back tracking scope #23189

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

Merged
merged 1 commit into from
Mar 9, 2019

Conversation

nkcsgexi
Copy link
Contributor

@nkcsgexi nkcsgexi commented Mar 8, 2019

Back tracking scope may lead to a same token to be consumed/received twice.
This patch introduces a DelayedTokenReceiver to temporarily store received
tokens during a back tracking scope. After the scope ends, the stored tokens
will be either transferred to the original token receiver in the parser or
be discarded, depending on whether the scope will actually back-track.

Fixing: rdar://42547871

@nkcsgexi
Copy link
Contributor Author

nkcsgexi commented Mar 8, 2019

@swift-ci please test

@nkcsgexi nkcsgexi merged commit 825d241 into swiftlang:swift-5.1-branch Mar 9, 2019
@nkcsgexi nkcsgexi deleted the cherry-pick-42547871 branch March 9, 2019 00:03
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