mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2026-11-04 16:02:20 +00:00
language: introduce the requirement to use return to return a value from a function
This commit is contained in:
27 files changed
+115
-19
No files matched your search
@@ -12,6 +12,8 @@ class VirtualMachine(world: CompiledWorld) : ExecutionContext {
|
||||
TrueOpHandler,
|
||||
FalseOpHandler,
|
||||
|
||||
NoneOpHandler,
|
||||
|
||||
ListMakeOpHandler,
|
||||
ListSizeOpHandler,
|
||||
|
||||
|
||||
@@ -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