structs can have fields with type var

behavior tests passing now
This commit is contained in:
Andrew Kelley
2019-11-23 17:51:37 -05:00
parent 7597735bad
commit f25182f46d
8 changed files with 97 additions and 61 deletions

View File

@@ -268,6 +268,8 @@ static const char *node_type_str(NodeType node_type) {
return "EnumLiteral";
case NodeTypeErrorSetField:
return "ErrorSetField";
case NodeTypeVarFieldType:
return "VarFieldType";
}
zig_unreachable();
}
@@ -1184,6 +1186,10 @@ static void render_node_extra(AstRender *ar, AstNode *node, bool grouped) {
fprintf(ar->f, ".%s", buf_ptr(&node->data.enum_literal.identifier->data.str_lit.str));
break;
}
case NodeTypeVarFieldType: {
fprintf(ar->f, "var");
break;
}
case NodeTypeParamDecl:
case NodeTypeTestDecl:
case NodeTypeStructField: