From 51c0c989e7beb784c772dd8328f51fb6443e751c Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Sat, 3 Aug 2019 17:40:26 -0400 Subject: Fix id declare error during var assignment --- pc.y | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/pc.y b/pc.y index a4a918b..6538ef6 100644 --- a/pc.y +++ b/pc.y @@ -9,10 +9,6 @@ #include "pc.h" #include "sem_check.h" -/* -TODO: -- Add checkid() to counter mkid() -*/ extern int yylex(); extern scope *cur_scope; @@ -122,11 +118,10 @@ id_list var_declarations :var_declarations VAR id_list ':' type ';' { - /*CHECK IDS HERE*/ ptree *tmp; - for(tmp = $3; tmp; tmp = tmp->l) { + for(tmp = $3; tmp; tmp = tmp->l) tmp->type = $5; - } + } |/*empty*/ ; @@ -267,13 +262,11 @@ TD: TO | DT; var :ID { - check_id(cur_scope, $1); $$ = mkid(scope_insert(cur_scope,$1)); } |ID '[' expr ']' { node* tmp; - check_id(cur_scope, $1); tmp = scope_insert(cur_scope, $1); $$ = mktree(ARRAY_ACCESS, mkid(tmp), $3); -- cgit v1.1