From 0811aa0345c586ed426e6a5deb2d08026fba9bbb Mon Sep 17 00:00:00 2001 From: Partho Date: Wed, 7 May 2025 00:21:23 -0400 Subject: [PATCH] did a little clean up. Note- I don't think reserve is being linked through the library --- src/grammar.y | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/grammar.y b/src/grammar.y index 085afda..c350b72 100644 --- a/src/grammar.y +++ b/src/grammar.y @@ -688,7 +688,7 @@ simple_statement: if(getAdInfoType((TableNode*)$1) == TYPE_ARRAY || getAdInfoType((TableNode*)$1) == TYPE_FUNCTION_DECLARATION){ PushContext(getTypeEntry((TableNode*)$1)); - printf("pushed %s to context stack in simple statement assignable rule\n",getName(getContextTypeEntry(context_head))); + //printf("pushed %s to context stack in simple statement assignable rule\n",getName(getContextTypeEntry(context_head))); } S_Push(TrueList, S_Init(), 0); S_Push(FalseList, S_Init(), 0); @@ -1204,16 +1204,9 @@ expression: TableNode* node = CreateEntry(cur,TYPE_ARRAY, getContextTypeEntry(context_head), temp, NULL); emit_reserve(node, tn_or_const(NODE,$2)); $$ = node; - }else if(((getTypeEntry((TableNode*)$2)) == getArrType(getContextTypeEntry(context_head))) - && (getAdInfoType(getContextTypeEntry(context_head)) == TYPE_ARRAY_TYPE)){ - char* temp = temp_var_gen(); - //does this have integer? - TableNode* node = CreateEntry(cur,TYPE_ARRAY, getContextTypeEntry(context_head), temp, NULL); - emit_reserve(node, tn_or_const(NODE,$2)); - $$ = node; - }else{ - printf("%s on right %s on left\n",getType((TableNode*)$2),getName(getArrType(getContextTypeEntry(context_head)))); - printf("%s is the name of the left\n",getName(getContextTypeEntry(context_head))); + }else{ + //printf("%s on right %s on left\n",getType((TableNode*)$2),getName(getArrType(getContextTypeEntry(context_head)))); + //printf("%s is the name of the left\n",getName(getContextTypeEntry(context_head))); $$ = undefined; } }