function arguments are getting added to the AST!
This commit is contained in:
@@ -6,18 +6,37 @@
|
||||
"type": "FunctionStatement",
|
||||
"name": {
|
||||
"type": "IdentifierLiteral",
|
||||
"value": "test"
|
||||
"value": "add"
|
||||
},
|
||||
"return_type": "Int",
|
||||
"parameters": [],
|
||||
"parameters": [
|
||||
{
|
||||
"type": "FunctionParameter",
|
||||
"name": "a",
|
||||
"value_type": "Int"
|
||||
},
|
||||
{
|
||||
"type": "FunctionParameter",
|
||||
"name": "b",
|
||||
"value_type": "Int"
|
||||
}
|
||||
],
|
||||
"body": {
|
||||
"type": "BlockStatement",
|
||||
"statements": [
|
||||
{
|
||||
"type": "ReturnStatement",
|
||||
"return_value": {
|
||||
"type": "IntegerLiteral",
|
||||
"value": 123
|
||||
"type": "InfixExpression",
|
||||
"left_node": {
|
||||
"type": "IdentifierLiteral",
|
||||
"value": "a"
|
||||
},
|
||||
"operator": "+",
|
||||
"right_node": {
|
||||
"type": "IdentifierLiteral",
|
||||
"value": "b"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -42,9 +61,18 @@
|
||||
"type": "CallExpression",
|
||||
"function": {
|
||||
"type": "IdentifierLiteral",
|
||||
"value": "test"
|
||||
"value": "add"
|
||||
},
|
||||
"arguments": []
|
||||
"arguments": [
|
||||
{
|
||||
"type": "IntegerLiteral",
|
||||
"value": 2
|
||||
},
|
||||
{
|
||||
"type": "IntegerLiteral",
|
||||
"value": 3
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user