2024-11-21 18:33:02 -06:00
|
|
|
---
|
|
|
|
source: kcl/src/simulation_tests.rs
|
|
|
|
description: Result of parsing function_sketch_with_position.kcl
|
|
|
|
---
|
|
|
|
{
|
|
|
|
"Ok": {
|
|
|
|
"body": [
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"declaration": {
|
|
|
|
"end": 203,
|
|
|
|
"id": {
|
|
|
|
"end": 6,
|
|
|
|
"name": "box",
|
|
|
|
"start": 3,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"declaration": {
|
|
|
|
"end": 185,
|
|
|
|
"id": {
|
|
|
|
"end": 28,
|
|
|
|
"name": "myBox",
|
|
|
|
"start": 23,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"body": [
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 49,
|
|
|
|
"raw": "'XY'",
|
|
|
|
"start": 45,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": "XY"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 44,
|
|
|
|
"name": "startSketchOn",
|
|
|
|
"start": 31,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 50,
|
|
|
|
"start": 31,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 74,
|
|
|
|
"name": "p",
|
|
|
|
"start": 73,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 77,
|
|
|
|
"start": 76,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 72,
|
|
|
|
"name": "startProfileAt",
|
|
|
|
"start": 58,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 78,
|
|
|
|
"start": 58,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 93,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 92,
|
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": 96,
|
|
|
|
"name": "l",
|
|
|
|
"start": 95,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 97,
|
|
|
|
"start": 91,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 100,
|
|
|
|
"start": 99,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 90,
|
|
|
|
"name": "line",
|
|
|
|
"start": 86,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 101,
|
|
|
|
"start": 86,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"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": 116,
|
|
|
|
"name": "w",
|
|
|
|
"start": 115,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 119,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 118,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 120,
|
|
|
|
"start": 114,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 123,
|
|
|
|
"start": 122,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 113,
|
|
|
|
"name": "line",
|
|
|
|
"start": 109,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 124,
|
|
|
|
"start": 109,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
2024-11-21 18:33:02 -06:00
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 139,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 138,
|
|
|
|
"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": 143,
|
|
|
|
"name": "l",
|
|
|
|
"start": 142,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 143,
|
|
|
|
"operator": "-",
|
|
|
|
"start": 141,
|
|
|
|
"type": "UnaryExpression",
|
|
|
|
"type": "UnaryExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 144,
|
|
|
|
"start": 137,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 147,
|
|
|
|
"start": 146,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 136,
|
|
|
|
"name": "line",
|
|
|
|
"start": 132,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 148,
|
|
|
|
"start": 132,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 163,
|
|
|
|
"start": 162,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 161,
|
|
|
|
"name": "close",
|
|
|
|
"start": 156,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"end": 164,
|
|
|
|
"start": 156,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"end": 181,
|
|
|
|
"name": "h",
|
|
|
|
"start": 180,
|
|
|
|
"type": "Identifier",
|
|
|
|
"type": "Identifier"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 184,
|
|
|
|
"start": 183,
|
|
|
|
"type": "PipeSubstitution",
|
|
|
|
"type": "PipeSubstitution"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"callee": {
|
|
|
|
"end": 179,
|
|
|
|
"name": "extrude",
|
|
|
|
"start": 172,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 185,
|
2024-12-07 07:16:04 +13:00
|
|
|
"start": 172,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
2024-12-07 07:16:04 +13:00
|
|
|
],
|
|
|
|
"end": 185,
|
|
|
|
"start": 31,
|
|
|
|
"type": "PipeExpression",
|
|
|
|
"type": "PipeExpression"
|
|
|
|
},
|
|
|
|
"start": 23,
|
|
|
|
"type": "VariableDeclarator"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 185,
|
|
|
|
"kind": "const",
|
|
|
|
"start": 23,
|
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
|
|
|
{
|
2024-12-07 07:16:04 +13:00
|
|
|
"argument": {
|
|
|
|
"end": 201,
|
|
|
|
"name": "myBox",
|
|
|
|
"start": 196,
|
|
|
|
"type": "Identifier",
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "Identifier"
|
2024-12-07 07:16:04 +13:00
|
|
|
},
|
|
|
|
"end": 201,
|
|
|
|
"start": 189,
|
|
|
|
"type": "ReturnStatement",
|
|
|
|
"type": "ReturnStatement"
|
2024-11-21 18:33:02 -06:00
|
|
|
}
|
|
|
|
],
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 203,
|
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
|
|
|
"end": 189,
|
|
|
|
"start": 185,
|
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 19
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
"end": 203,
|
|
|
|
"params": [
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 8,
|
|
|
|
"name": "p",
|
|
|
|
"start": 7,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 11,
|
|
|
|
"name": "h",
|
|
|
|
"start": 10,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 14,
|
|
|
|
"name": "l",
|
|
|
|
"start": 13,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"type": "Parameter",
|
|
|
|
"identifier": {
|
|
|
|
"end": 17,
|
|
|
|
"name": "w",
|
|
|
|
"start": 16,
|
|
|
|
"type": "Identifier"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"start": 6,
|
|
|
|
"type": "FunctionExpression",
|
|
|
|
"type": "FunctionExpression"
|
|
|
|
},
|
|
|
|
"start": 3,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 203,
|
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": 234,
|
|
|
|
"id": {
|
|
|
|
"end": 210,
|
|
|
|
"name": "thing",
|
|
|
|
"start": 205,
|
|
|
|
"type": "Identifier"
|
|
|
|
},
|
|
|
|
"init": {
|
|
|
|
"arguments": [
|
|
|
|
{
|
|
|
|
"elements": [
|
|
|
|
{
|
|
|
|
"end": 219,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 218,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"end": 222,
|
|
|
|
"raw": "0",
|
|
|
|
"start": 221,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 0.0
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"end": 223,
|
|
|
|
"start": 217,
|
|
|
|
"type": "ArrayExpression",
|
|
|
|
"type": "ArrayExpression"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"end": 226,
|
|
|
|
"raw": "3",
|
|
|
|
"start": 225,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 3.0
|
2024-11-21 18:33:02 -06:00
|
|
|
},
|
2024-12-07 07:16:04 +13:00
|
|
|
{
|
|
|
|
"end": 229,
|
|
|
|
"raw": "6",
|
|
|
|
"start": 228,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 6.0
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"end": 233,
|
|
|
|
"raw": "10",
|
|
|
|
"start": 231,
|
|
|
|
"type": "Literal",
|
|
|
|
"type": "Literal",
|
|
|
|
"value": 10.0
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"callee": {
|
|
|
|
"end": 216,
|
|
|
|
"name": "box",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 213,
|
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": 234,
|
|
|
|
"start": 213,
|
|
|
|
"type": "CallExpression",
|
|
|
|
"type": "CallExpression"
|
|
|
|
},
|
|
|
|
"start": 205,
|
|
|
|
"type": "VariableDeclarator"
|
|
|
|
},
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 234,
|
2024-11-21 18:33:02 -06:00
|
|
|
"kind": "const",
|
2024-11-27 15:46:58 +13:00
|
|
|
"start": 205,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "VariableDeclaration",
|
|
|
|
"type": "VariableDeclaration"
|
|
|
|
}
|
|
|
|
],
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 235,
|
2024-11-21 18:33:02 -06:00
|
|
|
"nonCodeMeta": {
|
|
|
|
"nonCodeNodes": {
|
|
|
|
"0": [
|
|
|
|
{
|
2024-11-27 15:46:58 +13:00
|
|
|
"end": 205,
|
|
|
|
"start": 203,
|
2024-11-21 18:33:02 -06:00
|
|
|
"type": "NonCodeNode",
|
|
|
|
"value": {
|
|
|
|
"type": "newLine"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"startNodes": []
|
|
|
|
},
|
|
|
|
"start": 0
|
|
|
|
}
|
|
|
|
}
|