Files
Plasma/debug/ast.json

80 lines
3.3 KiB
JSON
Raw Normal View History

2025-10-15 06:59:29 +11:00
{
"type": "Program",
"statements": [
{
"FunctionStatement": {
"type": "FunctionStatement",
"name": {
"type": "IdentifierLiteral",
2025-10-15 18:44:15 +11:00
"value": "main"
2025-10-15 06:59:29 +11:00
},
"return_type": "Int",
2025-10-15 18:44:15 +11:00
"parameters": [],
2025-10-15 06:59:29 +11:00
"body": {
"type": "BlockStatement",
"statements": [
{
2025-10-16 17:35:00 +11:00
"type": "ForStatement",
"var_declaration": {
"type": "AssignmentStatement",
"name": {
"type": "IdentifierLiteral",
"value": "x"
},
"value": {
"type": "IntegerLiteral",
"value": 1
},
"value_type": "Int"
2025-10-15 18:44:15 +11:00
},
"condition": {
"type": "InfixExpression",
"left_node": {
"type": "IdentifierLiteral",
2025-10-16 17:35:00 +11:00
"value": "x"
},
2025-10-16 17:35:00 +11:00
"operator": "<=",
"right_node": {
2025-10-15 18:44:15 +11:00
"type": "IntegerLiteral",
2025-10-16 17:35:00 +11:00
"value": 20
}
2025-10-15 18:44:15 +11:00
},
"body": {
"type": "BlockStatement",
"statements": [
{
2025-10-15 18:44:15 +11:00
"type": "ExpressionStatement",
"expr": {
"type": "CallExpression",
"function": {
"type": "IdentifierLiteral",
"value": "print"
},
"arguments": [
{
"type": "StringLiteral",
2025-10-16 17:35:00 +11:00
"value": "i = %i\\n"
2025-10-15 18:44:15 +11:00
},
{
"type": "IdentifierLiteral",
2025-10-16 17:35:00 +11:00
"value": "x"
2025-10-15 18:44:15 +11:00
}
]
}
}
]
2025-10-15 06:59:29 +11:00
}
2025-10-15 16:23:51 +11:00
},
{
"type": "ReturnStatement",
"return_value": {
2025-10-15 18:44:15 +11:00
"type": "IdentifierLiteral",
2025-10-16 17:35:00 +11:00
"value": "x"
2025-10-15 16:23:51 +11:00
}
2025-10-15 06:59:29 +11:00
}
]
}
}
}
]
}