View source on GitHub

Removes any called lambdas and blocks from comp.

This function will rename all the variables in comp in a single walk of the AST, then replace called lambdas with blocks in another walk, since this transformation interacts with scope in delicate ways. It will chain inlining the blocks and collapsing the selection-from-tuple pattern together into a final pass.

comp Instance of building_blocks.ComputationBuildingBlock from which we want to remove called lambdas and blocks.

A transformed version of comp which has no called lambdas or blocks, and no extraneous selections from tuples.