aboutsummaryrefslogtreecommitdiff
path: root/include/ast.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-02-27 22:26:35 +0100
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit76d85a10f6cda93eba29dad5372e8160af7289c8 (patch)
treecfec3043ec45a5e83494ec109e87c239dad6cc47 /include/ast.h
parent8201cd9f40897cf6b8e6973b28a8661108702ab1 (diff)
Use multiple threads to parse
Diffstat (limited to 'include/ast.h')
-rw-r--r--include/ast.h19
1 files changed, 14 insertions, 5 deletions
diff --git a/include/ast.h b/include/ast.h
index f3580c0..529b3c8 100644
--- a/include/ast.h
+++ b/include/ast.h
@@ -1,26 +1,29 @@
#ifndef AMALGAM_AST_H
#define AMALGAM_AST_H
-#include "buffer_view.h"
-#include "buffer.h"
-#include "misc.h"
-#include "scoped_allocator.h"
+#include "std/buffer_view.h"
+#include "std/buffer.h"
+#include "std/misc.h"
+#include "std/scoped_allocator.h"
typedef struct FunctionDecl FunctionDecl;
typedef struct FunctionCall FunctionCall;
typedef struct LhsExpr LhsExpr;
+typedef struct Import Import;
typedef union {
FunctionDecl *func_decl;
FunctionCall *func_call;
LhsExpr *lhs_expr;
+ Import *import;
} AstValue;
typedef enum {
AST_NONE,
AST_FUNCTION_DECL,
AST_FUNCTION_CALL,
- AST_LHS
+ AST_LHS,
+ AST_IMPORT
} AstType;
typedef struct {
@@ -43,6 +46,10 @@ struct LhsExpr {
Ast rhs_expr;
};
+struct Import {
+ BufferView path;
+};
+
Ast ast_none();
CHECK_RESULT int funcdecl_init(FunctionDecl *self, ScopedAllocator *allocator);
@@ -52,4 +59,6 @@ void funccall_init(FunctionCall *self, BufferView name);
void lhsexpr_init(LhsExpr *self, int isConst, BufferView var_name);
+void import_init(Import *self, BufferView path);
+
#endif