diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-15 10:25:18 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-15 10:25:18 +0000 |
| commit | 6d5250e96522ee6aaf856d11591c6b4545be2abb (patch) | |
| tree | 0b6362bfdaeb659abf266a5a824bca92103e53f7 /src/main/java | |
| parent | 429c677f1c22c400064c0f9d69e69b340e61fdb4 (diff) | |
Inline generateBlockInstructions()
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java | 21 |
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 |
