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 › parseCShiftExpr
parseCShiftExpr
MacroTranslator.parseCShiftExpr
fn parseCShiftExpr (mt : *MacroTranslator , scope : *Scope ) ParseError !ZigNode
File
Code
fn parseCShiftExpr (mt : *MacroTranslator , scope : *Scope ) ParseError !ZigNode {
var node = try mt .parseCAddSubExpr (scope );
while (true ) {
switch (mt .peek ()) {
.angle_bracket_angle_bracket_left => {
mt .i += 1 ;
const lhs = try mt .macroIntFromBool (node );
const rhs = try mt .macroIntFromBool (try mt .parseCAddSubExpr (scope ));
node = try ZigTag .shl .create (mt .t .arena , .{ .lhs = lhs , .rhs = rhs });
},
.angle_bracket_angle_bracket_right => {
mt .i += 1 ;
const lhs = try mt .macroIntFromBool (node );
const rhs = try mt .macroIntFromBool (try mt .parseCAddSubExpr (scope ));
node = try ZigTag .shr .create (mt .t .arena , .{ .lhs = lhs , .rhs = rhs });
},
else => return node ,
}
}
}