Skip to content

Use SwiftSyntaxBuilder to generate SwiftSyntaxBuilder Tokens #381

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 1 commit into from
May 27, 2022

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Apr 7, 2022

No description provided.

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 4 times, most recently from 9be07b7 to c7c3a28 Compare April 21, 2022 09:59
@kimdv
Copy link
Contributor Author

kimdv commented Apr 21, 2022

We also need to be able to run the executable from the CI, so we can ensure everything are up to date.

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 2 times, most recently from 1ca8240 to 64cfaa1 Compare April 21, 2022 13:31
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Thanks. This is looking great! It’s good to see that we can actually generate that sort of semi-complex code using SwiftSyntaxBuilder. I’ve added some initial review comments inline.

@iMostfa is working on some nice API to add comments to syntax nodes here: #385, maybe that will also help with the generation of Tokens.swift.

I think the next steps would be

  • Integrate it into build-script.py (in this PR)
    • Add a build-script.py action to build + run SwiftSyntaxBuilderGeneration (similar to the degyb action that currently exists)
    • Add a mode that verifies that the generated files match the committed ones for CI (--verify-generated-files)
  • In follow-up PRs:
    • Fix the indentation issue (could also be a PR that we merge prior to this one)
    • Use SwiftSyntaxBuilderGeneration.swift as an example to see how we can improve the SwiftSyntaxBuilder API, mostly by providing convenience initializers.
    • Adopt @iMostfa’s comment API

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 5 times, most recently from 9fdc9fe to 0352492 Compare April 28, 2022 08:40
@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 2 times, most recently from 417e9df to 5495b08 Compare May 5, 2022 06:12
@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 4 times, most recently from e9e6839 to ecbf68b Compare May 13, 2022 17:19
@kimdv kimdv marked this pull request as ready for review May 17, 2022 07:36
@kimdv
Copy link
Contributor Author

kimdv commented May 17, 2022

@swift-ci please test

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 2 times, most recently from 0e32efe to 8be214e Compare May 18, 2022 18:44
@kimdv
Copy link
Contributor Author

kimdv commented May 18, 2022

@swift-ci please test

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch from 8be214e to b08e4de Compare May 18, 2022 21:00
@kimdv
Copy link
Contributor Author

kimdv commented May 18, 2022

@swift-ci please test

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 2 times, most recently from 23ed086 to 3c9e1f2 Compare May 24, 2022 15:25
@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 3 times, most recently from ffe145e to d7b67c4 Compare May 25, 2022 11:54
@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch 2 times, most recently from 7ec1c7b to 80e30d3 Compare May 25, 2022 13:43
Copy link
Member

@ahoppen ahoppen left a comment

Choose a reason for hiding this comment

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

Let’s 🚢 it

@ahoppen
Copy link
Member

ahoppen commented May 27, 2022

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented May 27, 2022

Looks like the generated files don’t match. Could you re-generate them?

@kimdv kimdv force-pushed the kimdv/SwiftSyntaxBuilderGeneration branch from 80e30d3 to 422bd62 Compare May 27, 2022 16:16
@kimdv
Copy link
Contributor Author

kimdv commented May 27, 2022

@swift-ci please test

1 similar comment
@kimdv
Copy link
Contributor Author

kimdv commented May 27, 2022

@swift-ci please test

@kimdv kimdv merged commit 43ccbb6 into swiftlang:main May 27, 2022
@kimdv kimdv deleted the kimdv/SwiftSyntaxBuilderGeneration branch June 4, 2022 21:17
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.

2 participants