Skip to content

Add await and Protocol to the identifiers escaping rules #88

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 2 commits into from
Jun 22, 2023

Conversation

denil-ct
Copy link
Contributor

@denil-ct denil-ct commented Jun 21, 2023

Motivation

Resolves #34

Modifications

  • Added Protocol to the keywords set.
  • Added await to the keywords set.

Result

  • Would be able to support Protocol and await as property names.

Test Plan

Tested and verified for both names. They are properly renamed to _Protocol and _await

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Hi @denil-ct, thanks for another contribution!

Adding the two keywords is the quick fix and covers the original issue, so let's keep this PR to just that change, and please add to the unit tests to have some automated testing.

Could you break out the hex encoding experiment into a separate PR? I'd like us to discuss it more, but I don't want to block fixing #34 for it. Thanks! 🙏

@denil-ct
Copy link
Contributor Author

Sure, that makes sense.
Quick question @czechboy0 , the initial issue mentions only the Protocol keyword. Should there be a new issue for await or can it be added on to that?

@czechboy0
Copy link
Contributor

You can add await as well in this PR, the change is well understood.

The hex stuff is new and we'll want to think about the implications to existing code etc, thus the separate PR.

@denil-ct denil-ct force-pushed the add-missed-keywords branch from 532bc2f to 1d6d5bf Compare June 22, 2023 08:26
@czechboy0
Copy link
Contributor

@swift-server-bot add to allowlist

Copy link
Contributor

@czechboy0 czechboy0 left a comment

Choose a reason for hiding this comment

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

Looks good, thanks! I checked the unit tests and we already cover the "keyword" case, so no real need to list all the keywords there.

@czechboy0 czechboy0 requested a review from simonjbeaumont June 22, 2023 08:30
@denil-ct denil-ct changed the title Add missed keywords and character encoding Add missed keywords Jun 22, 2023
@czechboy0 czechboy0 added the 🔨 semver/patch No public API change. label Jun 22, 2023
Copy link
Collaborator

@simonjbeaumont simonjbeaumont left a comment

Choose a reason for hiding this comment

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

@denil-ct thank you for once again for diving in 💪

I left a comment about Protocol—not sure if we need it.

Additionally, would you mind adopting a PR title that would make a good entry in the release notes. For this PR, something like:

Add `await` to the identifiers escaping rules 

@denil-ct denil-ct changed the title Add missed keywords Add await and Protocol to the identifiers escaping rules Jun 22, 2023
@simonjbeaumont simonjbeaumont enabled auto-merge (squash) June 22, 2023 11:24
@simonjbeaumont simonjbeaumont merged commit 6d64332 into apple:main Jun 22, 2023
@denil-ct denil-ct deleted the add-missed-keywords branch June 22, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔨 semver/patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add "Protocol" to the list of reserved terms
3 participants