# HG changeset patch # User Paul Boddie # Date 1479765412 -3600 # Node ID 793757c2cd670573874a59fd77b1db857b306f25 # Parent 19ecdbc79852ad1d3d12a3d325892641179bcfee Removed handling of stray assignment nodes. diff -r 19ecdbc79852 -r 793757c2cd67 inspector.py --- a/inspector.py Mon Nov 21 22:15:32 2016 +0100 +++ b/inspector.py Mon Nov 21 22:56:52 2016 +0100 @@ -169,6 +169,8 @@ "Process the individual node 'n'." + path = self.get_namespace_path() + # Module global detection. if isinstance(n, compiler.ast.Global): @@ -225,10 +227,10 @@ # Assignments within non-Assign nodes. elif isinstance(n, compiler.ast.AssName): - self.process_assignment_node(n, None) + raise InspectError("Name assignment appearing outside assignment statement.", path, n) elif isinstance(n, compiler.ast.AssAttr): - self.process_attribute_access(n) + raise InspectError("Attribute assignment appearing outside assignment statement.", path, n) # Accesses. @@ -306,13 +308,13 @@ # Unsupported nodes. elif isinstance(n, compiler.ast.GenExpr): - raise InspectError("Generator expressions are not supported.", self.get_namespace_path(), n) + raise InspectError("Generator expressions are not supported.", path, n) elif isinstance(n, compiler.ast.IfExp): - raise InspectError("If-else expressions are not supported.", self.get_namespace_path(), n) + raise InspectError("If-else expressions are not supported.", path, n) elif isinstance(n, compiler.ast.ListComp): - raise InspectError("List comprehensions are not supported.", self.get_namespace_path(), n) + raise InspectError("List comprehensions are not supported.", path, n) # All other nodes are processed depth-first. diff -r 19ecdbc79852 -r 793757c2cd67 translator.py --- a/translator.py Mon Nov 21 22:15:32 2016 +0100 +++ b/translator.py Mon Nov 21 22:56:52 2016 +0100 @@ -480,15 +480,6 @@ for node in n.nodes: self.process_assignment_node(node, n.expr) - # Assignments within non-Assign nodes. - # NOTE: Cover all possible nodes employing these. - - elif isinstance(n, compiler.ast.AssName): - self.process_assignment_node(n, compiler.ast.Name("$temp")) - - elif isinstance(n, compiler.ast.AssAttr): - self.process_attribute_access(n) - # Accesses. elif isinstance(n, compiler.ast.Getattr):