This commit is contained in:
Dominic Grimm 2022-12-23 20:52:25 +01:00
parent bd9b51be9a
commit 115dc530e1
No known key found for this signature in database
GPG key ID: 6F294212DEAAC530
6 changed files with 153 additions and 64 deletions

View file

@ -1,9 +1,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#define UNW_LOCAL_ONLY
#include <libunwind.h>
#include <malloc.h>
#include "hydroforth/hydroforth.h"
@ -60,7 +57,7 @@ int main(int argc, char *argv[])
fputs("No source file specified!\n", stderr);
return 1;
}
FILE *fp = fopen(argv[1], "rb");
FILE *fp = fopen(argv[1], "r");
if (fp == NULL)
{
fputs("Error opening file!\n", stderr);
@ -75,11 +72,11 @@ int main(int argc, char *argv[])
.pos = 0,
.single_char_word_keys_len = 0,
.word_keys_len = 0,
.word_keys_max_len = 0,
.word_definitions_len = 0,
};
HYDROFORTH__RESULT result = {.error = OK, .backtrace_len = 0};
hydroforth.run(&result, &interpreter);
free(res.src);
free(interpreter.src);
if (result.error)
{
hydroforth__add_func_backtrace(&result);