fix NodeErrorSetDecl rendering

master
Vexu 2019-11-06 12:43:33 +02:00 committed by Andrew Kelley
parent 4530adbd33
commit ac6f0d245d
1 changed files with 14 additions and 4 deletions

View File

@ -1137,10 +1137,20 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
for (size_t i = 0; i < node->data.err_set_decl.decls.length; i += 1) {
AstNode *field_node = node->data.err_set_decl.decls.at(i);
assert(field_node->type == NodeTypeSymbol);
switch (field_node->type) {
case NodeTypeSymbol:
print_indent(ar);
print_symbol(ar, field_node->data.symbol_expr.symbol);
fprintf(ar->f, ",\n");
break;
case NodeTypeErrorSetField:
print_indent(ar);
print_symbol(ar, field_node->data.err_set_field.field_name->data.symbol_expr.symbol);
fprintf(ar->f, ",\n");
break;
default:
zig_unreachable();
}
}
ar->indent -= ar->indent_size;