---
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/while-break.js
---
Input:
function foo(a, b) {
  while (a) {
    break;
  }
  return b;
}


Output:
{
  "type": "Program",
  "body": [
    {
      "type": "FunctionDeclaration",
      "id": {
        "type": "Identifier",
        "name": "foo",
        "typeAnnotation": null,
        "loc": null,
        "range": [
          9,
          12
        ]
      },
      "params": [
        {
          "type": "Identifier",
          "name": "a",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            13,
            14
          ]
        },
        {
          "type": "Identifier",
          "name": "b",
          "typeAnnotation": null,
          "loc": null,
          "range": [
            16,
            17
          ]
        }
      ],
      "body": {
        "type": "BlockStatement",
        "body": [
          {
            "type": "WhileStatement",
            "test": {
              "type": "Identifier",
              "name": "a",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                30,
                31
              ]
            },
            "body": {
              "type": "BlockStatement",
              "body": [
                {
                  "type": "BreakStatement",
                  "label": null,
                  "loc": null,
                  "range": [
                    39,
                    45
                  ]
                }
              ],
              "loc": null,
              "range": [
                33,
                49
              ]
            },
            "loc": null,
            "range": [
              23,
              49
            ]
          },
          {
            "type": "ReturnStatement",
            "argument": {
              "type": "Identifier",
              "name": "b",
              "typeAnnotation": null,
              "loc": null,
              "range": [
                59,
                60
              ]
            },
            "loc": null,
            "range": [
              52,
              61
            ]
          }
        ],
        "loc": null,
        "range": [
          19,
          63
        ]
      },
      "generator": false,
      "async": false,
      "loc": null,
      "range": [
        0,
        63
      ],
      "loc": null,
      "range": [
        0,
        63
      ]
    }
  ],
  "sourceType": "script",
  "loc": null,
  "range": [
    0,
    63
  ]
}
