Function calls are being emitted with the right int for args
This commit is contained in:
@ -1045,10 +1045,14 @@ assignable:
|
|||||||
throw_error(ERROR_TYPE, "Undefined type returned by function.");
|
throw_error(ERROR_TYPE, "Undefined type returned by function.");
|
||||||
}
|
}
|
||||||
TableNode* node = CreateEntry(cur,t, typeNode2, temp, NULL);
|
TableNode* node = CreateEntry(cur,t, typeNode2, temp, NULL);
|
||||||
int a = S_Size(S_Peek(stack));
|
//-----------------------------------------------------------------------------
|
||||||
|
// Please don't touch
|
||||||
|
// the + 1 is here because I don't detach the last param
|
||||||
|
int a = S_Size(S_Peek(stack)) + 1;
|
||||||
emit_push_all(S_Peek(stack));
|
emit_push_all(S_Peek(stack));
|
||||||
S_Pop(stack);
|
S_Pop(stack);
|
||||||
emit_function_call(node, a, tn_or_const(NODE, $1));
|
emit_function_call(node, a, tn_or_const(NODE, $1));
|
||||||
|
//-----------------------------------------------------------------------------
|
||||||
$$ = node;
|
$$ = node;
|
||||||
//NOTE ADD ASSIGNMENT EMIT HERE (MIGHT NEED TO PUSH TO STACK for function call)
|
//NOTE ADD ASSIGNMENT EMIT HERE (MIGHT NEED TO PUSH TO STACK for function call)
|
||||||
printdebug("[ASSIGNABLE - RULE 2] assignable = type: %s | name_func = %s", getName(typeNode2), getName((TableNode*)$1));
|
printdebug("[ASSIGNABLE - RULE 2] assignable = type: %s | name_func = %s", getName(typeNode2), getName((TableNode*)$1));
|
||||||
|
@ -52,7 +52,7 @@ bool S_IsEmpty(Stack *s){
|
|||||||
}
|
}
|
||||||
|
|
||||||
int S_Size(Stack *s){
|
int S_Size(Stack *s){
|
||||||
if (s == NULL || !S_IsEmpty(s)) {
|
if (s == NULL || S_IsEmpty(s)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return s->size;
|
return s->size;
|
||||||
|
Reference in New Issue
Block a user