Files
modeling-app/rust/kcl-lib/tests/kcl_samples/car-wheel-assembly/ast.snap
Nick Cameron 461a2c3ab2 Support comments on attributes (#5850)
Signed-off-by: Nick Cameron <nrc@ncameron.org>
2025-03-20 16:23:20 +13:00

652 lines
18 KiB
Plaintext

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing car-wheel-assembly.kcl
---
{
"Ok": {
"body": [
{
"commentStart": 127,
"end": 0,
"path": {
"type": "Kcl",
"filename": "car-wheel.kcl"
},
"selector": {
"type": "None",
"alias": {
"commentStart": 155,
"end": 0,
"name": "carWheel",
"start": 0,
"type": "Identifier"
}
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 164,
"end": 0,
"path": {
"type": "Kcl",
"filename": "car-rotor.kcl"
},
"selector": {
"type": "None",
"alias": {
"commentStart": 190,
"end": 0,
"name": "carRotor",
"start": 0,
"type": "Identifier"
}
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 199,
"end": 0,
"path": {
"type": "Kcl",
"filename": "brake-caliper.kcl"
},
"selector": {
"type": "None",
"alias": {
"commentStart": 229,
"end": 0,
"name": "brakeCaliper",
"start": 0,
"type": "Identifier"
}
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 242,
"end": 0,
"path": {
"type": "Kcl",
"filename": "lug-nut.kcl"
},
"selector": {
"type": "None",
"alias": {
"commentStart": 266,
"end": 0,
"name": "lugNut",
"start": 0,
"type": "Identifier"
}
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 273,
"end": 0,
"path": {
"type": "Kcl",
"filename": "car-tire.kcl"
},
"selector": {
"type": "None",
"alias": {
"commentStart": 298,
"end": 0,
"name": "carTire",
"start": 0,
"type": "Identifier"
}
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 306,
"end": 0,
"path": {
"type": "Kcl",
"filename": "globals.kcl"
},
"selector": {
"type": "List",
"items": [
{
"alias": null,
"commentStart": 313,
"end": 0,
"name": {
"commentStart": 313,
"end": 0,
"name": "lugCount",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ImportItem"
}
]
},
"start": 0,
"type": "ImportStatement",
"type": "ImportStatement"
},
{
"commentStart": 340,
"end": 0,
"expression": {
"body": [
{
"commentStart": 342,
"end": 0,
"name": "carRotor",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 366,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 378,
"elements": [
{
"commentStart": 379,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 382,
"end": 0,
"raw": "0.5",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.5,
"suffix": "None"
}
},
{
"commentStart": 387,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"commentStart": 356,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"commentStart": 356,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 342,
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 391,
"end": 0,
"expression": {
"commentStart": 391,
"end": 0,
"name": "carWheel",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 400,
"end": 0,
"expression": {
"body": [
{
"commentStart": 400,
"end": 0,
"name": "lugNut",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 436,
"end": 0,
"name": "arcDegrees",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 449,
"end": 0,
"raw": "360",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 360.0,
"suffix": "None"
}
}
},
{
"type": "LabeledArg",
"label": {
"commentStart": 459,
"end": 0,
"name": "axis",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 466,
"elements": [
{
"commentStart": 467,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 470,
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"commentStart": 473,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"commentStart": 482,
"end": 0,
"name": "center",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 491,
"elements": [
{
"commentStart": 492,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 495,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 498,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"commentStart": 507,
"end": 0,
"name": "instances",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 519,
"end": 0,
"name": "lugCount",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
{
"type": "LabeledArg",
"label": {
"commentStart": 534,
"end": 0,
"name": "rotateDuplicates",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 553,
"end": 0,
"raw": "false",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": false
}
}
],
"callee": {
"commentStart": 412,
"end": 0,
"name": "patternCircular3d",
"start": 0,
"type": "Identifier"
},
"commentStart": 412,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 400,
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 564,
"end": 0,
"expression": {
"body": [
{
"commentStart": 564,
"end": 0,
"name": "brakeCaliper",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"commentStart": 592,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"arg": {
"commentStart": 604,
"elements": [
{
"commentStart": 605,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"commentStart": 608,
"end": 0,
"raw": "0.5",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.5,
"suffix": "None"
}
},
{
"commentStart": 613,
"end": 0,
"raw": "0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 0,
"start": 0,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"commentStart": 582,
"end": 0,
"name": "translate",
"start": 0,
"type": "Identifier"
},
"commentStart": 582,
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"commentStart": 564,
"end": 0,
"start": 0,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
},
{
"commentStart": 617,
"end": 0,
"expression": {
"commentStart": 617,
"end": 0,
"name": "carTire",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"start": 0,
"type": "ExpressionStatement",
"type": "ExpressionStatement"
}
],
"commentStart": 0,
"end": 0,
"innerAttrs": [
{
"commentStart": 0,
"end": 0,
"name": {
"commentStart": 95,
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"preComments": [
"// Car Wheel Assembly",
"// A car wheel assembly with a rotor, tire, and lug nuts.",
"",
"",
"// Set units"
],
"properties": [
{
"commentStart": 104,
"end": 0,
"key": {
"commentStart": 104,
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"commentStart": 124,
"end": 0,
"name": "in",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {
"5": [
{
"commentStart": 340,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": [
{
"commentStart": 127,
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"start": 0
}
}