Files
modeling-app/src/wasm-lib/kcl/tests/function_sketch_with_position/ast.snap

462 lines
16 KiB
Plaintext
Raw Normal View History

---
source: kcl/src/simulation_tests.rs
description: Result of parsing function_sketch_with_position.kcl
---
{
"Ok": {
"body": [
{
"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"
},
{
"arguments": [
{
"end": 74,
"name": "p",
"start": 73,
"type": "Identifier",
"type": "Identifier"
},
{
"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": [
{
"end": 93,
"raw": "0",
"start": 92,
"type": "Literal",
"type": "Literal",
"value": 0.0
},
{
"end": 96,
"name": "l",
"start": 95,
"type": "Identifier",
"type": "Identifier"
}
],
"end": 97,
"start": 91,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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": [
{
"elements": [
{
"end": 116,
"name": "w",
"start": 115,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 119,
"raw": "0",
"start": 118,
"type": "Literal",
"type": "Literal",
"value": 0.0
}
],
"end": 120,
"start": 114,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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": [
{
"end": 139,
"raw": "0",
"start": 138,
"type": "Literal",
"type": "Literal",
"value": 0.0
},
{
"argument": {
"end": 143,
"name": "l",
"start": 142,
"type": "Identifier",
"type": "Identifier"
},
"end": 143,
"operator": "-",
"start": 141,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 144,
"start": 137,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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"
},
{
"end": 184,
"start": 183,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 179,
"name": "extrude",
"start": 172,
"type": "Identifier"
},
"end": 185,
"start": 172,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 185,
"start": 31,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 23,
"type": "VariableDeclarator"
},
"end": 185,
"kind": "const",
"start": 23,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"argument": {
"end": 201,
"name": "myBox",
"start": 196,
"type": "Identifier",
"type": "Identifier"
},
"end": 201,
"start": 189,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 203,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 189,
"start": 185,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 19
},
"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"
},
"end": 203,
"kind": "fn",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"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
},
{
"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",
"start": 213,
"type": "Identifier"
},
"end": 234,
"start": 213,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 205,
"type": "VariableDeclarator"
},
"end": 234,
"kind": "const",
"start": 205,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 235,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 205,
"start": 203,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}