summaryrefslogtreecommitdiff
path: root/infer.c
diff options
context:
space:
mode:
Diffstat (limited to 'infer.c')
-rw-r--r--infer.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/infer.c b/infer.c
index 08eb5ab..6c2164a 100644
--- a/infer.c
+++ b/infer.c
@@ -1,9 +1,12 @@
/*
match and to are dynamic arrays of equal size
-find the value (and put it into val) of ident by matching match[i] to to[i], i = 0..arr_len(match)-1
+idents is a dyn array
+find the value of each ident by matching match[i] to to[i], i = 0..arr_len(match)-1
all the types in match must be resolved, and all the types in to must be unresolved
*/
-static bool infer(Type **match, Type **to, Identifier ident, Value *val, Type *type) {
+static bool infer(Type **match, Type **to, Identifier *idents, Value *vals, Type *types) {
+ Value *val = vals;
+ Type *type = types;
val->type = calloc(1,sizeof(Type));
val->type->flags = TYPE_IS_RESOLVED;
val->type->kind = TYPE_BUILTIN;