Zig 0.17.0-dev (Split by item)
This is an example of documentation generated by
ZigDoc , an alternative to Zig's built-in
Auto Doc feature. See also
examples in other modes/formats . The project being documented here (as the example) is the Zig library itself.
Zig › compiler/ › translate-c/ › ast.zig › renderStdImport
renderStdImport
ast.renderStdImport
fn renderStdImport (c : *Context , parts : []const []const u8 ) !NodeIndex
File
Code
fn renderStdImport (c : *Context , parts : []const []const u8 ) !NodeIndex {
const import_tok = try c .addToken (.builtin , "@import" );
_ = try c .addToken (.l_paren , "(" );
const std_tok = try c .addToken (.string_literal , "\"std\"" );
const std_node = try c .addNode (.{
.tag = .string_literal ,
.main_token = std_tok ,
.data = undefined ,
});
_ = try c .addToken (.r_paren , ")" );
const import_node = try c .addNode (.{
.tag = .builtin_call_two ,
.main_token = import_tok ,
.data = .{ .opt_node_and_opt_node = .{
std_node .toOptional (), .none ,
} },
});
var access_chain = import_node ;
for (parts ) |part | {
access_chain = try renderFieldAccess (c , access_chain , part );
}
return access_chain ;
}