Skip to content

Conversation

ahoppen
Copy link
Member

@ahoppen ahoppen commented Aug 8, 2023

No description provided.

@ahoppen ahoppen requested a review from bnbarham August 8, 2023 00:10
@ahoppen ahoppen force-pushed the ahoppen/macro-versioning branch 2 times, most recently from 0843072 to 9263dee Compare August 8, 2023 01:57

## Representation of New Syntax with Old swift-syntax Versions

In case that a swift-syntax verison is used that is older than the compiler’s version, then swift-syntax will not be able to represent the new syntactic structures (like new statements) in the source file because it doesn’t know about them.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In case that a swift-syntax verison is used that is older than the compiler’s version, then swift-syntax will not be able to represent the new syntactic structures (like new statements) in the source file because it doesn’t know about them.
If a swift-syntax verison is used that is older than the compiler’s version, then swift-syntax will not be able to represent the new syntactic structures (like new statements) in the source file because it doesn’t know about them.

@@ -0,0 +1,29 @@
# Updating a Macro to a New Major Swift-syntax Version
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Swift-syntax here vs swift-syntax below. Personally I wouldn't title case it

Copy link
Member Author

Choose a reason for hiding this comment

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

Damn, I didn’t double-check the output of titlecase.com here

@ahoppen ahoppen force-pushed the ahoppen/macro-versioning branch from 9263dee to e3471c9 Compare August 8, 2023 02:43
@ahoppen
Copy link
Member Author

ahoppen commented Aug 8, 2023

@swift-ci Please test


For simplicity, this article assumes that `509` is the current swift-syntax version and `510` the next, but everything applies to any other major swift-syntax version update, including version jumps to `600`.

When staring to write a macro, no special considerations need to be made with regard in terms of versioning. Depending on swift-syntax as with `from: "509.0.0"` will make sure that the macro receives any bug fix updates to swift-syntax 509. For example, a macro depending on swift-syntax 509 might be released as version 1.0, 1.2, 2.0, …
Copy link

@tevelee tevelee Aug 8, 2023

Choose a reason for hiding this comment

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

Suggested change
When staring to write a macro, no special considerations need to be made with regard in terms of versioning. Depending on swift-syntax as with `from: "509.0.0"` will make sure that the macro receives any bug fix updates to swift-syntax 509. For example, a macro depending on swift-syntax 509 might be released as version 1.0, 1.2, 2.0, …
When starting to write a macro, no special considerations need to be made with regard to versioning. Depending on swift-syntax as with `from: "509.0.0"` will make sure that the macro receives any bug fix updates to swift-syntax 509. For example, a macro depending on swift-syntax 509 might be released as version 1.0, 1.2, 2.0, …

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for catching these typos @tevelee

@ahoppen ahoppen force-pushed the ahoppen/macro-versioning branch from e3471c9 to be755dd Compare August 8, 2023 15:39
@ahoppen
Copy link
Member Author

ahoppen commented Aug 8, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge August 8, 2023 15:39
@ahoppen
Copy link
Member Author

ahoppen commented Aug 8, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit 819a68b into swiftlang:main Aug 9, 2023
@ahoppen ahoppen deleted the ahoppen/macro-versioning branch August 4, 2025 10:49
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.

4 participants