Skip to content

Commit

Permalink
fix test "tests/functions/and.py" and others that were failing becaus…
Browse files Browse the repository at this point in the history
…e visit_AssignSimple added "var " to module references
  • Loading branch information
thenewguy committed Jul 14, 2012
1 parent b164451 commit 126b10a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pyjaco/compiler/python.py
Expand Up @@ -293,7 +293,8 @@ def visit_AssignSimple(self, target, value):
if isinstance(target, ast.Name): if isinstance(target, ast.Name):
if not var in self._global_identifiers and not var in self._vars: if not var in self._global_identifiers and not var in self._vars:
self._vars.append(var) self._vars.append(var)
declare = "var " if not self.module or not var.startswith(self.module_ref):
declare = "var "
js.append("%s%s = %s.PY$__getitem__(%d);" % (declare, var, dummy, i)) js.append("%s%s = %s.PY$__getitem__(%d);" % (declare, var, dummy, i))
elif isinstance(target, ast.Subscript) and isinstance(target.slice, ast.Index): elif isinstance(target, ast.Subscript) and isinstance(target.slice, ast.Index):
# found index assignment # found index assignment
Expand Down

0 comments on commit 126b10a

Please sign in to comment.