diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-04 21:52:30 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2019-08-04 21:52:30 -0400 |
commit | a359edde7c8806687c4f0307dbfc6f77077ba063 (patch) | |
tree | 8a06fa32ce403cb961b6a32ecce7c19d78c40fb1 /tree.c | |
parent | 0caa6768c7055c3e3fb2f2ebeda2c35152ea011b (diff) |
Fix updating type on single variable declarations
Diffstat (limited to 'tree.c')
-rw-r--r-- | tree.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -61,10 +61,15 @@ int type; ptree *list; { assert(list); + if (list->type == ID) { + list->attr.nval->var_type = type; + return; + } + while (list->r && list->r->type == ID) { /*Set type of right child through list*/ list->r->attr.nval->var_type = type; - + if (list->l) { if (list->l->type == LIST) { list = list->l; |