Fix range field order

This commit is contained in:
Jeong YunWon 2023-05-18 20:19:54 +09:00
parent 6a85b99240
commit 957eaa5a19
35 changed files with 188 additions and 188 deletions

View file

@ -471,10 +471,10 @@ class StructVisitor(EmitVisitor):
self.emit_attrs(depth)
self.emit(f"pub struct {product_name}<R = TextRange> {{", depth)
self.emit_range(product.attributes, depth + 1)
for f in product.fields:
self.visit(f, type_info, "pub ", depth + 1)
assert bool(product.attributes) == type_info.no_cfg(self.type_info)
self.emit_range(product.attributes, depth + 1)
self.emit("}", depth)
field_names = [f'"{f.name}"' for f in product.fields]

View file

@ -2047,11 +2047,11 @@ impl Node for Cmpop {
#[derive(Clone, Debug, PartialEq)]
pub struct Comprehension<R = TextRange> {
pub range: OptionalRange<R>,
pub target: Expr<R>,
pub iter: Expr<R>,
pub ifs: Vec<Expr<R>>,
pub is_async: bool,
pub range: OptionalRange<R>,
}
impl<R> Node for Comprehension<R> {
@ -2089,6 +2089,7 @@ impl<R> Node for Excepthandler<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct Arguments<R = TextRange> {
pub range: OptionalRange<R>,
pub posonlyargs: Vec<Arg<R>>,
pub args: Vec<Arg<R>>,
pub vararg: Option<Box<Arg<R>>>,
@ -2096,7 +2097,6 @@ pub struct Arguments<R = TextRange> {
pub kw_defaults: Vec<Expr<R>>,
pub kwarg: Option<Box<Arg<R>>>,
pub defaults: Vec<Expr<R>>,
pub range: OptionalRange<R>,
}
impl<R> Node for Arguments<R> {
@ -2114,10 +2114,10 @@ impl<R> Node for Arguments<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct Arg<R = TextRange> {
pub range: R,
pub arg: Identifier,
pub annotation: Option<Box<Expr<R>>>,
pub type_comment: Option<String>,
pub range: R,
}
impl<R> Node for Arg<R> {
@ -2127,9 +2127,9 @@ impl<R> Node for Arg<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct Keyword<R = TextRange> {
pub range: R,
pub arg: Option<Identifier>,
pub value: Expr<R>,
pub range: R,
}
impl<R> Node for Keyword<R> {
@ -2139,9 +2139,9 @@ impl<R> Node for Keyword<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct Alias<R = TextRange> {
pub range: R,
pub name: Identifier,
pub asname: Option<Identifier>,
pub range: R,
}
impl<R> Node for Alias<R> {
@ -2151,9 +2151,9 @@ impl<R> Node for Alias<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct Withitem<R = TextRange> {
pub range: OptionalRange<R>,
pub context_expr: Expr<R>,
pub optional_vars: Option<Box<Expr<R>>>,
pub range: OptionalRange<R>,
}
impl<R> Node for Withitem<R> {
@ -2163,10 +2163,10 @@ impl<R> Node for Withitem<R> {
#[derive(Clone, Debug, PartialEq)]
pub struct MatchCase<R = TextRange> {
pub range: OptionalRange<R>,
pub pattern: Pattern<R>,
pub guard: Option<Box<Expr<R>>>,
pub body: Vec<Stmt<R>>,
pub range: OptionalRange<R>,
}
impl<R> Node for MatchCase<R> {

View file

@ -31,6 +31,7 @@ expression: parse_ast
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 11..12,
@ -77,7 +78,6 @@ expression: parse_ast
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -31,6 +31,7 @@ expression: parse_ast
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 11..12,
@ -77,7 +78,6 @@ expression: parse_ast
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -8,6 +8,7 @@ expression: parse_ast
range: 0..17,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 5..6,
@ -28,7 +29,6 @@ expression: parse_ast
},
),
),
range: (),
},
],
body: [

View file

@ -11,39 +11,39 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Arg {
range: 9..10,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 12..13,
},
Arg {
range: 15..16,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 15..16,
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,33 +11,34 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Arg {
range: 9..10,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 12..13,
},
Arg {
range: 18..19,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 18..19,
},
],
kw_defaults: [
@ -62,7 +63,6 @@ Ok(
],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,6 +11,7 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
@ -18,7 +19,6 @@ Ok(
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,64 +11,64 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 12..13,
},
],
vararg: None,
kwonlyargs: [
Arg {
range: 18..19,
arg: Identifier(
"d",
),
annotation: None,
type_comment: None,
range: 18..19,
},
Arg {
range: 21..22,
arg: Identifier(
"e",
),
annotation: None,
type_comment: None,
range: 21..22,
},
Arg {
range: 24..25,
arg: Identifier(
"f",
),
annotation: None,
type_comment: None,
range: 24..25,
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,58 +11,59 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 12..13,
},
],
vararg: None,
kwonlyargs: [
Arg {
range: 18..19,
arg: Identifier(
"d",
),
annotation: None,
type_comment: None,
range: 18..19,
},
Arg {
range: 21..22,
arg: Identifier(
"e",
),
annotation: None,
type_comment: None,
range: 21..22,
},
Arg {
range: 27..28,
arg: Identifier(
"f",
),
annotation: None,
type_comment: None,
range: 27..28,
},
],
kw_defaults: [
@ -87,7 +88,6 @@ Ok(
],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,67 +11,68 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 12..13,
},
],
vararg: Some(
Arg {
range: 16..20,
arg: Identifier(
"args",
),
annotation: None,
type_comment: None,
range: 16..20,
},
),
kwonlyargs: [
Arg {
range: 22..23,
arg: Identifier(
"d",
),
annotation: None,
type_comment: None,
range: 22..23,
},
Arg {
range: 25..26,
arg: Identifier(
"e",
),
annotation: None,
type_comment: None,
range: 25..26,
},
Arg {
range: 31..32,
arg: Identifier(
"f",
),
annotation: None,
type_comment: None,
range: 31..32,
},
],
kw_defaults: [
@ -96,7 +97,6 @@ Ok(
],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,67 +11,68 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 12..13,
},
],
vararg: Some(
Arg {
range: 16..20,
arg: Identifier(
"args",
),
annotation: None,
type_comment: None,
range: 16..20,
},
),
kwonlyargs: [
Arg {
range: 22..23,
arg: Identifier(
"d",
),
annotation: None,
type_comment: None,
range: 22..23,
},
Arg {
range: 25..26,
arg: Identifier(
"e",
),
annotation: None,
type_comment: None,
range: 25..26,
},
Arg {
range: 31..32,
arg: Identifier(
"f",
),
annotation: None,
type_comment: None,
range: 31..32,
},
],
kw_defaults: [
@ -96,16 +97,15 @@ Ok(
],
kwarg: Some(
Arg {
range: 39..45,
arg: Identifier(
"kwargs",
),
annotation: None,
type_comment: None,
range: 39..45,
},
),
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,31 +11,32 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 12..13,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 12..13,
},
],
vararg: None,
@ -43,7 +44,6 @@ Ok(
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(

View file

@ -11,31 +11,32 @@ Ok(
"f",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 6..7,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 6..7,
},
Arg {
range: 9..10,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 9..10,
},
Arg {
range: 15..16,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 15..16,
},
],
vararg: None,
@ -62,7 +63,6 @@ Ok(
},
),
],
range: (),
},
body: [
Pass(

View file

@ -11,39 +11,39 @@ Ok(
ExprLambda {
range: 0..20,
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Arg {
range: 10..11,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 10..11,
},
Arg {
range: 13..14,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 13..14,
},
Arg {
range: 16..17,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 16..17,
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -11,33 +11,34 @@ Ok(
ExprLambda {
range: 0..26,
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Arg {
range: 10..11,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 10..11,
},
Arg {
range: 13..14,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 13..14,
},
Arg {
range: 19..20,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 19..20,
},
],
kw_defaults: [
@ -62,7 +63,6 @@ Ok(
],
kwarg: None,
defaults: [],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -11,6 +11,7 @@ Ok(
ExprLambda {
range: 0..9,
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: None,
@ -18,7 +19,6 @@ Ok(
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -11,56 +11,56 @@ Ok(
ExprLambda {
range: 0..26,
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 7..8,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 7..8,
},
Arg {
range: 10..11,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 10..11,
},
Arg {
range: 13..14,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 13..14,
},
],
vararg: None,
kwonlyargs: [
Arg {
range: 19..20,
arg: Identifier(
"d",
),
annotation: None,
type_comment: None,
range: 19..20,
},
Arg {
range: 22..23,
arg: Identifier(
"e",
),
annotation: None,
type_comment: None,
range: 22..23,
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -11,31 +11,32 @@ Ok(
ExprLambda {
range: 0..17,
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 7..8,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 7..8,
},
Arg {
range: 10..11,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 10..11,
},
Arg {
range: 13..14,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 13..14,
},
],
vararg: None,
@ -43,7 +44,6 @@ Ok(
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -11,31 +11,32 @@ Ok(
ExprLambda {
range: 0..23,
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 7..8,
arg: Identifier(
"a",
),
annotation: None,
type_comment: None,
range: 7..8,
},
Arg {
range: 10..11,
arg: Identifier(
"b",
),
annotation: None,
type_comment: None,
range: 10..11,
},
Arg {
range: 16..17,
arg: Identifier(
"c",
),
annotation: None,
type_comment: None,
range: 16..17,
},
],
vararg: None,
@ -62,7 +63,6 @@ Ok(
},
),
],
range: (),
},
body: Constant(
ExprConstant {

View file

@ -38,6 +38,7 @@ Call(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 26..29,
@ -147,7 +148,6 @@ Call(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -37,6 +37,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 29..52,
@ -83,7 +84,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -122,6 +122,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 108..155,
@ -217,7 +218,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -236,6 +236,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 196..203,
@ -300,7 +301,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -319,6 +319,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 237..244,
@ -383,7 +384,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -402,6 +402,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 278..282,
@ -452,7 +453,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},

View file

@ -712,6 +712,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 549..550,
@ -734,9 +735,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 566..567,
@ -759,7 +760,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -782,15 +782,16 @@ expression: parse_ast
ExprLambda {
range: 590..618,
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 597..602,
arg: Identifier(
"query",
),
annotation: None,
type_comment: None,
range: 597..602,
},
],
vararg: None,
@ -798,7 +799,6 @@ expression: parse_ast
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: Compare(
ExprCompare {

View file

@ -38,15 +38,16 @@ expression: "parse_program(source, \"<test>\").unwrap()"
"__init__",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 31..35,
arg: Identifier(
"self",
),
annotation: None,
type_comment: None,
range: 31..35,
},
],
vararg: None,
@ -54,7 +55,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Pass(
@ -75,23 +75,24 @@ expression: "parse_program(source, \"<test>\").unwrap()"
"method_with_default",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 70..74,
arg: Identifier(
"self",
),
annotation: None,
type_comment: None,
range: 70..74,
},
Arg {
range: 76..79,
arg: Identifier(
"arg",
),
annotation: None,
type_comment: None,
range: 76..79,
},
],
vararg: None,
@ -109,7 +110,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
],
range: (),
},
body: [
Pass(

View file

@ -25,6 +25,7 @@ DictComp(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 12..13,
@ -45,7 +46,6 @@ DictComp(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -16,6 +16,7 @@ ListComp(
),
generators: [
Comprehension {
range: (),
target: Tuple(
ExprTuple {
range: 7..12,
@ -53,9 +54,9 @@ ListComp(
),
ifs: [],
is_async: false,
range: (),
},
Comprehension {
range: (),
target: Name(
ExprName {
range: 22..23,
@ -133,7 +134,6 @@ ListComp(
),
],
is_async: false,
range: (),
},
],
},

View file

@ -16,6 +16,7 @@ GeneratorExp(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 7..8,
@ -36,7 +37,6 @@ GeneratorExp(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -39,6 +39,7 @@ GeneratorExp(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 19..20,
@ -59,7 +60,6 @@ GeneratorExp(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -31,6 +31,7 @@ expression: parse_ast
],
keywords: [
Keyword {
range: 22..31,
arg: Some(
Identifier(
"keyword",
@ -45,7 +46,6 @@ expression: parse_ast
kind: None,
},
),
range: 22..31,
},
],
},

View file

@ -10,23 +10,24 @@ expression: parse_ast
ExprLambda {
range: 0..18,
args: Arguments {
range: (),
posonlyargs: [],
args: [
Arg {
range: 7..8,
arg: Identifier(
"x",
),
annotation: None,
type_comment: None,
range: 7..8,
},
Arg {
range: 10..11,
arg: Identifier(
"y",
),
annotation: None,
type_comment: None,
range: 10..11,
},
],
vararg: None,
@ -34,7 +35,6 @@ expression: parse_ast
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: BinOp(
ExprBinOp {

View file

@ -16,6 +16,7 @@ ListComp(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 7..8,
@ -36,7 +37,6 @@ ListComp(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -45,6 +45,7 @@ GeneratorExp(
),
generators: [
Comprehension {
range: (),
target: Name(
ExprName {
range: 16..17,
@ -65,7 +66,6 @@ GeneratorExp(
),
ifs: [],
is_async: false,
range: (),
},
],
},

View file

@ -17,6 +17,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 85..88,
@ -67,7 +68,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -86,6 +86,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchClass(
PatternMatchClass {
range: 144..152,
@ -144,7 +145,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -163,6 +163,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 208..209,
@ -216,9 +217,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 239..240,
@ -272,7 +273,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -291,6 +291,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 301..314,
@ -383,7 +384,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -402,6 +402,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 373..388,
@ -508,7 +509,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -527,6 +527,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 463..467,
@ -559,9 +560,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 499..501,
@ -589,7 +590,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -608,6 +608,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 564..579,
@ -699,9 +700,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 604..672,
@ -937,9 +938,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 697..699,
@ -975,7 +976,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -994,6 +994,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 755..767,
@ -1053,7 +1054,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1072,6 +1072,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 823..826,
@ -1122,7 +1123,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1141,6 +1141,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 882..895,
@ -1233,7 +1234,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1252,6 +1252,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 954..955,
@ -1305,7 +1306,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1324,6 +1324,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 1016..1022,
@ -1386,9 +1387,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 1047..1053,
@ -1451,9 +1452,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 1078..1083,
@ -1495,7 +1496,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1521,6 +1521,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1143..1147,
@ -1563,7 +1564,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1582,6 +1582,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 1203..1204,
@ -1625,9 +1626,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 1229..1230,
@ -1671,7 +1672,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1690,6 +1690,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 1286..1298,
@ -1749,7 +1750,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1794,6 +1794,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1364..1377,
@ -1882,7 +1883,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -1901,6 +1901,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1433..1436,
@ -1951,9 +1952,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1461..1467,
@ -2066,9 +2067,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1508..1514,
@ -2133,7 +2134,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2152,6 +2152,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1570..1580,
@ -2216,7 +2217,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2235,6 +2235,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 1636..1649,
@ -2300,7 +2301,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2327,6 +2327,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 1708..1711,
@ -2374,7 +2375,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2393,6 +2393,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 1767..1774,
@ -2463,7 +2464,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2482,6 +2482,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSingleton(
PatternMatchSingleton {
range: 1830..1834,
@ -2517,7 +2518,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2536,6 +2536,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 1890..1891,
@ -2579,7 +2580,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2598,6 +2598,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSingleton(
PatternMatchSingleton {
range: 1947..1952,
@ -2635,7 +2636,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2654,6 +2654,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2008..2010,
@ -2689,9 +2690,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2035..2039,
@ -2742,9 +2743,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchValue(
PatternMatchValue {
range: 2064..2066,
@ -2788,7 +2789,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2807,6 +2807,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchAs(
PatternMatchAs {
range: 2122..2123,
@ -2847,7 +2848,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2866,6 +2866,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2179..2192,
@ -2934,7 +2935,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -2953,6 +2953,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 2248..2278,
@ -3111,7 +3112,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3130,6 +3130,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchMapping(
PatternMatchMapping {
range: 2348..2363,
@ -3221,9 +3222,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchOr(
PatternMatchOr {
range: 2388..2457,
@ -3459,9 +3460,9 @@ expression: parse_ast
},
),
],
range: (),
},
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2482..2484,
@ -3497,7 +3498,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3542,6 +3542,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2548..2553,
@ -3602,7 +3603,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3647,6 +3647,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2617..2623,
@ -3707,7 +3708,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3726,6 +3726,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2680..2682,
@ -3773,7 +3774,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3809,6 +3809,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2741..2745,
@ -3867,7 +3868,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},
@ -3900,6 +3900,7 @@ expression: parse_ast
),
cases: [
MatchCase {
range: (),
pattern: MatchSequence(
PatternMatchSequence {
range: 2807..2814,
@ -3959,7 +3960,6 @@ expression: parse_ast
},
),
],
range: (),
},
],
},

View file

@ -10,10 +10,12 @@ expression: parse_ast
"args_to_tuple",
),
args: Arguments {
range: (),
posonlyargs: [],
args: [],
vararg: Some(
Arg {
range: 20..29,
arg: Identifier(
"args",
),
@ -35,14 +37,12 @@ expression: parse_ast
),
),
type_comment: None,
range: 20..29,
},
),
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
range: (),
},
body: [
Expr(

View file

@ -8,6 +8,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 0..12,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 5..6,
@ -18,7 +19,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -36,6 +36,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 13..30,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 18..19,
@ -56,7 +57,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -74,6 +74,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 31..46,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 36..37,
@ -84,9 +85,9 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 39..40,
@ -97,7 +98,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -115,6 +115,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 47..72,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 52..53,
@ -135,9 +136,9 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 60..61,
@ -158,7 +159,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -176,6 +176,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 73..97,
items: [
Withitem {
range: (),
context_expr: IfExp(
ExprIfExp {
range: 78..91,
@ -209,7 +210,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -227,6 +227,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 98..127,
items: [
Withitem {
range: (),
context_expr: IfExp(
ExprIfExp {
range: 103..116,
@ -270,7 +271,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -288,6 +288,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 128..141,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 133..135,
@ -296,7 +297,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -314,6 +314,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 142..160,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 147..149,
@ -332,7 +333,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -350,6 +350,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 161..175,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 167..168,
@ -360,7 +361,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -378,6 +378,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 176..195,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 182..183,
@ -398,7 +399,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -416,6 +416,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 196..211,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 202..203,
@ -426,7 +427,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -444,6 +444,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 212..232,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 217..221,
@ -472,7 +473,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -490,6 +490,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 233..250,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 239..240,
@ -500,9 +501,9 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 242..243,
@ -513,7 +514,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -531,6 +531,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 251..273,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 256..262,
@ -568,7 +569,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -586,6 +586,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 274..290,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 279..284,
@ -610,7 +611,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -628,6 +628,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 291..312,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 296..301,
@ -662,7 +663,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -680,6 +680,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 313..331,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 318..325,
@ -713,7 +714,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -731,6 +731,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 332..355,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 337..344,
@ -774,7 +775,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -792,6 +792,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 356..375,
items: [
Withitem {
range: (),
context_expr: NamedExpr(
ExprNamedExpr {
range: 362..368,
@ -816,7 +817,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -834,6 +834,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 376..400,
items: [
Withitem {
range: (),
context_expr: NamedExpr(
ExprNamedExpr {
range: 382..388,
@ -868,7 +869,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -886,6 +886,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 401..428,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 406..422,
@ -941,7 +942,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
optional_vars: None,
range: (),
},
],
body: [
@ -959,6 +959,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 429..461,
items: [
Withitem {
range: (),
context_expr: Tuple(
ExprTuple {
range: 434..450,
@ -1024,7 +1025,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -1042,6 +1042,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 462..481,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 468..469,
@ -1062,7 +1063,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -1080,6 +1080,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 482..502,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 488..489,
@ -1100,7 +1101,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -1118,6 +1118,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 503..530,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 509..510,
@ -1138,9 +1139,9 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 517..518,
@ -1161,7 +1162,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [
@ -1179,6 +1179,7 @@ expression: "parse_program(source, \"<test>\").unwrap()"
range: 531..559,
items: [
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 537..538,
@ -1199,9 +1200,9 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
Withitem {
range: (),
context_expr: Constant(
ExprConstant {
range: 545..546,
@ -1222,7 +1223,6 @@ expression: "parse_program(source, \"<test>\").unwrap()"
},
),
),
range: (),
},
],
body: [