language: introduce the requirement to use return to return a value from a function

This commit is contained in:
2023-11-21 04:28:46 -08:00
parent 5540918e7c
commit 0a2d029c5c
27 changed files with 115 additions and 19 deletions

View File

@ -12,6 +12,8 @@ class VirtualMachine(world: CompiledWorld) : ExecutionContext {
TrueOpHandler,
FalseOpHandler,
NoneOpHandler,
ListMakeOpHandler,
ListSizeOpHandler,

View File

@ -0,0 +1,12 @@
package gay.pizza.pork.vm.ops
import gay.pizza.pork.bytecode.Op
import gay.pizza.pork.bytecode.Opcode
import gay.pizza.pork.vm.InternalMachine
import gay.pizza.pork.vm.OpHandler
object NoneOpHandler : OpHandler(Opcode.None) {
override fun handle(machine: InternalMachine, op: Op) {
machine.push(Unit)
}
}