File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed
Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -461,8 +461,7 @@ def test_var_annot_simple_exec(self):
461461 # exec('X: str', {}, CNS2())
462462 # self.assertEqual(nonloc_ns['__annotations__']['x'], str)
463463
464- # TODO: RUSTPYTHON
465- @unittest .expectedFailure
464+
466465 def test_var_annot_rhs (self ):
467466 ns = {}
468467 exec ('x: tuple = 1, 2' , ns )
Original file line number Diff line number Diff line change @@ -107,7 +107,7 @@ ExpressionStatement: ast::Statement = {
107107 }
108108 }
109109 },
110- <location:@L> <target:TestOrStarExprList> <op:AugAssign> <rhs:TestList > => {
110+ <location:@L> <target:TestOrStarExprList> <op:AugAssign> <rhs:TestListOrYieldExpr > => {
111111 ast::Statement {
112112 location,
113113 node: ast::StatementType::AugAssign {
@@ -117,23 +117,27 @@ ExpressionStatement: ast::Statement = {
117117 },
118118 }
119119 },
120- <location:@L> <target:Test> ":" <annotation:Test> <rhs:("=" Test) ?> => {
120+ <location:@L> <target:Test> ":" <annotation:Test> <rhs:AssignSuffix ?> => {
121121 ast::Statement {
122122 location,
123123 node: ast::StatementType::AnnAssign {
124124 target: Box::new(target),
125125 annotation: Box::new(annotation),
126- value: rhs.map(|e| e.1)
126+ value: rhs
127127 },
128128 }
129129 },
130130};
131131
132132AssignSuffix: ast::Expression = {
133- "=" <e:TestList> => e,
134- "=" <e:YieldExpr> => e,
133+ "=" <e:TestListOrYieldExpr> => e
135134};
136135
136+ TestListOrYieldExpr: ast::Expression = {
137+ TestList,
138+ YieldExpr
139+ }
140+
137141TestOrStarExprList: ast::Expression = {
138142 <location:@L> <elements:OneOrMore<TestOrStarExpr>> <comma:","?> => {
139143 if elements.len() == 1 && comma.is_none() {
You can’t perform that action at this time.
0 commit comments