Remove need for type keyword

This commit is contained in:
Ginger Bill
2017-02-10 16:12:14 +00:00
parent f18ae89931
commit 73d6a55f5c
11 changed files with 194 additions and 219 deletions
+8 -2
View File
@@ -5255,7 +5255,13 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
ir_emit_comment(proc, str_lit("TypeMatchStmt"));
gbAllocator allocator = proc->module->allocator;
irValue *parent = ir_build_expr(proc, ms->tag);
ast_node(as, AssignStmt, ms->tag);
GB_ASSERT(as->lhs.count == 1);
GB_ASSERT(as->rhs.count == 1);
AstNode *lhs = as->lhs.e[0];
AstNode *rhs = as->rhs.e[0];
irValue *parent = ir_build_expr(proc, rhs);
bool is_union_ptr = false;
bool is_any = false;
GB_ASSERT(check_valid_type_match_type(ir_type(parent), &is_union_ptr, &is_any));
@@ -5276,7 +5282,7 @@ void ir_build_stmt_internal(irProcedure *proc, AstNode *node) {
ast_node(body, BlockStmt, ms->body);
String tag_var_name = ms->var->Ident.string;
String tag_var_name = lhs->Ident.string;
AstNodeArray default_stmts = {0};