From bd27c24fab9900f46c0b2a92debf2b42a071e463 Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 12 Feb 2017 21:27:13 +0000 Subject: Use a global to store the build context information --- src/parser.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/parser.c') diff --git a/src/parser.c b/src/parser.c index 085aade38..b5d8f442b 100644 --- a/src/parser.c +++ b/src/parser.c @@ -84,9 +84,9 @@ typedef enum ProcCallingConvention { } ProcCallingConvention; typedef enum VarDeclFlag { - VarDeclFlag_thread_local = 1<<0, - VarDeclFlag_using = 1<<1, - VarDeclFlag_immutable = 1<<2, + VarDeclFlag_using = 1<<0, + VarDeclFlag_immutable = 1<<1, + VarDeclFlag_thread_local = 1<<2, } VarDeclFlag; typedef enum StmtStateFlag { @@ -493,15 +493,11 @@ Token ast_node_token(AstNode *node) { case AstNode_ImportDecl: return node->ImportDecl.token; case AstNode_ForeignLibrary: return node->ForeignLibrary.token; - - case AstNode_Field: { + case AstNode_Field: if (node->Field.names.count > 0) { return ast_node_token(node->Field.names.e[0]); - } else { - return ast_node_token(node->Field.type); } - } - + return ast_node_token(node->Field.type); case AstNode_HelperType: return node->HelperType.token; case AstNode_ProcType: return node->ProcType.token; -- cgit v1.2.3