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 › std/ › zig/ › Ast.zig › fullSwitchCaseComponents
fullSwitchCaseComponents
Ast.fullSwitchCaseComponents
fn fullSwitchCaseComponents (tree : Ast , info : full .SwitchCase .Components , node : Node .Index ) full .SwitchCase
File
Code
fn fullSwitchCaseComponents (tree : Ast , info : full .SwitchCase .Components , node : Node .Index ) full .SwitchCase {
var result : full .SwitchCase = .{
.ast = info ,
.payload_token = null ,
.inline_token = null ,
};
if (tree .tokenTag (info .arrow_token + 1 ) == .pipe ) {
result .payload_token = info .arrow_token + 2 ;
}
result .inline_token = switch (tree .nodeTag (node )) {
.switch_case_inline , .switch_case_inline_one => if (result .ast .values .len == 0 )
info .arrow_token - 2
else
tree .firstToken (result .ast .values [0 ]) - 1 ,
else => null ,
};
return result ;
}