mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-11 23:25:22 +00:00
Add test for type identifier assignment
This commit is contained in:
parent
8e5d0cc385
commit
4776f689ae
2 changed files with 27 additions and 0 deletions
|
@ -958,6 +958,7 @@ a = (
|
||||||
type (
|
type (
|
||||||
X = int
|
X = int
|
||||||
)
|
)
|
||||||
|
type = 1
|
||||||
"#;
|
"#;
|
||||||
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
|
insta::assert_debug_snapshot!(ast::Suite::parse(source, "<test>").unwrap());
|
||||||
}
|
}
|
||||||
|
|
|
@ -975,4 +975,30 @@ expression: "ast::Suite::parse(source, \"<test>\").unwrap()"
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
Assign(
|
||||||
|
StmtAssign {
|
||||||
|
range: 617..625,
|
||||||
|
targets: [
|
||||||
|
Name(
|
||||||
|
ExprName {
|
||||||
|
range: 617..621,
|
||||||
|
id: Identifier(
|
||||||
|
"type",
|
||||||
|
),
|
||||||
|
ctx: Store,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
value: Constant(
|
||||||
|
ExprConstant {
|
||||||
|
range: 624..625,
|
||||||
|
value: Int(
|
||||||
|
1,
|
||||||
|
),
|
||||||
|
kind: None,
|
||||||
|
},
|
||||||
|
),
|
||||||
|
type_comment: None,
|
||||||
|
},
|
||||||
|
),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue