2024-11-21 18:33:02 -06:00
|
|
|
---
|
|
|
|
source: kcl/src/simulation_tests.rs
|
|
|
|
description: Result of parsing function_sketch.kcl
|
|
|
|
---
|
|
|
|
{
|
|
|
|
"Ok": {
|
|
|
|
"body": [
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 205,
|
|
|
|
"id": {
|
|
|
|
"end": 6,
|
|
|
|
"name": "box",
|
|
|
|
"start": 3,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"declaration": {
|
|
|
|
"end": 187,
|
|
|
|
"id": {
|
|
|
|
"end": 25,
|
|
|
|
"name": "myBox",
|
|
|
|
"start": 20,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 46,
|
|
|
|
"raw": "'XY'",
|
|
|
|
"start": 42,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": "XY"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 41,
|
|
|
|
"name": "startSketchOn",
|
|
|
|
"start": 28,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 47,
|
|
|
|
"start": 28,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"arguments": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 72,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 71,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
2024-12-07 07:16:04 +13:00
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 75,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 74,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 76,
|
|
|
|
"start": 70,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 79,
|
|
|
|
"start": 78,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 69,
|
|
|
|
"name": "startProfileAt",
|
|
|
|
"start": 55,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 80,
|
|
|
|
"start": 55,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 95,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 94,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 98,
|
|
|
|
"name": "l",
|
|
|
|
"start": 97,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 99,
|
|
|
|
"start": 93,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 102,
|
|
|
|
"start": 101,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 92,
|
|
|
|
"name": "line",
|
|
|
|
"start": 88,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 103,
|
|
|
|
"start": 88,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 118,
|
|
|
|
"name": "w",
|
|
|
|
"start": 117,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 121,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 120,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 122,
|
|
|
|
"start": 116,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 125,
|
|
|
|
"start": 124,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 115,
|
|
|
|
"name": "line",
|
|
|
|
"start": 111,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 126,
|
|
|
|
"start": 111,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 141,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 140,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"argument": {
|
|
|
|
"end": 145,
|
|
|
|
"name": "l",
|
|
|
|
"start": 144,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 145,
|
|
|
|
"operator": "-",
|
|
|
|
"start": 143,
|
|
|
|
"type": "UnaryExpression",
|
|
|
|
"type": "UnaryExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 146,
|
|
|
|
"start": 139,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 149,
|
|
|
|
"start": 148,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 138,
|
|
|
|
"name": "line",
|
|
|
|
"start": 134,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 150,
|
|
|
|
"start": 134,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 165,
|
|
|
|
"start": 164,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 163,
|
|
|
|
"name": "close",
|
|
|
|
"start": 158,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 166,
|
|
|
|
"start": 158,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 183,
|
|
|
|
"name": "h",
|
|
|
|
"start": 182,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 186,
|
|
|
|
"start": 185,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"callee": {
|
|
|
|
"end": 181,
|
|
|
|
"name": "extrude",
|
|
|
|
"start": 174,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 187,
|
2024-12-07 07:16:04 +13:00
|
|
|
"start": 174,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
2024-12-07 07:16:04 +13:00
|
|
|
],
|
|
|
|
"end": 187,
|
|
|
|
"start": 28,
|
|
|
|
"type": "PipeExpression",
|
|
|
|
"type": "PipeExpression"
|
|
|
|
},
|
|
|
|
"start": 20,
|
|
|
|
"type": "VariableDeclarator"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 187,
|
|
|
|
"kind": "const",
|
|
|
|
"start": 20,
|
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"argument": {
|
|
|
|
"end": 203,
|
|
|
|
"name": "myBox",
|
|
|
|
"start": 198,
|
|
|
|
"type": "Identifier",
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "Identifier"
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"end": 203,
|
|
|
|
"start": 191,
|
|
|
|
"type": "ReturnStatement",
|
|
|
|
"type": "ReturnStatement"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 205,
|
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
|
|
|
"end": 191,
|
|
|
|
"start": 187,
|
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 16
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 205,
|
|
|
|
"params": [
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 8,
|
|
|
|
"name": "h",
|
|
|
|
"start": 7,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 11,
|
|
|
|
"name": "l",
|
|
|
|
"start": 10,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 14,
|
|
|
|
"name": "w",
|
|
|
|
"start": 13,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"start": 6,
|
|
|
|
"type": "FunctionExpression",
|
|
|
|
"type": "FunctionExpression"
|
|
|
|
},
|
|
|
|
"start": 3,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 205,
|
2024-11-21 18:33:02 -06:00
|
|
|
"kind": "fn",
|
|
|
|
"start": 0,
|
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 228,
|
|
|
|
"id": {
|
|
|
|
"end": 212,
|
|
|
|
"name": "fnBox",
|
|
|
|
"start": 207,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 220,
|
|
|
|
"raw": "3",
|
|
|
|
"start": 219,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 3.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"end": 223,
|
|
|
|
"raw": "6",
|
|
|
|
"start": 222,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 6.0
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"end": 227,
|
|
|
|
"raw": "10",
|
|
|
|
"start": 225,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 10.0
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 218,
|
|
|
|
"name": "box",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 215,
|
2024-12-07 07:16:04 +13:00
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 228,
|
|
|
|
"start": 215,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
"start": 207,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 228,
|
2024-11-21 18:33:02 -06:00
|
|
|
"kind": "const",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 207,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
}
|
|
|
|
],
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 229,
|
2024-11-21 18:33:02 -06:00
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 207,
|
|
|
|
"start": 205,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 0
|
|
|
|
}
|
|
|
|
}
|