aboutsummaryrefslogtreecommitdiff
path: root/tree.c
diff options
context:
space:
mode:
authorTucker Evans <tuckerevans24@gmail.com>2019-08-04 21:52:30 -0400
committerTucker Evans <tuckerevans24@gmail.com>2019-08-04 21:52:30 -0400
commita359edde7c8806687c4f0307dbfc6f77077ba063 (patch)
tree8a06fa32ce403cb961b6a32ecce7c19d78c40fb1 /tree.c
parent0caa6768c7055c3e3fb2f2ebeda2c35152ea011b (diff)
Fix updating type on single variable declarations
Diffstat (limited to 'tree.c')
-rw-r--r--tree.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/tree.c b/tree.c
index e0216fd..71feb5b 100644
--- a/tree.c
+++ b/tree.c
@@ -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;