Function fromZoirNode [src]

Like fromZoir, but the parse starts at node instead of root.

Prototype

pub fn fromZoirNode( T: type, ast: Ast, zoir: Zoir, node: Zoir.Node.Index, diag: ?*Diagnostics, options: Options, ) error{ParseZon}!T

Parameters

T: typeast: Astzoir: Zoirnode: Zoir.Node.Indexdiag: ?*Diagnosticsoptions: Options

Possible Errors

ParseZon

Source

pub fn fromZoirNode( T: type, ast: Ast, zoir: Zoir, node: Zoir.Node.Index, diag: ?*Diagnostics, options: Options, ) error{ParseZon}!T { comptime assert(!requiresAllocator(T)); var buf: [0]u8 = .{}; var failing_allocator = std.heap.FixedBufferAllocator.init(&buf); return fromZoirNodeAlloc( T, failing_allocator.allocator(), ast, zoir, node, diag, options, ) catch |err| switch (err) { error.OutOfMemory => unreachable, // Checked by comptime assertion above else => |e| return e, }; }