From 792ac442453cb61ff81857aad423ad723040bb7b Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Mon, 16 Jun 2014 22:01:20 +0200 Subject: [PATCH] inline: return statements --- artiq/compiler/inline.py | 3 +-- artiq/devices/core.py | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/artiq/compiler/inline.py b/artiq/compiler/inline.py index 4b49176ce..7303e54be 100644 --- a/artiq/compiler/inline.py +++ b/artiq/compiler/inline.py @@ -1,7 +1,6 @@ from collections import namedtuple, defaultdict import inspect, textwrap, ast, builtins -from artiq.compiler import unparse from artiq.compiler.tools import eval_ast from artiq.language import experiment, units @@ -181,4 +180,4 @@ def inline(k_function, k_args, k_kwargs, rm=None): funcdef.body[0:0] = param_init - unparse.Unparser(funcdef.body) + return funcdef.body diff --git a/artiq/devices/core.py b/artiq/devices/core.py index 111692162..7b7e192f5 100644 --- a/artiq/devices/core.py +++ b/artiq/devices/core.py @@ -1,5 +1,7 @@ from artiq.compiler.inline import inline +from artiq.compiler.unparse import Unparser class Core: def run(self, k_function, k_args, k_kwargs): - inline(k_function, k_args, k_kwargs) + stmts = inline(k_function, k_args, k_kwargs) + Unparser(stmts)