mirror of
https://github.com/RustPython/Parser.git
synced 2025-08-28 22:35:02 +00:00
Add test for parenthized multiline type as identifier
This commit is contained in:
parent
1622c8f2da
commit
e2e1c2b705
2 changed files with 42 additions and 0 deletions
|
@ -952,6 +952,9 @@ a = (
|
|||
a = (
|
||||
type(b)
|
||||
)
|
||||
type (
|
||||
X = int
|
||||
)
|
||||
"#;
|
||||
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
|
||||
}
|
||||
|
|
|
@ -936,4 +936,43 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
|||
type_comment: None,
|
||||
},
|
||||
),
|
||||
Expr(
|
||||
StmtExpr {
|
||||
range: 599..616,
|
||||
value: Call(
|
||||
ExprCall {
|
||||
range: 599..616,
|
||||
func: Name(
|
||||
ExprName {
|
||||
range: 599..603,
|
||||
id: Identifier(
|
||||
"type",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
args: [],
|
||||
keywords: [
|
||||
Keyword {
|
||||
range: 607..614,
|
||||
arg: Some(
|
||||
Identifier(
|
||||
"X",
|
||||
),
|
||||
),
|
||||
value: Name(
|
||||
ExprName {
|
||||
range: 611..614,
|
||||
id: Identifier(
|
||||
"int",
|
||||
),
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue