From 39e9003ac5b1c63c965f68b94b41e5df43d0104d Mon Sep 17 00:00:00 2001 From: Brendan Hansen Date: Wed, 23 Sep 2020 12:47:05 -0500 Subject: [PATCH] forgot to add astnodes.h --- include/onyxastnodes.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/include/onyxastnodes.h b/include/onyxastnodes.h index 97432168..fb6994f4 100644 --- a/include/onyxastnodes.h +++ b/include/onyxastnodes.h @@ -26,6 +26,7 @@ typedef struct AstStructLiteral AstStructLiteral; typedef struct AstReturn AstReturn; typedef struct AstJump AstJump; +typedef struct AstUse AstUse; typedef struct AstBlock AstBlock; typedef struct AstIfWhile AstIfWhile; @@ -142,6 +143,7 @@ typedef enum AstKind { Ast_Kind_For, Ast_Kind_While, Ast_Kind_Jump, + Ast_Kind_Use, Ast_Kind_Defer, Ast_Kind_Switch, Ast_Kind_Switch_Case, @@ -439,7 +441,7 @@ struct AstArgument { AstTyped_base; AstTyped *value; }; struct AstAddressOf { AstTyped_base; AstTyped *expr; }; struct AstDereference { AstTyped_base; AstTyped *expr; }; struct AstArrayAccess { AstTyped_base; AstTyped *addr; AstTyped *expr; u64 elem_size; }; -struct AstFieldAccess { AstTyped_base; AstTyped *expr; u32 offset; u32 idx; }; +struct AstFieldAccess { AstTyped_base; AstTyped *expr; u32 offset; u32 idx; char* field; }; // If token is null, defer to field struct AstSizeOf { AstTyped_base; AstType *so_type; u64 size; }; struct AstAlignOf { AstTyped_base; AstType *ao_type; u64 alignment; }; struct AstFileContents { AstTyped_base; OnyxToken *filename; u32 addr, size; }; @@ -455,6 +457,7 @@ struct AstStructLiteral { // Intruction Node struct AstReturn { AstNode_base; AstTyped* expr; }; struct AstJump { AstNode_base; JumpType jump; u32 count; }; +struct AstUse { AstNode_base; AstTyped* expr; }; // Structure Nodes struct AstBlock { AstNode_base; AstNode *body; Scope *scope; bh_arr(AstLocal *) locals; }; -- 2.25.1