---
source: kcl-lib/src/simulation_tests.rs
description: Result of parsing any_type.kcl
---
{
  "Ok": {
    "body": [
      {
        "commentStart": 0,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "id",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "body": {
              "body": [
                {
                  "argument": {
                    "abs_path": false,
                    "commentStart": 0,
                    "end": 0,
                    "name": {
                      "commentStart": 0,
                      "end": 0,
                      "name": "x",
                      "start": 0,
                      "type": "Identifier"
                    },
                    "path": [],
                    "start": 0,
                    "type": "Name",
                    "type": "Name"
                  },
                  "commentStart": 0,
                  "end": 0,
                  "start": 0,
                  "type": "ReturnStatement",
                  "type": "ReturnStatement"
                }
              ],
              "commentStart": 0,
              "end": 0,
              "start": 0
            },
            "commentStart": 0,
            "end": 0,
            "params": [
              {
                "type": "Parameter",
                "identifier": {
                  "commentStart": 0,
                  "end": 0,
                  "name": "x",
                  "start": 0,
                  "type": "Identifier"
                },
                "labeled": false
              }
            ],
            "start": 0,
            "type": "FunctionExpression",
            "type": "FunctionExpression"
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 0,
        "kind": "fn",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "commentStart": 0,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "singleton",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "body": {
              "body": [
                {
                  "argument": {
                    "commentStart": 0,
                    "elements": [
                      {
                        "abs_path": false,
                        "commentStart": 0,
                        "end": 0,
                        "name": {
                          "commentStart": 0,
                          "end": 0,
                          "name": "x",
                          "start": 0,
                          "type": "Identifier"
                        },
                        "path": [],
                        "start": 0,
                        "type": "Name",
                        "type": "Name"
                      }
                    ],
                    "end": 0,
                    "start": 0,
                    "type": "ArrayExpression",
                    "type": "ArrayExpression"
                  },
                  "commentStart": 0,
                  "end": 0,
                  "start": 0,
                  "type": "ReturnStatement",
                  "type": "ReturnStatement"
                }
              ],
              "commentStart": 0,
              "end": 0,
              "start": 0
            },
            "commentStart": 0,
            "end": 0,
            "params": [
              {
                "type": "Parameter",
                "identifier": {
                  "commentStart": 0,
                  "end": 0,
                  "name": "x",
                  "start": 0,
                  "type": "Identifier"
                },
                "labeled": false
              }
            ],
            "start": 0,
            "type": "FunctionExpression",
            "type": "FunctionExpression"
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 0,
        "kind": "fn",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "commentStart": 0,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "len",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "body": {
              "body": [
                {
                  "argument": {
                    "arguments": [
                      {
                        "type": "LabeledArg",
                        "label": {
                          "commentStart": 0,
                          "end": 0,
                          "name": "initial",
                          "start": 0,
                          "type": "Identifier"
                        },
                        "arg": {
                          "commentStart": 0,
                          "end": 0,
                          "raw": "0",
                          "start": 0,
                          "type": "Literal",
                          "type": "Literal",
                          "value": {
                            "value": 0.0,
                            "suffix": "None"
                          }
                        }
                      },
                      {
                        "type": "LabeledArg",
                        "label": {
                          "commentStart": 0,
                          "end": 0,
                          "name": "f",
                          "start": 0,
                          "type": "Identifier"
                        },
                        "arg": {
                          "body": {
                            "body": [
                              {
                                "argument": {
                                  "commentStart": 0,
                                  "end": 0,
                                  "left": {
                                    "abs_path": false,
                                    "commentStart": 0,
                                    "end": 0,
                                    "name": {
                                      "commentStart": 0,
                                      "end": 0,
                                      "name": "accum",
                                      "start": 0,
                                      "type": "Identifier"
                                    },
                                    "path": [],
                                    "start": 0,
                                    "type": "Name",
                                    "type": "Name"
                                  },
                                  "operator": "+",
                                  "right": {
                                    "commentStart": 0,
                                    "end": 0,
                                    "raw": "1",
                                    "start": 0,
                                    "type": "Literal",
                                    "type": "Literal",
                                    "value": {
                                      "value": 1.0,
                                      "suffix": "None"
                                    }
                                  },
                                  "start": 0,
                                  "type": "BinaryExpression",
                                  "type": "BinaryExpression"
                                },
                                "commentStart": 0,
                                "end": 0,
                                "start": 0,
                                "type": "ReturnStatement",
                                "type": "ReturnStatement"
                              }
                            ],
                            "commentStart": 0,
                            "end": 0,
                            "start": 0
                          },
                          "commentStart": 0,
                          "end": 0,
                          "params": [
                            {
                              "type": "Parameter",
                              "identifier": {
                                "commentStart": 0,
                                "end": 0,
                                "name": "_",
                                "start": 0,
                                "type": "Identifier"
                              },
                              "labeled": false
                            },
                            {
                              "type": "Parameter",
                              "identifier": {
                                "commentStart": 0,
                                "end": 0,
                                "name": "accum",
                                "start": 0,
                                "type": "Identifier"
                              }
                            }
                          ],
                          "start": 0,
                          "type": "FunctionExpression",
                          "type": "FunctionExpression"
                        }
                      }
                    ],
                    "callee": {
                      "abs_path": false,
                      "commentStart": 0,
                      "end": 0,
                      "name": {
                        "commentStart": 0,
                        "end": 0,
                        "name": "reduce",
                        "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": "a",
                        "start": 0,
                        "type": "Identifier"
                      },
                      "path": [],
                      "start": 0,
                      "type": "Name",
                      "type": "Name"
                    }
                  },
                  "commentStart": 0,
                  "end": 0,
                  "start": 0,
                  "type": "ReturnStatement",
                  "type": "ReturnStatement"
                }
              ],
              "commentStart": 0,
              "end": 0,
              "start": 0
            },
            "commentStart": 0,
            "end": 0,
            "params": [
              {
                "type": "Parameter",
                "identifier": {
                  "commentStart": 0,
                  "end": 0,
                  "name": "a",
                  "start": 0,
                  "type": "Identifier"
                },
                "labeled": false
              }
            ],
            "start": 0,
            "type": "FunctionExpression",
            "type": "FunctionExpression"
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 0,
        "kind": "fn",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "commentStart": 0,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "one",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "callee": {
              "abs_path": false,
              "commentStart": 0,
              "end": 0,
              "name": {
                "commentStart": 0,
                "end": 0,
                "name": "id",
                "start": 0,
                "type": "Identifier"
              },
              "path": [],
              "start": 0,
              "type": "Name"
            },
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "CallExpressionKw",
            "type": "CallExpressionKw",
            "unlabeled": {
              "commentStart": 0,
              "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,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "a",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "callee": {
              "abs_path": false,
              "commentStart": 0,
              "end": 0,
              "name": {
                "commentStart": 0,
                "end": 0,
                "name": "id",
                "start": 0,
                "type": "Identifier"
              },
              "path": [],
              "start": 0,
              "type": "Name"
            },
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "CallExpressionKw",
            "type": "CallExpressionKw",
            "unlabeled": {
              "commentStart": 0,
              "end": 0,
              "raw": "\"a\"",
              "start": 0,
              "type": "Literal",
              "type": "Literal",
              "value": "a"
            }
          },
          "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": "arr1",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "callee": {
              "abs_path": false,
              "commentStart": 0,
              "end": 0,
              "name": {
                "commentStart": 0,
                "end": 0,
                "name": "singleton",
                "start": 0,
                "type": "Identifier"
              },
              "path": [],
              "start": 0,
              "type": "Name"
            },
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "CallExpressionKw",
            "type": "CallExpressionKw",
            "unlabeled": {
              "commentStart": 0,
              "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,
        "declaration": {
          "commentStart": 0,
          "end": 0,
          "id": {
            "commentStart": 0,
            "end": 0,
            "name": "len0",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "callee": {
              "abs_path": false,
              "commentStart": 0,
              "end": 0,
              "name": {
                "commentStart": 0,
                "end": 0,
                "name": "len",
                "start": 0,
                "type": "Identifier"
              },
              "path": [],
              "start": 0,
              "type": "Name"
            },
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "CallExpressionKw",
            "type": "CallExpressionKw",
            "unlabeled": {
              "commentStart": 0,
              "elements": [],
              "end": 0,
              "start": 0,
              "type": "ArrayExpression",
              "type": "ArrayExpression"
            }
          },
          "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": "len1",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "callee": {
              "abs_path": false,
              "commentStart": 0,
              "end": 0,
              "name": {
                "commentStart": 0,
                "end": 0,
                "name": "len",
                "start": 0,
                "type": "Identifier"
              },
              "path": [],
              "start": 0,
              "type": "Name"
            },
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "CallExpressionKw",
            "type": "CallExpressionKw",
            "unlabeled": {
              "commentStart": 0,
              "elements": [
                {
                  "commentStart": 0,
                  "end": 0,
                  "raw": "1",
                  "start": 0,
                  "type": "Literal",
                  "type": "Literal",
                  "value": {
                    "value": 1.0,
                    "suffix": "None"
                  }
                }
              ],
              "end": 0,
              "start": 0,
              "type": "ArrayExpression",
              "type": "ArrayExpression"
            }
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 0,
        "kind": "const",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "commentStart": 0,
        "end": 0,
        "expression": {
          "arguments": [
            {
              "type": "LabeledArg",
              "label": {
                "commentStart": 0,
                "end": 0,
                "name": "isEqualTo",
                "start": 0,
                "type": "Identifier"
              },
              "arg": {
                "commentStart": 0,
                "end": 0,
                "raw": "1",
                "start": 0,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              }
            }
          ],
          "callee": {
            "abs_path": false,
            "commentStart": 0,
            "end": 0,
            "name": {
              "commentStart": 0,
              "end": 0,
              "name": "assert",
              "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": "one",
              "start": 0,
              "type": "Identifier"
            },
            "path": [],
            "start": 0,
            "type": "Name",
            "type": "Name"
          }
        },
        "start": 0,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "commentStart": 0,
        "end": 0,
        "expression": {
          "arguments": [
            {
              "type": "LabeledArg",
              "label": {
                "commentStart": 0,
                "end": 0,
                "name": "isEqualTo",
                "start": 0,
                "type": "Identifier"
              },
              "arg": {
                "commentStart": 0,
                "end": 0,
                "raw": "0",
                "start": 0,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 0.0,
                  "suffix": "None"
                }
              }
            }
          ],
          "callee": {
            "abs_path": false,
            "commentStart": 0,
            "end": 0,
            "name": {
              "commentStart": 0,
              "end": 0,
              "name": "assert",
              "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": "len0",
              "start": 0,
              "type": "Identifier"
            },
            "path": [],
            "start": 0,
            "type": "Name",
            "type": "Name"
          }
        },
        "preComments": [
          "// TODO: we cannot currently assert on strings.",
          "// assert(a, isEqualTo = \"a\")",
          "// TODO: we cannot currently assert on arrays.",
          "// assert(arr1, isEqualTo = [1])"
        ],
        "start": 0,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "commentStart": 0,
        "end": 0,
        "expression": {
          "arguments": [
            {
              "type": "LabeledArg",
              "label": {
                "commentStart": 0,
                "end": 0,
                "name": "isEqualTo",
                "start": 0,
                "type": "Identifier"
              },
              "arg": {
                "commentStart": 0,
                "end": 0,
                "raw": "1",
                "start": 0,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              }
            }
          ],
          "callee": {
            "abs_path": false,
            "commentStart": 0,
            "end": 0,
            "name": {
              "commentStart": 0,
              "end": 0,
              "name": "assert",
              "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": "len1",
              "start": 0,
              "type": "Identifier"
            },
            "path": [],
            "start": 0,
            "type": "Name",
            "type": "Name"
          }
        },
        "start": 0,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      }
    ],
    "commentStart": 0,
    "end": 0,
    "nonCodeMeta": {
      "nonCodeNodes": {
        "0": [
          {
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ],
        "1": [
          {
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ],
        "2": [
          {
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ],
        "7": [
          {
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ],
        "10": [
          {
            "commentStart": 0,
            "end": 0,
            "start": 0,
            "type": "NonCodeNode",
            "value": {
              "type": "newLine"
            }
          }
        ]
      },
      "startNodes": []
    },
    "start": 0
  }
}
