ruff/crates/ruff_python_parser/src/snapshots
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
..
ruff_python_parser__context__tests__ann_assign_name.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__assign_attribute.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_for.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__context__tests__assign_list.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_list_comp.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_name.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_named_expr.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__assign_set_comp.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_starred.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_subscript.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_tuple.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__context__tests__assign_with.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__context__tests__aug_assign_attribute.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__aug_assign_name.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__aug_assign_subscript.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__del_attribute.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__del_name.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__context__tests__del_subscript.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__function__tests__function_kw_only_args.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_no_args.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_no_args_with_ranges.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_and_kw_only_args.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_args.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_args_with_defaults.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__function_pos_args_with_ranges.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__function__tests__lambda_kw_only_args.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__function__tests__lambda_no_args.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__function__tests__lambda_pos_args.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__lexer__tests__assignment.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__empty_ipython_escape_command.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__ipython_escape_command.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__ipython_escape_command_assignment.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__ipython_escape_command_indentation.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__ipython_help_end_escape_command.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__logical_newline_line_comment.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__non_logical_newline_in_string_continuation.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__numbers.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__operators.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__lexer__tests__string.snap Update lexer tests to use snapshots (#6658) 2023-08-22 18:23:19 +00:00
ruff_python_parser__parser__tests__decorator_ranges.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__parser__tests__dict_unpacking.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__generator_expression_argument.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__ipython_escape_commands.snap Rename Magic* to IpyEscape* (#6395) 2023-08-09 13:28:18 +00:00
ruff_python_parser__parser__tests__match.snap Introduce AST nodes for PatternMatchClass arguments (#6881) 2023-08-26 14:45:44 +00:00
ruff_python_parser__parser__tests__match_as_identifier.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__parser__tests__named_expression.snap Expand NamedExpr range to include full range of parenthesized value (#6632) 2023-08-17 14:34:05 +00:00
ruff_python_parser__parser__tests__numeric_literals.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap Introduce an Arguments AST node for function calls and class definitions (#6259) 2023-08-02 10:01:13 -04:00
ruff_python_parser__parser__tests__parse_bool_op_and.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_bool_op_or.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_class.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_class_generic_types.snap Add a TypeParams node to the AST (#6261) 2023-08-02 14:12:45 +00:00
ruff_python_parser__parser__tests__parse_dict_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_double_list_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_empty.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_f_string.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_function_definition.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__parser__tests__parse_generator_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_if_elif_else.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_if_else_generator_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_kwargs.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_lambda.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__parser__tests__parse_lambda_no_args.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__parser__tests__parse_list_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__parse_print_2.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_print_hello.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_string.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__parse_tuples.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__parser__tests__parse_type_declaration.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__parser__tests__patma.snap Introduce AST nodes for PatternMatchClass arguments (#6881) 2023-08-26 14:45:44 +00:00
ruff_python_parser__parser__tests__slice.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__parser__tests__star_index.snap Remove unsupported type_comment field 2023-08-01 12:53:13 +02:00
ruff_python_parser__parser__tests__try.snap Remove Stmt::TryStar (#6566) 2023-08-14 13:39:44 -04:00
ruff_python_parser__parser__tests__try_star.snap Remove Stmt::TryStar (#6566) 2023-08-14 13:39:44 -04:00
ruff_python_parser__parser__tests__type_as_identifier.snap Make Parameters an optional field on ExprLambda (#6669) 2023-08-18 15:34:54 +00:00
ruff_python_parser__parser__tests__variadic_generics.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__parser__tests__with_statement.snap Remove async AST node variants for with, for, and def (#6369) 2023-08-07 16:36:02 +00:00
ruff_python_parser__string__tests__backspace_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__bell_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__carriage_return_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__character_tabulation_with_justification_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__delete_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__double_quoted_byte.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__escape_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__escape_char_in_byte_literal.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__escape_octet.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__form_feed_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_constant_range.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_escaped_character.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_escaped_newline.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_line_continuation.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_parse_self_documenting_base.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__fstring_parse_self_documenting_base_more.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_parse_self_documenting_format.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__fstring_unescaped_newline.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__hts_alias.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_empty_fstring.snap Pull in RustPython parser (#6099) 2023-07-27 09:29:11 +00:00
ruff_python_parser__string__tests__parse_f_string_concat_1.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_f_string_concat_2.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_f_string_concat_3.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_f_string_concat_4.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring_equals.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__parse_fstring_nested_concatenation_string_spec.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring_nested_spec.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring_nested_string_spec.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring_not_equals.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__parse_fstring_not_nested_spec.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_fstring_self_doc_prec_space.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__parse_fstring_self_doc_trailing_space.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__parse_fstring_yield_expr.snap add DebugText for self-documenting f-strings (#6167) 2023-08-01 07:55:03 +02:00
ruff_python_parser__string__tests__parse_string_concat.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_string_triple_quotes_with_kind.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_u_f_string_concat_1.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_u_f_string_concat_2.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_u_string_concat_1.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__parse_u_string_concat_2.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__raw_byte_literal_1.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__raw_byte_literal_2.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__raw_fstring.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__single_quoted_byte.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00
ruff_python_parser__string__tests__triple_quoted_raw_fstring.snap Add an implicit concatenation flag to string and bytes constants (#6512) 2023-08-14 13:46:54 +00:00