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

446 lines
15 KiB
Plaintext
Raw Normal View History

---
source: kcl/src/simulation_tests.rs
description: Result of parsing function_sketch.kcl
---
{
"Ok": {
"body": [
{
"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"
},
{
"arguments": [
{
"elements": [
{
"end": 72,
"raw": "0",
"start": 71,
"type": "Literal",
"type": "Literal",
"value": 0.0
},
{
"end": 75,
"raw": "0",
"start": 74,
"type": "Literal",
"type": "Literal",
"value": 0.0
}
],
"end": 76,
"start": 70,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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": [
{
"end": 95,
"raw": "0",
"start": 94,
"type": "Literal",
"type": "Literal",
"value": 0.0
},
{
"end": 98,
"name": "l",
"start": 97,
"type": "Identifier",
"type": "Identifier"
}
],
"end": 99,
"start": 93,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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": [
{
"end": 118,
"name": "w",
"start": 117,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 121,
"raw": "0",
"start": 120,
"type": "Literal",
"type": "Literal",
"value": 0.0
}
],
"end": 122,
"start": 116,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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": [
{
"end": 141,
"raw": "0",
"start": 140,
"type": "Literal",
"type": "Literal",
"value": 0.0
},
{
"argument": {
"end": 145,
"name": "l",
"start": 144,
"type": "Identifier",
"type": "Identifier"
},
"end": 145,
"operator": "-",
"start": 143,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 146,
"start": 139,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"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"
},
{
"end": 186,
"start": 185,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 181,
"name": "extrude",
"start": 174,
"type": "Identifier"
},
"end": 187,
"start": 174,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 187,
"start": 28,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 20,
"type": "VariableDeclarator"
},
"end": 187,
"kind": "const",
"start": 20,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"argument": {
"end": 203,
"name": "myBox",
"start": 198,
"type": "Identifier",
"type": "Identifier"
},
"end": 203,
"start": 191,
"type": "ReturnStatement",
"type": "ReturnStatement"
}
],
"end": 205,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 191,
"start": 187,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 16
},
"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"
},
"end": 205,
"kind": "fn",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"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
},
{
"end": 227,
"raw": "10",
"start": 225,
"type": "Literal",
"type": "Literal",
"value": 10.0
}
],
"callee": {
"end": 218,
"name": "box",
"start": 215,
"type": "Identifier"
},
"end": 228,
"start": 215,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 207,
"type": "VariableDeclarator"
},
"end": 228,
"kind": "const",
"start": 207,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 229,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 207,
"start": 205,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}