2024-10-31 11:43:14 -05:00
|
|
|
---
|
|
|
|
source: kcl/src/simulation_tests.rs
|
|
|
|
description: Result of parsing double_map_fn.kcl
|
|
|
|
---
|
|
|
|
{
|
|
|
|
"Ok": {
|
|
|
|
"body": [
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 34,
|
|
|
|
"id": {
|
|
|
|
"end": 12,
|
|
|
|
"name": "increment",
|
|
|
|
"start": 3,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"argument": {
|
|
|
|
"end": 32,
|
|
|
|
"left": {
|
|
|
|
"end": 28,
|
|
|
|
"name": "i",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 27,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"operator": "+",
|
|
|
|
"right": {
|
|
|
|
"end": 32,
|
|
|
|
"raw": "1",
|
|
|
|
"start": 31,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 1.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"start": 27,
|
|
|
|
"type": "BinaryExpression",
|
|
|
|
"type": "BinaryExpression"
|
|
|
|
},
|
|
|
|
"end": 32,
|
|
|
|
"start": 20,
|
|
|
|
"type": "ReturnStatement",
|
|
|
|
"type": "ReturnStatement"
|
2024-10-31 11:43:14 -05:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 34,
|
|
|
|
"start": 16
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 34,
|
|
|
|
"params": [
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 14,
|
|
|
|
"name": "i",
|
|
|
|
"start": 13,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"start": 12,
|
|
|
|
"type": "FunctionExpression",
|
|
|
|
"type": "FunctionExpression"
|
|
|
|
},
|
|
|
|
"start": 3,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 34,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "fn",
|
|
|
|
"start": 0,
|
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 47,
|
|
|
|
"id": {
|
|
|
|
"end": 38,
|
|
|
|
"name": "xs",
|
|
|
|
"start": 36,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 47,
|
2024-12-07 07:16:04 +13:00
|
|
|
"endElement": {
|
|
|
|
"end": 46,
|
|
|
|
"raw": "2",
|
|
|
|
"start": 45,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 2.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"endInclusive": true,
|
|
|
|
"start": 41,
|
|
|
|
"startElement": {
|
|
|
|
"end": 43,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 42,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 0.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "ArrayRangeExpression",
|
|
|
|
"type": "ArrayRangeExpression"
|
|
|
|
},
|
|
|
|
"start": 36,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 47,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "const",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 36,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 101,
|
|
|
|
"id": {
|
|
|
|
"end": 50,
|
|
|
|
"name": "ys",
|
|
|
|
"start": 48,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"end": 55,
|
|
|
|
"name": "xs",
|
|
|
|
"start": 53,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 66,
|
|
|
|
"start": 65,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"end": 77,
|
|
|
|
"name": "increment",
|
|
|
|
"start": 68,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 64,
|
|
|
|
"name": "map",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 61,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 78,
|
|
|
|
"start": 61,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 89,
|
|
|
|
"start": 88,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"end": 100,
|
|
|
|
"name": "increment",
|
|
|
|
"start": 91,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 87,
|
|
|
|
"name": "map",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 84,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 101,
|
|
|
|
"start": 84,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"end": 101,
|
|
|
|
"start": 53,
|
|
|
|
"type": "PipeExpression",
|
|
|
|
"type": "PipeExpression"
|
|
|
|
},
|
|
|
|
"start": 48,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 101,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "const",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 48,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
}
|
|
|
|
],
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 102,
|
2024-10-31 11:43:14 -05:00
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 36,
|
|
|
|
"start": 34,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 0
|
|
|
|
}
|
|
|
|
}
|