ruff/crates/ruff_python_parser/src
Dhruv Manilawala 83152fff92
Include soft keywords for is_keyword check (#11445)
## 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`
2024-05-17 10:26:48 +05:30
..
lexer Rename AnyStringKind -> AnyStringFlags (#11405) 2024-05-13 13:18:07 +00:00
parser Create a newtype wrapper around Vec<FStringElement> (#11400) 2024-05-13 16:04:04 +00:00
snapshots Rename AnyStringKind -> AnyStringFlags (#11405) 2024-05-13 13:18:07 +00:00
error.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
lexer.rs Move string-prefix enumerations to a separate submodule (#11425) 2024-05-15 07:40:27 -04:00
lib.rs Add Tokens newtype wrapper, TokenKind iterator (#11361) 2024-05-14 16:45:04 +00:00
soft_keywords.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
string.rs Rename AnyStringKind -> AnyStringFlags (#11405) 2024-05-13 13:18:07 +00:00
token.rs Include soft keywords for is_keyword check (#11445) 2024-05-17 10:26:48 +05:30
token_set.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
token_source.rs Replace LALRPOP parser with hand-written parser (#10036) 2024-04-18 17:57:39 +05:30
typing.rs Add basic docs for the parser crate (#11199) 2024-04-29 17:08:07 +00:00