Move ExprConstant::kind to StringConstant::unicode (#7180)

This commit is contained in:
Dhruv Manilawala
2023-09-06 13:09:25 +05:30
committed by GitHub
parent 31990b8d3f
commit 04f2842e4f
119 changed files with 130 additions and 504 deletions

View File

@@ -623,7 +623,7 @@ StarPattern: ast::Pattern = {
ConstantAtom: ast::ParenthesizedExpr = {
<location:@L> <value:Constant> <end_location:@R> => ast::Expr::Constant(
ast::ExprConstant { value, kind: None, range: (location..end_location).into() }
ast::ExprConstant { value, range: (location..end_location).into() }
).into(),
}
@@ -716,17 +716,14 @@ MappingKey: ast::Expr = {
<e:AddOpExpr> => e.into(),
<location:@L> "None" <end_location:@R> => ast::ExprConstant {
value: ast::Constant::None,
kind: None,
range: (location..end_location).into()
}.into(),
<location:@L> "True" <end_location:@R> => ast::ExprConstant {
value: true.into(),
kind: None,
range: (location..end_location).into()
}.into(),
<location:@L> "False" <end_location:@R> => ast::ExprConstant {
value: false.into(),
kind: None,
range: (location..end_location).into()
}.into(),
<location:@L> <s:(@L string @R)+> =>? Ok(parse_strings(s)?),
@@ -1580,7 +1577,6 @@ Atom<Goal>: ast::ParenthesizedExpr = {
<location:@L> <s:(@L string @R)+> =>? Ok(parse_strings(s)?.into()),
<location:@L> <value:Constant> <end_location:@R> => ast::ExprConstant {
value,
kind: None,
range: (location..end_location).into(),
}.into(),
<location:@L> <id:Identifier> <end_location:@R> => ast::ExprName {
@@ -1671,10 +1667,10 @@ Atom<Goal>: ast::ParenthesizedExpr = {
generators,
range: (location..end_location).into(),
}.into(),
<location:@L> "True" <end_location:@R> => ast::ExprConstant { value: true.into(), kind: None, range: (location..end_location).into() }.into(),
<location:@L> "False" <end_location:@R> => ast::ExprConstant { value: false.into(), kind: None, range: (location..end_location).into() }.into(),
<location:@L> "None" <end_location:@R> => ast::ExprConstant { value: ast::Constant::None, kind: None, range: (location..end_location).into() }.into(),
<location:@L> "..." <end_location:@R> => ast::ExprConstant { value: ast::Constant::Ellipsis, kind: None, range: (location..end_location).into() }.into(),
<location:@L> "True" <end_location:@R> => ast::ExprConstant { value: true.into(), range: (location..end_location).into() }.into(),
<location:@L> "False" <end_location:@R> => ast::ExprConstant { value: false.into(), range: (location..end_location).into() }.into(),
<location:@L> "None" <end_location:@R> => ast::ExprConstant { value: ast::Constant::None, range: (location..end_location).into() }.into(),
<location:@L> "..." <end_location:@R> => ast::ExprConstant { value: ast::Constant::Ellipsis, range: (location..end_location).into() }.into(),
};
ListLiteralValues: Vec<ast::ParenthesizedExpr> = {

View File

@@ -1,5 +1,5 @@
// auto-generated: "lalrpop 0.20.0"
// sha3: 516ee93137b3322a578922c24eb95daee3078883fdfa0c097268e64b78fcc54f
// sha3: e8f3229288c1a13387ea6041355e2d8fe9ab788fbc7229032d2de92beb675944
use num_bigint::BigInt;
use ruff_text_size::{Ranged, TextSize};
use ruff_python_ast::{self as ast, IpyEscapeKind};
@@ -32376,7 +32376,7 @@ fn __action111<
) -> ast::ParenthesizedExpr
{
ast::Expr::Constant(
ast::ExprConstant { value, kind: None, range: (location..end_location).into() }
ast::ExprConstant { value, range: (location..end_location).into() }
).into()
}
@@ -32660,7 +32660,6 @@ fn __action129<
{
ast::ExprConstant {
value: ast::Constant::None,
kind: None,
range: (location..end_location).into()
}.into()
}
@@ -32677,7 +32676,6 @@ fn __action130<
{
ast::ExprConstant {
value: true.into(),
kind: None,
range: (location..end_location).into()
}.into()
}
@@ -32694,7 +32692,6 @@ fn __action131<
{
ast::ExprConstant {
value: false.into(),
kind: None,
range: (location..end_location).into()
}.into()
}
@@ -38353,7 +38350,6 @@ fn __action523<
{
ast::ExprConstant {
value,
kind: None,
range: (location..end_location).into(),
}.into()
}
@@ -38644,7 +38640,7 @@ fn __action537<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: true.into(), kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: true.into(), range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -38657,7 +38653,7 @@ fn __action538<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: false.into(), kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: false.into(), range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -38670,7 +38666,7 @@ fn __action539<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: ast::Constant::None, kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: ast::Constant::None, range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -38683,7 +38679,7 @@ fn __action540<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: ast::Constant::Ellipsis, kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: ast::Constant::Ellipsis, range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -39037,7 +39033,6 @@ fn __action566<
{
ast::ExprConstant {
value,
kind: None,
range: (location..end_location).into(),
}.into()
}
@@ -39302,7 +39297,7 @@ fn __action579<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: true.into(), kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: true.into(), range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -39315,7 +39310,7 @@ fn __action580<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: false.into(), kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: false.into(), range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -39328,7 +39323,7 @@ fn __action581<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: ast::Constant::None, kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: ast::Constant::None, range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]
@@ -39341,7 +39336,7 @@ fn __action582<
(_, end_location, _): (TextSize, TextSize, TextSize),
) -> ast::ParenthesizedExpr
{
ast::ExprConstant { value: ast::Constant::Ellipsis, kind: None, range: (location..end_location).into() }.into()
ast::ExprConstant { value: ast::Constant::Ellipsis, range: (location..end_location).into() }.into()
}
#[allow(unused_variables)]

View File

@@ -27,7 +27,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
),

View File

@@ -35,7 +35,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -44,7 +43,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -53,7 +51,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -24,7 +24,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -33,7 +32,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -42,7 +40,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -40,7 +40,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -49,7 +48,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -58,7 +56,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -45,7 +45,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -54,7 +53,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -63,7 +61,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -25,7 +25,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -34,7 +33,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -43,7 +41,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -22,7 +22,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -45,7 +45,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -54,7 +53,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -63,7 +61,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -46,7 +46,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -55,7 +54,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -64,7 +62,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -38,7 +38,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -47,7 +46,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -56,7 +54,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -40,7 +40,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -49,7 +48,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -58,7 +56,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -16,7 +16,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
optional_vars: Some(

View File

@@ -34,7 +34,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -43,7 +42,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -52,7 +50,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -20,7 +20,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -37,7 +37,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -46,7 +45,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
Constant(
@@ -55,7 +53,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],

View File

@@ -49,7 +49,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -71,7 +70,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),

View File

@@ -86,7 +86,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -108,7 +107,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),

View File

@@ -95,7 +95,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -117,7 +116,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),

View File

@@ -95,7 +95,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -117,7 +116,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),

View File

@@ -47,7 +47,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -69,7 +68,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),

View File

@@ -63,7 +63,6 @@ Ok(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -46,7 +46,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -68,7 +67,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),
@@ -83,7 +81,6 @@ Ok(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -17,7 +17,6 @@ Ok(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -88,7 +88,6 @@ Ok(
value: Int(
0,
),
kind: None,
},
),
},

View File

@@ -63,7 +63,6 @@ Ok(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -44,7 +44,6 @@ Ok(
value: Int(
20,
),
kind: None,
},
),
),
@@ -66,7 +65,6 @@ Ok(
value: Int(
30,
),
kind: None,
},
),
),
@@ -83,7 +81,6 @@ Ok(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -13,10 +13,10 @@ Dict(
value: Str(
StringConstant {
value: "a",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -28,10 +28,10 @@ Dict(
value: Str(
StringConstant {
value: "d",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -43,10 +43,10 @@ Dict(
value: Str(
StringConstant {
value: "b",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
Name(
@@ -62,10 +62,10 @@ Dict(
value: Str(
StringConstant {
value: "e",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -14,10 +14,10 @@ Call(
value: Str(
StringConstant {
value: " ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
attr: Identifier {
@@ -73,10 +73,10 @@ Call(
value: Str(
StringConstant {
value: "LIMIT %d",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
op: Mod,
@@ -93,7 +93,6 @@ Call(
ExprConstant {
range: 76..80,
value: None,
kind: None,
},
),
},
@@ -117,10 +116,10 @@ Call(
value: Str(
StringConstant {
value: "OFFSET %d",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
op: Mod,
@@ -137,7 +136,6 @@ Call(
ExprConstant {
range: 128..132,
value: None,
kind: None,
},
),
},

View File

@@ -227,7 +227,6 @@ Module(
value: Int(
5,
),
kind: None,
},
),
],

View File

@@ -17,10 +17,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "test",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -32,7 +32,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -105,10 +104,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "label",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -120,10 +119,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "test",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],
@@ -142,10 +141,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "label",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],
@@ -260,7 +259,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -274,7 +272,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -302,7 +299,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -338,7 +334,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -352,7 +347,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -380,7 +374,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -416,7 +409,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -444,7 +436,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},

View File

@@ -633,7 +633,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -670,7 +669,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -695,7 +693,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
2,
),
kind: None,
},
),
},
@@ -813,7 +810,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
12,
),
kind: None,
},
),
],

View File

@@ -1,6 +1,6 @@
---
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
expression: "parse_suite(source, \"<test>\").unwrap()"
---
[
Assign(
@@ -21,7 +21,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
123456789,
),
kind: None,
},
),
},
@@ -44,7 +43,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
123456,
),
kind: None,
},
),
},
@@ -67,7 +65,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
0.1,
),
kind: None,
},
),
},
@@ -90,7 +87,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
1.0,
),
kind: None,
},
),
},
@@ -113,7 +109,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
10.0,
),
kind: None,
},
),
},
@@ -136,7 +131,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
0.1,
),
kind: None,
},
),
},
@@ -159,7 +153,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
1.00000001,
),
kind: None,
},
),
},
@@ -182,7 +175,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
123456789.12345679,
),
kind: None,
},
),
},
@@ -205,7 +197,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
inf,
),
kind: None,
},
),
},
@@ -228,7 +219,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
inf,
),
kind: None,
},
),
},
@@ -252,7 +242,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
real: 0.0,
imag: 123456789.0,
},
kind: None,
},
),
},
@@ -276,7 +265,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
real: 0.0,
imag: 123456789.12345679,
},
kind: None,
},
),
},
@@ -299,7 +287,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
727756,
),
kind: None,
},
),
},
@@ -322,7 +309,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
11,
),
kind: None,
},
),
},
@@ -345,7 +331,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
511,
),
kind: None,
},
),
},
@@ -368,7 +353,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Float(
6e-9,
),
kind: None,
},
),
},
@@ -391,7 +375,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
10000,
),
kind: None,
},
),
},
@@ -414,7 +397,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
133333,
),
kind: None,
},
),
},

View File

@@ -27,7 +27,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
0.1,
),
kind: None,
},
),
attr: Identifier {
@@ -67,7 +66,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
1.0,
),
kind: None,
},
),
attr: Identifier {
@@ -100,7 +98,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
10.0,
),
kind: None,
},
),
attr: Identifier {
@@ -133,7 +130,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
0.1,
),
kind: None,
},
),
attr: Identifier {
@@ -169,7 +165,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
123456789.12345679,
),
kind: None,
},
),
attr: Identifier {
@@ -209,7 +204,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
inf,
),
kind: None,
},
),
attr: Identifier {
@@ -245,7 +239,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
inf,
),
kind: None,
},
),
attr: Identifier {
@@ -286,7 +279,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
real: 0.0,
imag: 123456789.0,
},
kind: None,
},
),
attr: Identifier {
@@ -323,7 +315,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
real: 0.0,
imag: 123456789.12345679,
},
kind: None,
},
),
attr: Identifier {
@@ -348,7 +339,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
11,
),
kind: None,
},
),
attr: Identifier {
@@ -396,7 +386,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
727756,
),
kind: None,
},
),
attr: Identifier {
@@ -439,7 +428,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
11,
),
kind: None,
},
),
attr: Identifier {
@@ -479,7 +467,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
511,
),
kind: None,
},
),
attr: Identifier {
@@ -515,7 +502,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Float(
6e-9,
),
kind: None,
},
),
attr: Identifier {
@@ -557,7 +543,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
real: 0.0,
imag: 100.0,
},
kind: None,
},
),
},
@@ -576,7 +561,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
10,
),
kind: None,
},
),
attr: Identifier {
@@ -594,7 +578,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 363..366,
value: Ellipsis,
kind: None,
},
),
},
@@ -624,7 +607,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
100,
),
kind: None,
},
),
slice: Name(
@@ -660,7 +642,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
100,
),
kind: None,
},
),
arguments: Arguments {

View File

@@ -325,7 +325,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -365,7 +364,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -439,7 +437,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -498,7 +495,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -549,7 +545,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},

View File

@@ -119,10 +119,10 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Str(
StringConstant {
value: "default",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),

View File

@@ -43,7 +43,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 26..29,
value: Ellipsis,
kind: None,
},
),
},
@@ -99,7 +98,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 73..76,
value: Ellipsis,
kind: None,
},
),
},
@@ -170,7 +168,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 135..138,
value: Ellipsis,
kind: None,
},
),
},
@@ -228,7 +225,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 178..181,
value: Ellipsis,
kind: None,
},
),
},
@@ -286,7 +282,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 220..223,
value: Ellipsis,
kind: None,
},
),
},
@@ -333,7 +328,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 258..261,
value: Ellipsis,
kind: None,
},
),
},
@@ -380,7 +374,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 293..296,
value: Ellipsis,
kind: None,
},
),
},

View File

@@ -84,7 +84,6 @@ ListComp(
value: Int(
5,
),
kind: None,
},
),
],
@@ -110,7 +109,6 @@ ListComp(
value: Int(
10,
),
kind: None,
},
),
],

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -43,7 +43,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 17..20,
value: Ellipsis,
kind: None,
},
),
},
@@ -123,7 +122,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 50..53,
value: Ellipsis,
kind: None,
},
),
},
@@ -211,7 +209,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 88..91,
value: Ellipsis,
kind: None,
},
),
},
@@ -314,7 +311,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 135..138,
value: Ellipsis,
kind: None,
},
),
},
@@ -387,7 +383,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 168..171,
value: Ellipsis,
kind: None,
},
),
},
@@ -491,7 +486,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
ExprConstant {
range: 227..230,
value: Ellipsis,
kind: None,
},
),
},

View File

@@ -12,7 +12,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
body: [
@@ -25,7 +24,6 @@ expression: parse_ast
value: Int(
10,
),
kind: None,
},
),
},
@@ -41,7 +39,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
),
@@ -55,7 +52,6 @@ expression: parse_ast
value: Int(
20,
),
kind: None,
},
),
},
@@ -75,7 +71,6 @@ expression: parse_ast
value: Int(
30,
),
kind: None,
},
),
},

View File

@@ -25,10 +25,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "positional",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],
@@ -47,7 +47,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},

View File

@@ -16,7 +16,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -32,7 +32,6 @@ GeneratorExp(
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -25,10 +25,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
Constant(
@@ -37,7 +37,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],

View File

@@ -25,10 +25,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -1,6 +1,6 @@
---
source: crates/ruff_python_parser/src/parser.rs
expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
expression: "parse_suite(source, \"<test>\").unwrap()"
---
[
Assign(
@@ -40,7 +40,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
4,
),
kind: None,
},
),
Constant(
@@ -49,7 +48,6 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
value: Int(
5,
),
kind: None,
},
),
],

View File

@@ -84,10 +84,10 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Str(
StringConstant {
value: "ForwardRefY",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -30,7 +30,6 @@ expression: parse_ast
real: 0.0,
imag: 0.0,
},
kind: None,
},
),
},
@@ -57,7 +56,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -130,7 +128,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -162,7 +159,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -174,7 +170,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
),
@@ -197,7 +192,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -215,7 +209,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -227,7 +220,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
),
@@ -250,7 +242,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -269,7 +260,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
cases: [
@@ -288,7 +278,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -302,7 +291,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -316,7 +304,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -330,7 +317,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
},
@@ -358,7 +344,6 @@ expression: parse_ast
value: Bool(
true,
),
kind: None,
},
),
},
@@ -398,7 +383,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -412,7 +396,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -433,7 +416,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -447,7 +429,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -478,7 +459,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -526,10 +506,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "seq",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -559,10 +539,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "map",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
),
@@ -596,7 +576,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -614,7 +593,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -628,7 +606,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -668,7 +645,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -691,7 +667,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -713,7 +688,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -727,7 +701,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -768,7 +741,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -800,7 +772,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -818,7 +789,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -832,7 +802,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -867,10 +836,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "X",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},
@@ -906,7 +875,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -941,7 +909,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -976,7 +943,6 @@ expression: parse_ast
value: Float(
0.25,
),
kind: None,
},
),
op: Add,
@@ -987,7 +953,6 @@ expression: parse_ast
real: 0.0,
imag: 1.75,
},
kind: None,
},
),
},
@@ -1014,7 +979,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1051,7 +1015,6 @@ expression: parse_ast
real: 0.0,
imag: 0.0,
},
kind: None,
},
),
},
@@ -1078,7 +1041,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1097,7 +1059,6 @@ expression: parse_ast
value: Int(
4,
),
kind: None,
},
),
cases: [
@@ -1116,7 +1077,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1130,7 +1090,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1144,7 +1103,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -1158,7 +1116,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
},
@@ -1186,7 +1143,6 @@ expression: parse_ast
value: Bool(
true,
),
kind: None,
},
),
},
@@ -1218,7 +1174,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1251,7 +1206,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1284,7 +1238,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -1298,7 +1251,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1327,7 +1279,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1346,7 +1297,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -1360,7 +1310,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1389,7 +1338,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1431,7 +1379,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -1497,7 +1444,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1529,7 +1475,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1554,7 +1499,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1572,7 +1516,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1597,7 +1540,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1630,10 +1572,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "foo",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],
@@ -1695,7 +1637,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
Constant(
@@ -1704,7 +1645,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -1713,7 +1653,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],
@@ -1736,7 +1675,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1750,7 +1688,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1775,7 +1712,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -1803,7 +1739,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1839,7 +1774,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1867,7 +1801,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1889,7 +1822,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1903,7 +1835,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -1943,7 +1874,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
),
@@ -1975,7 +1905,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -1997,7 +1926,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -2011,7 +1939,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2039,7 +1966,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -2119,7 +2045,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2158,7 +2083,6 @@ expression: parse_ast
value: Float(
0.25,
),
kind: None,
},
),
},
@@ -2171,7 +2095,6 @@ expression: parse_ast
real: 0.0,
imag: 1.75,
},
kind: None,
},
),
},
@@ -2198,7 +2121,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2268,7 +2190,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2353,7 +2274,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2402,7 +2322,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2434,7 +2353,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2459,7 +2377,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2510,7 +2427,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2559,7 +2475,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2581,10 +2496,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},
@@ -2612,7 +2527,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -2630,10 +2544,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},
@@ -2658,7 +2572,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -2713,7 +2626,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2798,7 +2710,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2838,7 +2749,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -2865,7 +2775,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -2892,7 +2801,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -2941,7 +2849,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -2969,7 +2876,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3002,7 +2908,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -3020,7 +2925,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -3034,7 +2938,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -3074,7 +2977,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3097,7 +2999,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -3119,7 +3020,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -3133,7 +3033,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -3174,7 +3073,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -3206,7 +3104,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
],
@@ -3224,7 +3121,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -3238,7 +3134,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -3273,10 +3168,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "X",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},
@@ -3312,7 +3207,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -3347,7 +3241,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -3370,7 +3263,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
Constant(
@@ -3379,7 +3271,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -3388,7 +3279,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],
@@ -3411,7 +3301,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3450,7 +3339,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3473,7 +3361,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
Constant(
@@ -3482,7 +3369,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
Constant(
@@ -3491,7 +3377,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],
@@ -3525,7 +3410,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
},
@@ -3553,7 +3437,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3615,7 +3498,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3704,7 +3586,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},
@@ -3791,7 +3672,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
},

View File

@@ -22,7 +22,6 @@ Subscript(
value: Int(
1,
),
kind: None,
},
),
),
@@ -33,7 +32,6 @@ Subscript(
value: Int(
2,
),
kind: None,
},
),
),
@@ -44,7 +42,6 @@ Subscript(
value: Int(
3,
),
kind: None,
},
),
),

View File

@@ -35,7 +35,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
Starred(
@@ -61,7 +60,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -99,7 +97,6 @@ expression: parse_ast
value: Int(
0,
),
kind: None,
},
),
Starred(
@@ -125,7 +122,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
},
@@ -226,7 +222,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
),
@@ -237,7 +232,6 @@ expression: parse_ast
value: Int(
5,
),
kind: None,
},
),
),

View File

@@ -30,7 +30,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -89,10 +88,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "caught ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -187,10 +186,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "caught ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -30,10 +30,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "eg",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
List(
@@ -59,7 +59,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
],
@@ -86,7 +85,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],
@@ -113,7 +111,6 @@ expression: parse_ast
value: Int(
3,
),
kind: None,
},
),
],
@@ -140,7 +137,6 @@ expression: parse_ast
value: Int(
4,
),
kind: None,
},
),
],
@@ -208,10 +204,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "caught ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -253,10 +249,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: " with nested ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -343,10 +339,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "caught ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -388,10 +384,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: " with nested ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -633,7 +633,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -749,7 +748,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
12,
),
kind: None,
},
),
],
@@ -928,7 +926,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -958,7 +955,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -988,7 +984,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},

View File

@@ -80,7 +80,6 @@ expression: parse_ast
ExprConstant {
range: 46..49,
value: Ellipsis,
kind: None,
},
),
},

View File

@@ -16,7 +16,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: None,
@@ -44,7 +43,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -80,7 +78,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: None,
@@ -93,7 +90,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
optional_vars: None,
@@ -121,7 +117,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -142,7 +137,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
optional_vars: Some(
@@ -181,7 +175,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
body: Constant(
@@ -190,7 +183,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
orelse: Constant(
@@ -199,7 +191,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
2,
),
kind: None,
},
),
},
@@ -232,7 +223,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
body: Constant(
@@ -241,7 +231,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
orelse: Constant(
@@ -250,7 +239,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
2,
),
kind: None,
},
),
},
@@ -348,7 +336,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: None,
@@ -376,7 +363,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -412,7 +398,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: None,
@@ -444,7 +429,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
],
@@ -484,7 +468,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: None,
@@ -497,7 +480,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
optional_vars: None,
@@ -529,7 +511,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
Constant(
@@ -538,7 +519,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
],
@@ -670,7 +650,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
Starred(
@@ -719,7 +698,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
Starred(
@@ -782,7 +760,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -822,7 +799,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -874,7 +850,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -895,7 +870,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -943,7 +917,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
},
@@ -964,7 +937,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
},
@@ -1006,7 +978,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -1042,7 +1013,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -1078,7 +1048,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -1099,7 +1068,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
optional_vars: Some(
@@ -1135,7 +1103,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
0,
),
kind: None,
},
),
optional_vars: Some(
@@ -1156,7 +1123,6 @@ expression: "parse_suite(source, \"<test>\").unwrap()"
value: Int(
1,
),
kind: None,
},
),
optional_vars: Some(

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{8}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{7}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\r",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{89}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{7f}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -272,7 +272,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{1b}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -26,7 +26,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -21,7 +21,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{c}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "aaa",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -43,10 +43,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "ccc",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -70,10 +70,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "eee",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\\",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\n",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\\\n",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -9,10 +9,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "mix ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(
@@ -41,10 +41,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: " with text and ",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -31,10 +31,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: ">10",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\n",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
FormattedValue(

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "\u{88}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
],

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
],

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
FormattedValue(
@@ -31,10 +31,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "!",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
debug_text: None,

View File

@@ -16,10 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
FormattedValue(
@@ -31,10 +31,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "!",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
debug_text: None,
@@ -48,10 +48,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "again!",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
],

View File

@@ -39,10 +39,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "{foo}",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
]

View File

@@ -15,7 +15,6 @@ expression: parse_ast
value: Int(
42,
),
kind: None,
},
),
ops: [
@@ -28,7 +27,6 @@ expression: parse_ast
value: Int(
42,
),
kind: None,
},
),
],

View File

@@ -29,10 +29,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
debug_text: None,

View File

@@ -29,10 +29,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
debug_text: None,

View File

@@ -15,7 +15,6 @@ expression: parse_ast
value: Int(
1,
),
kind: None,
},
),
ops: [
@@ -28,7 +27,6 @@ expression: parse_ast
value: Int(
2,
),
kind: None,
},
),
],

View File

@@ -26,10 +26,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "spec",
unicode: false,
implicit_concatenated: false,
},
),
kind: None,
},
),
],

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
},

View File

@@ -12,12 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello, world!",
unicode: true,
implicit_concatenated: false,
},
),
kind: Some(
"u",
),
},
),
},

View File

@@ -16,12 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: true,
implicit_concatenated: true,
},
),
kind: Some(
"u",
),
},
),
],

View File

@@ -16,12 +16,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world!",
unicode: true,
implicit_concatenated: true,
},
),
kind: Some(
"u",
),
},
),
],

View File

@@ -12,10 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: false,
implicit_concatenated: true,
},
),
kind: None,
},
),
},

View File

@@ -12,12 +12,10 @@ expression: parse_ast
value: Str(
StringConstant {
value: "Hello world",
unicode: true,
implicit_concatenated: true,
},
),
kind: Some(
"u",
),
},
),
},

View File

@@ -20,7 +20,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -18,7 +18,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -272,7 +272,6 @@ expression: parse_ast
implicit_concatenated: false,
},
),
kind: None,
},
),
},

View File

@@ -386,7 +386,6 @@ impl<'a> StringParser<'a> {
if !constant_piece.is_empty() {
spec_constructor.push(Expr::from(ast::ExprConstant {
value: std::mem::take(&mut constant_piece).into(),
kind: None,
range: self.range(start_location),
}));
}
@@ -407,7 +406,6 @@ impl<'a> StringParser<'a> {
if !constant_piece.is_empty() {
spec_constructor.push(Expr::from(ast::ExprConstant {
value: std::mem::take(&mut constant_piece).into(),
kind: None,
range: self.range(start_location),
}));
}
@@ -445,7 +443,6 @@ impl<'a> StringParser<'a> {
if !content.is_empty() {
values.push(Expr::from(ast::ExprConstant {
value: std::mem::take(&mut content).into(),
kind: None,
range: self.range(start_location),
}));
}
@@ -480,7 +477,6 @@ impl<'a> StringParser<'a> {
if !content.is_empty() {
values.push(Expr::from(ast::ExprConstant {
value: content.into(),
kind: None,
range: self.range(start_location),
}));
}
@@ -512,7 +508,6 @@ impl<'a> StringParser<'a> {
Ok(Expr::from(ast::ExprConstant {
value: content.chars().map(|c| c as u8).collect::<Vec<u8>>().into(),
kind: None,
range: self.range(start_location),
}))
}
@@ -529,8 +524,11 @@ impl<'a> StringParser<'a> {
}
}
Ok(Expr::from(ast::ExprConstant {
value: value.into(),
kind: self.kind.is_unicode().then(|| "u".to_string()),
value: ast::Constant::Str(ast::StringConstant {
value,
unicode: self.kind.is_unicode(),
implicit_concatenated: false,
}),
range: self.range(start_location),
}))
}
@@ -566,7 +564,7 @@ pub(crate) fn parse_strings(
// Preserve the initial location and kind.
let initial_start = values[0].0;
let last_end = values.last().unwrap().2;
let initial_kind = (values[0].1 .1 == StringKind::Unicode).then(|| "u".to_owned());
let is_initial_kind_unicode = values[0].1 .1 == StringKind::Unicode;
let has_fstring = values
.iter()
.any(|(_, (_, kind, ..), _)| kind.is_any_fstring());
@@ -604,7 +602,6 @@ pub(crate) fn parse_strings(
value: content,
implicit_concatenated,
}),
kind: None,
range: TextRange::new(initial_start, last_end),
}
.into());
@@ -626,9 +623,9 @@ pub(crate) fn parse_strings(
return Ok(ast::ExprConstant {
value: Constant::Str(StringConstant {
value: content.join(""),
unicode: is_initial_kind_unicode,
implicit_concatenated,
}),
kind: initial_kind,
range: TextRange::new(initial_start, last_end),
}
.into());
@@ -644,9 +641,9 @@ pub(crate) fn parse_strings(
Expr::Constant(ast::ExprConstant {
value: Constant::Str(StringConstant {
value: current.drain(..).collect::<String>(),
unicode: is_initial_kind_unicode,
implicit_concatenated,
}),
kind: initial_kind.clone(),
range: TextRange::new(start, end),
})
};