aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java21
1 files changed, 6 insertions, 15 deletions
diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
index 5ddcc13c..bb674bc4 100644
--- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
+++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java
@@ -879,7 +879,12 @@ public class PatioCodeGen {
PatioCodeGenContext context
) {
context = context.enterBlock();
- context = generateBlockInstructions(shidBlock, context);
+
+ context = declareShidVariables(shidBlock, context);
+
+ for (var shidInstruction : shidBlock.instructions()) {
+ context = generateInstruction(shidInstruction, context);
+ }
var targetsResult = context.temporaryPopAll();
var targets = targetsResult.value().reversed();
@@ -896,20 +901,6 @@ public class PatioCodeGen {
));
}
- // TODO: distinguish the two types of block we've apparently ended up with in Shid.
- private static PatioCodeGenContext generateBlockInstructions(
- ShidBlock block,
- PatioCodeGenContext context
- ) {
- context = declareShidVariables(block, context);
-
- for (var shidInstruction : block.instructions()) {
- context = generateInstruction(shidInstruction, context);
- }
-
- return context;
- }
-
private static PatioCodeGenResult<PatioLocalRef> generateCondition(
Source source,
PatioCodeGenContext context