]> git.mdlowis.com Git - proto/obnc.git/commitdiff
fixed up function calls
authorMichael D. Lowis <mike.lowis@gentex.com>
Mon, 7 Jun 2021 16:19:16 +0000 (12:19 -0400)
committerMichael D. Lowis <mike.lowis@gentex.com>
Mon, 7 Jun 2021 16:19:16 +0000 (12:19 -0400)
cerise/src/grammar.c
cerise/tests/Module.m

index f0625969ad78e9fac88d8751ad5200433820d637..7e891c8c7e42ca59e2d62436886b357c15aeccd4 100644 (file)
@@ -190,7 +190,8 @@ RULE(factor)
             if (accept(p, '('))
             {
                 Symbol* proc = symbol_get(p, item->imm.s, SYM_PROC);
-                Symbol* args = proc->desc;
+                item->type = proc->type->base;
+                Field* args = proc->type->fields;
                 Item arglist = {0};
                 Item** currarg = &(arglist.next);
                 while (args && !matches(p, ')'))
@@ -208,7 +209,6 @@ RULE(factor)
                         expect(p, ',');
                     }
                 }
-
                 if (args)
                 {
                     error(p, "too few arguments to function '%s'", proc->name);
index d9ddecd8b4b4075ac08169880603a4c38c0c91b6..eeead135df97998be8c651a2b4f29167208bedf2 100644 (file)
@@ -48,6 +48,11 @@ begin
   return z1;
 end
 
+procedure Bar(a : Int) : Int
+begin
+    return a;
+end
+
 begin
 
     h[1].i = 42;
@@ -130,6 +135,6 @@ begin
 #    g[c] = 42;
 #    e[0][9] = 42;
 
-
+    c = Bar(42);
 
 end