Function ifFull [src]
Prototype
pub fn ifFull(tree: Ast, node: Node.Index) full.If
Parameters
tree: Ast
node: Node.Index
Source
pub fn ifFull(tree: Ast, node: Node.Index) full.If {
assert(tree.nodeTag(node) == .@"if");
const cond_expr, const extra_index = tree.nodeData(node).node_and_extra;
const extra = tree.extraData(extra_index, Node.If);
return tree.fullIfComponents(.{
.cond_expr = cond_expr,
.then_expr = extra.then_expr,
.else_expr = extra.else_expr.toOptional(),
.if_token = tree.nodeMainToken(node),
});
}