* git mv src/wasm-lib rust Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv wasm-lib to workspace Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv kcl-lib Signed-off-by: Jess Frazelle <github@jessfraz.com> * mv derive docs Signed-off-by: Jess Frazelle <github@jessfraz.com> * resolve file paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * clippy Signed-off-by: Jess Frazelle <github@jessfraz.com> * move more shit Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix more paths Signed-off-by: Jess Frazelle <github@jessfraz.com> * make yarn build:wasm work Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix scripts Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixups Signed-off-by: Jess Frazelle <github@jessfraz.com> * better references Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix cargo ci Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix reference Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix more ci Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix tests Signed-off-by: Jess Frazelle <github@jessfraz.com> * cargo sort Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix script Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix Signed-off-by: Jess Frazelle <github@jessfraz.com> * fmt Signed-off-by: Jess Frazelle <github@jessfraz.com> * fix a dep Signed-off-by: Jess Frazelle <github@jessfraz.com> * sort Signed-off-by: Jess Frazelle <github@jessfraz.com> * remove unused deps Signed-off-by: Jess Frazelle <github@jessfraz.com> * Revert "remove unused deps" This reverts commit fbabdb062e275fd5cbc1476f8480a1afee15d972. * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> * deps; Signed-off-by: Jess Frazelle <github@jessfraz.com> * fixes Signed-off-by: Jess Frazelle <github@jessfraz.com> * updates Signed-off-by: Jess Frazelle <github@jessfraz.com> --------- Signed-off-by: Jess Frazelle <github@jessfraz.com>
803 lines
28 KiB
Plaintext
803 lines
28 KiB
Plaintext
---
|
|
source: kcl/src/simulation_tests.rs
|
|
description: Result of parsing cube.kcl
|
|
---
|
|
{
|
|
"Ok": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 375,
|
|
"id": {
|
|
"end": 7,
|
|
"name": "cube",
|
|
"start": 3,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": {
|
|
"body": [
|
|
{
|
|
"declaration": {
|
|
"end": 50,
|
|
"id": {
|
|
"end": 33,
|
|
"name": "l",
|
|
"start": 32,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"end": 50,
|
|
"left": {
|
|
"end": 46,
|
|
"name": "sideLength",
|
|
"start": 36,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"operator": "/",
|
|
"right": {
|
|
"end": 50,
|
|
"raw": "2",
|
|
"start": 49,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 2.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 36,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 32,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 50,
|
|
"kind": "const",
|
|
"start": 32,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 66,
|
|
"id": {
|
|
"end": 54,
|
|
"name": "x",
|
|
"start": 53,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"computed": false,
|
|
"end": 66,
|
|
"object": {
|
|
"end": 63,
|
|
"name": "center",
|
|
"start": 57,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"property": {
|
|
"end": 65,
|
|
"raw": "0",
|
|
"start": 64,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 57,
|
|
"type": "MemberExpression",
|
|
"type": "MemberExpression"
|
|
},
|
|
"start": 53,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 66,
|
|
"kind": "const",
|
|
"start": 53,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 82,
|
|
"id": {
|
|
"end": 70,
|
|
"name": "y",
|
|
"start": 69,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"computed": false,
|
|
"end": 82,
|
|
"object": {
|
|
"end": 79,
|
|
"name": "center",
|
|
"start": 73,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"property": {
|
|
"end": 81,
|
|
"raw": "1",
|
|
"start": 80,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 73,
|
|
"type": "MemberExpression",
|
|
"type": "MemberExpression"
|
|
},
|
|
"start": 69,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 82,
|
|
"kind": "const",
|
|
"start": 69,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 106,
|
|
"id": {
|
|
"end": 87,
|
|
"name": "p0",
|
|
"start": 85,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"elements": [
|
|
{
|
|
"end": 97,
|
|
"left": {
|
|
"argument": {
|
|
"end": 93,
|
|
"name": "l",
|
|
"start": 92,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 93,
|
|
"operator": "-",
|
|
"start": 91,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 97,
|
|
"name": "x",
|
|
"start": 96,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 91,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"end": 105,
|
|
"left": {
|
|
"argument": {
|
|
"end": 101,
|
|
"name": "l",
|
|
"start": 100,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 101,
|
|
"operator": "-",
|
|
"start": 99,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 105,
|
|
"name": "y",
|
|
"start": 104,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 99,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
],
|
|
"end": 106,
|
|
"start": 90,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
"start": 85,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 106,
|
|
"kind": "const",
|
|
"start": 85,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 129,
|
|
"id": {
|
|
"end": 111,
|
|
"name": "p1",
|
|
"start": 109,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"elements": [
|
|
{
|
|
"end": 121,
|
|
"left": {
|
|
"argument": {
|
|
"end": 117,
|
|
"name": "l",
|
|
"start": 116,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 117,
|
|
"operator": "-",
|
|
"start": 115,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 121,
|
|
"name": "x",
|
|
"start": 120,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 115,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"end": 128,
|
|
"left": {
|
|
"end": 124,
|
|
"name": "l",
|
|
"start": 123,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 128,
|
|
"name": "y",
|
|
"start": 127,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 123,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
],
|
|
"end": 129,
|
|
"start": 114,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
"start": 109,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 129,
|
|
"kind": "const",
|
|
"start": 109,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 151,
|
|
"id": {
|
|
"end": 134,
|
|
"name": "p2",
|
|
"start": 132,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"elements": [
|
|
{
|
|
"end": 143,
|
|
"left": {
|
|
"end": 139,
|
|
"name": "l",
|
|
"start": 138,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 143,
|
|
"name": "x",
|
|
"start": 142,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 138,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"end": 150,
|
|
"left": {
|
|
"end": 146,
|
|
"name": "l",
|
|
"start": 145,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 150,
|
|
"name": "y",
|
|
"start": 149,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 145,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
],
|
|
"end": 151,
|
|
"start": 137,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
"start": 132,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 151,
|
|
"kind": "const",
|
|
"start": 132,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 174,
|
|
"id": {
|
|
"end": 156,
|
|
"name": "p3",
|
|
"start": 154,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"elements": [
|
|
{
|
|
"end": 165,
|
|
"left": {
|
|
"end": 161,
|
|
"name": "l",
|
|
"start": 160,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 165,
|
|
"name": "x",
|
|
"start": 164,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 160,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
{
|
|
"end": 173,
|
|
"left": {
|
|
"argument": {
|
|
"end": 169,
|
|
"name": "l",
|
|
"start": 168,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"end": 169,
|
|
"operator": "-",
|
|
"start": 167,
|
|
"type": "UnaryExpression",
|
|
"type": "UnaryExpression"
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"end": 173,
|
|
"name": "y",
|
|
"start": 172,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
},
|
|
"start": 167,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
],
|
|
"end": 174,
|
|
"start": 159,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
},
|
|
"start": 154,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 174,
|
|
"kind": "const",
|
|
"start": 154,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"argument": {
|
|
"body": [
|
|
{
|
|
"arguments": [
|
|
{
|
|
"end": 201,
|
|
"name": "p0",
|
|
"start": 199,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 198,
|
|
"name": "startSketchAt",
|
|
"start": 185,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 202,
|
|
"start": 185,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "endAbsolute"
|
|
},
|
|
"arg": {
|
|
"end": 231,
|
|
"name": "p1",
|
|
"start": 229,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 214,
|
|
"name": "line",
|
|
"start": 210,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 232,
|
|
"start": 210,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "endAbsolute"
|
|
},
|
|
"arg": {
|
|
"end": 261,
|
|
"name": "p2",
|
|
"start": 259,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 244,
|
|
"name": "line",
|
|
"start": 240,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 262,
|
|
"start": 240,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "endAbsolute"
|
|
},
|
|
"arg": {
|
|
"end": 291,
|
|
"name": "p3",
|
|
"start": 289,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 274,
|
|
"name": "line",
|
|
"start": 270,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 292,
|
|
"start": 270,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "endAbsolute"
|
|
},
|
|
"arg": {
|
|
"end": 321,
|
|
"name": "p0",
|
|
"start": 319,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 304,
|
|
"name": "line",
|
|
"start": 300,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 322,
|
|
"start": 300,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
{
|
|
"arguments": [],
|
|
"callee": {
|
|
"end": 335,
|
|
"name": "close",
|
|
"start": 330,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 337,
|
|
"start": 330,
|
|
"type": "CallExpression",
|
|
"type": "CallExpression"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "length"
|
|
},
|
|
"arg": {
|
|
"end": 372,
|
|
"name": "sideLength",
|
|
"start": 362,
|
|
"type": "Identifier",
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 352,
|
|
"name": "extrude",
|
|
"start": 345,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 373,
|
|
"start": 345,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
}
|
|
],
|
|
"end": 373,
|
|
"start": 185,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"end": 373,
|
|
"start": 178,
|
|
"type": "ReturnStatement",
|
|
"type": "ReturnStatement"
|
|
}
|
|
],
|
|
"end": 375,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"6": [
|
|
{
|
|
"end": 178,
|
|
"start": 174,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 28
|
|
},
|
|
"end": 375,
|
|
"params": [
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 18,
|
|
"name": "sideLength",
|
|
"start": 8,
|
|
"type": "Identifier"
|
|
}
|
|
},
|
|
{
|
|
"type": "Parameter",
|
|
"identifier": {
|
|
"end": 26,
|
|
"name": "center",
|
|
"start": 20,
|
|
"type": "Identifier"
|
|
}
|
|
}
|
|
],
|
|
"start": 7,
|
|
"type": "FunctionExpression",
|
|
"type": "FunctionExpression"
|
|
},
|
|
"start": 3,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 375,
|
|
"kind": "fn",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"declaration": {
|
|
"end": 424,
|
|
"id": {
|
|
"end": 383,
|
|
"name": "myCube",
|
|
"start": 377,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "sideLength"
|
|
},
|
|
"arg": {
|
|
"end": 406,
|
|
"raw": "40",
|
|
"start": 404,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 40.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"type": "Identifier",
|
|
"name": "center"
|
|
},
|
|
"arg": {
|
|
"elements": [
|
|
{
|
|
"end": 419,
|
|
"raw": "0",
|
|
"start": 418,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"end": 422,
|
|
"raw": "0",
|
|
"start": 421,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
}
|
|
],
|
|
"end": 423,
|
|
"start": 417,
|
|
"type": "ArrayExpression",
|
|
"type": "ArrayExpression"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"end": 390,
|
|
"name": "cube",
|
|
"start": 386,
|
|
"type": "Identifier"
|
|
},
|
|
"end": 424,
|
|
"start": 386,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
},
|
|
"start": 377,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 424,
|
|
"kind": "const",
|
|
"start": 377,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
}
|
|
],
|
|
"end": 425,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"0": [
|
|
{
|
|
"end": 377,
|
|
"start": 375,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 0
|
|
}
|
|
}
|