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

import org.shedlang.compiler.sources.Source;
import org.shedlang.compiler.types.SimpleStructType;

import java.util.List;

/**
 * Push a struct type value onto the temporary value stack with the given
 * definition.
 */
public record ShidDefineStruct(
    SimpleStructType type,
    // TODO: remove fields? We should have fields from the type info.
    List<Field> fields,
    Source source
) implements ShidInstruction {
    public record Field(String name, Source source) {
    }

    @Override
    public boolean isBlockTerminator() {
        return false;
    }
}