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

697 lines
18 KiB
Plaintext
Raw Normal View History

---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing flush_batch_on_end.kcl
---
{
"Ok": {
"body": [
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "innerDiameter",
"start": 0,
"type": "Identifier"
},
"init": {
"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",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "outerDiameter",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"raw": "35",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 35.0,
"suffix": "None"
}
},
"operator": "/",
"right": {
"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"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"init": {
"end": 0,
"left": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"operator": "+",
"right": {
"end": 0,
"left": {
"end": 0,
"raw": "1",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 1.0,
"suffix": "None"
}
},
"operator": "/",
"right": {
"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"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "sketch000",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"end": 0,
"raw": "'XY'",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": "XY"
}
],
"callee": {
"end": 0,
"name": "startSketchOn",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "outerProfile",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "center",
"start": 0,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"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": {
"end": 0,
"name": "radius",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"end": 0,
"name": "outerDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"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": {
"end": 0,
"name": "tag",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"start": 0,
"type": "TagDeclarator",
"type": "TagDeclarator",
"value": "arc000"
}
}
],
"callee": {
"end": 0,
"name": "circle",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "sketch000",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "innerProfile",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "center",
"start": 0,
"type": "Identifier"
},
"arg": {
"elements": [
{
"end": 0,
"raw": "0.0",
"start": 0,
"type": "Literal",
"type": "Literal",
"value": {
"value": 0.0,
"suffix": "None"
}
},
{
"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": {
"end": 0,
"name": "radius",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"left": {
"end": 0,
"name": "innerDiameter",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
"operator": "/",
"right": {
"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": {
"end": 0,
"name": "tag",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"start": 0,
"type": "TagDeclarator",
"type": "TagDeclarator",
"value": "arc001"
}
}
],
"callee": {
"end": 0,
"name": "circle",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "sketch000",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "pipeProfile",
"start": 0,
"type": "Identifier"
},
"init": {
"body": [
{
"end": 0,
"name": "outerProfile",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"arguments": [
{
"end": 0,
"name": "innerProfile",
"start": 0,
"type": "Identifier",
"type": "Identifier"
},
{
"end": 0,
"start": 0,
"type": "PipeSubstitution",
"type": "PipeSubstitution"
}
],
"callee": {
"end": 0,
"name": "hole",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpression",
"type": "CallExpression"
}
],
"end": 0,
"nonCodeMeta": {
"nonCodeNodes": {
"1": [
{
"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",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
},
{
"declaration": {
"end": 0,
"id": {
"end": 0,
"name": "pipe",
"start": 0,
"type": "Identifier"
},
"init": {
"arguments": [
{
"type": "LabeledArg",
"label": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier"
},
"arg": {
"end": 0,
"name": "length",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"callee": {
"end": 0,
"name": "extrude",
"start": 0,
"type": "Identifier"
},
"end": 0,
"start": 0,
"type": "CallExpressionKw",
"type": "CallExpressionKw",
"unlabeled": {
"end": 0,
"name": "pipeProfile",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
},
"start": 0,
"type": "VariableDeclarator"
},
"end": 0,
"kind": "const",
"start": 0,
"type": "VariableDeclaration",
"type": "VariableDeclaration"
}
],
"end": 0,
"innerAttrs": [
{
"end": 0,
"name": {
"end": 0,
"name": "settings",
"start": 0,
"type": "Identifier"
},
"properties": [
{
"end": 0,
"key": {
"end": 0,
"name": "defaultLengthUnit",
"start": 0,
"type": "Identifier"
},
"start": 0,
"type": "ObjectProperty",
"value": {
"end": 0,
"name": "in",
"start": 0,
"type": "Identifier",
"type": "Identifier"
}
}
],
"start": 0,
"type": "Annotation"
}
],
"nonCodeMeta": {
"nonCodeNodes": {
"2": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "create a sketch on the 'XY' plane",
"style": "line"
}
}
],
"3": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "create a profile of the outside of the pipe",
"style": "line"
}
}
],
"4": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "create a profile of the inside of the pipe",
"style": "line"
}
}
],
"5": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLineBlockComment",
"value": "create a profile with holes sketch000Profile000Holes",
"style": "line"
}
}
]
},
"startNodes": [
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Set units in inches (in)",
"style": "line"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "newLine"
}
},
{
"end": 0,
"start": 0,
"type": "NonCodeNode",
"value": {
"type": "blockComment",
"value": "Define constants",
"style": "line"
}
}
]
},
"start": 0
}
}