Skip to content

[Parse] Create DiagnosticTransaction along with BacktrackingScope #5493

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Oct 27, 2016

to prevent duplicated diagnostics.

For instance, on Int8(exactly: 0xG), the following error was emitted two times:

test.swift:1:21: error: expected a digit after integer literal prefix
_ = Int8(exactly: 0xG)
                    ^
test.swift:1:21: error: expected a digit after integer literal prefix
_ = Int8(exactly: 0xG)
                    ^

In this change,
DiagnosticTransaction is committed on BacktrackingScope::cancelBacktrack(),
or aborted during BacktrackingScope destruction.

@rintaro
Copy link
Member Author

rintaro commented Oct 27, 2016

@swift-ci Please smoke test

@rintaro
Copy link
Member Author

rintaro commented Oct 27, 2016

This PR will affect the testcase of #5270.
Either one should be merged first.
CC: @DougGregor @CodaFi

@CodaFi
Copy link
Contributor

CodaFi commented Oct 27, 2016

Could you merge this one first please? I already have to edit the diagnostics in #5270 anyway.

@DougGregor
Copy link
Member

LGTM! I'll go ahead and merge so @CodaFi can land his change.

@DougGregor DougGregor merged commit 5564173 into swiftlang:master Oct 27, 2016
@rintaro rintaro deleted the backtrackingscope-diagtransaction branch November 12, 2016 04:09
MaxDesiatov pushed a commit that referenced this pull request Sep 7, 2023
[pull] swiftwasm from main
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.

3 participants