Skip to content
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

Include soft keywords for is_keyword check #11445

Merged
merged 1 commit into from
May 17, 2024
Merged

Conversation

dhruvmanila
Copy link
Member

@dhruvmanila dhruvmanila commented May 16, 2024

Summary

This PR updates the TokenKind::is_keyword check to include soft keywords. To account for this change, it adds a new is_non_soft_keyword method.

The usage in logical line rules were updated to use the is_non_soft_keyword method but it'll be updated to use is_keyword in a follow-up PR (#11446).

While, the parser usages were kept as is. And because of that, the snapshots for two test cases were updated in a better direction.

Test Plan

cargo insta test

Base automatically changed from dhruv/remove-marker-tokens to main May 16, 2024 11:39
@dhruvmanila dhruvmanila changed the title Include soft keywords for TokenKind::is_keyword Include soft keywords for is_keyword check May 16, 2024
@dhruvmanila dhruvmanila added the internal An internal refactor or improvement label May 16, 2024
@dhruvmanila
Copy link
Member Author

This PR is strictly an improvement for the parser side especially the error messages. The follow-up PR #11446 updates the usages of is_keyword on the linter side which improves certain rules.

Copy link
Contributor

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

Formatter (stable)

✅ ecosystem check detected no format changes.

Formatter (preview)

✅ ecosystem check detected no format changes.

@dhruvmanila dhruvmanila merged commit 83152ff into main May 17, 2024
18 of 19 checks passed
@dhruvmanila dhruvmanila deleted the dhruv/token-kind-keywords branch May 17, 2024 04:56
dhruvmanila added a commit that referenced this pull request May 20, 2024
## Summary

This is a follow-up PR to #11445 update the `E27` rules to consider soft
keywords as well.

## Test Plan

Add test cases consisting of soft keywords and update the snapshot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal An internal refactor or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants