Charlie Marsh
15b73bdb8a
Introduce AST nodes for PatternMatchClass arguments ( #6881 )
...
## Summary
This PR introduces two new AST nodes to improve the representation of
`PatternMatchClass`. As a reminder, `PatternMatchClass` looks like this:
```python
case Point2D(0, 0, x=1, y=2):
...
```
Historically, this was represented as a vector of patterns (for the `0,
0` portion) and parallel vectors of keyword names (for `x` and `y`) and
values (for `1` and `2`). This introduces a bunch of challenges for the
formatter, but importantly, it's also really different from how we
represent similar nodes, like arguments (`func(0, 0, x=1, y=2)`) or
parameters (`def func(x, y)`).
So, firstly, we now use a single node (`PatternArguments`) for the
entire parenthesized region, making it much more consistent with our
other nodes. So, above, `PatternArguments` would be `(0, 0, x=1, y=2)`.
Secondly, we now have a `PatternKeyword` node for `x=1` and `y=2`. This
is much more similar to the how `Keyword` is represented within
`Arguments` for call expressions.
Closes https://github.com/astral-sh/ruff/issues/6866 .
Closes https://github.com/astral-sh/ruff/issues/6880 .
2023-08-26 14:45:44 +00:00
..
2023-07-19 13:01:58 +02:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-07-11 06:08:08 +00:00
2023-08-14 12:28:58 +00:00
2023-08-01 08:26:30 +02:00
2023-07-11 16:40:28 +02:00
2023-08-24 09:47:57 +00:00
2023-06-30 06:32:50 +00:00
2023-08-01 08:26:30 +02:00
2023-08-16 15:05:51 +00:00
2023-07-29 10:06:26 -04:00
2023-08-25 19:03:37 +00:00
2023-08-25 19:03:37 +00:00
2023-08-25 19:03:37 +00:00
2023-08-26 14:45:44 +00:00
2023-07-19 13:01:58 +02:00
2023-07-24 07:04:40 +00:00
2023-06-30 06:32:50 +00:00
2023-08-15 07:15:33 -04:00
2023-08-15 18:59:18 +00:00
2023-07-31 16:58:15 -04:00
2023-08-03 20:45:03 +00:00
2023-08-03 20:45:03 +00:00
2023-08-14 12:28:58 +00:00
2023-08-01 08:26:30 +02:00
2023-08-04 13:58:01 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-17 05:58:19 +00:00
2023-07-11 16:51:24 +02:00
2023-08-01 15:30:59 +00:00
2023-08-04 13:58:01 +00:00
2023-07-26 16:21:23 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 18:59:18 +00:00
2023-07-10 21:23:49 +02:00
2023-07-19 11:47:56 +00:00
2023-08-15 18:59:18 +00:00
2023-08-08 08:45:20 -04:00
2023-07-11 14:07:39 +02:00
2023-08-24 14:09:25 +02:00
2023-07-31 10:46:40 +02:00
2023-06-30 06:32:50 +00:00
2023-06-30 10:13:23 +02:00
2023-08-26 12:29:58 +02:00
2023-07-11 16:40:28 +02:00
2023-08-25 03:50:56 +00:00
2023-08-07 12:22:33 -05:00
2023-08-08 09:15:35 +00:00
2023-08-07 12:22:33 -05:00
2023-08-26 12:29:58 +02:00
2023-08-25 00:18:05 -04:00
2023-08-11 17:58:42 +00:00
2023-08-08 08:45:20 -04:00
2023-08-08 09:15:35 +00:00
2023-08-25 09:58:26 +02:00
2023-08-15 18:59:18 +00:00
2023-07-10 15:55:19 +02:00
2023-08-18 15:34:54 +00:00
2023-08-04 14:00:54 +00:00
2023-08-25 00:18:05 -04:00
2023-08-21 16:29:26 +02:00
2023-07-20 10:07:22 +00:00
2023-07-20 15:05:18 +00:00
2023-08-11 17:58:42 +00:00
2023-08-16 13:41:07 +00:00
2023-08-26 12:29:58 +02:00
2023-08-16 13:20:48 +00:00
2023-08-24 09:47:57 +00:00
2023-08-25 17:47:02 +02:00
2023-07-21 12:07:51 +00:00
2023-08-24 14:09:25 +02:00
2023-08-15 08:00:35 +02:00
2023-08-14 15:57:36 +00:00
2023-08-26 12:29:58 +02:00
2023-08-14 15:57:36 +00:00
2023-08-26 12:29:58 +02:00
2023-08-14 15:57:36 +00:00
2023-08-26 12:29:58 +02:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-14 15:57:36 +00:00
2023-08-17 05:58:19 +00:00
2023-08-17 05:58:19 +00:00
2023-08-25 19:03:37 +00:00
2023-08-17 06:05:41 +00:00
2023-08-17 06:05:41 +00:00
2023-08-21 17:45:23 +02:00
2023-08-11 13:33:15 +00:00
2023-08-15 18:59:18 +00:00
2023-08-23 00:44:33 +00:00
2023-08-23 00:40:18 -04:00
2023-08-26 12:29:58 +02:00
2023-07-13 10:51:25 +00:00
2023-08-25 07:51:55 +02:00
2023-08-15 18:59:18 +00:00
2023-07-13 10:51:25 +00:00
2023-06-26 14:15:55 +02:00
2023-08-02 20:29:28 +00:00
2023-08-08 09:15:35 +00:00
2023-08-23 14:01:14 +00:00
2023-08-22 12:18:59 +02:00
2023-08-11 18:28:48 +00:00
2023-08-02 19:55:00 +00:00
2023-08-11 11:21:16 +00:00
2023-08-15 07:15:33 -04:00
2023-08-22 12:27:40 -04:00
2023-08-26 14:45:44 +00:00
2023-08-02 19:55:00 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 18:59:18 +00:00
2023-08-15 09:33:57 +02:00
2023-08-21 09:02:23 +02:00
2023-08-22 11:50:28 +02:00
2023-08-02 20:40:32 +00:00
2023-07-13 08:57:29 +02:00
2023-08-18 03:30:38 +00:00
2023-08-26 12:29:58 +02:00
2023-06-26 14:15:55 +02:00