aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-10-08 23:55:09 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-10-08 23:55:09 -0400
commit04c1c13e0c6de1bebc6a8311c00cdfb72d1053b9 (patch)
treee7369146dac951e1f4197168869acb102e1d8921
parent26d81965f8fdb68076d81132ca3ea9c4c77da2ee (diff)
Fix function args with constants pass type checking
-rw-r--r--main.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/main.c b/main.c
index 1657259..9f4565e 100644
--- a/main.c
+++ b/main.c
@@ -173,6 +173,18 @@ int size, *nxt;
*nxt = t->attr.nval->var_type;
return size;
+ } else if (t->type == INUM) {
+ if (--size == -1)
+ yyerror("VARIABLE COUNT CHANGED!!!\n");
+
+ *nxt = INT;
+ return size;
+ } else if (t->type == RNUM) {
+ if (--size == -1)
+ yyerror("VARIABLE COUNT CHANGED!!!\n");
+
+ *nxt = REAL;
+ return size;
}
return size;
}