package org.shedlang.compiler.patio.instructions; import org.shedlang.compiler.patio.operands.PatioLocalRef; import org.shedlang.compiler.patio.operands.PatioOperand; import org.shedlang.compiler.sources.Source; import java.util.List; /// Find a case with a value matching that of the instruction's value. If such a /// case is found, execute the body of that case, otherwise execute the default /// body. /// /// Each block must have the same number of results as destinations. Each result /// is assigned to the destination with the same index. public record PatioSwitch( List destinations, PatioOperand value, List cases, PatioBlock defaultBody, Source source ) implements PatioInstruction { @Override public boolean isBlockTerminator() { return true; } }