From 9b73c657467c973e703fc4664b732a6c7737aeb4 Mon Sep 17 00:00:00 2001 From: Annie Date: Thu, 3 Apr 2025 17:34:18 -0400 Subject: [PATCH] allow renaming of tablenodes --- src/symbol_table.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/symbol_table.c b/src/symbol_table.c index ec960e1..70f28d5 100644 --- a/src/symbol_table.c +++ b/src/symbol_table.c @@ -390,8 +390,8 @@ bool getAsKeyword(TableNode *definition) { } if (strcmp(getType(definition), "primitive function") != 0) { printdebug( - "not checking if a function is called with as or not -- " - "invalid op"); + "not checking if a function is called with as or not (%s) -- " + "invalid op", getType(definition)); return 0; } return definition->additionalinfo->FunDecAdInfo->regularoras; @@ -856,6 +856,11 @@ TableNode *addName(TableNode *tn, char *str) { printdebug( "Name doesn't look like it is empty before you change. " "Are you sure you need to update name?"); + if (str != NULL) { + tn->theName = str; + return tn; + } + printdebug("passed a NULL string to the addName function"); return undefined; } if (str == NULL) { @@ -1322,4 +1327,4 @@ TableNode *getNextEntry(TableNode *tn) { printdebug("The type of the first entry is %s",First_Entry->theType); return 0; } - */ \ No newline at end of file + */