-Subproject commit 86c07142d6942990d228ed1cd4d584e898cfe90f
+Subproject commit b032c9500ff15c8b20a01f3abcb3e1751d4b465f
ANN Func get_func(const Env, const Func_Def);
ANN m_bool traverse_func_template(const Env env, const Func_Def def, const Type_List types);
ANN ID_List str2list(const Env, const m_str path, m_uint* array_depth);
+ANN void env_err(const Env, const uint pos, const m_str fmt, ...);
#endif
ANN VM* gwion_cpy(const VM*);
ANN void gwion_run(const Gwion gwion);
ANN void gwion_end(const Gwion gwion);
-ANN void gwion_err(const Gwion gwion, const uint pos, const m_str fmt, ...);
#endif
#define insert_symbol(a) insert_symbol(env->gwion->st, (a))
#undef ERR_B
-#define ERR_B(a, b, ...) { gwion_err(env->gwion, (a), (b), ## __VA_ARGS__); return GW_ERROR; }
+#define ERR_B(a, b, ...) { env_err(env, (a), (b), ## __VA_ARGS__); return GW_ERROR; }
#undef ERR_O
-#define ERR_O(a, b, ...) { gwion_err(env->gwion, (a), (b), ## __VA_ARGS__); return NULL; }
+#define ERR_O(a, b, ...) { env_err(env, (a), (b), ## __VA_ARGS__); return NULL; }
#define RET_NSPC(exp) \
++env->scope->depth; \
#define insert_symbol(a) insert_symbol(emit->env->gwion->st, (a))
#undef ERR_B
-#define ERR_B(a, b, ...) { gwion_err(emit->gwion, (a), (b), ## __VA_ARGS__); return GW_ERROR; }
+#define ERR_B(a, b, ...) { env_err(emit->env, (a), (b), ## __VA_ARGS__); return GW_ERROR; }
#undef ERR_O
-#define ERR_O(a, b, ...) { gwion_err(emit->gwion, (a), (b), ## __VA_ARGS__); return NULL; }
+#define ERR_O(a, b, ...) { env_err(emit->env, (a), (b), ## __VA_ARGS__); return NULL; }
typedef struct Local_ {
m_uint size;
mempool_end(gwion->p);
}
-ANN void gwion_err(const Gwion gwion, const uint pos, const m_str fmt, ...) {
- const Env env = gwion->env;
+ANN void env_err(const Env env, const uint pos, const m_str fmt, ...) {
gw_err("in file: '%s'\n", env->name);
if(env->class_def)
gw_err("in class: '%s'\n", env->class_def->name);
env_reset(gwi.gwion->env);
}
return GW_OK;
-}
+}
\ No newline at end of file
}
if(c == ',') {
if(!lvl) {
- gwion_err(env->gwion, 0, "illegal use of ',' outside of templating in name '%s'.", a);
+ env_err(env, 0, "illegal use of ',' outside of templating in name '%s'.", a);
return GW_ERROR;
}
continue;
}
if(c == '>') {
if(!lvl) {
- gwion_err(env->gwion, 0, "illegal templating in name '%s'.", a);
+ env_err(env, 0, "illegal templating in name '%s'.", a);
return GW_ERROR;
}
lvl--;
continue;
}
- gwion_err(env->gwion, 0, "illegal character '%c' in name '%s'.", c, a);
+ env_err(env, 0, "illegal character '%c' in name '%s'.", c, a);
return GW_ERROR;
}
return !lvl ? 1 : -1;
for(m_uint i = p->len + 1; --i;) {
const char c = p->path[i - 1];
if(c != '.' && check_illegal(p->curr, c, i) < 0) {
- gwion_err(env->gwion, 0, "illegal character '%c' in path '%s'.", c, p->path);
+ env_err(env, 0, "illegal character '%c' in path '%s'.", c, p->path);
return GW_ERROR;
}
if(c == '.' || i == 1) {
*list = prepend_id_list(env->gwion->st->p, insert_symbol(env->gwion->st, p->curr), *list, 0);
memset(p->curr, 0, p->len + 1);
} else {
- gwion_err(env->gwion, 0, "path '%s' must not ini or end with '.'.", p->path);
+ env_err(env, 0, "path '%s' must not ini or end with '.'.", p->path);
return GW_ERROR;
}
}
#include "gwion.h"
#include "arg.h"
+#ifdef __linux__
+#include<libintl.h>
+#include<locale.h>
+#endif
+
static jmp_buf jmp;
static struct Gwion_ gwion;
}
int main(int argc, char** argv) {
+// setlocale(LC_ALL,"");
+// bindtextdomain ("bison-runtime", "/usr/share/locale");
Arg arg = { .argc=argc, .argv=argv, .loop=-1 };
signal(SIGINT, sig);
signal(SIGTERM, sig);
ANN static Type prim_id_non_res(const Env env, const Exp_Primary* primary) {
const Value v = check_non_res_value(env, primary);
if(!v || !GET_FLAG(v, checked)) {
- gwion_err(env->gwion, exp_self(primary)->pos,
+ env_err(env, exp_self(primary)->pos,
"variable %s not legit at this point.", s_name(primary->d.var));
did_you_mean(env->gwion->st, s_name(primary->d.var));
return NULL;
}
ANN2(1) static void* function_alternative(const Env env, const Type f, const Exp args, const uint pos){
- gwion_err(env->gwion, pos, "argument type(s) do not match for function. should be :");
+ env_err(env, pos, "argument type(s) do not match for function. should be :");
Func up = f->d.func;
do {
gw_err("(%s)\t", up->name);