diff options
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/stackir/StackCompiler.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java b/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java index 0d467c0d..bad4f72c 100644 --- a/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java +++ b/src/main/java/org/shedlang/compiler/stackir/StackCompiler.java @@ -315,7 +315,7 @@ public class StackCompiler { compileFunctionReturn(functionReturn, context); case TypedResumeNode resume -> - throw new UnsupportedOperationException("TODO"); + compileResume(resume, context); case TypedWhileNode while_ -> compileWhile(while_, context); @@ -479,6 +479,12 @@ public class StackCompiler { } } + private static Context compileResume(TypedResumeNode node, Context context) { + context = compileExpression(node.expression(), context); + context = context.addInstruction(new ReturnInstruction(node.source())); + return context; + } + private static Context compileStringLiteral( TypedStringLiteralNode node, Context context |
