diff options
| author | Michael Williamson <mike@zwobble.org> | 2023-12-15 11:55:41 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2023-12-15 11:55:41 +0000 |
| commit | 64ae63e69b6a5f180b869bd49fa92aaed7407021 (patch) | |
| tree | 16d89803c89f31c71b2ec38fad25b0d14150ba6a /src/main/java | |
| parent | 9e0b6a33c18e5757587e71a341f11bc9d8031f99 (diff) | |
Fix name of instruction
Diffstat (limited to 'src/main/java')
| -rw-r--r-- | src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java | 2 | ||||
| -rw-r--r-- | src/main/java/org/shedlang/compiler/shid/ShidCodeGen.java | 2 | ||||
| -rw-r--r-- | src/main/java/org/shedlang/compiler/shid/ShidSerializer.java | 2 | ||||
| -rw-r--r-- | src/main/java/org/shedlang/compiler/shid/instructions/ShidEffectHandlerBreak.java (renamed from src/main/java/org/shedlang/compiler/shid/instructions/ShedEffectHandlerBreak.java) | 2 | ||||
| -rw-r--r-- | src/main/java/org/shedlang/compiler/shid/instructions/ShidInstruction.java | 6 |
5 files changed, 7 insertions, 7 deletions
diff --git a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java index 2107991d..925b540a 100644 --- a/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java +++ b/src/main/java/org/shedlang/compiler/patio/PatioCodeGen.java @@ -304,7 +304,7 @@ public class PatioCodeGen { yield context.temporaryPush(value).temporaryPush(value); } - case ShedEffectHandlerBreak effectHandlerBreak -> { + case ShidEffectHandlerBreak effectHandlerBreak -> { var valueResult = context.temporaryPop(); var value = valueResult.value(); context = valueResult.context(); diff --git a/src/main/java/org/shedlang/compiler/shid/ShidCodeGen.java b/src/main/java/org/shedlang/compiler/shid/ShidCodeGen.java index fee218db..cf14766c 100644 --- a/src/main/java/org/shedlang/compiler/shid/ShidCodeGen.java +++ b/src/main/java/org/shedlang/compiler/shid/ShidCodeGen.java @@ -93,7 +93,7 @@ public class ShidCodeGen { private static Context compileBreak(TypedBreakNode node, Context context) { context = compileExpression(node.expression(), context); - context = context.addInstruction(new ShedEffectHandlerBreak(node.handledEffect(), node.source())); + context = context.addInstruction(new ShidEffectHandlerBreak(node.handledEffect(), node.source())); return context; } diff --git a/src/main/java/org/shedlang/compiler/shid/ShidSerializer.java b/src/main/java/org/shedlang/compiler/shid/ShidSerializer.java index 66f6e049..09501abe 100644 --- a/src/main/java/org/shedlang/compiler/shid/ShidSerializer.java +++ b/src/main/java/org/shedlang/compiler/shid/ShidSerializer.java @@ -126,7 +126,7 @@ public class ShidSerializer { treeIdentifier("duplicate") ); - case ShedEffectHandlerBreak effectHandlerBreak -> + case ShidEffectHandlerBreak effectHandlerBreak -> treeList( treeIdentifier("effect-handler-break"), userDefinedEffectToTree(effectHandlerBreak.effect()) diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShedEffectHandlerBreak.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidEffectHandlerBreak.java index 156352b8..b19edcd5 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShedEffectHandlerBreak.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidEffectHandlerBreak.java @@ -7,7 +7,7 @@ import org.shedlang.compiler.types.UserDefinedEffect; * Pop a value from the temporary value stack and exit with that value from * the closest try expression in the call stack that handles the given effect. */ -public record ShedEffectHandlerBreak( +public record ShidEffectHandlerBreak( UserDefinedEffect effect, Source source ) implements ShidInstruction { diff --git a/src/main/java/org/shedlang/compiler/shid/instructions/ShidInstruction.java b/src/main/java/org/shedlang/compiler/shid/instructions/ShidInstruction.java index 2b559d9d..8eb2b3a0 100644 --- a/src/main/java/org/shedlang/compiler/shid/instructions/ShidInstruction.java +++ b/src/main/java/org/shedlang/compiler/shid/instructions/ShidInstruction.java @@ -3,11 +3,11 @@ package org.shedlang.compiler.shid.instructions; import org.shedlang.compiler.sources.Source; public sealed interface ShidInstruction - permits ShedEffectHandlerBreak, ShidBlock, ShidCall, ShidDefineEffect, ShidDefineFunction, ShidDefineStruct, ShidDiscard, ShidDuplicate, ShidFieldLoad, ShidIf, ShidIntAdd, ShidIntEquals, ShidIntNotEqual, ShidIntSub, ShidLocalDrop, ShidLocalLoad, ShidLocalStore, ShidLoop, ShidLoopBreak, ShidLoopContinue, ShidNamespaceFieldStore, ShidNamespaceImport, ShidPushBool, ShidPushInt, ShidPushString, ShidPushUnit, ShidResume, ShidReturn, ShidStringAdd, ShidSwitch, ShidTry, ShidTupleCreate, ShidTupleGet, ShidVarLoad, ShidVarStore { + permits ShidEffectHandlerBreak, ShidBlock, ShidCall, ShidDefineEffect, ShidDefineFunction, ShidDefineStruct, ShidDiscard, ShidDuplicate, ShidFieldLoad, ShidIf, ShidIntAdd, ShidIntEquals, ShidIntNotEqual, ShidIntSub, ShidLocalDrop, ShidLocalLoad, ShidLocalStore, ShidLoop, ShidLoopBreak, ShidLoopContinue, ShidNamespaceFieldStore, ShidNamespaceImport, ShidPushBool, ShidPushInt, ShidPushString, ShidPushUnit, ShidResume, ShidReturn, ShidStringAdd, ShidSwitch, ShidTry, ShidTupleCreate, ShidTupleGet, ShidVarLoad, ShidVarStore { /** - * If an instruction is a terminator, any following instructions in the - * current block are guaranteed to be unreachable. + * If an instruction is a terminator, execution is guaranteed to leave the + * current block. */ boolean isTerminator(); |
