diff options
| author | gingerBill <ginger.bill.22@gmail.com> | 2016-08-16 20:08:40 +0100 |
|---|---|---|
| committer | gingerBill <ginger.bill.22@gmail.com> | 2016-08-16 20:08:40 +0100 |
| commit | e8530ca883edd79c188443ced54cea2c5d3ad4ed (patch) | |
| tree | 4e264d51cbbbe41f0dc7eed16bcdbb73f372c844 /src/parser.cpp | |
| parent | 2d49a615630eb27d95c7cde67722f419a1977996 (diff) | |
Win32 Demo: OpenGL Context
Diffstat (limited to 'src/parser.cpp')
| -rw-r--r-- | src/parser.cpp | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index cce4bc551..d6c450a88 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -177,7 +177,6 @@ AST_NODE_KIND(_DeclBegin, struct{}) \ String foreign_name; \ }) \ AST_NODE_KIND(TypeDecl, struct { Token token; AstNode *name, *type; }) \ - AST_NODE_KIND(AliasDecl, struct { Token token; AstNode *name, *type; }) \ AST_NODE_KIND(LoadDecl, struct { Token token, filepath; }) \ AST_NODE_KIND(_DeclEnd, struct{}) \ AST_NODE_KIND(_TypeBegin, struct{}) \ @@ -336,8 +335,6 @@ Token ast_node_token(AstNode *node) { return node->ProcDecl.name->Ident.token; case AstNode_TypeDecl: return node->TypeDecl.token; - case AstNode_AliasDecl: - return node->AliasDecl.token; case AstNode_LoadDecl: return node->LoadDecl.token; case AstNode_Field: { @@ -759,15 +756,6 @@ gb_inline AstNode *make_type_decl(AstFile *f, Token token, AstNode *name, AstNod return result; } -gb_inline AstNode *make_alias_decl(AstFile *f, Token token, AstNode *name, AstNode *type) { - AstNode *result = make_node(f, AstNode_AliasDecl); - result->AliasDecl.token = token; - result->AliasDecl.name = name; - result->AliasDecl.type = type; - return result; -} - - gb_inline AstNode *make_load_decl(AstFile *f, Token token, Token filepath) { AstNode *result = make_node(f, AstNode_LoadDecl); result->LoadDecl.token = token; @@ -1948,31 +1936,7 @@ AstNode *parse_stmt(AstFile *f) { AstNode *name = parse_identifier(f); expect_token(f, Token_Colon); AstNode *type = parse_type(f); - - AstNode *type_decl = make_type_decl(f, token, name, type); - - if (type->kind != AstNode_StructType && - type->kind != AstNode_ProcType) { - expect_token(f, Token_Semicolon); - } - - return type_decl; - } break; - - case Token_alias: { - Token token = expect_token(f, Token_alias); - AstNode *name = parse_identifier(f); - expect_token(f, Token_Colon); - AstNode *type = parse_type(f); - - AstNode *alias_decl = make_alias_decl(f, token, name, type); - - if (type->kind != AstNode_StructType && - type->kind != AstNode_ProcType) { - expect_token(f, Token_Semicolon); - } - - return alias_decl; + return make_type_decl(f, token, name, type); } break; // Operands |