forgot about the not operator 🥀
This commit is contained in:
@@ -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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user