Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Jun 10, 2025

The only place where we were dropping unexpected tokens or trivia around a string segment was when inferring the indentation of the closing quote. Instead of having a precondition, add the conditions that the last segment doesn’t have any of these here and fall back to the same logic that is used when the indentaiton could not be inferred.

Fixes #3097

@ahoppen ahoppen force-pushed the string-literal-precondition branch from c1714f3 to d280549 Compare June 10, 2025 13:23
@ahoppen
Copy link
Member Author

ahoppen commented Jun 10, 2025

@swift-ci Please test

Copy link
Contributor

@hamishknight hamishknight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@ahoppen ahoppen force-pushed the string-literal-precondition branch from d280549 to ebcb98d Compare June 10, 2025 14:15
The only place where we were dropping unexpected tokens or trivia around a string segment was when inferring the indentation of the closing quote. Instead of having a precondition, add the conditions that the last segment doesn’t have any of these here and fall back to the same logic that is used when the indentaiton could not be inferred.

Fixes swiftlang#3097
@hamishknight
Copy link
Contributor

swiftlang/swift#82150

@swift-ci please test

@hamishknight hamishknight merged commit 3274aaa into swiftlang:main Jun 11, 2025
51 of 53 checks passed
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.

Swift parser crashes on invalid multi-line string literal

2 participants