package org.shedlang.compiler.patio.instructions; import org.shedlang.compiler.patio.operands.PatioOperand; import org.shedlang.compiler.sources.Source; import org.shedlang.compiler.util.Lists; import java.util.List; /// Execute the instructions in the body of the block. The results may be used in /// the parent scope, but any other variables (as distinct from values) are no /// longer in use. public record PatioBlock( List body, List results, Source source ) implements PatioInstruction { public PatioBlock addInstruction(PatioInstruction instruction) { return new PatioBlock( Lists.concat(this.body, List.of(instruction)), this.results, this.source ); } @Override public boolean isBlockTerminator() { return false; } }