You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the new transformation signature this needs to be updated to:
for subroutine in psyir.walk(Routine):
if subroutine.name == "invoke_propagate_perturbation":
# Modify subroutine
Which I am not totally satisfied because it is more verbose, adds indentations, and even worst, it doesn't fail if the named routine does not exist. It would be good to add a generic Conatiner.get method to get routines by name or fail:
Those methods implement all the 'language' knowledge regarding visibility, imports, interfaces, ... I was thinking something simpler, something akin to the tree semantic navigation methods that we have, so that we can navigate the tree by name when it makes sense.
E.g. "go to the lhs of the 3rd statement of the "mysub" routine in the first module" would be: target = psyir[0]["mysub"][2].lhs
Note that in this example I navigate 2 container, one by index-order [0] and one by name ["mysub"]. But I am just traversing the tree, I am not interested in language logic here.
While doing #2739 some PSyKAl transformation scripts have:
With the new transformation signature this needs to be updated to:
Which I am not totally satisfied because it is more verbose, adds indentations, and even worst, it doesn't fail if the named routine does not exist. It would be good to add a generic Conatiner.get method to get routines by name or fail:
The first 'children' is unrelated, it is for going to the FileContainer to the Module also introduced in the mentioned PR.
Some alternatives are:
The text was updated successfully, but these errors were encountered: