From 04c1c13e0c6de1bebc6a8311c00cdfb72d1053b9 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Tue, 8 Oct 2019 23:55:09 -0400 Subject: Fix function args with constants pass type checking --- main.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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; } -- cgit v1.1