aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/shedlang/compiler/shid/instructions/ShidBlock.java
blob: 33dd5a6aa5c90c42f3173f650f3b2db48cef53fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.shedlang.compiler.shid.instructions;

import org.shedlang.compiler.sources.Source;

import java.util.List;

/**
 * Execute the instructions, potentially leaving values on the temporary value
 * stack.
 */
public record ShidBlock(
    List<ShidVariable> boundVariables,
    List<ShidInstruction> instructions,
    Source source
) implements ShidInstruction {
    @Override
    public boolean isBlockTerminator() {
        return instructions.stream().anyMatch(ShidInstruction::isBlockTerminator);
    }
}