---
source: kcl/src/simulation_tests.rs
description: Result of parsing array_elem_push.kcl
---
{
  "Ok": {
    "body": [
      {
        "declaration": {
          "end": 15,
          "id": {
            "end": 3,
            "name": "arr",
            "start": 0,
            "type": "Identifier"
          },
          "init": {
            "elements": [
              {
                "end": 8,
                "raw": "1",
                "start": 7,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              },
              {
                "end": 11,
                "raw": "2",
                "start": 10,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 2.0,
                  "suffix": "None"
                }
              },
              {
                "end": 14,
                "raw": "3",
                "start": 13,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 3.0,
                  "suffix": "None"
                }
              }
            ],
            "end": 15,
            "start": 6,
            "type": "ArrayExpression",
            "type": "ArrayExpression"
          },
          "start": 0,
          "type": "VariableDeclarator"
        },
        "end": 15,
        "kind": "const",
        "start": 0,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 39,
          "id": {
            "end": 24,
            "name": "new_arr1",
            "start": 16,
            "type": "Identifier"
          },
          "init": {
            "arguments": [
              {
                "end": 35,
                "name": "arr",
                "start": 32,
                "type": "Identifier",
                "type": "Identifier"
              },
              {
                "end": 38,
                "raw": "4",
                "start": 37,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 4.0,
                  "suffix": "None"
                }
              }
            ],
            "callee": {
              "end": 31,
              "name": "push",
              "start": 27,
              "type": "Identifier"
            },
            "end": 39,
            "start": 27,
            "type": "CallExpression",
            "type": "CallExpression"
          },
          "start": 16,
          "type": "VariableDeclarator"
        },
        "end": 39,
        "kind": "const",
        "start": 16,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "declaration": {
          "end": 68,
          "id": {
            "end": 48,
            "name": "new_arr2",
            "start": 40,
            "type": "Identifier"
          },
          "init": {
            "arguments": [
              {
                "end": 64,
                "name": "new_arr1",
                "start": 56,
                "type": "Identifier",
                "type": "Identifier"
              },
              {
                "end": 67,
                "raw": "5",
                "start": 66,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 5.0,
                  "suffix": "None"
                }
              }
            ],
            "callee": {
              "end": 55,
              "name": "push",
              "start": 51,
              "type": "Identifier"
            },
            "end": 68,
            "start": 51,
            "type": "CallExpression",
            "type": "CallExpression"
          },
          "start": 40,
          "type": "VariableDeclarator"
        },
        "end": 68,
        "kind": "const",
        "start": 40,
        "type": "VariableDeclaration",
        "type": "VariableDeclaration"
      },
      {
        "end": 142,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 92,
              "object": {
                "end": 89,
                "name": "new_arr1",
                "start": 81,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 91,
                "raw": "0",
                "start": 90,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 0.0,
                  "suffix": "None"
                }
              },
              "start": 81,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 95,
              "raw": "1",
              "start": 94,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 1.0,
                "suffix": "None"
              }
            },
            {
              "end": 104,
              "raw": "0.00001",
              "start": 97,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 141,
              "raw": "\"element 0 should not have changed\"",
              "start": 106,
              "type": "Literal",
              "type": "Literal",
              "value": "element 0 should not have changed"
            }
          ],
          "callee": {
            "end": 80,
            "name": "assertEqual",
            "start": 69,
            "type": "Identifier"
          },
          "end": 142,
          "start": 69,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 69,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 216,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 166,
              "object": {
                "end": 163,
                "name": "new_arr1",
                "start": 155,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 165,
                "raw": "1",
                "start": 164,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              },
              "start": 155,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 169,
              "raw": "2",
              "start": 168,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 2.0,
                "suffix": "None"
              }
            },
            {
              "end": 178,
              "raw": "0.00001",
              "start": 171,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 215,
              "raw": "\"element 1 should not have changed\"",
              "start": 180,
              "type": "Literal",
              "type": "Literal",
              "value": "element 1 should not have changed"
            }
          ],
          "callee": {
            "end": 154,
            "name": "assertEqual",
            "start": 143,
            "type": "Identifier"
          },
          "end": 216,
          "start": 143,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 143,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 290,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 240,
              "object": {
                "end": 237,
                "name": "new_arr1",
                "start": 229,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 239,
                "raw": "2",
                "start": 238,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 2.0,
                  "suffix": "None"
                }
              },
              "start": 229,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 243,
              "raw": "3",
              "start": 242,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 3.0,
                "suffix": "None"
              }
            },
            {
              "end": 252,
              "raw": "0.00001",
              "start": 245,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 289,
              "raw": "\"element 2 should not have changed\"",
              "start": 254,
              "type": "Literal",
              "type": "Literal",
              "value": "element 2 should not have changed"
            }
          ],
          "callee": {
            "end": 228,
            "name": "assertEqual",
            "start": 217,
            "type": "Identifier"
          },
          "end": 290,
          "start": 217,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 217,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 366,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 314,
              "object": {
                "end": 311,
                "name": "new_arr1",
                "start": 303,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 313,
                "raw": "3",
                "start": 312,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 3.0,
                  "suffix": "None"
                }
              },
              "start": 303,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 317,
              "raw": "4",
              "start": 316,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 4.0,
                "suffix": "None"
              }
            },
            {
              "end": 326,
              "raw": "0.00001",
              "start": 319,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 365,
              "raw": "\"4 was added to the end of the array\"",
              "start": 328,
              "type": "Literal",
              "type": "Literal",
              "value": "4 was added to the end of the array"
            }
          ],
          "callee": {
            "end": 302,
            "name": "assertEqual",
            "start": 291,
            "type": "Identifier"
          },
          "end": 366,
          "start": 291,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 291,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 440,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 390,
              "object": {
                "end": 387,
                "name": "new_arr2",
                "start": 379,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 389,
                "raw": "0",
                "start": 388,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 0.0,
                  "suffix": "None"
                }
              },
              "start": 379,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 393,
              "raw": "1",
              "start": 392,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 1.0,
                "suffix": "None"
              }
            },
            {
              "end": 402,
              "raw": "0.00001",
              "start": 395,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 439,
              "raw": "\"element 0 should not have changed\"",
              "start": 404,
              "type": "Literal",
              "type": "Literal",
              "value": "element 0 should not have changed"
            }
          ],
          "callee": {
            "end": 378,
            "name": "assertEqual",
            "start": 367,
            "type": "Identifier"
          },
          "end": 440,
          "start": 367,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 367,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 514,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 464,
              "object": {
                "end": 461,
                "name": "new_arr2",
                "start": 453,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 463,
                "raw": "1",
                "start": 462,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 1.0,
                  "suffix": "None"
                }
              },
              "start": 453,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 467,
              "raw": "2",
              "start": 466,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 2.0,
                "suffix": "None"
              }
            },
            {
              "end": 476,
              "raw": "0.00001",
              "start": 469,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 513,
              "raw": "\"element 1 should not have changed\"",
              "start": 478,
              "type": "Literal",
              "type": "Literal",
              "value": "element 1 should not have changed"
            }
          ],
          "callee": {
            "end": 452,
            "name": "assertEqual",
            "start": 441,
            "type": "Identifier"
          },
          "end": 514,
          "start": 441,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 441,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 588,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 538,
              "object": {
                "end": 535,
                "name": "new_arr2",
                "start": 527,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 537,
                "raw": "2",
                "start": 536,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 2.0,
                  "suffix": "None"
                }
              },
              "start": 527,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 541,
              "raw": "3",
              "start": 540,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 3.0,
                "suffix": "None"
              }
            },
            {
              "end": 550,
              "raw": "0.00001",
              "start": 543,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 587,
              "raw": "\"element 2 should not have changed\"",
              "start": 552,
              "type": "Literal",
              "type": "Literal",
              "value": "element 2 should not have changed"
            }
          ],
          "callee": {
            "end": 526,
            "name": "assertEqual",
            "start": 515,
            "type": "Identifier"
          },
          "end": 588,
          "start": 515,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 515,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 664,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 612,
              "object": {
                "end": 609,
                "name": "new_arr2",
                "start": 601,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 611,
                "raw": "3",
                "start": 610,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 3.0,
                  "suffix": "None"
                }
              },
              "start": 601,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 615,
              "raw": "4",
              "start": 614,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 4.0,
                "suffix": "None"
              }
            },
            {
              "end": 624,
              "raw": "0.00001",
              "start": 617,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 663,
              "raw": "\"4 was added to the end of the array\"",
              "start": 626,
              "type": "Literal",
              "type": "Literal",
              "value": "4 was added to the end of the array"
            }
          ],
          "callee": {
            "end": 600,
            "name": "assertEqual",
            "start": 589,
            "type": "Identifier"
          },
          "end": 664,
          "start": 589,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 589,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      },
      {
        "end": 740,
        "expression": {
          "arguments": [
            {
              "computed": false,
              "end": 688,
              "object": {
                "end": 685,
                "name": "new_arr2",
                "start": 677,
                "type": "Identifier",
                "type": "Identifier"
              },
              "property": {
                "end": 687,
                "raw": "4",
                "start": 686,
                "type": "Literal",
                "type": "Literal",
                "value": {
                  "value": 4.0,
                  "suffix": "None"
                }
              },
              "start": 677,
              "type": "MemberExpression",
              "type": "MemberExpression"
            },
            {
              "end": 691,
              "raw": "5",
              "start": 690,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 5.0,
                "suffix": "None"
              }
            },
            {
              "end": 700,
              "raw": "0.00001",
              "start": 693,
              "type": "Literal",
              "type": "Literal",
              "value": {
                "value": 0.00001,
                "suffix": "None"
              }
            },
            {
              "end": 739,
              "raw": "\"5 was added to the end of the array\"",
              "start": 702,
              "type": "Literal",
              "type": "Literal",
              "value": "5 was added to the end of the array"
            }
          ],
          "callee": {
            "end": 676,
            "name": "assertEqual",
            "start": 665,
            "type": "Identifier"
          },
          "end": 740,
          "start": 665,
          "type": "CallExpression",
          "type": "CallExpression"
        },
        "start": 665,
        "type": "ExpressionStatement",
        "type": "ExpressionStatement"
      }
    ],
    "end": 741,
    "start": 0
  }
}
