Files
Plasma/debug/ast.json

83 lines
2.9 KiB
JSON
Raw Normal View History

2025-10-15 06:59:29 +11:00
{
"type": "Program",
"statements": [
{
"FunctionStatement": {
"type": "FunctionStatement",
"name": {
"type": "IdentifierLiteral",
"value": "add"
2025-10-15 06:59:29 +11:00
},
"return_type": "Int",
"parameters": [
{
"type": "FunctionParameter",
"name": "a",
"value_type": "Int"
},
{
"type": "FunctionParameter",
"name": "b",
"value_type": "Int"
}
],
2025-10-15 06:59:29 +11:00
"body": {
"type": "BlockStatement",
"statements": [
{
"type": "ReturnStatement",
"return_value": {
"type": "InfixExpression",
"left_node": {
"type": "IdentifierLiteral",
"value": "a"
},
"operator": "+",
"right_node": {
"type": "IdentifierLiteral",
"value": "b"
}
2025-10-15 06:59:29 +11:00
}
}
]
}
}
},
{
"FunctionStatement": {
"type": "FunctionStatement",
"name": {
"type": "IdentifierLiteral",
"value": "main"
},
"return_type": "Int",
"parameters": [],
"body": {
"type": "BlockStatement",
"statements": [
{
"type": "ReturnStatement",
"return_value": {
"type": "CallExpression",
"function": {
"type": "IdentifierLiteral",
"value": "add"
2025-10-15 06:59:29 +11:00
},
"arguments": [
{
"type": "IntegerLiteral",
"value": 1
},
{
"type": "IntegerLiteral",
"value": 2
}
]
2025-10-15 06:59:29 +11:00
}
}
]
}
}
}
]
}