Skip to content

Rename eof to endOfFile #1842

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 6 commits into from
Jul 11, 2023
Merged

Conversation

mininny
Copy link
Contributor

@mininny mininny commented Jun 25, 2023

Resolves #1837
rdar://111217077

This PR renames eof(or EOF) to endOfFile.

I've also noticed there was a FIXME where eof was treated specially in SYNTAX_TOKENS. I changed the TokenSpec to include EndOfFile as a regular SYNTAX_TOKENS, and fixed places where eof was handled individually. In most cases, these special handlings could be covered with existing logic for other tokens.

This is my first PR in swift-syntax, so please let me know if there's a better way to land these kind of changes.

Copy link
Contributor

@kimdv kimdv left a comment

Choose a reason for hiding this comment

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

Hi @mininny and welcome to SwiftSyntax 🤩

Thanks for the PR.
I've added some inline comments. If there is any question please feel free to comment on them and I will try to help you.

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.

Thank you for the rename, and also cleaning up the special handling of eof in CodeGeneration. It’s great to see that gone 🤩

@mininny
Copy link
Contributor Author

mininny commented Jun 28, 2023

Thanks for the review @ahoppen @kimdv! I've resolved the comments you two left. :)

@kimdv
Copy link
Contributor

kimdv commented Jun 29, 2023

@mininny could you rebase your PR instead of merge main into it.
It gives a more clear and clean history

@mininny mininny force-pushed the 1837-rename-eof-to-endOfFile branch from 16ad3b0 to 2abcb73 Compare June 29, 2023 16:17
@mininny
Copy link
Contributor Author

mininny commented Jun 29, 2023

@mininny could you rebase your PR instead of merge main into it. It gives a more clear and clean history

Of course! I've rebased the changes to main 👍

@mininny
Copy link
Contributor Author

mininny commented Jul 4, 2023

@kimdv Hi, if the reviewed code is fine, I was wondering if this could be tested and merged 😄

@kimdv
Copy link
Contributor

kimdv commented Jul 4, 2023

Hi @mininny !

Sorry for the delay and thanks for the ping.
Can you rebase on the latest main?
I'll review tomorrow.

@ahoppen also need to review.
I think he's on vacation 🌴

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.

Thank you @mininny. This looks great. I’ll trigger CI and once that passes I’ll merge your PR.

@ahoppen
Copy link
Member

ahoppen commented Jul 7, 2023

@swift-ci Please test

@ahoppen
Copy link
Member

ahoppen commented Jul 7, 2023

Looks like the code isn’t formatted using swift-format. Could you run ./format.py?

@mininny mininny force-pushed the 1837-rename-eof-to-endOfFile branch from 2abcb73 to 1b11c7f Compare July 10, 2023 10:51
@ahoppen
Copy link
Member

ahoppen commented Jul 10, 2023

@swift-ci Please test

@mininny
Copy link
Contributor Author

mininny commented Jul 10, 2023

Looks like the code isn’t formatted using swift-format. Could you run ./format.py?

Yep! I ran the swift formatter. Thanks

@ahoppen ahoppen enabled auto-merge (squash) July 10, 2023 10:52
auto-merge was automatically disabled July 10, 2023 10:59

Head branch was pushed to by a user without write access

@mininny mininny force-pushed the 1837-rename-eof-to-endOfFile branch from 1b11c7f to 76d9e28 Compare July 10, 2023 10:59
@ahoppen
Copy link
Member

ahoppen commented Jul 10, 2023

@swift-ci Please test

@ahoppen ahoppen enabled auto-merge (squash) July 10, 2023 11:01
@ahoppen
Copy link
Member

ahoppen commented Jul 11, 2023

@swift-ci Please test Windows

@ahoppen ahoppen merged commit d7b1493 into swiftlang:main Jul 11, 2023
@mininny mininny deleted the 1837-rename-eof-to-endOfFile branch July 11, 2023 13:34
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.

Rename TokenKind.eof to TokenKind.endOfFile
3 participants