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

This commit is contained in:
alex committed 2023-11-21 04:28:46 -08:00
1 parent 5540918e7c
commit 0a2d029c5c
27 files changed
+115 -19

No files matched your search

@@ -3,4 +3,12 @@ package gay.pizza.pork.bytecode
import kotlinx.serialization.Serializable
@Serializable
data class Op(val code: Opcode, val args: List<UInt>)
class Op(val code: Opcode, val args: List<UInt>) {
override fun toString(): String = buildString {
append(code.name)
if (args.isNotEmpty()) {
append(" ")
append(args.joinToString(" "))
}
}
}