Files
modeling-app/rust/kcl-lib/tests/ssi_pattern/ast.snap

853 lines
27 KiB
Plaintext
Raw Normal View History

---
source: kcl/src/simulation_tests.rs
description: Result of parsing ssi_pattern.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 272,
"id": {
"end": 9,
"name": "sketch001",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 30,
"raw": "'XZ'",
"start": 26,
"type": "Literal",
"type": "Literal",
"value": "XZ"
}
],
"callee": {
"end": 25,
"name": "startSketchOn",
"start": 12,
"type": "Identifier"
},
"end": 31,
"start": 12,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"elements": [
{
"argument": {
"end": 58,
"raw": "4.35",
"start": 54,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.35,
"suffix": "None"
}
},
"end": 58,
"operator": "-",
"start": 53,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"argument": {
"end": 66,
"raw": "12.26",
"start": 61,
"type": "Literal",
"type": "Literal",
"value": {
"value": 12.26,
"suffix": "None"
}
},
"end": 66,
"operator": "-",
"start": 60,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 67,
"start": 52,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 70,
"start": 69,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 51,
"name": "startProfileAt",
"start": 37,
"type": "Identifier"
},
"end": 71,
"start": 37,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 87,
"raw": "10.2",
"start": 83,
"type": "Literal",
"type": "Literal",
"value": {
"value": 10.2,
"suffix": "None"
}
},
{
"end": 90,
"start": 89,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 82,
"name": "yLine",
"start": 77,
"type": "Identifier"
},
"end": 91,
"start": 77,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "end"
},
"arg": {
"elements": [
{
"end": 113,
"raw": "0.54",
"start": 109,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.54,
"suffix": "None"
}
},
{
"argument": {
"end": 120,
"raw": "0.03",
"start": 116,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.03,
"suffix": "None"
}
},
"end": 120,
"operator": "-",
"start": 115,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 121,
"start": 108,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 101,
"name": "line",
"start": 97,
"type": "Identifier"
},
"end": 122,
"start": 97,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"elements": [
{
"end": 149,
"raw": "20.4",
"start": 145,
"type": "Literal",
"type": "Literal",
"value": {
"value": 20.4,
"suffix": "None"
}
},
{
"end": 156,
"raw": "14.61",
"start": 151,
"type": "Literal",
"type": "Literal",
"value": {
"value": 14.61,
"suffix": "None"
}
}
],
"end": 157,
"start": 144,
"type": "ArrayExpression",
"type": "ArrayExpression"
},
{
"end": 160,
"start": 159,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 143,
"name": "tangentialArcTo",
"start": 128,
"type": "Identifier"
},
"end": 161,
"start": 128,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"argument": {
"end": 179,
"raw": "26.76",
"start": 174,
"type": "Literal",
"type": "Literal",
"value": {
"value": 26.76,
"suffix": "None"
}
},
"end": 179,
"operator": "-",
"start": 173,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 182,
"start": 181,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 172,
"name": "yLine",
"start": 167,
"type": "Identifier"
},
"end": 183,
"start": 167,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "endAbsolute"
},
"arg": {
"elements": [
{
"arguments": [
{
"end": 224,
"start": 223,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 222,
"name": "profileStartX",
"start": 209,
"type": "Identifier"
},
"end": 225,
"start": 209,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"end": 242,
"start": 241,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 240,
"name": "profileStartY",
"start": 227,
"type": "Identifier"
},
"end": 243,
"start": 227,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 244,
"start": 208,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "tag"
},
"arg": {
"end": 258,
"start": 252,
"type": "TagDeclarator",
"type": "TagDeclarator",
"value": "seg01"
}
}
],
"callee": {
"end": 193,
"name": "line",
"start": 189,
"type": "Identifier"
},
"end": 259,
"start": 189,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [],
"callee": {
"end": 270,
"name": "close",
"start": 265,
"type": "Identifier"
},
"end": 272,
"start": 265,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 272,
"start": 12,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 272,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 318,
"id": {
"end": 284,
"name": "extrude001",
"start": 274,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "length"
},
"arg": {
"end": 317,
"raw": "50",
"start": 315,
"type": "Literal",
"type": "Literal",
"value": {
"value": 50.0,
"suffix": "None"
}
}
}
],
"callee": {
"end": 294,
"name": "extrude",
"start": 287,
"type": "Identifier"
},
"end": 318,
"start": 287,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 304,
"name": "sketch001",
"start": 295,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 274,
"type": "VariableDeclarator"
},
"end": 318,
"kind": "const",
"start": 274,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 625,
"id": {
"end": 329,
"name": "sketch002",
"start": 320,
"type": "Identifier"
},
"init": {
"body": [
{
"arguments": [
{
"end": 356,
"name": "extrude001",
"start": 346,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 363,
"name": "seg01",
"start": 358,
"type": "Identifier",
"type": "Identifier"
}
],
"callee": {
"end": 345,
"name": "startSketchOn",
"start": 332,
"type": "Identifier"
},
"end": 364,
"start": 332,
"type": "CallExpression",
"type": "CallExpression"
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "center"
},
"arg": {
"elements": [
{
"argument": {
"end": 392,
"raw": "2.08",
"start": 388,
"type": "Literal",
"type": "Literal",
"value": {
"value": 2.08,
"suffix": "None"
}
},
"end": 392,
"operator": "-",
"start": 387,
"type": "UnaryExpression",
"type": "UnaryExpression"
},
{
"end": 398,
"raw": "47.7",
"start": 394,
"type": "Literal",
"type": "Literal",
"value": {
"value": 47.7,
"suffix": "None"
}
}
],
"end": 399,
"start": 386,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "radius"
},
"arg": {
"end": 413,
"raw": "1.4",
"start": 410,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.4,
"suffix": "None"
}
}
}
],
"callee": {
"end": 376,
"name": "circle",
"start": 370,
"type": "Identifier"
},
"end": 414,
"start": 370,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "instances"
},
"arg": {
"end": 449,
"raw": "5",
"start": 448,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "distance"
},
"arg": {
"end": 463,
"raw": "5",
"start": 462,
"type": "Literal",
"type": "Literal",
"value": {
"value": 5.0,
"suffix": "None"
}
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "axis"
},
"arg": {
"elements": [
{
"end": 474,
"raw": "1",
"start": 473,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
{
"end": 477,
"raw": "0",
"start": 476,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
}
],
"end": 478,
"start": 472,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 435,
"name": "patternLinear2d",
"start": 420,
"type": "Identifier"
},
"end": 479,
"start": 420,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "instances"
},
"arg": {
"end": 567,
"raw": "6",
"start": 566,
"type": "Literal",
"type": "Literal",
"value": {
"value": 6.0,
"suffix": "None"
}
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "distance"
},
"arg": {
"end": 581,
"raw": "4",
"start": 580,
"type": "Literal",
"type": "Literal",
"value": {
"value": 4.0,
"suffix": "None"
}
}
},
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "axis"
},
"arg": {
"elements": [
{
"end": 592,
"raw": "0",
"start": 591,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"argument": {
"end": 596,
"raw": "1",
"start": 595,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"end": 596,
"operator": "-",
"start": 594,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
],
"end": 597,
"start": 590,
"type": "ArrayExpression",
"type": "ArrayExpression"
}
}
],
"callee": {
"end": 553,
"name": "patternLinear2d",
"start": 538,
"type": "Identifier"
},
"end": 598,
"start": 538,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
},
{
"arguments": [
{
"type": "LabeledArg",
"label": {
"type": "Identifier",
"name": "length"
},
"arg": {
"argument": {
"end": 624,
"raw": "40",
"start": 622,
"type": "Literal",
"type": "Literal",
"value": {
"value": 40.0,
"suffix": "None"
}
},
"end": 624,
"operator": "-",
"start": 621,
"type": "UnaryExpression",
"type": "UnaryExpression"
}
}
],
"callee": {
"end": 611,
"name": "extrude",
"start": 604,
"type": "Identifier"
},
"end": 625,
"start": 604,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": null
}
],
"end": 625,
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 532,
"start": 481,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Instances was reduced from 12 to speed this up.",
"style": "line"
}
}
]
},
"startNodes": []
},
"start": 332,
"type": "PipeExpression",
"type": "PipeExpression"
},
"start": 320,
"type": "VariableDeclarator"
},
"end": 625,
"kind": "const",
"start": 320,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 626,
"nonCodeMeta": {
"nonCodeNodes": {
"0": [
{
"end": 274,
"start": 272,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
],
"1": [
{
"end": 320,
"start": 318,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
}
]
},
"startNodes": []
},
"start": 0
}
}