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;