output: render 'usingnamespace'

some constructs are imported using "pub usingnamespace". example:

    zdoc std.x
0.10
alex 2 years ago
parent 054254c5ab
commit 8448fa079b

@ -69,6 +69,18 @@ pub fn renderPubMember(gpa: Allocator, ais: *Ais, tree: Ast, decl: Ast.Node.Inde
try renderExpression(gpa, ais, tree, fn_proto, .newline);
},
.@"usingnamespace" => {
const mtok = main_tokens[decl];
// todo: move this to analyze.isPublic?
if (mtok > 0 and token_tags[mtok - 1] == .keyword_pub) {
try renderToken(ais, tree, mtok - 1, .space); // pub
try renderToken(ais, tree, mtok, .space); // usingnamespace
const expr = datas[decl].lhs;
try renderExpression(gpa, ais, tree, expr, .none);
return renderToken(ais, tree, tree.lastToken(expr) + 1, space); // ;
}
},
//.global_var_decl => return renderVarDecl(gpa, ais, tree, tree.globalVarDecl(decl)),
.simple_var_decl => {
if (analyze.isPublic(tree, decl)) {

Loading…
Cancel
Save