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 standard library.
std › zig › Ast › fullVarDeclComponents Private Function fullVarDeclComponents Doc Source 1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999 fn fullVarDeclComponents (tree : Ast , info : full .VarDecl .Components ) full .VarDecl {
var result : full .VarDecl = .{
.ast = info ,
.visib_token = null ,
.extern_export_token = null ,
.lib_name = null ,
.threadlocal_token = null ,
.comptime_token = null ,
};
var i = info .mut_token ;
while (i > 0 ) {
i -= 1 ;
switch (tree .tokenTag (i )) {
.keyword_extern , .keyword_export => result .extern_export_token = i ,
.keyword_comptime => result .comptime_token = i ,
.keyword_pub => result .visib_token = i ,
.keyword_threadlocal => result .threadlocal_token = i ,
.string_literal => result .lib_name = i ,
else => break ,
}
}
return result ;
}