From 1047733767d793d228d46ce75c2e525e1dfe9f79 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 15 Jun 2020 18:32:21 +0200 Subject: [PATCH] :art: Add compat_func --- src/parse/compat_func.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/parse/compat_func.c diff --git a/src/parse/compat_func.c b/src/parse/compat_func.c new file mode 100644 index 00000000..f8646a7a --- /dev/null +++ b/src/parse/compat_func.c @@ -0,0 +1,18 @@ +#include "gwion_util.h" +#include "gwion_ast.h" +#include "gwion_env.h" + +ANN m_bool compat_func(const restrict Func_Def lhs, const restrict Func_Def rhs) { + Arg_List e1 = lhs->base->args; + Arg_List e2 = rhs->base->args; + + while(e1 && e2) { + if(e1->type != e2->type) + return GW_ERROR; + e1 = e1->next; + e2 = e2->next; + } + if(e1 || e2) + return GW_ERROR; + return GW_OK; +} -- 2.43.0