]> Nishi Git Mirror - gwion.git/commitdiff
:art: Move compat_func
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 15 Jun 2020 16:19:12 +0000 (18:19 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Mon, 15 Jun 2020 16:19:12 +0000 (18:19 +0200)
ast
src/parse/compat_func.h [new file with mode: 0644]

diff --git a/ast b/ast
index bb6cb30ffd3fbc8daccff74ba19f90de7b7a6029..0835f9740272e180bc609e82a3c0f80218814be0 160000 (submodule)
--- a/ast
+++ b/ast
@@ -1 +1 @@
-Subproject commit bb6cb30ffd3fbc8daccff74ba19f90de7b7a6029
+Subproject commit 0835f9740272e180bc609e82a3c0f80218814be0
diff --git a/src/parse/compat_func.h b/src/parse/compat_func.h
new file mode 100644 (file)
index 0000000..f8646a7
--- /dev/null
@@ -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;
+}