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/ › Render.zig › renderQuotedIdentifier
renderQuotedIdentifier
Render.renderQuotedIdentifier
fn renderQuotedIdentifier (r : *Render , token_index : Ast .TokenIndex , space : Space , comptime unquote : bool ) !void
File
Code
fn renderQuotedIdentifier (r : *Render , token_index : Ast .TokenIndex , space : Space , comptime unquote : bool ) !void {
const tree = r .tree ;
const ais = r .ais ;
assert (tree .tokenTag (token_index ) == .identifier );
const lexeme = tokenSliceForRender (tree , token_index );
assert (lexeme .len >= 3 and lexeme [0 ] == '@' );
if (!unquote ) try ais .writeAll ("@\"" );
const contents = lexeme [2 .. lexeme .len - 1 ];
try renderIdentifierContents (ais , contents );
if (!unquote ) try ais .writeByte ('\"' );
try renderSpace (r , token_index , lexeme .len , space );
}