Nspc nspc;
struct Map_ lbls;
HAS_OBJ
+ m_bool error;
};
ANN2(2) ANEW Context new_context(MemPool p, const Ast, const m_str);
if(!stmt->is_label)
stmt->data.instr = emit_add_instr(emit, Goto);
else {
- if(switch_inside(emit->env, stmt_self(stmt)->pos) > 0 && !strcmp(s_name(stmt->name), "default"))
+ if(!strcmp(s_name(stmt->name), "default") && switch_inside(emit->env, stmt_self(stmt)->pos) > 0)
return switch_default(emit->env, emit_code_size(emit), stmt_self(stmt)->pos);
if(!stmt->data.v.ptr)
ERR_B(stmt_self(stmt)->pos, _("illegal case"))
#include "oo.h"
#include "vm.h"
#include "env.h"
+#include "context.h"
#include "type.h"
#include "func.h"
#include "value.h"
}
ANN void env_err(const Env env, const struct YYLTYPE* pos, const m_str fmt, ...) {
+ if(env->context->error)
+ return;
if(env->class_def)
gw_err(_("in class: '%s'\n"), env->class_def->name);
if(env->func)
va_end(arg);
fprintf(stderr, "\n");
loc_err(pos, env->name);
+ env->context->error = 1;
}
}
ANN static m_bool check_exp_call1_check(const Env env, const Exp exp) {
- if(!check_exp(env, exp))
- ERR_B(exp->pos, _("function call using a non-existing function"))
+ CHECK_OB(check_exp(env, exp))
+// if(!check_exp(env, exp))
+// ERR_B(exp->pos, _("function call using a non-existing function"))
if(isa(exp->type, t_function) < 0)
ERR_B(exp->pos, _("function call using a non-function value"))
return GW_OK;
+++ /dev/null
-// [contains] function call using a non-existing function
- test();