Skip to content

Conversation

@TTOzzi
Copy link
Member

@TTOzzi TTOzzi commented May 16, 2023

  • Explanation: Previously, we would not consider newlines inside comments as making a token start on a new line. Because of this we would reject the following, saying that the two elements should be separated by a semicolon
let a = 1 /*
*/let b = 2

@TTOzzi TTOzzi requested a review from ahoppen as a code owner May 16, 2023 16:12
import XCTest
@_spi(RawSyntax) import SwiftSyntax
@_spi(Testing)@_spi(RawSyntax) import SwiftParser
@_spi(Testing) @_spi(RawSyntax) import SwiftParser
Copy link
Member Author

@TTOzzi TTOzzi May 16, 2023

Choose a reason for hiding this comment

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

I ran format.py before opening the PR, and it made this change 🤔
Should I include this in this PR?

Copy link
Member

Choose a reason for hiding this comment

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

Ah, that’s because the 5.9 swift-format doesn’t add a space here. It shouldn’t be included in the PR or CI will complain that the release/5.9 branch is not formatted correctly according to the release/5.9 branch of swift-format.

Copy link
Member Author

Choose a reason for hiding this comment

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

Aha, I understand. I removed the formatting commit. Thank you for explaining it 🙂


@_spi(RawSyntax) import SwiftSyntax
@_spi(Testing)@_spi(RawSyntax) import SwiftParser
@_spi(Testing) @_spi(RawSyntax) import SwiftParser
Copy link
Member Author

Choose a reason for hiding this comment

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

This is also the same.

@TTOzzi TTOzzi force-pushed the 5.9-fix-newline-parsing-at-trailing-trivia branch from 4b82be7 to 32f9b25 Compare May 17, 2023 13:58
@ahoppen
Copy link
Member

ahoppen commented May 17, 2023

@swift-ci Please test

@ahoppen ahoppen requested a review from bnbarham May 17, 2023 21:33
@ahoppen ahoppen merged commit 222b7f4 into swiftlang:release/5.9 May 18, 2023
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