Fix array parsing properly.
This commit is contained in:
parent
8d2f98aa53
commit
28c349726e
|
@ -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");
|
||||||
|
|
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user