ANN m_int gwi_func_arg(const Gwi gwi, const __restrict__ m_str t, const __restrict__ m_str n);
ANN m_int gwi_func_end(const Gwi gwi, const ae_flag flag);
-ANN2(1) m_int gwi_oper_ini(const Gwi gwi, const m_str l, const m_str r, const m_str t);
-ANN m_int gwi_oper_add(const Gwi gwi, const opck);
-ANN m_int gwi_oper_emi(const Gwi gwi, const opem);
-ANN2(1) m_int gwi_oper_end(const Gwi gwi, const m_str op, const f_instr f);
-ANN m_int gwi_oper_cond(const Gwi, const m_str, const f_instr, const f_instr);
-ANN Type_Decl* str2decl(const Env, const m_str, m_uint* depth, const loc_t);
+#include "import/oper.h"
+#include "import/special.h"
OP_CHECK(opck_const_rhs);
OP_CHECK(opck_unary_meta);
ANN Type_List str2tl(const Env env, const m_str s, const loc_t);
-#define FREEARG(a) ANN void a(Instr instr NUSED, void *gwion NUSED)
-typedef void (*f_freearg)(Instr, void*);
-ANN void register_freearg(const Gwi, const f_instr, const f_freearg);
-ANN void gwi_reserve(const Gwi, const m_str);
-typedef struct SpecialId_* SpecialId;
-ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId);
-ANN void gwi_set_loc(const Gwi, const m_str, const uint);
#endif
--- /dev/null
+#ifndef __IMPORT_SPECIAL
+#define __IMPORT_SPECIAL
+
+#define FREEARG(a) ANN void a(Instr instr NUSED, void *gwion NUSED)
+typedef void (*f_freearg)(Instr, void*);
+ANN void register_freearg(const Gwi, const f_instr, const f_freearg);
+ANN void gwi_reserve(const Gwi, const m_str);
+typedef struct SpecialId_* SpecialId;
+ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId);
+ANN void gwi_set_loc(const Gwi, const m_str, const uint);
+
+ANN Type_Decl* str2decl(const Env env, const m_str s, m_uint *depth, const loc_t pos);
+
+#endif
--- /dev/null
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "value.h"
+#include "traverse.h"
+#include "instr.h"
+#include "object.h"
+#include "emit.h"
+#include "func.h"
+#include "nspc.h"
+#include "gwion.h"
+#include "operator.h"
+#include "import.h"
+#include "gwi.h"
+#include "gwi.h"
+#include "parser.h"
+#include "specialid.h"
+
+ANN void register_freearg(const Gwi gwi, const f_instr _exec, const f_freearg _free) {
+ map_set(&gwi->gwion->data->freearg, (vtype)_exec, (vtype)_free);
+}
+
+ANN void gwi_reserve(const Gwi gwi, const m_str str) {
+ vector_add(&gwi->gwion->data->reserved, (vtype)insert_symbol(gwi->gwion->st, str));
+}
+
+ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId spid) {
+ struct SpecialId_ *a = mp_calloc(gwi->gwion->mp, SpecialId);
+ memcpy(a, spid, sizeof(struct SpecialId_));
+ map_set(&gwi->gwion->data->id, (vtype)insert_symbol(gwi->gwion->st, id), (vtype)a);
+ gwi_reserve(gwi, id);
+}
+
+ANN void gwi_set_loc(const Gwi gwi, const m_str file, const uint line) {
+ gwi->loc->first_line = gwi->loc->last_line = line;
+ gwi->gwion->env->name = file;
+}
gwi->union_data.type_name = NULL;
return t;
}
-
-ANN void register_freearg(const Gwi gwi, const f_instr _exec, const f_freearg _free) {
- map_set(&gwi->gwion->data->freearg, (vtype)_exec, (vtype)_free);
-}
-
-ANN void gwi_reserve(const Gwi gwi, const m_str str) {
- vector_add(&gwi->gwion->data->reserved, (vtype)insert_symbol(gwi->gwion->st, str));
-}
-
-ANN void gwi_specialid(const Gwi gwi, const m_str id, const SpecialId spid) {
- struct SpecialId_ *a = mp_calloc(gwi->gwion->mp, SpecialId);
- memcpy(a, spid, sizeof(struct SpecialId_));
- map_set(&gwi->gwion->data->id, (vtype)insert_symbol(gwi->gwion->st, id), (vtype)a);
- gwi_reserve(gwi, id);
-}
-
-ANN void gwi_set_loc(const Gwi gwi, const m_str file, const uint line) {
- gwi->loc->first_line = gwi->loc->last_line = line;
- gwi->gwion->env->name = file;
-}