diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-08 23:55:09 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-10-08 23:55:09 -0400 |
commit | 04c1c13e0c6de1bebc6a8311c00cdfb72d1053b9 (patch) | |
tree | e7369146dac951e1f4197168869acb102e1d8921 | |
parent | 26d81965f8fdb68076d81132ca3ea9c4c77da2ee (diff) |
Fix function args with constants pass type checking
-rw-r--r-- | main.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -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; } |