forked from M-Labs/artiq
transforms.iodelay_estimator: allow goto in zero-iodelay while statements.
This commit is contained in:
parent
2759310662
commit
0755aa38ff
@ -200,11 +200,15 @@ class IODelayEstimator(algorithm.Visitor):
|
||||
self.abort("{} cannot be interleaved".format(kind), node.loc)
|
||||
self.current_delay = old_delay
|
||||
|
||||
visit_While = lambda self, node: self.visit_control_flow("while statement", node)
|
||||
visit_If = lambda self, node: self.visit_control_flow("if statement", node)
|
||||
visit_IfExpT = lambda self, node: self.visit_control_flow("if expression", node)
|
||||
visit_Try = lambda self, node: self.visit_control_flow("try statement", node)
|
||||
|
||||
def visit_While(self, node):
|
||||
old_goto, self.current_goto = self.current_goto, None
|
||||
self.visit_control_flow("while statement", node)
|
||||
self.current_goto = old_goto
|
||||
|
||||
def visit_Return(self, node):
|
||||
self.current_return = node
|
||||
|
||||
|
@ -9,6 +9,7 @@ def f():
|
||||
print(2)
|
||||
while False:
|
||||
print(3)
|
||||
break
|
||||
delay_mu(1)
|
||||
print(4)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user