From 170f3ddc3d8967c0b5d4755c0221c396db215b2f Mon Sep 17 00:00:00 2001 From: Kimplul Date: Sun, 7 Apr 2024 01:28:45 +0300 Subject: implement some initial qbt backend stuff --- src/compiler.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/compiler.c') 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 #include #include +#include #include -#include #include /** @@ -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); -- cgit v1.3