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: type
gpa: Allocator
ast: Ast
zoir: Zoir
node: Zoir.Node.Index
status: ?*Status
options: Options
Possible Errors
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);
}