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

1024 lines
31 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing i-beam.kcl
---
{
"Ok": {
"body": [
{
"commentStart": 160,
"declaration": {
"commentStart": 188,
"end": 0,
"id": {
"commentStart": 188,
"end": 0,
"name": "beamLength",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 201,
"end": 0,
"left": {
"commentStart": 201,
"end": 0,
"raw": "6",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
},
"operator": "*",
"right": {
"arguments": [],
"callee": {
"abs_path": false,
"commentStart": 203,
"end": 0,
"name": {
"commentStart": 203,
"end": 0,
"name": "ft",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 203,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"preComments": [
"// Define Beam Dimensions"
],
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 208,
"declaration": {
"commentStart": 208,
"end": 0,
"id": {
"commentStart": 208,
"end": 0,
"name": "beamHeight",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 221,
"end": 0,
"raw": "4",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 223,
"declaration": {
"commentStart": 223,
"end": 0,
"id": {
"commentStart": 223,
"end": 0,
"name": "flangeWidth",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 237,
"end": 0,
"raw": "2.663",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.663,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 243,
"declaration": {
"commentStart": 243,
"end": 0,
"id": {
"commentStart": 243,
"end": 0,
"name": "flangeThickness",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 261,
"end": 0,
"raw": "0.293",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.293,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 267,
"declaration": {
"commentStart": 267,
"end": 0,
"id": {
"commentStart": 267,
"end": 0,
"name": "webThickness",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 282,
"end": 0,
"raw": "0.193",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.193,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 288,
"declaration": {
"commentStart": 288,
"end": 0,
"id": {
"commentStart": 288,
"end": 0,
"name": "rootRadius",
"start": 0,
"type": "Identifier"
},
"init": {
"commentStart": 301,
"end": 0,
"raw": "0.457",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.457,
"suffix": "None"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"commentStart": 306,
"declaration": {
"commentStart": 433,
"end": 0,
"id": {
"commentStart": 433,
"end": 0,
"name": "sketch001",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"argument": {
"abs_path": false,
"commentStart": 460,
"end": 0,
"name": {
"commentStart": 460,
"end": 0,
"name": "XZ",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 459,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"callee": {
"abs_path": false,
"commentStart": 445,
"end": 0,
"name": {
"commentStart": 445,
"end": 0,
"name": "startSketchOn",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 445,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"commentStart": 484,
"elements": [
{
"commentStart": 485,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 488,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 488,
"end": 0,
"name": {
"commentStart": 488,
"end": 0,
"name": "beamHeight",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 501,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"commentStart": 505,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"abs_path": false,
"commentStart": 469,
"end": 0,
"name": {
"commentStart": 469,
"end": 0,
"name": "startProfileAt",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 469,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 519,
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 528,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 528,
"end": 0,
"name": {
"commentStart": 528,
"end": 0,
"name": "flangeWidth",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 542,
"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": 513,
"end": 0,
"name": {
"commentStart": 513,
"end": 0,
"name": "xLine",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 513,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 556,
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"argument": {
"abs_path": false,
"commentStart": 566,
"end": 0,
"name": {
"commentStart": 566,
"end": 0,
"name": "flangeThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"commentStart": 565,
"end": 0,
"operator": "-",
"start": 0,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 550,
"end": 0,
"name": {
"commentStart": 550,
"end": 0,
"name": "yLine",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 550,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 594,
"end": 0,
"name": "endAbsolute",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 608,
"end": 0,
"left": {
"commentStart": 608,
"end": 0,
"left": {
"abs_path": false,
"commentStart": 608,
"end": 0,
"name": {
"commentStart": 608,
"end": 0,
"name": "webThickness",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"operator": "/",
"right": {
"commentStart": 623,
"end": 0,
"raw": "2",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.0,
"suffix": "None"
}
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
},
"operator": "+",
"right": {
"abs_path": false,
"commentStart": 627,
"end": 0,
"name": {
"commentStart": 627,
"end": 0,
"name": "rootRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
},
"start": 0,
"type": "BinaryExpression",
"type": "BinaryExpression"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 588,
"end": 0,
"name": {
"commentStart": 588,
"end": 0,
"name": "xLine",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 588,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"commentStart": 658,
"end": 0,
"properties": [
{
"commentStart": 660,
"end": 0,
"key": {
"commentStart": 660,
"end": 0,
"name": "radius",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"abs_path": false,
"commentStart": 669,
"end": 0,
"name": {
"commentStart": 669,
"end": 0,
"name": "rootRadius",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
},
{
"commentStart": 681,
"end": 0,
"key": {
"commentStart": 681,
"end": 0,
"name": "offset",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"commentStart": 690,
"end": 0,
"raw": "90",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 90.0,
"suffix": "None"
}
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"commentStart": 696,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"abs_path": false,
"commentStart": 644,
"end": 0,
"name": {
"commentStart": 644,
"end": 0,
"name": "tangentialArc",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 644,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 710,
"end": 0,
"name": "endAbsolute",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 724,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
}
],
"callee": {
"abs_path": false,
"commentStart": 704,
"end": 0,
"name": {
"commentStart": 704,
"end": 0,
"name": "yLine",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 704,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"commentStart": 741,
"end": 0,
"properties": [
{
"commentStart": 743,
"end": 0,
"key": {
"commentStart": 743,
"end": 0,
"name": "axis",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"commentStart": 750,
"end": 0,
"raw": "'X'",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "X"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"commentStart": 757,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"abs_path": false,
"commentStart": 732,
"end": 0,
"name": {
"commentStart": 732,
"end": 0,
"name": "mirror2d",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 732,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"commentStart": 774,
"end": 0,
"properties": [
{
"commentStart": 776,
"end": 0,
"key": {
"commentStart": 776,
"end": 0,
"name": "axis",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"commentStart": 783,
"end": 0,
"raw": "'Y'",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "Y"
}
}
],
"start": 0,
"type": "ObjectExpression",
"type": "ObjectExpression"
},
{
"commentStart": 790,
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"abs_path": false,
"commentStart": 765,
"end": 0,
"name": {
"commentStart": 765,
"end": 0,
"name": "mirror2d",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 765,
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 806,
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"abs_path": false,
"commentStart": 815,
"end": 0,
"name": {
"commentStart": 815,
"end": 0,
"name": "beamLength",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
}
],
"callee": {
"abs_path": false,
"commentStart": 798,
"end": 0,
"name": {
"commentStart": 798,
"end": 0,
"name": "extrude",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name"
},
"commentStart": 798,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 445,
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"preComments": [
"",
"",
"// Sketch a quadrant of the beam cross section, then mirror for symmetry across each axis. Extrude to the appropriate length"
],
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"commentStart": 0,
"end": 0,
"innerAttrs": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 128,
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"preComments": [
"// I-beam",
"// A structural metal beam with an I shaped cross section. Often used in construction and architecture",
"",
"",
"// Set Units"
],
"properties": [
{
"commentStart": 137,
"end": 0,
"key": {
"commentStart": 137,
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"abs_path": false,
"commentStart": 157,
"end": 0,
"name": {
"commentStart": 157,
"end": 0,
"name": "in",
"start": 0,
"type": "Identifier"
},
"path": [],
"start": 0,
"type": "Name",
"type": "Name"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {},
"startNodes": [
{
"commentStart": 160,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"start": 0
}
}