Merge pull request #65 from UB-CSE443/Dev

Dev
This commit is contained in:
Annie Slenker
2025-05-04 16:45:33 -04:00
committed by GitHub
174 changed files with 996 additions and 664 deletions

View File

@ -116,6 +116,18 @@ int getPrimSize(TableNode *definition) {
"Invalid.");
return -1;
}
if(getAdInfoType(definition) == TYPE_ARRAY_TYPE){
//special case to return size for reference to an array
return 8;
}
if(getAdInfoType(definition) == TYPE_FUNCTION_TYPE){
//special case to return size for reference to a function
return 8;
}
if(getAdInfoType(definition) == TYPE_RECORD_TYPE){
//special case to return size for reference to a record
return getRecTotal(definition);
}
if (definition->additionalinfo == NULL) {
printdebug("node has NULL additionalinfo. Invalid.");
return -1;
@ -1200,6 +1212,14 @@ TableNode *table_lookup(SymbolTable *table, char *x) {
}
TableNode *entrie = table->entries;
for (; entrie != NULL; entrie = entrie->next) {
if (entrie->theName == NULL) {
printdebug("name of entry is currently NULL, undefined");
return undefined;
}
if (entrie->theName == undefined->theName) {
printdebug("name of entry is currently undefined");
return undefined;
}
if (!strcmp(entrie->theName, x)) {
return entrie;
}