Function fromZoirNode [src]

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

Prototype

pub fn fromZoirNode( T: type, gpa: Allocator, ast: Ast, zoir: Zoir, node: Zoir.Node.Index, status: ?*Status, options: Options, ) error{ OutOfMemory, ParseZon }!T

Parameters

T: typegpa: Allocatorast: Astzoir: Zoirnode: Zoir.Node.Indexstatus: ?*Statusoptions: Options

Possible Errors

OutOfMemory
ParseZon

Source

pub fn fromZoirNode( T: type, gpa: Allocator, ast: Ast, zoir: Zoir, node: Zoir.Node.Index, status: ?*Status, options: Options, ) error{ OutOfMemory, ParseZon }!T { comptime assert(canParseType(T)); if (status) |s| { s.assertEmpty(); s.ast = ast; s.zoir = zoir; } if (zoir.hasCompileErrors()) { return error.ParseZon; } var parser: Parser = .{ .gpa = gpa, .ast = ast, .zoir = zoir, .options = options, .status = status, }; return parser.parseExpr(T, node); }