diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-09-05 18:15:32 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-09-05 18:15:32 -0400 |
commit | 3a9747434de494fa189cf02ac31f6a4cff7fc761 (patch) | |
tree | 02fe1e9412f02f652f0f07e8d5dd20b4ed0f3515 | |
parent | 1300aa3672d7ae27963465fa6d8d2a6ebe8a71d2 (diff) |
Add procedure argument types
-rw-r--r-- | pc.y | 14 |
1 files changed, 13 insertions, 1 deletions
@@ -195,8 +195,20 @@ sub_prog_head } |PROC ID arguments ';' { + node *tmp; + int i = 0; + check_id(cur_scope->prev, $2); - scope_insert(cur_scope->prev, $2); + tmp = scope_insert(cur_scope->prev, $2); + + i = count_args($3); + + tmp->func_info = malloc(sizeof(struct fi)); + assert(tmp->func_info); + tmp->func_info->argc = i; + assert(tmp->func_info->argv = malloc(i * sizeof(int))); + + assert(!set_func_types($3, tmp->func_info->argv, i)); } ; |