mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-30 07:08:14 +00:00
Add multiline type alias tests with line continuations
This commit is contained in:
parent
7bbd80eb6c
commit
1622c8f2da
2 changed files with 80 additions and 0 deletions
|
@ -912,6 +912,14 @@ type X[T: (int, str), *Ts, **P] = (T, Ts, P)
|
|||
type type = int
|
||||
type match = int
|
||||
type case = int
|
||||
|
||||
# multine definitions
|
||||
type \
|
||||
X = int
|
||||
type X \
|
||||
= int
|
||||
type X = \
|
||||
int
|
||||
"#;
|
||||
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
|
||||
}
|
||||
|
|
|
@ -634,4 +634,76 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
),
|
||||
},
|
||||
),
|
||||
TypeAlias(
|
||||
StmtTypeAlias {
|
||||
range: 367..382,
|
||||
name: Name(
|
||||
ExprName {
|
||||
range: 375..376,
|
||||
id: Identifier(
|
||||
"X",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
type_params: [],
|
||||
value: Name(
|
||||
ExprName {
|
||||
range: 379..382,
|
||||
id: Identifier(
|
||||
"int",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
TypeAlias(
|
||||
StmtTypeAlias {
|
||||
range: 383..398,
|
||||
name: Name(
|
||||
ExprName {
|
||||
range: 388..389,
|
||||
id: Identifier(
|
||||
"X",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
type_params: [],
|
||||
value: Name(
|
||||
ExprName {
|
||||
range: 395..398,
|
||||
id: Identifier(
|
||||
"int",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
TypeAlias(
|
||||
StmtTypeAlias {
|
||||
range: 399..414,
|
||||
name: Name(
|
||||
ExprName {
|
||||
range: 404..405,
|
||||
id: Identifier(
|
||||
"X",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
type_params: [],
|
||||
value: Name(
|
||||
ExprName {
|
||||
range: 411..414,
|
||||
id: Identifier(
|
||||
"int",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue