merge branch 'f/empty-del'
This commit is contained in:
commit
1187353661
@ -1294,9 +1294,15 @@ class HyASTCompiler(object):
|
|||||||
return ret
|
return ret
|
||||||
|
|
||||||
@builds("del")
|
@builds("del")
|
||||||
@checkargs(min=1)
|
|
||||||
def compile_del_expression(self, expr):
|
def compile_del_expression(self, expr):
|
||||||
expr.pop(0)
|
root = expr.pop(0)
|
||||||
|
if not expr:
|
||||||
|
result = Result()
|
||||||
|
result += ast.Name(id='None', ctx=ast.Load(),
|
||||||
|
lineno=root.start_line,
|
||||||
|
col_offset=root.start_column)
|
||||||
|
return result
|
||||||
|
|
||||||
ld_targets, ret, _ = self._compile_collect(expr)
|
ld_targets, ret, _ = self._compile_collect(expr)
|
||||||
|
|
||||||
del_targets = []
|
del_targets = []
|
||||||
|
@ -1081,7 +1081,8 @@
|
|||||||
(del (get test 4))
|
(del (get test 4))
|
||||||
(assert (= test [0 1 2 3]))
|
(assert (= test [0 1 2 3]))
|
||||||
(del (get test 2))
|
(del (get test 2))
|
||||||
(assert (= test [0 1 3])))
|
(assert (= test [0 1 3]))
|
||||||
|
(assert (= (del) nil)))
|
||||||
|
|
||||||
|
|
||||||
(defn test-macroexpand []
|
(defn test-macroexpand []
|
||||||
|
Loading…
Reference in New Issue
Block a user