Add a new implementation struct with only one function.

This commit is contained in:
2018-04-24 16:59:53 -07:00
parent 14e9ddea23
commit 0a24fff344
5 changed files with 32 additions and 3 deletions

View File

@@ -2,18 +2,22 @@
#include "util.h"
void libab_interpreter_init(libab_interpreter* intr,
libab_ref* table) {
libab_ref* table,
libab_impl* impl) {
libab_ref_copy(table, &intr->base_table);
intr->impl = impl;
}
struct interpreter_state {
libab_ref num_ref;
libab_impl* impl;
};
libab_result _interpreter_init(struct interpreter_state* state, libab_interpreter* intr) {
libab_result result = LIBAB_SUCCESS;
libab_basetype* num_type;
libab_ref_null(&state->num_ref);
state->impl = intr->impl;
num_type = libab_table_search_basetype(libab_ref_get(&intr->base_table), "num");
if(num_type != NULL) {