Skip to content

[5.9] Update BasicFormat #1576

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
merged 14 commits into from
Apr 26, 2023

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Apr 24, 2023

@ahoppen ahoppen requested a review from DougGregor April 24, 2023 00:46
@ahoppen
Copy link
Member Author

ahoppen commented Apr 24, 2023

@swift-ci Please test

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test Windows

1 similar comment
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test Windows

@ahoppen ahoppen force-pushed the ahoppen/5.9/update-basic-format branch from f245da3 to 78c2fe4 Compare April 25, 2023 20:28
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test

@ahoppen ahoppen force-pushed the ahoppen/5.9/update-basic-format branch from 78c2fe4 to a3ff9b4 Compare April 25, 2023 21:00
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test Windows

kimdv and others added 14 commits April 25, 2023 14:41
With the new BasicFormat, these cases will be formatted weirdly, so I want to update them now.
This re-writes the implementation of BasicFormat once again to better handle user-indented code.

Co-authored-by: Ben Barham <[email protected]>
This mostly improves performance by calling `previousToken`, `nextToken`, and `firstToken` less often.
When a token node is modified, we would not add its arena as a child to the new arena. This is unsafe because the newly created token might still have its text stored in the original arena.
Instead of having to opt into separating tokens by spaces, assume that all tokens need to be separated by spaces and explicitly opt-out of space separtion of tokens.

# Conflicts:
#	Sources/SwiftParserDiagnostics/DiagnosticExtensions.swift
#	Tests/SwiftParserTest/VariadicGenericsTests.swift
#	Tests/SwiftParserTest/translated/AvailabilityQueryUnavailabilityTests.swift
#	Tests/SwiftParserTest/translated/DiagnoseDynamicReplacementTests.swift
…e same tree by formatting it using BasicFormat
@ahoppen ahoppen force-pushed the ahoppen/5.9/update-basic-format branch from a3ff9b4 to 2057d63 Compare April 25, 2023 21:41
@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test

@ahoppen
Copy link
Member Author

ahoppen commented Apr 25, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit a723958 into swiftlang:release/5.9 Apr 26, 2023
@ahoppen ahoppen deleted the ahoppen/5.9/update-basic-format branch April 26, 2023 01:12
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