mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Fixed an AST bug
This commit is contained in:
@@ -362,8 +362,8 @@ void Toy_emitASTNodeAnd(Toy_ASTNode** nodeHandle, Toy_ASTNode* rhs) {
|
||||
Toy_ASTNode* tmp = TOY_ALLOCATE(Toy_ASTNode, 1);
|
||||
|
||||
tmp->type = TOY_AST_NODE_AND;
|
||||
tmp->binary.left = *nodeHandle;
|
||||
tmp->binary.right = rhs;
|
||||
tmp->pathAnd.left = *nodeHandle;
|
||||
tmp->pathAnd.right = rhs;
|
||||
|
||||
*nodeHandle = tmp;
|
||||
}
|
||||
@@ -372,8 +372,8 @@ void Toy_emitASTNodeOr(Toy_ASTNode** nodeHandle, Toy_ASTNode* rhs) {
|
||||
Toy_ASTNode* tmp = TOY_ALLOCATE(Toy_ASTNode, 1);
|
||||
|
||||
tmp->type = TOY_AST_NODE_OR;
|
||||
tmp->binary.left = *nodeHandle;
|
||||
tmp->binary.right = rhs;
|
||||
tmp->pathOr.left = *nodeHandle;
|
||||
tmp->pathOr.right = rhs;
|
||||
|
||||
*nodeHandle = tmp;
|
||||
}
|
||||
|
||||
@@ -455,8 +455,8 @@ static void printToBuffer(const char* str) {
|
||||
globalPrintBuffer = TOY_GROW_ARRAY(char, globalPrintBuffer, oldCapacity, globalPrintCapacity);
|
||||
}
|
||||
|
||||
snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "\0");
|
||||
globalPrintCount += strlen(str);
|
||||
size_t total = snprintf(globalPrintBuffer + globalPrintCount, strlen(str) + 1, "%s", str ? str : "");
|
||||
globalPrintCount += total;
|
||||
}
|
||||
|
||||
//exposed functions
|
||||
|
||||
Reference in New Issue
Block a user