2024-11-04 20:34:22 -06:00
|
|
|
---
|
2025-03-20 11:06:27 +13:00
|
|
|
source: kcl-lib/src/simulation_tests.rs
|
2024-11-04 20:34:22 -06:00
|
|
|
description: Result of parsing if_else.kcl
|
|
|
|
---
|
|
|
|
{
|
|
|
|
"Ok": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 48,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 48,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "a",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 52,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 55,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "true",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": true
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"digest": null,
|
|
|
|
"else_ifs": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 68,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 76,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "true",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": true
|
|
|
|
},
|
|
|
|
"digest": null,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 85,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 85,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "4",
|
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": 4.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 81,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"type": "ElseIf"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"final_else": {
|
|
|
|
"body": [
|
2024-11-04 20:34:22 -06:00
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 98,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 98,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "5",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 5.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
2024-11-04 20:34:22 -06:00
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 98,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
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
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 64,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 64,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "3",
|
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": 3.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 64,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "IfExpression",
|
|
|
|
"type": "IfExpression"
|
|
|
|
},
|
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-11-04 20:34:22 -06:00
|
|
|
"kind": "const",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 102,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"expression": {
|
|
|
|
"arguments": [
|
|
|
|
{
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 114,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 114,
|
|
|
|
"end": 0,
|
|
|
|
"name": "a",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 117,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "3",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 3.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 120,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "0.001",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 0.001,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 127,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "\"the 'if' branch gets returned\"",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": "the 'if' branch gets returned"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 102,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 102,
|
|
|
|
"end": 0,
|
|
|
|
"name": "assertEqual",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 102,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 159,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 161,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 161,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "b",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 165,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 168,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "false",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": false
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"digest": null,
|
|
|
|
"else_ifs": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 182,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 190,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "true",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": true
|
|
|
|
},
|
|
|
|
"digest": null,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 199,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 199,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "4",
|
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": 4.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 195,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"type": "ElseIf"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"final_else": {
|
|
|
|
"body": [
|
2024-11-04 20:34:22 -06:00
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 212,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 212,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "5",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 5.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
2024-11-04 20:34:22 -06:00
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 212,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
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
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 178,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 178,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "3",
|
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": 3.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 178,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "IfExpression",
|
|
|
|
"type": "IfExpression"
|
|
|
|
},
|
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-11-04 20:34:22 -06:00
|
|
|
"kind": "const",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 216,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"expression": {
|
|
|
|
"arguments": [
|
|
|
|
{
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 228,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 228,
|
|
|
|
"end": 0,
|
|
|
|
"name": "b",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 231,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "4",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 4.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 234,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "0.001",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 0.001,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 241,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "\"the 'else if' branch gets returned\"",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": "the 'else if' branch gets returned"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 216,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 216,
|
|
|
|
"end": 0,
|
|
|
|
"name": "assertEqual",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 216,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 278,
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 280,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"id": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 280,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"name": "c",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 284,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 287,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "false",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": false
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"digest": null,
|
|
|
|
"else_ifs": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 301,
|
2024-12-07 07:16:04 +13:00
|
|
|
"cond": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 309,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "false",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": false
|
|
|
|
},
|
|
|
|
"digest": null,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 319,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 319,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "4",
|
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": 4.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 315,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"type": "ElseIf"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"final_else": {
|
|
|
|
"body": [
|
2024-11-04 20:34:22 -06:00
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 332,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 332,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "5",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 5.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
2024-11-04 20:34:22 -06:00
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 332,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
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
|
|
|
"then_val": {
|
|
|
|
"body": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 297,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"expression": {
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 297,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-12-07 07:16:04 +13:00
|
|
|
"raw": "3",
|
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": 3.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": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 297,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "IfExpression",
|
|
|
|
"type": "IfExpression"
|
|
|
|
},
|
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-11-04 20:34:22 -06:00
|
|
|
"kind": "const",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 336,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"expression": {
|
|
|
|
"arguments": [
|
|
|
|
{
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 348,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 348,
|
|
|
|
"end": 0,
|
|
|
|
"name": "c",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 351,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "5",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 5.0,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 354,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "0.001",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2025-01-22 08:29:30 +13:00
|
|
|
"value": {
|
|
|
|
"value": 0.001,
|
|
|
|
"suffix": "None"
|
|
|
|
}
|
2024-11-04 20:34:22 -06:00
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 361,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"raw": "\"the 'else' branch gets returned\"",
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": "the 'else' branch gets returned"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
2025-03-24 20:58:55 +13:00
|
|
|
"abs_path": false,
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 336,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2025-03-24 20:58:55 +13:00
|
|
|
"name": {
|
|
|
|
"commentStart": 336,
|
|
|
|
"end": 0,
|
|
|
|
"name": "assertEqual",
|
|
|
|
"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-11-04 20:34:22 -06:00
|
|
|
},
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 336,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
2025-03-20 11:06:27 +13:00
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "ExpressionStatement",
|
|
|
|
"type": "ExpressionStatement"
|
|
|
|
}
|
|
|
|
],
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"1": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 159,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"3": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 278,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": [
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 0,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"start": 0,
|
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "blockComment",
|
|
|
|
"value": "This tests evaluating if-else expressions.",
|
|
|
|
"style": "line"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
2025-03-20 16:23:20 +13:00
|
|
|
"commentStart": 45,
|
2025-03-20 11:06:27 +13:00
|
|
|
"end": 0,
|
|
|
|
"start": 0,
|
2024-11-04 20:34:22 -06:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"start": 0
|
|
|
|
}
|
|
|
|
}
|