Virtools脚本语言(VSL)教程 - 函数
{
"function": {
"name": "exampleFunction",
"returnType": "int",
"parameters": [
{
"name": "a",
"type": "int"
},
{
"name": "b",
"type": "float"
}
],
"body": [
{
"type": "if",
"condition": "a == 0",
"thenBlock": [
{
"type": "return",
"value": "0"
}
]
},
{
"type": "return",
"value": "(int)(b * a)"
}
]
}
}