Files
modeling-app/rust/kcl-lib/tests/kcl_samples/bench/ast.snap
2025-03-26 11:53:34 -04:00

1365 lines
39 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing bench.kcl
---
{
"Ok": {
"body": [
{
"commentStart": 394,
"declaration": {
"commentStart": 423,
"end": 0,
"id": {
"commentStart": 423,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 437,
"end": 0,
"raw": "56",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 56.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"preComments": [
"// Define the bench length"
],
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 439,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"preComments": [
"",
"",
"// Import various constants and functions from our library"
],
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 507,
"end": 0,
"name": {
"commentStart": 507,
"end": 0,
"name": "dividerThickness",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 547,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 554,
"end": 0,
"name": {
"commentStart": 554,
"end": 0,
"name": "divider",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 585,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 592,
"end": 0,
"name": {
"commentStart": 592,
"end": 0,
"name": "connector",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 625,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 632,
"end": 0,
"name": {
"commentStart": 632,
"end": 0,
"name": "seatSlats",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 665,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 672,
"end": 0,
"name": {
"commentStart": 672,
"end": 0,
"name": "backSlats",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 705,
"end": 0,
"path": {
"type": "Kcl",
"filename": "bench-parts.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 712,
"end": 0,
"name": {
"commentStart": 712,
"end": 0,
"name": "armRest",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 742,
"end": 0,
"expression": {
"arguments": [
{
"abs_path": false,
"commentStart": 811,
"end": 0,
"name": {
"commentStart": 811,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
"abs_path": false,
"commentStart": 803,
"end": 0,
"name": {
"commentStart": 803,
"end": 0,
"name": "divider",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 803,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"preComments": [
"",
"",
"// Create the dividers, these hold the seat and back slats"
],
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 815,
"end": 0,
"expression": {
"arguments": [
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 840,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 849,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 849,
"end": 0,
"name": {
"commentStart": 849,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 863,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 823,
"end": 0,
"name": {
"commentStart": 823,
"end": 0,
"name": "offsetPlane",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 823,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"argument": {
"abs_path": false,
"commentStart": 836,
"end": 0,
"name": {
"commentStart": 836,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 835,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 815,
"end": 0,
"name": {
"commentStart": 815,
"end": 0,
"name": "divider",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 815,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 867,
"end": 0,
"expression": {
"arguments": [
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 891,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 900,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 900,
"end": 0,
"name": {
"commentStart": 900,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 914,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 875,
"end": 0,
"name": {
"commentStart": 875,
"end": 0,
"name": "offsetPlane",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 875,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"abs_path": false,
"commentStart": 887,
"end": 0,
"name": {
"commentStart": 887,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 867,
"end": 0,
"name": {
"commentStart": 867,
"end": 0,
"name": "divider",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 867,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 917,
"end": 0,
"expression": {
"arguments": [
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 991,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 1000,
"end": 0,
"left": {
"argument": {
"abs_path": false,
"commentStart": 1001,
"end": 0,
"name": {
"commentStart": 1001,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1000,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"commentStart": 1015,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 975,
"end": 0,
"name": {
"commentStart": 975,
"end": 0,
"name": "offsetPlane",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 975,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"abs_path": false,
"commentStart": 987,
"end": 0,
"name": {
"commentStart": 987,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
},
{
"abs_path": false,
"commentStart": 1019,
"end": 0,
"name": {
"commentStart": 1019,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
],
"callee": {
"abs_path": false,
"commentStart": 965,
"end": 0,
"name": {
"commentStart": 965,
"end": 0,
"name": "connector",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 965,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"preComments": [
"",
"",
"// Create the connectors to join the dividers"
],
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 1031,
"end": 0,
"expression": {
"arguments": [
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 1084,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 1093,
"end": 0,
"left": {
"commentStart": 1093,
"end": 0,
"left": {
"argument": {
"abs_path": false,
"commentStart": 1094,
"end": 0,
"name": {
"commentStart": 1094,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1093,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"commentStart": 1108,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"commentStart": 1113,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 1113,
"end": 0,
"name": {
"commentStart": 1113,
"end": 0,
"name": "dividerThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 1132,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 1068,
"end": 0,
"name": {
"commentStart": 1068,
"end": 0,
"name": "offsetPlane",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1068,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"abs_path": false,
"commentStart": 1080,
"end": 0,
"name": {
"commentStart": 1080,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
},
{
"commentStart": 1137,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 1137,
"end": 0,
"name": {
"commentStart": 1137,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 1151,
"end": 0,
"name": {
"commentStart": 1151,
"end": 0,
"name": "dividerThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 1058,
"end": 0,
"name": {
"commentStart": 1058,
"end": 0,
"name": "seatSlats",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1058,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"preComments": [
"",
"",
"// Create the seat slats"
],
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 1168,
"end": 0,
"expression": {
"arguments": [
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 1221,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 1230,
"end": 0,
"left": {
"commentStart": 1230,
"end": 0,
"left": {
"argument": {
"abs_path": false,
"commentStart": 1231,
"end": 0,
"name": {
"commentStart": 1231,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1230,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"commentStart": 1245,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "-",
"right": {
"commentStart": 1250,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 1250,
"end": 0,
"name": {
"commentStart": 1250,
"end": 0,
"name": "dividerThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 1269,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 1205,
"end": 0,
"name": {
"commentStart": 1205,
"end": 0,
"name": "offsetPlane",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1205,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"abs_path": false,
"commentStart": 1217,
"end": 0,
"name": {
"commentStart": 1217,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
},
{
"commentStart": 1274,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 1274,
"end": 0,
"name": {
"commentStart": 1274,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 1288,
"end": 0,
"name": {
"commentStart": 1288,
"end": 0,
"name": "dividerThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 1195,
"end": 0,
"name": {
"commentStart": 1195,
"end": 0,
"name": "backSlats",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1195,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"preComments": [
"",
"",
"// Create the back slats"
],
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 1305,
"end": 0,
"expression": {
"arguments": [
{
"argument": {
"abs_path": false,
"commentStart": 1340,
"end": 0,
"name": {
"commentStart": 1340,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1339,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"commentStart": 1344,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 1344,
"end": 0,
"name": {
"commentStart": 1344,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 1358,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 1331,
"end": 0,
"name": {
"commentStart": 1331,
"end": 0,
"name": "armRest",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1331,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"preComments": [
"",
"",
"// Create the arm rests"
],
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 1361,
"end": 0,
"expression": {
"arguments": [
{
"argument": {
"abs_path": false,
"commentStart": 1370,
"end": 0,
"name": {
"commentStart": 1370,
"end": 0,
"name": "YZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1369,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"commentStart": 1374,
"end": 0,
"left": {
"argument": {
"abs_path": false,
"commentStart": 1375,
"end": 0,
"name": {
"commentStart": 1375,
"end": 0,
"name": "benchLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 1374,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
"operator": "/",
"right": {
"commentStart": 1389,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 1361,
"end": 0,
"name": {
"commentStart": 1361,
"end": 0,
"name": "armRest",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 1361,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"commentStart": 0,
"end": 0,
"innerAttrs": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 362,
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"preComments": [
"// Bench",
"// This is a slight remix of Depep1's original 3D Boaty (https://www.printables.com/model/1141963-3d-boaty). This is a tool used for benchmarking 3D FDM printers for bed adhesion, overhangs, bridging and top surface quality. The name of this file is a bit of misnomer, the shape of the object is a typical park bench.",
"",
"",
"// Set units in millimeters (mm)"
],
"properties": [
{
"commentStart": 371,
"end": 0,
"key": {
"commentStart": 371,
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"abs_path": false,
"commentStart": 391,
"end": 0,
"name": {
"commentStart": 391,
"end": 0,
"name": "mm",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"startNodes": [
{
"commentStart": 394,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"start": 0
}
}