From a359edde7c8806687c4f0307dbfc6f77077ba063 Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sun, 4 Aug 2019 21:52:30 -0400 Subject: Fix updating type on single variable declarations --- tree.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tree.c') 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; -- cgit v1.1