From b758aab829a5ddb20fd5284b1fad581db36742c6 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Thu, 19 Dec 2024 17:28:51 +0000 Subject: Create method information for methods in struct --- .../compiler/ast/untyped/UntypedStructDefinitionNode.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/main/java/org/shedlang/compiler/ast') diff --git a/src/main/java/org/shedlang/compiler/ast/untyped/UntypedStructDefinitionNode.java b/src/main/java/org/shedlang/compiler/ast/untyped/UntypedStructDefinitionNode.java index af335ee5..666a9cef 100644 --- a/src/main/java/org/shedlang/compiler/ast/untyped/UntypedStructDefinitionNode.java +++ b/src/main/java/org/shedlang/compiler/ast/untyped/UntypedStructDefinitionNode.java @@ -93,5 +93,16 @@ public record UntypedStructDefinitionNode( ); } + + public Builder addMethod(UntypedFunctionDefinitionNode method) { + return new Builder( + this.name, + this.visibility, + this.typeLevelParams, + this.fields, + this.fieldsArePositional, + this.methods.plus(method) + ); + } } } -- cgit v1.2.3