Type Function unwrap [src]
Prototype
pub fn unwrap(self: Value) union(enum) { instruction: Function.Instruction.Index, constant: Constant, metadata: Metadata, }
Parameters
self: Value
Source
pub fn unwrap(self: Value) union(enum) {
instruction: Function.Instruction.Index,
constant: Constant,
metadata: Metadata,
} {
return if (@intFromEnum(self) < first_constant)
.{ .instruction = @enumFromInt(@intFromEnum(self)) }
else if (@intFromEnum(self) < first_metadata)
.{ .constant = @enumFromInt(@intFromEnum(self) - first_constant) }
else
.{ .metadata = @enumFromInt(@intFromEnum(self) - first_metadata) };
}