Users MUST use keyword call syntax now. Closes https://github.com/KittyCAD/modeling-app/issues/4600
856 lines
23 KiB
Plaintext
856 lines
23 KiB
Plaintext
---
|
|
source: kcl-lib/src/simulation_tests.rs
|
|
description: Result of parsing flush_batch_on_end.kcl
|
|
---
|
|
{
|
|
"Ok": {
|
|
"body": [
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "innerDiameter",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "0.364",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.364,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"preComments": [
|
|
"// Set units in inches (in)",
|
|
"",
|
|
"",
|
|
"// Define constants"
|
|
],
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "outerDiameter",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "35",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 35.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"operator": "/",
|
|
"right": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "64",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 64.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "length",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"operator": "+",
|
|
"right": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"left": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "1",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 1.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"operator": "/",
|
|
"right": {
|
|
"commentStart": 0,
|
|
"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"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "sketch000",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "startSketchOn",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "XY",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"preComments": [
|
|
"",
|
|
"",
|
|
"// create a sketch on the XY plane"
|
|
],
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "outerProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "center",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"elements": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "0.0",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "0.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": 0,
|
|
"end": 0,
|
|
"name": "radius",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"left": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "outerDiameter",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"operator": "/",
|
|
"right": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "2",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 2.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
},
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "tag",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "TagDeclarator",
|
|
"type": "TagDeclarator",
|
|
"value": "arc000"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "circle",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "sketch000",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"preComments": [
|
|
"",
|
|
"",
|
|
"// create a profile of the outside of the pipe"
|
|
],
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "innerProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "center",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"elements": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "0.0",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 0.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "0.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": 0,
|
|
"end": 0,
|
|
"name": "radius",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"left": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "innerDiameter",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
"operator": "/",
|
|
"right": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"raw": "2",
|
|
"start": 0,
|
|
"type": "Literal",
|
|
"type": "Literal",
|
|
"value": {
|
|
"value": 2.0,
|
|
"suffix": "None"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "BinaryExpression",
|
|
"type": "BinaryExpression"
|
|
}
|
|
},
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "tag",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "TagDeclarator",
|
|
"type": "TagDeclarator",
|
|
"value": "arc001"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "circle",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "sketch000",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"preComments": [
|
|
"",
|
|
"",
|
|
"// create a profile of the inside of the pipe"
|
|
],
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "pipeProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"body": [
|
|
{
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "outerProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
},
|
|
{
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "tool",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "innerProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "subtract2d",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": null
|
|
}
|
|
],
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {
|
|
"1": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLineBlockComment",
|
|
"value": "extrude the pipe profile to create the pipe",
|
|
"style": "line"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"startNodes": []
|
|
},
|
|
"start": 0,
|
|
"type": "PipeExpression",
|
|
"type": "PipeExpression"
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"preComments": [
|
|
"",
|
|
"",
|
|
"// create a profile with holes sketch000Profile000Holes"
|
|
],
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
},
|
|
{
|
|
"commentStart": 0,
|
|
"declaration": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"id": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "pipe",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"init": {
|
|
"arguments": [
|
|
{
|
|
"type": "LabeledArg",
|
|
"label": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "length",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"arg": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "length",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
}
|
|
],
|
|
"callee": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "extrude",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name"
|
|
},
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "CallExpressionKw",
|
|
"type": "CallExpressionKw",
|
|
"unlabeled": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "pipeProfile",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
},
|
|
"start": 0,
|
|
"type": "VariableDeclarator"
|
|
},
|
|
"end": 0,
|
|
"kind": "const",
|
|
"start": 0,
|
|
"type": "VariableDeclaration",
|
|
"type": "VariableDeclaration"
|
|
}
|
|
],
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"innerAttrs": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "settings",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"properties": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"key": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "defaultLengthUnit",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"start": 0,
|
|
"type": "ObjectProperty",
|
|
"value": {
|
|
"abs_path": false,
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": {
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"name": "in",
|
|
"start": 0,
|
|
"type": "Identifier"
|
|
},
|
|
"path": [],
|
|
"start": 0,
|
|
"type": "Name",
|
|
"type": "Name"
|
|
}
|
|
}
|
|
],
|
|
"start": 0,
|
|
"type": "Annotation"
|
|
}
|
|
],
|
|
"nonCodeMeta": {
|
|
"nonCodeNodes": {},
|
|
"startNodes": [
|
|
{
|
|
"commentStart": 0,
|
|
"end": 0,
|
|
"start": 0,
|
|
"type": "NonCodeNode",
|
|
"value": {
|
|
"type": "newLine"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"start": 0
|
|
}
|
|
}
|