From 3db61919691010581f55a1de18094cb90d69f60c Mon Sep 17 00:00:00 2001 From: Partho Bhattacharya Date: Wed, 12 Mar 2025 10:27:48 -0400 Subject: [PATCH] fixed symbol_table entries not working --- src/symbol_table.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/symbol_table.c b/src/symbol_table.c index fa0e6bb..4369551 100644 --- a/src/symbol_table.c +++ b/src/symbol_table.c @@ -37,17 +37,18 @@ SymbolTable* CreateScope(SymbolTable* ParentScope, int Line, int Column) { //create entry just for things below top level scope TableNode* CreateEntry(SymbolTable* table, char* typeOf, char* id) { -if(table ==NULL || table->Parent_Scope == NULL){ +if(table ==NULL /*|| table->Parent_Scope == NULL*/){ printf("Null reference to table given for create entry or given top level scope which is invalid\n"); return NULL; } -TableNode* topDef = (table_lookup(getAncestor(table),typeOf)); +/*TableNode* topDef = (table_lookup(getAncestor(table),typeOf)); if(topDef == NULL){ printf("This type is not defined at the top level\n"); return NULL; -} +}*/ TableNode* newEntry = (TableNode*)malloc(sizeof(TableNode)); - newEntry->theType = topDef->theName; + //newEntry->theType = topDef->theName; + newEntry->theType=typeOf; newEntry->theName = id; if (table->entries == NULL) { table->entries = newEntry;