diff options
Diffstat (limited to 'src/main/java/org/shedlang/compiler/ast')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNode.java | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNode.java b/src/main/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNode.java index a478e588..d727b98e 100644 --- a/src/main/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNode.java +++ b/src/main/java/org/shedlang/compiler/ast/untyped/UntypedSumTypeDefinitionNode.java @@ -7,26 +7,35 @@ import org.shedlang.compiler.types.Visibility; import org.shedlang.compiler.util.P; import java.util.List; +import java.util.Optional; public record UntypedSumTypeDefinitionNode( String name, Visibility visibility, + Optional<List<UntypedTypeLevelParamNode>> typeLevelParams, List<UntypedTypeLevelExpressionNode> variants, Source source ) implements UntypedNamespaceStatementNode, UntypedVariableDeclarationNode { public static Builder builder() { - return new Builder("DefaultSumTypeName", Visibility.PRIVATE, P.vector()); + return new Builder( + "DefaultSumTypeName", + Visibility.PRIVATE, + Optional.empty(), + P.vector() + ); } public record Builder( String name, Visibility visibility, + Optional<List<UntypedTypeLevelParamNode>> typeLevelParams, PVector<UntypedTypeLevelExpressionNode> variants ) { public UntypedSumTypeDefinitionNode build() { return new UntypedSumTypeDefinitionNode( this.name, this.visibility, + this.typeLevelParams, this.variants, Sources.NULL ); @@ -36,6 +45,7 @@ public record UntypedSumTypeDefinitionNode( return new Builder( name, this.visibility, + this.typeLevelParams, this.variants ); } @@ -44,6 +54,7 @@ public record UntypedSumTypeDefinitionNode( return new Builder( this.name, this.visibility, + this.typeLevelParams, this.variants.plus(variant) ); } |
