--- source: kcl-lib/src/simulation_tests.rs description: Result of parsing cube_with_error.kcl --- { "Ok": { "body": [ { "commentStart": 0, "declaration": { "commentStart": 3, "end": 0, "id": { "commentStart": 3, "end": 0, "name": "cube", "start": 0, "type": "Identifier" }, "init": { "body": { "body": [ { "commentStart": 28, "declaration": { "commentStart": 28, "end": 0, "id": { "commentStart": 28, "end": 0, "name": "l", "start": 0, "type": "Identifier" }, "init": { "commentStart": 32, "end": 0, "left": { "commentStart": 32, "end": 0, "name": "length", "start": 0, "type": "Identifier", "type": "Identifier" }, "operator": "/", "right": { "commentStart": 41, "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": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 45, "declaration": { "commentStart": 45, "end": 0, "id": { "commentStart": 45, "end": 0, "name": "x", "start": 0, "type": "Identifier" }, "init": { "commentStart": 49, "computed": false, "end": 0, "object": { "commentStart": 49, "end": 0, "name": "center", "start": 0, "type": "Identifier", "type": "Identifier" }, "property": { "commentStart": 56, "end": 0, "raw": "0", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 0.0, "suffix": "None" } }, "start": 0, "type": "MemberExpression", "type": "MemberExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 61, "declaration": { "commentStart": 61, "end": 0, "id": { "commentStart": 61, "end": 0, "name": "y", "start": 0, "type": "Identifier" }, "init": { "commentStart": 65, "computed": false, "end": 0, "object": { "commentStart": 65, "end": 0, "name": "center", "start": 0, "type": "Identifier", "type": "Identifier" }, "property": { "commentStart": 72, "end": 0, "raw": "1", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 1.0, "suffix": "None" } }, "start": 0, "type": "MemberExpression", "type": "MemberExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 77, "declaration": { "commentStart": 77, "end": 0, "id": { "commentStart": 77, "end": 0, "name": "p0", "start": 0, "type": "Identifier" }, "init": { "commentStart": 82, "elements": [ { "commentStart": 83, "end": 0, "left": { "argument": { "commentStart": 84, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "commentStart": 83, "end": 0, "operator": "-", "start": 0, "type": "UnaryExpression", "type": "UnaryExpression" }, "operator": "+", "right": { "commentStart": 88, "end": 0, "name": "x", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" }, { "commentStart": 91, "end": 0, "left": { "argument": { "commentStart": 92, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "commentStart": 91, "end": 0, "operator": "-", "start": 0, "type": "UnaryExpression", "type": "UnaryExpression" }, "operator": "+", "right": { "commentStart": 96, "end": 0, "name": "y", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" } ], "end": 0, "start": 0, "type": "ArrayExpression", "type": "ArrayExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 101, "declaration": { "commentStart": 101, "end": 0, "id": { "commentStart": 101, "end": 0, "name": "p1", "start": 0, "type": "Identifier" }, "init": { "commentStart": 106, "elements": [ { "commentStart": 107, "end": 0, "left": { "argument": { "commentStart": 108, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "commentStart": 107, "end": 0, "operator": "-", "start": 0, "type": "UnaryExpression", "type": "UnaryExpression" }, "operator": "+", "right": { "commentStart": 112, "end": 0, "name": "x", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" }, { "commentStart": 115, "end": 0, "left": { "commentStart": 115, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { "commentStart": 119, "end": 0, "name": "y", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" } ], "end": 0, "start": 0, "type": "ArrayExpression", "type": "ArrayExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 124, "declaration": { "commentStart": 124, "end": 0, "id": { "commentStart": 124, "end": 0, "name": "p2", "start": 0, "type": "Identifier" }, "init": { "commentStart": 129, "elements": [ { "commentStart": 130, "end": 0, "left": { "commentStart": 130, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { "commentStart": 134, "end": 0, "name": "x", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" }, { "commentStart": 137, "end": 0, "left": { "commentStart": 137, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { "commentStart": 141, "end": 0, "name": "y", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" } ], "end": 0, "start": 0, "type": "ArrayExpression", "type": "ArrayExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 146, "declaration": { "commentStart": 146, "end": 0, "id": { "commentStart": 146, "end": 0, "name": "p3", "start": 0, "type": "Identifier" }, "init": { "commentStart": 151, "elements": [ { "commentStart": 152, "end": 0, "left": { "commentStart": 152, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "operator": "+", "right": { "commentStart": 156, "end": 0, "name": "x", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" }, { "commentStart": 159, "end": 0, "left": { "argument": { "commentStart": 160, "end": 0, "name": "l", "start": 0, "type": "Identifier", "type": "Identifier" }, "commentStart": 159, "end": 0, "operator": "-", "start": 0, "type": "UnaryExpression", "type": "UnaryExpression" }, "operator": "+", "right": { "commentStart": 164, "end": 0, "name": "y", "start": 0, "type": "Identifier", "type": "Identifier" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" } ], "end": 0, "start": 0, "type": "ArrayExpression", "type": "ArrayExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "argument": { "body": [ { "arguments": [ { "commentStart": 191, "end": 0, "name": "XY", "start": 0, "type": "Identifier", "type": "Identifier" } ], "callee": { "commentStart": 177, "end": 0, "name": "startSketchOn", "start": 0, "type": "Identifier" }, "commentStart": 177, "end": 0, "start": 0, "type": "CallExpression", "type": "CallExpression" }, { "arguments": [ { "commentStart": 217, "end": 0, "name": "p0", "start": 0, "type": "Identifier", "type": "Identifier" }, { "commentStart": 221, "end": 0, "start": 0, "type": "PipeSubstitution", "type": "PipeSubstitution" } ], "callee": { "commentStart": 202, "end": 0, "name": "startProfileAt", "start": 0, "type": "Identifier" }, "commentStart": 202, "end": 0, "start": 0, "type": "CallExpression", "type": "CallExpression" }, { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 236, "end": 0, "name": "endAbsolute", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 250, "end": 0, "name": "p1", "start": 0, "type": "Identifier", "type": "Identifier" } } ], "callee": { "commentStart": 231, "end": 0, "name": "line", "start": 0, "type": "Identifier" }, "commentStart": 231, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null }, { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 266, "end": 0, "name": "endAbsolute", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 280, "end": 0, "name": "p2", "start": 0, "type": "Identifier", "type": "Identifier" } } ], "callee": { "commentStart": 261, "end": 0, "name": "line", "start": 0, "type": "Identifier" }, "commentStart": 261, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null }, { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 296, "end": 0, "name": "endAbsolute", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 310, "end": 0, "name": "p3", "start": 0, "type": "Identifier", "type": "Identifier" } } ], "callee": { "commentStart": 291, "end": 0, "name": "line", "start": 0, "type": "Identifier" }, "commentStart": 291, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null }, { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 326, "end": 0, "name": "endAbsolute", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 340, "end": 0, "name": "p0", "start": 0, "type": "Identifier", "type": "Identifier" } } ], "callee": { "commentStart": 321, "end": 0, "name": "line", "start": 0, "type": "Identifier" }, "commentStart": 321, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null }, { "arguments": [], "callee": { "commentStart": 351, "end": 0, "name": "close", "start": 0, "type": "Identifier" }, "commentStart": 351, "end": 0, "start": 0, "type": "CallExpression", "type": "CallExpression" }, { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 374, "end": 0, "name": "length", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 383, "end": 0, "name": "length", "start": 0, "type": "Identifier", "type": "Identifier" } } ], "callee": { "commentStart": 366, "end": 0, "name": "extrude", "start": 0, "type": "Identifier" }, "commentStart": 366, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": null } ], "commentStart": 177, "end": 0, "start": 0, "type": "PipeExpression", "type": "PipeExpression" }, "commentStart": 166, "end": 0, "start": 0, "type": "ReturnStatement", "type": "ReturnStatement" } ], "commentStart": 24, "end": 0, "nonCodeMeta": { "nonCodeNodes": { "6": [ { "commentStart": 166, "end": 0, "start": 0, "type": "NonCodeNode", "value": { "type": "newLine" } } ] }, "startNodes": [] }, "start": 0 }, "commentStart": 7, "end": 0, "params": [ { "type": "Parameter", "identifier": { "commentStart": 8, "end": 0, "name": "length", "start": 0, "type": "Identifier" } }, { "type": "Parameter", "identifier": { "commentStart": 16, "end": 0, "name": "center", "start": 0, "type": "Identifier" } } ], "start": 0, "type": "FunctionExpression", "type": "FunctionExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "fn", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 392, "declaration": { "commentStart": 394, "end": 0, "id": { "commentStart": 394, "end": 0, "name": "myCube", "start": 0, "type": "Identifier" }, "init": { "arguments": [ { "commentStart": 408, "end": 0, "raw": "40", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 40.0, "suffix": "None" } }, { "commentStart": 412, "elements": [ { "commentStart": 413, "end": 0, "raw": "0", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 0.0, "suffix": "None" } }, { "commentStart": 416, "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": 403, "end": 0, "name": "cube", "start": 0, "type": "Identifier" }, "commentStart": 403, "end": 0, "start": 0, "type": "CallExpression", "type": "CallExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 419, "end": 0, "expression": { "commentStart": 465, "end": 0, "name": "foo", "start": 0, "type": "Identifier", "type": "Identifier" }, "preComments": [ "", "", "// Error, after creating meaningful output." ], "start": 0, "type": "ExpressionStatement", "type": "ExpressionStatement" } ], "commentStart": 0, "end": 0, "nonCodeMeta": { "nonCodeNodes": { "0": [ { "commentStart": 392, "end": 0, "start": 0, "type": "NonCodeNode", "value": { "type": "newLine" } } ] }, "startNodes": [] }, "start": 0 } }