Fix array parsing properly.

This commit is contained in:
Curle 2020-11-21 22:16:10 +00:00
parent 8d2f98aa53
commit 28c349726e
Signed by: TheCurle
GPG Key ID: 5942F13718443F79
2 changed files with 2 additions and 1 deletions

View File

@ -104,7 +104,7 @@ int AssembleTree(struct ASTNode* Node, int Register, int ParentOp) {
return AsAddr(Node->Value.ID); return AsAddr(Node->Value.ID);
case OP_DEREF: case OP_DEREF:
return AsDeref(LeftVal, Node->Left->ExprType); return Node->RVal ? AsDeref(LeftVal, Node->Left->ExprType) : LeftVal;
case OP_ASSIGN: case OP_ASSIGN:
printf("Calculating for assignment..\r\n"); printf("Calculating for assignment..\r\n");

View File

@ -192,6 +192,7 @@ struct ASTNode* ParsePrecedenceASTNode(int PreviousTokenPrecedence) {
if(OpType == OP_ASSIGN) { if(OpType == OP_ASSIGN) {
printf("\tParsePrecedenceASTNode: Assignment statement\r\n"); printf("\tParsePrecedenceASTNode: Assignment statement\r\n");
RightNode->RVal = 1; RightNode->RVal = 1;
LeftNode->RVal = 0;
RightNode = MutateType(RightNode, LeftNode->ExprType, 0); RightNode = MutateType(RightNode, LeftNode->ExprType, 0);
if(LeftNode == NULL) if(LeftNode == NULL)