1.1 --- a/inspector.py Mon Nov 21 22:15:32 2016 +0100
1.2 +++ b/inspector.py Mon Nov 21 22:56:52 2016 +0100
1.3 @@ -169,6 +169,8 @@
1.4
1.5 "Process the individual node 'n'."
1.6
1.7 + path = self.get_namespace_path()
1.8 +
1.9 # Module global detection.
1.10
1.11 if isinstance(n, compiler.ast.Global):
1.12 @@ -225,10 +227,10 @@
1.13 # Assignments within non-Assign nodes.
1.14
1.15 elif isinstance(n, compiler.ast.AssName):
1.16 - self.process_assignment_node(n, None)
1.17 + raise InspectError("Name assignment appearing outside assignment statement.", path, n)
1.18
1.19 elif isinstance(n, compiler.ast.AssAttr):
1.20 - self.process_attribute_access(n)
1.21 + raise InspectError("Attribute assignment appearing outside assignment statement.", path, n)
1.22
1.23 # Accesses.
1.24
1.25 @@ -306,13 +308,13 @@
1.26 # Unsupported nodes.
1.27
1.28 elif isinstance(n, compiler.ast.GenExpr):
1.29 - raise InspectError("Generator expressions are not supported.", self.get_namespace_path(), n)
1.30 + raise InspectError("Generator expressions are not supported.", path, n)
1.31
1.32 elif isinstance(n, compiler.ast.IfExp):
1.33 - raise InspectError("If-else expressions are not supported.", self.get_namespace_path(), n)
1.34 + raise InspectError("If-else expressions are not supported.", path, n)
1.35
1.36 elif isinstance(n, compiler.ast.ListComp):
1.37 - raise InspectError("List comprehensions are not supported.", self.get_namespace_path(), n)
1.38 + raise InspectError("List comprehensions are not supported.", path, n)
1.39
1.40 # All other nodes are processed depth-first.
1.41
2.1 --- a/translator.py Mon Nov 21 22:15:32 2016 +0100
2.2 +++ b/translator.py Mon Nov 21 22:56:52 2016 +0100
2.3 @@ -480,15 +480,6 @@
2.4 for node in n.nodes:
2.5 self.process_assignment_node(node, n.expr)
2.6
2.7 - # Assignments within non-Assign nodes.
2.8 - # NOTE: Cover all possible nodes employing these.
2.9 -
2.10 - elif isinstance(n, compiler.ast.AssName):
2.11 - self.process_assignment_node(n, compiler.ast.Name("$temp"))
2.12 -
2.13 - elif isinstance(n, compiler.ast.AssAttr):
2.14 - self.process_attribute_access(n)
2.15 -
2.16 # Accesses.
2.17
2.18 elif isinstance(n, compiler.ast.Getattr):