}
ANN m_bool _array_check(const Gwi gwi, struct array_checker *ck) {
+ const m_str base = ck->str;
const size_t sz = strlen(ck->str);
char tmp[sz + 1];
for(m_uint i = 0; i < sz; ++i) {
if(isdigit(c))
tmp[i] = c;
else
- GWI_ERR_B(_("invalid subscript '%c' in '%s'"), c, ck->str)
+ GWI_ERR_B(_("invalid subscript '%c' in '%s'"), c, base)
}
- GWI_ERR_B(_("incoherent subscript '%s'"), ck->str)
+ GWI_ERR_B(_("incoherent subscript '%s'"), base)
}
ANN m_bool array_check(const Gwi gwi, struct array_checker *ck) {
DECL_OO(const Fptr_Def, fptr, = import_fptr(gwi, flag))
// what happens if it is in a template class ?
const m_bool ret = traverse_fptr_def(gwi->gwion->env, fptr);
- if(fptr->base->func)
+ if(fptr->base->func) // is it needed ?
SET_FLAG(fptr->base->func, builtin);
const Type t = ret > 0 ? fptr->type : NULL;
free_fptr_def(gwi->gwion->mp, fptr);
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "gwi.h"
+
+GWION_IMPORT(checker) {
+ gwi_item_ini(gwi, "int", "array[]");
+ return GW_OK;
+}
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "gwi.h"
+
+GWION_IMPORT(checker) {
+ gwi_item_ini(gwi, "int", "array[2][3][]");
+ return GW_OK;
+}
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "gwi.h"
+
+GWION_IMPORT(checker) {
+ gwi_item_ini(gwi, "int", "array[.]");
+ return GW_OK;
+}
--- /dev/null
+#include "gwion_util.h"
+#include "gwion_ast.h"
+#include "oo.h"
+#include "vm.h"
+#include "env.h"
+#include "type.h"
+#include "object.h"
+#include "instr.h"
+#include "gwion.h"
+#include "value.h"
+#include "operator.h"
+#include "import.h"
+#include "gwi.h"
+
+GWION_IMPORT(checker) {
+ CHECK_BB(tmpl_valid(gwi, "<l"))
+ return GW_OK;
+}