ruff/crates/ruff_python_parser/src
Gautier Moin a067d87ccc
Fix incorrect Parameter range for *args and **kwargs (#10283)
## Summary

Fix #10282 

This PR updates the Python grammar to include the `*` character in
`*args` `**kwargs` in the range of the `Parameter`
```
def f(*args, **kwargs): pass
#      ~~~~    ~~~~~~    <-- range before the PR
#     ^^^^^  ^^^^^^^^    <-- range after
```

The invalid syntax `def f(*, **kwargs): ...` is also now correctly
reported.

## Test Plan

Test cases were added to `function.rs`.
2024-03-08 18:57:49 -05:00
..
lexer Track quoting style in the tokenizer (#10256) 2024-03-08 08:40:06 +00:00
snapshots Fix incorrect Parameter range for *args and **kwargs (#10283) 2024-03-08 18:57:49 -05:00
context.rs Add parenthesized flag to ExprTuple and ExprGenerator (#9614) 2024-02-26 15:35:20 +00:00
function.rs Fix incorrect Parameter range for *args and **kwargs (#10283) 2024-03-08 18:57:49 -05:00
invalid.rs Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
lexer.rs Track quoting style in the tokenizer (#10256) 2024-03-08 08:40:06 +00:00
lib.rs Start tracking quoting style in the AST (#10298) 2024-03-08 19:11:47 +00:00
parser.rs Remove Expr postfix from ExprNamed, ExprIf, and ExprGenerator (#10229) 2024-03-04 12:55:01 +01:00
python.lalrpop Fix incorrect Parameter range for *args and **kwargs (#10283) 2024-03-08 18:57:49 -05:00
python.rs Fix incorrect Parameter range for *args and **kwargs (#10283) 2024-03-08 18:57:49 -05:00
soft_keywords.rs Reduce Result<Tok, LexicalError> size by using Box<str> instead of String (#9885) 2024-02-08 20:36:22 +00:00
string.rs Start tracking quoting style in the AST (#10298) 2024-03-08 19:11:47 +00:00
string_token_flags.rs Start tracking quoting style in the AST (#10298) 2024-03-08 19:11:47 +00:00
token.rs Track quoting style in the tokenizer (#10256) 2024-03-08 08:40:06 +00:00
token_source.rs Remove type parameter from parse_* methods (#9466) 2024-01-11 19:41:19 +01:00
typing.rs Remove source path from parser errors (#9322) 2023-12-30 20:33:05 +00:00