aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2023-07-20 10:17:06 +0100
committerMichael Williamson <mike@zwobble.org>2023-07-20 10:17:06 +0100
commite9b4a3d35aa08ff7579957a6c7622fff63f972c4 (patch)
tree8e1bc71702a15c13b4def945640de56a71328484
parent6fb449a6e75e1a879b095656700425de0346d668 (diff)
Rename int to int-get
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolFalseInstructionGeneratesPushIntZeroInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolTrueInstructionGeneratesPushIntOneInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushIntTests]/[method:pushIntInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushUnitTests]/[method:pushUnitInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected2
-rw-r--r--src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java2
-rw-r--r--src/main/java/org/shedlang/compiler/patio/PatioInstructionSerializer.java8
-rw-r--r--src/main/java/org/shedlang/compiler/patio/instructions/PatioInstruction.java2
-rw-r--r--src/main/java/org/shedlang/compiler/patio/instructions/PatioIntGet.java (renamed from src/main/java/org/shedlang/compiler/patio/instructions/PatioInt.java)2
-rw-r--r--src/test/java/org/shedlang/compiler/patio/PatioInstructionSerializerTests.java6
-rw-r--r--src/test/java/org/shedlang/compiler/patio/instructions/Patio.java4
10 files changed, 16 insertions, 16 deletions
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolFalseInstructionGeneratesPushIntZeroInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolFalseInstructionGeneratesPushIntZeroInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index faba9cad..40416415 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolFalseInstructionGeneratesPushIntZeroInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolFalseInstructionGeneratesPushIntZeroInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -1,7 +1,7 @@
Instructions:
(
- (int "tmp__0" 0)
+ (int-get "tmp__0" 0)
)
Temporary stack:
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolTrueInstructionGeneratesPushIntOneInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolTrueInstructionGeneratesPushIntOneInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index 626e6a4c..710f05b4 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolTrueInstructionGeneratesPushIntOneInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushBoolTests]/[method:pushBoolTrueInstructionGeneratesPushIntOneInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -1,7 +1,7 @@
Instructions:
(
- (int "tmp__0" 1)
+ (int-get "tmp__0" 1)
)
Temporary stack:
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushIntTests]/[method:pushIntInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushIntTests]/[method:pushIntInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index d9b2bcd5..c723b551 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushIntTests]/[method:pushIntInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushIntTests]/[method:pushIntInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -1,7 +1,7 @@
Instructions:
(
- (int "tmp__0" 42)
+ (int-get "tmp__0" 42)
)
Temporary stack:
diff --git a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushUnitTests]/[method:pushUnitInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushUnitTests]/[method:pushUnitInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
index faba9cad..40416415 100644
--- a/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushUnitTests]/[method:pushUnitInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
+++ b/snapshots/[engine:junit-jupiter]/[class:org.shedlang.compiler.patio.PatioCodeGenPushUnitTests]/[method:pushUnitInstructionGeneratesPushIntInstruction(org.shedlang.compiler.testing.snapshots.Snapshotter)].expected
@@ -1,7 +1,7 @@
Instructions:
(
- (int "tmp__0" 0)
+ (int-get "tmp__0" 0)
)
Temporary stack:
diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
index fe74e70b..5fdcd30f 100644
--- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
+++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
@@ -124,7 +124,7 @@ public class PatioCodeGen {
context = localResult.context();
return context
- .addInstruction(new PatioInt(local, value, source))
+ .addInstruction(new PatioIntGet(local, value, source))
.temporaryPush(local);
}
}
diff --git a/src/main/java/org/shedlang/compiler/patio/PatioInstructionSerializer.java b/src/main/java/org/shedlang/compiler/patio/PatioInstructionSerializer.java
index d0785c7a..132803fe 100644
--- a/src/main/java/org/shedlang/compiler/patio/PatioInstructionSerializer.java
+++ b/src/main/java/org/shedlang/compiler/patio/PatioInstructionSerializer.java
@@ -50,11 +50,11 @@ public class PatioInstructionSerializer {
)
);
- case PatioInt int_ ->
+ case PatioIntGet intGet ->
treeList(
- treeIdentifier("int"),
- localToTree(int_.target()),
- treeInt(int_.value())
+ treeIdentifier("int-get"),
+ localToTree(intGet.target()),
+ treeInt(intGet.value())
);
case PatioLocalCopy localCopy ->
diff --git a/src/main/java/org/shedlang/compiler/patio/instructions/PatioInstruction.java b/src/main/java/org/shedlang/compiler/patio/instructions/PatioInstruction.java
index 9d68b623..c7ce5e85 100644
--- a/src/main/java/org/shedlang/compiler/patio/instructions/PatioInstruction.java
+++ b/src/main/java/org/shedlang/compiler/patio/instructions/PatioInstruction.java
@@ -2,6 +2,6 @@ package org.shedlang.compiler.patio.instructions;
import org.shedlang.compiler.sources.Source;
-public sealed interface PatioInstruction permits PatioAlloc, PatioCallPointer, PatioFunctionPointerGet, PatioInt, PatioLocalCopy, PatioMemoryLoad, PatioMemoryStore, PatioReturn {
+public sealed interface PatioInstruction permits PatioAlloc, PatioCallPointer, PatioFunctionPointerGet, PatioIntGet, PatioLocalCopy, PatioMemoryLoad, PatioMemoryStore, PatioReturn {
Source source();
}
diff --git a/src/main/java/org/shedlang/compiler/patio/instructions/PatioInt.java b/src/main/java/org/shedlang/compiler/patio/instructions/PatioIntGet.java
index f02c6146..0d1bbfc2 100644
--- a/src/main/java/org/shedlang/compiler/patio/instructions/PatioInt.java
+++ b/src/main/java/org/shedlang/compiler/patio/instructions/PatioIntGet.java
@@ -5,5 +5,5 @@ import org.shedlang.compiler.sources.Source;
/**
* Store the given value in the target local.
*/
-public record PatioInt(PatioLocal target, int value, Source source) implements PatioInstruction {
+public record PatioIntGet(PatioLocal target, int value, Source source) implements PatioInstruction {
}
diff --git a/src/test/java/org/shedlang/compiler/patio/PatioInstructionSerializerTests.java b/src/test/java/org/shedlang/compiler/patio/PatioInstructionSerializerTests.java
index c07ec16f..03e00a92 100644
--- a/src/test/java/org/shedlang/compiler/patio/PatioInstructionSerializerTests.java
+++ b/src/test/java/org/shedlang/compiler/patio/PatioInstructionSerializerTests.java
@@ -42,12 +42,12 @@ public class PatioInstructionSerializerTests {
}
@Test
- public void canSerializeInt() {
- var instruction = Patio.int_("target", 42);
+ public void canSerializeIntGet() {
+ var instruction = Patio.intGet("target", 42);
var string = serialize(instruction);
- assertThat(string, equalTo("(int \"target\" 42)"));
+ assertThat(string, equalTo("(int-get \"target\" 42)"));
}
@Test
diff --git a/src/test/java/org/shedlang/compiler/patio/instructions/Patio.java b/src/test/java/org/shedlang/compiler/patio/instructions/Patio.java
index 54963c34..c9a01ce3 100644
--- a/src/test/java/org/shedlang/compiler/patio/instructions/Patio.java
+++ b/src/test/java/org/shedlang/compiler/patio/instructions/Patio.java
@@ -30,8 +30,8 @@ public class Patio {
return new PatioFunctionPointerGet(new PatioLocal(target), name, Sources.NULL);
}
- public static PatioInstruction int_(String target, int value) {
- return new PatioInt(new PatioLocal(target), value, Sources.NULL);
+ public static PatioInstruction intGet(String target, int value) {
+ return new PatioIntGet(new PatioLocal(target), value, Sources.NULL);
}
public static PatioInstruction localCopy(String target, String value) {