forked from M-Labs/artiq
tools/make_stmt_transformer: pass args/kwargs
This commit is contained in:
parent
c3092ae13f
commit
c71eb702bb
|
@ -25,8 +25,8 @@ def value_to_ast(value):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
def make_stmt_transformer(transformer_class):
|
def make_stmt_transformer(transformer_class):
|
||||||
def stmt_transformer(stmts):
|
def stmt_transformer(stmts, *args, **kwargs):
|
||||||
transformer = transformer_class()
|
transformer = transformer_class(*args, **kwargs)
|
||||||
new_stmts = [transformer.visit(stmt) for stmt in stmts]
|
new_stmts = [transformer.visit(stmt) for stmt in stmts]
|
||||||
stmts[:] = new_stmts
|
stmts[:] = new_stmts
|
||||||
return stmt_transformer
|
return stmt_transformer
|
||||||
|
|
Loading…
Reference in New Issue