Skip to content

Filter out 0-length tokens when generating syntax model nodes #11332

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

nathawes
Copy link
Contributor

@nathawes nathawes commented Aug 3, 2017

swift::tokenize() with TokenizeInterpolatedString set to true produces an empty string literal token between directly adjacent interpolations, e.g. in "\(1)\(1)". The syntax model relies upon having a string literal token in this position to determine whether the next left paren and preceding right paren are string interpolation anchors or not, but there is no need to to include a corresponding empty SyntaxNode in the syntax model. 0-length syntax nodes don't really make sense and may break assumptions in client SyntaxModelWalkers.

Resolves rdar://problem/33601932.

@nathawes
Copy link
Contributor Author

nathawes commented Aug 3, 2017

@swift-ci Please smoke test

@nathawes nathawes requested a review from benlangmuir August 3, 2017 21:48
@nathawes nathawes merged commit 5c110ca into swiftlang:master Aug 3, 2017
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