From ddcd2dd094fbf3fc7ee153ca66ec2df380f22f10 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Fri, 28 Oct 2022 07:19:30 +0200 Subject: [PATCH] :art: more on internal ops --- src/parse/scan1.c | 7 +++++++ tests/internal_op/forbidden_operator.gw | 1 + 2 files changed, 8 insertions(+) create mode 100644 tests/internal_op/forbidden_operator.gw 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; } -- 2.43.0