--- source: kcl-lib/src/simulation_tests.rs description: Result of parsing kw_fn_with_defaults.kcl --- { "Ok": { "body": [ { "commentStart": 0, "declaration": { "commentStart": 3, "end": 0, "id": { "commentStart": 3, "end": 0, "name": "increment", "start": 0, "type": "Identifier" }, "init": { "body": { "body": [ { "argument": { "commentStart": 37, "end": 0, "left": { "abs_path": false, "commentStart": 37, "end": 0, "name": { "commentStart": 37, "end": 0, "name": "x", "start": 0, "type": "Identifier" }, "path": [], "start": 0, "type": "Name", "type": "Name" }, "operator": "+", "right": { "abs_path": false, "commentStart": 41, "end": 0, "name": { "commentStart": 41, "end": 0, "name": "by", "start": 0, "type": "Identifier" }, "path": [], "start": 0, "type": "Name", "type": "Name" }, "start": 0, "type": "BinaryExpression", "type": "BinaryExpression" }, "commentStart": 30, "end": 0, "start": 0, "type": "ReturnStatement", "type": "ReturnStatement" } ], "commentStart": 26, "end": 0, "start": 0 }, "commentStart": 12, "end": 0, "params": [ { "type": "Parameter", "identifier": { "commentStart": 14, "end": 0, "name": "x", "start": 0, "type": "Identifier" }, "labeled": false }, { "type": "Parameter", "identifier": { "commentStart": 17, "end": 0, "name": "by", "start": 0, "type": "Identifier" }, "default_value": { "commentStart": 23, "end": 0, "raw": "1", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 1.0, "suffix": "None" } } } ], "start": 0, "type": "FunctionExpression", "type": "FunctionExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "fn", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 45, "declaration": { "commentStart": 47, "end": 0, "id": { "commentStart": 47, "end": 0, "name": "two", "start": 0, "type": "Identifier" }, "init": { "arguments": [ { "commentStart": 63, "end": 0, "raw": "1", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 1.0, "suffix": "None" } } ], "callee": { "abs_path": false, "commentStart": 53, "end": 0, "name": { "commentStart": 53, "end": 0, "name": "increment", "start": 0, "type": "Identifier" }, "path": [], "start": 0, "type": "Name" }, "commentStart": 53, "end": 0, "start": 0, "type": "CallExpression", "type": "CallExpression" }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" }, { "commentStart": 66, "declaration": { "commentStart": 66, "end": 0, "id": { "commentStart": 66, "end": 0, "name": "twentyOne", "start": 0, "type": "Identifier" }, "init": { "arguments": [ { "type": "LabeledArg", "label": { "commentStart": 91, "end": 0, "name": "by", "start": 0, "type": "Identifier" }, "arg": { "commentStart": 96, "end": 0, "raw": "20", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 20.0, "suffix": "None" } } } ], "callee": { "abs_path": false, "commentStart": 78, "end": 0, "name": { "commentStart": 78, "end": 0, "name": "increment", "start": 0, "type": "Identifier" }, "path": [], "start": 0, "type": "Name" }, "commentStart": 78, "end": 0, "start": 0, "type": "CallExpressionKw", "type": "CallExpressionKw", "unlabeled": { "commentStart": 88, "end": 0, "raw": "1", "start": 0, "type": "Literal", "type": "Literal", "value": { "value": 1.0, "suffix": "None" } } }, "start": 0, "type": "VariableDeclarator" }, "end": 0, "kind": "const", "start": 0, "type": "VariableDeclaration", "type": "VariableDeclaration" } ], "commentStart": 0, "end": 0, "nonCodeMeta": { "nonCodeNodes": { "0": [ { "commentStart": 45, "end": 0, "start": 0, "type": "NonCodeNode", "value": { "type": "newLine" } } ] }, "startNodes": [] }, "start": 0 } }