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/ › MacroTranslator.zig › parseCAbstractDeclarator
parseCAbstractDeclarator
MacroTranslator.parseCAbstractDeclarator
fn parseCAbstractDeclarator (mt : *MacroTranslator , node : ZigNode ) ParseError !ZigNode
File
Code
fn parseCAbstractDeclarator (mt : *MacroTranslator , node : ZigNode ) ParseError !ZigNode {
if (mt .eat (.asterisk )) {
if (node .castTag (.type )) |some | {
if (std .mem .eql (u8 , some .data , "anyopaque" )) {
const ptr = try ZigTag .single_pointer .create (mt .t .arena , .{
.is_const = false ,
.is_volatile = false ,
.is_allowzero = false ,
.elem_type = node ,
});
return ZigTag .optional_type .create (mt .t .arena , ptr );
}
}
return ZigTag .c_pointer .create (mt .t .arena , .{
.is_const = false ,
.is_volatile = false ,
.is_allowzero = false ,
.elem_type = node ,
});
}
return node ;
}