mirror of
https://github.com/GayPizzaSpecifications/pork.git
synced 2025-08-04 05:31:33 +00:00
language: introduce the requirement to use return to return a value from a function
This commit is contained in:
@ -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(" "))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user