added @paultag suggestions
This commit is contained in:
parent
6778e9b2e1
commit
099ad28ad1
@ -1144,13 +1144,9 @@ class HyASTCompiler(object):
|
||||
# (assoc foo bar baz) => foo[bar] = baz
|
||||
target = self.compile(expr.pop(0))
|
||||
ret = target
|
||||
while expr:
|
||||
key = self.compile(expr.pop(0))
|
||||
try:
|
||||
val = self.compile(expr.pop(0))
|
||||
except IndexError:
|
||||
raise HyCompileError(
|
||||
"Key {key} has no value to associate".format(key))
|
||||
i = iter(expr)
|
||||
for (key, val) in ((self.compile(x), self.compile(y))
|
||||
for (x, y) in zip(i, i)):
|
||||
|
||||
ret += key + val + ast.Assign(
|
||||
lineno=expr.start_line,
|
||||
|
Loading…
x
Reference in New Issue
Block a user