set_mem->m_val2 = (m_uint)value->d.func_ref->code;
}
-ANN static void emit_func_def_init(const Emitter emit, const Func func) {
- const Type t = emit->env->class_def;
- char c[(t ? strlen(t->name) + 1 : 0) + strlen(func->name) + 6];
- sprintf(c, "%s%s%s(...)", t ? t->name : "", t ? "." : "", func->name);
- emit_push_code(emit, c);
+ANN static inline void emit_func_def_init(const Emitter emit, const Func func) {
+ emit_push_code(emit, func->name);
}
ANN static void emit_func_def_args(const Emitter emit, Arg_List a) {
#include "gwion_ast.h"
m_str code_name_set(MemPool p, const m_str name, const m_str file) {
+ const m_str search = strrchr(name, '@');
+ const m_str is_file = search ? search + 1 : name;
+ if(!strcmp(is_file, file)) {
+ return mstrdup(p, name);
+ }
const size_t len = strlen(name) + strlen(file) + 2;
const m_str str = (const m_str)_mp_malloc(p, len);
sprintf(str, "%s$%s", name, file);