diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-20 17:07:02 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-20 17:08:49 +0000 |
| commit | fc115476216f364d947804cce2202b428d8afd6f (patch) | |
| tree | aa106a2639d127486d90cc40170bae3a7b30a221 /src/test/java | |
| parent | c4b8cef3e2cc580f9f74dfdfb061d8d6dd49ca0f (diff) | |
Rename PatioCodeGen to ShidToPatio
Diffstat (limited to 'src/test/java')
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java | 2 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java | 2 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/PatioTesting.java | 2 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioCallTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenCallTests.java) | 10 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioContextTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenContextTests.java) | 10 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineEffectTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineEffectTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineFunctionTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineFunctionTests.java) | 30 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineStructTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineStructTests.java) | 12 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioDiscardTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenDiscardTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioEffectHandlerBreakTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenEffectHandlerBreakTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioFieldLoadTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenFieldLoadTests.java) | 14 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioIfTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenIfTests.java) | 14 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioIntAddTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntAddTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioIntEqualsTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntEqualsTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioIntNotEqualTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntNotEqualTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioIntSubTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntSubTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalLoadTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalStoreTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java) | 8 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopBreakTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopBreakTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopContinueTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopContinueTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceFieldStoreTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceFieldStoreTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceImportTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceImportTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioPushBoolTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushBoolTests.java) | 10 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioPushIntTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushIntTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioPushStringTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushStringTests.java) | 12 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioPushUnitTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushUnitTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioResumeTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioReturnTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioStringAddTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenStringAddTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioSwitchTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenSwitchTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioTryTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenTryTests.java) | 10 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleCreateTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java) | 10 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleGetTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleGetTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioVarLoadTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarLoadTests.java) | 6 | ||||
| -rw-r--r-- | src/test/java/org/shedlang/compiler/patio/ShidToPatioVarStoreTests.java (renamed from src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarStoreTests.java) | 12 |
37 files changed, 145 insertions, 145 deletions
diff --git a/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java b/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java index 55583c6d..84083666 100644 --- a/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java +++ b/src/test/java/org/shedlang/compiler/backends/llvm/PatioToLlvmTests.java @@ -58,7 +58,7 @@ public class PatioToLlvmTests extends PatioExampleTests { )); Files.createDirectories(Path.of("tests-tmp")); - var workingDirectory = Files.createTempDirectory(Path.of("tests-tmp"), "LlvmPatioCodeGen"); + var workingDirectory = Files.createTempDirectory(Path.of("tests-tmp"), "LlvmShidToPatio"); var objectFilePath = LlvmCompiler.compileLlvmModule( llvmModule, diff --git a/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java b/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java index a8687230..b5a10d11 100644 --- a/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java +++ b/src/test/java/org/shedlang/compiler/backends/wasm/PatioToWasmTests.java @@ -50,7 +50,7 @@ public class PatioToWasmTests extends PatioExampleTests { )); Files.createDirectories(Path.of("tests-tmp")); - var workingDirectory = Files.createTempDirectory(Path.of("tests-tmp"), "WasmPatioCodeGen"); + var workingDirectory = Files.createTempDirectory(Path.of("tests-tmp"), "WasmShidToPatio"); var objectPath = workingDirectory.resolve("main.o"); try (var outputStream = new FileOutputStream(objectPath.toFile())) { diff --git a/src/test/java/org/shedlang/compiler/patio/PatioTesting.java b/src/test/java/org/shedlang/compiler/patio/PatioTesting.java index 6f655ccc..03344fb8 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioTesting.java +++ b/src/test/java/org/shedlang/compiler/patio/PatioTesting.java @@ -12,7 +12,7 @@ import org.shedlang.compiler.patio.ast.types.PatioType; class PatioTesting { private PatioTesting() {} - static String serialize(PatioCodeGenContext context) { + static String serialize(ShidToPatioContext context) { var builder = new StringBuilder(); builder.append("Compilation unit elements:\n\n"); diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenCallTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioCallTests.java index a4ed029f..4f5d8056 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenCallTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioCallTests.java @@ -13,15 +13,15 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenCallTests { +public class ShidToPatioCallTests { @Test public void canCallFunctionWithNoArgs(Snapshotter snapshotter) throws IOException { var instruction = Shid.call(0, List.of()); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("receiver")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -29,7 +29,7 @@ public class PatioCodeGenCallTests { @Test public void canCallFunctionWithArgs(Snapshotter snapshotter) throws IOException { var instruction = Shid.call(2, List.of("b", "a")); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("receiver")) .temporaryPush(new PatioLocalRef("pos1")) @@ -37,7 +37,7 @@ public class PatioCodeGenCallTests { .temporaryPush(new PatioLocalRef("namedB")) .temporaryPush(new PatioLocalRef("namedA")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenContextTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioContextTests.java index 7d46a284..1b2c0a75 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenContextTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioContextTests.java @@ -10,10 +10,10 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.zwobble.precisely.AssertThat.assertThat; import static org.zwobble.precisely.Matchers.*; -public class PatioCodeGenContextTests { +public class ShidToPatioContextTests { @Test public void canAddCompilationUnitElementsWithDistinctNames() { - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; context = context.addCompilationUnitElement(new PatioDataElementImmutable( "x", @@ -34,7 +34,7 @@ public class PatioCodeGenContextTests { @Test public void addingCompilationUnitsWithSameNameThrowsError() { - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .addCompilationUnitElement(new PatioDataElementImmutable( "x", PatioDataValues.int_(0), @@ -55,7 +55,7 @@ public class PatioCodeGenContextTests { @Test public void canEnsureCompilationUnitElementsWithSameNameAndSameValue() { - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; context = context.ensureCompilationUnitElement(new PatioDataElementImmutable( "x", @@ -75,7 +75,7 @@ public class PatioCodeGenContextTests { @Test public void ensuringCompilationUnitsWithSameNameAndDifferentValueThrowsError() { - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .ensureCompilationUnitElement(new PatioDataElementImmutable( "x", PatioDataValues.int_(0), diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineEffectTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineEffectTests.java index 7137affe..a2e743ee 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineEffectTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineEffectTests.java @@ -13,7 +13,7 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenDefineEffectTests { +public class ShidToPatioDefineEffectTests { @Test public void canGenerateCodeForDefineEffect(Snapshotter snapshotter) throws IOException { var effect = Effects.userDefined(NamespaceName.of("Example", "Project"), "State"); @@ -38,9 +38,9 @@ public class PatioCodeGenDefineEffectTests { ) .build() ); - var context = PatioCodeGenContext.forTypeInfos(typeInfos); + var context = ShidToPatioContext.forTypeInfos(typeInfos); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineFunctionTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineFunctionTests.java index 9c52db77..7d156ff2 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineFunctionTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineFunctionTests.java @@ -17,7 +17,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenDefineFunctionTests { +public class ShidToPatioDefineFunctionTests { @Test public void canDefineMinimalFunction(Snapshotter snapshotter) throws IOException { var instruction = new ShidDefineFunction( @@ -32,9 +32,9 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.FUNCTION, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -53,11 +53,11 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.FUNCTION, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .defineShidParam("a") .defineShidParam("b"); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -76,11 +76,11 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.FUNCTION, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY - .declareShidVal("a", PatioCodeGenTypes.VALUE_TYPE).context() - .declareShidVal("b", PatioCodeGenTypes.VALUE_TYPE).context(); + var context = ShidToPatioContext.EMPTY + .declareShidVal("a", ShidToPatioTypes.VALUE_TYPE).context() + .declareShidVal("b", ShidToPatioTypes.VALUE_TYPE).context(); - context = PatioCodeGen.generateInstruction(instruction, context); + context = ShidToPatio.generateInstruction(instruction, context); // We make sure there are some other instructions before setting the // free variables so we can distinguish the free variable being copied @@ -111,13 +111,13 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.FUNCTION, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .declareShidVal("a", PatioTypes.DATA_POINTER).context() .initShidLocal("a") .declareShidVal("b", PatioTypes.DATA_POINTER).context() .initShidLocal("b"); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -141,11 +141,11 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.FUNCTION, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .defineShidParam("a") .defineShidParam("b"); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -164,9 +164,9 @@ public class PatioCodeGenDefineFunctionTests { ShidDefineFunction.Variant.EFFECT_HANDLER_METHOD, Sources.NULL ); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineStructTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineStructTests.java index 450dcba2..18d45800 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDefineStructTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDefineStructTests.java @@ -18,7 +18,7 @@ import static org.zwobble.precisely.AssertThat.assertThat; import static org.zwobble.precisely.Matchers.equalTo; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenDefineStructTests { +public class ShidToPatioDefineStructTests { @Test public void canGenerateCodeForDefineStruct(Snapshotter snapshotter) throws IOException { var structType = Types.struct(NamespaceName.of("Example", "Project"), "User"); @@ -37,9 +37,9 @@ public class PatioCodeGenDefineStructTests { .addField("isActive", Types.BOOL) .build() ); - var context = PatioCodeGenContext.forTypeInfos(typeInfos); + var context = ShidToPatioContext.forTypeInfos(typeInfos); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -56,10 +56,10 @@ public class PatioCodeGenDefineStructTests { var typeInfos = TypeInfos.EMPTY .addStructTypeInfo(structType1, StructTypeInfo.builder().build()) .addStructTypeInfo(structType2, StructTypeInfo.builder().build()); - var context = PatioCodeGenContext.forTypeInfos(typeInfos); + var context = ShidToPatioContext.forTypeInfos(typeInfos); - context = PatioCodeGen.generateInstruction(instruction1, context); - context = PatioCodeGen.generateInstruction(instruction2, context); + context = ShidToPatio.generateInstruction(instruction1, context); + context = ShidToPatio.generateInstruction(instruction2, context); assertThat(context.structTag(structType1), equalTo(0)); assertThat(context.structTag(structType2), equalTo(1)); diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDiscardTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDiscardTests.java index ff66e6bb..ca7a9bb5 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenDiscardTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioDiscardTests.java @@ -12,15 +12,15 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenDiscardTests { +public class ShidToPatioDiscardTests { @Test public void discardInstructionPopsFromTemporaryStack(Snapshotter snapshotter) throws IOException { var shid = Shid.discard(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenEffectHandlerBreakTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioEffectHandlerBreakTests.java index 128f001a..16bb8adf 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenEffectHandlerBreakTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioEffectHandlerBreakTests.java @@ -14,17 +14,17 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenEffectHandlerBreakTests { +public class ShidToPatioEffectHandlerBreakTests { @Test public void effectHandlerBreakThrowsException(Snapshotter snapshotter) throws IOException { var namespaceName = NamespaceName.of("Example", "Project"); var effect = Effects.userDefined(namespaceName, "Effect"); var shid = Shid.effectHandlerBreak(effect); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenFieldLoadTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioFieldLoadTests.java index 24ec9c18..b99bca39 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenFieldLoadTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioFieldLoadTests.java @@ -16,7 +16,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenFieldLoadTests { +public class ShidToPatioFieldLoadTests { @Test public void canGenerateCodeForNamespaceFieldLoad(Snapshotter snapshotter) throws IOException { var namespaceName = new NamespaceName(List.of("Example", "Project")); @@ -31,11 +31,11 @@ public class PatioCodeGenFieldLoadTests { .build() ) .toTypeInfos(); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -54,11 +54,11 @@ public class PatioCodeGenFieldLoadTests { .addField("isActive", Types.BOOL) .build() ); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -77,11 +77,11 @@ public class PatioCodeGenFieldLoadTests { .addMethod("read", FunctionType.builder().build()) .build() ); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIfTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIfTests.java index 9a385a1f..5f65372b 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIfTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIfTests.java @@ -13,7 +13,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenIfTests { +public class ShidToPatioIfTests { @Test public void canGenerateCodeForIfWithNoResults(Snapshotter snapshotter) throws IOException { var instruction = Shid.if_( @@ -27,11 +27,11 @@ public class PatioCodeGenIfTests { Shid.discard() )) ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("condition")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -51,11 +51,11 @@ public class PatioCodeGenIfTests { Shid.intAdd() )) ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("condition")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -73,11 +73,11 @@ public class PatioCodeGenIfTests { Shid.pushInt(102) )) ); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("condition")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntAddTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntAddTests.java index 53158d0d..2ef8587c 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntAddTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntAddTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenIntAddTests { +public class ShidToPatioIntAddTests { @Test public void canGenerateCodeForIntAdd(Snapshotter snapshotter) throws IOException { var shid = Shid.intAdd(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntEqualsTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntEqualsTests.java index 8b9fe35f..671e0678 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntEqualsTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntEqualsTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenIntEqualsTests { +public class ShidToPatioIntEqualsTests { @Test public void canGenerateCodeForIntEquals(Snapshotter snapshotter) throws IOException { var shid = Shid.intEquals(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntNotEqualTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntNotEqualTests.java index 5715f0d4..f662435d 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntNotEqualTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntNotEqualTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenIntNotEqualTests { +public class ShidToPatioIntNotEqualTests { @Test public void canGenerateCodeForIntNotEqual(Snapshotter snapshotter) throws IOException { var shid = Shid.intNotEqual(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntSubTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntSubTests.java index e2036764..8fc103a3 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenIntSubTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioIntSubTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenIntSubTests { +public class ShidToPatioIntSubTests { @Test public void canGenerateCodeForIntSub(Snapshotter snapshotter) throws IOException { var shid = Shid.intSub(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalLoadTests.java index f452583b..c6eac482 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalLoadTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalLoadTests.java @@ -11,14 +11,14 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenLocalLoadTests { +public class ShidToPatioLocalLoadTests { @Test public void localLoadPushesLocalOntoStack(Snapshotter snapshotter) throws IOException { var shid = Shid.localLoad("x"); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .defineShidParam("x"); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalStoreTests.java index 00b50c44..61c4cabd 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLocalStoreTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLocalStoreTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenLocalStoreTests { +public class ShidToPatioLocalStoreTests { @Test public void localStorePopsTemporaryIntoLocal(Snapshotter snapshotter) throws IOException { var shid = Shid.localStore("x"); - var context = PatioCodeGenContext.EMPTY - .declareShidVal("x", PatioCodeGenTypes.VALUE_TYPE).context() + var context = ShidToPatioContext.EMPTY + .declareShidVal("x", ShidToPatioTypes.VALUE_TYPE).context() .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopBreakTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopBreakTests.java index 16ab525d..b31e37fe 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopBreakTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopBreakTests.java @@ -11,13 +11,13 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenLoopBreakTests { +public class ShidToPatioLoopBreakTests { @Test public void canGenerateCodeForLoopBreak(Snapshotter snapshotter) throws IOException { var instruction = Shid.loopBreak(); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopContinueTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopContinueTests.java index 0e9372fc..6ad5ab09 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopContinueTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopContinueTests.java @@ -11,13 +11,13 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenLoopContinueTests { +public class ShidToPatioLoopContinueTests { @Test public void canGenerateCodeForLoopContinue(Snapshotter snapshotter) throws IOException { var instruction = Shid.loopContinue(); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopTests.java index 67ab77b5..aee95b84 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenLoopTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioLoopTests.java @@ -12,7 +12,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenLoopTests { +public class ShidToPatioLoopTests { @Test public void canGenerateCodeForLoop(Snapshotter snapshotter) throws IOException { var instruction = Shid.loop( @@ -21,9 +21,9 @@ public class PatioCodeGenLoopTests { Shid.discard() )) ); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceFieldStoreTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceFieldStoreTests.java index 254249e0..31159dbc 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceFieldStoreTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceFieldStoreTests.java @@ -17,7 +17,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenNamespaceFieldStoreTests { +public class ShidToPatioNamespaceFieldStoreTests { @Test public void canGenerateCodeForNamespaceFieldStore(Snapshotter snapshotter) throws IOException { var namespaceName = new NamespaceName(List.of("Example", "Project")); @@ -32,11 +32,11 @@ public class PatioCodeGenNamespaceFieldStoreTests { .build() ) .toTypeInfos(); - var context = PatioCodeGenContext.forTypeInfos(typeInfo) + var context = ShidToPatioContext.forTypeInfos(typeInfo) .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceImportTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceImportTests.java index f86388cb..e7d9e46f 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceImportTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceImportTests.java @@ -13,14 +13,14 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenNamespaceImportTests { +public class ShidToPatioNamespaceImportTests { @Test public void canGenerateCodeForNamespaceImport(Snapshotter snapshotter) throws IOException { var namespaceName = new NamespaceName(List.of("Example", "Project")); var instruction = Shid.namespaceImport(namespaceName); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceTests.java index dc3b6adf..6b45c22e 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenNamespaceTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioNamespaceTests.java @@ -20,7 +20,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serializeCompilationUnit; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenNamespaceTests { +public class ShidToPatioNamespaceTests { @Test public void canDefineNamespace(Snapshotter snapshotter) throws IOException { var instruction = new ShidDefineFunction( @@ -45,10 +45,10 @@ public class PatioCodeGenNamespaceTests { .addField("y", Types.STRING) .build() ); - var context = PatioCodeGenContext.forTypeInfos(typeInfos); + var context = ShidToPatioContext.forTypeInfos(typeInfos); var shidNamespace = new ShidNamespace(namespaceName, instructions); - var result = PatioCodeGen.generateNamespace(shidNamespace, context); + var result = ShidToPatio.generateNamespace(shidNamespace, context); snapshotter.assertSnapshot(serializeCompilationUnit(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushBoolTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushBoolTests.java index 4b3c869c..b7864376 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushBoolTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushBoolTests.java @@ -11,13 +11,13 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenPushBoolTests { +public class ShidToPatioPushBoolTests { @Test public void pushBoolFalseInstructionGeneratesIntGetZeroInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.pushBool(false); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } @@ -25,9 +25,9 @@ public class PatioCodeGenPushBoolTests { @Test public void pushBoolTrueInstructionGeneratesIntGetOneInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.pushBool(true); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushIntTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushIntTests.java index 0996f981..ed78b991 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushIntTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushIntTests.java @@ -11,13 +11,13 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenPushIntTests { +public class ShidToPatioPushIntTests { @Test public void pushIntInstructionGeneratesIntGetInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.pushInt(42); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushStringTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushStringTests.java index 3a878afe..7d538c4f 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushStringTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushStringTests.java @@ -11,23 +11,23 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenPushStringTests { +public class ShidToPatioPushStringTests { @Test public void pushStringIsCompiledToDataAndIndexToData(Snapshotter snapshotter) throws IOException { var shidInstruction = Shid.pushString("hello"); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } @Test public void canHaveMultipleStrings(Snapshotter snapshotter) throws IOException { - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(Shid.pushString("hello"), context); - result = PatioCodeGen.generateInstruction(Shid.pushString("world"), result); + var result = ShidToPatio.generateInstruction(Shid.pushString("hello"), context); + result = ShidToPatio.generateInstruction(Shid.pushString("world"), result); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushUnitTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushUnitTests.java index d1aa4bd8..fef89215 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenPushUnitTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioPushUnitTests.java @@ -11,13 +11,13 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenPushUnitTests { +public class ShidToPatioPushUnitTests { @Test public void pushUnitInstructionGeneratesIntGetInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.pushUnit(); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioResumeTests.java index 6ac0e4f7..57df08cc 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenResumeTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioResumeTests.java @@ -12,17 +12,17 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenResumeTests { +public class ShidToPatioResumeTests { @Test public void resumeInstructionGeneratesResumeInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.resume(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .stashEffectHandler(new PatioLocalRef("effect_handler")) .stashGcRootStackIndex(new PatioLocalRef("gc_root_stack_index")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioReturnTests.java index f2bf807e..c291a5e3 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenReturnTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioReturnTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenReturnTests { +public class ShidToPatioReturnTests { @Test public void returnInstructionGeneratesReturnInstruction(Snapshotter snapshotter) throws IOException { var shid = Shid.return_(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .stashGcRootStackIndex(new PatioLocalRef("gc_root_stack_index"));; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenStringAddTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioStringAddTests.java index 8eb09cb7..fc087d2b 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenStringAddTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioStringAddTests.java @@ -12,16 +12,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenStringAddTests { +public class ShidToPatioStringAddTests { @Test public void canGenerateCodeForStringAdd(Snapshotter snapshotter) throws IOException { var shid = Shid.stringAdd(); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenSwitchTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioSwitchTests.java index e9838702..d70e1723 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenSwitchTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioSwitchTests.java @@ -17,7 +17,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenSwitchTests { +public class ShidToPatioSwitchTests { @Test public void canGenerateCodeForSwitchWithSingleResult(Snapshotter snapshotter) throws IOException { var namespaceName = NamespaceName.of("Example", "Project"); @@ -46,11 +46,11 @@ public class PatioCodeGenSwitchTests { var typeInfos = TypeInfos.EMPTY .addStructTypeInfo(structType1, StructTypeInfo.builder().build()) .addStructTypeInfo(structType2, StructTypeInfo.builder().build()); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("condition")); - var result = PatioCodeGen.generateInstruction(instruction, context); + var result = ShidToPatio.generateInstruction(instruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTryTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTryTests.java index c64ed1d8..8ed1f6ff 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTryTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTryTests.java @@ -15,7 +15,7 @@ import java.util.List; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenTryTests { +public class ShidToPatioTryTests { @Test public void canGenerateCodeForTry(Snapshotter snapshotter) throws IOException { var namespaceName = new NamespaceName(List.of("Example", "Project")); @@ -37,13 +37,13 @@ public class PatioCodeGenTryTests { .build() ) .toTypeInfos(); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("handlerA")) .temporaryPush(new PatioLocalRef("handlerC")) .temporaryPush(new PatioLocalRef("handlerB")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } @@ -68,12 +68,12 @@ public class PatioCodeGenTryTests { .build() ) .toTypeInfos(); - var context = PatioCodeGenContext.forTypeInfos(typeInfos) + var context = ShidToPatioContext.forTypeInfos(typeInfos) .stashGcRootStackIndex(new PatioLocalRef("gcRootStackIndex")) .temporaryPush(new PatioLocalRef("other")) .temporaryPush(new PatioLocalRef("handlerA")); - var result = PatioCodeGen.generateInstruction(shidInstruction, context); + var result = ShidToPatio.generateInstruction(shidInstruction, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleCreateTests.java index d5cb6ef1..8fc0e251 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleCreateTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleCreateTests.java @@ -12,17 +12,17 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenTupleCreateTests { +public class ShidToPatioTupleCreateTests { @Test public void canGenerateCodeForTupleCreate(Snapshotter snapshotter) throws IOException { var shid = Shid.tupleCreate(3); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")) .temporaryPush(new PatioLocalRef("c")) .temporaryPush(new PatioLocalRef("d")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } @@ -30,9 +30,9 @@ public class PatioCodeGenTupleCreateTests { @Test public void zeroElementTupleIsCreatedWithoutAlloc(Snapshotter snapshotter) throws IOException { var shid = Shid.tupleCreate(0); - var context = PatioCodeGenContext.EMPTY; + var context = ShidToPatioContext.EMPTY; - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleGetTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleGetTests.java index 41a037b0..14e43c45 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenTupleGetTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioTupleGetTests.java @@ -12,15 +12,15 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenTupleGetTests { +public class ShidToPatioTupleGetTests { @Test public void canGenerateCodeForTupleGet(Snapshotter snapshotter) throws IOException { var shid = Shid.tupleGet(2, 3); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarLoadTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioVarLoadTests.java index 3eae5cf9..76b74fd3 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarLoadTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioVarLoadTests.java @@ -12,14 +12,14 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenVarLoadTests { +public class ShidToPatioVarLoadTests { @Test public void canGenerateCodeForVarLoad(Snapshotter snapshotter) throws IOException { var shid = Shid.varLoad("x"); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .declareShidVal("x", PatioTypes.DATA_POINTER).context(); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } diff --git a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarStoreTests.java b/src/test/java/org/shedlang/compiler/patio/ShidToPatioVarStoreTests.java index 4f9d4430..e0c868e0 100644 --- a/src/test/java/org/shedlang/compiler/patio/PatioCodeGenVarStoreTests.java +++ b/src/test/java/org/shedlang/compiler/patio/ShidToPatioVarStoreTests.java @@ -13,16 +13,16 @@ import java.io.IOException; import static org.shedlang.compiler.patio.PatioTesting.serialize; @ExtendWith({SnapshotResolver.class}) -public class PatioCodeGenVarStoreTests { +public class ShidToPatioVarStoreTests { @Test public void canGenerateCodeForVarStore(Snapshotter snapshotter) throws IOException { var shid = Shid.varStore("x"); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .declareShidVal("x", PatioTypes.DATA_POINTER).context() .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); + var result = ShidToPatio.generateInstruction(shid, context); snapshotter.assertSnapshot(serialize(result)); } @@ -30,13 +30,13 @@ public class PatioCodeGenVarStoreTests { @Test public void canStoreIntoVarMultipleTimes(Snapshotter snapshotter) throws IOException { var shid = Shid.varStore("x"); - var context = PatioCodeGenContext.EMPTY + var context = ShidToPatioContext.EMPTY .declareShidVal("x", PatioTypes.DATA_POINTER).context() .temporaryPush(new PatioLocalRef("a")) .temporaryPush(new PatioLocalRef("b")); - var result = PatioCodeGen.generateInstruction(shid, context); - result = PatioCodeGen.generateInstruction(shid, result); + var result = ShidToPatio.generateInstruction(shid, context); + result = ShidToPatio.generateInstruction(shid, result); snapshotter.assertSnapshot(serialize(result)); } |
