From: fennecdjay Date: Fri, 28 Oct 2022 05:19:30 +0000 (+0200) Subject: :art: more on internal ops X-Git-Tag: nightly~207^2~104 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=ddcd2dd094fbf3fc7ee153ca66ec2df380f22f10;p=gwion.git :art: more on internal ops --- diff --git a/src/parse/scan1.c b/src/parse/scan1.c index 89ce3798..1d034d2a 100644 --- a/src/parse/scan1.c +++ b/src/parse/scan1.c @@ -605,6 +605,13 @@ ANN static m_bool scan_internal(const Env env, const Func_Base *base) { if (op == insert_symbol("@conditional") || op == insert_symbol("@unconditional")) return scan_internal_int(env, base); + if(op == insert_symbol("@array_init") || + op == insert_symbol("@each") || + op == insert_symbol("@each_idx") || + op == insert_symbol("@each_init") || + op == insert_symbol("@each_val") || + op == insert_symbol("@partial")) + ERR_B(base->pos, "operator '%s' not allowed", s_name(op)); return GW_OK; } diff --git a/tests/internal_op/forbidden_operator.gw b/tests/internal_op/forbidden_operator.gw new file mode 100644 index 00000000..9c279afb --- /dev/null +++ b/tests/internal_op/forbidden_operator.gw @@ -0,0 +1 @@ +operator bool @each(int i, int j) { return true; }