From f2ab791334abe75807c4bff32b17fa379b466193 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Tue, 13 Jun 2023 20:35:55 +0100 Subject: Put namespace name onto namespace nodes --- .../stackir/StackCompilerNamespaceTests.java | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'src/test/java/org/shedlang/compiler/stackir') diff --git a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java index a3b34c55..32ff72ba 100644 --- a/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java +++ b/src/test/java/org/shedlang/compiler/stackir/StackCompilerNamespaceTests.java @@ -18,16 +18,19 @@ public class StackCompilerNamespaceTests { public void bodyOfNamespaceIsCompiledWithNamesBeingExported() { var namespaceName = new NamespaceName(List.of("Example")); - var node = Typed.namespace(List.of( - TypedFunctionDefinitionNode.builder() - .withName("f") - .addPositionalParam("x", Typed.typeLevelReference("String", Types.STRING)) - .addNamedParam("y", Typed.typeLevelReference("Int", Types.INT)) - .addStatement(Typed.expressionStatement(Typed.stringLiteral("hello"))) - .build() - )); + var node = Typed.namespace( + namespaceName, + List.of( + TypedFunctionDefinitionNode.builder() + .withName("f") + .addPositionalParam("x", Typed.typeLevelReference("String", Types.STRING)) + .addNamedParam("y", Typed.typeLevelReference("Int", Types.INT)) + .addStatement(Typed.expressionStatement(Typed.stringLiteral("hello"))) + .build() + ) + ); - var instructions = StackCompiler.compileNamespace(node, namespaceName); + var instructions = StackCompiler.compileNamespace(node); assertThat(instructions, isSequence( instanceOf( -- cgit v1.2.3