Update
This commit is contained in:
parent
4e8c187050
commit
bd9b51be9a
8 changed files with 142 additions and 85 deletions
11
src/main.c
11
src/main.c
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue