Fixing the "olasd" bug
This commit is contained in:
parent
1763cb7a60
commit
d421d869af
@ -72,10 +72,21 @@ class HyASTCompiler(object):
|
||||
ret.append(ast.Return(value=el,
|
||||
lineno=el.lineno,
|
||||
col_offset=el.col_offset))
|
||||
ret += [ast.Expr(value=el,
|
||||
lineno=el.lineno,
|
||||
col_offset=el.col_offset)
|
||||
if not isinstance(el, ast.stmt) else el for el in tree] # NOQA
|
||||
|
||||
for el in tree:
|
||||
if type(el) == list:
|
||||
blob = self._mangle_branch(el)
|
||||
blob.reverse()
|
||||
ret += blob
|
||||
continue
|
||||
|
||||
if isinstance(el, ast.stmt):
|
||||
ret.append(el)
|
||||
continue
|
||||
|
||||
ret.append(ast.Expr(value=el,
|
||||
lineno=el.lineno,
|
||||
col_offset=el.col_offset))
|
||||
|
||||
ret.reverse()
|
||||
return ret
|
||||
|
@ -212,6 +212,14 @@
|
||||
(with-as (open "README.md" "r") fd
|
||||
(pass)))
|
||||
|
||||
(defn test-for-doodle []
|
||||
"NATIVE: test for-do"
|
||||
(setf (, x y) (, 0 0))
|
||||
(foreach [- [1 2]]
|
||||
(do
|
||||
(setf x (+ x 1))
|
||||
(setf y (+ y 1))))
|
||||
(assert (= y x 2)))
|
||||
|
||||
(defn test-comprehensions []
|
||||
"NATIVE: test list comprehensions"
|
||||
|
Loading…
Reference in New Issue
Block a user