diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__class_type_parameters.snap b/crates/ruff_python_ast/tests/snapshots/preorder__class_type_parameters.snap index e532ffd8b87cc3..bf2a7eccb5fe48 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__class_type_parameters.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__class_type_parameters.snap @@ -10,6 +10,5 @@ expression: trace - TypeParamTypeVarTuple - TypeParamParamSpec - StmtExpr - - ExprConstant - - Ellipsis + - ExprEllipsisLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__compare.snap b/crates/ruff_python_ast/tests/snapshots/preorder__compare.snap index 42d8bb281d6045..848886f7676523 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__compare.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__compare.snap @@ -5,11 +5,9 @@ expression: trace - ModModule - StmtExpr - ExprCompare - - ExprConstant - - Int(4) + - ExprNumberLiteral - Lt - ExprName - Lt - - ExprConstant - - Int(5) + - ExprNumberLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__dict_comprehension.snap b/crates/ruff_python_ast/tests/snapshots/preorder__dict_comprehension.snap index 54f133dc32810e..d1479d6fed158d 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__dict_comprehension.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__dict_comprehension.snap @@ -9,8 +9,7 @@ expression: trace - ExprBinOp - ExprName - Pow - - ExprConstant - - Int(2) + - ExprNumberLiteral - Comprehension - ExprName - ExprName diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__function_arguments.snap b/crates/ruff_python_ast/tests/snapshots/preorder__function_arguments.snap index 68d8454d1d8158..5ecec46ee04f96 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__function_arguments.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__function_arguments.snap @@ -9,15 +9,12 @@ expression: trace - Parameter - Parameter - Parameter - - ExprConstant - - Int(20) + - ExprNumberLiteral - Parameter - Parameter - - ExprConstant - - Int(5) + - ExprNumberLiteral - Parameter - - ExprConstant - - Int(20) + - ExprNumberLiteral - Parameter - StmtPass diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__function_positional_only_with_default.snap b/crates/ruff_python_ast/tests/snapshots/preorder__function_positional_only_with_default.snap index 2c9ace59af2779..fdc755b1f02700 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__function_positional_only_with_default.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__function_positional_only_with_default.snap @@ -7,11 +7,9 @@ expression: trace - Parameters - Parameter - Parameter - - ExprConstant - - Int(34) + - ExprNumberLiteral - Parameter - - ExprConstant - - Int(20) + - ExprNumberLiteral - Parameter - StmtPass diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__function_type_parameters.snap b/crates/ruff_python_ast/tests/snapshots/preorder__function_type_parameters.snap index c221faf0490dcf..47aa1ecf6a7f53 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__function_type_parameters.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__function_type_parameters.snap @@ -11,6 +11,5 @@ expression: trace - TypeParamParamSpec - Parameters - StmtExpr - - ExprConstant - - Ellipsis + - ExprEllipsisLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/preorder__match_class_pattern.snap b/crates/ruff_python_ast/tests/snapshots/preorder__match_class_pattern.snap index f1d75a5155d1ae..da4fe2cd9750c1 100644 --- a/crates/ruff_python_ast/tests/snapshots/preorder__match_class_pattern.snap +++ b/crates/ruff_python_ast/tests/snapshots/preorder__match_class_pattern.snap @@ -9,27 +9,20 @@ expression: trace - PatternMatchClass - ExprName - PatternMatchValue - - ExprConstant - - Int(0) + - ExprNumberLiteral - PatternMatchValue - - ExprConstant - - Int(0) + - ExprNumberLiteral - StmtExpr - - ExprConstant - - Ellipsis + - ExprEllipsisLiteral - MatchCase - PatternMatchClass - ExprName - PatternMatchValue - - ExprConstant - - Int(0) + - ExprNumberLiteral - PatternMatchValue - - ExprConstant - - Int(0) + - ExprNumberLiteral - PatternMatchValue - - ExprConstant - - Int(0) + - ExprNumberLiteral - StmtExpr - - ExprConstant - - Ellipsis + - ExprEllipsisLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__class_type_parameters.snap b/crates/ruff_python_ast/tests/snapshots/visitor__class_type_parameters.snap index 19975fd797c25c..5ca38f249ffbdd 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__class_type_parameters.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__class_type_parameters.snap @@ -9,5 +9,5 @@ expression: trace - TypeParamTypeVarTuple - TypeParamParamSpec - StmtExpr - - ExprConstant + - ExprEllipsisLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__compare.snap b/crates/ruff_python_ast/tests/snapshots/visitor__compare.snap index 299623e3491fdb..6a5f99eb4d8e4f 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__compare.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__compare.snap @@ -4,9 +4,9 @@ expression: trace --- - StmtExpr - ExprCompare - - ExprConstant + - ExprNumberLiteral - Lt - Lt - ExprName - - ExprConstant + - ExprNumberLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__dict_comprehension.snap b/crates/ruff_python_ast/tests/snapshots/visitor__dict_comprehension.snap index 64623b98863b29..138cb45b385ba2 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__dict_comprehension.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__dict_comprehension.snap @@ -11,5 +11,5 @@ expression: trace - ExprBinOp - ExprName - Pow - - ExprConstant + - ExprNumberLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__function_arguments.snap b/crates/ruff_python_ast/tests/snapshots/visitor__function_arguments.snap index aaab46e7dada44..fa6ebc6ee4ee3a 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__function_arguments.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__function_arguments.snap @@ -4,9 +4,9 @@ expression: trace --- - StmtFunctionDef - Parameters - - ExprConstant - - ExprConstant - - ExprConstant + - ExprNumberLiteral + - ExprNumberLiteral + - ExprNumberLiteral - Parameter - Parameter - Parameter diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__function_positional_only_with_default.snap b/crates/ruff_python_ast/tests/snapshots/visitor__function_positional_only_with_default.snap index a53646e2076f6d..a92798a086572f 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__function_positional_only_with_default.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__function_positional_only_with_default.snap @@ -4,8 +4,8 @@ expression: trace --- - StmtFunctionDef - Parameters - - ExprConstant - - ExprConstant + - ExprNumberLiteral + - ExprNumberLiteral - Parameter - Parameter - Parameter diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__function_type_parameters.snap b/crates/ruff_python_ast/tests/snapshots/visitor__function_type_parameters.snap index b0bbf8f5507352..60a1abe6be50ca 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__function_type_parameters.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__function_type_parameters.snap @@ -10,5 +10,5 @@ expression: trace - TypeParamParamSpec - Parameters - StmtExpr - - ExprConstant + - ExprEllipsisLiteral diff --git a/crates/ruff_python_ast/tests/snapshots/visitor__match_class_pattern.snap b/crates/ruff_python_ast/tests/snapshots/visitor__match_class_pattern.snap index 73e5ea145319a3..0c3513b0a648c0 100644 --- a/crates/ruff_python_ast/tests/snapshots/visitor__match_class_pattern.snap +++ b/crates/ruff_python_ast/tests/snapshots/visitor__match_class_pattern.snap @@ -8,20 +8,20 @@ expression: trace - PatternMatchClass - ExprName - PatternMatchValue - - ExprConstant + - ExprNumberLiteral - PatternMatchValue - - ExprConstant + - ExprNumberLiteral - StmtExpr - - ExprConstant + - ExprEllipsisLiteral - MatchCase - PatternMatchClass - ExprName - PatternMatchValue - - ExprConstant + - ExprNumberLiteral - PatternMatchValue - - ExprConstant + - ExprNumberLiteral - PatternMatchValue - - ExprConstant + - ExprNumberLiteral - StmtExpr - - ExprConstant + - ExprEllipsisLiteral diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_comment.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_comment.snap index 9fc7302a81fa3c..9be65b1a41b2a7 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_comment.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_comment.snap @@ -4,7 +4,7 @@ expression: comments.debug(test_case.source_code) --- { Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 11..12, source: `5`, }: { @@ -19,7 +19,7 @@ expression: comments.debug(test_case.source_code) ], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 79..80, source: `3`, }: { diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_trailing_end_of_line_comment.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_trailing_end_of_line_comment.snap index f553e8b817c4a0..e1f0f769fd3ad9 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_trailing_end_of_line_comment.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__binary_expression_left_operand_trailing_end_of_line_comment.snap @@ -4,7 +4,7 @@ expression: comments.debug(test_case.source_code) --- { Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 11..12, source: `5`, }: { @@ -34,7 +34,7 @@ expression: comments.debug(test_case.source_code) "trailing": [], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 103..104, source: `3`, }: { diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__nested_binary_expression.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__nested_binary_expression.snap index 8a70941d7aeeae..7309048231e329 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__nested_binary_expression.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__nested_binary_expression.snap @@ -19,7 +19,7 @@ expression: comments.debug(test_case.source_code) "trailing": [], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 12..13, source: `5`, }: { @@ -34,7 +34,7 @@ expression: comments.debug(test_case.source_code) ], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 125..126, source: `3`, }: { diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__parenthesized_expression.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__parenthesized_expression.snap index 0c49034c20c217..6fc27f35a3a6b7 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__parenthesized_expression.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__parenthesized_expression.snap @@ -19,7 +19,7 @@ expression: comments.debug(test_case.source_code) "trailing": [], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 30..32, source: `10`, }: { diff --git a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__trailing_most_outer_nested.snap b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__trailing_most_outer_nested.snap index 278320eb581519..37e4a4cc52b179 100644 --- a/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__trailing_most_outer_nested.snap +++ b/crates/ruff_python_formatter/src/comments/snapshots/ruff_python_formatter__comments__tests__trailing_most_outer_nested.snap @@ -19,7 +19,7 @@ expression: comments.debug(test_case.source_code) ], }, Node { - kind: ExprConstant, + kind: ExprNumberLiteral, range: 11..12, source: `3`, }: { diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap index 3c0df82555ece9..656770c0946b2b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__ann_assign_name.snap @@ -21,8 +21,8 @@ expression: parse_ast }, ), value: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 9..10, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap index 32a8e89e7d9012..e269b2e4d45edb 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_attribute.snap @@ -29,24 +29,24 @@ expression: parse_ast ExprTuple { range: 6..15, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 7..8, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 13..14, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap index 27d264d04fcad0..d7775fae998762 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_for.snap @@ -18,24 +18,24 @@ expression: parse_ast ExprTuple { range: 9..18, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 13..14, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 16..17, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap index 3ff39502f346f5..436e3f449f8852 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list.snap @@ -34,24 +34,24 @@ expression: parse_ast ExprTuple { range: 9..18, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 13..14, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 16..17, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap index 87867da60d3e9c..d73b326211c805 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_list_comp.snap @@ -39,24 +39,24 @@ expression: parse_ast ExprTuple { range: 16..25, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 17..18, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 20..21, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 23..24, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap index 000931fc1951cb..c3b835c27e2ecc 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_name.snap @@ -19,24 +19,24 @@ expression: parse_ast ExprTuple { range: 4..13, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 5..6, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 11..12, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap index 7cb15989d9d45a..4177eaaeb8945c 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_named_expr.snap @@ -16,8 +16,8 @@ expression: parse_ast ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 7..8, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap index 92049ffffb0423..f5c256cd2541a5 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_set_comp.snap @@ -39,24 +39,24 @@ expression: parse_ast ExprTuple { range: 16..25, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 17..18, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 20..21, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 23..24, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap index 035f4aa0ce2fd0..d6401710ed9260 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_starred.snap @@ -40,24 +40,24 @@ expression: parse_ast ExprTuple { range: 10..19, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 11..12, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 14..15, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 17..18, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap index 6b1b52325b6ca0..abdb9e8088c9c0 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_subscript.snap @@ -32,24 +32,24 @@ expression: parse_ast ExprTuple { range: 7..16, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 11..12, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 14..15, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap index 455b9957284760..ac332e78f70e93 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_tuple.snap @@ -34,24 +34,24 @@ expression: parse_ast ExprTuple { range: 9..18, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 13..14, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 16..17, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap index 8951904b64c95e..9700d860a8452c 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__assign_with.snap @@ -10,8 +10,8 @@ expression: parse_ast items: [ WithItem { range: 5..11, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 5..6, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap index e0c517de834aa3..6286c124851367 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_attribute.snap @@ -28,24 +28,24 @@ expression: parse_ast ExprTuple { range: 7..16, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 11..12, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 14..15, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap index 5bdb12571d4753..760e6d3638268a 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_name.snap @@ -14,8 +14,8 @@ expression: parse_ast }, ), op: Add, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 5..6, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap index a427014c7b9997..6b1feb17984856 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__context__tests__aug_assign_subscript.snap @@ -31,24 +31,24 @@ expression: parse_ast ExprTuple { range: 8..17, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 9..10, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 12..13, value: Int( 2, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 15..16, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap index d2928c89a4a6dc..4fc404217901db 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_kw_only_args_with_defaults.snap @@ -43,8 +43,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 14..16, value: Int( 20, @@ -64,8 +64,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 20..22, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap index 892d7d8cd122da..790aebd17cabcd 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults.snap @@ -80,8 +80,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 23..25, value: Int( 20, @@ -101,8 +101,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 29..31, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap index eb52560edc61dd..b3ca641a0b6029 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs.snap @@ -89,8 +89,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 27..29, value: Int( 20, @@ -110,8 +110,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 33..35, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap index 8c36f8acb036ed..ce6f07a1907012 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_and_kw_only_args_with_defaults_and_varargs_and_kwargs.snap @@ -89,8 +89,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 27..29, value: Int( 20, @@ -110,8 +110,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 33..35, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap index 4ef26c79570cdd..aee38b6fa58231 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__function_pos_args_with_defaults.snap @@ -41,8 +41,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 11..13, value: Int( 20, @@ -62,8 +62,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 17..19, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap index c40d94e9b672f2..38d20e2b292c7d 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args.snap @@ -57,8 +57,8 @@ Ok( kwarg: None, }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 19..20, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap index 84eec0e2bfc828..3defc8ae80cc38 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_kw_only_args_with_defaults.snap @@ -40,8 +40,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 15..17, value: Int( 20, @@ -61,8 +61,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 21..23, value: Int( 30, @@ -75,8 +75,8 @@ Ok( kwarg: None, }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 25..26, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap index 305dc3c54ff69a..3008200f440ec0 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_no_args.snap @@ -11,8 +11,8 @@ Ok( ExprLambda { range: 0..9, parameters: None, - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap index cdd389a9a4ea73..9f137fa1ace225 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_and_kw_only_args.snap @@ -82,8 +82,8 @@ Ok( kwarg: None, }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 25..26, value: Int( 0, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap index 895dd7d413e2fe..4af124410e1379 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args.snap @@ -57,8 +57,8 @@ Ok( kwarg: None, }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 16..17, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap index 07c2993d3082d7..7f12863609c13b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__function__tests__lambda_pos_args_with_defaults.snap @@ -38,8 +38,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 12..14, value: Int( 20, @@ -59,8 +59,8 @@ Ok( annotation: None, }, default: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 18..20, value: Int( 30, @@ -75,8 +75,8 @@ Ok( kwarg: None, }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 22..23, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap index 8a488120eacb14..7e5c892feac09f 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__dict_unpacking.snap @@ -7,46 +7,34 @@ Dict( range: 0..25, keys: [ Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1..4, - value: Str( - StringConstant { - value: "a", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "a", + unicode: false, + implicit_concatenated: false, }, ), ), None, Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 16..19, - value: Str( - StringConstant { - value: "d", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "d", + unicode: false, + implicit_concatenated: false, }, ), ), ], values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 6..9, - value: Str( - StringConstant { - value: "b", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "b", + unicode: false, + implicit_concatenated: false, }, ), Name( @@ -56,16 +44,12 @@ Dict( ctx: Load, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 21..24, - value: Str( - StringConstant { - value: "e", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "e", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap index f1e664a40990c2..7263bb506e71f5 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings.snap @@ -13,16 +13,12 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 2..8, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 3..7, - value: Str( - StringConstant { - value: " f", - unicode: false, - implicit_concatenated: false, - }, - ), + value: " f", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, @@ -78,8 +74,8 @@ expression: parse_ast ExprTuple { range: 24..26, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 24..25, value: Int( 3, @@ -114,8 +110,8 @@ expression: parse_ast value: Compare( ExprCompare { range: 32..36, - left: Constant( - ExprConstant { + left: NumberLiteral( + ExprNumberLiteral { range: 32..33, value: Int( 3, @@ -126,8 +122,8 @@ expression: parse_ast NotEq, ], comparators: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 35..36, value: Int( 4, @@ -166,8 +162,8 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 42..54, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 43..44, value: Int( 3, @@ -184,16 +180,12 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 45..50, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 46..49, - value: Str( - StringConstant { - value: "}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "}", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, @@ -201,16 +193,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 50..53, - value: Str( - StringConstant { - value: ">10", - unicode: false, - implicit_concatenated: false, - }, - ), + value: ">10", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -236,8 +224,8 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 58..70, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 59..60, value: Int( 3, @@ -254,16 +242,12 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 61..66, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 62..65, - value: Str( - StringConstant { - value: "{", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "{", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, @@ -271,16 +255,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 66..69, - value: Str( - StringConstant { - value: ">10", - unicode: false, - implicit_concatenated: false, - }, - ), + value: ">10", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -358,16 +338,12 @@ expression: parse_ast ExprFString { range: 100..105, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 100..105, - value: Str( - StringConstant { - value: ".3f ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: ".3f ", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -430,16 +406,16 @@ expression: parse_ast ExprTuple { range: 132..136, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 132..133, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 135..136, value: Int( 2, @@ -483,8 +459,8 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 149..162, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 150..156, value: Float( 3.1415, @@ -503,16 +479,12 @@ expression: parse_ast ExprFString { range: 158..161, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 158..161, - value: Str( - StringConstant { - value: ".1f", - unicode: false, - implicit_concatenated: false, - }, - ), + value: ".1f", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -533,16 +505,12 @@ expression: parse_ast ExprFString { range: 164..168, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 164..168, - value: Str( - StringConstant { - value: "*^20", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "*^20", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -570,16 +538,12 @@ expression: parse_ast ExprFString { range: 173..201, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 174..186, - value: Str( - StringConstant { - value: "foo bar ", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "foo bar ", + unicode: false, + implicit_concatenated: true, }, ), FormattedValue( @@ -610,16 +574,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 193..200, - value: Str( - StringConstant { - value: " baz", - unicode: false, - implicit_concatenated: true, - }, - ), + value: " baz", + unicode: false, + implicit_concatenated: true, }, ), ], @@ -629,8 +589,8 @@ expression: parse_ast ), ], values: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 203..205, value: Int( 10, @@ -658,16 +618,12 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 227..232, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 227..232, - value: Str( - StringConstant { - value: "one", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "one", + unicode: false, + implicit_concatenated: false, }, ), }, @@ -686,16 +642,12 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 256..284, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 256..284, - value: Str( - StringConstant { - value: "implicitly concatenated", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "implicitly concatenated", + unicode: false, + implicit_concatenated: true, }, ), }, @@ -719,16 +671,12 @@ expression: parse_ast ExprFString { range: 300..317, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 302..303, - value: Str( - StringConstant { - value: "\\", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -746,16 +694,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 308..309, - value: Str( - StringConstant { - value: "\\", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -775,16 +719,12 @@ expression: parse_ast ExprFString { range: 314..315, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 314..315, - value: Str( - StringConstant { - value: "\\", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -807,16 +747,12 @@ expression: parse_ast ExprFString { range: 318..332, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 320..331, - value: Str( - StringConstant { - value: "\\{foo\\}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\{foo\\}", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -849,16 +785,12 @@ expression: parse_ast ExprFString { range: 347..369, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 347..369, - value: Str( - StringConstant { - value: "x\n y\n z\n", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "x\n y\n z\n", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap index b10d76f60f49fa..587845166d0c7b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__fstrings_with_unicode.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..29, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..5, - value: Str( - StringConstant { - value: "foo", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "foo", + unicode: true, + implicit_concatenated: true, }, ), FormattedValue( @@ -37,16 +33,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 17..28, - value: Str( - StringConstant { - value: "baz some", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "baz some", + unicode: false, + implicit_concatenated: true, }, ), ], @@ -62,16 +54,12 @@ expression: parse_ast ExprFString { range: 30..59, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 31..34, - value: Str( - StringConstant { - value: "foo", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "foo", + unicode: false, + implicit_concatenated: true, }, ), FormattedValue( @@ -89,16 +77,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 47..58, - value: Str( - StringConstant { - value: "baz some", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "baz some", + unicode: true, + implicit_concatenated: true, }, ), ], @@ -114,16 +98,12 @@ expression: parse_ast ExprFString { range: 60..89, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 61..64, - value: Str( - StringConstant { - value: "foo", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "foo", + unicode: false, + implicit_concatenated: true, }, ), FormattedValue( @@ -141,16 +121,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 76..88, - value: Str( - StringConstant { - value: "baz some", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "baz some", + unicode: false, + implicit_concatenated: true, }, ), ], @@ -166,16 +142,12 @@ expression: parse_ast ExprFString { range: 90..128, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 92..103, - value: Str( - StringConstant { - value: "foobar ", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "foobar ", + unicode: true, + implicit_concatenated: true, }, ), FormattedValue( @@ -193,16 +165,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 108..127, - value: Str( - StringConstant { - value: " reallybarno", - unicode: false, - implicit_concatenated: true, - }, - ), + value: " reallybarno", + unicode: false, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap index b5ffa4e7a64368..5d3cf3b2769a29 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__generator_expression_argument.snap @@ -8,16 +8,12 @@ Call( func: Attribute( ExprAttribute { range: 0..8, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..3, - value: Str( - StringConstant { - value: " ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: " ", + unicode: false, + implicit_concatenated: false, }, ), attr: Identifier { @@ -67,16 +63,12 @@ Call( body: BinOp( ExprBinOp { range: 43..61, - left: Constant( - ExprConstant { + left: StringLiteral( + ExprStringLiteral { range: 43..53, - value: Str( - StringConstant { - value: "LIMIT %d", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "LIMIT %d", + unicode: false, + implicit_concatenated: false, }, ), op: Mod, @@ -89,10 +81,9 @@ Call( ), }, ), - orelse: Constant( - ExprConstant { + orelse: NoneLiteral( + ExprNoneLiteral { range: 76..80, - value: None, }, ), }, @@ -110,16 +101,12 @@ Call( body: BinOp( ExprBinOp { range: 91..111, - left: Constant( - ExprConstant { + left: StringLiteral( + ExprStringLiteral { range: 91..102, - value: Str( - StringConstant { - value: "OFFSET %d", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "OFFSET %d", + unicode: false, + implicit_concatenated: false, }, ), op: Mod, @@ -132,10 +119,9 @@ Call( ), }, ), - orelse: Constant( - ExprConstant { + orelse: NoneLiteral( + ExprNoneLiteral { range: 128..132, - value: None, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap index 240f724d1b5ba3..1ec5ddd1fdee62 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__ipython_escape_commands.snap @@ -221,8 +221,8 @@ Module( arguments: Arguments { range: 725..728, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 726..727, value: Int( 5, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap index dc723a1468a29c..0a0e02e4f6e418 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match.snap @@ -11,23 +11,19 @@ expression: parse_ast range: 7..18, keys: [ Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 8..14, - value: Str( - StringConstant { - value: "test", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "test", + unicode: false, + implicit_concatenated: false, }, ), ), ], values: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 16..17, value: Int( 1, @@ -98,31 +94,23 @@ expression: parse_ast range: 80..97, keys: [ Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 81..88, - value: Str( - StringConstant { - value: "label", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "label", + unicode: false, + implicit_concatenated: false, }, ), ), ], values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 90..96, - value: Str( - StringConstant { - value: "test", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "test", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -135,16 +123,12 @@ expression: parse_ast PatternMatchMapping { range: 108..155, keys: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 118..125, - value: Str( - StringConstant { - value: "label", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "label", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -253,8 +237,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 197..198, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 197..198, value: Int( 0, @@ -266,8 +250,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 200..201, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 200..201, value: Int( 1, @@ -293,8 +277,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 217..218, value: Int( 0, @@ -328,8 +312,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 238..239, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 238..239, value: Int( 0, @@ -341,8 +325,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 241..242, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 241..242, value: Int( 1, @@ -368,8 +352,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 258..259, value: Int( 0, @@ -403,8 +387,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 279..280, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 279..280, value: Int( 0, @@ -430,8 +414,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 296..297, value: Int( 0, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap index af623dab7c1079..6591b7c9d0baa1 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__match_as_identifier.snap @@ -627,8 +627,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 520..521, value: Int( 1, @@ -663,8 +663,8 @@ expression: "parse_suite(source, \"\").unwrap()" pattern: MatchValue( PatternMatchValue { range: 550..551, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 550..551, value: Int( 1, @@ -687,8 +687,8 @@ expression: "parse_suite(source, \"\").unwrap()" pattern: MatchValue( PatternMatchValue { range: 567..568, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 567..568, value: Int( 2, @@ -804,8 +804,8 @@ expression: "parse_suite(source, \"\").unwrap()" arguments: Arguments { range: 631..635, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 632..634, value: Int( 12, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap index 183ac67430405f..c43a803b8992e8 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals.snap @@ -15,8 +15,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 4..13, value: Int( 123456789, @@ -37,8 +37,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 18..24, value: Int( 123456, @@ -59,8 +59,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 29..31, value: Float( 0.1, @@ -81,8 +81,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 36..38, value: Float( 1.0, @@ -103,8 +103,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 43..47, value: Float( 10.0, @@ -125,8 +125,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 52..56, value: Float( 0.1, @@ -147,8 +147,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 61..73, value: Float( 1.00000001, @@ -169,8 +169,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 78..97, value: Float( 123456789.12345679, @@ -191,8 +191,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 102..131, value: Float( inf, @@ -213,8 +213,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 136..155, value: Float( inf, @@ -235,8 +235,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 160..170, value: Complex { real: 0.0, @@ -258,8 +258,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 175..195, value: Complex { real: 0.0, @@ -281,8 +281,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 200..207, value: Int( 727756, @@ -303,8 +303,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 212..218, value: Int( 11, @@ -325,8 +325,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 223..228, value: Int( 511, @@ -347,8 +347,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 233..244, value: Float( 6e-9, @@ -369,8 +369,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 249..254, value: Int( 10000, @@ -391,8 +391,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 259..265, value: Int( 133333, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap index a4f07acef7b1b6..79d63ba4915b19 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__numeric_literals_attribute_access.snap @@ -21,8 +21,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 4..17, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 4..6, value: Float( 0.1, @@ -60,8 +60,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 24..32, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 24..26, value: Float( 1.0, @@ -92,8 +92,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 37..46, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 37..41, value: Float( 10.0, @@ -124,8 +124,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 51..60, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 51..55, value: Float( 0.1, @@ -159,8 +159,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 65..88, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 65..84, value: Float( 123456789.12345679, @@ -198,8 +198,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 95..130, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 95..124, value: Float( inf, @@ -233,8 +233,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 135..165, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 135..154, value: Float( inf, @@ -272,8 +272,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 172..187, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 172..182, value: Complex { real: 0.0, @@ -308,8 +308,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 192..220, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 192..212, value: Complex { real: 0.0, @@ -333,8 +333,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 221..238, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 221..227, value: Int( 11, @@ -380,8 +380,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 246..263, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 246..253, value: Int( 727756, @@ -422,8 +422,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 270..287, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 270..276, value: Int( 11, @@ -461,8 +461,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Attribute( ExprAttribute { range: 294..305, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 294..299, value: Int( 511, @@ -496,8 +496,8 @@ expression: "parse_suite(source, \"\").unwrap()" func: Attribute( ExprAttribute { range: 310..327, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 310..321, value: Float( 6e-9, @@ -536,8 +536,8 @@ expression: "parse_suite(source, \"\").unwrap()" ExprUnaryOp { range: 334..344, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 335..344, value: Complex { real: 0.0, @@ -555,8 +555,8 @@ expression: "parse_suite(source, \"\").unwrap()" test: Attribute( ExprAttribute { range: 349..357, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 349..351, value: Int( 10, @@ -574,10 +574,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 363..366, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 363..366, - value: Ellipsis, }, ), }, @@ -601,8 +600,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Subscript( ExprSubscript { range: 372..379, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 372..375, value: Int( 100, @@ -636,8 +635,8 @@ expression: "parse_suite(source, \"\").unwrap()" value: Call( ExprCall { range: 384..391, - func: Constant( - ExprConstant { + func: NumberLiteral( + ExprNumberLiteral { range: 384..387, value: Int( 100, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap index 12e66dfc7ec6d6..8707ba33d6e211 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parenthesized_with_statement.snap @@ -319,8 +319,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 169..170, value: Int( 0, @@ -358,8 +358,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 189..190, value: Int( 0, @@ -431,8 +431,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 232..233, value: Int( 0, @@ -489,8 +489,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 262..263, value: Int( 0, @@ -539,8 +539,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 287..288, value: Int( 0, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap index e604da964b10ce..ebf85a89e247bd 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class.snap @@ -113,16 +113,12 @@ expression: "parse_suite(source, \"\").unwrap()" annotation: None, }, default: Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 80..89, - value: Str( - StringConstant { - value: "default", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "default", + unicode: false, + implicit_concatenated: false, }, ), ), diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap index e6e6d0cb2a62db..8d868ecef23a36 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_class_generic_types.snap @@ -39,10 +39,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 26..29, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 26..29, - value: Ellipsis, }, ), }, @@ -94,10 +93,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 73..76, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 73..76, - value: Ellipsis, }, ), }, @@ -164,10 +162,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 135..138, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 135..138, - value: Ellipsis, }, ), }, @@ -221,10 +218,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 178..181, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 178..181, - value: Ellipsis, }, ), }, @@ -278,10 +274,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 220..223, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 220..223, - value: Ellipsis, }, ), }, @@ -324,10 +319,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 258..261, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 258..261, - value: Ellipsis, }, ), }, @@ -370,10 +364,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 293..296, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 293..296, - value: Ellipsis, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap index 33b3655934ce59..0440c2f3313097 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_double_list_comprehension.snap @@ -78,8 +78,8 @@ ListComp( Lt, ], comparators: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 36..37, value: Int( 5, @@ -103,8 +103,8 @@ ListComp( Gt, ], comparators: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 45..47, value: Int( 10, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap index edf6c9b3a7edca..323e950616dd2b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_f_string.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..14, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..13, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap index a3c85c36219a87..c673e95d9658c2 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_function_definition.snap @@ -39,10 +39,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 17..20, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 17..20, - value: Ellipsis, }, ), }, @@ -118,10 +117,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 50..53, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 50..53, - value: Ellipsis, }, ), }, @@ -205,10 +203,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 88..91, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 88..91, - value: Ellipsis, }, ), }, @@ -307,10 +304,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 135..138, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 135..138, - value: Ellipsis, }, ), }, @@ -379,10 +375,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 168..171, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 168..171, - value: Ellipsis, }, ), }, @@ -482,10 +477,9 @@ expression: "parse_suite(source, \"\").unwrap()" Expr( StmtExpr { range: 227..230, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 227..230, - value: Ellipsis, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap index 2d6d498b5cfb8a..9f9e87a388c8c6 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_if_elif_else.snap @@ -6,8 +6,8 @@ expression: parse_ast If( StmtIf { range: 0..28, - test: Constant( - ExprConstant { + test: NumberLiteral( + ExprNumberLiteral { range: 3..4, value: Int( 1, @@ -18,8 +18,8 @@ expression: parse_ast Expr( StmtExpr { range: 6..8, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 6..8, value: Int( 10, @@ -33,8 +33,8 @@ expression: parse_ast ElifElseClause { range: 9..19, test: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 14..15, value: Int( 2, @@ -46,8 +46,8 @@ expression: parse_ast Expr( StmtExpr { range: 17..19, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 17..19, value: Int( 20, @@ -65,8 +65,8 @@ expression: parse_ast Expr( StmtExpr { range: 26..28, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 26..28, value: Int( 30, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap index c5b72bceaf1a48..5aeea6fccc4780 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_kwargs.snap @@ -19,16 +19,12 @@ expression: parse_ast arguments: Arguments { range: 7..32, args: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 8..20, - value: Str( - StringConstant { - value: "positional", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "positional", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -41,8 +37,8 @@ expression: parse_ast range: 22..29, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 30..31, value: Int( 2, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap index 3e92dce298581c..a24210739c9779 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_lambda_no_args.snap @@ -10,8 +10,8 @@ expression: parse_ast ExprLambda { range: 0..9, parameters: None, - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap index 0c42ad4b8246c8..00cb053f1a0198 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_named_expression_generator_comprehension.snap @@ -26,8 +26,8 @@ GeneratorExp( }, ), op: Add, - right: Constant( - ExprConstant { + right: NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap index 8da6210bebdf57..d72338562526b5 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_2.snap @@ -19,20 +19,16 @@ expression: parse_ast arguments: Arguments { range: 5..23, args: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 6..19, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: false, }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 21..22, value: Int( 2, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap index 67d725d1ff2963..4e665b28312f9b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_print_hello.snap @@ -19,16 +19,12 @@ expression: parse_ast arguments: Arguments { range: 5..20, args: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 6..19, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap index 40dd83f830b12d..5f65e7d4a785c6 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_string.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..13, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..13, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap index 105599e5e3c572..3dd0a471b213c6 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_tuples.snap @@ -34,16 +34,16 @@ expression: "parse_suite(source, \"\").unwrap()" ExprTuple { range: 7..11, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 7..8, value: Int( 4, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 10..11, value: Int( 5, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap index 7b0b60304ea15c..24cd00399424fc 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__parse_type_declaration.snap @@ -78,16 +78,12 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), op: BitOr, - right: Constant( - ExprConstant { + right: StringLiteral( + ExprStringLiteral { range: 48..61, - value: Str( - StringConstant { - value: "ForwardRefY", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "ForwardRefY", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap index d88e875fd88b65..11be351c0aa89b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__patma.snap @@ -23,8 +23,8 @@ expression: parse_ast ExprUnaryOp { range: 85..88, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 86..88, value: Complex { real: 0.0, @@ -50,8 +50,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 102..103, value: Int( 0, @@ -122,8 +122,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 166..167, value: Int( 0, @@ -153,8 +153,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 208..209, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 208..209, value: Int( 0, @@ -164,8 +164,8 @@ expression: parse_ast }, ), guard: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 213..214, value: Int( 0, @@ -186,8 +186,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 228..229, value: Int( 0, @@ -203,8 +203,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 239..240, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 239..240, value: Int( 0, @@ -214,8 +214,8 @@ expression: parse_ast }, ), guard: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 244..245, value: Int( 1, @@ -236,8 +236,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 259..260, value: Int( 1, @@ -254,8 +254,8 @@ expression: parse_ast Match( StmtMatch { range: 283..332, - subject: Constant( - ExprConstant { + subject: NumberLiteral( + ExprNumberLiteral { range: 289..290, value: Int( 3, @@ -272,8 +272,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 301..302, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 301..302, value: Int( 0, @@ -285,8 +285,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 305..306, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 305..306, value: Int( 1, @@ -298,8 +298,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 309..310, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 309..310, value: Int( 2, @@ -311,8 +311,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 313..314, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 313..314, value: Int( 3, @@ -338,12 +338,10 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: BooleanLiteral( + ExprBooleanLiteral { range: 328..332, - value: Bool( - true, - ), + value: true, }, ), }, @@ -377,8 +375,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 374..375, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 374..375, value: Int( 0, @@ -390,8 +388,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 377..378, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 377..378, value: Int( 1, @@ -410,8 +408,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 383..384, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 383..384, value: Int( 1, @@ -423,8 +421,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 386..387, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 386..387, value: Int( 0, @@ -453,8 +451,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 402..403, value: Int( 0, @@ -500,16 +498,12 @@ expression: parse_ast StmtReturn { range: 477..489, value: Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 484..489, - value: Str( - StringConstant { - value: "seq", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "seq", + unicode: false, + implicit_concatenated: false, }, ), ), @@ -533,16 +527,12 @@ expression: parse_ast StmtReturn { range: 511..523, value: Some( - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 518..523, - value: Str( - StringConstant { - value: "map", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "map", + unicode: false, + implicit_concatenated: false, }, ), ), @@ -570,8 +560,8 @@ expression: parse_ast PatternMatchMapping { range: 564..579, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 565..566, value: Int( 0, @@ -587,8 +577,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 569..570, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 569..570, value: Int( 1, @@ -600,8 +590,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 572..573, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 572..573, value: Int( 2, @@ -639,8 +629,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 593..594, value: Int( 0, @@ -661,8 +651,8 @@ expression: parse_ast PatternMatchMapping { range: 604..626, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 605..606, value: Int( 0, @@ -682,8 +672,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 609..610, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 609..610, value: Int( 1, @@ -695,8 +685,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 612..613, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 612..613, value: Int( 2, @@ -733,8 +723,8 @@ expression: parse_ast PatternMatchMapping { range: 629..638, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 630..631, value: Int( 1, @@ -764,8 +754,8 @@ expression: parse_ast PatternMatchMapping { range: 641..656, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 642..643, value: Int( 0, @@ -781,8 +771,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 646..647, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 646..647, value: Int( 1, @@ -794,8 +784,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 649..650, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 649..650, value: Int( 2, @@ -828,16 +818,12 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 664..667, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 664..667, - value: Str( - StringConstant { - value: "X", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "X", + unicode: false, + implicit_concatenated: false, }, ), }, @@ -867,8 +853,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 686..687, value: Int( 1, @@ -901,8 +887,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 713..714, value: Int( 2, @@ -935,8 +921,8 @@ expression: parse_ast value: BinOp( ExprBinOp { range: 755..767, - left: Constant( - ExprConstant { + left: NumberLiteral( + ExprNumberLiteral { range: 755..759, value: Float( 0.25, @@ -944,8 +930,8 @@ expression: parse_ast }, ), op: Add, - right: Constant( - ExprConstant { + right: NumberLiteral( + ExprNumberLiteral { range: 762..767, value: Complex { real: 0.0, @@ -971,8 +957,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 781..782, value: Int( 0, @@ -1006,8 +992,8 @@ expression: parse_ast ExprUnaryOp { range: 823..826, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 824..826, value: Complex { real: 0.0, @@ -1033,8 +1019,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 840..841, value: Int( 0, @@ -1051,8 +1037,8 @@ expression: parse_ast Match( StmtMatch { range: 864..913, - subject: Constant( - ExprConstant { + subject: NumberLiteral( + ExprNumberLiteral { range: 870..871, value: Int( 4, @@ -1069,8 +1055,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 882..883, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 882..883, value: Int( 0, @@ -1082,8 +1068,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 886..887, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 886..887, value: Int( 1, @@ -1095,8 +1081,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 890..891, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 890..891, value: Int( 2, @@ -1108,8 +1094,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 894..895, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 894..895, value: Int( 3, @@ -1135,12 +1121,10 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: BooleanLiteral( + ExprBooleanLiteral { range: 909..913, - value: Bool( - true, - ), + value: true, }, ), }, @@ -1166,8 +1150,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 954..955, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 954..955, value: Int( 0, @@ -1198,8 +1182,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 974..975, value: Int( 0, @@ -1230,8 +1214,8 @@ expression: parse_ast PatternMatchMapping { range: 1016..1022, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1017..1018, value: Int( 1, @@ -1243,8 +1227,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1020..1021, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1020..1021, value: Int( 0, @@ -1271,8 +1255,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1036..1037, value: Int( 0, @@ -1289,8 +1273,8 @@ expression: parse_ast PatternMatchMapping { range: 1047..1053, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1048..1049, value: Int( 0, @@ -1302,8 +1286,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1051..1052, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1051..1052, value: Int( 0, @@ -1330,8 +1314,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1067..1068, value: Int( 1, @@ -1371,8 +1355,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1097..1098, value: Int( 2, @@ -1436,8 +1420,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1161..1162, value: Int( 0, @@ -1467,8 +1451,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 1203..1204, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1203..1204, value: Int( 1, @@ -1491,8 +1475,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1218..1219, value: Int( 0, @@ -1508,8 +1492,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 1229..1230, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1229..1230, value: Int( 1, @@ -1532,8 +1516,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1244..1245, value: Int( 1, @@ -1564,16 +1548,12 @@ expression: parse_ast PatternMatchMapping { range: 1286..1298, keys: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1287..1292, - value: Str( - StringConstant { - value: "foo", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "foo", + unicode: false, + implicit_concatenated: false, }, ), ], @@ -1629,24 +1609,24 @@ expression: parse_ast ExprTuple { range: 1344..1353, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1345..1346, value: Int( 0, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1348..1349, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1351..1352, value: Int( 2, @@ -1667,8 +1647,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1365..1366, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1365..1366, value: Int( 0, @@ -1680,8 +1660,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1368..1369, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1368..1369, value: Int( 1, @@ -1704,8 +1684,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1375..1376, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1375..1376, value: Int( 2, @@ -1731,8 +1711,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1391..1392, value: Int( 0, @@ -1766,8 +1746,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1434..1435, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1434..1435, value: Int( 0, @@ -1793,8 +1773,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1450..1451, value: Int( 0, @@ -1814,8 +1794,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1462..1463, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1462..1463, value: Int( 1, @@ -1827,8 +1807,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1465..1466, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1465..1466, value: Int( 0, @@ -1866,8 +1846,8 @@ expression: parse_ast range: 1479..1481, lower: None, upper: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 1480..1481, value: Int( 0, @@ -1897,8 +1877,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1497..1498, value: Int( 1, @@ -1918,8 +1898,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1509..1510, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1509..1510, value: Int( 1, @@ -1931,8 +1911,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 1512..1513, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1512..1513, value: Int( 0, @@ -1958,8 +1938,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1528..1529, value: Int( 2, @@ -2037,8 +2017,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1594..1595, value: Int( 0, @@ -2075,8 +2055,8 @@ expression: parse_ast ExprUnaryOp { range: 1636..1641, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 1637..1641, value: Float( 0.25, @@ -2086,8 +2066,8 @@ expression: parse_ast }, ), op: Sub, - right: Constant( - ExprConstant { + right: NumberLiteral( + ExprNumberLiteral { range: 1644..1649, value: Complex { real: 0.0, @@ -2113,8 +2093,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1663..1664, value: Int( 0, @@ -2182,8 +2162,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1725..1726, value: Int( 0, @@ -2266,8 +2246,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1788..1789, value: Int( 0, @@ -2314,8 +2294,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1848..1849, value: Int( 0, @@ -2345,8 +2325,8 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 1890..1891, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1890..1891, value: Int( 0, @@ -2369,8 +2349,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1905..1906, value: Int( 0, @@ -2417,8 +2397,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 1966..1967, value: Int( 0, @@ -2465,8 +2445,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2024..2025, value: Int( 0, @@ -2486,16 +2466,12 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2036..2038, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 2036..2038, - value: Str( - StringConstant { - value: "", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "", + unicode: false, + implicit_concatenated: false, }, ), }, @@ -2517,8 +2493,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2053..2054, value: Int( 1, @@ -2534,16 +2510,12 @@ expression: parse_ast pattern: MatchValue( PatternMatchValue { range: 2064..2066, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 2064..2066, - value: Str( - StringConstant { - value: "", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "", + unicode: false, + implicit_concatenated: false, }, ), }, @@ -2562,8 +2534,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2080..2081, value: Int( 2, @@ -2616,8 +2588,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2137..2138, value: Int( 0, @@ -2700,8 +2672,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2206..2207, value: Int( 0, @@ -2739,8 +2711,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2249..2250, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2249..2250, value: Int( 0, @@ -2765,8 +2737,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2260..2261, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2260..2261, value: Int( 1, @@ -2791,8 +2763,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2271..2272, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2271..2272, value: Int( 2, @@ -2839,8 +2811,8 @@ expression: parse_ast }, ), op: Mod, - right: Constant( - ExprConstant { + right: NumberLiteral( + ExprNumberLiteral { range: 2291..2292, value: Int( 2, @@ -2866,8 +2838,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2306..2307, value: Int( 0, @@ -2898,8 +2870,8 @@ expression: parse_ast PatternMatchMapping { range: 2348..2363, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2349..2350, value: Int( 0, @@ -2915,8 +2887,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2353..2354, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2353..2354, value: Int( 1, @@ -2928,8 +2900,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2356..2357, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2356..2357, value: Int( 2, @@ -2967,8 +2939,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2377..2378, value: Int( 0, @@ -2989,8 +2961,8 @@ expression: parse_ast PatternMatchMapping { range: 2388..2411, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2389..2390, value: Int( 0, @@ -3010,8 +2982,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2393..2394, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2393..2394, value: Int( 1, @@ -3023,8 +2995,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2396..2397, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2396..2397, value: Int( 2, @@ -3061,8 +3033,8 @@ expression: parse_ast PatternMatchMapping { range: 2414..2423, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2415..2416, value: Int( 1, @@ -3092,8 +3064,8 @@ expression: parse_ast PatternMatchMapping { range: 2426..2441, keys: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2427..2428, value: Int( 0, @@ -3109,8 +3081,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2431..2432, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2431..2432, value: Int( 1, @@ -3122,8 +3094,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2434..2435, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2434..2435, value: Int( 2, @@ -3156,16 +3128,12 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2449..2452, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 2449..2452, - value: Str( - StringConstant { - value: "X", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "X", + unicode: false, + implicit_concatenated: false, }, ), }, @@ -3195,8 +3163,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2471..2472, value: Int( 1, @@ -3229,8 +3197,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2498..2499, value: Int( 2, @@ -3251,24 +3219,24 @@ expression: parse_ast ExprTuple { range: 2528..2537, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2529..2530, value: Int( 0, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2532..2533, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2535..2536, value: Int( 2, @@ -3289,8 +3257,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2548..2549, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2548..2549, value: Int( 0, @@ -3327,8 +3295,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2567..2568, value: Int( 0, @@ -3349,24 +3317,24 @@ expression: parse_ast ExprTuple { range: 2597..2606, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2598..2599, value: Int( 0, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2601..2602, value: Int( 1, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2604..2605, value: Int( 2, @@ -3398,8 +3366,8 @@ expression: parse_ast MatchValue( PatternMatchValue { range: 2621..2622, - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2621..2622, value: Int( 2, @@ -3425,8 +3393,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2637..2638, value: Int( 0, @@ -3486,8 +3454,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2696..2697, value: Int( 0, @@ -3574,8 +3542,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2759..2760, value: Int( 0, @@ -3660,8 +3628,8 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 2828..2829, value: Int( 0, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap index ed8946f6141d0b..3113d140366894 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__slice.snap @@ -16,8 +16,8 @@ Subscript( ExprSlice { range: 2..7, lower: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 2..3, value: Int( 1, @@ -26,8 +26,8 @@ Subscript( ), ), upper: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 4..5, value: Int( 2, @@ -36,8 +36,8 @@ Subscript( ), ), step: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 6..7, value: Int( 3, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap index a00b0453c35dab..3cd99121dedd85 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__star_index.snap @@ -29,8 +29,8 @@ expression: parse_ast ExprTuple { range: 20..35, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 20..21, value: Int( 0, @@ -54,8 +54,8 @@ expression: parse_ast ExprUnaryOp { range: 33..35, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 34..35, value: Int( 1, @@ -91,8 +91,8 @@ expression: parse_ast ExprTuple { range: 43..58, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 43..44, value: Int( 0, @@ -116,8 +116,8 @@ expression: parse_ast ExprUnaryOp { range: 56..58, op: USub, - operand: Constant( - ExprConstant { + operand: NumberLiteral( + ExprNumberLiteral { range: 57..58, value: Int( 1, @@ -216,8 +216,8 @@ expression: parse_ast ExprSlice { range: 126..129, lower: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 126..127, value: Int( 3, @@ -226,8 +226,8 @@ expression: parse_ast ), ), upper: Some( - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 128..129, value: Int( 5, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap index b9aab97c0d967f..f653b8c7f0d8c4 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try.snap @@ -24,8 +24,8 @@ expression: parse_ast arguments: Arguments { range: 25..28, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 26..27, value: Int( 1, @@ -82,16 +82,12 @@ expression: parse_ast ExprFString { range: 62..81, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 64..71, - value: Str( - StringConstant { - value: "caught ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "caught ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -180,16 +176,12 @@ expression: parse_ast ExprFString { range: 114..133, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 116..123, - value: Str( - StringConstant { - value: "caught ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "caught ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap index 5f691af0cf7730..2ed0abb3ea0fb7 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__try_star.snap @@ -24,16 +24,12 @@ expression: parse_ast arguments: Arguments { range: 29..98, args: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 30..34, - value: Str( - StringConstant { - value: "eg", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "eg", + unicode: false, + implicit_concatenated: false, }, ), List( @@ -53,8 +49,8 @@ expression: parse_ast arguments: Arguments { range: 55..58, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 56..57, value: Int( 1, @@ -79,8 +75,8 @@ expression: parse_ast arguments: Arguments { range: 69..72, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 70..71, value: Int( 2, @@ -105,8 +101,8 @@ expression: parse_ast arguments: Arguments { range: 81..84, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 82..83, value: Int( 3, @@ -131,8 +127,8 @@ expression: parse_ast arguments: Arguments { range: 93..96, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 94..95, value: Int( 4, @@ -198,16 +194,12 @@ expression: parse_ast ExprFString { range: 133..179, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 135..142, - value: Str( - StringConstant { - value: "caught ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "caught ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -243,16 +235,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 151..164, - value: Str( - StringConstant { - value: " with nested ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: " with nested ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -333,16 +321,12 @@ expression: parse_ast ExprFString { range: 213..259, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 215..222, - value: Str( - StringConstant { - value: "caught ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "caught ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -378,16 +362,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 231..244, - value: Str( - StringConstant { - value: " with nested ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: " with nested ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap index 5d6787776a447c..ad394b4042ac61 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__type_as_identifier.snap @@ -627,8 +627,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 492..493, value: Int( 1, @@ -742,8 +742,8 @@ expression: "parse_suite(source, \"\").unwrap()" arguments: Arguments { range: 546..550, args: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 547..549, value: Int( 12, @@ -920,8 +920,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 624..625, value: Int( 1, @@ -949,8 +949,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 637..638, value: Int( 1, @@ -978,8 +978,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, ), ], - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 650..651, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap index b7e2c7c1899e35..ce30084c32dcd3 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__unicode_aliases.snap @@ -15,16 +15,12 @@ expression: parse_ast }, ), ], - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 4..37, - value: Str( - StringConstant { - value: "\u{8}another cool trick", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{8}another cool trick", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap index 5c43a8b07dbbd6..82ef9d16c5feca 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__variadic_generics.snap @@ -76,10 +76,9 @@ expression: parse_ast Expr( StmtExpr { range: 46..49, - value: Constant( - ExprConstant { + value: EllipsisLiteral( + ExprEllipsisLiteral { range: 46..49, - value: Ellipsis, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap index 74b8279ae46139..de4e64d775aa16 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__parser__tests__with_statement.snap @@ -10,8 +10,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 5..6, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 5..6, value: Int( 0, @@ -37,8 +37,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 18..24, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 18..19, value: Int( 0, @@ -72,8 +72,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 36..37, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 36..37, value: Int( 0, @@ -84,8 +84,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, WithItem { range: 39..40, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 39..40, value: Int( 1, @@ -111,8 +111,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 52..58, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 52..53, value: Int( 0, @@ -131,8 +131,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, WithItem { range: 60..66, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 60..61, value: Int( 1, @@ -169,24 +169,24 @@ expression: "parse_suite(source, \"\").unwrap()" context_expr: IfExp( ExprIfExp { range: 78..91, - test: Constant( - ExprConstant { + test: NumberLiteral( + ExprNumberLiteral { range: 83..84, value: Int( 1, ), }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 78..79, value: Int( 0, ), }, ), - orelse: Constant( - ExprConstant { + orelse: NumberLiteral( + ExprNumberLiteral { range: 90..91, value: Int( 2, @@ -217,24 +217,24 @@ expression: "parse_suite(source, \"\").unwrap()" context_expr: IfExp( ExprIfExp { range: 103..116, - test: Constant( - ExprConstant { + test: NumberLiteral( + ExprNumberLiteral { range: 108..109, value: Int( 1, ), }, ), - body: Constant( - ExprConstant { + body: NumberLiteral( + ExprNumberLiteral { range: 103..104, value: Int( 0, ), }, ), - orelse: Constant( - ExprConstant { + orelse: NumberLiteral( + ExprNumberLiteral { range: 115..116, value: Int( 2, @@ -330,8 +330,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 167..168, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 167..168, value: Int( 0, @@ -357,8 +357,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 181..189, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 182..183, value: Int( 0, @@ -392,8 +392,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 202..203, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 202..203, value: Int( 0, @@ -423,8 +423,8 @@ expression: "parse_suite(source, \"\").unwrap()" ExprTuple { range: 217..221, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 218..219, value: Int( 0, @@ -462,8 +462,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 239..240, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 239..240, value: Int( 0, @@ -474,8 +474,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, WithItem { range: 242..243, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 242..243, value: Int( 1, @@ -505,16 +505,16 @@ expression: "parse_suite(source, \"\").unwrap()" ExprTuple { range: 256..262, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 257..258, value: Int( 0, ), }, ), - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 260..261, value: Int( 1, @@ -644,8 +644,8 @@ expression: "parse_suite(source, \"\").unwrap()" ExprTuple { range: 318..325, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 319..320, value: Int( 0, @@ -692,8 +692,8 @@ expression: "parse_suite(source, \"\").unwrap()" ExprTuple { range: 337..344, elts: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 338..339, value: Int( 0, @@ -754,8 +754,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 367..368, value: Int( 0, @@ -793,8 +793,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 387..388, value: Int( 0, @@ -844,8 +844,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 412..413, value: Int( 0, @@ -864,8 +864,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 420..421, value: Int( 1, @@ -911,8 +911,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 440..441, value: Int( 0, @@ -931,8 +931,8 @@ expression: "parse_suite(source, \"\").unwrap()" ctx: Store, }, ), - value: Constant( - ExprConstant { + value: NumberLiteral( + ExprNumberLiteral { range: 448..449, value: Int( 1, @@ -972,8 +972,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 468..474, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 468..469, value: Int( 0, @@ -1007,8 +1007,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 488..494, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 488..489, value: Int( 0, @@ -1042,8 +1042,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 509..515, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 509..510, value: Int( 0, @@ -1062,8 +1062,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, WithItem { range: 517..523, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 517..518, value: Int( 1, @@ -1097,8 +1097,8 @@ expression: "parse_suite(source, \"\").unwrap()" items: [ WithItem { range: 537..543, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 537..538, value: Int( 0, @@ -1117,8 +1117,8 @@ expression: "parse_suite(source, \"\").unwrap()" }, WithItem { range: 545..551, - context_expr: Constant( - ExprConstant { + context_expr: NumberLiteral( + ExprNumberLiteral { range: 545..546, value: Int( 1, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__backspace_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__backspace_alias.snap index f05fffeb999983..f29c2f977121f6 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__backspace_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__backspace_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..15, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..15, - value: Str( - StringConstant { - value: "\u{8}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{8}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__bell_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__bell_alias.snap index e0ef3c542a5d43..ef30240f8a89be 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__bell_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__bell_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..9, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..9, - value: Str( - StringConstant { - value: "\u{7}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{7}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__carriage_return_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__carriage_return_alias.snap index 0f1a81266c6c66..4224f30ab7cbe3 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__carriage_return_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__carriage_return_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..21, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..21, - value: Str( - StringConstant { - value: "\r", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\r", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__character_tabulation_with_justification_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__character_tabulation_with_justification_alias.snap index f86cadd6cd4948..735816fc1fedde 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__character_tabulation_with_justification_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__character_tabulation_with_justification_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..45, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..45, - value: Str( - StringConstant { - value: "\u{89}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{89}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__delete_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__delete_alias.snap index 7ad63ab23d3f35..e54a28743075d7 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__delete_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__delete_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..12, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..12, - value: Str( - StringConstant { - value: "\u{7f}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{7f}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__double_quoted_byte.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__double_quoted_byte.snap index 99b35c5b407b24..e3b24f2b522852 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__double_quoted_byte.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__double_quoted_byte.snap @@ -6,272 +6,268 @@ expression: parse_ast Expr( StmtExpr { range: 0..738, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..738, - value: Bytes( - BytesConstant { - value: [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - ], - implicit_concatenated: false, - }, - ), + value: [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 227, + 228, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_alias.snap index 5efa42a127de22..871b5788cadb33 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..12, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..12, - value: Str( - StringConstant { - value: "\u{1b}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{1b}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_char_in_byte_literal.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_char_in_byte_literal.snap index ff789cab8f2dce..1ad9fb00a0f377 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_char_in_byte_literal.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_char_in_byte_literal.snap @@ -6,26 +6,22 @@ expression: parse_ast Expr( StmtExpr { range: 0..13, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..13, - value: Bytes( - BytesConstant { - value: [ - 111, - 109, - 107, - 109, - 111, - 107, - 92, - 88, - 97, - 97, - ], - implicit_concatenated: false, - }, - ), + value: [ + 111, + 109, + 107, + 109, + 111, + 107, + 92, + 88, + 97, + 97, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_octet.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_octet.snap index d32f060205d754..1471b60aa0413b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_octet.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__escape_octet.snap @@ -6,21 +6,17 @@ expression: parse_ast Expr( StmtExpr { range: 0..14, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..14, - value: Bytes( - BytesConstant { - value: [ - 35, - 97, - 4, - 83, - 52, - ], - implicit_concatenated: false, - }, - ), + value: [ + 35, + 97, + 4, + 83, + 52, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__form_feed_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__form_feed_alias.snap index c974de85af64d6..d574d60f914663 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__form_feed_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__form_feed_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..15, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..15, - value: Str( - StringConstant { - value: "\u{c}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{c}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_constant_range.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_constant_range.snap index 245d664aa87563..2609db65ebcf0a 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_constant_range.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_constant_range.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..22, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..5, - value: Str( - StringConstant { - value: "aaa", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "aaa", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -37,16 +33,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 10..13, - value: Str( - StringConstant { - value: "ccc", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "ccc", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -64,16 +56,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 18..21, - value: Str( - StringConstant { - value: "eee", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "eee", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_character.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_character.snap index 796b97b9eac023..9d179474d18c15 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_character.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_character.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..8, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..4, - value: Str( - StringConstant { - value: "\\", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_newline.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_newline.snap index 17dc9dbe2bd736..aa63b7d99d05cf 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_newline.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_escaped_newline.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..8, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..4, - value: Str( - StringConstant { - value: "\n", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\n", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_line_continuation.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_line_continuation.snap index fcf985cc79c3cf..52dd4c6e45842a 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_line_continuation.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_line_continuation.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..9, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 3..5, - value: Str( - StringConstant { - value: "\\\n", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\\\n", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_base_more.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_base_more.snap index c3f98691021dd9..1cf05d42dd09c4 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_base_more.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_base_more.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..38, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..6, - value: Str( - StringConstant { - value: "mix ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "mix ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( @@ -42,16 +38,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 13..28, - value: Str( - StringConstant { - value: " with text and ", - unicode: false, - implicit_concatenated: false, - }, - ), + value: " with text and ", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_format.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_format.snap index 21fca06ff64b24..5e17b1c8a2843b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_format.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_parse_self_documenting_format.snap @@ -32,16 +32,12 @@ expression: parse_ast ExprFString { range: 9..12, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 9..12, - value: Str( - StringConstant { - value: ">10", - unicode: false, - implicit_concatenated: false, - }, - ), + value: ">10", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_unescaped_newline.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_unescaped_newline.snap index 654b947387a387..7ec5e8b42a353f 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_unescaped_newline.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__fstring_unescaped_newline.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..11, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 4..5, - value: Str( - StringConstant { - value: "\n", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\n", + unicode: false, + implicit_concatenated: false, }, ), FormattedValue( diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__hts_alias.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__hts_alias.snap index 3e699ccf70a65d..48eab469043b34 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__hts_alias.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__hts_alias.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..9, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..9, - value: Str( - StringConstant { - value: "\u{88}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "\u{88}", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_1.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_1.snap index db3c59a6385ea1..97c70a7a22e644 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_1.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_1.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..17, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1..16, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_2.snap index db3c59a6385ea1..97c70a7a22e644 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_2.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_2.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..17, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1..16, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_3.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_3.snap index d7887a62aae9cc..ccfe7c64849985 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_3.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_3.snap @@ -10,31 +10,23 @@ expression: parse_ast ExprFString { range: 0..22, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1..16, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), FormattedValue( ExprFormattedValue { range: 16..21, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 17..20, - value: Str( - StringConstant { - value: "!", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "!", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_4.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_4.snap index 86e8c4f5b85145..e6cb23a5868379 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_4.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_f_string_concat_4.snap @@ -10,31 +10,23 @@ expression: parse_ast ExprFString { range: 0..31, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 1..16, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), FormattedValue( ExprFormattedValue { range: 16..21, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 17..20, - value: Str( - StringConstant { - value: "!", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "!", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, @@ -42,16 +34,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 24..30, - value: Str( - StringConstant { - value: "again!", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "again!", + unicode: false, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring.snap index ec007012e25dba..6ee1be1ee840d2 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring.snap @@ -40,16 +40,12 @@ expression: parse_ast format_spec: None, }, ), - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 10..17, - value: Str( - StringConstant { - value: "{foo}", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "{foo}", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_equals.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_equals.snap index 99e94a06b52cbe..25315bc0359a0b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_equals.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_equals.snap @@ -16,8 +16,8 @@ expression: parse_ast value: Compare( ExprCompare { range: 3..11, - left: Constant( - ExprConstant { + left: NumberLiteral( + ExprNumberLiteral { range: 3..5, value: Int( 42, @@ -28,8 +28,8 @@ expression: parse_ast Eq, ], comparators: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 9..11, value: Int( 42, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_concatenation_string_spec.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_concatenation_string_spec.snap index 105460ecbcd24f..070a1d0eea32fe 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_concatenation_string_spec.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_concatenation_string_spec.snap @@ -30,16 +30,12 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 7..14, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 8..13, - value: Str( - StringConstant { - value: "", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "", + unicode: false, + implicit_concatenated: true, }, ), debug_text: None, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_string_spec.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_string_spec.snap index b1abddec3d7d04..327506de08aa83 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_string_spec.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_nested_string_spec.snap @@ -30,16 +30,12 @@ expression: parse_ast FormattedValue( ExprFormattedValue { range: 7..11, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 8..10, - value: Str( - StringConstant { - value: "", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "", + unicode: false, + implicit_concatenated: false, }, ), debug_text: None, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_equals.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_equals.snap index c0035a45b9405c..216021cec10c5c 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_equals.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_equals.snap @@ -16,8 +16,8 @@ expression: parse_ast value: Compare( ExprCompare { range: 3..9, - left: Constant( - ExprConstant { + left: NumberLiteral( + ExprNumberLiteral { range: 3..4, value: Int( 1, @@ -28,8 +28,8 @@ expression: parse_ast NotEq, ], comparators: [ - Constant( - ExprConstant { + NumberLiteral( + ExprNumberLiteral { range: 8..9, value: Int( 2, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_nested_spec.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_nested_spec.snap index e5cc2fade40ae1..cb1664e20c9c23 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_nested_spec.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_fstring_not_nested_spec.snap @@ -27,16 +27,12 @@ expression: parse_ast ExprFString { range: 7..11, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 7..11, - value: Str( - StringConstant { - value: "spec", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "spec", + unicode: false, + implicit_concatenated: false, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_concat.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_concat.snap index 2e3e059ba36cfb..93c14088eb2f07 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_concat.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_concat.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..16, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..16, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_triple_quotes_with_kind.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_triple_quotes_with_kind.snap index b7acd40d9ebd0d..9347faf323fa9b 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_triple_quotes_with_kind.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_string_triple_quotes_with_kind.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..20, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..20, - value: Str( - StringConstant { - value: "Hello, world!", - unicode: true, - implicit_concatenated: false, - }, - ), + value: "Hello, world!", + unicode: true, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_1.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_1.snap index 5f0ecabfed2a98..df260efb74a14f 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_1.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_1.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..18, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..17, - value: Str( - StringConstant { - value: "Hello world", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: true, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_2.snap index 39610847fe217c..aced9ed7983cdc 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_2.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_f_string_concat_2.snap @@ -10,16 +10,12 @@ expression: parse_ast ExprFString { range: 0..22, values: [ - Constant( - ExprConstant { + StringLiteral( + ExprStringLiteral { range: 2..21, - value: Str( - StringConstant { - value: "Hello world!", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "Hello world!", + unicode: true, + implicit_concatenated: true, }, ), ], diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_1.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_1.snap index 9b1eeaf6028dac..21dd4a1c10911a 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_1.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_1.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..17, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..17, - value: Str( - StringConstant { - value: "Hello world", - unicode: false, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: false, + implicit_concatenated: true, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_2.snap index ea32b3ef27fc59..19c9f87309d029 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_2.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__parse_u_string_concat_2.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..17, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..17, - value: Str( - StringConstant { - value: "Hello world", - unicode: true, - implicit_concatenated: true, - }, - ), + value: "Hello world", + unicode: true, + implicit_concatenated: true, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_1.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_1.snap index b2d41140023ba0..0ddea1aeca5ff0 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_1.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_1.snap @@ -6,20 +6,16 @@ expression: parse_ast Expr( StmtExpr { range: 0..8, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..8, - value: Bytes( - BytesConstant { - value: [ - 92, - 120, - 49, - 122, - ], - implicit_concatenated: false, - }, - ), + value: [ + 92, + 120, + 49, + 122, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_2.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_2.snap index bd22e64b0cda70..c7f13431590a82 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_2.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__raw_byte_literal_2.snap @@ -6,18 +6,14 @@ expression: parse_ast Expr( StmtExpr { range: 0..6, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..6, - value: Bytes( - BytesConstant { - value: [ - 92, - 92, - ], - implicit_concatenated: false, - }, - ), + value: [ + 92, + 92, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__single_quoted_byte.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__single_quoted_byte.snap index 99b35c5b407b24..e3b24f2b522852 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__single_quoted_byte.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__single_quoted_byte.snap @@ -6,272 +6,268 @@ expression: parse_ast Expr( StmtExpr { range: 0..738, - value: Constant( - ExprConstant { + value: BytesLiteral( + ExprBytesLiteral { range: 0..738, - value: Bytes( - BytesConstant { - value: [ - 0, - 1, - 2, - 3, - 4, - 5, - 6, - 7, - 8, - 9, - 10, - 11, - 12, - 13, - 14, - 15, - 16, - 17, - 18, - 19, - 20, - 21, - 22, - 23, - 24, - 25, - 26, - 27, - 28, - 29, - 30, - 31, - 32, - 33, - 34, - 35, - 36, - 37, - 38, - 39, - 40, - 41, - 42, - 43, - 44, - 45, - 46, - 47, - 48, - 49, - 50, - 51, - 52, - 53, - 54, - 55, - 56, - 57, - 58, - 59, - 60, - 61, - 62, - 63, - 64, - 65, - 66, - 67, - 68, - 69, - 70, - 71, - 72, - 73, - 74, - 75, - 76, - 77, - 78, - 79, - 80, - 81, - 82, - 83, - 84, - 85, - 86, - 87, - 88, - 89, - 90, - 91, - 92, - 93, - 94, - 95, - 96, - 97, - 98, - 99, - 100, - 101, - 102, - 103, - 104, - 105, - 106, - 107, - 108, - 109, - 110, - 111, - 112, - 113, - 114, - 115, - 116, - 117, - 118, - 119, - 120, - 121, - 122, - 123, - 124, - 125, - 126, - 127, - 128, - 129, - 130, - 131, - 132, - 133, - 134, - 135, - 136, - 137, - 138, - 139, - 140, - 141, - 142, - 143, - 144, - 145, - 146, - 147, - 148, - 149, - 150, - 151, - 152, - 153, - 154, - 155, - 156, - 157, - 158, - 159, - 160, - 161, - 162, - 163, - 164, - 165, - 166, - 167, - 168, - 169, - 170, - 171, - 172, - 173, - 174, - 175, - 176, - 177, - 178, - 179, - 180, - 181, - 182, - 183, - 184, - 185, - 186, - 187, - 188, - 189, - 190, - 191, - 192, - 193, - 194, - 195, - 196, - 197, - 198, - 199, - 200, - 201, - 202, - 203, - 204, - 205, - 206, - 207, - 208, - 209, - 210, - 211, - 212, - 213, - 214, - 215, - 216, - 217, - 218, - 219, - 220, - 221, - 222, - 223, - 224, - 225, - 226, - 227, - 228, - 229, - 230, - 231, - 232, - 233, - 234, - 235, - 236, - 237, - 238, - 239, - 240, - 241, - 242, - 243, - 244, - 245, - 246, - 247, - 248, - 249, - 250, - 251, - 252, - 253, - 254, - 255, - ], - implicit_concatenated: false, - }, - ), + value: [ + 0, + 1, + 2, + 3, + 4, + 5, + 6, + 7, + 8, + 9, + 10, + 11, + 12, + 13, + 14, + 15, + 16, + 17, + 18, + 19, + 20, + 21, + 22, + 23, + 24, + 25, + 26, + 27, + 28, + 29, + 30, + 31, + 32, + 33, + 34, + 35, + 36, + 37, + 38, + 39, + 40, + 41, + 42, + 43, + 44, + 45, + 46, + 47, + 48, + 49, + 50, + 51, + 52, + 53, + 54, + 55, + 56, + 57, + 58, + 59, + 60, + 61, + 62, + 63, + 64, + 65, + 66, + 67, + 68, + 69, + 70, + 71, + 72, + 73, + 74, + 75, + 76, + 77, + 78, + 79, + 80, + 81, + 82, + 83, + 84, + 85, + 86, + 87, + 88, + 89, + 90, + 91, + 92, + 93, + 94, + 95, + 96, + 97, + 98, + 99, + 100, + 101, + 102, + 103, + 104, + 105, + 106, + 107, + 108, + 109, + 110, + 111, + 112, + 113, + 114, + 115, + 116, + 117, + 118, + 119, + 120, + 121, + 122, + 123, + 124, + 125, + 126, + 127, + 128, + 129, + 130, + 131, + 132, + 133, + 134, + 135, + 136, + 137, + 138, + 139, + 140, + 141, + 142, + 143, + 144, + 145, + 146, + 147, + 148, + 149, + 150, + 151, + 152, + 153, + 154, + 155, + 156, + 157, + 158, + 159, + 160, + 161, + 162, + 163, + 164, + 165, + 166, + 167, + 168, + 169, + 170, + 171, + 172, + 173, + 174, + 175, + 176, + 177, + 178, + 179, + 180, + 181, + 182, + 183, + 184, + 185, + 186, + 187, + 188, + 189, + 190, + 191, + 192, + 193, + 194, + 195, + 196, + 197, + 198, + 199, + 200, + 201, + 202, + 203, + 204, + 205, + 206, + 207, + 208, + 209, + 210, + 211, + 212, + 213, + 214, + 215, + 216, + 217, + 218, + 219, + 220, + 221, + 222, + 223, + 224, + 225, + 226, + 227, + 228, + 229, + 230, + 231, + 232, + 233, + 234, + 235, + 236, + 237, + 238, + 239, + 240, + 241, + 242, + 243, + 244, + 245, + 246, + 247, + 248, + 249, + 250, + 251, + 252, + 253, + 254, + 255, + ], + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_mac_eol.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_mac_eol.snap index 451aae8765f973..50d87b93a57cc2 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_mac_eol.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_mac_eol.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..18, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..18, - value: Str( - StringConstant { - value: "text more text", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "text more text", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_unix_eol.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_unix_eol.snap index 451aae8765f973..50d87b93a57cc2 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_unix_eol.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_unix_eol.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..18, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..18, - value: Str( - StringConstant { - value: "text more text", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "text more text", + unicode: false, + implicit_concatenated: false, }, ), }, diff --git a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_windows_eol.snap b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_windows_eol.snap index 9b839986a3f559..fcee590ad5ca84 100644 --- a/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_windows_eol.snap +++ b/crates/ruff_python_parser/src/snapshots/ruff_python_parser__string__tests__string_parser_escaped_windows_eol.snap @@ -6,16 +6,12 @@ expression: parse_ast Expr( StmtExpr { range: 0..19, - value: Constant( - ExprConstant { + value: StringLiteral( + ExprStringLiteral { range: 0..19, - value: Str( - StringConstant { - value: "text more text", - unicode: false, - implicit_concatenated: false, - }, - ), + value: "text more text", + unicode: false, + implicit_concatenated: false, }, ), },