clean:
$(MAKE) -C ./Tool clean
- $(MAKE) -C ./Serenade clean
+ $(MAKE) -C ./Serenade clean SUFFIX_SO="$(SUFFIX_SO)" PREFIX_SO="$(PREFIX_SO)"
rm -f config.h
FILES = `find . -name "*.c" -or -name "*.h"`
struct sn_interpreter* sn = malloc(sizeof(struct sn_interpreter));
sn->variables = malloc(sizeof(struct sn_interpreter_kv*));
sn->variables[0] = NULL;
+ sn->local_variables = NULL;
sn->generics = malloc(sizeof(struct sn_generic**));
sn->generics[0] = NULL;
+ sn->callstack = 0;
return sn;
}
struct sn_interpreter_kv** variables;
struct sn_interpreter_kv** local_variables;
struct sn_generic*** generics;
+ int callstack;
};
struct sn_interpreter_kv {
int i;
struct sn_interpreter_kv** old_kv = sn->local_variables;
sn->local_variables = malloc(sizeof(struct sn_interpreter_kv*));
- sn->local_variables[i] = NULL;
+ sn->local_variables[0] = NULL;
+ sn->callstack++;
for(i = 0; gens[i] != NULL; i++) {
_sn_run(sn, gens[i]);
}
+ sn->callstack--;
free(sn->local_variables);
sn->local_variables = old_kv;
return r;