AST works for variable reassignment

kinda coded horribly tho lol
This commit is contained in:
SpookyDervish
2025-10-14 19:22:59 +11:00
parent 5741a48e73
commit 655e5d1d12
7 changed files with 132 additions and 39 deletions

View File

@@ -21,24 +21,35 @@
},
"value": {
"type": "IntegerLiteral",
"value": 123
"value": 0
},
"value_type": "Int"
},
{
"type": "ReturnStatement",
"return_value": {
"type": "ReassignStatement",
"ident": {
"type": "IdentifierLiteral",
"value": "x"
},
"right_value": {
"type": "InfixExpression",
"left_node": {
"type": "IdentifierLiteral",
"value": "x"
},
"operator": "+",
"operator": "*",
"right_node": {
"type": "IntegerLiteral",
"value": 5
"value": 2
}
}
},
{
"type": "ReturnStatement",
"return_value": {
"type": "IdentifierLiteral",
"value": "x"
}
}
]
}