style cleanup
This commit is contained in:
parent
a1cf9e50eb
commit
ada946fca8
@ -534,8 +534,8 @@ class HyASTCompiler(object):
|
|||||||
|
|
||||||
@builds("global")
|
@builds("global")
|
||||||
@checkargs(1)
|
@checkargs(1)
|
||||||
def compile_global_expression(self,expr):
|
def compile_global_expression(self, expr):
|
||||||
expr.pop(0) # global
|
expr.pop(0) # global
|
||||||
e = expr.pop(0)
|
e = expr.pop(0)
|
||||||
return ast.Global(names=[ast_str(e)],
|
return ast.Global(names=[ast_str(e)],
|
||||||
lineno=e.start_line,
|
lineno=e.start_line,
|
||||||
|
@ -185,15 +185,18 @@ def test_ast_bad_assert():
|
|||||||
cant_compile("(assert)")
|
cant_compile("(assert)")
|
||||||
cant_compile("(assert 1 2)")
|
cant_compile("(assert 1 2)")
|
||||||
|
|
||||||
|
|
||||||
def test_ast_good_global():
|
def test_ast_good_global():
|
||||||
"Make sure AST can compile valid global"
|
"Make sure AST can compile valid global"
|
||||||
hy_compile(tokenize("(global a)"))
|
hy_compile(tokenize("(global a)"))
|
||||||
|
|
||||||
|
|
||||||
def test_ast_bad_global():
|
def test_ast_bad_global():
|
||||||
"Make sure AST can't compile invalid global"
|
"Make sure AST can't compile invalid global"
|
||||||
cant_compile("(global)")
|
cant_compile("(global)")
|
||||||
cant_compile("(global foo bar)")
|
cant_compile("(global foo bar)")
|
||||||
|
|
||||||
|
|
||||||
def test_ast_good_lambda():
|
def test_ast_good_lambda():
|
||||||
"Make sure AST can compile valid lambda"
|
"Make sure AST can compile valid lambda"
|
||||||
hy_compile(tokenize("(lambda [] 1)"))
|
hy_compile(tokenize("(lambda [] 1)"))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user