2024-10-31 11:43:14 -05:00
|
|
|
---
|
2025-03-20 11:06:27 +13:00
|
|
|
source: kcl-lib/src/simulation_tests.rs
|
2024-10-31 11:43:14 -05:00
|
|
|
description: Result of parsing double_map_fn.kcl
|
|
|
|
---
|
|
|
|
{
|
|
|
|
"Ok": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "increment",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"argument": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"left": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": "i",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"type": "Name",
|
|
|
|
"type": "Name"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"operator": "+",
|
|
|
|
"right": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "1",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"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
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "BinaryExpression",
|
|
|
|
"type": "BinaryExpression"
|
|
|
|
},
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "ReturnStatement",
|
|
|
|
"type": "ReturnStatement"
|
2024-10-31 11:43:14 -05:00
|
|
|
}
|
|
|
|
],
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"params": [
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "i",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
2025-05-01 11:36:51 -05:00
|
|
|
},
|
|
|
|
"labeled": false
|
2024-12-07 07:16:04 +13:00
|
|
|
}
|
|
|
|
],
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "FunctionExpression",
|
|
|
|
"type": "FunctionExpression"
|
|
|
|
},
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "fn",
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"start": 0,
|
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "xs",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"endElement": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "2",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"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,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"startElement": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "0",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"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"
|
|
|
|
},
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "const",
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "ys",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": "xs",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"type": "Name",
|
|
|
|
"type": "Name"
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
2025-04-25 19:09:03 -05:00
|
|
|
"type": "LabeledArg",
|
|
|
|
"label": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": "f",
|
2025-03-24 20:58:55 +13:00
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
2025-04-25 19:09:03 -05:00
|
|
|
"arg": {
|
|
|
|
"abs_path": false,
|
|
|
|
"commentStart": 0,
|
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": {
|
|
|
|
"commentStart": 0,
|
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": "increment",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
|
|
|
"start": 0,
|
|
|
|
"type": "Name",
|
|
|
|
"type": "Name"
|
|
|
|
}
|
2024-12-07 07:16:04 +13:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": "map",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"type": "Name"
|
2024-10-31 11:43:14 -05:00
|
|
|
},
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"type": "CallExpressionKw",
|
|
|
|
"type": "CallExpressionKw",
|
|
|
|
"unlabeled": null
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
2025-04-25 19:09:03 -05:00
|
|
|
"type": "LabeledArg",
|
|
|
|
"label": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": "f",
|
2025-03-24 20:58:55 +13:00
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
2025-04-25 19:09:03 -05:00
|
|
|
"arg": {
|
|
|
|
"abs_path": false,
|
|
|
|
"commentStart": 0,
|
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": {
|
|
|
|
"commentStart": 0,
|
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"name": "increment",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
|
|
|
"start": 0,
|
|
|
|
"type": "Name",
|
|
|
|
"type": "Name"
|
|
|
|
}
|
2024-12-07 07:16:04 +13:00
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": "map",
|
|
|
|
"start": 0,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"path": [],
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"type": "Name"
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2025-04-25 19:09:03 -05:00
|
|
|
"type": "CallExpressionKw",
|
|
|
|
"type": "CallExpressionKw",
|
|
|
|
"unlabeled": null
|
2024-12-07 07:16:04 +13:00
|
|
|
}
|
|
|
|
],
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "PipeExpression",
|
|
|
|
"type": "PipeExpression"
|
|
|
|
},
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"kind": "const",
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
2025-04-07 17:42:15 +12:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-06-24 14:38:43 -04:00
|
|
|
"moduleId": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-10-31 11:43:14 -05:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 0
|
|
|
|
}
|
|
|
|
}
|