mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-03 13:11:32 +00:00
language: introduce the requirement to use return to return a value from a function
This commit is contained in:
@ -12,6 +12,8 @@ class VirtualMachine(world: CompiledWorld) : ExecutionContext {
|
||||
TrueOpHandler,
|
||||
FalseOpHandler,
|
||||
|
||||
NoneOpHandler,
|
||||
|
||||
ListMakeOpHandler,
|
||||
ListSizeOpHandler,
|
||||
|
||||
|
12
vm/src/main/kotlin/gay/pizza/pork/vm/ops/NoneOpHandler.kt
Normal file
12
vm/src/main/kotlin/gay/pizza/pork/vm/ops/NoneOpHandler.kt
Normal 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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user