From 707d62ad684e52963422a64f539f574b19e95187 Mon Sep 17 00:00:00 2001 From: Dhruv Manilawala Date: Wed, 20 Mar 2024 21:30:09 +0530 Subject: [PATCH] Update snapshots from rebase --- ...tests__parser__tests__parse_with_stmt.snap | 8 +- ...__tests__suite__tests__dict_unpacking.snap | 97 - ...parser__tests__suite__tests__fstrings.snap | 1105 ----- ...__suite__tests__fstrings_with_unicode.snap | 322 -- ..._tests__generator_expression_argument.snap | 175 - ...r__parser__tests__suite__tests__match.snap | 624 --- ...ser__tests__suite__tests__parse_class.snap | 154 - ...__tests__suite__tests__parse_f_string.snap | 38 - ...er__tests__suite__tests__parse_kwargs.snap | 65 - ...r__tests__suite__tests__parse_print_2.snap | 55 - ...ests__suite__tests__parse_print_hello.snap | 47 - ...er__tests__suite__tests__parse_string.snap | 29 - ..._suite__tests__parse_type_declaration.snap | 954 ----- ...r__parser__tests__suite__tests__patma.snap | 3739 ----------------- ...ser__parser__tests__suite__tests__try.snap | 262 -- ...parser__tests__suite__tests__try_star.snap | 446 -- ...r__invalid__tests__ok_attribute_weird.snap | 51 - ...ements__invalid_assignment_targets.py.snap | 10 +- ...nvalid_augmented_assignment_target.py.snap | 10 +- ...lid_syntax@expressions__dictionary.py.snap | 26 +- ...ressions__dictionary_comprehension.py.snap | 2 +- ...valid_syntax@expressions__f_string.py.snap | 148 +- ...alid_syntax@expressions__generator.py.snap | 6 +- .../valid_syntax@expressions__string.py.snap | 28 +- .../valid_syntax@statement__assert.py.snap | 2 +- ...valid_syntax@statement__assignment.py.snap | 2 +- .../valid_syntax@statement__class.py.snap | 2 +- .../valid_syntax@statement__function.py.snap | 2 +- .../valid_syntax@statement__match.py.snap | 32 +- .../valid_syntax@statement__try.py.snap | 10 +- .../valid_syntax@statement__type.py.snap | 2 +- .../valid_syntax@statement__while.py.snap | 4 +- 32 files changed, 149 insertions(+), 8308 deletions(-) delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__dict_unpacking.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings_with_unicode.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__generator_expression_argument.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__match.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_class.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_f_string.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_kwargs.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_2.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_hello.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_string.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_type_declaration.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__patma.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try.snap delete mode 100644 crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try_star.snap delete mode 100644 crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__parser__tests__parse_with_stmt.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__parser__tests__parse_with_stmt.snap index cd5ef026f59aa..bc71f1c311634 100644 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__parser__tests__parse_with_stmt.snap +++ b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__parser__tests__parse_with_stmt.snap @@ -617,7 +617,7 @@ Program { value: "bla.txt", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -657,7 +657,7 @@ Program { value: "bla.txt", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -776,7 +776,7 @@ Program { value: "new_file", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -806,7 +806,7 @@ Program { value: "wb", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__dict_unpacking.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__dict_unpacking.snap deleted file mode 100644 index 7b66ed3a0bb52..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__dict_unpacking.snap +++ /dev/null @@ -1,97 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -Dict( - ExprDict { - range: 0..25, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 1..4, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 1..4, - value: "a", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - None, - Some( - StringLiteral( - ExprStringLiteral { - range: 16..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 16..19, - value: "d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - StringLiteral( - ExprStringLiteral { - range: 6..9, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..9, - value: "b", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - Name( - ExprName { - range: 13..14, - id: "c", - ctx: Load, - }, - ), - StringLiteral( - ExprStringLiteral { - range: 21..24, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 21..24, - value: "e", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - }, -) diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings.snap deleted file mode 100644 index 5213055ebc761..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings.snap +++ /dev/null @@ -1,1105 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..9, - value: FString( - ExprFString { - range: 0..9, - value: FStringValue { - inner: Single( - FString( - FString { - range: 0..9, - elements: [ - Expression( - FStringExpressionElement { - range: 2..8, - expression: StringLiteral( - ExprStringLiteral { - range: 3..7, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 3..7, - value: " f", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 10..20, - value: FString( - ExprFString { - range: 10..20, - value: FStringValue { - inner: Single( - FString( - FString { - range: 10..20, - elements: [ - Expression( - FStringExpressionElement { - range: 12..19, - expression: Name( - ExprName { - range: 13..16, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: Str, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 21..28, - value: FString( - ExprFString { - range: 21..28, - value: FStringValue { - inner: Single( - FString( - FString { - range: 21..28, - elements: [ - Expression( - FStringExpressionElement { - range: 23..27, - expression: Tuple( - ExprTuple { - range: 24..26, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 24..25, - value: Int( - 3, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 29..39, - value: FString( - ExprFString { - range: 29..39, - value: FStringValue { - inner: Single( - FString( - FString { - range: 29..39, - elements: [ - Expression( - FStringExpressionElement { - range: 31..38, - expression: Compare( - ExprCompare { - range: 32..36, - left: NumberLiteral( - ExprNumberLiteral { - range: 32..33, - value: Int( - 3, - ), - }, - ), - ops: [ - NotEq, - ], - comparators: [ - NumberLiteral( - ExprNumberLiteral { - range: 35..36, - value: Int( - 4, - ), - }, - ), - ], - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 37..37, - elements: [], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 40..55, - value: FString( - ExprFString { - range: 40..55, - value: FStringValue { - inner: Single( - FString( - FString { - range: 40..55, - elements: [ - Expression( - FStringExpressionElement { - range: 42..54, - expression: NumberLiteral( - ExprNumberLiteral { - range: 43..44, - value: Int( - 3, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 45..53, - elements: [ - Expression( - FStringExpressionElement { - range: 45..50, - expression: StringLiteral( - ExprStringLiteral { - range: 46..49, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 46..49, - value: "}", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 50..53, - value: ">10", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 56..71, - value: FString( - ExprFString { - range: 56..71, - value: FStringValue { - inner: Single( - FString( - FString { - range: 56..71, - elements: [ - Expression( - FStringExpressionElement { - range: 58..70, - expression: NumberLiteral( - ExprNumberLiteral { - range: 59..60, - value: Int( - 3, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 61..69, - elements: [ - Expression( - FStringExpressionElement { - range: 61..66, - expression: StringLiteral( - ExprStringLiteral { - range: 62..65, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 62..65, - value: "{", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 66..69, - value: ">10", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 72..86, - value: FString( - ExprFString { - range: 72..86, - value: FStringValue { - inner: Single( - FString( - FString { - range: 72..86, - elements: [ - Expression( - FStringExpressionElement { - range: 74..85, - expression: Name( - ExprName { - range: 77..80, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 87..107, - value: FString( - ExprFString { - range: 87..107, - value: FStringValue { - inner: Single( - FString( - FString { - range: 87..107, - elements: [ - Expression( - FStringExpressionElement { - range: 89..106, - expression: Name( - ExprName { - range: 92..95, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 100..105, - elements: [ - Literal( - FStringLiteralElement { - range: 100..105, - value: ".3f ", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 108..126, - value: FString( - ExprFString { - range: 108..126, - value: FStringValue { - inner: Single( - FString( - FString { - range: 108..126, - elements: [ - Expression( - FStringExpressionElement { - range: 110..125, - expression: Name( - ExprName { - range: 113..116, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: Str, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 127..143, - value: FString( - ExprFString { - range: 127..143, - value: FStringValue { - inner: Single( - FString( - FString { - range: 127..143, - elements: [ - Expression( - FStringExpressionElement { - range: 129..142, - expression: Tuple( - ExprTuple { - range: 132..136, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 132..133, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 135..136, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - debug_text: Some( - DebugText { - leading: " ", - trailing: " = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 144..170, - value: FString( - ExprFString { - range: 144..170, - value: FStringValue { - inner: Single( - FString( - FString { - range: 144..170, - elements: [ - Expression( - FStringExpressionElement { - range: 146..169, - expression: FString( - ExprFString { - range: 147..163, - value: FStringValue { - inner: Single( - FString( - FString { - range: 147..163, - elements: [ - Expression( - FStringExpressionElement { - range: 149..162, - expression: NumberLiteral( - ExprNumberLiteral { - range: 150..156, - value: Float( - 3.1415, - ), - }, - ), - debug_text: Some( - DebugText { - leading: "", - trailing: "=", - }, - ), - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 158..161, - elements: [ - Literal( - FStringLiteralElement { - range: 158..161, - value: ".1f", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 164..168, - elements: [ - Literal( - FStringLiteralElement { - range: 164..168, - value: "*^20", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 172..206, - value: Dict( - ExprDict { - range: 172..206, - keys: [ - Some( - FString( - ExprFString { - range: 173..201, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 173..179, - value: "foo ", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 180..195, - elements: [ - Literal( - FStringLiteralElement { - range: 182..186, - value: "bar ", - }, - ), - Expression( - FStringExpressionElement { - range: 186..193, - expression: BinOp( - ExprBinOp { - range: 187..192, - left: Name( - ExprName { - range: 187..188, - id: "x", - ctx: Load, - }, - ), - op: Add, - right: Name( - ExprName { - range: 191..192, - id: "y", - ctx: Load, - }, - ), - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 193..194, - value: " ", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 196..201, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - ), - ], - values: [ - NumberLiteral( - ExprNumberLiteral { - range: 203..205, - value: Int( - 10, - ), - }, - ), - ], - }, - ), - }, - ), - Match( - StmtMatch { - range: 207..298, - subject: Name( - ExprName { - range: 213..216, - id: "foo", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 222..246, - pattern: MatchValue( - PatternMatchValue { - range: 227..232, - value: StringLiteral( - ExprStringLiteral { - range: 227..232, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 227..232, - value: "one", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 242..246, - }, - ), - ], - }, - MatchCase { - range: 251..298, - pattern: MatchValue( - PatternMatchValue { - range: 256..284, - value: StringLiteral( - ExprStringLiteral { - range: 256..284, - value: StringLiteralValue { - inner: Concatenated( - ConcatenatedStringLiteral { - strings: [ - StringLiteral { - range: 256..269, - value: "implicitly ", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - StringLiteral { - range: 270..284, - value: "concatenated", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ], - value: "implicitly concatenated", - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 294..298, - }, - ), - ], - }, - ], - }, - ), - Expr( - StmtExpr { - range: 300..317, - value: FString( - ExprFString { - range: 300..317, - value: FStringValue { - inner: Single( - FString( - FString { - range: 300..317, - elements: [ - Literal( - FStringLiteralElement { - range: 302..303, - value: "\\", - }, - ), - Expression( - FStringExpressionElement { - range: 303..308, - expression: Name( - ExprName { - range: 304..307, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 308..309, - value: "\\", - }, - ), - Expression( - FStringExpressionElement { - range: 309..316, - expression: Name( - ExprName { - range: 310..313, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 314..315, - elements: [ - Literal( - FStringLiteralElement { - range: 314..315, - value: "\\", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 318..332, - value: FString( - ExprFString { - range: 318..332, - value: FStringValue { - inner: Single( - FString( - FString { - range: 318..332, - elements: [ - Literal( - FStringLiteralElement { - range: 320..331, - value: "\\{foo\\}", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 333..373, - value: FString( - ExprFString { - range: 333..373, - value: FStringValue { - inner: Single( - FString( - FString { - range: 333..373, - elements: [ - Expression( - FStringExpressionElement { - range: 337..370, - expression: Name( - ExprName { - range: 343..346, - id: "foo", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: Some( - FStringFormatSpec { - range: 347..369, - elements: [ - Literal( - FStringLiteralElement { - range: 347..369, - value: "x\n y\n z\n", - }, - ), - ], - }, - ), - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: true, - }, - }, - ), - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 374..392, - value: FString( - ExprFString { - range: 374..392, - value: FStringValue { - inner: Single( - FString( - FString { - range: 374..392, - elements: [ - Expression( - FStringExpressionElement { - range: 376..391, - expression: Name( - ExprName { - range: 381..384, - id: "foo", - ctx: Load, - }, - ), - debug_text: Some( - DebugText { - leading: " ( ", - trailing: " ) = ", - }, - ), - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings_with_unicode.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings_with_unicode.snap deleted file mode 100644 index d69f927f9b0f2..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__fstrings_with_unicode.snap +++ /dev/null @@ -1,322 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..29, - value: FString( - ExprFString { - range: 0..29, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 0..6, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 7..15, - elements: [ - Expression( - FStringExpressionElement { - range: 9..14, - expression: Name( - ExprName { - range: 10..13, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 16..21, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 22..29, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 30..59, - value: FString( - ExprFString { - range: 30..59, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 30..35, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 36..44, - elements: [ - Expression( - FStringExpressionElement { - range: 38..43, - expression: Name( - ExprName { - range: 39..42, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 45..51, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 52..59, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 60..89, - value: FString( - ExprFString { - range: 60..89, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 60..65, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 66..74, - elements: [ - Expression( - FStringExpressionElement { - range: 68..73, - expression: Name( - ExprName { - range: 69..72, - id: "bar", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 75..80, - value: "baz", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 81..89, - value: " some", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), - Expr( - StmtExpr { - range: 90..128, - value: FString( - ExprFString { - range: 90..128, - value: FStringValue { - inner: Concatenated( - [ - Literal( - StringLiteral { - range: 90..96, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - FString( - FString { - range: 97..116, - elements: [ - Literal( - FStringLiteralElement { - range: 99..103, - value: "bar ", - }, - ), - Expression( - FStringExpressionElement { - range: 103..108, - expression: Name( - ExprName { - range: 104..107, - id: "baz", - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 108..115, - value: " really", - }, - ), - ], - flags: FStringFlags { - quote_style: Double, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 117..123, - value: "bar", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Unicode, - triple_quoted: false, - }, - }, - ), - Literal( - StringLiteral { - range: 124..128, - value: "no", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - ], - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__generator_expression_argument.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__generator_expression_argument.snap deleted file mode 100644 index a60b1b4226edf..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__generator_expression_argument.snap +++ /dev/null @@ -1,175 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -Call( - ExprCall { - range: 0..141, - func: Attribute( - ExprAttribute { - range: 0..8, - value: StringLiteral( - ExprStringLiteral { - range: 0..3, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..3, - value: " ", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - attr: Identifier { - id: "join", - range: 4..8, - }, - ctx: Load, - }, - ), - arguments: Arguments { - range: 8..141, - args: [ - Generator( - ExprGenerator { - range: 14..139, - elt: Name( - ExprName { - range: 14..17, - id: "sql", - ctx: Load, - }, - ), - generators: [ - Comprehension { - range: 22..139, - target: Name( - ExprName { - range: 26..29, - id: "sql", - ctx: Store, - }, - ), - iter: Tuple( - ExprTuple { - range: 33..139, - elts: [ - If( - ExprIf { - range: 43..80, - test: Name( - ExprName { - range: 65..70, - id: "limit", - ctx: Load, - }, - ), - body: BinOp( - ExprBinOp { - range: 43..61, - left: StringLiteral( - ExprStringLiteral { - range: 43..53, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 43..53, - value: "LIMIT %d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - op: Mod, - right: Name( - ExprName { - range: 56..61, - id: "limit", - ctx: Load, - }, - ), - }, - ), - orelse: NoneLiteral( - ExprNoneLiteral { - range: 76..80, - }, - ), - }, - ), - If( - ExprIf { - range: 90..132, - test: Name( - ExprName { - range: 116..122, - id: "offset", - ctx: Load, - }, - ), - body: BinOp( - ExprBinOp { - range: 91..111, - left: StringLiteral( - ExprStringLiteral { - range: 91..102, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 91..102, - value: "OFFSET %d", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - op: Mod, - right: Name( - ExprName { - range: 105..111, - id: "offset", - ctx: Load, - }, - ), - }, - ), - orelse: NoneLiteral( - ExprNoneLiteral { - range: 128..132, - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ifs: [], - is_async: false, - }, - ], - parenthesized: false, - }, - ), - ], - keywords: [], - }, - }, -) diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__match.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__match.snap deleted file mode 100644 index a03546f38fb29..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__match.snap +++ /dev/null @@ -1,624 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Match( - StmtMatch { - range: 1..73, - subject: Dict( - ExprDict { - range: 7..18, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 8..14, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 8..14, - value: "test", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - NumberLiteral( - ExprNumberLiteral { - range: 16..17, - value: Int( - 1, - ), - }, - ), - ], - }, - ), - cases: [ - MatchCase { - range: 24..73, - pattern: MatchMapping( - PatternMatchMapping { - range: 29..52, - keys: [], - patterns: [], - rest: Some( - Identifier { - id: "rest", - range: 41..45, - }, - ), - }, - ), - guard: None, - body: [ - Expr( - StmtExpr { - range: 62..73, - value: Call( - ExprCall { - range: 62..73, - func: Name( - ExprName { - range: 62..67, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 67..73, - args: [ - Name( - ExprName { - range: 68..72, - id: "rest", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 74..177, - subject: Dict( - ExprDict { - range: 80..97, - keys: [ - Some( - StringLiteral( - ExprStringLiteral { - range: 81..88, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 81..88, - value: "label", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - ], - values: [ - StringLiteral( - ExprStringLiteral { - range: 90..96, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 90..96, - value: "test", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - }, - ), - cases: [ - MatchCase { - range: 103..177, - pattern: MatchMapping( - PatternMatchMapping { - range: 108..155, - keys: [ - StringLiteral( - ExprStringLiteral { - range: 118..125, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 118..125, - value: "label", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - patterns: [ - MatchAs( - PatternMatchAs { - range: 127..148, - pattern: Some( - MatchOr( - PatternMatchOr { - range: 127..139, - patterns: [ - MatchClass( - PatternMatchClass { - range: 127..132, - cls: Name( - ExprName { - range: 127..130, - id: "str", - ctx: Load, - }, - ), - arguments: PatternArguments { - range: 130..132, - patterns: [], - keywords: [], - }, - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 135..139, - value: None, - }, - ), - ], - }, - ), - ), - name: Some( - Identifier { - id: "label", - range: 143..148, - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Expr( - StmtExpr { - range: 165..177, - value: Call( - ExprCall { - range: 165..177, - func: Name( - ExprName { - range: 165..170, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 170..177, - args: [ - Name( - ExprName { - range: 171..176, - id: "label", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 178..218, - subject: Name( - ExprName { - range: 184..185, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 191..218, - pattern: MatchSequence( - PatternMatchSequence { - range: 196..203, - patterns: [ - MatchValue( - PatternMatchValue { - range: 197..198, - value: NumberLiteral( - ExprNumberLiteral { - range: 197..198, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 200..201, - value: NumberLiteral( - ExprNumberLiteral { - range: 200..201, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 213..218, - targets: [ - Name( - ExprName { - range: 213..214, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 217..218, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 219..259, - subject: Name( - ExprName { - range: 225..226, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 232..259, - pattern: MatchSequence( - PatternMatchSequence { - range: 237..244, - patterns: [ - MatchValue( - PatternMatchValue { - range: 238..239, - value: NumberLiteral( - ExprNumberLiteral { - range: 238..239, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 241..242, - value: NumberLiteral( - ExprNumberLiteral { - range: 241..242, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 254..259, - targets: [ - Name( - ExprName { - range: 254..255, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 258..259, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 260..297, - subject: Name( - ExprName { - range: 266..267, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 273..297, - pattern: MatchSequence( - PatternMatchSequence { - range: 278..282, - patterns: [ - MatchValue( - PatternMatchValue { - range: 279..280, - value: NumberLiteral( - ExprNumberLiteral { - range: 279..280, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 292..297, - targets: [ - Name( - ExprName { - range: 292..293, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 296..297, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 298..332, - subject: Tuple( - ExprTuple { - range: 304..306, - elts: [ - Name( - ExprName { - range: 304..305, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 312..332, - pattern: MatchAs( - PatternMatchAs { - range: 317..318, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 317..318, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 328..332, - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 333..369, - subject: Tuple( - ExprTuple { - range: 339..343, - elts: [ - Name( - ExprName { - range: 339..340, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 342..343, - id: "y", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 349..369, - pattern: MatchAs( - PatternMatchAs { - range: 354..355, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 354..355, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 365..369, - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 370..407, - subject: Tuple( - ExprTuple { - range: 376..381, - elts: [ - Name( - ExprName { - range: 376..377, - id: "x", - ctx: Load, - }, - ), - Name( - ExprName { - range: 379..380, - id: "y", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 387..407, - pattern: MatchAs( - PatternMatchAs { - range: 392..393, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 392..393, - }, - ), - }, - ), - guard: None, - body: [ - Pass( - StmtPass { - range: 403..407, - }, - ), - ], - }, - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_class.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_class.snap deleted file mode 100644 index db0f620966bef..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_class.snap +++ /dev/null @@ -1,154 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: "parse_suite(source).unwrap()" ---- -[ - ClassDef( - StmtClassDef { - range: 0..98, - decorator_list: [], - name: Identifier { - id: "Foo", - range: 6..9, - }, - type_params: None, - arguments: Some( - Arguments { - range: 9..15, - args: [ - Name( - ExprName { - range: 10..11, - id: "A", - ctx: Load, - }, - ), - Name( - ExprName { - range: 13..14, - id: "B", - ctx: Load, - }, - ), - ], - keywords: [], - }, - ), - body: [ - FunctionDef( - StmtFunctionDef { - range: 18..44, - is_async: false, - decorator_list: [], - name: Identifier { - id: "__init__", - range: 22..30, - }, - type_params: None, - parameters: Parameters { - range: 30..36, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 31..35, - parameter: Parameter { - range: 31..35, - name: Identifier { - id: "self", - range: 31..35, - }, - annotation: None, - }, - default: None, - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 40..44, - }, - ), - ], - }, - ), - FunctionDef( - StmtFunctionDef { - range: 46..98, - is_async: false, - decorator_list: [], - name: Identifier { - id: "method_with_default", - range: 50..69, - }, - type_params: None, - parameters: Parameters { - range: 69..90, - posonlyargs: [], - args: [ - ParameterWithDefault { - range: 70..74, - parameter: Parameter { - range: 70..74, - name: Identifier { - id: "self", - range: 70..74, - }, - annotation: None, - }, - default: None, - }, - ParameterWithDefault { - range: 76..89, - parameter: Parameter { - range: 76..79, - name: Identifier { - id: "arg", - range: 76..79, - }, - annotation: None, - }, - default: Some( - StringLiteral( - ExprStringLiteral { - range: 80..89, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 80..89, - value: "default", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ], - vararg: None, - kwonlyargs: [], - kwarg: None, - }, - returns: None, - body: [ - Pass( - StmtPass { - range: 94..98, - }, - ), - ], - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_f_string.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_f_string.snap deleted file mode 100644 index 3db9c46498d5e..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_f_string.snap +++ /dev/null @@ -1,38 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..14, - value: FString( - ExprFString { - range: 0..14, - value: FStringValue { - inner: Single( - FString( - FString { - range: 0..14, - elements: [ - Literal( - FStringLiteralElement { - range: 2..13, - value: "Hello world", - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_kwargs.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_kwargs.snap deleted file mode 100644 index 08a17d1bf5739..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_kwargs.snap +++ /dev/null @@ -1,65 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..32, - value: Call( - ExprCall { - range: 0..32, - func: Name( - ExprName { - range: 0..7, - id: "my_func", - ctx: Load, - }, - ), - arguments: Arguments { - range: 7..32, - args: [ - StringLiteral( - ExprStringLiteral { - range: 8..20, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 8..20, - value: "positional", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - keywords: [ - Keyword { - range: 22..31, - arg: Some( - Identifier { - id: "keyword", - range: 22..29, - }, - ), - value: NumberLiteral( - ExprNumberLiteral { - range: 30..31, - value: Int( - 2, - ), - }, - ), - }, - ], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_2.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_2.snap deleted file mode 100644 index 61a91fa684610..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_2.snap +++ /dev/null @@ -1,55 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..23, - value: Call( - ExprCall { - range: 0..23, - func: Name( - ExprName { - range: 0..5, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 5..23, - args: [ - StringLiteral( - ExprStringLiteral { - range: 6..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..19, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 21..22, - value: Int( - 2, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_hello.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_hello.snap deleted file mode 100644 index 1264c60a04598..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_print_hello.snap +++ /dev/null @@ -1,47 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..20, - value: Call( - ExprCall { - range: 0..20, - func: Name( - ExprName { - range: 0..5, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 5..20, - args: [ - StringLiteral( - ExprStringLiteral { - range: 6..19, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 6..19, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_string.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_string.snap deleted file mode 100644 index f9a23c8269db3..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_string.snap +++ /dev/null @@ -1,29 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Expr( - StmtExpr { - range: 0..13, - value: StringLiteral( - ExprStringLiteral { - range: 0..13, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..13, - value: "Hello world", - flags: StringLiteralFlags { - quote_style: Single, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_type_declaration.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_type_declaration.snap deleted file mode 100644 index fa99a71304d64..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__parse_type_declaration.snap +++ /dev/null @@ -1,954 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser.rs -expression: parse_suite(source).unwrap() ---- -[ - TypeAlias( - StmtTypeAlias { - range: 1..13, - name: Name( - ExprName { - range: 6..7, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 10..13, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 14..32, - name: Name( - ExprName { - range: 19..20, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: BinOp( - ExprBinOp { - range: 23..32, - left: Name( - ExprName { - range: 23..26, - id: "int", - ctx: Load, - }, - ), - op: BitOr, - right: Name( - ExprName { - range: 29..32, - id: "str", - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 33..61, - name: Name( - ExprName { - range: 38..39, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: BinOp( - ExprBinOp { - range: 42..61, - left: Name( - ExprName { - range: 42..45, - id: "int", - ctx: Load, - }, - ), - op: BitOr, - right: StringLiteral( - ExprStringLiteral { - range: 48..61, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 48..61, - value: "ForwardRefY", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 62..88, - name: Name( - ExprName { - range: 67..68, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 68..71, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 69..70, - name: Identifier { - id: "T", - range: 69..70, - }, - bound: None, - }, - ), - ], - }, - ), - value: BinOp( - ExprBinOp { - range: 74..88, - left: Name( - ExprName { - range: 74..75, - id: "T", - ctx: Load, - }, - ), - op: BitOr, - right: Subscript( - ExprSubscript { - range: 78..88, - value: Name( - ExprName { - range: 78..82, - id: "list", - ctx: Load, - }, - ), - slice: Subscript( - ExprSubscript { - range: 83..87, - value: Name( - ExprName { - range: 83..84, - id: "X", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 85..86, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 102..117, - name: Name( - ExprName { - range: 107..108, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 108..111, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 109..110, - name: Identifier { - id: "T", - range: 109..110, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 114..117, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 118..146, - name: Name( - ExprName { - range: 123..124, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 124..127, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 125..126, - name: Identifier { - id: "T", - range: 125..126, - }, - bound: None, - }, - ), - ], - }, - ), - value: BinOp( - ExprBinOp { - range: 130..146, - left: Subscript( - ExprSubscript { - range: 130..137, - value: Name( - ExprName { - range: 130..134, - id: "list", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 135..136, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - op: BitOr, - right: Subscript( - ExprSubscript { - range: 140..146, - value: Name( - ExprName { - range: 140..143, - id: "set", - ctx: Load, - }, - ), - slice: Name( - ExprName { - range: 144..145, - id: "T", - ctx: Load, - }, - ), - ctx: Load, - }, - ), - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 147..179, - name: Name( - ExprName { - range: 152..153, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 153..166, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 154..155, - name: Identifier { - id: "T", - range: 154..155, - }, - bound: None, - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 157..160, - name: Identifier { - id: "Ts", - range: 158..160, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 162..165, - name: Identifier { - id: "P", - range: 164..165, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 169..179, - elts: [ - Name( - ExprName { - range: 170..171, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 173..175, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 177..178, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 180..217, - name: Name( - ExprName { - range: 185..186, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 186..204, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 187..193, - name: Identifier { - id: "T", - range: 187..188, - }, - bound: Some( - Name( - ExprName { - range: 190..193, - id: "int", - ctx: Load, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 195..198, - name: Identifier { - id: "Ts", - range: 196..198, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 200..203, - name: Identifier { - id: "P", - range: 202..203, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 207..217, - elts: [ - Name( - ExprName { - range: 208..209, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 211..213, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 215..216, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 218..262, - name: Name( - ExprName { - range: 223..224, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 224..249, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 225..238, - name: Identifier { - id: "T", - range: 225..226, - }, - bound: Some( - Tuple( - ExprTuple { - range: 228..238, - elts: [ - Name( - ExprName { - range: 229..232, - id: "int", - ctx: Load, - }, - ), - Name( - ExprName { - range: 234..237, - id: "str", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - ), - }, - ), - TypeVarTuple( - TypeParamTypeVarTuple { - range: 240..243, - name: Identifier { - id: "Ts", - range: 241..243, - }, - }, - ), - ParamSpec( - TypeParamParamSpec { - range: 245..248, - name: Identifier { - id: "P", - range: 247..248, - }, - }, - ), - ], - }, - ), - value: Tuple( - ExprTuple { - range: 252..262, - elts: [ - Name( - ExprName { - range: 253..254, - id: "T", - ctx: Load, - }, - ), - Name( - ExprName { - range: 256..258, - id: "Ts", - ctx: Load, - }, - ), - Name( - ExprName { - range: 260..261, - id: "P", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 293..308, - name: Name( - ExprName { - range: 298..302, - id: "type", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 305..308, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 309..325, - name: Name( - ExprName { - range: 314..319, - id: "match", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 322..325, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 326..341, - name: Name( - ExprName { - range: 331..335, - id: "case", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 338..341, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 367..382, - name: Name( - ExprName { - range: 372..375, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 378..382, - id: "type", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 383..399, - name: Name( - ExprName { - range: 388..391, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 394..399, - id: "match", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 400..415, - name: Name( - ExprName { - range: 405..408, - id: "foo", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 411..415, - id: "case", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 439..454, - name: Name( - ExprName { - range: 447..448, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 451..454, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 455..470, - name: Name( - ExprName { - range: 460..461, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 467..470, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 471..486, - name: Name( - ExprName { - range: 476..477, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 483..486, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 487..507, - name: Name( - ExprName { - range: 492..493, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 502..505, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 508..527, - name: Name( - ExprName { - range: 519..520, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 520..523, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 521..522, - name: Identifier { - id: "T", - range: 521..522, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 526..527, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 528..548, - name: Name( - ExprName { - range: 533..534, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 541..544, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 542..543, - name: Identifier { - id: "T", - range: 542..543, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 547..548, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 549..568, - name: Name( - ExprName { - range: 554..555, - id: "X", - ctx: Store, - }, - ), - type_params: Some( - TypeParams { - range: 555..558, - type_params: [ - TypeVar( - TypeParamTypeVar { - range: 556..557, - name: Identifier { - id: "T", - range: 556..557, - }, - bound: None, - }, - ), - ], - }, - ), - value: Name( - ExprName { - range: 567..568, - id: "T", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 590..602, - name: Name( - ExprName { - range: 595..596, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 599..602, - id: "int", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 604..616, - name: Name( - ExprName { - range: 609..610, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 613..616, - id: "str", - ctx: Load, - }, - ), - }, - ), - TypeAlias( - StmtTypeAlias { - range: 618..631, - name: Name( - ExprName { - range: 623..624, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 627..631, - id: "type", - ctx: Load, - }, - ), - }, - ), - ClassDef( - StmtClassDef { - range: 632..653, - decorator_list: [], - name: Identifier { - id: "X", - range: 638..639, - }, - type_params: None, - arguments: None, - body: [ - TypeAlias( - StmtTypeAlias { - range: 641..653, - name: Name( - ExprName { - range: 646..647, - id: "X", - ctx: Store, - }, - ), - type_params: None, - value: Name( - ExprName { - range: 650..653, - id: "int", - ctx: Load, - }, - ), - }, - ), - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__patma.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__patma.snap deleted file mode 100644 index 97b542e37bfa8..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__patma.snap +++ /dev/null @@ -1,3739 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Match( - StmtMatch { - range: 67..103, - subject: Name( - ExprName { - range: 73..74, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 80..103, - pattern: MatchValue( - PatternMatchValue { - range: 85..88, - value: UnaryOp( - ExprUnaryOp { - range: 85..88, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 86..88, - value: Complex { - real: 0.0, - imag: 0.0, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 98..103, - targets: [ - Name( - ExprName { - range: 98..99, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 102..103, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 126..167, - subject: Name( - ExprName { - range: 132..133, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 139..167, - pattern: MatchClass( - PatternMatchClass { - range: 144..152, - cls: Name( - ExprName { - range: 144..149, - id: "bytes", - ctx: Load, - }, - ), - arguments: PatternArguments { - range: 149..152, - patterns: [ - MatchAs( - PatternMatchAs { - range: 150..151, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 150..151, - }, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 162..167, - targets: [ - Name( - ExprName { - range: 162..163, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 166..167, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 190..260, - subject: Name( - ExprName { - range: 196..197, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 203..229, - pattern: MatchValue( - PatternMatchValue { - range: 208..209, - value: NumberLiteral( - ExprNumberLiteral { - range: 208..209, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - NumberLiteral( - ExprNumberLiteral { - range: 213..214, - value: Int( - 0, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 224..229, - targets: [ - Name( - ExprName { - range: 224..225, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 228..229, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 234..260, - pattern: MatchValue( - PatternMatchValue { - range: 239..240, - value: NumberLiteral( - ExprNumberLiteral { - range: 239..240, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - NumberLiteral( - ExprNumberLiteral { - range: 244..245, - value: Int( - 1, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 255..260, - targets: [ - Name( - ExprName { - range: 255..256, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 259..260, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 283..332, - subject: NumberLiteral( - ExprNumberLiteral { - range: 289..290, - value: Int( - 3, - ), - }, - ), - cases: [ - MatchCase { - range: 296..332, - pattern: MatchOr( - PatternMatchOr { - range: 301..314, - patterns: [ - MatchValue( - PatternMatchValue { - range: 301..302, - value: NumberLiteral( - ExprNumberLiteral { - range: 301..302, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 305..306, - value: NumberLiteral( - ExprNumberLiteral { - range: 305..306, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 309..310, - value: NumberLiteral( - ExprNumberLiteral { - range: 309..310, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 313..314, - value: NumberLiteral( - ExprNumberLiteral { - range: 313..314, - value: Int( - 3, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 324..332, - targets: [ - Name( - ExprName { - range: 324..325, - id: "x", - ctx: Store, - }, - ), - ], - value: BooleanLiteral( - ExprBooleanLiteral { - range: 328..332, - value: true, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 355..403, - subject: Name( - ExprName { - range: 361..362, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 368..403, - pattern: MatchOr( - PatternMatchOr { - range: 373..388, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 373..379, - patterns: [ - MatchValue( - PatternMatchValue { - range: 374..375, - value: NumberLiteral( - ExprNumberLiteral { - range: 374..375, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 377..378, - value: NumberLiteral( - ExprNumberLiteral { - range: 377..378, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ), - MatchSequence( - PatternMatchSequence { - range: 382..388, - patterns: [ - MatchValue( - PatternMatchValue { - range: 383..384, - value: NumberLiteral( - ExprNumberLiteral { - range: 383..384, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 386..387, - value: NumberLiteral( - ExprNumberLiteral { - range: 386..387, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 398..403, - targets: [ - Name( - ExprName { - range: 398..399, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 402..403, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 445..523, - subject: Name( - ExprName { - range: 451..452, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 458..489, - pattern: MatchSequence( - PatternMatchSequence { - range: 463..467, - patterns: [ - MatchStar( - PatternMatchStar { - range: 464..466, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Return( - StmtReturn { - range: 477..489, - value: Some( - StringLiteral( - ExprStringLiteral { - range: 484..489, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 484..489, - value: "seq", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ), - ], - }, - MatchCase { - range: 494..523, - pattern: MatchMapping( - PatternMatchMapping { - range: 499..501, - keys: [], - patterns: [], - rest: None, - }, - ), - guard: None, - body: [ - Return( - StmtReturn { - range: 511..523, - value: Some( - StringLiteral( - ExprStringLiteral { - range: 518..523, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 518..523, - value: "map", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 546..714, - subject: Name( - ExprName { - range: 552..553, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 559..594, - pattern: MatchMapping( - PatternMatchMapping { - range: 564..579, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 565..566, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 568..578, - patterns: [ - MatchValue( - PatternMatchValue { - range: 569..570, - value: NumberLiteral( - ExprNumberLiteral { - range: 569..570, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 572..573, - value: NumberLiteral( - ExprNumberLiteral { - range: 572..573, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 575..577, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 589..594, - targets: [ - Name( - ExprName { - range: 589..590, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 593..594, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 599..687, - pattern: MatchOr( - PatternMatchOr { - range: 604..672, - patterns: [ - MatchMapping( - PatternMatchMapping { - range: 604..626, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 605..606, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchOr( - PatternMatchOr { - range: 608..625, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 608..618, - patterns: [ - MatchValue( - PatternMatchValue { - range: 609..610, - value: NumberLiteral( - ExprNumberLiteral { - range: 609..610, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 612..613, - value: NumberLiteral( - ExprNumberLiteral { - range: 612..613, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 615..617, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 621..625, - value: True, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 629..638, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 630..631, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 633..637, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 634..636, - patterns: [], - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 641..656, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 642..643, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 645..655, - patterns: [ - MatchValue( - PatternMatchValue { - range: 646..647, - value: NumberLiteral( - ExprNumberLiteral { - range: 646..647, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 649..650, - value: NumberLiteral( - ExprNumberLiteral { - range: 649..650, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 652..654, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchSequence( - PatternMatchSequence { - range: 659..661, - patterns: [], - }, - ), - MatchValue( - PatternMatchValue { - range: 664..667, - value: StringLiteral( - ExprStringLiteral { - range: 664..667, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 664..667, - value: "X", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 670..672, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 682..687, - targets: [ - Name( - ExprName { - range: 682..683, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 686..687, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 692..714, - pattern: MatchSequence( - PatternMatchSequence { - range: 697..699, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 709..714, - targets: [ - Name( - ExprName { - range: 709..710, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 713..714, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 737..782, - subject: Name( - ExprName { - range: 743..744, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 750..782, - pattern: MatchValue( - PatternMatchValue { - range: 755..767, - value: BinOp( - ExprBinOp { - range: 755..767, - left: NumberLiteral( - ExprNumberLiteral { - range: 755..759, - value: Float( - 0.25, - ), - }, - ), - op: Add, - right: NumberLiteral( - ExprNumberLiteral { - range: 762..767, - value: Complex { - real: 0.0, - imag: 1.75, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 777..782, - targets: [ - Name( - ExprName { - range: 777..778, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 781..782, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 805..841, - subject: Name( - ExprName { - range: 811..812, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 818..841, - pattern: MatchValue( - PatternMatchValue { - range: 823..826, - value: UnaryOp( - ExprUnaryOp { - range: 823..826, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 824..826, - value: Complex { - real: 0.0, - imag: 0.0, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 836..841, - targets: [ - Name( - ExprName { - range: 836..837, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 840..841, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 864..913, - subject: NumberLiteral( - ExprNumberLiteral { - range: 870..871, - value: Int( - 4, - ), - }, - ), - cases: [ - MatchCase { - range: 877..913, - pattern: MatchOr( - PatternMatchOr { - range: 882..895, - patterns: [ - MatchValue( - PatternMatchValue { - range: 882..883, - value: NumberLiteral( - ExprNumberLiteral { - range: 882..883, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 886..887, - value: NumberLiteral( - ExprNumberLiteral { - range: 886..887, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 890..891, - value: NumberLiteral( - ExprNumberLiteral { - range: 890..891, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 894..895, - value: NumberLiteral( - ExprNumberLiteral { - range: 894..895, - value: Int( - 3, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 905..913, - targets: [ - Name( - ExprName { - range: 905..906, - id: "x", - ctx: Store, - }, - ), - ], - value: BooleanLiteral( - ExprBooleanLiteral { - range: 909..913, - value: true, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 936..975, - subject: Name( - ExprName { - range: 942..943, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 949..975, - pattern: MatchValue( - PatternMatchValue { - range: 954..955, - value: NumberLiteral( - ExprNumberLiteral { - range: 954..955, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: Some( - Name( - ExprName { - range: 959..960, - id: "x", - ctx: Load, - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 970..975, - targets: [ - Name( - ExprName { - range: 970..971, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 974..975, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 998..1098, - subject: Name( - ExprName { - range: 1004..1005, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1011..1037, - pattern: MatchMapping( - PatternMatchMapping { - range: 1016..1022, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 1017..1018, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchValue( - PatternMatchValue { - range: 1020..1021, - value: NumberLiteral( - ExprNumberLiteral { - range: 1020..1021, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1032..1037, - targets: [ - Name( - ExprName { - range: 1032..1033, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1036..1037, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1042..1068, - pattern: MatchMapping( - PatternMatchMapping { - range: 1047..1053, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 1048..1049, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchValue( - PatternMatchValue { - range: 1051..1052, - value: NumberLiteral( - ExprNumberLiteral { - range: 1051..1052, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1063..1068, - targets: [ - Name( - ExprName { - range: 1063..1064, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1067..1068, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1073..1098, - pattern: MatchMapping( - PatternMatchMapping { - range: 1078..1083, - keys: [], - patterns: [], - rest: Some( - Identifier { - id: "z", - range: 1081..1082, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1093..1098, - targets: [ - Name( - ExprName { - range: 1093..1094, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1097..1098, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1121..1162, - subject: Call( - ExprCall { - range: 1127..1132, - func: Name( - ExprName { - range: 1127..1130, - id: "Seq", - ctx: Load, - }, - ), - arguments: Arguments { - range: 1130..1132, - args: [], - keywords: [], - }, - }, - ), - cases: [ - MatchCase { - range: 1138..1162, - pattern: MatchSequence( - PatternMatchSequence { - range: 1143..1147, - patterns: [ - MatchStar( - PatternMatchStar { - range: 1144..1146, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1157..1162, - targets: [ - Name( - ExprName { - range: 1157..1158, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1161..1162, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1185..1245, - subject: Name( - ExprName { - range: 1191..1192, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1198..1219, - pattern: MatchValue( - PatternMatchValue { - range: 1203..1204, - value: NumberLiteral( - ExprNumberLiteral { - range: 1203..1204, - value: Int( - 1, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1214..1219, - targets: [ - Name( - ExprName { - range: 1214..1215, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1218..1219, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1224..1245, - pattern: MatchValue( - PatternMatchValue { - range: 1229..1230, - value: NumberLiteral( - ExprNumberLiteral { - range: 1229..1230, - value: Int( - 1, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1240..1245, - targets: [ - Name( - ExprName { - range: 1240..1241, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1244..1245, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1268..1315, - subject: Name( - ExprName { - range: 1274..1275, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1281..1315, - pattern: MatchMapping( - PatternMatchMapping { - range: 1286..1298, - keys: [ - StringLiteral( - ExprStringLiteral { - range: 1287..1292, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 1287..1292, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - ], - patterns: [ - MatchAs( - PatternMatchAs { - range: 1294..1297, - pattern: None, - name: Some( - Identifier { - id: "bar", - range: 1294..1297, - }, - ), - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1308..1315, - targets: [ - Name( - ExprName { - range: 1308..1309, - id: "y", - ctx: Store, - }, - ), - ], - value: Name( - ExprName { - range: 1312..1315, - id: "bar", - ctx: Load, - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1338..1392, - subject: Tuple( - ExprTuple { - range: 1344..1353, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 1345..1346, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 1348..1349, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 1351..1352, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 1359..1392, - pattern: MatchSequence( - PatternMatchSequence { - range: 1364..1377, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1365..1366, - value: NumberLiteral( - ExprNumberLiteral { - range: 1365..1366, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1368..1369, - value: NumberLiteral( - ExprNumberLiteral { - range: 1368..1369, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 1371..1373, - name: Some( - Identifier { - id: "x", - range: 1372..1373, - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1375..1376, - value: NumberLiteral( - ExprNumberLiteral { - range: 1375..1376, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1387..1392, - targets: [ - Name( - ExprName { - range: 1387..1388, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1391..1392, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1415..1529, - subject: Name( - ExprName { - range: 1421..1422, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1428..1451, - pattern: MatchSequence( - PatternMatchSequence { - range: 1433..1436, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1434..1435, - value: NumberLiteral( - ExprNumberLiteral { - range: 1434..1435, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1446..1451, - targets: [ - Name( - ExprName { - range: 1446..1447, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1450..1451, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1456..1498, - pattern: MatchSequence( - PatternMatchSequence { - range: 1461..1467, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1462..1463, - value: NumberLiteral( - ExprNumberLiteral { - range: 1462..1463, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1465..1466, - value: NumberLiteral( - ExprNumberLiteral { - range: 1465..1466, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: Some( - Named( - ExprNamed { - range: 1472..1482, - target: Name( - ExprName { - range: 1472..1473, - id: "x", - ctx: Store, - }, - ), - value: Subscript( - ExprSubscript { - range: 1477..1482, - value: Name( - ExprName { - range: 1477..1478, - id: "x", - ctx: Load, - }, - ), - slice: Slice( - ExprSlice { - range: 1479..1481, - lower: None, - upper: Some( - NumberLiteral( - ExprNumberLiteral { - range: 1480..1481, - value: Int( - 0, - ), - }, - ), - ), - step: None, - }, - ), - ctx: Load, - }, - ), - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 1493..1498, - targets: [ - Name( - ExprName { - range: 1493..1494, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1497..1498, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 1503..1529, - pattern: MatchSequence( - PatternMatchSequence { - range: 1508..1514, - patterns: [ - MatchValue( - PatternMatchValue { - range: 1509..1510, - value: NumberLiteral( - ExprNumberLiteral { - range: 1509..1510, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 1512..1513, - value: NumberLiteral( - ExprNumberLiteral { - range: 1512..1513, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1524..1529, - targets: [ - Name( - ExprName { - range: 1524..1525, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1528..1529, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1552..1595, - subject: Name( - ExprName { - range: 1558..1559, - id: "w", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1565..1595, - pattern: MatchSequence( - PatternMatchSequence { - range: 1570..1580, - patterns: [ - MatchAs( - PatternMatchAs { - range: 1571..1572, - pattern: None, - name: Some( - Identifier { - id: "x", - range: 1571..1572, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 1574..1575, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 1574..1575, - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 1577..1579, - name: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1590..1595, - targets: [ - Name( - ExprName { - range: 1590..1591, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1594..1595, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1618..1664, - subject: Name( - ExprName { - range: 1624..1625, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1631..1664, - pattern: MatchValue( - PatternMatchValue { - range: 1636..1649, - value: BinOp( - ExprBinOp { - range: 1636..1649, - left: UnaryOp( - ExprUnaryOp { - range: 1636..1641, - op: USub, - operand: NumberLiteral( - ExprNumberLiteral { - range: 1637..1641, - value: Float( - 0.25, - ), - }, - ), - }, - ), - op: Sub, - right: NumberLiteral( - ExprNumberLiteral { - range: 1644..1649, - value: Complex { - real: 0.0, - imag: 1.75, - }, - }, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1659..1664, - targets: [ - Name( - ExprName { - range: 1659..1660, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1663..1664, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1687..1726, - subject: Tuple( - ExprTuple { - range: 1693..1697, - elts: [ - Name( - ExprName { - range: 1694..1695, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 1703..1726, - pattern: MatchSequence( - PatternMatchSequence { - range: 1708..1711, - patterns: [ - MatchAs( - PatternMatchAs { - range: 1709..1710, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 1709..1710, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1721..1726, - targets: [ - Name( - ExprName { - range: 1721..1722, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1725..1726, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1749..1789, - subject: Name( - ExprName { - range: 1755..1756, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1762..1789, - pattern: MatchValue( - PatternMatchValue { - range: 1767..1774, - value: Attribute( - ExprAttribute { - range: 1767..1774, - value: Attribute( - ExprAttribute { - range: 1767..1772, - value: Attribute( - ExprAttribute { - range: 1767..1770, - value: Name( - ExprName { - range: 1767..1768, - id: "A", - ctx: Load, - }, - ), - attr: Identifier { - id: "B", - range: 1769..1770, - }, - ctx: Load, - }, - ), - attr: Identifier { - id: "C", - range: 1771..1772, - }, - ctx: Load, - }, - ), - attr: Identifier { - id: "D", - range: 1773..1774, - }, - ctx: Load, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1784..1789, - targets: [ - Name( - ExprName { - range: 1784..1785, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1788..1789, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1812..1849, - subject: Name( - ExprName { - range: 1818..1819, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1825..1849, - pattern: MatchSingleton( - PatternMatchSingleton { - range: 1830..1834, - value: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1844..1849, - targets: [ - Name( - ExprName { - range: 1844..1845, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1848..1849, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1872..1906, - subject: Name( - ExprName { - range: 1878..1879, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1885..1906, - pattern: MatchValue( - PatternMatchValue { - range: 1890..1891, - value: NumberLiteral( - ExprNumberLiteral { - range: 1890..1891, - value: Int( - 0, - ), - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1901..1906, - targets: [ - Name( - ExprName { - range: 1901..1902, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1905..1906, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1929..1967, - subject: Name( - ExprName { - range: 1935..1936, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 1942..1967, - pattern: MatchSingleton( - PatternMatchSingleton { - range: 1947..1952, - value: False, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 1962..1967, - targets: [ - Name( - ExprName { - range: 1962..1963, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 1966..1967, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 1990..2081, - subject: Name( - ExprName { - range: 1996..1997, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2003..2025, - pattern: MatchSequence( - PatternMatchSequence { - range: 2008..2010, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2020..2025, - targets: [ - Name( - ExprName { - range: 2020..2021, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2024..2025, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2030..2054, - pattern: MatchSequence( - PatternMatchSequence { - range: 2035..2039, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2036..2038, - value: StringLiteral( - ExprStringLiteral { - range: 2036..2038, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2036..2038, - value: "", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2049..2054, - targets: [ - Name( - ExprName { - range: 2049..2050, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2053..2054, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2059..2081, - pattern: MatchValue( - PatternMatchValue { - range: 2064..2066, - value: StringLiteral( - ExprStringLiteral { - range: 2064..2066, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2064..2066, - value: "", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2076..2081, - targets: [ - Name( - ExprName { - range: 2076..2077, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2080..2081, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2104..2138, - subject: Name( - ExprName { - range: 2110..2111, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2117..2138, - pattern: MatchAs( - PatternMatchAs { - range: 2122..2123, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 2122..2123, - }, - ), - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2133..2138, - targets: [ - Name( - ExprName { - range: 2133..2134, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2137..2138, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2161..2207, - subject: Name( - ExprName { - range: 2167..2168, - id: "w", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2174..2207, - pattern: MatchSequence( - PatternMatchSequence { - range: 2179..2192, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2180..2181, - pattern: None, - name: Some( - Identifier { - id: "x", - range: 2180..2181, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2183..2184, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2183..2184, - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 2186..2191, - name: Some( - Identifier { - id: "rest", - range: 2187..2191, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2202..2207, - targets: [ - Name( - ExprName { - range: 2202..2203, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2206..2207, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2230..2307, - subject: Name( - ExprName { - range: 2236..2237, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2243..2307, - pattern: MatchOr( - PatternMatchOr { - range: 2248..2278, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2249..2255, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2249..2250, - value: NumberLiteral( - ExprNumberLiteral { - range: 2249..2250, - value: Int( - 0, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2254..2255, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2260..2266, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2260..2261, - value: NumberLiteral( - ExprNumberLiteral { - range: 2260..2261, - value: Int( - 1, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2265..2266, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2271..2277, - pattern: Some( - MatchValue( - PatternMatchValue { - range: 2271..2272, - value: NumberLiteral( - ExprNumberLiteral { - range: 2271..2272, - value: Int( - 2, - ), - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "z", - range: 2276..2277, - }, - ), - }, - ), - ], - }, - ), - guard: Some( - Compare( - ExprCompare { - range: 2282..2292, - left: Name( - ExprName { - range: 2282..2283, - id: "z", - ctx: Load, - }, - ), - ops: [ - Eq, - ], - comparators: [ - BinOp( - ExprBinOp { - range: 2287..2292, - left: Name( - ExprName { - range: 2287..2288, - id: "x", - ctx: Load, - }, - ), - op: Mod, - right: NumberLiteral( - ExprNumberLiteral { - range: 2291..2292, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - ), - body: [ - Assign( - StmtAssign { - range: 2302..2307, - targets: [ - Name( - ExprName { - range: 2302..2303, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2306..2307, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2330..2499, - subject: Name( - ExprName { - range: 2336..2337, - id: "x", - ctx: Load, - }, - ), - cases: [ - MatchCase { - range: 2343..2378, - pattern: MatchMapping( - PatternMatchMapping { - range: 2348..2363, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2349..2350, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2352..2362, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2353..2354, - value: NumberLiteral( - ExprNumberLiteral { - range: 2353..2354, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2356..2357, - value: NumberLiteral( - ExprNumberLiteral { - range: 2356..2357, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2359..2361, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2373..2378, - targets: [ - Name( - ExprName { - range: 2373..2374, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2377..2378, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2383..2472, - pattern: MatchOr( - PatternMatchOr { - range: 2388..2457, - patterns: [ - MatchMapping( - PatternMatchMapping { - range: 2388..2411, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2389..2390, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchOr( - PatternMatchOr { - range: 2392..2410, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2392..2402, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2393..2394, - value: NumberLiteral( - ExprNumberLiteral { - range: 2393..2394, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2396..2397, - value: NumberLiteral( - ExprNumberLiteral { - range: 2396..2397, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2399..2401, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - MatchSingleton( - PatternMatchSingleton { - range: 2405..2410, - value: False, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2414..2423, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2415..2416, - value: Int( - 1, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2418..2422, - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2419..2421, - patterns: [], - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2426..2441, - keys: [ - NumberLiteral( - ExprNumberLiteral { - range: 2427..2428, - value: Int( - 0, - ), - }, - ), - ], - patterns: [ - MatchSequence( - PatternMatchSequence { - range: 2430..2440, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2431..2432, - value: NumberLiteral( - ExprNumberLiteral { - range: 2431..2432, - value: Int( - 1, - ), - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2434..2435, - value: NumberLiteral( - ExprNumberLiteral { - range: 2434..2435, - value: Int( - 2, - ), - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2437..2439, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - ], - rest: None, - }, - ), - MatchSequence( - PatternMatchSequence { - range: 2444..2446, - patterns: [], - }, - ), - MatchValue( - PatternMatchValue { - range: 2449..2452, - value: StringLiteral( - ExprStringLiteral { - range: 2449..2452, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 2449..2452, - value: "X", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - }, - ), - MatchMapping( - PatternMatchMapping { - range: 2455..2457, - keys: [], - patterns: [], - rest: None, - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2467..2472, - targets: [ - Name( - ExprName { - range: 2467..2468, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2471..2472, - value: Int( - 1, - ), - }, - ), - }, - ), - ], - }, - MatchCase { - range: 2477..2499, - pattern: MatchSequence( - PatternMatchSequence { - range: 2482..2484, - patterns: [], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2494..2499, - targets: [ - Name( - ExprName { - range: 2494..2495, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2498..2499, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2522..2568, - subject: Tuple( - ExprTuple { - range: 2528..2537, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 2529..2530, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2532..2533, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2535..2536, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 2543..2568, - pattern: MatchSequence( - PatternMatchSequence { - range: 2548..2553, - patterns: [ - MatchValue( - PatternMatchValue { - range: 2548..2549, - value: NumberLiteral( - ExprNumberLiteral { - range: 2548..2549, - value: Int( - 0, - ), - }, - ), - }, - ), - MatchStar( - PatternMatchStar { - range: 2551..2553, - name: Some( - Identifier { - id: "x", - range: 2552..2553, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2563..2568, - targets: [ - Name( - ExprName { - range: 2563..2564, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2567..2568, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2591..2638, - subject: Tuple( - ExprTuple { - range: 2597..2606, - elts: [ - NumberLiteral( - ExprNumberLiteral { - range: 2598..2599, - value: Int( - 0, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2601..2602, - value: Int( - 1, - ), - }, - ), - NumberLiteral( - ExprNumberLiteral { - range: 2604..2605, - value: Int( - 2, - ), - }, - ), - ], - ctx: Load, - parenthesized: true, - }, - ), - cases: [ - MatchCase { - range: 2612..2638, - pattern: MatchSequence( - PatternMatchSequence { - range: 2617..2623, - patterns: [ - MatchStar( - PatternMatchStar { - range: 2617..2619, - name: Some( - Identifier { - id: "x", - range: 2618..2619, - }, - ), - }, - ), - MatchValue( - PatternMatchValue { - range: 2621..2622, - value: NumberLiteral( - ExprNumberLiteral { - range: 2621..2622, - value: Int( - 2, - ), - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2633..2638, - targets: [ - Name( - ExprName { - range: 2633..2634, - id: "y", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2637..2638, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2661..2697, - subject: Tuple( - ExprTuple { - range: 2667..2669, - elts: [ - Name( - ExprName { - range: 2667..2668, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2675..2697, - pattern: MatchSequence( - PatternMatchSequence { - range: 2680..2682, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2680..2681, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2680..2681, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2692..2697, - targets: [ - Name( - ExprName { - range: 2692..2693, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2696..2697, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2720..2760, - subject: Tuple( - ExprTuple { - range: 2726..2730, - elts: [ - Name( - ExprName { - range: 2726..2727, - id: "w", - ctx: Load, - }, - ), - Name( - ExprName { - range: 2729..2730, - id: "x", - ctx: Load, - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2736..2760, - pattern: MatchSequence( - PatternMatchSequence { - range: 2741..2745, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2741..2742, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2741..2742, - }, - ), - }, - ), - MatchAs( - PatternMatchAs { - range: 2744..2745, - pattern: None, - name: Some( - Identifier { - id: "z", - range: 2744..2745, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2755..2760, - targets: [ - Name( - ExprName { - range: 2755..2756, - id: "v", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2759..2760, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), - Match( - StmtMatch { - range: 2783..2829, - subject: Tuple( - ExprTuple { - range: 2789..2796, - elts: [ - Named( - ExprNamed { - range: 2789..2795, - target: Name( - ExprName { - range: 2789..2790, - id: "w", - ctx: Store, - }, - ), - value: Name( - ExprName { - range: 2794..2795, - id: "x", - ctx: Load, - }, - ), - }, - ), - ], - ctx: Load, - parenthesized: false, - }, - ), - cases: [ - MatchCase { - range: 2802..2829, - pattern: MatchSequence( - PatternMatchSequence { - range: 2807..2814, - patterns: [ - MatchAs( - PatternMatchAs { - range: 2807..2813, - pattern: Some( - MatchAs( - PatternMatchAs { - range: 2807..2808, - pattern: None, - name: Some( - Identifier { - id: "y", - range: 2807..2808, - }, - ), - }, - ), - ), - name: Some( - Identifier { - id: "v", - range: 2812..2813, - }, - ), - }, - ), - ], - }, - ), - guard: None, - body: [ - Assign( - StmtAssign { - range: 2824..2829, - targets: [ - Name( - ExprName { - range: 2824..2825, - id: "z", - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 2828..2829, - value: Int( - 0, - ), - }, - ), - }, - ), - ], - }, - ], - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try.snap deleted file mode 100644 index 9f13f219b4c28..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try.snap +++ /dev/null @@ -1,262 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Try( - StmtTry { - range: 0..134, - body: [ - Raise( - StmtRaise { - range: 9..28, - exc: Some( - Call( - ExprCall { - range: 15..28, - func: Name( - ExprName { - range: 15..25, - id: "ValueError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 25..28, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 26..27, - value: Int( - 1, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ), - cause: None, - }, - ), - ], - handlers: [ - ExceptHandler( - ExceptHandlerExceptHandler { - range: 29..82, - type_: Some( - Name( - ExprName { - range: 36..45, - id: "TypeError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 49..50, - }, - ), - body: [ - Expr( - StmtExpr { - range: 56..82, - value: Call( - ExprCall { - range: 56..82, - func: Name( - ExprName { - range: 56..61, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 61..82, - args: [ - FString( - ExprFString { - range: 62..81, - value: FStringValue { - inner: Single( - FString( - FString { - range: 62..81, - elements: [ - Literal( - FStringLiteralElement { - range: 64..71, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 71..80, - expression: Call( - ExprCall { - range: 72..79, - func: Name( - ExprName { - range: 72..76, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 76..79, - args: [ - Name( - ExprName { - range: 77..78, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ExceptHandler( - ExceptHandlerExceptHandler { - range: 83..134, - type_: Some( - Name( - ExprName { - range: 90..97, - id: "OSError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 101..102, - }, - ), - body: [ - Expr( - StmtExpr { - range: 108..134, - value: Call( - ExprCall { - range: 108..134, - func: Name( - ExprName { - range: 108..113, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 113..134, - args: [ - FString( - ExprFString { - range: 114..133, - value: FStringValue { - inner: Single( - FString( - FString { - range: 114..133, - elements: [ - Literal( - FStringLiteralElement { - range: 116..123, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 123..132, - expression: Call( - ExprCall { - range: 124..131, - func: Name( - ExprName { - range: 124..128, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 128..131, - args: [ - Name( - ExprName { - range: 129..130, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ], - orelse: [], - finalbody: [], - is_star: false, - }, - ), -] diff --git a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try_star.snap b/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try_star.snap deleted file mode 100644 index 66fdf192a0ab9..0000000000000 --- a/crates/ruff_python_parser/src/parser/tests/snapshots/ruff_python_parser__parser__tests__suite__tests__try_star.snap +++ /dev/null @@ -1,446 +0,0 @@ ---- -source: crates/ruff_python_parser/src/parser/tests/suite.rs -expression: parse_ast ---- -[ - Try( - StmtTry { - range: 0..260, - body: [ - Raise( - StmtRaise { - range: 9..98, - exc: Some( - Call( - ExprCall { - range: 15..98, - func: Name( - ExprName { - range: 15..29, - id: "ExceptionGroup", - ctx: Load, - }, - ), - arguments: Arguments { - range: 29..98, - args: [ - StringLiteral( - ExprStringLiteral { - range: 30..34, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 30..34, - value: "eg", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - List( - ExprList { - range: 44..97, - elts: [ - Call( - ExprCall { - range: 45..58, - func: Name( - ExprName { - range: 45..55, - id: "ValueError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 55..58, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 56..57, - value: Int( - 1, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 60..72, - func: Name( - ExprName { - range: 60..69, - id: "TypeError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 69..72, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 70..71, - value: Int( - 2, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 74..84, - func: Name( - ExprName { - range: 74..81, - id: "OSError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 81..84, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 82..83, - value: Int( - 3, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - Call( - ExprCall { - range: 86..96, - func: Name( - ExprName { - range: 86..93, - id: "OSError", - ctx: Load, - }, - ), - arguments: Arguments { - range: 93..96, - args: [ - NumberLiteral( - ExprNumberLiteral { - range: 94..95, - value: Int( - 4, - ), - }, - ), - ], - keywords: [], - }, - }, - ), - ], - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - ), - cause: None, - }, - ), - ], - handlers: [ - ExceptHandler( - ExceptHandlerExceptHandler { - range: 99..180, - type_: Some( - Name( - ExprName { - range: 107..116, - id: "TypeError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 120..121, - }, - ), - body: [ - Expr( - StmtExpr { - range: 127..180, - value: Call( - ExprCall { - range: 127..180, - func: Name( - ExprName { - range: 127..132, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 132..180, - args: [ - FString( - ExprFString { - range: 133..179, - value: FStringValue { - inner: Single( - FString( - FString { - range: 133..179, - elements: [ - Literal( - FStringLiteralElement { - range: 135..142, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 142..151, - expression: Call( - ExprCall { - range: 143..150, - func: Name( - ExprName { - range: 143..147, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 147..150, - args: [ - Name( - ExprName { - range: 148..149, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 151..164, - value: " with nested ", - }, - ), - Expression( - FStringExpressionElement { - range: 164..178, - expression: Attribute( - ExprAttribute { - range: 165..177, - value: Name( - ExprName { - range: 165..166, - id: "e", - ctx: Load, - }, - ), - attr: Identifier { - id: "exceptions", - range: 167..177, - }, - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ExceptHandler( - ExceptHandlerExceptHandler { - range: 181..260, - type_: Some( - Name( - ExprName { - range: 189..196, - id: "OSError", - ctx: Load, - }, - ), - ), - name: Some( - Identifier { - id: "e", - range: 200..201, - }, - ), - body: [ - Expr( - StmtExpr { - range: 207..260, - value: Call( - ExprCall { - range: 207..260, - func: Name( - ExprName { - range: 207..212, - id: "print", - ctx: Load, - }, - ), - arguments: Arguments { - range: 212..260, - args: [ - FString( - ExprFString { - range: 213..259, - value: FStringValue { - inner: Single( - FString( - FString { - range: 213..259, - elements: [ - Literal( - FStringLiteralElement { - range: 215..222, - value: "caught ", - }, - ), - Expression( - FStringExpressionElement { - range: 222..231, - expression: Call( - ExprCall { - range: 223..230, - func: Name( - ExprName { - range: 223..227, - id: "type", - ctx: Load, - }, - ), - arguments: Arguments { - range: 227..230, - args: [ - Name( - ExprName { - range: 228..229, - id: "e", - ctx: Load, - }, - ), - ], - keywords: [], - }, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - Literal( - FStringLiteralElement { - range: 231..244, - value: " with nested ", - }, - ), - Expression( - FStringExpressionElement { - range: 244..258, - expression: Attribute( - ExprAttribute { - range: 245..257, - value: Name( - ExprName { - range: 245..246, - id: "e", - ctx: Load, - }, - ), - attr: Identifier { - id: "exceptions", - range: 247..257, - }, - ctx: Load, - }, - ), - debug_text: None, - conversion: None, - format_spec: None, - }, - ), - ], - flags: FStringFlags { - quote_style: Single, - prefix: Regular, - triple_quoted: false, - }, - }, - ), - ), - }, - }, - ), - ], - keywords: [], - }, - }, - ), - }, - ), - ], - }, - ), - ], - orelse: [], - finalbody: [], - is_star: true, - }, - ), -] diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap deleted file mode 100644 index 9e23886b10669..0000000000000 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__invalid__tests__ok_attribute_weird.snap +++ /dev/null @@ -1,51 +0,0 @@ ---- -source: crates/ruff_python_parser/src/invalid.rs -expression: ast ---- -Ok( - [ - Assign( - StmtAssign { - range: 0..12, - targets: [ - Attribute( - ExprAttribute { - range: 0..7, - value: StringLiteral( - ExprStringLiteral { - range: 0..5, - value: StringLiteralValue { - inner: Single( - StringLiteral { - range: 0..5, - value: "foo", - flags: StringLiteralFlags { - quote_style: Double, - prefix: Empty, - triple_quoted: false, - }, - }, - ), - }, - }, - ), - attr: Identifier { - id: "y", - range: 6..7, - }, - ctx: Store, - }, - ), - ], - value: NumberLiteral( - ExprNumberLiteral { - range: 10..12, - value: Int( - 42, - ), - }, - ), - }, - ), - ], -) diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap index e67fc0be1751e..7ffedb76cb6e7 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_assignment_targets.py.snap @@ -331,7 +331,7 @@ Module( value: "a", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -800,7 +800,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -872,7 +872,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -906,7 +906,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -943,7 +943,7 @@ Module( ], flags: BytesLiteralFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap index cbdd6137947b3..1557f335d93cd 100644 --- a/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/invalid_syntax@statements__invalid_augmented_assignment_target.py.snap @@ -248,7 +248,7 @@ Module( value: "a", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -706,7 +706,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -777,7 +777,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -810,7 +810,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -846,7 +846,7 @@ Module( ], flags: BytesLiteralFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap index a59f118791bfd..181b8d7e437bd 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary.py.snap @@ -84,7 +84,7 @@ Module( value: "hello", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -153,7 +153,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -175,7 +175,7 @@ Module( value: "bar", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -198,7 +198,7 @@ Module( value: "nested", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -219,7 +219,7 @@ Module( value: "dict", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -559,7 +559,7 @@ Module( value: "nested", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -580,7 +580,7 @@ Module( value: "dict", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -778,7 +778,7 @@ Module( value: "A", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -798,7 +798,7 @@ Module( value: "B", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -902,7 +902,7 @@ Module( value: "a", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -923,7 +923,7 @@ Module( value: "d", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -944,7 +944,7 @@ Module( value: "b", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -969,7 +969,7 @@ Module( value: "e", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap index 625f88e81e239..310a25c8d916c 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__dictionary_comprehension.py.snap @@ -155,7 +155,7 @@ Module( value: "x", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap index e2329aa2e8fdc..4f94e707968f5 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__f_string.py.snap @@ -23,7 +23,7 @@ Module( elements: [], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -48,7 +48,7 @@ Module( elements: [], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -73,7 +73,7 @@ Module( elements: [], flags: FStringFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -98,7 +98,7 @@ Module( elements: [], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: true, }, }, @@ -123,7 +123,7 @@ Module( elements: [], flags: FStringFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: true, }, }, @@ -159,7 +159,7 @@ Module( value: " f", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -175,7 +175,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -216,7 +216,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -267,7 +267,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -332,7 +332,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -385,7 +385,7 @@ Module( value: "}", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -412,7 +412,7 @@ Module( ], flags: FStringFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -465,7 +465,7 @@ Module( value: "{", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -492,7 +492,7 @@ Module( ], flags: FStringFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -538,7 +538,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -596,7 +596,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -642,7 +642,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -706,7 +706,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -777,7 +777,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -806,7 +806,7 @@ Module( ], flags: FStringFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -837,7 +837,7 @@ Module( value: "foo ", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -889,7 +889,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -900,7 +900,7 @@ Module( value: "baz", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -952,7 +952,7 @@ Module( value: "one", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -988,7 +988,7 @@ Module( value: "implicitly ", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -997,7 +997,7 @@ Module( value: "concatenated", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -1091,7 +1091,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1123,7 +1123,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1176,7 +1176,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: true, }, }, @@ -1222,7 +1222,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1317,7 +1317,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1427,7 +1427,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1486,7 +1486,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1576,7 +1576,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1652,7 +1652,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1698,7 +1698,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1744,7 +1744,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1790,7 +1790,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1843,7 +1843,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1901,7 +1901,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1954,7 +1954,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1980,7 +1980,7 @@ Module( value: "hello", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2007,7 +2007,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2050,7 +2050,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2077,7 +2077,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2120,7 +2120,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2131,7 +2131,7 @@ Module( value: "world", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2201,7 +2201,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2227,7 +2227,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2254,7 +2254,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2265,7 +2265,7 @@ Module( value: "bar", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2299,7 +2299,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2317,7 +2317,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2328,7 +2328,7 @@ Module( value: "c", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2346,7 +2346,9 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: true, + prefix: Raw { + uppercase_r: false, + }, triple_quoted: false, }, }, @@ -2364,7 +2366,9 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: true, + prefix: Raw { + uppercase_r: false, + }, triple_quoted: false, }, }, @@ -2391,7 +2395,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "u", + prefix: Unicode, triple_quoted: false, }, }, @@ -2418,7 +2422,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2429,7 +2433,7 @@ Module( value: "baz", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2440,7 +2444,7 @@ Module( value: " some", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2467,7 +2471,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2494,7 +2498,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2505,7 +2509,7 @@ Module( value: "baz", flags: StringLiteralFlags { quote_style: Double, - prefix: "u", + prefix: Unicode, triple_quoted: false, }, }, @@ -2516,7 +2520,7 @@ Module( value: " some", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2543,7 +2547,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2570,7 +2574,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2581,7 +2585,7 @@ Module( value: "baz", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2592,7 +2596,7 @@ Module( value: " some", flags: StringLiteralFlags { quote_style: Double, - prefix: "u", + prefix: Unicode, triple_quoted: false, }, }, @@ -2619,7 +2623,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "u", + prefix: Unicode, triple_quoted: false, }, }, @@ -2658,7 +2662,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -2669,7 +2673,7 @@ Module( value: "bar", flags: StringLiteralFlags { quote_style: Double, - prefix: "u", + prefix: Unicode, triple_quoted: false, }, }, @@ -2680,7 +2684,7 @@ Module( value: "no", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap index 43544502f48c9..e15affba7a862 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__generator.py.snap @@ -735,7 +735,7 @@ Module( value: " ", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -800,7 +800,7 @@ Module( value: "LIMIT %d", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -848,7 +848,7 @@ Module( value: "OFFSET %d", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap index d31c21a5a37df..85db63784d707 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@expressions__string.py.snap @@ -22,7 +22,7 @@ Module( value: "Hello World", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -45,7 +45,7 @@ Module( value: "😎", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -70,7 +70,7 @@ Module( value: "Foo", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -79,7 +79,7 @@ Module( value: "Bar", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -107,7 +107,7 @@ Module( value: "A", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -116,7 +116,7 @@ Module( value: "B", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -125,7 +125,7 @@ Module( value: "C", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -151,7 +151,7 @@ Module( value: "Olá, Mundo!", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: true, }, }, @@ -174,7 +174,7 @@ Module( value: "ABCDE", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: true, }, }, @@ -199,7 +199,7 @@ Module( value: "aB", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: true, }, }, @@ -208,7 +208,7 @@ Module( value: "cD", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: true, }, }, @@ -246,7 +246,7 @@ Module( ], flags: BytesLiteralFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -276,7 +276,7 @@ Module( ], flags: BytesLiteralFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -298,7 +298,7 @@ Module( ], flags: BytesLiteralFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap index bbe987f2d958f..0ab6c52f70006 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assert.py.snap @@ -113,7 +113,7 @@ Module( value: "error", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap index 3e1555b66dbea..fc6bd9d7b8d5e 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__assignment.py.snap @@ -780,7 +780,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap index de7980e51d999..98ebc2cf778c9 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__class.py.snap @@ -361,7 +361,7 @@ Module( value: "default", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap index 3324431350f56..24c3173de094b 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__function.py.snap @@ -1891,7 +1891,7 @@ Module( value: "str", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap index 7d77774f594cf..14bcebe20fbfb 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__match.py.snap @@ -514,7 +514,7 @@ Module( value: "seq", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -553,7 +553,7 @@ Module( value: "map", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -854,7 +854,7 @@ Module( value: "X", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -1594,7 +1594,7 @@ Module( value: "foo", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2524,7 +2524,7 @@ Module( value: "", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -2578,7 +2578,7 @@ Module( value: "", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -3206,7 +3206,7 @@ Module( value: "X", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -3785,7 +3785,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -3826,7 +3826,7 @@ Module( value: "test", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -3919,7 +3919,7 @@ Module( value: "label", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -3940,7 +3940,7 @@ Module( value: "test", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -3968,7 +3968,7 @@ Module( value: "label", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -4618,7 +4618,7 @@ Module( value: "", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -4657,7 +4657,7 @@ Module( value: [], flags: BytesLiteralFlags { quote_style: Single, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -5029,7 +5029,7 @@ Module( value: "", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -6638,7 +6638,7 @@ Module( value: "", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap index b59d96c452f59..88679762f4f16 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__try.py.snap @@ -617,7 +617,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -722,7 +722,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -778,7 +778,7 @@ Module( value: "eg", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -1026,7 +1026,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, @@ -1162,7 +1162,7 @@ Module( ], flags: FStringFlags { quote_style: Double, - raw: false, + prefix: Regular, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap index 38a1a67398ebb..1b5e45c4662db 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__type.py.snap @@ -94,7 +94,7 @@ Module( value: "ForwardRefY", flags: StringLiteralFlags { quote_style: Double, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, diff --git a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap index cf64f34aad619..8344f68de05a0 100644 --- a/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap +++ b/crates/ruff_python_parser/tests/snapshots/valid_syntax@statement__while.py.snap @@ -160,7 +160,7 @@ Module( value: "Hello World!", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, }, @@ -203,7 +203,7 @@ Module( value: "Olá, Mundo!", flags: StringLiteralFlags { quote_style: Single, - prefix: "", + prefix: Empty, triple_quoted: false, }, },