This commit is contained in:
Dominic Grimm 2022-12-23 17:16:29 +01:00
parent 4e8c187050
commit bd9b51be9a
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530
8 changed files with 142 additions and 85 deletions

View file

@ -2,6 +2,9 @@
#include <stdio.h>
#include <stdbool.h>
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#include "hydroforth/hydroforth.h"
struct ReadSrcResult
@ -74,11 +77,13 @@ int main(int argc, char *argv[])
.word_keys_len = 0,
.word_keys_max_len = 0,
};
const bool run_res = hydroforth.run(&interpreter);
HYDROFORTH__RESULT result = {.error = OK, .backtrace_len = 0};
hydroforth.run(&result, &interpreter);
free(res.src);
if (!run_res)
if (result.error)
{
return 1;
hydroforth__add_func_backtrace(&result);
return hydroforth.result.unwrap(&result, 1);
}
}
else