forgot about the not operator 🥀

This commit is contained in:
SpookyDervish
2025-10-14 21:30:56 +11:00
parent 3d9208f0f8
commit bf0f9a9348
4 changed files with 14 additions and 109 deletions

View File

@@ -1,90 +0,0 @@
{
"type": "Program",
"statements": [
{
"FunctionStatement": {
"type": "FunctionStatement",
"name": {
"type": "IdentifierLiteral",
"value": "main"
},
"return_type": "Int",
"parameters": [],
"body": {
"type": "BlockStatement",
"statements": [
{
"type": "AssignmentStatement",
"name": {
"type": "IdentifierLiteral",
"value": "x"
},
"value": {
"type": "IntegerLiteral",
"value": 123
},
"value_type": "Int"
},
{
"type": "ExpressionStatement",
"expr": {
"type": "IfStatement",
"condition": {
"type": "InfixExpression",
"left_node": {
"type": "IdentifierLiteral",
"value": "x"
},
"operator": "==",
"right_node": {
"type": "IntegerLiteral",
"value": 123
}
},
"consequence": {
"type": "BlockStatement",
"statements": [
{
"type": "ReassignStatement",
"ident": {
"type": "IdentifierLiteral",
"value": "x"
},
"right_value": {
"type": "IntegerLiteral",
"value": 0
}
}
]
},
"alternative": {
"type": "BlockStatement",
"statements": [
{
"type": "ReassignStatement",
"ident": {
"type": "IdentifierLiteral",
"value": "x"
},
"right_value": {
"type": "IntegerLiteral",
"value": 1
}
}
]
}
}
},
{
"type": "ReturnStatement",
"return_value": {
"type": "IdentifierLiteral",
"value": "x"
}
}
]
}
}
}
]
}