@@ -0,0 +1,784 @@
+package com.shapesecurity.shift.semantics.asgvisitor;%0A%0Aimport com.shapesecurity.functional.data.ImmutableList;%0Aimport com.shapesecurity.shift.semantics.asg.Block;%0Aimport com.shapesecurity.shift.semantics.asg.Node;%0Aimport com.shapesecurity.shift.semantics.visitor.ReconstructingReducer;%0Aimport org.jetbrains.annotations.NotNull;%0A%0Aimport javax.annotation.Nonnull;%0A%0Apublic class BlockSquasher extends ReconstructingReducer %7B%0A%09@Nonnull%0A%09@Override%0A%09protected Block visitBlock(@NotNull Block block) %7B%0A%09%09return new Block(block.children.flatMap(this::childHelper));%0A%09%7D%0A%0A%09@Nonnull%0A%09private ImmutableList%3CNode%3E childHelper(Node node) %7B%0A%09%09if (node instanceof Block) %7B%0A%09%09%09return ((Block) node).children.flatMap(this::childHelper);%0A%09%09%7D else %7B%0A%09%09%09return ImmutableList.of(visitNode(node));%0A%09%09%7D%0A%09%7D%0A%7D%0A

Implement block squasher (#12)