Skip to content

[libSyntax] Add leading and trailing space property for Token #36383

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

Conversation

kimdv
Copy link
Contributor

@kimdv kimdv commented Mar 10, 2021

This add a leading/trailing space property on Token.py so we can use gyb for generate in swiftlang/swift-syntax#264

@kimdv kimdv force-pushed the kimdv/add-leading-trailing-space-for-token branch from b8ef673 to 86652af Compare March 10, 2021 17:32
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.

The overall design of requires_leading_space and requires_trailing_space looks good to me.

As to the classifications, which tokens need spaces, all you choices look reasonable to me and I don’t have any objections but I believe we’ll need to come back here and re-classify once we get a feeling how the SyntaxBuildable actually produces code – but we can do that in follow-up PRs.

Checking it locally, I noticed that Python lint fails. Could you make sure that utils/python_lint.py passes?

Just invoke it as follows

cd /path/to/swift
utils/python_lint.py

@kimdv kimdv force-pushed the kimdv/add-leading-trailing-space-for-token branch from 86652af to ad93067 Compare March 11, 2021 08:05
@kimdv kimdv marked this pull request as ready for review March 11, 2021 08:05
@kimdv
Copy link
Contributor Author

kimdv commented Mar 11, 2021

It should pass now @ahoppen 🎉

@kimdv kimdv force-pushed the kimdv/add-leading-trailing-space-for-token branch from ad93067 to df86242 Compare March 11, 2021 09:54
@CodaFi
Copy link
Contributor

CodaFi commented Mar 15, 2021

@swift-ci smoke test

@ahoppen ahoppen merged commit 91be112 into swiftlang:main Mar 16, 2021
@kimdv kimdv deleted the kimdv/add-leading-trailing-space-for-token branch December 1, 2021 18:54
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