Function wrap [src]
Prototype
pub fn wrap(cap: Unwrapped) Capture
Parameters
cap: Unwrapped
Source
pub fn wrap(cap: Unwrapped) Capture {
return switch (cap) {
.nested => |idx| .{
.tag = .nested,
.data = idx,
},
.instruction => |inst| .{
.tag = .instruction,
.data = @intCast(@intFromEnum(inst)),
},
.instruction_load => |inst| .{
.tag = .instruction_load,
.data = @intCast(@intFromEnum(inst)),
},
.decl_val => |str| .{
.tag = .decl_val,
.data = @intCast(@intFromEnum(str)),
},
.decl_ref => |str| .{
.tag = .decl_ref,
.data = @intCast(@intFromEnum(str)),
},
};
}