Skip to content

[4.1][Parse] Disable token receiver while parsing types in editor placeholder #13480

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

Conversation

rintaro
Copy link
Member

@rintaro rintaro commented Dec 16, 2017

Explanation: The parser has TokReceiver for recording consumed tokens used by SourceKit. When the parser parses types in editor placeholder (e.g. <#T##String#>), it should stop the recording so it doesn't record extra tokens following to the placeholder. Although those extra tokens were usually just ignored, if the placeholder was at the end of the file, it used to cause a SourceKit crash.
Scope: Affects SourceKit for files which has placeholder at the end of it.
Issue: rdar://problem/36081659
Risk: Low, TokReceiver is disabled in normal compilation.
Testing: Added compiler regression test.

Otherwise, for `<#T##Type#>`, `TokReceiver` records
 `{'<#T##Type#>', 'Type'}`.
@rintaro rintaro requested a review from akyrtzi December 16, 2017 03:22
@rintaro
Copy link
Member Author

rintaro commented Dec 16, 2017

@swift-ci Please test

@akyrtzi akyrtzi merged commit ebd67e7 into swiftlang:swift-4.1-branch Dec 18, 2017
@rintaro rintaro deleted the 4.1-parse-placeholder-disablesyntax branch January 23, 2018 16:28
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