Skip to content

[BasicFormat] Don't insert space between floatLiteral and period#3300

Merged
cachemeifyoucan merged 1 commit intoswiftlang:mainfrom
cachemeifyoucan:eng/PR-can-import-version-basic-format
Mar 28, 2026
Merged

[BasicFormat] Don't insert space between floatLiteral and period#3300
cachemeifyoucan merged 1 commit intoswiftlang:mainfrom
cachemeifyoucan:eng/PR-can-import-version-basic-format

Conversation

@cachemeifyoucan
Copy link
Copy Markdown
Contributor

Version numbers like 8.0.4 in #if canImport(M, _version: 8.0.4) are tokenized as floatLiteral("8.0") + period + integerLiteral("4"). The existing rule for (.integerLiteral, .period) prevented space insertion for integer-prefixed versions but missed float-prefixed ones, causing 8.0 .4. Add the missing (.floatLiteral, .period) case.

@cachemeifyoucan
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

Version numbers like `8.0.4` in `#if canImport(M, _version: 8.0.4)`
are tokenized as `floatLiteral("8.0") + period + integerLiteral("4")`.
The existing rule for `(.integerLiteral, .period)` prevented space
insertion for integer-prefixed versions but missed float-prefixed ones,
causing `8.0 .4`. Add the missing `(.floatLiteral, .period)` case.
@cachemeifyoucan cachemeifyoucan force-pushed the eng/PR-can-import-version-basic-format branch from 2ff23ba to 6da2b8e Compare March 26, 2026 19:37
@cachemeifyoucan
Copy link
Copy Markdown
Contributor Author

@swift-ci please test

Copy link
Copy Markdown
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!

@cachemeifyoucan
Copy link
Copy Markdown
Contributor Author

@swift-ci please test windows

@rintaro
Copy link
Copy Markdown
Member

rintaro commented Mar 27, 2026

@swift-ci Please test Windows

@cachemeifyoucan cachemeifyoucan merged commit e9b5143 into swiftlang:main Mar 28, 2026
72 of 73 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.

3 participants