---
source: crates/react_hermes_parser/tests/parser_test.rs
expression: "format!(\"Input:\\n{input}\\n\\nOutput:\\n{output}\")"
input_file: crates/react_hermes_parser/tests/fixtures/for-empty-update-with-continue.js
---
Input:
function Component(props) {
  let x = 0;
  for (let i = 0; i < props.count; ) {
    x += i;
    i += 1;
    continue;
  }
  return x;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "Component",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          18
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "props",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            19,
            24
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "VariableDeclaration",
            "kind": "let",
            "declarations": [
              {
                "type": "VariableDeclarator",
                "id": {
                  "type": "Identifier",
                  "name": "x",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    34,
                    35
                  ]
                },
                "init": {
                  "type": "NumericLiteral",
                  "value": 0.0,
                  "loc": null,
                  "range": [
                    38,
                    39
                  ]
                },
                "loc": null,
                "range": [
                  34,
                  39
                ]
              }
            ],
            "loc": null,
            "range": [
              30,
              40
            ]
          },
          {
            "type": "ForStatement",
            "init": {
              "type": "VariableDeclaration",
              "kind": "let",
              "declarations": [
                {
                  "type": "VariableDeclarator",
                  "id": {
                    "type": "Identifier",
                    "name": "i",
                    "typeAnnotation": null,
                    "loc": null,
                    "range": [
                      52,
                      53
                    ]
                  },
                  "init": {
                    "type": "NumericLiteral",
                    "value": 0.0,
                    "loc": null,
                    "range": [
                      56,
                      57
                    ]
                  },
                  "loc": null,
                  "range": [
                    52,
                    57
                  ]
                }
              ],
              "loc": null,
              "range": [
                48,
                57
              ]
            },
            "test": {
              "type": "BinaryExpression",
              "left": {
                "type": "Identifier",
                "name": "i",
                "typeAnnotation": null,
                "loc": null,
                "range": [
                  59,
                  60
                ]
              },
              "operator": "<",
              "right": {
                "type": "MemberExpression",
                "object": {
                  "type": "Identifier",
                  "name": "props",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    63,
                    68
                  ]
                },
                "property": {
                  "type": "Identifier",
                  "name": "count",
                  "typeAnnotation": null,
                  "loc": null,
                  "range": [
                    69,
                    74
                  ]
                },
                "computed": false,
                "loc": null,
                "range": [
                  63,
                  74
                ]
              },
              "loc": null,
              "range": [
                59,
                74
              ]
            },
            "update": null,
            "body": {
              "type": "BlockStatement",
              "body": [
                {
                  "type": "ExpressionStatement",
                  "expression": {
                    "type": "AssignmentExpression",
                    "operator": "+=",
                    "left": {
                      "type": "Identifier",
                      "name": "x",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        84,
                        85
                      ]
                    },
                    "right": {
                      "type": "Identifier",
                      "name": "i",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        89,
                        90
                      ]
                    },
                    "loc": null,
                    "range": [
                      84,
                      90
                    ]
                  },
                  "directive": null,
                  "loc": null,
                  "range": [
                    84,
                    91
                  ]
                },
                {
                  "type": "ExpressionStatement",
                  "expression": {
                    "type": "AssignmentExpression",
                    "operator": "+=",
                    "left": {
                      "type": "Identifier",
                      "name": "i",
                      "typeAnnotation": null,
                      "loc": null,
                      "range": [
                        96,
                        97
                      ]
                    },
                    "right": {
                      "type": "NumericLiteral",
                      "value": 1.0,
                      "loc": null,
                      "range": [
                        101,
                        102
                      ]
                    },
                    "loc": null,
                    "range": [
                      96,
                      102
                    ]
                  },
                  "directive": null,
                  "loc": null,
                  "range": [
                    96,
                    103
                  ]
                },
                {
                  "type": "ContinueStatement",
                  "label": null,
                  "loc": null,
                  "range": [
                    108,
                    117
                  ]
                }
              ],
              "loc": null,
              "range": [
                78,
                121
              ]
            },
            "loc": null,
            "range": [
              43,
              121
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "x",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                131,
                132
              ]
            },
            "loc": null,
            "range": [
              124,
              133
            ]
          }
        ],
        "loc": null,
        "range": [
          26,
          135
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        135
      ],
      "loc": null,
      "range": [
        0,
        135
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    135
  ]
}
