aboutsummaryrefslogtreecommitdiff
path: root/include/compiler.h
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-03-31 13:44:27 +0200
committerdec05eba <dec05eba@protonmail.com>2020-07-25 14:36:46 +0200
commit6a9466da5377d0bc73c7e5aa48deca3740d3de6f (patch)
tree87f4630f72fe77d037fe19d17bdc00618929f678 /include/compiler.h
parent6927b6338b9655974db79c429e6ffc73037ab5e0 (diff)
Test errors, stop working on error
Diffstat (limited to 'include/compiler.h')
-rw-r--r--include/compiler.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/compiler.h b/include/compiler.h
index b80d7c1..3a31ad9 100644
--- a/include/compiler.h
+++ b/include/compiler.h
@@ -6,7 +6,7 @@
#include "std/buffer_view.h"
#include "std/scoped_allocator.h"
#include "std/thread.h"
-#include "defs.h"
+#include "compiler_options.h"
#include "ast.h"
#define AMAL_COMPILER_OK 0
@@ -31,6 +31,7 @@ typedef struct {
struct amal_compiler {
amal_default_types default_types;
+ amal_compiler_options options;
ScopedAllocator allocator;
Scope root_scope;
Buffer/*<Parser*>*/ parsers;
@@ -39,17 +40,22 @@ struct amal_compiler {
ParserThreadData *threads;
int usable_thread_count;
bool started;
+ bool used;
amal_mutex mutex;
int generic_work_object_index;
};
-CHECK_RESULT int amal_compiler_init(amal_compiler *self);
+void amal_compiler_options_init(amal_compiler_options *self);
+
+/* If @options is NULL, then default values are used */
+CHECK_RESULT int amal_compiler_init(amal_compiler *self, const amal_compiler_options *options);
CHECK_RESULT int amal_compiler_deinit(amal_compiler *self);
/*
This function creates a copy of @filepath in the same thread it's called from
so it doesn't have to survive longer than this function call.
*/
-CHECK_RESULT int amal_compiler_load_file(amal_compiler *self, const char *filepath, FileScopeReference **file_scope);
+CHECK_RESULT int amal_compiler_load_file(amal_compiler *self, const char *filepath);
+CHECK_RESULT int amal_compiler_internal_load_file(amal_compiler *self, const char *filepath, FileScopeReference **file_scope);
/* TODO: amal_compiler_unload_file */
#endif