diff options
| author | Ginger Bill <github@gingerbill.org> | 2016-10-26 15:05:41 +0100 |
|---|---|---|
| committer | Ginger Bill <github@gingerbill.org> | 2016-10-26 15:05:41 +0100 |
| commit | aed7a83f5b8e812b3c2c31bdf745a3107da80190 (patch) | |
| tree | e05d17f33801c8982d019ee56dd596d36f4e305a /src/parser.cpp | |
| parent | 6996df410456292b358b8deaabd5ba2aea7af069 (diff) | |
Code reorganization - Separate files and slice refactoring
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index 642e838e1..c36fbf85a 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -1996,7 +1996,7 @@ AstNodeArray parse_struct_params(AstFile *f, isize *decl_count_, b32 using_allow expect_semicolon_after_stmt(f, decl); - if (decl != NULL && is_ast_node_decl(decl)) { + if (is_ast_node_decl(decl)) { array_add(&decls, decl); if (decl->kind == AstNode_VarDecl) { decl->VarDecl.is_using = is_using && using_allowed; @@ -2157,13 +2157,8 @@ AstNode *parse_identifier_or_type(AstFile *f, u32 flags) { return make_enum_type(f, token, base_type, fields); } - case Token_proc: { - AstNode *curr_proc = f->curr_proc; - AstNode *type = parse_proc_type(f); - f->curr_proc = type; - f->curr_proc = curr_proc; - return type; - } + case Token_proc: + return parse_proc_type(f); case Token_OpenParen: { // NOTE(bill): Skip the paren expression @@ -2527,12 +2522,10 @@ AstNode *parse_match_stmt(AstFile *f) { Token token = expect_token(f, Token_match); AstNode *init = NULL; - AstNode *tag = NULL; + AstNode *tag = NULL; AstNode *body = NULL; Token open, close; - - if (allow_token(f, Token_type)) { isize prev_level = f->expr_level; f->expr_level = -1; |