diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-04-07 01:28:45 +0300 |
| commit | 170f3ddc3d8967c0b5d4755c0221c396db215b2f (patch) | |
| tree | 00314209cd7878b9d5b3fe6fc2e0c7297f76dec8 /src/compiler.c | |
| parent | 2bdf1f8b1856bca8091d66a7a447e6c90993c297 (diff) | |
| download | ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.tar.gz ek-170f3ddc3d8967c0b5d4755c0221c396db215b2f.zip | |
implement some initial qbt backend stuff
Diffstat (limited to 'src/compiler.c')
| -rw-r--r-- | src/compiler.c | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/src/compiler.c b/src/compiler.c index 76b420a..b345e16 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -21,8 +21,8 @@ #include <ek/parser.h> #include <ek/debug.h> #include <ek/scope.h> +#include <ek/lower.h> #include <ek/path.h> -#include <ek/ops.h> #include <ek/res.h> /** @@ -140,8 +140,6 @@ int process_file(struct scope **scope, int public, const char *file) if (!cwd) goto out; - debug("(cwd:%s)(dir:%s)(base:%s)", cwd, dir, base); - if (*dir != 0 && chdir(dir)) { error("couldn't change to directory %s: %s", dir, strerror( errno)); @@ -152,7 +150,8 @@ int process_file(struct scope **scope, int public, const char *file) goto out; if (chdir(cwd)) { - error("couldn't change back to directory %s: %s\n", cwd, strerror( + error("couldn't change back to directory %s: %s\n", cwd, + strerror( errno)); goto out; } @@ -163,7 +162,7 @@ out: return res; } -int compile(const char *input, const char *output) { +int compile(const char *input) { int ret = -1; struct scope *root = NULL; if (process_file(&root, 0, input)) { @@ -173,16 +172,7 @@ int compile(const char *input, const char *output) { return ret; } - /* - if ((ret = actualize_main(root))) { - destroy_scope(root); - destroy_ast_nodes(); - error("compilation of %s stopped due to errors", input); - return ret; - } - */ - - if ((ret = lower_ops(root, output))) { + if ((ret = lower_actuals(root))) { destroy_scope(root); destroy_ast_nodes(); error("compilation of %s stopped due to errors", input); |
