[
  {
    "path": ".github/ISSUE_TEMPLATE/Bug_report.yml",
    "content": "name: ✨ Formatting\ndescription: Issues for incorrect or unreadable code\nbody:\n  - type: textarea\n    id: code\n    attributes:\n      label: Input code\n      placeholder: Paste the input code here.\n      render: rust\n    validations:\n      required: true\n  - type: textarea\n    id: output\n    attributes:\n      label: Output code\n      placeholder: Paste the formatted code here.\n      render: rust\n    validations:\n      required: true\n  - type: textarea\n    id: extra\n    attributes:\n      label: Additional context\n      placeholder: Add other relevant context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "content": "contact_links:\n  - name: Github discussion board\n    url: https://github.com/jinxdash/prettier-plugin-rust/discussions\n    about: Questions and answers\n    \nblank_issues_enabled: true\n"
  },
  {
    "path": ".gitignore",
    "content": "# npm\nnode_modules\n\n# cache\n/.rollup.cache/\n*.tsbuildinfo\n\n# debug\n*.temp.*\n*.temp/\n\n# repl\n/repl/\n\n# build\n/index.*\n/extension/index.*\n*.vsix\n/crate/target"
  },
  {
    "path": ".gitmodules",
    "content": "[submodule \"ext/jinx-rust\"]\n\tpath = ext/jinx-rust\n\turl = https://github.com/jinxdash/jinx-rust.git\n"
  },
  {
    "path": ".npmrc",
    "content": "link-workspace-packages = false"
  },
  {
    "path": ".vscode/launch.json",
    "content": "// A launch configuration that compiles the extension and then opens it inside a new window\n// Use IntelliSense to learn about possible attributes.\n// Hover to view descriptions of existing attributes.\n// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"args\": [\"--extensionDevelopmentPath=${workspaceFolder}/extension\"],\n\t\t\t\"name\": \"Launch Extension\",\n\t\t\t\"outFiles\": [\"${workspaceFolder}/extension/index.js\"],\n\t\t\t\"request\": \"launch\",\n\t\t\t\"type\": \"extensionHost\"\n\t\t}\n\t]\n}\n"
  },
  {
    "path": ".vscode/settings.json",
    "content": "{\n  \"npm.exclude\": [\n    \"**/ext/jinx-rust\"\n  ],\n  \"files.exclude\": {\n    \"ext\": true\n  }\n}"
  },
  {
    "path": "CHANGELOG.md",
    "content": "# Prettier Rust Changelog\n\n## Unreleased\n\n- fix: clear some issues related to formatting `#[attr]` like full-on expressions ([#25](jinxdash/prettier-plugin-rust/issues/25))\n\n## 0.1.9\n\n- feat: format `cfg_if!` macros\n- feat: format `@` character in `macro_rules`\n- fix: format `<number>.` and `<number>e0` to float instead of int ([#14](https://github.com/jinxdash/prettier-plugin-rust/issues/14), [#16](https://github.com/jinxdash/prettier-plugin-rust/issues/16))\n- fix: always end files with a newline ([#21](https://github.com/jinxdash/prettier-plugin-rust/issues/21))\n- fix: avoid removing optional semi in rare [rust compiler bug](https://github.com/rust-lang/rust/issues/70844) ([#22](https://github.com/jinxdash/prettier-plugin-rust/issues/22))\n\n## 0.1.8\n\n- feat(extension): display message when formatting fails due to non-parser errors.\n- feat: move `..spread`, `..` to the end of patterns and reassignments ([#7](https://github.com/jinxdash/prettier-plugin-rust/pull/7))\n- fix: remove comma after `..` in patterns and reassignments ([#7](https://github.com/jinxdash/prettier-plugin-rust/pull/7))\n- fix: support malformed `macro_rules!` ([jinx-rust@0.1.6](/jinxdash/jinx-rust/pull/2))\n- fix: unprinted comment errors in failed macros ([#8](https://github.com/jinxdash/prettier-plugin-rust/pull/8))\n\n## 0.1.7\n\n- feat: move `..spread` to the end of struct literals ([#6](https://github.com/jinxdash/prettier-plugin-rust/pull/6))\n- fix: remove comma after `..spread` in struct literals ([#6](https://github.com/jinxdash/prettier-plugin-rust/pull/6))\n\n## 0.1.6\n\n- fix: parenthesize >1 length `dyn`/`impl` types nested in unary types. ([#4](https://github.com/jinxdash/prettier-plugin-rust/pull/4))\n- fix: remove comma after `match` cases with block-like macro expressions. ([#4](https://github.com/jinxdash/prettier-plugin-rust/pull/4))\n\n## 0.1.5\n\n- feat: wrap non-block closure expressions with a block when a `->` ReturnType is defined\n- fix: add extension to filepath in ESM imports ([#2](https://github.com/jinxdash/prettier-plugin-rust/issues/2))\n- fix: add missing whitespace in `let_else` feature\n- fix(extension): disable config caching\n"
  },
  {
    "path": "LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022-present jinxdash <jinxdash.github@gmail.com> (https://github.com/jinxdash)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "README.md",
    "content": "<div align=\"center\">\n  <img alt=\"Prettier Rust\" height=\"256px\" src=\"https://user-images.githubusercontent.com/109366411/181039409-b66d6a4c-bbc7-4fbb-8a79-d7bb1af87a63.png\">\n</div>\n\n<h1 align=\"center\">Prettier Rust</h1>\n\n<div align=\"center\">\n\n![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg) [![npm version](https://img.shields.io/npm/v/prettier-plugin-rust.svg?style=flat)](https://www.npmjs.com/package/prettier-plugin-rust) [![extension installs](https://img.shields.io/visual-studio-marketplace/i/jinxdash.prettier-rust?logo=visualstudiocode&style=social)](https://marketplace.visualstudio.com/items?itemName=jinxdash.prettier-rust) ![GitHub Repo stars](https://img.shields.io/github/stars/jinxdash/prettier-plugin-rust?style=social) [![Twitter Follow](https://img.shields.io/twitter/follow/jinxdash?style=social)](https://twitter.com/jinxdash)\n\n_The massively popular [Prettier](https://prettier.io/) code formatter, now with [Rust](https://www.rust-lang.org/) support!_\n\n**Get Started:** Install [VSCode Extension](https://marketplace.visualstudio.com/items?itemName=jinxdash.prettier-rust) `Prettier - Code formatter (Rust)`\n\n</div>\n\n## Why Prettier?\n\n> What usually happens once people start using Prettier is that they realize how much time and mental energy they actually spend formatting their code. No matter how incomplete or broken the code you're working on is, with the Prettier Editor Extension you can always just press the `Format Document` key binding and \\*poof\\*, the code snaps right into place.\n\n<br>\n\n- **Beautiful, uniform and consistent** — Prettier is strongly opinionated, with no style options.\n- **There when you need it the most** — Prettier can format code that won't compile _(e.g. missing annotations)_\n- **Speed up the day-to-day** — Prettier auto-fixes common syntax errors _(e.g. missing semicolons, blocks, parentheses)_\n\n<br>\n\n<table align=\"center\">\n<tr> <th>> input</th> <th>> formatted</th> </tr>\n<tr>\n  <td>\n\n<!-- prettier-ignore -->\n```rs\nconst LEET = 1337\n/// My WIP code draft\n#![feature(crate_visibility_modifier)]\nasync crate fn foo(arg) {\n  arg.0 *= 3.14 + LEET & 1337\n  arg.1(|b, c| -> T &c).await\n}\n```\n\n  </td>\n  <td>\n\n<!-- prettier-ignore -->\n```rs\nconst LEET = 1337;\n#![feature(crate_visibility_modifier)]\n/// My WIP code draft\ncrate async fn foo(arg) {\n    arg.0 *= (3.14 + LEET) & 1337;\n    (arg.1)(|b, c| -> T { &c }).await\n}\n```\n\n  </td>\n</tr>\n</table>\n<div align=\"center\">\n\n_Formatting succeeds and fixes 7 syntax errors._\n\n</div>\n\n<br>\n\n## Configuration\n\nhttps://prettier.io/docs/en/configuration\n\n<!-- prettier-ignore -->\n```json5\n// .prettierrc.json\n{\n  \"useTabs\": false,\n  \"tabWidth\": 4,\n  \"printWidth\": 100,\n  \"endOfLine\": \"lf\",\n\n  // -- Not supported yet --\n  // \"trailingComma\": \"es5\",\n  // \"embeddedLanguageFormatting\": \"auto\",\n\n  // Example override\n  \"overrides\": { \"files\": [\"tests/*.rs\"], \"options\": { \"printWidth\": 80 } }\n}\n```\n\n<details>\n    <summary>See alternative configuration using a TOML file</summary>\n\n```toml\n# .prettierrc.toml\n\nuseTabs = false\ntabWidth = 4\nprintWidth = 100\nendOfLine = \"lf\"\n\n# -- Not supported yet --\n# trailingComma = \"es5\"\n# embeddedLanguageFormatting = \"auto\"\n\n# Example override\noverrides = [\n  { files = [\"tests/*.rs\"], options = { printWidth = 80 } }\n]\n```\n\n</details>\n\n### How to ignore things\n\n- Add `// prettier-ignore` or `#[rustfmt::skip]` above it\n- Add `#![rustfmt::skip]` inside blocks or files\n- Create a `.prettierignore` file to glob-match files, like `.gitignore`\n\n### How are macros formatted?\n\n- Curlies `!{}` format like blocks, `![]` and `!()` like comma-separated expressions\n- Formatting inside macro invocations is more conservative, since macros can be token-sensitive\n- Popular/built-in macros with original syntax rules get custom formatting (e.g. `matches!`, `if_chains!`...) _[Not implemented yet]_\n- Macro Declarations are only partially formatted (the transformed part isn't yet, but could be in the future)\n- Macros that can't be formatted are silently ignored\n\n### Are nightly features supported?\n\nYes! Prettier Rust formats most nightly features. Support depends on [`jinx-rust`](https://github.com/jinxdash/jinx-rust).\n\n<br>\n\n## Editor integration\n\n- ### `Recommended` Extension Standalone\n\n  _Easy install + auto-updates_\n\n  - VSCode | Search and install `Prettier - Code formatter (Rust)` [[direct link]](https://marketplace.visualstudio.com/items?itemName=jinxdash.prettier-rust)\n\n  - _Request your favorite editor:_ [[file an issue]](https://github.com/jinxdash/prettier-plugin-rust/issues/new)\n\n- ### `Alternative` Core Extension Plugin\n\n  _Requires [NodeJS](https://nodejs.dev/download/) + [Prettier Extension](https://prettier.io/docs/en/editors.html)_ (built-in Jetbrains IDEs)\n\n  ```sh\n  npm install --global prettier-plugin-rust prettier\n  ```\n\n  _Restart IDE after installing._  \n  _To update (manual only!!):_ `npm upgrade --global prettier-plugin-rust prettier`  \n  _To check installed version:_ `npm ls -g --depth=0 prettier-plugin-rust prettier`  \n  _To check latest version:_ `npm info prettier-plugin-rust version`\n\n<br>\n\n## Project integration\n\n- ### Command line\n\n  _Requires [NodeJS](https://nodejs.dev/download/)_\n\n  - Install `prettier` and `prettier-plugin-rust` globally\n\n    ```sh\n    npm install --global prettier-plugin-rust prettier\n    ```\n\n  - Use the [prettier CLI](https://prettier.io/docs/en/cli.html) to format rust files. E.g. run:\n\n    ```sh\n    prettier --write **/*.rs\n    ```\n\n- ### NodeJS package\n\n  _Requires [NodeJS](https://nodejs.dev/download/)_\n\n  - Install `prettier` and `prettier-plugin-rust` in the project\n\n    ```sh\n    npm install --save-dev prettier-plugin-rust prettier\n    ```\n\n  - Link to the plugin's location in your prettier config:\n\n    ```json\n    \"plugins\": [\"./node_modules/prettier-plugin-rust\"]\n    ```\n\n  - Use the [prettier CLI](https://prettier.io/docs/en/cli.html) to format rust files. E.g. run:\n\n    ```sh\n    npx prettier --write **/*.rs\n    ```\n\n  - You can also use the plugin programmatically:\n\n    ```ts\n    import prettier from \"prettier\";\n    import * as rustPlugin from \"prettier-plugin-rust\";\n\n    prettier.format(code, { plugins: [rustPlugin] });\n    ```\n\n- ### Rust crate\n\n  _No crate yet. Above options are available in the meantime._\n\n<br>\n\n## Q&A\n\n- ### _Why would I use this and not the established `cargo fmt` ?_\n\n  _It's all about the Editor Integration_ — Having the ability to format your code while you work on it really makes for a great developer experience, and autocompletion for Rust's strict syntax is such a massive time save. Once you've tried the extension there really is no coming back.\n\n  All-in-all the difference in code style is minimal, so adopting Prettier Rust won't drastically change your codebase. The real downside is the harsher integration with the Rust ecosystem, but it'll get better eventually.\n\n  Point by point:\n\n  - the extension streamlines your work in the editor\n    - it can format code that won't compile _(e.g. code with missing type annotations)_\n    - it autocorrects syntax errors _(e.g. missing semicolons, blocks, parentheses...)_\n  - it is strongly opinionated with no style options, so code is uniform across projects.\n  - it produces more readable code in some cases (e.g. condition chains, compound expressions, patterns)\n  - it supports everything out-of-the-box (e.g. nightly features, macros)\n  - it consistently prints code in the same way, whereas Rustfmt preserves arbitrary style at places\n  - it can be used for other languages (e.g. markdown, html, typescript, java, python, ruby)\n  - it formats language embeds. So rust code blocks in non-rust files (e.g. markdown), and supported languages in rust doc comments. _[NOTE: the latter is not yet implemented]_\n\n- ### _Why not just add those features to rustfmt instead?_\n\n  Unfortunately Rustfmt cannot implement those features by design.\n\n  Rustfmt parses code with rustc. Rustc is strict and unforgiving as it always assumes code is at its \"final version\", thus every slight deviation from the accepted syntax crashes the parser. There's also that rustc has many lint-like checks within the parser. The intention is to save work for the compiler down the line, unfortunately it also means that rustc sometimes fails to parse syntactically correct code.\n\n  Prettier Rust however is based on [jinx-rust](https://github.com/jinxdash/jinx-rust). Jinx-rust is built specifically for Rust tooling. Hence it's designed to tolerate a wide range of syntax errors, supports missing nodes and sometimes even infers user intent (e.g. Javascript's `!==`)\n\n  Jinx-rust has a little _plaidoyer_ in its readme arguing for Rust Tooling _not_ to use the official rustc parser [here](https://github.com/jinxdash/jinx-rust#why-jinx-rust-and-why-in-typescript).\n\n- ### _When exactly does Prettier Rust change code syntax?_\n\n  The Prettier Rust syntax autocorrection feature is intended to be an adaptation of how Prettier Typescript autocorrects javascript code with missing semicolons.\n\n  You can effectively think of Prettier Rust syntax autocorrection as auto-applying the Rust compiler's suggested syntax fixes automatically (e.g. \"semicolon missing here\", \"parenthesize this\" or \"add a block around that\")\n\n  Otherwise if your codebase compiles, then Prettier Rust is just a formatter like any other. It won't change the syntax of valid rust code. Moreover, it doesn't reorganize imports, split comments or combine attributes.\n\n- ### _This is an \"opinionated formatter\". But it's brand new! How reliable are those opinions?_\n\n  Rest assured, Prettier Rust actually does not take style decisions on its own. Prettier Rust is essentially a 1:1 adaptation of Prettier Typescript, hence the opinions it implements have been battle tested and agreed-upon by [millions and millions of users](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) already.\n"
  },
  {
    "path": "crate/Cargo.toml",
    "content": "[package]\nname = \"prettier\"\nversion = \"0.1.5\"\nedition = \"2021\"\nreadme = \"README.md\"\nlicense = \"MIT\"\ndescription = \"Opinionated code formatter - `cargo fmt` alternative (Community) (WIP)\"\nrepository = \"https://github.com/jinxdash/prettier-plugin-rust\"\nkeywords = [\"format\", \"rustfmt\", \"tool\", \"development\", \"editor\"]\ncategories = [\"development-tools\", \"text-editors\", \"web-programming\"]\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[dependencies]\n"
  },
  {
    "path": "crate/README.md",
    "content": "# Prettier crate\n\n_Reserved_ (August 2022)\n\nhttps://github.com/jinxdash/prettier-plugin-rust\n\n- _(todo) Crate provides Prettier CLI_\n- _(todo) Rust binding for `prettier.format`_\n- _(todo) Configuration and version-control of prettier and its plugins from `Cargo.toml`_"
  },
  {
    "path": "crate/src/main.rs",
    "content": "fn main() {\n    println!(\"Hello, world!\");\n}\n"
  },
  {
    "path": "extension/LICENSE",
    "content": "MIT License\n\nCopyright (c) 2022-present jinxdash <jinxdash.github@gmail.com> (https://github.com/jinxdash)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE."
  },
  {
    "path": "extension/README.md",
    "content": "<div align=\"center\">\n  <img alt=\"Prettier Rust\" height=\"256px\" src=\"https://user-images.githubusercontent.com/109366411/181039409-b66d6a4c-bbc7-4fbb-8a79-d7bb1af87a63.png\">\n</div>\n\n<h1 align=\"center\">Prettier Rust</h1>\n\n<div align=\"center\">\n\n![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg) [![npm version](https://img.shields.io/npm/v/prettier-plugin-rust.svg?style=flat)](https://www.npmjs.com/package/prettier-plugin-rust) ![GitHub Repo stars](https://img.shields.io/github/stars/jinxdash/prettier-plugin-rust?style=social) [![Twitter Follow](https://img.shields.io/twitter/follow/jinxdash?style=social)](https://twitter.com/jinxdash)\n\n_The massively popular [Prettier](https://prettier.io/) code formatter, now with [Rust](https://www.rust-lang.org/) support!_\n\n_This extension is a standalone bundle of Prettier + Prettier Plugin Rust._\n\n</div>\n\n## Why Prettier?\n\n> What usually happens once people start using Prettier is that they realize how much time and mental energy they actually spend formatting their code. No matter how incomplete or broken the code you're working on is, with the Prettier Editor Extension you can always just press the `Format Document` key binding and \\*poof\\*, the code snaps right into place.\n\n<br>\n\n- **Beautiful, uniform and consistent** — Prettier is strongly opinionated, with no style options.\n- **There when you need it the most** — Prettier can format code that won't compile _(e.g. missing annotations)_\n- **Speed up the day-to-day** — Prettier auto-fixes common syntax errors _(e.g. missing semicolons, blocks, parentheses)_\n\n<br>\n\n<table align=\"center\">\n<tr> <th>> input</th> <th>> formatted</th> </tr>\n<tr>\n  <td>\n\n<!-- prettier-ignore -->\n```rs\nconst LEET = 1337\n/// My WIP code draft\n#![feature(crate_visibility_modifier)]\nasync crate fn foo(arg) {\n  arg.0 *= 3.14 + LEET & 1337\n  arg.1(|b, c| -> T &c).await\n}\n```\n\n  </td>\n  <td>\n\n<!-- prettier-ignore -->\n```rs\nconst LEET = 1337;\n#![feature(crate_visibility_modifier)]\n/// My WIP code draft\ncrate async fn foo(arg) {\n    arg.0 *= (3.14 + LEET) & 1337;\n    (arg.1)(|b, c| -> T { &c }).await\n}\n```\n\n  </td>\n</tr>\n</table>\n<div align=\"center\">\n\n_Formatting succeeds and fixes 7 syntax errors._\n\n</div>\n\n<br>\n\n## Configuration\n\nhttps://prettier.io/docs/en/configuration\n\n<!-- prettier-ignore -->\n```json5\n// .prettierrc.json\n{\n  \"useTabs\": false,\n  \"tabWidth\": 4,\n  \"printWidth\": 100,\n  \"endOfLine\": \"lf\",\n\n  // -- Not supported yet --\n  // \"trailingComma\": \"es5\",\n  // \"embeddedLanguageFormatting\": \"auto\",\n\n  // Example override\n  \"overrides\": { \"files\": [\"tests/*.rs\"], \"options\": { \"printWidth\": 80 } }\n}\n```\n\n<details>\n    <summary>Alternative config using TOML</summary>\n\n```toml\n# .prettierrc.toml\n\nuseTabs = false\ntabWidth = 4\nprintWidth = 100\nendOfLine = \"lf\"\n\n# -- Not supported yet --\n# trailingComma = \"es5\"\n# embeddedLanguageFormatting = \"auto\"\n\n# Example override\noverrides = [\n  { files = [\"tests/*.rs\"], options = { printWidth = 80 } }\n]\n```\n\n</details>\n\n### How to ignore things\n\n- Add `// prettier-ignore` or `#[rustfmt::skip]` above it\n- Add `#![rustfmt::skip]` inside blocks or files\n- Create a `.prettierignore` file to glob-match files, like `.gitignore`\n\n### How are macros formatted?\n\n- Curlies `!{}` format like blocks, `![]` and `!()` like comma-separated expressions\n- Formatting inside macro invocations is more conservative, since macros can be token-sensitive\n- Popular/built-in macros with original syntax rules get custom formatting (e.g. `matches!`, `if_chains!`...) _[Not implemented yet]_\n- Macro Declarations are only partially formatted (the transformed part isn't yet, but could be in the future)\n- Macros that can't be formatted are silently ignored\n\n### Are nightly features supported?\n\nYes! Prettier Rust formats most nightly features. Support depends on [`jinx-rust`](https://github.com/jinxdash/jinx-rust).\n\n<br>\n\n## Project integration\n\n- ### Command line\n\n  _Requires [NodeJS](https://nodejs.dev/download/)_\n\n  - Install `prettier` and `prettier-plugin-rust` globally\n\n    ```sh\n    npm install --global prettier-plugin-rust prettier\n    ```\n\n  - Use the [prettier CLI](https://prettier.io/docs/en/cli.html) to format rust files. E.g. run:\n\n    ```sh\n    prettier --write **/*.rs\n    ```\n\n- ### NodeJS package\n\n  _Requires [NodeJS](https://nodejs.dev/download/)_\n\n  - Install `prettier` and `prettier-plugin-rust` in the project\n\n    ```sh\n    npm install --save-dev prettier-plugin-rust prettier\n    ```\n\n  - Link to the plugin's location in your prettier config:\n\n    ```json\n    \"plugins\": [\"./node_modules/prettier-plugin-rust\"]\n    ```\n\n  - Use the [prettier CLI](https://prettier.io/docs/en/cli.html) to format rust files. E.g. run:\n\n    ```sh\n    npx prettier --write **/*.rs\n    ```\n\n- ### Rust crate\n\n  _No crate yet. Above options are available in the meantime._\n\n<br>\n\n## Q&A\n\n- ### _Why would I use this and not the established `cargo fmt` ?_\n\n  _It's all about the Editor Integration_ — Having the ability to format your code while you work on it really makes for a great developer experience, and autocompletion for Rust's strict syntax is such a massive time save. Once you've tried the extension there really is no coming back.\n\n  All-in-all the difference in code style is minimal, so adopting Prettier Rust won't drastically change your codebase. The real downside is the harsher integration with the Rust ecosystem, but it'll get better eventually.\n\n  Point by point:\n\n  - the extension streamlines your work in the editor\n    - it can format code that won't compile _(e.g. code with missing type annotations)_\n    - it autocorrects syntax errors _(e.g. missing semicolons, blocks, parentheses...)_\n  - it is strongly opinionated with no style options, so code is uniform across projects.\n  - it produces more readable code in some cases (e.g. condition chains, compound expressions, patterns)\n  - it supports everything out-of-the-box (e.g. nightly features, macros)\n  - it consistently prints code in the same way, whereas Rustfmt preserves arbitrary style at places\n  - it can be used for other languages (e.g. markdown, html, typescript, java, python, ruby)\n  - it formats language embeds. So rust code blocks in non-rust files (e.g. markdown), and supported languages in rust doc comments. _[NOTE: the latter is not yet implemented]_\n\n- ### _Why not just add those features to rustfmt instead?_\n\n  Unfortunately Rustfmt cannot implement those features by design.\n\n  Rustfmt parses code with rustc. Rustc is strict and unforgiving as it always assumes code is at its \"final version\", thus every slight deviation from the accepted syntax crashes the parser. There's also that rustc has many lint-like checks within the parser. The intention is to save work for the compiler down the line, unfortunately it also means that rustc sometimes fails to parse syntactically correct code.\n\n  Prettier Rust however is based on [jinx-rust](https://github.com/jinxdash/jinx-rust). Jinx-rust is built specifically for Rust tooling. Hence it's designed to tolerate a wide range of syntax errors, supports missing nodes and sometimes even infers user intent (e.g. Javascript's `!==`)\n\n  Jinx-rust has a little *plaidoyer* in its readme arguing for Rust Tooling *not* to use the official rustc parser [here](https://github.com/jinxdash/jinx-rust#why-jinx-rust-and-why-in-typescript).\n\n- ### _When exactly does Prettier Rust change code syntax?_\n\n  The Prettier Rust syntax autocorrection feature is intended to be an adaptation of how Prettier Typescript autocorrects javascript code with missing semicolons.\n\n  You can effectively think of Prettier Rust syntax autocorrection as auto-applying the Rust compiler's suggested syntax fixes automatically (e.g. \"semicolon missing here\", \"parenthesize this\" or \"add a block around that\")\n\n  Otherwise if your codebase compiles, then Prettier Rust is just a formatter like any other. It won't change the syntax of valid rust code. Moreover, it doesn't reorganize imports, split comments or combine attributes.\n\n- ### _This is an \"opinionated formatter\". But it's brand new! How reliable are those opinions?_\n\n  Rest assured, Prettier Rust actually does not take style decisions on its own. Prettier Rust is essentially a 1:1 adaptation of Prettier Typescript, hence the opinions it implements have been battle tested and agreed-upon by [millions and millions of users](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) already.\n"
  },
  {
    "path": "extension/package.json",
    "content": "{\n\t\"icon\": \"icon.png\",\n\t\"name\": \"prettier-rust\",\n\t\"publisher\": \"jinxdash\",\n\t\"displayName\": \"Prettier - Code formatter (Rust)\",\n\t\"description\": \"Prettier Rust is a code formatter that autocorrects bad syntax\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/jinxdash/prettier-plugin-rust.git\",\n\t\t\"directory\": \"extension\"\n\t},\n\t\"author\": \"jinxdash <jinxdash.github@gmail.com> (https://github.com/jinxdash)\",\n\t\"version\": \"0.1.9\",\n\t\"engines\": {\n\t\t\"vscode\": \"^1.69.0\"\n\t},\n\t\"categories\": [\n\t\t\"Formatters\"\n\t],\n\t\"keywords\": [\n\t\t\"rust\",\n\t\t\"formatter\",\n\t\t\"prettier\"\n\t],\n\t\"scripts\": {\n\t\t\"bundle\": \"esbuild src/index.ts --bundle --outfile=index.js --format=cjs --platform=node --external:vscode\",\n\t\t\"watch\": \"pnpm run bundle --watch\",\n\t\t\"package\": \"pnpm run bundle && pnpm vsce package --no-dependencies\",\n\t\t\"publish\": \"pnpm vsce publish --no-dependencies\"\n\t},\n\t\"contributes\": {\n\t\t\"languages\": [\n\t\t\t{\n\t\t\t\t\"id\": \"rust\",\n\t\t\t\t\"aliases\": [\n\t\t\t\t\t\"rs\"\n\t\t\t\t],\n\t\t\t\t\"extensions\": [\n\t\t\t\t\t\"rs\"\n\t\t\t\t]\n\t\t\t}\n\t\t]\n\t},\n\t\"devDependencies\": {\n\t\t\"@types/node\": \"^18.0.6\",\n\t\t\"@types/vscode\": \"^1.69.0\",\n\t\t\"esbuild\": \"^0.14.49\",\n\t\t\"typescript\": \"^4.7.4\"\n\t},\n\t\"dependencies\": {\n\t\t\"prettier\": \"^2.7.1\",\n\t\t\"jinx-rust\": \"0.1.6\",\n\t\t\"prettier-plugin-rust\": \"workspace:prettier-plugin-rust\"\n\t},\n\t\"main\": \"index.js\",\n\t\"activationEvents\": [\n\t\t\"onStartupFinished\"\n\t]\n}\n"
  },
  {
    "path": "extension/src/index.ts",
    "content": "import { rs } from \"jinx-rust\";\nimport path from \"node:path\";\nimport prettier, { Config, resolveConfig } from \"prettier\";\nimport plugin from \"prettier-plugin-rust\";\nimport { ExtensionContext, languages, Position, Range, TextDocument, TextEdit, window } from \"vscode\";\n\nconst console = createOutputChannel(\"Prettier (Rust)\");\n\nconsole.log(`VSCode Extension: ${process.env.EXTENSION_NAME || \"jinxdash.prettier-rust\"}@${process.env.EXTENSION_VERSION || \"dev\"}`);\nexport async function activate(context: ExtensionContext) {\n\tcontext.subscriptions.push(\n\t\tlanguages.registerDocumentFormattingEditProvider(\"rust\", {\n\t\t\tasync provideDocumentFormattingEdits(document) {\n\t\t\t\tconst config: Config = {\n\t\t\t\t\tfilepath: cmd(document.fileName),\n\t\t\t\t\t...((await resolveConfig(document.fileName, { editorconfig: true, useCache: false })) ?? {}),\n\t\t\t\t};\n\t\t\t\tconsole.log(\"\", `# Formatting using prettier@${prettier.version}`, {\n\t\t\t\t\t...config,\n\t\t\t\t\tplugins: config.plugins?.flatMap((p) => (typeof p === \"string\" ? p : p.printers && Object.keys(p.printers))),\n\t\t\t\t});\n\t\t\t\tif (\n\t\t\t\t\t!config.plugins?.some((plugin) => typeof plugin === \"object\" && plugin.languages?.some((lang) => lang.name === \"Rust\"))\n\t\t\t\t) {\n\t\t\t\t\tconfig.parser = \"jinx-rust\";\n\t\t\t\t\tconfig.plugins ??= [plugin];\n\t\t\t\t}\n\t\t\t\treturn format(document, config);\n\t\t\t},\n\t\t})\n\t);\n}\n\nfunction format(document: TextDocument, config: Config) {\n\t// length of common prefix\n\tconst next = tryFormat(document, config);\n\tconst prev = document.getText();\n\tif (prev === next) {\n\t\t// console.log(\"No changes\");\n\t\treturn [];\n\t}\n\tconst end = Math.min(prev.length, next.length);\n\tvar i = 0;\n\tvar j = 0;\n\tfor (var i = 0; i < end && compare(i, i); ++i);\n\tfor (var j = 0; i + j < end && compare(prev.length - j - 1, next.length - j - 1); ++j);\n\t// console.log([i, j]);\n\treturn [TextEdit.replace(new Range(document.positionAt(i), document.positionAt(prev.length - j)), next.substring(i, next.length - j))];\n\tfunction compare(i: number, j: number) {\n\t\treturn prev.charCodeAt(i) === next.charCodeAt(j);\n\t}\n}\n\nfunction tryFormat(doc: TextDocument, config: prettier.Config) {\n\ttry {\n\t\treturn prettier.format(doc.getText(), config);\n\t} catch (e) {\n\t\tif ((e as any).loc) {\n\t\t\ttry {\n\t\t\t\trs.parseFile(doc.getText(), { filepath: config.filepath });\n\t\t\t} catch (_e) {\n\t\t\t\tconst e2 = _e as rs.ParserError;\n\t\t\t\tconst pos = new Position(e2.loc.start.line - 1, e2.loc.start.column - 1);\n\t\t\t\twindow.showTextDocument(doc, { selection: new Range(pos, pos) });\n\t\t\t\twindow.showErrorMessage(e2.message);\n\t\t\t}\n\t\t} else {\n\t\t\tconsole.log(e);\n\t\t\twindow.showErrorMessage((e as any).message);\n\t\t}\n\t\treturn doc.getText();\n\t}\n}\n\nfunction createOutputChannel(name: string) {\n\tconst out = window.createOutputChannel(name);\n\treturn {\n\t\tlog(...arr: any[]) {\n\t\t\tfor (var item of arr) {\n\t\t\t\tif (typeof item === \"string\") {\n\t\t\t\t\tout.appendLine(unstyle(item));\n\t\t\t\t} else if (item instanceof Error) {\n\t\t\t\t\tif (item?.message) out.appendLine(unstyle(item.message));\n\t\t\t\t\tif (item?.stack) out.appendLine(unstyle(item.stack));\n\t\t\t\t} else {\n\t\t\t\t\tout.appendLine(JSON.stringify(item, null, 2));\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t};\n}\nfunction unstyle(str: string) {\n\treturn str.replace(/\\x1B\\[[0-9][0-9]?m/g, \"\");\n}\n\nfunction cmd(filepath: string | undefined, frompath = \"\") {\n\treturn normPath(path.relative(frompath, normPath(filepath ?? \"\"))) || \".\";\n}\nfunction normPath(filepath: string) {\n\treturn filepath.replace(/^file:\\/\\/\\//, \"\").replace(/\\\\\\\\?/g, \"/\");\n}\n"
  },
  {
    "path": "extension/tsconfig.json",
    "content": "{\n\t\"extends\": \"../tsconfig.base.json\",\n\t\"compilerOptions\": { \"rootDir\": \"src\" },\n\t\"include\": [\"src\"]\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n\t\"name\": \"prettier-plugin-rust\",\n\t\"version\": \"0.1.9\",\n\t\"description\": \"Prettier plugin for Rust\",\n\t\"repository\": {\n\t\t\"type\": \"git\",\n\t\t\"url\": \"https://github.com/jinxdash/prettier-plugin-rust.git\"\n\t},\n\t\"author\": \"jinxdash <jinxdash.github@gmail.com> (https://github.com/jinxdash)\",\n\t\"keywords\": [\n\t\t\"prettier\",\n\t\t\"formatter\",\n\t\t\"rust\"\n\t],\n\t\"license\": \"MIT\",\n\t\"type\": \"module\",\n\t\"main\": \"index.cjs\",\n\t\"module\": \"index.js\",\n\t\"types\": \"index.d.ts\",\n\t\"exports\": {\n\t\t\"./package.json\": \"./package.json\",\n\t\t\".\": {\n\t\t\t\"require\": \"./index.cjs\",\n\t\t\t\"import\": \"./index.js\"\n\t\t}\n\t},\n\t\"files\": [\n\t\t\"index.js\",\n\t\t\"index.cjs\",\n\t\t\"index.d.ts\",\n\t\t\"package.json\",\n\t\t\"LICENSE\"\n\t],\n\t\"scripts\": {\n\t\t\"build\": \"ts-node ./scripts/build.ts && ts-node ./tests/test.build.ts\",\n\t\t\"test-build\": \"ts-node ./tests/test.build.ts\",\n\t\t\"test-print-samples\": \"ts-node ./tests/print.ts\",\n\t\t\"dev-repl\": \"ts-node ./scripts/dev.repl.ts\",\n\t\t\"dev-format-local\": \"ts-node ./scripts/dev.format.ts\"\n\t},\n\t\"devDependencies\": {\n\t\t\"@swc/core\": \"^1.2.248\",\n\t\t\"@types/node\": \"^18.0.6\",\n\t\t\"@types/prettier\": \"^2.7.0\",\n\t\t\"ts-node\": \"^10.9.1\",\n\t\t\"tsup\": \"^6.2.3\",\n\t\t\"typescript\": \"^4.8.2\"\n\t},\n\t\"dependencies\": {\n\t\t\"jinx-rust\": \"0.1.6\",\n\t\t\"prettier\": \"^2.7.1\"\n\t},\n\t\"prettier\": {\n\t\t\"printWidth\": 140,\n\t\t\"semi\": true,\n\t\t\"tabWidth\": 4,\n\t\t\"useTabs\": true,\n\t\t\"endOfLine\": \"lf\",\n\t\t\"overrides\": [\n\t\t\t{\n\t\t\t\t\"files\": [\n\t\t\t\t\t\"**/*.md\"\n\t\t\t\t],\n\t\t\t\t\"options\": {\n\t\t\t\t\t\"printWidth\": 80,\n\t\t\t\t\t\"useTabs\": false,\n\t\t\t\t\t\"tabWidth\": 2\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n}\n"
  },
  {
    "path": "pnpm-workspace.yaml",
    "content": "packages:\n  - 'ext/*'\n  - 'extension'"
  },
  {
    "path": "scripts/build.ts",
    "content": "import { build } from \"tsup\";\nimport { createStripPlugin } from \"../ext/jinx-rust/scripts/utils/build\";\n\nawait build({\n\tdts: true,\n\ttsconfig: \"tsconfig.build.json\",\n\tentry: [\"src/index.ts\"],\n\texternal: [\"jinx-rust\"],\n\toutDir: \".\",\n\tformat: [\"cjs\", \"esm\"],\n\tplugins: [createStripPlugin({ labels: [\"__DEV__\"], functionCalls: [\"devonly\"] })],\n\ttreeshake: {\n\t\tpreset: \"smallest\",\n\t\tmoduleSideEffects: false,\n\t\tpropertyReadSideEffects: false,\n\t\ttryCatchDeoptimization: false,\n\t\tunknownGlobalSideEffects: false,\n\t},\n});\n"
  },
  {
    "path": "scripts/dev.format.ts",
    "content": "import prettier from \"prettier\";\nimport { for_each_rs_file } from \"../ext/jinx-rust/scripts/utils/common\";\nimport { update_file } from \"../ext/jinx-rust/scripts/utils/fs\";\nimport { plugin } from \"../src/format/plugin\";\n\nfunction format(code: string, filepath: string) {\n\tconst next = prettier.format(code, {\n\t\tparser: \"jinx-rust\",\n\t\tplugins: [plugin],\n\t\tprintWidth: 100,\n\t\ttabWidth: 4,\n\t\tfilepath,\n\t});\n\tif (code !== next && code.trim() !== next.trim()) {\n\t\tupdate_file(filepath, next, { external: true });\n\t}\n}\n\nglobalThis.TESTS_FORMAT_DEV = true;\n\nfor_each_rs_file(\n\t[`E:/dev/github/rust/rust-lang/`],\n\t(file) => {\n\t\tformat(file.content, file.cmd);\n\t},\n\t[\"test\", \"tests\"]\n).then(() => {\n\tglobalThis.TESTS_FORMAT_DEV = false;\n});\n"
  },
  {
    "path": "scripts/dev.repl.ts",
    "content": "import { createASTtoJSONPrinter, createPrettierPrinter, rs_createREPL } from \"../ext/jinx-rust/scripts/utils\";\nimport { plugin } from \"../src/format/plugin\";\n\nrs_createREPL([\n\tcreatePrettierPrinter(\n\t\t{\n\t\t\tparser: \"jinx-rust\",\n\t\t\tplugins: [plugin],\n\t\t},\n\t\ttrue\n\t),\n\tcreateASTtoJSONPrinter(),\n]);\n"
  },
  {
    "path": "scripts/tsconfig.json",
    "content": "{\n\t\"extends\": \"../tsconfig.base.json\",\n\t\"include\": [\"../tests\", \"../scripts\"],\n\t\"references\": [{ \"path\": \"../tsconfig.json\" }, { \"path\": \"../ext/jinx-rust/scripts/tsconfig.json\" }],\n\t\"compilerOptions\": {\n\t\t\"rootDir\": \"..\"\n\t}\n}\n"
  },
  {
    "path": "src/format/comments.ts",
    "content": "import { CommentOrDocComment, LocArray, Node, NodeType, NodeWithBodyOrCases } from \"jinx-rust\";\nimport {\n\tend,\n\tgetBodyOrCases,\n\tgetLastParameter,\n\thasOuterAttributes,\n\tisInner,\n\tis_Attribute,\n\tis_AttributeOrDocComment,\n\tis_BlockCommentKind,\n\tis_BlockCommentNode,\n\tis_Comment,\n\tis_CommentOrDocComment,\n\tis_ExpressionWithBodyOrCases,\n\tis_ExternSpecifier,\n\tis_FlowControlExpression,\n\tis_FunctionDeclaration,\n\tis_FunctionNode,\n\tis_IfBlockExpression,\n\tis_LineCommentKind,\n\tis_LineCommentNode,\n\tis_LocArray,\n\tis_MacroRule,\n\tis_NodeWithBodyOrCases,\n\tis_ReassignmentNode,\n\tis_StatementNode,\n\tis_StructLiteralProperty,\n\tis_StructLiteralPropertySpread,\n\tnisAnyOf,\n\townStart,\n\tstart,\n} from \"jinx-rust/utils\";\nimport { is_CallExpression_or_CallLikeMacroInvocation } from \"../transform\";\nimport { Narrow, assert, exit, iLast, last_of, maybe_last_of } from \"../utils/common\";\nimport { is_MemberAccessLike, is_xVariableEqualishLike } from \"./core\";\nimport {\n\tAnyComment,\n\tCustomOptions,\n\tDCM,\n\tDoc,\n\tMutatedAttribute,\n\tNodeWithComments,\n\tPrettierCommentInfo,\n\tbreakParent,\n\tcursor,\n\thardline,\n\tindent,\n\tjoin,\n\tline,\n\tlineSuffix,\n\tliteralline,\n} from \"./external\";\nimport { assertPathAtNode, canAttachComment, getAllComments, getContext, getNode, getOptions, pathCallEach } from \"./plugin\";\nimport { shouldPrintOuterAttributesAbove } from \"./styling\";\n\nfunction addCommentHelper(node: Node, comment: AnyComment, leading = false, trailing = false) {\n\t__DEV__: assert(!handled(comment));\n\t((node as NodeWithComments<Node>).comments ??= []).push(comment);\n\t(comment.leading = leading), (comment.trailing = trailing), (comment.printed = false);\n}\n\nfunction addLeadingComment(node: Node, comment: AnyComment) {\n\taddCommentHelper(node, comment, true);\n}\nfunction addDanglingComment(node: Node, comment: AnyComment, marker: DCM) {\n\taddCommentHelper(node, comment);\n\tcomment.marker = marker;\n}\nfunction addTrailingComment(node: Node, comment: AnyComment) {\n\taddCommentHelper(node, comment, false, true);\n}\nexport function setPrettierIgnoreTarget(node: Node, comment: AnyComment) {\n\t__DEV__: Narrow<Node & { prettierIgnore?: true }>(node), assert(isPrettierIgnoreComment(comment) || isPrettierIgnoreAttribute(comment));\n\tcomment.unignore = true;\n\tnode.prettierIgnore = true;\n}\n\nfunction hasComments<T extends Node>(node: T): node is NodeWithComments<T> {\n\treturn \"comments\" in node && node.comments.length > 0;\n}\n\nexport function printDanglingComments(enclosingNode: Node, sameIndent: boolean, marker?: DCM) {\n\tif (hasComments(enclosingNode)) {\n\t\tconst printed: Doc[] = [];\n\t\tpathCallEach(enclosingNode, \"comments\", (comment) => {\n\t\t\tif (isDangling(comment) && (!marker || comment.marker === marker)) {\n\t\t\t\tprinted.push(printComment(comment));\n\t\t\t}\n\t\t});\n\t\tif (printed.length > 0) {\n\t\t\treturn sameIndent //\n\t\t\t\t? join(hardline, printed)\n\t\t\t\t: indent([hardline, join(hardline, printed)]);\n\t\t}\n\t}\n\treturn \"\";\n}\n\nexport function needsHardlineAfterDanglingComment(node: Node) {\n\tif (!hasComment(node)) return false;\n\tconst lastDanglingComment = maybe_last_of(getComments(node, CF.Dangling));\n\treturn lastDanglingComment && is_LineCommentNode(lastDanglingComment);\n}\nexport function setDidPrintComment(comment: AnyComment) {\n\tcomment.printed = true;\n}\n\nfunction printComment(comment: AnyComment) {\n\t__DEV__: assertPathAtNode(\"printComment\", comment);\n\t__DEV__: assert(handled(comment), `Assertion failed: Comment was not printed at ${comment.loc.url()}`, comment);\n\tsetDidPrintComment(comment);\n\treturn getContext().options.printer.printComment!(getContext().path as any, getOptions());\n}\n\nexport function isPreviousLineEmpty(node: Node) {\n\tlet index = start(node) - 1;\n\tindex = skipSpaces(index, true) as number;\n\tindex = skipNewline(index, true) as number;\n\tindex = skipSpaces(index, true) as number;\n\treturn index !== skipNewline(index, true);\n}\nexport function hasBreaklineBefore(node: Node) {\n\treturn hasNewline(start(node) - 1, true);\n}\n\nexport function hasBreaklineAfter(node: Node) {\n\treturn hasNewline(end(node));\n}\n\nexport function printCommentsSeparately(ignored?: Set<AnyComment>) {\n\tconst node = getNode();\n\t__DEV__: Narrow<Node & { comments?: AnyComment[] }>(node);\n\n\tconst leading: Doc[] = [];\n\tconst trailing: Doc[] = [];\n\tlet hasTrailingLineComment = false;\n\tlet hadLeadingBlockComment = false;\n\n\tif (\"comments\" in node) {\n\t\tpathCallEach(node, \"comments\", (comment) => {\n\t\t\tif (ignored?.has(comment)) {\n\t\t\t\treturn;\n\t\t\t} else if (isLeading(comment)) {\n\t\t\t\tleading.push(printLeadingComment(comment));\n\t\t\t} else if (isTrailing(comment)) {\n\t\t\t\ttrailing.push(printTrailingComment(comment));\n\t\t\t}\n\t\t});\n\t}\n\n\tif (node === getOptions().cursorNode) {\n\t\tleading.unshift(cursor);\n\t\ttrailing.push(cursor);\n\t}\n\n\treturn (leading.length | trailing.length) > 0 ? { leading, trailing } : ({ leading: \"\", trailing: \"\" } as const);\n\n\tfunction printLeadingComment(comment: AnyComment) {\n\t\tif (is_Attribute(comment) && !comment.inner) {\n\t\t\tconst printed = printComment(comment);\n\t\t\treturn [printed, \" \"];\n\t\t}\n\t\thadLeadingBlockComment ||= is_BlockCommentKind(comment) && hasBreaklineBefore(comment);\n\t\treturn [\n\t\t\tprintComment(comment),\n\t\t\tis_BlockCommentKind(comment)\n\t\t\t\t? hasBreaklineAfter(comment) //\n\t\t\t\t\t? hadLeadingBlockComment\n\t\t\t\t\t\t? hardline\n\t\t\t\t\t\t: line\n\t\t\t\t\t: \" \"\n\t\t\t\t: hardline,\n\t\t\thasNewline(skipNewline(skipSpaces(end(comment)))) ? hardline : \"\",\n\t\t];\n\t}\n\n\tfunction printTrailingComment(comment: AnyComment) {\n\t\tconst printed = printComment(comment);\n\t\treturn hasBreaklineBefore(comment)\n\t\t\t? lineSuffix([hardline, isPreviousLineEmpty(comment) ? hardline : \"\", printed])\n\t\t\t: is_BlockCommentNode(comment)\n\t\t\t? [\" \", printed]\n\t\t\t: lineSuffix([\" \", printed, hasTrailingLineComment === (hasTrailingLineComment = true) ? hardline : breakParent]);\n\t}\n}\n\nexport function getPostLeadingComment(comment: AnyComment) {\n\t// console.log(comment.loc.url());\n\t// is_BlockCommentKind(comment)\n\t// \t? hasBreaklineAfter(comment) //\n\t// \t\t? hasBreaklineBefore(comment)\n\t// \t\t\t? hardline\n\t// \t\t\t: line\n\t// \t\t: \" \"\n\t// \t: hardline,\n\treturn hasNewline(skipNewline(skipSpaces(end(comment)))) ? hardline : \"\";\n}\n\nexport function withComments<D extends Doc>(node: Node, printed: D, ignored?: Set<AnyComment>): D | Doc[] {\n\t__DEV__: assertPathAtNode(\"withComments\", node);\n\tconst { leading, trailing } = printCommentsSeparately(ignored);\n\treturn leading || trailing ? [...leading!, printed, ...trailing!] : printed;\n\t// return needsOuterParens(node) ? group([\"(\", indent([softline, parts]), softline, \")\"]) : parts;\n\t// return parts;\n}\nexport function getComments(node: Node, ...args: Parameters<typeof getCommentTestFunction>): AnyComment[] {\n\t__DEV__: Narrow<Node & { comments?: AnyComment[] }>(node);\n\t// if (!node || !node.comments) return [];\n\t// if (args.length === 0) return node.comments;\n\t// return args.length > 0 ? node.comments.filter(getCommentTestFunction(...args)) : node.comments;\n\treturn node && node.comments //\n\t\t? args.length > 0\n\t\t\t? node.comments.filter(getCommentTestFunction(...args))\n\t\t\t: node.comments\n\t\t: [];\n}\n\nexport function getFirstComment(node: Node, flags: CF, fn?: (comment: AnyComment) => boolean): AnyComment | undefined {\n\tconst r = getComments(node, flags | CF.First, fn);\n\treturn r.length === 0 ? undefined : r[0];\n}\n\nexport function escapeComments(flags: number, fn?: (comment: AnyComment) => boolean) {\n\tconst comments = getAllComments().filter(getCommentTestFunction(flags, fn)) as AnyComment[];\n\tcomments.forEach(setDidPrintComment);\n\treturn new Set(comments);\n}\n\nexport const enum CF {\n\tLeading = 1 << 1,\n\tTrailing = 1 << 2,\n\tDangling = 1 << 3,\n\tBlock = 1 << 4,\n\tLine = 1 << 5,\n\tPrettierIgnore = 1 << 6,\n\tFirst = 1 << 7,\n\tLast = 1 << 8,\n}\nexport function isPrettierIgnoreComment(comment: AnyComment) {\n\treturn is_Comment(comment) && /^\\s*prettier-ignore\\s*/.test(comment.value) && !comment.unignore;\n}\nexport function isPrettierIgnoreAttribute(node: Node): node is MutatedAttribute {\n\treturn is_Attribute(node) && /^\\s*rustfmt::skip\\s*$/.test(node.value);\n}\nfunction getCommentTestFunction(flags: CF, fn?: (comment: AnyComment) => boolean) {\n\treturn function (comment: AnyComment, index: number, comments: AnyComment[]) {\n\t\t__DEV__: Narrow<number>(flags), assert(handled(comment));\n\t\treturn !(\n\t\t\t(flags & CF.Leading && !isLeading(comment)) ||\n\t\t\t(flags & CF.Trailing && !isTrailing(comment)) ||\n\t\t\t(flags & CF.Dangling && !isDangling(comment)) ||\n\t\t\t(flags & CF.Block && !is_BlockCommentKind(comment)) ||\n\t\t\t(flags & CF.Line && !is_LineCommentKind(comment)) ||\n\t\t\t(flags & CF.First && index !== 0) ||\n\t\t\t(flags & CF.Last && !iLast(index, comments)) ||\n\t\t\t(flags & CF.PrettierIgnore && !(isPrettierIgnoreComment(comment) || isPrettierIgnoreAttribute(comment))) ||\n\t\t\t(fn && !fn(comment))\n\t\t);\n\t};\n}\n\nexport function hasComment(node: Node, flags: number = 0, fn?: (comment: AnyComment) => boolean) {\n\tif (\"comments\" in node && node.comments!.length > 0) {\n\t\treturn flags || fn ? (node.comments as AnyComment[]).some(getCommentTestFunction(flags, fn)) : true;\n\t}\n\treturn false;\n}\nexport function hasNewlineInRange(leftIndex: number, rightIndex: number) {\n\t__DEV__: assert(leftIndex <= rightIndex);\n\tconst text = getContext().options.originalText;\n\tfor (var i = leftIndex; i < rightIndex; ++i) if (text.charCodeAt(i) === 10) return true;\n\treturn false;\n}\nexport function isNextLineEmpty(node: Node) {\n\treturn isNextLineEmptyAfterIndex(end(node));\n}\nexport function isNextLineEmptyAfterIndex(index: number | false) {\n\tlet oldIdx: number | false = -1;\n\tlet idx: number | false = index;\n\twhile (idx !== oldIdx) {\n\t\toldIdx = idx;\n\t\tidx = skipToLineEnd(idx);\n\t\tidx = skipBlockComment(idx);\n\t\tidx = skipSpaces(idx);\n\t\tidx = skipParens(idx);\n\t}\n\tidx = skipLineComment(idx);\n\tidx = skipParens(idx);\n\tidx = skipNewline(idx);\n\tidx = skipParens(idx);\n\treturn idx !== false && hasNewline(idx);\n}\nexport function hasNewline(index: number | false, backwards = false) {\n\tif (index === false) return false;\n\tconst i = skipSpaces(index, backwards);\n\treturn i !== false && i !== skipNewline(i, backwards);\n}\nfunction skipLineComment(index: number | false) {\n\tif (index === false) return false;\n\tconst { commentSpans, originalText } = getContext().options;\n\tif (commentSpans.has(index) && originalText.charCodeAt(index + 1) === 47 /** \"/\" */)\n\t\treturn skipEverythingButNewLine(commentSpans.get(index)!);\n\treturn index;\n}\nfunction skipBlockComment(index: number | false) {\n\tif (index === false) return false;\n\tconst { commentSpans, originalText } = getContext().options;\n\tif (commentSpans.has(index) && originalText.charCodeAt(index + 1) === 42 /** \"*\" */) return commentSpans.get(index)!;\n\treturn index;\n}\nconst [skipSpaces, skipToLineEnd, skipEverythingButNewLine] = [/[ \\t]/, /[,; \\t]/, /[^\\r\\n]/].map(function (re) {\n\treturn function (index: number | false, backwards = false) {\n\t\tif (index === false) return false;\n\t\tconst { originalText: text } = getContext().options;\n\t\tlet cursor = index;\n\t\twhile (cursor >= 0 && cursor < text.length) {\n\t\t\tif (re.test(text.charAt(cursor))) backwards ? cursor-- : cursor++;\n\t\t\telse return cursor;\n\t\t}\n\t\treturn cursor === -1 || cursor === text.length ? cursor : false;\n\t};\n});\n\nfunction skipNewline(index: number | false, backwards = false) {\n\tif (index === false) return false;\n\tconst { originalText } = getContext().options;\n\tconst atIndex = originalText.charCodeAt(index);\n\tif (backwards) {\n\t\tif (originalText.charCodeAt(index - 1) === 13 && atIndex === 10) return index - 2;\n\t\tif (atIndex === 10) return index - 1;\n\t} else {\n\t\tif (atIndex === 13 && originalText.charCodeAt(index + 1) === 10) return index + 2;\n\t\tif (atIndex === 10) return index + 1;\n\t}\n\treturn index;\n}\n\nfunction skipParens(index: number | false, backwards = false) {\n\treturn index;\n\t// if (index === false) return false;\n\t// const { parensPositions } = getContext().options;\n\t// while (parensPositions.has(index)) backwards ? index-- : index++;\n\t// return index;\n}\n\nexport function getNextNonSpaceNonCommentCharacterIndex(node: Node) {\n\treturn getNextNonSpaceNonCommentCharacterIndexWithStartIndex(end(node));\n}\nfunction getNextNonSpaceNonCommentCharacterIndexWithStartIndex(i: number) {\n\tlet oldIdx = -1;\n\tlet nextIdx = i;\n\twhile (nextIdx !== oldIdx) {\n\t\toldIdx = nextIdx;\n\t\tnextIdx = skipSpaces(nextIdx) as number;\n\t\tnextIdx = skipBlockComment(nextIdx) as number;\n\t\tnextIdx = skipLineComment(nextIdx) as number;\n\t\tnextIdx = skipNewline(nextIdx) as number;\n\t\tnextIdx = skipParens(nextIdx) as number;\n\t}\n\treturn nextIdx;\n}\nexport function getNextNonSpaceNonCommentCharacter(node: Node) {\n\treturn getContext().options.originalText.charAt(getNextNonSpaceNonCommentCharacterIndex(node));\n}\n\ninterface CommentContext {\n\tcomment: AnyComment;\n\tprecedingNode: Node | undefined;\n\tenclosingNode: Node | undefined;\n\tfollowingNode: Node | undefined;\n\ttext: string;\n\toptions: CustomOptions;\n\tast: Node;\n\tisLastComment: boolean;\n}\n\nfunction handled(comment: AnyComment) {\n\treturn \"printed\" in comment;\n}\nfunction handleCommon(ctx: CommentContext): boolean {\n\t{\n\t\tconst { comment, precedingNode, enclosingNode, followingNode } = ctx;\n\t\tif (!enclosingNode) {\n\t\t\tctx.enclosingNode = ctx.comment.loc.src.program;\n\t\t} else if (enclosingNode && is_NodeWithBodyOrCases(enclosingNode)) {\n\t\t\tconst body = getBodyOrCases(enclosingNode);\n\t\t\tif (body) {\n\t\t\t\tif (is_ExpressionWithBodyOrCases(enclosingNode) && enclosingNode.label) {\n\t\t\t\t\tif (ctx.precedingNode === enclosingNode.label) {\n\t\t\t\t\t\tctx.precedingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (followingNode === enclosingNode.label) {\n\t\t\t\t\t\tctx.followingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (comment.loc.isBefore(body)) {\n\t\t\t\t\tif (followingNode && body.loc.contains(followingNode)) {\n\t\t\t\t\t\tctx.followingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!ctx.precedingNode && !ctx.followingNode) {\n\t\t\t\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else if (comment.loc.isAfter(body)) {\n\t\t\t\t\tif (precedingNode && body.loc.contains(precedingNode)) {\n\t\t\t\t\t\tctx.precedingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (!ctx.precedingNode && !ctx.followingNode) {\n\t\t\t\t\t\taddTrailingComment(enclosingNode, comment);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t} else if (body.loc.contains(comment)) {\n\t\t\t\t\tif (precedingNode && !body.loc.contains(precedingNode)) {\n\t\t\t\t\t\tctx.precedingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t\tif (followingNode && !body.loc.contains(followingNode)) {\n\t\t\t\t\t\tctx.followingNode = undefined;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tfor (const fn of [\n\t\thandleMixedInOuterAttributeComments,\n\t\thandleAttributeComments,\n\t\thandleDanglingComments,\n\t\thandleFunctionComments,\n\t\thandleMacroRuleComments,\n\t\thandleStructLiteralComments,\n\t\thandleVariableDeclaratorComments,\n\t\thandleIfBlockExpressionComments,\n\t\thandleMemberExpressionComments,\n\t\thandleStatementComments,\n\t\thandleFlowControlComments,\n\t\thandleBadComments,\n\t]) {\n\t\tfn(ctx);\n\t\tif (handled(ctx.comment)) {\n\t\t\t// console.log(ctx.comment.loc.url(), fn.name);\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tconst { precedingNode, followingNode, comment } = ctx;\n\n\tif (isStartOfLine(comment)) {\n\t\tif (followingNode) {\n\t\t\taddLeadingComment(followingNode, comment);\n\t\t} else if (precedingNode) {\n\t\t\taddTrailingComment(precedingNode, comment);\n\t\t} else {\n\t\t\texit.never(ctx);\n\t\t}\n\t} else if (isEndOfLine(comment)) {\n\t\tif (precedingNode) {\n\t\t\taddTrailingComment(precedingNode, comment);\n\t\t} else if (followingNode) {\n\t\t\taddLeadingComment(followingNode, comment);\n\t\t} else {\n\t\t\texit.never(ctx);\n\t\t}\n\t} else {\n\t\tif (precedingNode && followingNode) {\n\t\t\treturn false;\n\t\t} else if (precedingNode) {\n\t\t\taddTrailingComment(precedingNode, comment);\n\t\t} else if (followingNode) {\n\t\t\taddLeadingComment(followingNode, comment);\n\t\t} else {\n\t\t\texit.never(ctx);\n\t\t}\n\t}\n\treturn handled(ctx.comment);\n}\nexport function handleOwnLineComment(ctx: CommentContext) {\n\treturn handleCommon(ctx);\n}\nexport function handleEndOfLineComment(ctx: CommentContext) {\n\tconst { precedingNode, enclosingNode, comment } = ctx;\n\tif (\n\t\t// handleCallExpressionComments\n\t\tprecedingNode &&\n\t\tenclosingNode &&\n\t\tis_CallExpression_or_CallLikeMacroInvocation(enclosingNode) &&\n\t\tenclosingNode.arguments.length > 0 &&\n\t\tprecedingNode === (enclosingNode.typeArguments ? last_of(enclosingNode.typeArguments) : enclosingNode.callee)\n\t) {\n\t\taddLeadingComment(enclosingNode.arguments[0], comment);\n\t\treturn true;\n\t} else if (\n\t\t// handlePropertyComments\n\t\tenclosingNode &&\n\t\tis_StructLiteralProperty(enclosingNode)\n\t) {\n\t\taddLeadingComment(enclosingNode, comment);\n\t\treturn true;\n\t} else {\n\t\treturn handleCommon(ctx);\n\t}\n}\n\nexport function handleRemainingComment(ctx: CommentContext) {\n\treturn handleCommon(ctx);\n}\n\nfunction handleStructLiteralComments({ enclosingNode, followingNode, comment }: CommentContext) {\n\tif (enclosingNode && is_StructLiteralPropertySpread(enclosingNode) && followingNode === enclosingNode.expression) {\n\t\taddLeadingComment(enclosingNode, comment);\n\t}\n}\n\nfunction handleVariableDeclaratorComments({ enclosingNode, followingNode, comment }: CommentContext) {\n\tif (\n\t\tenclosingNode &&\n\t\t(is_xVariableEqualishLike(enclosingNode) || is_ReassignmentNode(enclosingNode)) &&\n\t\tfollowingNode &&\n\t\t(is_BlockCommentKind(comment) ||\n\t\t\tnisAnyOf(followingNode, [\n\t\t\t\tNodeType.StructLiteral,\n\t\t\t\tNodeType.StructPattern,\n\t\t\t\tNodeType.TupleLiteral,\n\t\t\t\tNodeType.TypeTuple,\n\t\t\t\tNodeType.TuplePattern,\n\t\t\t\tNodeType.ArrayLiteral,\n\t\t\t\tNodeType.ArrayPattern,\n\t\t\t\tNodeType.SizedArrayLiteral,\n\t\t\t\tNodeType.TypeSizedArray,\n\t\t\t]))\n\t) {\n\t\taddLeadingComment(followingNode, comment);\n\t}\n}\n\nfunction handleMixedInOuterAttributeComments({ precedingNode, enclosingNode, followingNode, comment }: CommentContext) {\n\tif (enclosingNode && hasOuterAttributes(enclosingNode) && end(comment) <= ownStart(enclosingNode)) {\n\t\tif (isPrettierIgnoreComment(comment) || isPrettierIgnoreAttribute(comment)) {\n\t\t\tsetPrettierIgnoreTarget(enclosingNode, comment);\n\t\t}\n\t\tif (isEndOfLine(comment)) {\n\t\t\t__DEV__: assert(!!precedingNode && is_Attribute(precedingNode), \"\", precedingNode);\n\t\t\tif (shouldPrintOuterAttributesAbove(enclosingNode)) {\n\t\t\t\t// #[attr] // comment\n\t\t\t\t// node\n\t\t\t\taddTrailingComment(precedingNode, comment);\n\t\t\t} else {\n\t\t\t\t// #[attr] /* comment */ node\n\t\t\t\taddLeadingComment(followingNode || enclosingNode, comment);\n\t\t\t}\n\t\t} else {\n\t\t\t// __DEV__: assert(isStartOfLine(comment));\n\t\t\tif (followingNode && end(followingNode) <= ownStart(enclosingNode)) {\n\t\t\t\taddLeadingComment(followingNode, comment);\n\t\t\t} else if (precedingNode && enclosingNode.loc.contains(precedingNode)) {\n\t\t\t\taddTrailingComment(precedingNode, comment);\n\t\t\t} else {\n\t\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t\t}\n\t\t}\n\t}\n}\nfunction handleAttributeComments({ precedingNode, enclosingNode, followingNode, comment, ast }: CommentContext) {\n\tif (is_AttributeOrDocComment(comment)) {\n\t\tif (\n\t\t\tcomment.inner &&\n\t\t\tenclosingNode &&\n\t\t\tis_FunctionDeclaration(enclosingNode) &&\n\t\t\t(!followingNode || !is_StatementNode(followingNode)) &&\n\t\t\t(!precedingNode || !is_StatementNode(precedingNode))\n\t\t) {\n\t\t\tif (enclosingNode.body) {\n\t\t\t\tif (canAttachCommentInLocArray(enclosingNode.body)) {\n\t\t\t\t\taddDanglingComment(enclosingNode, comment, DCM[\"body\"]);\n\t\t\t\t} else {\n\t\t\t\t\taddLeadingComment(enclosingNode.body[0], comment);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t\t}\n\t\t} else {\n\t\t\t// if (comment.loc.url().startsWith(\"tests/samples/macro/attr.rs\") && getContext().options.danglingAttributes.includes(comment)) {\n\t\t\t// \t// debugger;\n\t\t\t// \tconsole.log({\n\t\t\t// \t\tcomment: comment.loc.url(),\n\t\t\t// \t\tprecedingNode: precedingNode?.loc.url(),\n\t\t\t// \t\tenclosingNode: enclosingNode?.loc.url(),\n\t\t\t// \t\tfollowingNode: followingNode?.loc.url(),\n\t\t\t// \t});\n\t\t\t// }\n\t\t\tif (followingNode) {\n\t\t\t\taddLeadingComment(followingNode, comment);\n\t\t\t} else if (enclosingNode) {\n\t\t\t\tfor (var key in DCM)\n\t\t\t\t\tif (key in enclosingNode) {\n\t\t\t\t\t\taddDanglingComment(enclosingNode, comment, key as DCM);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddDanglingComment(ast, comment, DCM[\"body\"]);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction handleBadComments({ precedingNode, enclosingNode, followingNode, ast, comment }: CommentContext) {\n\tif (!enclosingNode) {\n\t\t// console.log(comment.loc.url());\n\t\tif (followingNode) {\n\t\t\taddLeadingComment(followingNode, comment);\n\t\t} else if (precedingNode) {\n\t\t\taddTrailingComment(precedingNode, comment);\n\t\t} else {\n\t\t\taddDanglingComment(enclosingNode || ast, comment, DCM[\"body\"]);\n\t\t}\n\t} else if (!precedingNode && !followingNode) {\n\t\tif (enclosingNode && enclosingNode !== ast) {\n\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t} else {\n\t\t\taddDanglingComment(ast, comment, DCM[\"body\"]);\n\t\t}\n\t}\n}\nfunction is_ABI_Comment({ precedingNode, enclosingNode, comment }: CommentContext) {\n\treturn (\n\t\tis_CommentOrDocComment(comment) &&\n\t\t((precedingNode && is_ExternSpecifier(precedingNode)) || (enclosingNode && is_ExternSpecifier(enclosingNode)))\n\t);\n}\nfunction handleFlowControlComments({ precedingNode, enclosingNode, followingNode, comment }: CommentContext) {\n\tif (enclosingNode && is_FlowControlExpression(enclosingNode)) {\n\t\tif (!precedingNode && (isOwnLine(comment) || isEndOfLine(comment)) && !followingNode) {\n\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t}\n\t}\n}\nfunction handleFunctionComments(ctx: CommentContext) {\n\tconst { precedingNode, enclosingNode, followingNode, comment } = ctx;\n\tif (enclosingNode && is_FunctionNode(enclosingNode)) {\n\t\tif (\n\t\t\tis_FunctionDeclaration(enclosingNode) &&\n\t\t\t((!is_ABI_Comment(ctx) && comment.loc.isBefore(enclosingNode.generics || enclosingNode.id)) ||\n\t\t\t\t(enclosingNode.generics && comment.loc.isBetween(enclosingNode.generics, enclosingNode.parameters)))\n\t\t) {\n\t\t\taddLeadingComment(enclosingNode, comment);\n\t\t} else if (\n\t\t\t!enclosingNode.returnType &&\n\t\t\tcomment.loc.isBetween(\n\t\t\t\tenclosingNode.parameters,\n\t\t\t\tis_FunctionDeclaration(enclosingNode) ? enclosingNode.body! : enclosingNode.expression\n\t\t\t)\n\t\t) {\n\t\t\tif (is_FunctionDeclaration(enclosingNode)) {\n\t\t\t\taddCommentToBlock(enclosingNode, comment);\n\t\t\t} else {\n\t\t\t\taddLeadingComment(enclosingNode.expression, comment);\n\t\t\t}\n\t\t} else if (\n\t\t\tprecedingNode && //\n\t\t\tenclosingNode.parameters.loc.contains(comment)\n\t\t) {\n\t\t\tif (precedingNode === getLastParameter(enclosingNode)) {\n\t\t\t\taddTrailingComment(precedingNode, comment);\n\t\t\t}\n\t\t} else if (\n\t\t\tfollowingNode &&\n\t\t\tisStartOfLine(comment) &&\n\t\t\tcomment.loc.isAfter(enclosingNode.parameters) &&\n\t\t\t(!is_FunctionDeclaration(enclosingNode) || !enclosingNode.whereBounds || comment.loc.isAfter(enclosingNode.whereBounds!)) &&\n\t\t\t(!enclosingNode.returnType || comment.loc.isAfter(enclosingNode.returnType)) &&\n\t\t\tfollowingNode === (is_FunctionDeclaration(enclosingNode) ? enclosingNode.body?.[0] : enclosingNode.expression)\n\t\t) {\n\t\t\taddLeadingComment(followingNode, comment);\n\t\t}\n\t}\n}\nfunction handleMacroRuleComments(ctx: CommentContext) {\n\tconst { precedingNode, enclosingNode, followingNode, comment } = ctx;\n\tif (enclosingNode && is_MacroRule(enclosingNode)) {\n\t\tif (enclosingNode.transform.loc.contains(comment)) {\n\t\t\t__DEV__: assert(enclosingNode.transform.length > 0);\n\t\t\tif (!precedingNode || !enclosingNode.transform.loc.contains(precedingNode)) {\n\t\t\t\t__DEV__: assert(!!followingNode && enclosingNode.transform.loc.contains(followingNode));\n\t\t\t\taddLeadingComment(followingNode, comment);\n\t\t\t}\n\t\t} else if (enclosingNode.match.loc.contains(comment)) {\n\t\t\t__DEV__: assert(enclosingNode.match.length > 0);\n\t\t\tif (!followingNode || !enclosingNode.match.loc.contains(followingNode)) {\n\t\t\t\t__DEV__: assert(!!precedingNode && enclosingNode.match.loc.contains(precedingNode));\n\t\t\t\taddTrailingComment(precedingNode!, comment);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction handleStatementComments(ctx: CommentContext) {\n\tconst { precedingNode, comment } = ctx;\n\tif (isEndOfLine(comment) && precedingNode && (is_StatementNode(precedingNode) || precedingNode.loc.sliceText().endsWith(\";\"))) {\n\t\taddTrailingComment(precedingNode, comment);\n\t}\n}\n\nfunction addCommentToBlock(block: NodeWithBodyOrCases, comment: AnyComment) {\n\tconst body = getBodyOrCases(block);\n\t__DEV__: assert(!!body);\n\tif (body.length > 0) {\n\t\taddLeadingComment(body![0], comment);\n\t} else {\n\t\taddDanglingComment(block, comment, DCM[\"body\"]);\n\t}\n}\n\nfunction handleIfBlockExpressionComments(ctx: CommentContext) {\n\tconst { comment, enclosingNode } = ctx;\n\tif (enclosingNode && is_IfBlockExpression(enclosingNode)) {\n\t\tconst { condition, body, else: else_ } = enclosingNode;\n\t\tif (comment.loc.isBefore(condition)) {\n\t\t\taddLeadingComment(condition, comment);\n\t\t} else if (comment.loc.isBetween(condition, body)) {\n\t\t\taddTrailingComment(condition, comment);\n\t\t} else if (else_ && comment.loc.isBetween(body, else_)) {\n\t\t\tif (is_IfBlockExpression(else_)) {\n\t\t\t\taddLeadingComment(else_.condition, comment);\n\t\t\t} else {\n\t\t\t\taddCommentToBlock(else_, comment);\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction handleMemberExpressionComments({ comment, precedingNode, enclosingNode }: CommentContext) {\n\tif (enclosingNode && is_MemberAccessLike(enclosingNode)) {\n\t\tif (isStartOfLine(comment) || !precedingNode) addLeadingComment(enclosingNode, comment);\n\t\telse addTrailingComment(precedingNode, comment);\n\t\treturn true;\n\t}\n\n\treturn false;\n}\n\nfunction handleDanglingComments({ comment, enclosingNode }: CommentContext) {\n\tif (enclosingNode) {\n\t\tfor (var key in DCM) {\n\t\t\tif (key in enclosingNode) {\n\t\t\t\tvar arr: LocArray = enclosingNode[key];\n\t\t\t\tif (is_LocArray(arr) && canAttachCommentInLocArray(arr) && arr.loc.contains(comment)) {\n\t\t\t\t\taddDanglingComment(enclosingNode, comment, key as DCM);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction canAttachCommentInLocArray(arr: LocArray) {\n\treturn arr.length === 0 || arr.every((node) => !canAttachComment(node));\n}\n\nfunction isOwnLine(comment: AnyComment) {\n\treturn isStartOfLine(comment) && hasBreaklineAfter(comment);\n}\nfunction isStartOfLine(comment: AnyComment) {\n\treturn comment.placement === \"ownLine\";\n}\nfunction isEndOfLine(comment: AnyComment) {\n\treturn comment.placement === \"endOfLine\";\n}\nexport function isDangling(comment: AnyComment) {\n\t__DEV__: assert(handled(comment));\n\treturn !comment.leading && !comment.trailing;\n}\nexport function isLeading(comment: AnyComment) {\n\t__DEV__: assert(handled(comment));\n\treturn comment.leading && !comment.trailing;\n}\nexport function isTrailing(comment: AnyComment) {\n\t__DEV__: assert(handled(comment));\n\treturn !comment.leading && comment.trailing;\n}\n\nexport function print_comment(comment: CommentOrDocComment) {\n\t__DEV__: Narrow<PrettierCommentInfo>(comment);\n\n\tconst doc = is_BlockCommentNode(comment)\n\t\t? isIndentableBlockComment(comment.value)\n\t\t\t? [\n\t\t\t\t\t(!handled(comment) || isTrailing(comment)) && !hasBreaklineBefore(comment) ? hardline : \"\",\n\t\t\t\t\tgetCommentStart(comment),\n\t\t\t\t\t...comment.value.split(/\\n/g).map((line, i, a) =>\n\t\t\t\t\t\ti === 0 //\n\t\t\t\t\t\t\t? [line.trimEnd(), hardline]\n\t\t\t\t\t\t\t: !iLast(i, a)\n\t\t\t\t\t\t\t? [\" \" + line.trim(), hardline]\n\t\t\t\t\t\t\t: \" \" + line.trimStart()\n\t\t\t\t\t),\n\t\t\t\t\t\"*/\",\n\t\t\t  ]\n\t\t\t: [\n\t\t\t\t\tgetCommentStart(comment), //\n\t\t\t\t\tjoin(literalline, comment.value.split(/\\n/g)),\n\t\t\t\t\t\"*/\",\n\t\t\t  ]\n\t\t: [getCommentStart(comment), comment.value.trimEnd()];\n\n\treturn handled(comment) && isDangling(comment) //\n\t\t? [doc, getPostLeadingComment(comment)]\n\t\t: doc;\n\n\tfunction getCommentStart(comment: CommentOrDocComment) {\n\t\treturn is_Comment(comment)\n\t\t\t? is_BlockCommentKind(comment)\n\t\t\t\t? \"/*\"\n\t\t\t\t: \"//\"\n\t\t\t: is_BlockCommentKind(comment)\n\t\t\t? isInner(comment)\n\t\t\t\t? \"/*!\"\n\t\t\t\t: \"/**\"\n\t\t\t: isInner(comment)\n\t\t\t? \"//!\"\n\t\t\t: \"///\";\n\t}\n\tfunction isIndentableBlockComment(value: string) {\n\t\tconst lines = `*${value}*`.split(/\\n/g);\n\t\treturn lines.length > 1 && lines.every((line) => /^\\s*\\*/.test(line));\n\t}\n}\n"
  },
  {
    "path": "src/format/complexity.ts",
    "content": "import {\n\tForLtParametersBody,\n\tFunctionSpread,\n\tGenericParameterDeclaration,\n\tMaybeGenericArgsTarget,\n\tMissingNode,\n\tNode,\n\tNodeType,\n\tTypeBound,\n\tTypeBoundsConstaint,\n\tTypeCallArgument,\n\tTypeNamespaceTargetNoSelector,\n\tTypeNode,\n} from \"jinx-rust\";\nimport {\n\tgetAstPath,\n\tgetOwnChildAstPath,\n\tis_BareTypeTraitBound,\n\tis_FunctionSpread,\n\tis_LetScrutinee,\n\tis_Literal,\n\tis_MissingNode,\n\tis_TypeBoundsStandaloneNode,\n\tis_TypeFunctionNode,\n\tis_TypeNode,\n\tis_VariableDeclarationNode,\n} from \"jinx-rust/utils\";\nimport { exit, has_key_defined, last_of, spliceAll } from \"../utils/common\";\nimport { canBreak } from \"./external\";\nimport { getContext, getNode, getOptions, getPrintFn } from \"./plugin\";\n\nlet DEPTH = 0;\nconst ANCESTRY: Node[] = [];\nconst LONE_SHORT_ARGUMENT_THRESHOLD_RATE = 0.25;\n\nexport function withCheckContext<R>(fn: () => R): R {\n\tif (0 === DEPTH) {\n\t\treturn fn();\n\t} else {\n\t\tDEPTH = 0;\n\t\tconst prev = spliceAll(ANCESTRY);\n\t\ttry {\n\t\t\treturn fn();\n\t\t} finally {\n\t\t\tDEPTH = ANCESTRY.push(...prev);\n\t\t}\n\t}\n}\n\nexport function is_short(str: string) {\n\treturn str.length <= LONE_SHORT_ARGUMENT_THRESHOLD_RATE * getOptions().printWidth;\n}\nfunction print(target: Node) {\n\tconst current = getNode();\n\tconst keys: (string | number)[] = [...getAstPath(ANCESTRY[0], getNode())];\n\tfor (let i = 1; i < ANCESTRY.length; i++) keys.push(...getOwnChildAstPath(ANCESTRY[i - 1], ANCESTRY[i]));\n\tkeys.push(...getOwnChildAstPath(last_of(ANCESTRY), target));\n\ttry {\n\t\treturn getContext().path.call(() => getPrintFn(target)(), ...keys);\n\t} catch (e) {\n\t\tconsole.log({ current, target, keys, ANCESTRY });\n\t\tthrow e;\n\t}\n}\n\nfunction IsSimpleFunction<T extends Node>(fn: (node: T) => boolean): (node: T) => boolean {\n\treturn function (node: T) {\n\t\tif (0 !== DEPTH && node === ANCESTRY[DEPTH - 1]) {\n\t\t\treturn fn(node);\n\t\t}\n\n\t\tif (DEPTH >= 2) {\n\t\t\treturn isShortBasic(node);\n\t\t}\n\n\t\ttry {\n\t\t\treturn fn((ANCESTRY[DEPTH++] = node) as any);\n\t\t} finally {\n\t\t\tANCESTRY.length = --DEPTH;\n\t\t}\n\t} as any;\n}\n\nfunction HasComplexFunction<T extends Node>(fn: (node: T) => boolean): (node: T) => boolean {\n\treturn function (node: T) {\n\t\tif (0 !== DEPTH && node === ANCESTRY[DEPTH - 1]) {\n\t\t\treturn fn(node);\n\t\t}\n\n\t\tif (DEPTH >= 2) {\n\t\t\treturn !isShortBasic(node);\n\t\t}\n\n\t\ttry {\n\t\t\treturn fn((ANCESTRY[DEPTH++] = node) as any);\n\t\t} finally {\n\t\t\tANCESTRY.length = --DEPTH;\n\t\t}\n\t} as any;\n}\n\nconst isShortBasic = (node: Node) => {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.MissingNode:\n\t\t\treturn true;\n\t\tcase NodeType.Identifier:\n\t\tcase NodeType.Index:\n\t\tcase NodeType.LtIdentifier:\n\t\tcase NodeType.LbIdentifier:\n\t\tcase NodeType.McIdentifier:\n\t\t\treturn is_short(node.name);\n\t\tcase NodeType.Literal:\n\t\t\treturn is_short(node.value) && !/\\n/.test(node.value);\n\t}\n\treturn false;\n};\n\nexport const isSimpleType = IsSimpleFunction<FunctionSpread | TypeNode | MissingNode>((node): boolean => {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.MissingNode:\n\t\tcase NodeType.FunctionSpread:\n\t\t\treturn true;\n\t\tcase NodeType.MacroInvocation:\n\t\t\treturn false;\n\t\tcase NodeType.Identifier:\n\t\tcase NodeType.TypeNever:\n\t\tcase NodeType.TypeInferred:\n\t\t\treturn true;\n\t\tcase NodeType.TypePath:\n\t\t\treturn isShortBasic(node.segment) && (!node.namespace || isSimpleType(node.namespace));\n\t\tcase NodeType.TypeCall:\n\t\t\treturn isSimpleType(node.typeCallee) && !hasComplexTypeArguments(node);\n\t\tcase NodeType.ExpressionTypeSelector:\n\t\t\treturn isSimpleType(node.typeTarget) && (!node.typeExpression || isSimpleType(node.typeExpression));\n\t\tcase NodeType.TypeDynBounds:\n\t\t\treturn !hasComplexTypeBounds(node);\n\t\tcase NodeType.TypeImplBounds:\n\t\t\treturn !hasComplexTypeBounds(node);\n\t\tcase NodeType.TypeFnPointer: {\n\t\t\tconst param = node.parameters[0];\n\t\t\treturn (\n\t\t\t\t(!node.extern || !node.extern.abi || isShortBasic(node.extern.abi)) &&\n\t\t\t\t!hasComplexLtParameters(node) &&\n\t\t\t\t(node.parameters.length === 0 ||\n\t\t\t\t\t(node.parameters.length === 1 &&\n\t\t\t\t\t\t(is_FunctionSpread(param) ||\n\t\t\t\t\t\t\t(!is_TypeFunctionNode(param.typeAnnotation) && isSimpleType(param.typeAnnotation))))) &&\n\t\t\t\t(!node.returnType || isSimpleType(node.returnType))\n\t\t\t);\n\t\t}\n\t\tcase NodeType.TypeFunction:\n\t\t\treturn isSimpleType(node.callee) && node.parameters.every(isSimpleType) && (!node.returnType || isSimpleType(node.returnType));\n\t\tcase NodeType.TypeSizedArray:\n\t\t\treturn isSimpleType(node.typeExpression) && isShortBasic(node.sizeExpression);\n\t\tcase NodeType.TypeSlice:\n\t\t\treturn isSimpleType(node.typeExpression);\n\t\tcase NodeType.TypeTuple:\n\t\t\treturn node.items.length === 0 || (node.items.length === 1 && isSimpleType(node.items[0]));\n\t\tcase NodeType.TypeReference:\n\t\tcase NodeType.TypeDereferenceMut:\n\t\tcase NodeType.TypeDereferenceConst:\n\t\tcase NodeType.TypeParenthesized:\n\t\t\treturn isSimpleType(node.typeExpression);\n\t\tdefault:\n\t\t\t__DEV__: exit.never(node);\n\t\t\treturn false;\n\t}\n});\n\nexport const hasComplexTypeBounds = HasComplexFunction<Extract<Node, TypeBoundsConstaint>>((node) => {\n\treturn !!node.typeBounds && node.typeBounds.length > 1 && !node.typeBounds.every(isSimpleTypeBound);\n});\n\nexport const isSimpleTypeBound = (node: TypeBound): boolean => {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.TypeParenthesized:\n\t\t\treturn isSimpleTypeBound(node.typeExpression);\n\t\t// #Lifetime\n\t\tcase NodeType.LtIdentifier:\n\t\tcase NodeType.LtElided:\n\t\tcase NodeType.LtStatic:\n\t\t\treturn true;\n\t\tcase NodeType.TypeTraitBound:\n\t\t\treturn is_BareTypeTraitBound(node) && isSimpleTypeNamespaceTargetNoSelector(node.typeExpression);\n\t\tdefault:\n\t\t\t__DEV__: exit.never(node);\n\t\t\treturn false;\n\t}\n\tfunction isSimpleTypeNamespaceTargetNoSelector(node: TypeNamespaceTargetNoSelector): boolean {\n\t\tswitch (node.nodeType) {\n\t\t\tcase NodeType.Identifier:\n\t\t\t\treturn true;\n\t\t\tcase NodeType.TypePath:\n\t\t\t\treturn undefined === node.namespace || isSimpleTypeNamespaceTargetNoSelector(node.namespace);\n\t\t\tcase NodeType.TypeCall:\n\t\t\t\treturn false;\n\t\t\tcase NodeType.TypeFunction:\n\t\t\t\treturn isSimpleTypeNamespaceTargetNoSelector(node.callee) && node.parameters.length === 0 && !node.returnType;\n\t\t\tdefault:\n\t\t\t\t__DEV__: exit.never(node);\n\t\t\t\treturn false;\n\t\t}\n\t}\n};\n\nconst isSimpleTypeArgument = IsSimpleFunction<TypeCallArgument>((node) => {\n\tif (is_TypeNode(node)) {\n\t\treturn isSimpleType(node);\n\t}\n\tswitch (node.nodeType) {\n\t\t// #Lifetime\n\t\tcase NodeType.LtIdentifier:\n\t\tcase NodeType.LtElided:\n\t\tcase NodeType.LtStatic:\n\t\tcase NodeType.Literal:\n\t\t\treturn true;\n\t\tcase NodeType.MinusExpression:\n\t\t\treturn is_Literal(node.expression);\n\t\tcase NodeType.BlockExpression:\n\t\t\treturn false; //willBreak(getPrintFn(node)(\"body\"));\n\t\tcase NodeType.TypeCallNamedArgument:\n\t\t\treturn isSimpleType(node.typeExpression);\n\t\tcase NodeType.TypeCallNamedBound:\n\t\t\treturn isSimpleType(node.typeTarget) && !hasComplexTypeBounds(node);\n\t\tdefault:\n\t\t\t__DEV__: exit.never(node);\n\t\t\treturn false;\n\t}\n});\n\nexport const hasComplexTypeArguments = HasComplexFunction<Extract<Node, MaybeGenericArgsTarget>>((node) =>\n\t!node.typeArguments || node.typeArguments.length === 0\n\t\t? false\n\t\t: node.typeArguments.length === 1\n\t\t? (() => {\n\t\t\t\tconst arg = node.typeArguments[0];\n\t\t\t\treturn is_TypeBoundsStandaloneNode(arg) || canBreak(print(arg));\n\t\t  })()\n\t\t: true\n);\n\nexport const hasComplexLtParameters = HasComplexFunction<Extract<Node, ForLtParametersBody>>((node) => {\n\tconst ltParameters = node.ltParameters;\n\tif (!ltParameters || ltParameters.length === 0) {\n\t\treturn false;\n\t}\n\tif (ltParameters.length === 1) {\n\t\tconst arg = ltParameters[0];\n\t\tif (arg.ltBounds && arg.ltBounds.length > 1) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n\treturn true;\n});\n\nexport const isShortGenericParameterDeclaration = IsSimpleFunction<GenericParameterDeclaration>((node) => {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.GenericTypeParameterDeclaration:\n\t\t\treturn !node.typeBounds && !node.typeDefault;\n\t\tcase NodeType.ConstTypeParameterDeclaration:\n\t\t\treturn (!node.typeAnnotation || is_MissingNode(node)) && !node.typeDefault;\n\t\tcase NodeType.GenericLtParameterDeclaration:\n\t\t\treturn !node.ltBounds;\n\t\tdefault:\n\t\t\texit.never();\n\t}\n});\n\nexport const hasComplexGenerics = HasComplexFunction<Node>((node) => {\n\treturn has_key_defined(node, \"generics\") && node.generics.length > 0 && !node.generics.every(isShortGenericParameterDeclaration);\n});\n\nexport const hasComplexTypeAnnotation = HasComplexFunction<Node>((node) => {\n\tif (is_VariableDeclarationNode(node) && !is_LetScrutinee(node)) {\n\t\tconst { typeAnnotation } = node;\n\t\treturn !!typeAnnotation && !is_MissingNode(typeAnnotation) && !isSimpleType(typeAnnotation);\n\t} else {\n\t\treturn false;\n\t}\n});\n"
  },
  {
    "path": "src/format/core.ts",
    "content": "import {\n\tAndExpression,\n\tAttributeOrDocComment,\n\tBreakExpression,\n\tCallExpression,\n\tClosureFunctionExpression,\n\tComparisonExpression,\n\tDeclarationNode,\n\tDelimKind,\n\tEnumDeclaration,\n\tExpressionBody,\n\tExpressionNode,\n\tExpressionPath,\n\tExpressionWithBody,\n\tForLtParametersBody,\n\tFunctionDeclaration,\n\tFunctionLike,\n\tFunctionNode,\n\tIfBlockExpression,\n\tImplDeclaration,\n\tLeftRightExpression,\n\tLocArray,\n\tMacroDeclaration,\n\tMacroGroup,\n\tMacroInlineRuleDeclaration,\n\tMacroMatchSegment,\n\tMacroRuleDeclaration,\n\tMacroRulesDeclaration,\n\tMatchExpression,\n\tMatchExpressionCase,\n\tMaybeBlockBody,\n\tMaybeGenericArgsTarget,\n\tMaybeHasLtBounds,\n\tMaybeReturnTypeConstraint,\n\tMaybeTypeAnnotationTarget,\n\tMemberExpression,\n\tNegativeImplDeclaration,\n\tNode,\n\tNodeType,\n\tNodeWithBodyOrCases,\n\tNodeWithCondition,\n\tObjectNode,\n\tOperationExpression,\n\tOrExpression,\n\tPathNode,\n\tPatternBody,\n\tPatternNode,\n\tPunctuationToken,\n\tRangeNode,\n\tRestPattern,\n\tReturnExpression,\n\tStructDeclaration,\n\tStructLiteral,\n\tStructLiteralPropertySpread,\n\tStructLiteralRestUnassigned,\n\tTK,\n\tTraitAliasDeclaration,\n\tTraitDeclaration,\n\tTupleStructDeclaration,\n\tTypeAliasDeclaration,\n\tTypeBoundsConstaint,\n\tTypeFunctionNode,\n\tUnaryExpression,\n\tUnionDeclaration,\n\tUnionPattern,\n\tWhileBlockExpression,\n\tYieldExpression,\n} from \"jinx-rust\";\nimport {\n\tDelimChars,\n\tend,\n\tgetBodyOrCases,\n\tgetDelimChars,\n\tgetParameters,\n\thasAttributes,\n\thasCondition,\n\thasItems,\n\thasLetScrutineeCondition,\n\thasParameters,\n\thasProperties,\n\thasSelfParameter,\n\thasSemiNoBody,\n\thasSemiNoProperties,\n\thasTypeBounds,\n\tis_ArrayOrTupleLiteral,\n\tis_Attribute,\n\tis_ClosureBlock,\n\tis_ClosureFunctionExpression,\n\tis_DelimGroup,\n\tis_ElseBlock,\n\tis_EnumMemberStructDeclaration,\n\tis_ExpressionAsTypeCast,\n\tis_ExpressionNode,\n\tis_ExpressionPath,\n\tis_ExpressionStatement,\n\tis_ExpressionTypeCast,\n\tis_ExpressionWithBodyOrCases,\n\tis_FlowControlExpression,\n\tis_FunctionDeclaration,\n\tis_FunctionParameterDeclaration,\n\tis_GenericParameterDeclaration,\n\tis_Identifier,\n\tis_IdentifierOrIndex,\n\tis_IfBlockExpression,\n\tis_ImplDeclarationNode,\n\tis_LetScrutinee,\n\tis_LineCommentNode,\n\tis_Literal,\n\tis_LiteralBooleanLike,\n\tis_LiteralNumberLike,\n\tis_LiteralStringLike,\n\tis_LogicalExpression,\n\tis_MacroGroup,\n\tis_MacroInlineRuleDeclaration,\n\tis_MacroInvocation,\n\tis_MacroParameterDeclaration,\n\tis_MatchExpression,\n\tis_MatchExpressionCase,\n\tis_MemberExpression,\n\tis_MinusExpression,\n\tis_MissingNode,\n\tis_NodeWithBodyOrCases,\n\tis_OrExpression,\n\tis_PostfixExpression,\n\tis_Program,\n\tis_PunctuationToken,\n\tis_RangeLiteral,\n\tis_RangePattern,\n\tis_ReassignmentExpression,\n\tis_ReassignmentNode,\n\tis_RestPattern,\n\tis_SourceFile,\n\tis_StructDeclaration,\n\tis_StructLiteral,\n\tis_StructLiteralProperty,\n\tis_StructLiteralPropertySpread,\n\tis_StructPattern,\n\tis_StructPatternPropertyDestructured,\n\tis_StructProperty,\n\tis_TupleLiteral,\n\tis_TupleNode,\n\tis_TuplePattern,\n\tis_TupleStructDeclaration,\n\tis_TypeCallNamedArgument,\n\tis_TypeTuple,\n\tis_UnaryExpression,\n\tis_UnionDeclaration,\n\tis_UnwrapExpression,\n\tis_VariableDeclarationNode,\n\townStart,\n\tstart,\n} from \"jinx-rust/utils\";\nimport { BlockLikeMacroInvocation, CallLikeMacroInvocation, is_CallExpression_or_CallLikeMacroInvocation } from \"../transform\";\nimport { AssertTypesEq, Identity, Map_get, Narrow, assert, exit, find_last, flat, iLast, last_of, spread } from \"../utils/common\";\nimport {\n\tCF,\n\tgetFirstComment,\n\tgetNextNonSpaceNonCommentCharacterIndex,\n\thasBreaklineBefore,\n\thasComment,\n\thasNewline,\n\thasNewlineInRange,\n\tisNextLineEmpty,\n\tisNextLineEmptyAfterIndex,\n\tisPreviousLineEmpty,\n\tprintCommentsSeparately,\n\tprintDanglingComments,\n\twithComments,\n} from \"./comments\";\nimport {\n\thasComplexGenerics,\n\thasComplexLtParameters,\n\thasComplexTypeAnnotation,\n\thasComplexTypeArguments,\n\thasComplexTypeBounds,\n\tisShortGenericParameterDeclaration,\n\tis_short,\n} from \"./complexity\";\nimport {\n\tAstPath,\n\tDCM,\n\tDoc,\n\talign,\n\tbreakParent,\n\tcanBreak,\n\tcleanDoc,\n\tconditionalGroup,\n\tdedentToRoot,\n\tfill,\n\tgetDocParts,\n\tgroup,\n\thardline,\n\tifBreak,\n\tindent,\n\tindentIfBreak,\n\tisConcat,\n\tjoin,\n\tlabel,\n\tline,\n\tlineSuffixBoundary,\n\tremoveLines,\n\tsoftline,\n\twillBreak,\n} from \"./external\";\nimport {\n\tf,\n\tgetContext,\n\tgetGrandParentNode,\n\tgetNode,\n\tgetOptions,\n\tgetParentNode,\n\tgetPrintFn,\n\tis_printing_macro,\n\tpathCall,\n\tpathCallEach,\n\tprint,\n} from \"./plugin\";\nimport { canInlineBlockBody, emptyContent, needsParens, shouldFlatten } from \"./styling\";\n\nexport function isNoopExpressionStatement(node: Node) {\n\treturn is_ExpressionStatement(node) && undefined === node.expression && !hasAttributes(node) && !hasComment(node);\n}\n\nexport function getLastNotNoopExpressionStatement(parent: MaybeBlockBody) {\n\treturn parent.body && find_last(parent.body, (stmt) => !isNoopExpressionStatement(stmt));\n}\n\nexport function is_xVariableEqualishLike(node: Node) {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.LetScrutinee:\n\t\tcase NodeType.LetVariableDeclaration:\n\t\tcase NodeType.ConstVariableDeclaration:\n\t\tcase NodeType.StaticVariableDeclaration:\n\t\tcase NodeType.TypeAliasDeclaration:\n\t\tcase NodeType.TraitAliasDeclaration:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function is_BinaryishExpression(node: Node): node is OrExpression | AndExpression | OperationExpression | ComparisonExpression {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.OrExpression:\n\t\tcase NodeType.AndExpression:\n\t\tcase NodeType.OperationExpression:\n\t\tcase NodeType.ComparisonExpression:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport type StructSpread = StructLiteralPropertySpread | StructLiteralRestUnassigned | RestPattern;\nexport function is_StructSpread(node: Node): node is StructSpread {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.StructLiteralPropertySpread:\n\t\tcase NodeType.StructLiteralRestUnassigned:\n\t\tcase NodeType.RestPattern:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\ntype ArrayLikeNode = Exclude<Extract<Node, { items: Node[] }>, UnionPattern>;\nfunction isConciselyPrintedArray(node: ArrayLikeNode) {\n\treturn (\n\t\tnode.items.length > 1 &&\n\t\t(node.items as Node[]).every(\n\t\t\t(element) =>\n\t\t\t\t(is_LiteralNumberLike(element) ||\n\t\t\t\t\t(is_MinusExpression(element) && is_LiteralNumberLike(element.expression) && !hasComment(element.expression))) &&\n\t\t\t\t!hasComment(element, CF.Trailing | CF.Line, (comment) => !hasBreaklineBefore(comment))\n\t\t)\n\t);\n}\nexport function printCommentsInsideEmptyArray(path: AstPath<Node>) {\n\tconst node = path.getValue();\n\tif (hasComment(node, CF.Dangling)) {\n\t\treturn [printDanglingComments(node, false, DCM[\"items\"]), softline];\n\t} else {\n\t\treturn \"\";\n\t}\n}\n\nexport function printNumber(rawNumber: string) {\n\treturn rawNumber\n\t\t.toLowerCase()\n\t\t.replace(/^([\\d.]+e)(?:\\+|(-))?0*(\\d)/, \"$1$2$3\")\n\t\t.replace(/^(\\d+)e[+-]?0+$/, \"$1.0\")\n\t\t.replace(/^([\\d.]+)e[+-]?0+$/, \"$1\")\n\t\t.replace(/\\.(\\d+?)0+(?=e|$)/, \".$1\")\n\t\t.replace(/\\.(?=e|$)/, \".0\");\n}\n\nexport function printOnOwnLine(node: Node, printed: Doc) {\n\treturn [printed, maybeEmptyLine(node)];\n}\nexport function maybeEmptyLine(node: Node) {\n\treturn isNextLineEmpty(node) ? [hardline, hardline] : hardline;\n}\n\nexport function printBodyOrCases<T extends NodeWithBodyOrCases | BlockLikeMacroInvocation>(print: print<T>, node: T) {\n\t// Note: Inner Attributes are inserted into body/cases (see \"./transform.ts\")\n\t// Example: { #[OUTER] #![INNER] 0 }; body: [\"#[OUTER] 0\", \"#![INNER]\"]\n\tconst p: { node: Node; doc: Doc }[] = [];\n\tif (is_MatchExpression(node)) {\n\t\t__DEV__: Narrow<print<MatchExpression>>(print);\n\t\tpathCallEach(node as Extract<Node, MatchExpression>, \"cases\", (mCase) => {\n\t\t\tp.push({\n\t\t\t\tnode: mCase,\n\t\t\t\tdoc: is_MatchExpressionCase(mCase) && !is_ExpressionWithBodyOrCases(mCase.expression) ? [print(), \",\"] : print(),\n\t\t\t});\n\t\t});\n\t} else {\n\t\t__DEV__: Narrow<Extract<Node, MaybeBlockBody>>(node);\n\t\tpathCallEach(node as Extract<Node, MaybeBlockBody>, \"body\", (stmt) => {\n\t\t\tif (!isNoopExpressionStatement(stmt)) {\n\t\t\t\tp.push({ node: stmt, doc: print() });\n\t\t\t}\n\t\t});\n\t}\n\n\tconst printed: Doc[] = bumpInnerAttributes(p).map(({ doc, node }, i, a) =>\n\t\tiLast(i, a) ? group(doc) : printOnOwnLine(node, group(doc))\n\t);\n\n\tconst comments = printDanglingCommentsForInline(node, DCM[\"body\"]);\n\tif (comments) printed.push(comments);\n\tconst ccomments = printDanglingCommentsForInline(node, DCM[\"cases\"]);\n\tif (ccomments) printed.push(ccomments);\n\n\tif (is_Program(node) && is_SourceFile(getParentNode(node)!) && printed.length > 0 && !comments) {\n\t\tprinted.push(hardline);\n\t}\n\n\treturn printed;\n\n\tfunction bumpInnerAttributes(arr: { node: Node; doc: Doc }[]) {\n\t\treturn arr.sort((a, b) => ownStart(a.node) - ownStart(b.node));\n\t}\n}\n\nexport function printMacroRules<T extends MacroDeclaration | MacroRulesDeclaration>(print: print<T>, node: T) {\n\treturn !Array.isArray(node.rules)\n\t\t? print(\"rules\")\n\t\t: node.rules.length > 0\n\t\t? [\" {\", indent([hardline, ...print.join(\"rules\", (rule) => maybeEmptyLine(rule))]), hardline, \"}\"]\n\t\t: [\" {\", printDanglingCommentsForInline(node, DCM[\"rules\"]) || emptyContent(node), \"}\"];\n}\nfunction is_unary_token(item: MacroMatchSegment | undefined) {\n\tswitch (item && is_PunctuationToken(item) ? item.tk : TK.None) {\n\t\tcase TK[\"-\"]:\n\t\tcase TK[\"*\"]:\n\t\tcase TK[\"&\"]:\n\t\tcase TK[\"#\"]:\n\t\tcase TK[\"!\"]:\n\t\tcase TK[\"~\"]:\n\t\t\treturn true;\n\t\tcase TK[\"?\"]:\n\t\t\treturn !/\\s/.test(getOptions().originalText.charAt(end(item!)));\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\nfunction can_unary(node: MacroMatchSegment) {\n\treturn (!is_PunctuationToken(node) || is_unary_token(node)) && (!is_MacroGroup(node) || is_optional_unary(node));\n}\nfunction is_optional_token(item: MacroMatchSegment | undefined): item is MacroGroup<MacroMatchSegment> & { segments: [PunctuationToken] } {\n\treturn !!item && is_MacroGroup(item) && item.kind === \"?\" && item.segments.length === 1 && is_PunctuationToken(item.segments[0]);\n}\nfunction is_optional_unary(item: MacroMatchSegment | undefined) {\n\treturn is_optional_token(item) && is_unary_token(item.segments[0]);\n}\n\nfunction is_optional_segment(item: Node): item is MacroGroup {\n\treturn is_MacroGroup(item) && item.kind === \"?\";\n}\n\nexport function printRuleMatch<T extends MacroRuleDeclaration | MacroInlineRuleDeclaration>(print: print<T>, rule: T) {\n\t// \"\", \".\", \"&&\", \"||\", \"=\", \"+\", \"-\", \"*\", \"/\", \"%\", \"&\", \"|\", \"^\", \"<<\", \">>\", \"==\", \"!=\", \">\", \">=\", \"<\", \"<=\", \"+=\", \"-=\", \"*=\", \"/=\",\n\t// \"%=\", \"&=\", \"|=\", \"^=\", \"<<=\", \">>=\", \"$\", \"@\", \"_\", \"..\", \"...\", \"..=\", \",\", \";\", \":\", \"::\", \"#\", \"?\", \"!\", \"=>\", \"->\", \"~\"\n\n\treturn print_map(rule, \"match\");\n\n\ttype ArrProps<T extends {}> = { [K in keyof T]: NonNullable<T[K]> extends readonly any[] ? T[K] & unknown[] : never };\n\tfunction print_map<T extends Node, K extends keyof ArrProps<T> & keyof typeof DCM>(node: T, property: K) {\n\t\t__DEV__: assert(property in DCM);\n\t\tconst arr = node[property as any] as LocArray<MacroMatchSegment>;\n\t\tconst shouldHug = should_hug(arr);\n\t\tconst dline =\n\t\t\tarr.dk === DelimKind[\"{}\"] ? line : shouldHug ? \"\" /*  : is_MacroGroup(node) && node.kind !== \"?\" ? hardline */ : softline;\n\t\tconst isParamsLike = is_params_like(arr);\n\t\tconst shouldBreak = should_break(arr);\n\t\tconst d = getDelimChars(arr);\n\t\tif (arr.length === 0) return [d.left, printDanglingCommentsForInline(node, DCM[property]), d.right];\n\t\tconst printed = flat(print.map_join(property as any, print_item, join_item));\n\n\t\t// const printed = flat(print.map_join(property as any, print_item, join_item))\n\t\t// \t.reduce(\n\t\t// \t\t(arr, doc, i, a) => {\n\t\t// \t\t\tlast_of(arr).push(doc);\n\t\t// \t\t\tif (doc === line && (a[i - 1] === \",\" || a[i - 1] === \";\")) arr.push([]);\n\t\t// \t\t\treturn arr;\n\t\t// \t\t},\n\t\t// \t\t[[]] as Doc[][]\n\t\t// \t)\n\t\t// \t.map((grp) => group(grp));\n\n\t\treturn group([d.left, !dline ? printed : [indent([dline, printed]), dline], d.right], {\n\t\t\tshouldBreak,\n\t\t\tid: getMacroGroupId(node),\n\t\t});\n\n\t\tfunction should_hug(arr: LocArray<MacroMatchSegment>) {\n\t\t\tif (node === (rule as any)) return false;\n\t\t\tlet has_nonToken = false;\n\t\t\treturn arr.every((item) => !is_MacroGroup(item) && (is_PunctuationToken(item) || has_nonToken !== (has_nonToken = true)));\n\t\t}\n\n\t\tfunction should_break(arr: LocArray<MacroMatchSegment>) {\n\t\t\tlet has_decl = false;\n\t\t\treturn arr.some(\n\t\t\t\t(item, i, a) =>\n\t\t\t\t\t(is_match_any(item) && arr.length !== 1) ||\n\t\t\t\t\t(!iLast(i, a) && isDeclStart(item, a[i + 1]) && has_decl === (has_decl = true))\n\t\t\t);\n\t\t}\n\n\t\tfunction print_item(item: MacroMatchSegment, index: number, arr: MacroMatchSegment[]) {\n\t\t\tswitch (item.nodeType) {\n\t\t\t\tcase NodeType.Identifier:\n\t\t\t\tcase NodeType.LtIdentifier:\n\t\t\t\tcase NodeType.Literal:\n\t\t\t\tcase NodeType.PunctuationToken:\n\t\t\t\tcase NodeType.MacroParameterDeclaration:\n\t\t\t\t\treturn print();\n\t\t\t\tcase NodeType.MacroGroup:\n\t\t\t\t\tNarrow<print<MacroGroup>>(print);\n\t\t\t\t\treturn printComments([\"$\", print_map(item, \"segments\"), print(\"sep\"), item.kind]);\n\t\t\t\tcase NodeType.DelimGroup:\n\t\t\t\t\treturn printComments(print_map(item, \"segments\"));\n\t\t\t}\n\t\t\t__DEV__: exit.never();\n\n\t\t\tfunction printComments(doc: Doc) {\n\t\t\t\tconst printed = withComments(item, doc);\n\t\t\t\tconst comment = getFirstComment(item, CF.Leading | CF.Line);\n\t\t\t\treturn comment && index !== 0\n\t\t\t\t\t? isPreviousLineEmpty(comment) &&\n\t\t\t\t\t  typeof join_item(arr[index - 1], item, index === 1 ? undefined : arr[index - 2]) === \"string\"\n\t\t\t\t\t\t? [hardline, hardline, printed]\n\t\t\t\t\t\t: [hardline, printed]\n\t\t\t\t\t: printed;\n\t\t\t}\n\t\t}\n\n\t\tfunction is_params_like(arr: MacroMatchSegment[]) {\n\t\t\treturn arr.some(function isComma(item) {\n\t\t\t\tswitch (item.nodeType) {\n\t\t\t\t\tcase NodeType.PunctuationToken:\n\t\t\t\t\t\treturn TK[\",\"] === item.tk;\n\t\t\t\t\tcase NodeType.MacroGroup:\n\t\t\t\t\t\treturn (!!item.sep && isComma(item.sep)) || is_params_like(item.segments);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tfunction join_item(item: MacroMatchSegment, next: MacroMatchSegment, prev: MacroMatchSegment | undefined) {\n\t\t\tif (is_PunctuationToken(item)) {\n\t\t\t\tswitch (item.tk) {\n\t\t\t\t\tcase TK[\",\"]:\n\t\t\t\t\tcase TK[\";\"]:\n\t\t\t\t\t\treturn line;\n\t\t\t\t\tcase TK[\"::\"]:\n\t\t\t\t\tcase TK[\"..\"]:\n\t\t\t\t\tcase TK[\"...\"]:\n\t\t\t\t\tcase TK[\".\"]:\n\t\t\t\t\tcase TK[\"#\"]:\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\tcase TK[\"!\"]:\n\t\t\t\t\t\tif (prev && is_ident(prev) && is_DelimGroup(next)) {\n\t\t\t\t\t\t\treturn next.segments.dk === DelimKind[\"{}\"] ? \" \" : \"\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TK[\"@\"]:\n\t\t\t\t\t\treturn is_ident(next) && (!prev || is_MacroGroup(prev) || is_DelimGroup(prev)) ? \"\" : \" \";\n\t\t\t\t}\n\n\t\t\t\treturn is_unary_token(item) && //\n\t\t\t\t\t(!prev || !is_ident(prev)) &&\n\t\t\t\t\tcan_unary(next)\n\t\t\t\t\t? \"\"\n\t\t\t\t\t: \" \";\n\t\t\t}\n\n\t\t\tswitch (is_PunctuationToken(next) ? next.tk : TK.None) {\n\t\t\t\tcase TK[\",\"]:\n\t\t\t\tcase TK[\";\"]:\n\t\t\t\tcase TK[\":\"]:\n\t\t\t\tcase TK[\"::\"]:\n\t\t\t\tcase TK[\"..\"]:\n\t\t\t\tcase TK[\"...\"]:\n\t\t\t\tcase TK[\".\"]:\n\t\t\t\t\treturn \"\";\n\t\t\t\tcase TK[\"!\"]:\n\t\t\t\t\tif (is_ident(item)) {\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_match_any(item)) {\n\t\t\t\treturn line;\n\t\t\t}\n\n\t\t\t{\n\t\t\t\tconst sep_tk = is_MacroGroup(item) && item.sep && is_PunctuationToken(item.sep) ? item.sep.tk : TK.None;\n\t\t\t\tswitch (sep_tk) {\n\t\t\t\t\tcase TK[\"::\"]:\n\t\t\t\t\tcase TK[\".\"]:\n\t\t\t\t\t\treturn \"\"; // $(...)::* | $(...).*\n\t\t\t\t\tcase TK[\",\"]:\n\t\t\t\t\tcase TK[\";\"]:\n\t\t\t\t\t\treturn sep_tk === maybe_tk(next) ? ifBreak(line, \" \", { groupId: getMacroGroupId(item) }) : line;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_optional_token(item)) {\n\t\t\t\tswitch (item.segments[0].tk) {\n\t\t\t\t\tcase TK[\"+\"]:\n\t\t\t\t\tcase TK[\"|\"]:\n\t\t\t\t\t\treturn \" \";\n\t\t\t\t\tcase TK[\"::\"]:\n\t\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t\tif (is_unary_token(item.segments[0])) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_DelimGroup(item) || is_MacroGroup(item)) {\n\t\t\t\tif (item.segments.dk === DelimKind[\"{}\"]) {\n\t\t\t\t\treturn line;\n\t\t\t\t}\n\n\t\t\t\tif (is_MacroGroup(item) && item.segments.length === 2) {\n\t\t\t\t\tconst { 0: left, 1: right } = item.segments;\n\t\t\t\t\tif (is_PunctuationToken(left) && is_DelimGroup(right) && left.tk === TK[\"#\"] && right.segments.dk === DelimKind[\"[]\"]) {\n\t\t\t\t\t\treturn hardline;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn isParamsLike || is_tk(next) ? \" \" : line;\n\t\t\t}\n\n\t\t\tconst next_1 = next !== last_of(arr) && arr[arr.indexOf(next) + 1];\n\t\t\tif (is_ident(item) && is_DelimGroup(next) && next.segments.dk === DelimKind[\"()\"]) {\n\t\t\t\tif (!next_1 || !is_match_any(next_1)) {\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (is_match_any(next) && (!is_DelimGroup(next) || (next_1 && is_match_any(next_1)))) {\n\t\t\t\treturn line;\n\t\t\t}\n\n\t\t\t// if (is_ident(item) && !is_ident(next) && !(is_DelimGroup(next) && next.segments.dk === DelimKind[\"{}\"])) {\n\t\t\t// \tconst next_1 = arr[arr.indexOf(next) + 1];\n\t\t\t// \tif (next_1 && typeof join_item(next, next_1, item) === \"object\") {\n\t\t\t// \t\treturn line;\n\t\t\t// \t}\n\t\t\t// }\n\n\t\t\treturn \" \";\n\t\t}\n\t}\n\n\tfunction is_ident(item: MacroMatchSegment) {\n\t\tswitch (item.nodeType) {\n\t\t\tcase NodeType.Identifier:\n\t\t\t\treturn true;\n\t\t\tcase NodeType.MacroParameterDeclaration:\n\t\t\t\treturn item.ty.name === \"ident\";\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\tfunction is_tk(item: MacroMatchSegment) {\n\t\treturn is_PunctuationToken(item) || is_optional_token(item);\n\t}\n\tfunction maybe_tk(item: MacroMatchSegment) {\n\t\tswitch (item.nodeType) {\n\t\t\tcase NodeType.PunctuationToken:\n\t\t\t\treturn item.tk;\n\t\t\tcase NodeType.MacroGroup:\n\t\t\t\treturn is_optional_token(item) ? item.segments[0].tk : TK.None;\n\t\t\tdefault:\n\t\t\t\treturn TK.None;\n\t\t}\n\t}\n\tfunction isDeclStart(item: MacroMatchSegment, next: MacroMatchSegment) {\n\t\tif (is_Identifier(item)) {\n\t\t\tswitch (item.name) {\n\t\t\t\tcase \"fn\":\n\t\t\t\tcase \"mod\":\n\t\t\t\tcase \"use\":\n\t\t\t\tcase \"struct\":\n\t\t\t\tcase \"trait\":\n\t\t\t\tcase \"union\":\n\t\t\t\tcase \"enum\":\n\t\t\t\tcase \"impl\":\n\t\t\t\tcase \"type\":\n\t\t\t\tcase \"let\":\n\t\t\t\tcase \"static\":\n\t\t\t\tcase \"const\":\n\t\t\t\t\tif (is_ident(next)) {\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n\tfunction is_match_any(item: MacroMatchSegment) {\n\t\treturn (\n\t\t\t!!item &&\n\t\t\t((is_MacroGroup(item) &&\n\t\t\t\t!item.sep &&\n\t\t\t\t(item.kind === \"*\" || item.kind === \"+\") &&\n\t\t\t\titem.segments.length === 1 &&\n\t\t\t\tis_MacroParameterDeclaration(item.segments[0]) &&\n\t\t\t\titem.segments[0].ty.name === \"tt\") ||\n\t\t\t\t(is_DelimGroup(item) && item.segments.length === 1 && is_match_any(item.segments[0])))\n\t\t);\n\t}\n}\n\nexport function printRuleTransform<T extends MacroRuleDeclaration | MacroInlineRuleDeclaration>(\n\tprint: print<T>,\n\tnode: T,\n\tt: DelimChars = getDelimChars(node.transform)\n) {\n\tconst text = node.transform.loc.sliceText();\n\tconst fline = is_MacroInlineRuleDeclaration(node) ? hardline : line;\n\tif (/^. *\\n/.test(text)) {\n\t\treturn [\n\t\t\tdedentToRoot([\n\t\t\t\tt.left,\n\t\t\t\tfline,\n\t\t\t\ttext\n\t\t\t\t\t.slice(1, -1) //\n\t\t\t\t\t.replace(/^ *\\n|\\n\\s*$/g, \"\"),\n\t\t\t]),\n\t\t\tfline,\n\t\t\tt.right,\n\t\t];\n\t} else if (/\\n/.test(text) && node.transform.length === 1) {\n\t\tconst segment = node.transform[0];\n\t\tif (is_DelimGroup(segment) || is_MacroGroup(segment)) {\n\t\t\tconst inner = is_DelimGroup(segment)\n\t\t\t\t? getDelimChars(segment.segments)\n\t\t\t\t: { left: \"$(\", right: `)${segment.sep?.loc.getOwnText() ?? \"\"}${segment.kind}` };\n\t\t\treturn [\n\t\t\t\tdedentToRoot([\n\t\t\t\t\tt.left,\n\t\t\t\t\t[\n\t\t\t\t\t\tindent(indent([fline, inner.left])),\n\t\t\t\t\t\tline,\n\t\t\t\t\t\tsegment.segments.loc.sliceText(1, -1).replace(/^ *\\n|\\n\\s*$/g, \"\"),\n\t\t\t\t\t\tindent(indent([line, inner.right])),\n\t\t\t\t\t],\n\t\t\t\t]),\n\t\t\t\tfline,\n\t\t\t\tt.right,\n\t\t\t];\n\t\t}\n\t}\n\treturn text;\n\n\treturn node.transform.length > 0\n\t\t? group([t.left, indent([line, print(\"transform\")]), line, t.right])\n\t\t: [t.left, printDanglingCommentsForInline(node, DCM[\"transform\"]), t.right];\n}\n\nfunction is_AssignmentOrVariableDeclarator(node: Node): boolean {\n\treturn is_ReassignmentNode(node) || is_VariableDeclarationNode(node);\n}\nfunction hasLeadingOwnLineComment(node: Node): boolean {\n\tif (is_NodeWithBodyOrCases(node) && hasComment(node, CF.Leading, is_Attribute)) {\n\t\treturn true;\n\t}\n\treturn hasComment(\n\t\tnode,\n\t\tCF.Leading,\n\t\t(comment) => hasNewline(end(comment)) && !getContext().options.danglingAttributes.includes(comment as any)\n\t);\n}\nfunction isComplexDestructuring(node: Node): boolean {\n\tif (is_ReassignmentExpression(node)) {\n\t\tconst leftNode = node.left;\n\t\treturn (\n\t\t\tis_StructLiteral(leftNode) && //\n\t\t\tleftNode.properties.length > 2 &&\n\t\t\tleftNode.properties.some((property) => is_StructLiteralProperty(property) || is_StructLiteralPropertySpread(property))\n\t\t);\n\t}\n\tif (is_VariableDeclarationNode(node) || is_MatchExpressionCase(node) || is_LetScrutinee(node)) {\n\t\tconst leftNode = node.pattern;\n\t\treturn (\n\t\t\tis_StructPattern(leftNode) && //\n\t\t\tleftNode.properties.length > 2 &&\n\t\t\tleftNode.properties.some((property) => is_StructPatternPropertyDestructured(property))\n\t\t);\n\t}\n\treturn false;\n}\n\n// export function isShortWhereBoundDeclaration(node: WhereBoundDeclaration) {\n// \tswitch (node.nodeType) {\n// \t\tcase NodeType.WhereTypeBoundDeclaration:\n// \t\t\t__DEV__: Narrow<WhereTypeBoundDeclaration>(node);\n// \t\t\treturn !node.ltParameters && is_Identifier(node.typeTarget);\n// \t\tcase NodeType.WhereLtBoundDeclaration:\n// \t\t\t__DEV__: Narrow<WhereLtBoundDeclaration>(node);\n// \t\t\t// return !node.typeAnnotation && !node.typeDefault;\n// \t\tdefault:\n// \t\t\texit.never();\n// \t}\n// }\n\nfunction isArrowFunctionVariableDeclarator(node: Node) {\n\treturn is_VariableDeclarationNode(node) && node.expression && is_ClosureFunctionExpression(node.expression);\n}\nfunction isObjectPropertyWithShortKey(node: Node, keyDoc: Doc) {\n\tif (!is_StructProperty(node)) return false;\n\tkeyDoc = cleanDoc(keyDoc);\n\tconst MIN_OVERLAP_FOR_BREAK = 3;\n\treturn typeof keyDoc === \"string\" && keyDoc.length < getContext().options.tabWidth + MIN_OVERLAP_FOR_BREAK;\n}\n\nfunction print_CallExpression_end(print: print<CallExpression>, node: CallExpression) {\n\treturn [f`::${printTypeArguments(print, node)}`, printCallArguments(print, node)];\n}\n\nexport function printCallExpression(print: print<CallExpression>, node: CallExpression) {\n\tif (shouldPrint_CallExpression_chain(node) && !pathCall(node, \"callee\", (node) => needsParens(node))) {\n\t\treturn printMemberChain(print, node);\n\t}\n\n\tconst contents = [print(\"callee\"), ...print_CallExpression_end(print, node)];\n\n\tif (is_CallExpression_or_CallLikeMacroInvocation(node.callee)) {\n\t\treturn group(contents);\n\t}\n\n\treturn contents;\n}\n\nexport function printTypeAnnotation<T extends Extract<Node, MaybeTypeAnnotationTarget<any>>>(print: print<T>, node: T) {\n\treturn node.typeAnnotation && !is_MissingNode(node.typeAnnotation) ? [\": \", print(\"typeAnnotation\")] : \"\";\n}\nexport function printAnnotatedPattern<T extends Extract<Node, MaybeTypeAnnotationTarget<any> & PatternBody>>(print: print<T>, node: T) {\n\treturn [print(\"pattern\"), printTypeAnnotation(print, node)];\n}\n\nfunction isLoneShortArgument(node: Node) {\n\tif (hasComment(node)) {\n\t\treturn false;\n\t}\n\n\tif ((is_Identifier(node) && is_short(node.name)) || (is_LiteralNumberLike(node) && !hasComment(node))) {\n\t\treturn true;\n\t}\n\n\tif (is_LiteralStringLike(node)) {\n\t\treturn is_short(node.value) && !node.value.includes(\"\\n\");\n\t}\n\n\treturn is_LiteralBooleanLike(node);\n}\n\n// prettier-ignore\nconst toLayout = [\"break-after-operator\", \"never-break-after-operator\", \"fluid\", \"break-lhs\", \"chain\", \"chain-tail\", \"chain-tail-arrow-chain\", \"only-left\"];\nconst enum Layout {\n\t\"break-after-operator\",\n\t\"never-break-after-operator\",\n\t\"fluid\",\n\t\"break-lhs\",\n\t\"chain\",\n\t\"chain-tail\",\n\t\"chain-tail-arrow-chain\",\n\t\"only-left\",\n}\n\nexport function printMemberExpression(print: print<MemberExpression>, node: MemberExpression) {\n\tconst objectDoc = print(\"expression\");\n\tconst lookupDoc = printMemberLookup(print, node);\n\n\tconst shouldInline = shouldInlineMemberExpression(node, objectDoc);\n\n\treturn label((objectDoc as any).label === \"member-chain\" ? \"member-chain\" : \"member\", [\n\t\tobjectDoc,\n\t\tshouldInline ? lookupDoc : group(indent([softline, lookupDoc])),\n\t]);\n}\n\nfunction shouldInlineMemberExpression(node: MemberExpression, objectDoc: Doc) {\n\tconst { path } = getContext();\n\tconst parent = getParentNode()!;\n\tlet i = 0;\n\tlet nmparent: Node | null = parent;\n\twhile (nmparent && (is_MemberExpression(nmparent) || is_PostfixExpression(nmparent))) {\n\t\tnmparent = path.getParentNode(i++);\n\t}\n\n\tconst shouldInline =\n\t\t(nmparent && (is_ExpressionPath(nmparent) || (is_ReassignmentNode(nmparent) && !is_Identifier(nmparent.left)))) ||\n\t\t!node.computed ||\n\t\t(is_Identifier(node.expression) && is_Identifier(node.property) && !is_MemberExpression(parent)) ||\n\t\t(is_AssignmentOrVariableDeclarator(parent) &&\n\t\t\t((is_CallExpression_or_CallLikeMacroInvocation(node.expression) && node.expression.arguments.length > 0) ||\n\t\t\t\t(is_PostfixExpression(node.expression) &&\n\t\t\t\t\tis_CallExpression_or_CallLikeMacroInvocation(node.expression.expression) &&\n\t\t\t\t\tnode.expression.expression.arguments.length > 0) ||\n\t\t\t\t(objectDoc as any).label === \"member-chain\"));\n\treturn shouldInline;\n}\n\nexport function printAssignment(leftDoc: Doc, operator: string, rightPropertyName: string) {\n\tconst assignmentNode = getNode();\n\tconst rightNode = assignmentNode[rightPropertyName];\n\n\tif (!rightNode) return group(leftDoc);\n\n\tconst layout = chooseLayout();\n\tconst rightDoc = getPrintFn(assignmentNode)(rightPropertyName as any, { assignmentLayout: layout });\n\tconst res = (function () {\n\t\tswitch (layout) {\n\t\t\tcase Layout[\"break-after-operator\"]:\n\t\t\t\treturn group([group(leftDoc), operator, group(indent([line, rightDoc]))]);\n\t\t\tcase Layout[\"never-break-after-operator\"]:\n\t\t\t\treturn group([group(leftDoc), operator, \" \", rightDoc]);\n\t\t\tcase Layout[\"fluid\"]: {\n\t\t\t\tconst groupId = Symbol(\"assignment\");\n\t\t\t\treturn group([\n\t\t\t\t\tgroup(leftDoc),\n\t\t\t\t\toperator, //\n\t\t\t\t\tgroup(indent(line), { id: groupId }),\n\t\t\t\t\tlineSuffixBoundary,\n\t\t\t\t\tindentIfBreak(rightDoc, { groupId }),\n\t\t\t\t]);\n\t\t\t}\n\t\t\tcase Layout[\"break-lhs\"]:\n\t\t\t\treturn group([leftDoc, operator, \" \", group(rightDoc)]);\n\t\t\tcase Layout[\"chain\"]:\n\t\t\t\treturn [group(leftDoc), operator, line, rightDoc];\n\t\t\tcase Layout[\"chain-tail\"]:\n\t\t\t\treturn [group(leftDoc), operator, indent([line, rightDoc])];\n\t\t\tcase Layout[\"chain-tail-arrow-chain\"]:\n\t\t\t\treturn [group(leftDoc), operator, rightDoc];\n\t\t\tdefault:\n\t\t\t\texit.never();\n\t\t}\n\t})();\n\n\treturn label(toLayout[layout], res);\n\treturn res;\n\n\tfunction chooseLayout() {\n\t\tif (\n\t\t\t(is_ReassignmentExpression(assignmentNode) && is_printing_macro()) ||\n\t\t\tis_GenericParameterDeclaration(assignmentNode) ||\n\t\t\tis_TypeCallNamedArgument(assignmentNode)\n\t\t) {\n\t\t\treturn Layout[\"never-break-after-operator\"];\n\t\t}\n\n\t\tconst isTail = !is_ReassignmentNode(rightNode);\n\t\tconst shouldUseChainFormatting = getContext().path.match(\n\t\t\tis_ReassignmentNode,\n\t\t\tis_AssignmentOrVariableDeclarator,\n\t\t\t(node: Node) => !isTail || (!is_ExpressionStatement(node) && !is_VariableDeclarationNode(node))\n\t\t);\n\n\t\tif (shouldUseChainFormatting) {\n\t\t\treturn !isTail\n\t\t\t\t? Layout[\"chain\"]\n\t\t\t\t: is_ClosureFunctionExpression(rightNode) && is_ClosureFunctionExpression(rightNode.expression)\n\t\t\t\t? Layout[\"chain-tail-arrow-chain\"]\n\t\t\t\t: Layout[\"chain-tail\"];\n\t\t}\n\n\t\tconst isHeadOfLongChain = !isTail && is_ReassignmentNode(rightNode.right);\n\t\tif (isHeadOfLongChain || hasLeadingOwnLineComment(rightNode)) {\n\t\t\treturn Layout[\"break-after-operator\"];\n\t\t}\n\n\t\tif (\n\t\t\tisComplexDestructuring(assignmentNode) ||\n\t\t\thasComplexGenerics(assignmentNode) ||\n\t\t\thasComplexTypeAnnotation(assignmentNode) ||\n\t\t\t(isArrowFunctionVariableDeclarator(assignmentNode) && canBreak(leftDoc))\n\t\t) {\n\t\t\treturn Layout[\"break-lhs\"];\n\t\t}\n\n\t\tconst hasShortKey = isObjectPropertyWithShortKey(assignmentNode, leftDoc);\n\n\t\tif (pathCall(assignmentNode, rightPropertyName as never, (rightNode) => shouldBreakAfterOperator(rightNode, hasShortKey))) {\n\t\t\treturn Layout[\"break-after-operator\"];\n\t\t}\n\n\t\tif (hasShortKey || is_Literal(rightNode)) {\n\t\t\treturn Layout[\"never-break-after-operator\"];\n\t\t}\n\n\t\treturn Layout[\"fluid\"];\n\t}\n\n\tfunction shouldBreakAfterOperator(rightNode: Node, hasShortKey: boolean) {\n\t\tif (is_MemberExpression(rightNode) && shouldInlineMemberExpression(rightNode, getPrintFn(rightNode)(\"expression\"))) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_BinaryishExpression(rightNode) && !shouldInlineLogicalExpression(rightNode)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (is_IfBlockExpression(rightNode)) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (hasShortKey) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn (function unwrap(node: Node) {\n\t\t\tif (is_UnaryExpression(node) || is_PostfixExpression(node)) {\n\t\t\t\treturn pathCall(node, \"expression\", unwrap);\n\t\t\t}\n\t\t\tif (is_LiteralStringLike(node)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn isPoorlyBreakableMemberOrCallChain(node);\n\t\t})(rightNode);\n\n\t\tfunction isPoorlyBreakableMemberOrCallChain(topNode: Node) {\n\t\t\treturn (function unwrap(node: Node): boolean {\n\t\t\t\tif (is_MemberExpression(node) || is_PostfixExpression(node) || is_UnaryExpression(node)) {\n\t\t\t\t\treturn pathCall(node, \"expression\", unwrap);\n\t\t\t\t}\n\n\t\t\t\tif (is_ExpressionPath(node)) {\n\t\t\t\t\treturn pathCall(node, \"namespace\", (namespace) => !namespace || unwrap(namespace));\n\t\t\t\t}\n\n\t\t\t\tif (is_CallExpression_or_CallLikeMacroInvocation(node)) {\n\t\t\t\t\tconst doc = printCallExpression(getPrintFn(), node);\n\t\t\t\t\tif ((doc as any).label === \"member-chain\") {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst args = node.arguments;\n\t\t\t\t\tconst isPoorlyBreakableCall = args.length === 0 || (args.length === 1 && isLoneShortArgument(args[0]));\n\t\t\t\t\tif (!isPoorlyBreakableCall) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (hasComplexTypeArguments(node)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn pathCall(node, \"callee\", unwrap);\n\t\t\t\t}\n\n\t\t\t\treturn topNode === node ? false : is_Identifier(node);\n\t\t\t})(topNode);\n\t\t}\n\t}\n}\nfunction is_MemberExpression_with_RangeOrLiteral_Property(node: Node | undefined) {\n\treturn (\n\t\t!!node && is_MemberExpression(node) && (node.computed ? is_Literal_or_SimpleRangeLiteral(node.property) : is_Literal(node.property))\n\t);\n}\nfunction is_Literal_or_SimpleRangeLiteral(node: Node) {\n\treturn is_Literal(node)\n\t\t? true\n\t\t: is_RangeLiteral(node)\n\t\t? (!node.lower || is_Literal(node.lower)) && (!node.upper || is_Literal(node.upper))\n\t\t: false;\n}\nfunction printMemberLookup(print: print<MemberExpression>, node: MemberExpression) {\n\treturn !node.computed\n\t\t? [\".\", print(\"property\")]\n\t\t: is_Literal_or_SimpleRangeLiteral(node.property)\n\t\t? [\"[\", print(\"property\"), \"]\"]\n\t\t: group([\"[\", indent([softline, print(\"property\")]), softline, \"]\"]);\n}\n\nfunction shouldPrint_CallExpression_chain(node: CallExpression) {\n\treturn is_MemberAccessLike(node.callee) || is_CallExpression_or_CallLikeMacroInvocation(node.callee);\n}\nexport function is_MemberAccessLike(node: Node): node is ExpressionPath | MemberExpression {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.ExpressionPath:\n\t\tcase NodeType.MemberExpression:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\ntype ChainItem = { node: Node; printed: Doc; needsParens: boolean };\nfunction printMemberChain(print: print<CallExpression>, node: CallExpression) {\n\tconst parent = getParentNode();\n\tconst isExpressionStatement = !parent || is_ExpressionStatement(parent);\n\tconst { printedNodes, groups } = splitCallChains(node);\n\n\tconst shouldMerge = groups.length >= 2 && !hasComment(groups[1][0].node) && shouldNotWrap(groups);\n\n\tconst printedGroups = groups.map(printGroup);\n\tconst oneLine = printedGroups;\n\n\tconst cutoff = shouldMerge ? 3 : 2;\n\n\tconst nodeHasComment =\n\t\tprintedNodes.slice(1, -1).some(({ node }) => hasComment(node, CF.Leading)) ||\n\t\tprintedNodes.slice(0, -1).some(({ node }) => hasComment(node, CF.Trailing)) ||\n\t\t(groups[cutoff] && hasComment(groups[cutoff][0].node, CF.Leading));\n\n\tif (groups.length <= cutoff && !nodeHasComment) {\n\t\treturn isLongCurriedCallExpression(node) ? oneLine : group(oneLine);\n\t}\n\n\tconst lastNodeBeforeIndent = last_of(groups[shouldMerge ? 1 : 0]).node;\n\tconst shouldHaveEmptyLineBeforeIndent =\n\t\t!is_CallExpression_or_CallLikeMacroInvocation(lastNodeBeforeIndent) && shouldInsertEmptyLineAfter(lastNodeBeforeIndent);\n\n\tconst expanded = [\n\t\tprintGroup(groups[0]),\n\t\tshouldMerge ? groups.slice(1, 2).map(printGroup) : \"\",\n\t\tshouldHaveEmptyLineBeforeIndent ? hardline : \"\",\n\t\tprintIndentedGroup(groups.slice(shouldMerge ? 2 : 1)),\n\t];\n\n\tconst callExpressions = printedNodes.map(({ node }) => node).filter(is_CallExpression_or_CallLikeMacroInvocation);\n\tconst result: Doc =\n\t\tnodeHasComment ||\n\t\t(callExpressions.length > 2 && callExpressions.some((expr) => expr.arguments.some((arg) => !isSimpleCallArgument(arg, 0)))) ||\n\t\tprintedGroups.slice(0, -1).some(willBreak) ||\n\t\tlastGroupWillBreakAndOtherCallsHaveFunctionArguments()\n\t\t\t? group(expanded)\n\t\t\t: [shouldHaveEmptyLineBeforeIndent || willBreak(oneLine) ? breakParent : \"\", conditionalGroup([oneLine, expanded])];\n\n\treturn label(\"member-chain\", result);\n\n\tfunction shouldInsertEmptyLineAfter(node: Node) {\n\t\tlet start = end(node);\n\t\tconst last = getNextNonSpaceNonCommentCharacterIndex(node);\n\t\tconst { originalText } = getContext().options;\n\t\twhile (start < last) {\n\t\t\tif (originalText.charAt(start) === \")\") {\n\t\t\t\treturn isNextLineEmptyAfterIndex(start + 1);\n\t\t\t}\n\t\t\tstart++;\n\t\t}\n\t\treturn isNextLineEmpty(node);\n\t}\n\n\tfunction isFactory(name: string) {\n\t\treturn /^[A-Z]|^[$_]+$/.test(name);\n\t}\n\tfunction isShort(name: string) {\n\t\treturn name.length <= getContext().options.tabWidth;\n\t}\n\n\tfunction shouldNotWrap(groups: ChainItem[][]) {\n\t\tconst hasComputed = groups[1].length > 0 && is_MemberExpression(groups[1][0].node) && groups[1][0].node.computed;\n\n\t\tif (groups[0].length === 1) {\n\t\t\tconst firstNode = groups[0][0].node;\n\t\t\treturn (\n\t\t\t\tis_Identifier(firstNode) && (isFactory(firstNode.name) || (isExpressionStatement && isShort(firstNode.name)) || hasComputed)\n\t\t\t);\n\t\t}\n\n\t\tconst lastNode = last_of(groups[0]).node;\n\t\tconst lastNodeLeft = is_ExpressionPath(lastNode)\n\t\t\t? lastNode.namespace\n\t\t\t: is_MemberExpression(lastNode)\n\t\t\t? lastNode.expression\n\t\t\t: undefined;\n\t\treturn lastNodeLeft && is_Identifier(lastNodeLeft) && (isFactory(lastNodeLeft.name) || hasComputed);\n\t}\n\n\tfunction printGroup(g: ChainItem[]) {\n\t\tconst printed: Doc[] = [];\n\t\tif (printedNodes[0] === g[0]) {\n\t\t\tfor (const item of printedNodes) {\n\t\t\t\tif (item.needsParens) printed.unshift(\"(\");\n\t\t\t}\n\t\t}\n\t\tfor (const item of g) {\n\t\t\tprinted.push(item.printed);\n\t\t\tif (item.needsParens) printed.push(\")\");\n\t\t}\n\t\treturn printed;\n\t}\n\n\tfunction printIndentedGroup(groups: ChainItem[][]) {\n\t\tif (groups.length === 0) return \"\";\n\t\treturn indent(group([hardline, join(hardline, groups.map(printGroup))]));\n\t}\n\n\tfunction lastGroupWillBreakAndOtherCallsHaveFunctionArguments() {\n\t\tconst lastGroupNode = last_of(last_of(groups)).node;\n\t\tconst lastGroupDoc = last_of(printedGroups);\n\t\treturn (\n\t\t\tis_CallExpression_or_CallLikeMacroInvocation(lastGroupNode) &&\n\t\t\twillBreak(lastGroupDoc) &&\n\t\t\tcallExpressions.slice(0, -1).some((node) => node.arguments.some(is_ClosureFunctionExpression))\n\t\t);\n\t}\n\n\tfunction splitCallChains(topNode: CallExpression | CallLikeMacroInvocation) {\n\t\tconst printedNodes: ChainItem[] = [\n\t\t\t{\n\t\t\t\tnode: topNode,\n\t\t\t\tneedsParens: false,\n\t\t\t\tprinted: print_CallExpression_end(print, node),\n\t\t\t},\n\t\t];\n\n\t\tpathCall(topNode, \"callee\", function READ_LEFT(node: Node) {\n\t\t\tif (is_CallExpression_or_CallLikeMacroInvocation(node) && shouldPrint_CallExpression_chain(node)) {\n\t\t\t\t__DEV__: Narrow<print<typeof node>>(print);\n\n\t\t\t\tunshift(print_CallExpression_end(print, node), shouldInsertEmptyLineAfter(node));\n\t\t\t\tpathCall(node, \"callee\", READ_LEFT);\n\t\t\t} else if (is_MemberExpression(node)) {\n\t\t\t\t__DEV__: Narrow<print<typeof node>>(print);\n\n\t\t\t\tunshift(printMemberLookup(print, node));\n\t\t\t\tpathCall(node, \"expression\", READ_LEFT);\n\t\t\t} else if (is_ExpressionPath(node)) {\n\t\t\t\t__DEV__: Narrow<print<typeof node>>(print);\n\n\t\t\t\tunshift([\"::\", print(\"segment\")]);\n\t\t\t\tif (node.namespace) {\n\t\t\t\t\tpathCall(node, \"namespace\", READ_LEFT as any);\n\t\t\t\t}\n\t\t\t} else if (is_PostfixExpression(node)) {\n\t\t\t\tunshift(is_UnwrapExpression(node) ? \"?\" : \".await\");\n\t\t\t\tpathCall(node, \"expression\", READ_LEFT);\n\t\t\t} else {\n\t\t\t\tprintedNodes.unshift({ node, needsParens: false, printed: print() });\n\t\t\t}\n\n\t\t\tfunction unshift(printed: Doc, needsHardlineAfter = false) {\n\t\t\t\tprintedNodes.unshift({\n\t\t\t\t\tnode,\n\t\t\t\t\tneedsParens: is_MemberAccessLike(node) && needsParens(node),\n\t\t\t\t\tprinted: [withComments(node, printed), needsHardlineAfter ? hardline : \"\"],\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\tconst groups = spread(function* () {\n\t\t\tlet i = 0;\n\t\t\tlet currentItem = printedNodes[i];\n\n\t\t\tfunction testNextItem(fn: (item: ChainItem) => boolean) {\n\t\t\t\treturn i + 1 < printedNodes.length && fn(printedNodes[i + 1]);\n\t\t\t}\n\n\t\t\tfunction readGroup(fn: () => Iterable<ChainItem>) {\n\t\t\t\t__DEV__: assert(i < printedNodes.length);\n\t\t\t\treturn spread(function* () {\n\t\t\t\t\tfor (var _item of fn()) {\n\t\t\t\t\t\tyield currentItem;\n\t\t\t\t\t\tif (++i < printedNodes.length) currentItem = printedNodes[i];\n\t\t\t\t\t\telse break;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tfunction* loop(condition: (item: ChainItem) => boolean) {\n\t\t\t\twhile (condition(currentItem)) yield currentItem;\n\t\t\t}\n\t\t\tfunction* until(condition: (item: ChainItem) => boolean) {\n\t\t\t\twhile (!condition(currentItem)) yield currentItem;\n\t\t\t}\n\n\t\t\tyield readGroup(function* () {\n\t\t\t\tconst isCallExpression = is_CallExpression_or_CallLikeMacroInvocation(currentItem.node);\n\n\t\t\t\tyield currentItem;\n\t\t\t\tyield* loop(\n\t\t\t\t\t({ node, needsParens }) =>\n\t\t\t\t\t\tis_PostfixExpression(node) ||\n\t\t\t\t\t\tis_CallExpression_or_CallLikeMacroInvocation(node) ||\n\t\t\t\t\t\tis_MemberExpression_with_RangeOrLiteral_Property(node) ||\n\t\t\t\t\t\tneedsParens\n\t\t\t\t);\n\n\t\t\t\tif (!isCallExpression) {\n\t\t\t\t\tyield* loop(\n\t\t\t\t\t\t({ node, needsParens }) =>\n\t\t\t\t\t\t\tis_MemberAccessLike(node) && //\n\t\t\t\t\t\t\ttestNextItem(({ node }) => is_MemberAccessLike(node))\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\n\t\t\twhile (i < printedNodes.length) {\n\t\t\t\tyield readGroup(function* () {\n\t\t\t\t\tlet isCallExpression = false;\n\n\t\t\t\t\tyield* until(\n\t\t\t\t\t\t({ node }) =>\n\t\t\t\t\t\t\t(isCallExpression = is_CallExpression_or_CallLikeMacroInvocation(node)) || //\n\t\t\t\t\t\t\thasComment(node, CF.Trailing)\n\t\t\t\t\t);\n\t\t\t\t\tyield currentItem;\n\n\t\t\t\t\tif (isCallExpression) {\n\t\t\t\t\t\tyield* loop(({ node }) => is_MemberExpression_with_RangeOrLiteral_Property(node));\n\t\t\t\t\t\tyield* until(\n\t\t\t\t\t\t\t({ node }) =>\n\t\t\t\t\t\t\t\tis_MemberAccessLike(node) || //\n\t\t\t\t\t\t\t\thasComment(node, CF.Trailing)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn { printedNodes, groups };\n\t}\n}\n\nfunction isSimpleCallArgument(node: Node, depth: number) {\n\tif (depth >= 2) return false;\n\n\tif (is_IdentifierOrIndex(node)) {\n\t\treturn true;\n\t}\n\n\tif (is_Literal(node)) {\n\t\treturn !is_LiteralStringLike(node) || !node.value.includes(\"\\n\");\n\t}\n\n\tif (is_ArrayOrTupleLiteral(node)) {\n\t\treturn node.items.every(isChildSimple);\n\t}\n\n\tif (is_StructLiteral(node)) {\n\t\treturn (\n\t\t\tisSimpleCallArgument(node.struct, depth) &&\n\t\t\tnode.properties.every((prop) =>\n\t\t\t\tis_StructLiteralPropertySpread(prop)\n\t\t\t\t\t? isChildSimple(prop.expression)\n\t\t\t\t\t: is_StructLiteralProperty(prop)\n\t\t\t\t\t? isChildSimple(prop.value)\n\t\t\t\t\t: true\n\t\t\t)\n\t\t);\n\t}\n\n\tif (is_CallExpression_or_CallLikeMacroInvocation(node)) {\n\t\treturn (\n\t\t\tisSimpleCallArgument(node.callee, depth) &&\n\t\t\t(node.typeArguments ?? []).every(isChildSimple) &&\n\t\t\tnode.arguments.every(isChildSimple)\n\t\t);\n\t}\n\n\tif (is_MemberExpression(node)) {\n\t\treturn isSimpleCallArgument(node.expression, depth) && isSimpleCallArgument(node.property, depth);\n\t}\n\n\tif (is_ExpressionTypeCast(node)) {\n\t\treturn isSimpleCallArgument(node.typeCallee, depth) && node.typeArguments.every(isChildSimple);\n\t}\n\n\tif (is_ExpressionPath(node)) {\n\t\tconst namespace = node.namespace;\n\t\treturn !namespace || isSimpleCallArgument(namespace, depth);\n\t}\n\n\tif (is_UnaryExpression(node) || is_PostfixExpression(node)) {\n\t\treturn isSimpleCallArgument(node.expression, depth);\n\t}\n\n\treturn false;\n\n\tfunction isChildSimple(child: Node) {\n\t\treturn isSimpleCallArgument(child, depth + 1);\n\t}\n}\nfunction isLongCurriedCallExpression(node: Node) {\n\tconst parent = getParentNode(node)!;\n\treturn (\n\t\tis_CallExpression_or_CallLikeMacroInvocation(node) &&\n\t\tis_CallExpression_or_CallLikeMacroInvocation(parent) &&\n\t\tparent.callee === node &&\n\t\tnode.arguments.length > parent.arguments.length &&\n\t\tparent.arguments.length > 0\n\t);\n}\n\nexport function printTypeArguments<T extends Extract<Node, MaybeGenericArgsTarget>>(print: print<T>, node: T) {\n\treturn !node.typeArguments\n\t\t? \"\"\n\t\t: node.typeArguments.length === 0\n\t\t? [\"<\", printDanglingCommentsForInline(node, DCM[\"typeArguments\"]), \">\"]\n\t\t: hasComplexTypeArguments(node)\n\t\t? group(\n\t\t\t\t[\n\t\t\t\t\t\"<\", //\n\t\t\t\t\tindent([softline, print.join(\"typeArguments\", [\",\", line])]),\n\t\t\t\t\tsoftline,\n\t\t\t\t\t\">\",\n\t\t\t\t],\n\t\t\t\t{ id: getTypeParametersGroupId(node) }\n\t\t  )\n\t\t: [\"<\", print.join(\"typeArguments\", \", \"), \">\"];\n}\n\nexport function printLtParameters<T extends Extract<Node, ForLtParametersBody>>(print: print<T>, node: T) {\n\treturn !node.ltParameters\n\t\t? \"\"\n\t\t: node.ltParameters.length === 0\n\t\t? [\"for<\", printDanglingCommentsForInline(node, DCM[\"ltParameters\"]), \"> \"]\n\t\t: hasComplexLtParameters(node)\n\t\t? group(\n\t\t\t\t[\n\t\t\t\t\t\"for<\", //\n\t\t\t\t\tindent([softline, print.join(\"ltParameters\", [\",\", line])]),\n\t\t\t\t\tsoftline,\n\t\t\t\t\t\"> \",\n\t\t\t\t],\n\t\t\t\t{ id: getTypeParametersGroupId(node) }\n\t\t  )\n\t\t: [\"for<\", print.join(\"ltParameters\", \", \"), \"> \"];\n}\n\nexport function printGenerics<T extends DeclarationNode>(print: print<T>, node: T) {\n\treturn group(\n\t\t!node.generics\n\t\t\t? \"\"\n\t\t\t: hasComplexGenerics(node)\n\t\t\t? [\n\t\t\t\t\t\"<\",\n\t\t\t\t\tindent([softline, print.join(\"generics\", [\",\", line])]), //\n\t\t\t\t\thasMultipleHeritage(node) ? indent([softline, \">\"]) : [softline, \">\"],\n\t\t\t  ]\n\t\t\t: [\n\t\t\t\t\t\"<\",\n\t\t\t\t\tprint.join(\"generics\", \", \"), //\n\t\t\t\t\tprintDanglingCommentsForInline(node, DCM[\"generics\"]),\n\t\t\t\t\t\">\",\n\t\t\t  ]\n\t);\n}\nfunction getPrintedTypeBounds<T extends Extract<Node, TypeBoundsConstaint>>(print: print<T>, node: T) {\n\tif (!hasTypeBounds(node) || node.typeBounds.length === 0) return \"\";\n\tif (node.typeBounds.length === 1) return print.map(\"typeBounds\");\n\t// let shouldIndent = false;\n\t// const printed = print.map(\"typeBounds\", (bound, i, arr) =>\n\t// \t0 === i\n\t// \t\t? print()\n\t// \t\t: true //isSimpleTypeBound(arr[i - 1]) && isSimpleTypeBound(bound)\n\t// \t\t? indent([\" +\", line, print()])\n\t// \t\t: [\" + \", (shouldIndent ||= isSimpleTypeBound(arr[i - 1]) || isSimpleTypeBound(bound)) ? indent(print()) : print()]\n\t// );\n\tconst printed = print.join(\"typeBounds\", (_, __, prev) => (!prev ? \" +\" : [\" +\", line]));\n\treturn [printed.shift()!, indent([line, printed])];\n}\nexport function printTypeBounds<T extends Extract<Node, TypeBoundsConstaint>>(operator: \"dyn\" | \"impl\" | \":\", print: print<T>, node: T) {\n\tif (!hasTypeBounds(node)) return \"\";\n\tconst printed = getPrintedTypeBounds(print, node);\n\treturn printed ? group([operator, \" \", printed]) : operator;\n\n\treturn !node.typeBounds\n\t\t? \"\"\n\t\t: hasComplexTypeBounds(node)\n\t\t? group(indent([ifBreak(line), operator, \" \", join([line, \"+ \"], print.map(\"typeBounds\"))]))\n\t\t: [operator, \" \", join(\" + \", print.map(\"typeBounds\"))];\n}\n\nexport function printLtBounds<T extends Extract<Node, MaybeHasLtBounds>>(left: Doc, print: print<T>, node: T) {\n\treturn group(\n\t\t!node.ltBounds\n\t\t\t? \"\"\n\t\t\t: node.ltBounds.length === 0\n\t\t\t? [left, \" \"]\n\t\t\t: [left, \" \", print.map(\"ltBounds\", (typeBound, i) => (i === 0 ? print() : indent([line, \"+ \", print()])))]\n\t);\n}\n\nfunction printWhereBounds<T extends DeclarationNode>(print: print<T>, node: T) {\n\tif (!node.whereBounds || node.whereBounds.length === 0) return \"\";\n\treturn adjustDeclarationClause(\n\t\tnode, //\n\t\t\"where\",\n\t\tprint.join(\"whereBounds\", [\",\", line])\n\t);\n}\nexport function printDeclarationTypeBounds<T extends Extract<DeclarationNode, TypeBoundsConstaint>>(\n\tprint: print<T>,\n\tnode: T,\n\toperator: \":\" | \" =\"\n) {\n\treturn hasTypeBounds(node) ? adjustDeclarationClause(node, operator, getPrintedTypeBounds(print, node)) : \"\";\n}\nexport function printImplTraitForType(\n\tprint: print<ImplDeclaration | NegativeImplDeclaration>,\n\tnode: ImplDeclaration | NegativeImplDeclaration\n) {\n\treturn node.trait\n\t\t? [print(\"trait\"), adjustDeclarationClause(node, \"for\", print(\"typeTarget\"))] //\n\t\t: print(\"typeTarget\");\n}\n\nfunction adjustDeclarationClause(node: DeclarationNode, clause: \":\" | \" =\" | \"for\" | \"->\" | \"where\", content: Doc) {\n\tconst isTypeBoundsClause = clause === \":\" || clause === \" =\";\n\treturn (clause === \"where\" || hasMultipleHeritage(node) ? indent : Identity)([\n\t\tclause === \"->\"\n\t\t\t? hasMultipleHeritage(node) && node.whereBounds!.length > 1\n\t\t\t\t? line\n\t\t\t\t: \" \"\n\t\t\t: clause === \"where\" //\n\t\t\t? line\n\t\t\t: isTypeBoundsClause\n\t\t\t? hasMultipleHeritage(node)\n\t\t\t\t? softline\n\t\t\t\t: \"\"\n\t\t\t: line,\n\t\tclause,\n\t\tcontent &&\n\t\t\tgroup(\n\t\t\t\tclause === \"where\"\n\t\t\t\t\t? indent([line, content]) //\n\t\t\t\t\t: clause === \"->\" || isTypeBoundsClause\n\t\t\t\t\t? [\" \", content]\n\t\t\t\t\t: [line, content]\n\t\t\t),\n\t]);\n}\nfunction hasNonWhereHeritageClause(node: DeclarationNode) {\n\tAssertTypesEq<\n\t\tDeclarationNode,\n\t\t| FunctionDeclaration\n\t\t| StructDeclaration\n\t\t| TupleStructDeclaration\n\t\t| UnionDeclaration\n\t\t| TypeAliasDeclaration\n\t\t| TraitDeclaration\n\t\t| TraitAliasDeclaration\n\t\t| NegativeImplDeclaration\n\t\t| ImplDeclaration\n\t\t| EnumDeclaration\n\t>();\n\tswitch (node.nodeType) {\n\t\tcase NodeType.FunctionDeclaration:\n\t\t\treturn !!node.returnType;\n\t\tcase NodeType.StructDeclaration:\n\t\tcase NodeType.TupleStructDeclaration:\n\t\tcase NodeType.UnionDeclaration:\n\t\tcase NodeType.EnumDeclaration:\n\t\t\treturn false;\n\t\tcase NodeType.TypeAliasDeclaration:\n\t\tcase NodeType.TraitDeclaration:\n\t\tcase NodeType.TraitAliasDeclaration:\n\t\t\t// case NodeType.AutoTraitDeclaration:\n\t\t\treturn hasTypeBounds(node);\n\t\tcase NodeType.ImplDeclaration:\n\t\tcase NodeType.NegativeImplDeclaration:\n\t\t\treturn !!node.trait;\n\t\tdefault:\n\t\t\t__DEV__: exit.never(node);\n\t}\n}\nfunction hasAnyHeritageClause(node: DeclarationNode) {\n\treturn !!node.whereBounds || hasNonWhereHeritageClause(node);\n}\n\nfunction hasMultipleHeritage(node: DeclarationNode) {\n\treturn !!node.whereBounds && hasNonWhereHeritageClause(node);\n}\n\nconst getMacroGroupId = createGroupIdMapper(\"MacroGroup\");\nconst getHeritageGroupId = createGroupIdMapper(\"heritageGroup\");\nconst getWhereBoundsGroupId = createGroupIdMapper(\"where\");\nconst getTypeParametersGroupId = createGroupIdMapper(\"typeParameters\");\nfunction createGroupIdMapper(description: string) {\n\tconst groupIds = new WeakMap<Node, symbol>();\n\treturn (node: Node) => Map_get(groupIds, node, () => Symbol(description));\n}\n\nexport function printDanglingCommentsForInline(node: Node, marker?: DCM) {\n\tconst hasOnlyBlockComments =\n\t\t!hasComment(node, CF.Line | CF.Dangling, (comment) => !marker || comment.marker === marker) || is_Program(node);\n\tconst printed = printDanglingComments(node, hasOnlyBlockComments, marker);\n\treturn (\n\t\tprinted &&\n\t\t(hasOnlyBlockComments && !is_Program(node)\n\t\t\t? willBreak(printed)\n\t\t\t\t? [indent([hardline, printed]), hardline]\n\t\t\t\t: [printed]\n\t\t\t: [printed, hardline])\n\t);\n}\n\nfunction isFormatLikeCall(node: CallExpression | CallLikeMacroInvocation) {\n\tif (is_Identifier(node.callee) && !node.typeArguments) {\n\t\tconst [first, ...rest] = node.arguments;\n\t\tif (is_Literal(first) && is_LiteralStringLike(first) && first.value.includes(\"{}\") && rest.every(is_Identifier)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nclass ArgExpansionBailout extends Error {}\n\nexport function printCallArguments<T extends CallExpression | CallLikeMacroInvocation>(print: print<T>, node: T) {\n\tconst args = node.arguments;\n\tconst { left: LEFT, right: RIGHT } = getDelimChars(args);\n\n\t__DEV__: {\n\t\t// assert(args.length === 0 || !hasComment(node, CF.Dangling), \"\", node);\n\t\tif (is_MacroInvocation(node)) assert(args.every(is_ExpressionNode), \"\", node);\n\t}\n\n\tif (args.length === 0) return [LEFT, printDanglingCommentsForInline(node, DCM[\"arguments\"]), RIGHT];\n\n\t// force inline format!(\" {} \", ident)\n\tif (args.length === 2 && isFormatLikeCall(node)) {\n\t\treturn [LEFT, print([\"arguments\", 0]), \", \", print([\"arguments\", 1]), RIGHT];\n\t}\n\n\tlet anyArgEmptyLine = false;\n\tlet hasEmptyLineFollowingFirstArg = false;\n\tconst lastArgIndex = args.length - 1;\n\tconst trailingComma = false ? \",\" : \"\";\n\tconst printedArguments = print.map(\"arguments\", (arg, index, arr) => {\n\t\tif (index === lastArgIndex) {\n\t\t\treturn [print()];\n\t\t} else if (isNextLineEmpty(arg)) {\n\t\t\tif (index === 0) hasEmptyLineFollowingFirstArg = true;\n\t\t\tanyArgEmptyLine = true;\n\t\t\treturn [print(), \",\", hardline, hardline];\n\t\t} else {\n\t\t\treturn [print(), \",\", line];\n\t\t}\n\t});\n\n\tif (anyArgEmptyLine || isFunctionCompositionArgs(args)) {\n\t\treturn allArgsBrokenOut();\n\t}\n\n\tconst shouldGroupFirst = shouldGroupFirstArg(args);\n\tconst shouldGroupLast = shouldGroupLastArg(args);\n\tif (shouldGroupFirst || shouldGroupLast) {\n\t\tif (shouldGroupFirst ? printedArguments.slice(1).some(willBreak) : printedArguments.slice(0, -1).some(willBreak)) {\n\t\t\treturn allArgsBrokenOut();\n\t\t}\n\t\tlet printedExpanded: Doc[] = [];\n\t\tconst { path } = getContext();\n\t\tconst stackBackup = [...path.stack];\n\t\ttry {\n\t\t\tpath_try(() => {\n\t\t\t\tgetContext().path.each((p, i) => {\n\t\t\t\t\tif (shouldGroupFirst && i === 0) {\n\t\t\t\t\t\tprintedExpanded = [\n\t\t\t\t\t\t\t[\n\t\t\t\t\t\t\t\tprint([], { expandFirstArg: true }),\n\t\t\t\t\t\t\t\tprintedArguments.length > 1 ? \",\" : \"\",\n\t\t\t\t\t\t\t\thasEmptyLineFollowingFirstArg ? hardline : line,\n\t\t\t\t\t\t\t\thasEmptyLineFollowingFirstArg ? hardline : \"\",\n\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t...printedArguments.slice(1),\n\t\t\t\t\t\t];\n\t\t\t\t\t}\n\t\t\t\t\tif (shouldGroupLast && i === lastArgIndex) {\n\t\t\t\t\t\tprintedExpanded = [...printedArguments.slice(0, -1), print([], { expandLastArg: true })];\n\t\t\t\t\t}\n\t\t\t\t}, \"arguments\");\n\t\t\t});\n\t\t} catch (caught) {\n\t\t\tpath.stack.length = 0;\n\t\t\tpath.stack.push(...stackBackup);\n\t\t\tif (caught instanceof ArgExpansionBailout) return allArgsBrokenOut();\n\t\t\tthrow caught;\n\t\t}\n\n\t\treturn [\n\t\t\tprintedArguments.some(willBreak) ? breakParent : \"\",\n\t\t\tconditionalGroup([\n\t\t\t\t[LEFT, ...printedExpanded, RIGHT],\n\t\t\t\tshouldGroupFirst\n\t\t\t\t\t? [LEFT, group(printedExpanded[0], { shouldBreak: true }), ...printedExpanded.slice(1), RIGHT]\n\t\t\t\t\t: [LEFT, ...printedArguments.slice(0, -1), group(printedExpanded[lastArgIndex], { shouldBreak: true }), RIGHT],\n\t\t\t\tallArgsBrokenOut(),\n\t\t\t]),\n\t\t];\n\t}\n\n\tconst contents = [LEFT, indent([softline, ...printedArguments]), ifBreak(trailingComma), softline, RIGHT];\n\n\treturn isLongCurriedCallExpression(node)\n\t\t? contents\n\t\t: group(contents, { shouldBreak: anyArgEmptyLine || printedArguments.some(willBreak) });\n\n\tfunction allArgsBrokenOut() {\n\t\treturn group([LEFT, indent([line, ...printedArguments]), trailingComma, line, RIGHT], { shouldBreak: true });\n\t}\n}\n\nfunction shouldHugFunctionParameters(node: Extract<Node, FunctionLike>) {\n\tif (!node) return false;\n\tconst parameters = getParameters(node);\n\tif (parameters.length !== 1) return false;\n\tconst param = parameters[0];\n\tif (hasComment(param)) return false;\n\tswitch (param.nodeType) {\n\t\tcase NodeType.FunctionSelfParameterDeclaration:\n\t\tcase NodeType.FunctionSpread:\n\t\tcase NodeType.TypeFnPointerParameter:\n\t\tdefault:\n\t\t\treturn false;\n\t\tcase NodeType.FunctionParameterDeclaration:\n\t\tcase NodeType.ClosureFunctionParameterDeclaration:\n\t\t\treturn \"items\" in param.pattern || \"properties\" in param.pattern;\n\t}\n}\n\nfunction shouldGroupFunctionParameters(functionNode: FunctionDeclaration, returnTypeDoc: Doc) {\n\tconst returnType = functionNode.returnType;\n\tconst generics = functionNode.generics;\n\tconst whereBounds = functionNode.whereBounds;\n\tif (!returnType) return false;\n\tif (generics) {\n\t\tif (generics.length > 1) return false;\n\t\tif (generics.length === 1 && !isShortGenericParameterDeclaration(generics[0])) return false;\n\t}\n\tif (whereBounds) {\n\t\tif (whereBounds.length > 1) return false;\n\t}\n\treturn (\n\t\tgetParameters(functionNode).length === 1 &&\n\t\t(willBreak(returnTypeDoc) || willBreak(printWhereBounds(getPrintFn(functionNode), functionNode)))\n\t);\n}\n\nexport function printBlockBody<T extends NodeWithBodyOrCases | BlockLikeMacroInvocation>(print: print<T>, node: T): Doc {\n\tconst body = printBodyOrCases(print, node);\n\treturn [\n\t\t\"{\",\n\t\tbody.length > 0\n\t\t\t? getBodyOrCases(node)?.length\n\t\t\t\t? canInlineBlockBody(node)\n\t\t\t\t\t? [indent([line, body]), line]\n\t\t\t\t\t: group([indent([line, body]), line], { shouldBreak: true })\n\t\t\t\t: body\n\t\t\t: emptyContent(node),\n\t\t\"}\",\n\t];\n}\n\nexport function printMaybeBlockBody<T extends (NodeWithBodyOrCases | BlockLikeMacroInvocation) & { body: undefined | {} }>(\n\tprint: print<T>,\n\tnode: T\n): Doc {\n\treturn hasSemiNoBody(node) ? \";\" : adjustClause(node, printBlockBody(print, node));\n}\n\nexport function printArrowFunction<T extends ClosureFunctionExpression>(print: print<T>, node: T) {\n\tconst signatures: Doc[] = [];\n\tconst body: Doc[] = [];\n\tconst { args, path } = getContext();\n\tlet chainShouldBreak = false;\n\n\tlet tailNode: ClosureFunctionExpression = node;\n\t(function rec(node: ClosureFunctionExpression) {\n\t\ttailNode = node;\n\t\tconst doc = printArrowFunctionSignature(print, node);\n\t\tif (signatures.length === 0) {\n\t\t\tsignatures.push(doc);\n\t\t} else {\n\t\t\tconst { leading, trailing } = printCommentsSeparately();\n\t\t\tsignatures.push([leading!, doc]);\n\t\t\tbody.unshift(trailing!);\n\t\t}\n\n\t\tchainShouldBreak ||= !!node.returnType || !node.parameters.every((param) => isSimplePattern(param.pattern));\n\n\t\tif (!is_ClosureFunctionExpression(node.expression) || (args && args.expandLastArg)) {\n\t\t\tbody.unshift(print(\"expression\", args));\n\t\t} else {\n\t\t\tpathCall(node, \"expression\", rec);\n\t\t}\n\t})(node);\n\n\tif (signatures.length > 1) {\n\t\treturn printArrowChain(signatures, chainShouldBreak, body, tailNode);\n\t} else {\n\t\tconst printed = signatures[0];\n\n\t\tif (\n\t\t\t!hasLeadingOwnLineComment(node.expression) &&\n\t\t\t(is_ArrayOrTupleLiteral(node.expression) ||\n\t\t\t\tis_StructLiteral(node.expression) ||\n\t\t\t\tis_ExpressionWithBodyOrCases(node.expression) ||\n\t\t\t\tis_ClosureFunctionExpression(node.expression))\n\t\t) {\n\t\t\treturn group([printed, \" \", body]);\n\t\t}\n\n\t\tconst shouldAddSoftLine = args && args.expandLastArg && !hasComment(node);\n\t\tconst printTrailingComma = args && args.expandLastArg && false;\n\t\tconst shouldAddParens = is_OrExpression(node.expression);\n\n\t\treturn group([\n\t\t\tprinted,\n\t\t\tgroup([\n\t\t\t\tindent(shouldAddParens ? [line, ifBreak(\"\", \"(\"), body, ifBreak(\"\", \")\")] : [line, body]),\n\t\t\t\tshouldAddSoftLine ? [ifBreak(printTrailingComma ? \",\" : \"\"), softline] : \"\",\n\t\t\t]),\n\t\t]);\n\t}\n}\n\nfunction printArrowChain(signatures: Doc[], shouldBreak: boolean, bodyDoc: Doc, tailNode: ClosureFunctionExpression) {\n\tconst { args } = getContext();\n\tconst parent = getParentNode()!;\n\tconst isCallee = is_CallExpression_or_CallLikeMacroInvocation(parent) && parent.callee === getNode();\n\tconst isAssignmentRhs = !!(args && args.assignmentLayout);\n\tconst shouldPutBodyOnSeparateLine = !is_ExpressionWithBodyOrCases(tailNode.expression) && !is_StructLiteral(tailNode.expression);\n\tconst shouldBreakBeforeChain =\n\t\t(isCallee && shouldPutBodyOnSeparateLine) || (args && args.assignmentLayout === Layout[\"chain-tail-arrow-chain\"]);\n\n\tconst groupId = Symbol(\"arrow-chain\");\n\n\treturn group([\n\t\tgroup(\n\t\t\tindent([isCallee || isAssignmentRhs ? softline : \"\", group(join(line, signatures), { shouldBreak })]), //\n\t\t\t{ id: groupId, shouldBreak: shouldBreakBeforeChain }\n\t\t),\n\t\tindentIfBreak(shouldPutBodyOnSeparateLine ? indent([line, bodyDoc]) : [\" \", bodyDoc], { groupId }),\n\t\tisCallee ? ifBreak(softline, \"\", { groupId }) : \"\",\n\t]);\n}\n\nfunction printArrowFunctionSignature<T extends ClosureFunctionExpression>(print: print<T>, node: T) {\n\tconst { args } = getContext();\n\tconst expandArg = args && (args.expandLastArg || args.expandFirstArg);\n\tlet returnTypeDoc: Doc = printReturnType(print, node);\n\tif (expandArg) {\n\t\tif (willBreak(returnTypeDoc)) throw new ArgExpansionBailout();\n\t\telse returnTypeDoc = group(removeLines(returnTypeDoc));\n\t}\n\t// const dangling = printDanglingComments(node, true, (comment) => node.parameters.loc.contains(comment));\n\n\t// if (dangling) {\n\t// \tparts.push(\" \", dangling);\n\t// }\n\treturn [\n\t\tprint.b(\"static\"),\n\t\tprint.b(\"async\"),\n\t\tprint.b(\"move\"), //\n\t\tgroup([printFunctionParameters(print, node, expandArg), returnTypeDoc]),\n\t];\n}\n\nexport function printGenerics_x_whereBounds<T extends DeclarationNode>(print: print<T>, node: T, xDoc: Doc) {\n\tconst generics: Doc = is_ImplDeclarationNode(node)\n\t\t? [printGenerics(print, node), \" \"]\n\t\t: [\" \", print(\"id\" as any), printGenerics(print, node)];\n\n\tconst whereBoundsDoc = printWhereBounds(print, node);\n\n\treturn is_TupleStructDeclaration(node)\n\t\t? [...generics, xDoc, group(whereBoundsDoc, { id: getHeritageGroupId(node) })]\n\t\t: [...generics, group([xDoc, whereBoundsDoc], { id: getHeritageGroupId(node) })];\n}\n\nexport function adjustClause(\n\tnode: DeclarationNode | ((NodeWithBodyOrCases | BlockLikeMacroInvocation) & { body: undefined | {} }),\n\tdoc: Doc\n) {\n\treturn [\n\t\t\"whereBounds\" in node && (!!node.whereBounds || (hasTypeBounds(node) && node.typeBounds.length > 1)) && willBreak(doc)\n\t\t\t? ifBreak(hardline, \" \", { groupId: getHeritageGroupId(node) })\n\t\t\t: \" \",\n\t\tdoc,\n\t];\n}\n\nexport function printParametersAndReturnType(node: FunctionNode | TypeFunctionNode) {\n\tconst parametersDoc = printFunctionParameters(getPrintFn(node), node);\n\tconst returnTypeDoc = printReturnType(getPrintFn(node), node);\n\treturn is_FunctionDeclaration(node) && shouldGroupFunctionParameters(node, returnTypeDoc)\n\t\t? group([group(parametersDoc), returnTypeDoc])\n\t\t: group([parametersDoc, returnTypeDoc]);\n}\n\nexport function printFlowControlExpression<T extends ReturnExpression | BreakExpression | YieldExpression>(print: print<T>, node: T) {\n\treturn !node.expression\n\t\t? \"\"\n\t\t: // : hasLeadingComment(node.expression)\n\t\t// ? [\" (\", indent([hardline, print(\"expression\")]), hardline, \")\"]\n\t\tis_BinaryishExpression(node.expression) && !flowControlExpressionNeedsOuterParens(node)\n\t\t? group([\" \", ifBreak(\"(\"), indent([softline, print(\"expression\")]), softline, ifBreak(\")\")])\n\t\t: [\" \", print(\"expression\")];\n\n\tfunction hasLeadingComment(node: Node) {\n\t\tif (hasLeadingOwnLineComment(node)) return true;\n\t\tif (hasNakedLeftSide(node)) {\n\t\t\tlet leftMost = node;\n\t\t\twhile ((leftMost = getLeftSide(leftMost))) {\n\t\t\t\tif (hasLeadingOwnLineComment(leftMost)) return true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}\n}\nexport function flowControlExpressionNeedsOuterParens(flow: ReturnExpression | BreakExpression | YieldExpression) {\n\treturn (\n\t\tflow.expression &&\n\t\t(function hasLeadingComment(node: Node) {\n\t\t\tif (hasLeadingOwnLineComment(node)) return true;\n\t\t\tif (hasNakedLeftSide(node)) {\n\t\t\t\tlet leftMost = node;\n\t\t\t\twhile ((leftMost = getLeftSide(leftMost))) {\n\t\t\t\t\tif (hasLeadingOwnLineComment(leftMost)) return true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t})(flow.expression)\n\t);\n}\nfunction getLeftSide(node, includeAttributes = false) {\n\tlet target: Node =\n\t\t(node as LeftRightExpression).left ??\n\t\t(node as CallExpression).callee ??\n\t\t(node as PathNode).namespace ??\n\t\t(node as ExpressionWithBody).label ??\n\t\t(node as RangeNode).lower ??\n\t\t(node as StructLiteral).struct ??\n\t\t(node as NodeWithCondition).condition ??\n\t\t(node as ExpressionBody).expression;\n\tif (target && includeAttributes && hasAttributes(node)) {\n\t\t(node.attributes as AttributeOrDocComment[]).forEach((attr) => {\n\t\t\tif (start(attr) < start(target)) target = attr;\n\t\t});\n\t}\n\treturn target;\n}\nfunction hasNakedLeftSide(node: Node) {\n\treturn (\n\t\tis_BinaryishExpression(node) ||\n\t\tis_ReassignmentNode(node) ||\n\t\tis_CallExpression_or_CallLikeMacroInvocation(node) ||\n\t\tis_MemberAccessLike(node) ||\n\t\tis_PostfixExpression(node) ||\n\t\tis_ExpressionAsTypeCast(node)\n\t);\n}\n\nexport function printReturnType<T extends Extract<Node, MaybeReturnTypeConstraint>>(print: print<T>, node: T) {\n\treturn node.returnType\n\t\t? is_FunctionDeclaration(node)\n\t\t\t? adjustDeclarationClause(node, \"->\", print(\"returnType\"))\n\t\t\t: [\" -> \", print(\"returnType\")]\n\t\t: \"\";\n}\n\nfunction printFunctionParameters<T extends FunctionNode | TypeFunctionNode>(\n\tprint: print<T>,\n\tnode: T,\n\texpandArg = false,\n\tprintTypeParams = false\n) {\n\tconst { left: leftDelim, right: rightDelim } = getDelimChars(node.parameters);\n\tconst generics = printTypeParams && is_FunctionDeclaration(node) ? printGenerics(print as any, node) : \"\";\n\n\tif (!hasParameters(node)) {\n\t\treturn [\n\t\t\tgenerics, //\n\t\t\tleftDelim,\n\t\t\tprintDanglingCommentsForInline(node, DCM[\"parameters\"]),\n\t\t\trightDelim,\n\t\t];\n\t}\n\n\tconst isParametersInTestCall = false;\n\tconst shouldHugParameters = shouldHugFunctionParameters(node);\n\tconst printed = print.join(\"parameters\", sepFn);\n\tif (hasSelfParameter(node)) {\n\t\tprinted.unshift(getContext().path.call(() => [print(), printed.length ? sepFn(node.parameters.self) : \"\"], \"parameters\", \"self\"));\n\t}\n\n\tif (expandArg) {\n\t\tif (willBreak(generics) || willBreak(printed)) throw new ArgExpansionBailout();\n\t\treturn group([removeLines(generics), leftDelim, removeLines(printed), rightDelim]);\n\t} else if (shouldHugParameters || isParametersInTestCall) {\n\t\treturn [generics, leftDelim, ...printed, rightDelim];\n\t} else {\n\t\treturn [generics, leftDelim, indent([softline, ...printed]), softline, rightDelim];\n\t}\n\tfunction sepFn(param: Node) {\n\t\treturn shouldHugParameters || isParametersInTestCall //\n\t\t\t? \", \"\n\t\t\t: isNextLineEmpty(param)\n\t\t\t? [\",\", hardline, hardline]\n\t\t\t: [\",\", line];\n\t}\n}\n\nfunction path_try<T>(callback: () => T): T {\n\tconst { stack } = getContext().path;\n\tconst stackBackup = [...stack];\n\ttry {\n\t\treturn callback();\n\t} finally {\n\t\tstack.length = 0;\n\t\tstack.push(...stackBackup);\n\t}\n}\nfunction shouldGroupFirstArg(args: LocArray<ExpressionNode>): boolean {\n\tif (args.length !== 2) return false;\n\tconst [firstArg, secondArg] = args;\n\treturn (\n\t\t!hasComment(firstArg) &&\n\t\tis_ClosureFunctionExpression(firstArg) &&\n\t\tis_ExpressionWithBodyOrCases(firstArg.expression) &&\n\t\t!is_ClosureFunctionExpression(secondArg) &&\n\t\t!couldGroupArg(secondArg)\n\t);\n}\nfunction shouldGroupLastArg(args: LocArray<ExpressionNode>): boolean {\n\tconst lastArg = last_of(args);\n\tconst preLastArg = args[args.length - 2];\n\treturn (\n\t\t!hasComment(lastArg, CF.Leading) &&\n\t\t!hasComment(lastArg, CF.Trailing) &&\n\t\tcouldGroupArg(lastArg) &&\n\t\t(!preLastArg || preLastArg.nodeType !== lastArg.nodeType) &&\n\t\t(args.length !== 2 || !is_ClosureFunctionExpression(preLastArg) || !is_ArrayOrTupleLiteral(lastArg)) &&\n\t\t!(args.length > 1 && is_ArrayOrTupleLiteral(lastArg) && isConciselyPrintedArray(lastArg)) &&\n\t\t(args.length !== 1 || !is_IfBlockExpression(lastArg))\n\t);\n}\nfunction couldGroupArg(arg: Node, arrowChainRecursion = false): boolean {\n\treturn (\n\t\t(is_StructLiteral(arg) && (arg.properties.length > 0 || hasComment(arg))) ||\n\t\t(is_ArrayOrTupleLiteral(arg) && (arg.items.length > 0 || hasComment(arg))) ||\n\t\t(is_ExpressionAsTypeCast(arg) && couldGroupArg(arg.expression)) ||\n\t\t(is_ClosureFunctionExpression(arg) &&\n\t\t\t(!arg.returnType || is_Identifier(arg.returnType) || !isNonEmptyBlockStatement(arg.expression)) &&\n\t\t\t(isNonEmptyBlockStatement(arg.expression) ||\n\t\t\t\t(is_ClosureFunctionExpression(arg.expression) && couldGroupArg(arg.expression, true)) ||\n\t\t\t\tis_StructLiteral(arg.expression) ||\n\t\t\t\tis_ArrayOrTupleLiteral(arg.expression) ||\n\t\t\t\t(!arrowChainRecursion && is_CallExpression_or_CallLikeMacroInvocation(arg.expression)))) ||\n\t\tis_ExpressionWithBodyOrCases(arg) //&& isNonEmptyBlockStatement(arg)\n\t);\n}\nfunction isNonEmptyBlockStatement(node: Node) {\n\tif (is_MatchExpression(node)) return node.cases.length > 0;\n\treturn is_ExpressionWithBodyOrCases(node) && node.body.length > 0;\n}\nfunction isFunctionCompositionArgs(args) {\n\tif (args.length <= 1) {\n\t\treturn false;\n\t}\n\tlet count = 0;\n\tfor (const arg of args) {\n\t\tif (is_ClosureFunctionExpression(arg)) {\n\t\t\tif (++count > 1) return true;\n\t\t} else if (is_CallExpression_or_CallLikeMacroInvocation(arg)) {\n\t\t\tfor (const childArg of arg.arguments) {\n\t\t\t\tif (is_ClosureFunctionExpression(childArg)) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn false;\n}\n\nexport function printBinaryishExpression<T extends AndExpression | OrExpression | ComparisonExpression | OperationExpression>(\n\tprint: print<T>,\n\tnode: T\n) {\n\tconst parent = getParentNode()!;\n\tconst grandParent = getGrandParentNode();\n\tconst isInsideParenthesis = (\"condition\" in parent && parent.condition === node) || is_MatchExpression(parent);\n\n\tconst parts = printBinaryishExpressions(false, isInsideParenthesis);\n\tif (isInsideParenthesis) return parts;\n\tif (\n\t\t(is_CallExpression_or_CallLikeMacroInvocation(parent) && parent.callee === node) || //\n\t\tis_UnaryExpression(parent) ||\n\t\tis_MemberExpression(parent)\n\t) {\n\t\treturn group([indent([softline, ...parts]), softline]);\n\t}\n\n\tconst shouldNotIndent =\n\t\tis_FlowControlExpression(parent) ||\n\t\t(is_ClosureFunctionExpression(parent) && parent.expression === node) ||\n\t\tis_ExpressionWithBodyOrCases(parent);\n\n\tconst shouldIndentIfInlining =\n\t\tis_ReassignmentNode(parent) || is_VariableDeclarationNode(parent) || is_StructLiteral(parent) || is_StructLiteral(grandParent);\n\n\tconst samePrecedenceSubExpression = is_BinaryishExpression(node.left) && shouldFlatten(node, node.left);\n\n\tif (\n\t\tshouldNotIndent ||\n\t\t(shouldInlineLogicalExpression(node) && !samePrecedenceSubExpression) ||\n\t\t(!shouldInlineLogicalExpression(node) && shouldIndentIfInlining)\n\t) {\n\t\treturn group(parts);\n\t}\n\n\tif (parts.length === 0) return \"\";\n\tconst firstGroupIndex = parts.findIndex((part) => typeof part !== \"string\" && !Array.isArray(part) && part.type === \"group\");\n\tconst leading = parts.slice(0, firstGroupIndex === -1 ? 1 : firstGroupIndex + 1);\n\treturn group([...leading, indent(parts.slice(leading.length))], { id: Symbol(\"logicalChain\") });\n\n\tfunction printBinaryishExpressions(isNested: boolean, isInsideParenthesis: boolean): Doc[] {\n\t\tconst { path, print, options } = getContext();\n\t\tconst node = path.getValue();\n\n\t\tif (!is_BinaryishExpression(node)) {\n\t\t\treturn [group(print())];\n\t\t}\n\n\t\tconst parts: Doc[] = [];\n\n\t\tif (shouldFlatten(node, node.left)) {\n\t\t\tparts.push(...pathCall(node, \"left\", () => printBinaryishExpressions(true, isInsideParenthesis)));\n\t\t} else {\n\t\t\tparts.push(group(print(\"left\")));\n\t\t}\n\n\t\tconst shouldInline = shouldInlineLogicalExpression(node);\n\t\tconst operator = node.kind;\n\n\t\tconst right = [\n\t\t\toperator,\n\t\t\tshouldInline ? \" \" : line,\n\t\t\t// this is a hack (should always be 'print(\"right\")')\n\t\t\t!shouldInline && is_LogicalExpression(node.right) && shouldFlatten(node.right, node)\n\t\t\t\t? pathCall(node, \"right\", () => printBinaryishExpressions(true, isInsideParenthesis))\n\t\t\t\t: print(\"right\"),\n\t\t];\n\n\t\tconst shouldBreak = hasComment(node.left, CF.Trailing | CF.Line);\n\t\tconst shouldGroup =\n\t\t\tshouldBreak ||\n\t\t\t(!(isInsideParenthesis && is_LogicalExpression(node)) &&\n\t\t\t\tpath.getParentNode()!.nodeType !== node.nodeType &&\n\t\t\t\tnode.left.nodeType !== node.nodeType &&\n\t\t\t\tnode.right.nodeType !== node.nodeType);\n\n\t\tparts.push(\" \", shouldGroup ? group(right, { shouldBreak }) : right);\n\n\t\tif (isNested && hasComment(node)) {\n\t\t\tconst printed = cleanDoc(withComments(node, parts));\n\t\t\tif (isConcat(printed) || (printed as any).type === \"fill\") {\n\t\t\t\treturn getDocParts(printed) as Doc[];\n\t\t\t}\n\n\t\t\treturn [printed];\n\t\t}\n\n\t\treturn parts;\n\t}\n}\n\n// export function printLogicalExpression<T extends AndExpression | OrExpression>(print: print<T>, node: T) {\n// \tif (!is_insideScrutinee(node)) return printBinaryishExpression(print, node);\n\n// }\n\nfunction shouldInlineLogicalExpression(node: Node) {\n\tif (is_LogicalExpression(node)) {\n\t\tif (is_StructLiteral(node.right)) return node.right.properties.length > 0;\n\t\tif (is_ArrayOrTupleLiteral(node.right)) return node.right.items.length > 0;\n\t}\n\treturn false;\n}\n\nexport function printUnaryExpression<T extends UnaryExpression>(leftDoc: Doc, node: T) {\n\t__DEV__: assert(is_UnaryExpression(node));\n\t// if (unaryNeedsOuterParens(node)) {\n\t// \treturn [leftDoc, group([\"(\", indent([softline, getPrintFn<UnaryExpression>()(\"expression\")]), softline, \")\"])];\n\t// } else {\n\tconst printed = getPrintFn(node)(\"expression\");\n\n\treturn group([leftDoc, printed]);\n\t// }\n}\n\nexport function printIfBlock<T extends IfBlockExpression>(print: print<T>, node: T) {\n\tlet printed: Doc = [\n\t\tprintIfBlockCondition(print, node), //\n\t\tprintBlockBody(print, node),\n\t\tf` else ${print(\"else\")}`,\n\t];\n\n\tconst parent = getParentNode()!;\n\n\tif (is_ClosureBlock(node, parent)) {\n\t\tprinted = parenthesize_if_break([indent([softline, printed]), softline]);\n\t} else if (!is_ElseBlock(node, parent)) {\n\t\t// if (needsParens(node)) {\n\t\t// \tprinted = group(printed);\n\t\t// }\n\t\t// if (needsParens(node)) {\n\t\t// \tprinted = group([indent([softline, printed]), softline]);\n\t\t// } else {\n\t\t// printed = group(printed);\n\t\t// }\n\t}\n\n\treturn printed;\n}\n\nexport function printIfBlockCondition<T extends IfBlockExpression | MatchExpressionCase>(print: print<T>, node: T) {\n\tif (!hasCondition(node)) return \"\";\n\t// const id = Symbol(\"if\");\n\t// return [\"if \", group(printCondition(print, node), { id }), ifBreak(\"\", \" \", { groupId: id })];\n\treturn f`if ${printCondition(print, node)}`;\n}\n\n// export function printMatchExpressionExpression<T extends MatchExpression>(print: print<T>, node: T) {\n// \treturn [\"match \", maybe_parenthesize_condition(print, node), \" \"];\n// }\n\nexport function printCondition<T extends IfBlockExpression | MatchExpressionCase | WhileBlockExpression>(print: print<T>, node: T) {\n\treturn pathCall(node, \"condition\", (condition) => {\n\t\tif (!condition) return \"\";\n\t\tif (needsParens(condition)) return [print(), \" \"];\n\t\tconst id = Symbol(\"condition\");\n\t\tconst softlineStart = true; //!is_LetScrutinee(condition); //!is_LetScrutinee(getLeftMostCondition(condition));\n\t\tconst printed = [indent([softlineStart ? softline : \"\", print()]), softline];\n\t\treturn [group(printed, { id }), ifBreak(\"\", \" \", { groupId: id })];\n\t\treturn hasLetScrutineeCondition(node)\n\t\t\t? printed // parenthesizing nested \"let\" throws 'unused_parens'\n\t\t\t: parenthesize_if_break(printed);\n\t});\n}\nexport function parenthesize_if_break(doc: Doc) {\n\treturn conditionalGroup([doc, [\"(\", doc, \")\"]], { shouldBreak: willBreak(doc) });\n}\nfunction unwrapParenthesized(doc: Doc) {\n\t__DEV__: {\n\t\tconst check = (doc: Doc) => Array.isArray(doc) && doc.length === 3 && doc[0] === \"(\" && doc[2] === \")\";\n\t\tassert(Array.isArray(doc) && check(doc.length === 1 ? doc[0] : doc), \"Expected ['(', Doc, ')']\", doc);\n\t}\n\treturn doc.length === 1 ? doc[0][1] : doc[1];\n}\nexport function withParensIdentOnBreak(node: Node, printed: Doc) {\n\treturn printed;\n\tconst parens = needsParens(node);\n\tconst grouped = group([indent([softline, parens ? unwrapParenthesized(printed) : printed]), softline]);\n\treturn conditionalGroup([printed, parens ? [\"(\", grouped, \")\"] : grouped], { shouldBreak: willBreak(printed) });\n}\nfunction isSimplePattern(node: PatternNode | undefined) {\n\tif (!node) return false;\n\tswitch (node.nodeType) {\n\t\tcase NodeType.MacroInvocation:\n\t\t\treturn false;\n\t\tcase NodeType.ExpressionTypeCast:\n\t\t\treturn isSimplePattern(node.typeCallee) && !hasComplexTypeArguments(node);\n\t\tcase NodeType.ExpressionTypeSelector:\n\t\t\treturn is_Identifier(node.typeTarget) && (!node.typeExpression || is_Identifier(node.typeExpression));\n\t\tcase NodeType.ExpressionPath:\n\t\t\treturn !node.namespace || isSimplePattern(node.namespace);\n\t\tcase NodeType.RangePattern:\n\t\t\treturn (!node.lower || isSimplePattern(node.lower)) && (!node.upper || isSimplePattern(node.upper));\n\t\tcase NodeType.PatternVariableDeclaration:\n\t\tcase NodeType.ReferencePattern:\n\t\tcase NodeType.BoxPattern:\n\t\tcase NodeType.MinusPattern:\n\t\t\treturn isSimplePattern(node.pattern);\n\t\tcase NodeType.Identifier:\n\t\tcase NodeType.Literal:\n\t\tcase NodeType.RestPattern:\n\t\tcase NodeType.WildcardPattern:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function printUnionPattern<T extends UnionPattern>(print: print<T>, node: T) {\n\tif (node.patterns.length === 1) return print.map(\"patterns\");\n\tconst parent = getParentNode();\n\tconst prebreak = parent && (is_VariableDeclarationNode(parent) || is_LetScrutinee(parent)) && !needsParens(node);\n\treturn group([\n\t\tprebreak ? softline : \"\",\n\t\tprint.map(\"patterns\", (node, i, arr) => [\n\t\t\twithComments(node, [\n\t\t\t\ti === 0 //\n\t\t\t\t\t? ifBreak(\"| \")\n\t\t\t\t\t: \"| \",\n\t\t\t\talign(2, print()),\n\t\t\t]),\n\t\t\ti === arr.length - 1 ? \"\" : line,\n\t\t]),\n\t]);\n}\n\nexport function printArrayLike<T extends ArrayLikeNode>(print: print<T>, node: T) {\n\tconst delims = getDelimChars(node.items);\n\tif (node.items.length === 0) {\n\t\tconst comments = printDanglingCommentsForInline(node, DCM[\"items\"]);\n\t\treturn comments ? group([delims.left, comments, delims.right]) : delims.left + delims.right;\n\t}\n\n\tconst groupId = Symbol(\"array\");\n\tconst shouldBreak =\n\t\t// is_TupleStructDeclaration(node) ||\n\t\t!is_TupleNode(node) &&\n\t\tnode.items.length > 1 &&\n\t\t(node.items as (ExpressionNode | PatternNode)[]).every((item, i) => {\n\t\t\tconst next = node.items[i + 1];\n\t\t\treturn (\n\t\t\t\t((hasProperties(item) && item.properties.length > 1) || (hasItems(item) && item.items.length > 1)) &&\n\t\t\t\t(!next || item.nodeType === next.nodeType)\n\t\t\t);\n\t\t});\n\tconst shouldUseConciseFormatting = isConciselyPrintedArray(node);\n\n\tconst parent = getParentNode(node)!;\n\tconst needsForcedTrailingComma =\n\t\tnode.items.length === 1\n\t\t\t? is_TupleLiteral(node)\n\t\t\t\t? is_RangeLiteral(node.items[0])\n\t\t\t\t\t? !(is_ReassignmentExpression(parent) && parent.left === node)\n\t\t\t\t\t: true\n\t\t\t\t: is_TuplePattern(node)\n\t\t\t\t? !node.struct && !is_RangePattern(node.items[0]) && !is_RestPattern(node.items[0])\n\t\t\t\t: is_TypeTuple(node)\n\t\t\t\t? true\n\t\t\t\t: false\n\t\t\t: false;\n\tconst trailingComma: Doc = needsForcedTrailingComma\n\t\t? \",\" //\n\t\t: shouldUseConciseFormatting\n\t\t? ifBreak(\",\", \"\", { groupId })\n\t\t: ifBreak(\",\");\n\n\tconst printed = shouldUseConciseFormatting //\n\t\t? fill(\n\t\t\t\tprint.join(\n\t\t\t\t\t\"items\",\n\t\t\t\t\t(item, next) =>\n\t\t\t\t\t\tisNextLineEmpty(item)\n\t\t\t\t\t\t\t? [\",\", hardline, hardline]\n\t\t\t\t\t\t\t: hasComment(next, CF.Leading, (comment) => is_LineCommentNode(comment) || comment.placement === \"ownLine\")\n\t\t\t\t\t\t\t? [\",\", hardline]\n\t\t\t\t\t\t\t: [\",\", line],\n\t\t\t\t\ttrailingComma\n\t\t\t\t)\n\t\t  )\n\t\t: print.map_join(\n\t\t\t\t\"items\",\n\t\t\t\t() => group(print()),\n\t\t\t\t(item) => (isNextLineEmpty(item) ? [\",\", line, softline] : [\",\", line]),\n\t\t\t\ttrailingComma\n\t\t  );\n\n\treturn group([delims.left, indent([softline, printed]), printDanglingComments(node, true, DCM[\"items\"]), softline, delims.right], {\n\t\tshouldBreak,\n\t\tid: groupId,\n\t});\n}\n\nexport function printObject<T extends ObjectNode>(print: print<T>, node: T): Doc {\n\tif (hasSemiNoProperties(node)) {\n\t\treturn \";\";\n\t}\n\tif (!hasProperties(node)) {\n\t\treturn [\" {\", printDanglingCommentsForInline(node, DCM[\"properties\"]) || emptyContent(node), \"}\"];\n\t}\n\n\tconst firstProperty = node.properties[0];\n\n\tconst parent = getParentNode()!;\n\n\tconst shouldBreak = is_StructPattern(node)\n\t\t? false\n\t\t: is_UnionDeclaration(node) ||\n\t\t  is_StructDeclaration(node) ||\n\t\t  is_EnumMemberStructDeclaration(node) ||\n\t\t  hasNewlineInRange(start(node), start(firstProperty));\n\n\tconst content = [\n\t\t\" {\",\n\t\tindent([\n\t\t\tline,\n\t\t\t...print.join(\n\t\t\t\t\"properties\", //\n\t\t\t\t(node) => (isNextLineEmpty(node) ? [\",\", hardline, hardline] : [\",\", line]),\n\t\t\t\t(node) => (is_StructSpread(node) ? \"\" : ifBreak(\",\"))\n\t\t\t),\n\t\t]),\n\t\tline,\n\t\t\"}\",\n\t];\n\n\tconst grandparent = getGrandParentNode();\n\tif (\n\t\tgrandparent &&\n\t\t(is_FunctionDeclaration(grandparent) || is_ClosureFunctionExpression(grandparent)) &&\n\t\tgetParameters(grandparent)[0] === parent\n\t) {\n\t\treturn content;\n\t}\n\n\tif (\n\t\t(is_StructLiteral(node) && is_ReassignmentNode(parent) && parent.left === node) ||\n\t\t(is_StructPattern(node) &&\n\t\t\t(is_VariableDeclarationNode(parent) || is_MatchExpressionCase(parent) || is_FunctionParameterDeclaration(parent)) &&\n\t\t\tparent.pattern === node)\n\t) {\n\t\treturn content;\n\t}\n\n\treturn group(content, { shouldBreak });\n}\n\nexport function printEnumBody<T extends EnumDeclaration>(print: print<T>, node: T): Doc {\n\tconst printed = print.join(\"members\", (member) => [\",\", maybeEmptyLine(member)], \",\");\n\treturn [\n\t\t\" {\",\n\t\tprinted.length === 0\n\t\t\t? printDanglingCommentsForInline(node, DCM[\"members\"]) || emptyContent(node)\n\t\t\t: [indent([hardline, ...printed]), hardline],\n\t\t\"}\",\n\t];\n}\n"
  },
  {
    "path": "src/format/external.ts",
    "content": "import { Attribute, AttributeOrDocComment, Comment, DocCommentAttribute, LocArray, MemberExpression, Node, SourceFile } from \"jinx-rust\";\nimport { PickProps } from \"jinx-rust/utils\";\nimport type { Doc, ParserOptions, Printer } from \"prettier\";\nimport doc from \"prettier/doc.js\";\nimport { AssertTypesEq } from \"../utils/common\";\n\nexport type { Doc, ParserOptions, Plugin, Printer } from \"prettier\";\n\ndeclare module \"prettier/doc.js\" {\n\tnamespace utils {\n\t\tfunction canBreak(doc: Doc): boolean;\n\t}\n}\n\nexport const {\n\tjoin,\n\tline,\n\tsoftline,\n\thardline,\n\tliteralline,\n\tgroup,\n\tconditionalGroup,\n\tfill,\n\tlineSuffix,\n\tlineSuffixBoundary,\n\tcursor,\n\tbreakParent,\n\tifBreak,\n\ttrim,\n\tindent,\n\tindentIfBreak,\n\talign,\n\taddAlignmentToDoc,\n\tmarkAsRoot,\n\tdedentToRoot,\n\tdedent,\n\thardlineWithoutBreakParent,\n\tliterallineWithoutBreakParent,\n\tlabel,\n} = doc.builders;\n\nexport const {\n\tisConcat,\n\tgetDocParts,\n\twillBreak,\n\ttraverseDoc,\n\tfindInDoc,\n\tmapDoc,\n\tpropagateBreaks,\n\tremoveLines,\n\tstripTrailingHardline,\n\tnormalizeParts,\n\tnormalizeDoc,\n\tcleanDoc,\n\tcanBreak,\n} = doc.utils;\n\nexport const Symbol_comments = Symbol.for(\"comments\");\n\nexport interface CustomOptions extends ParserOptions<Node> {\n\t[Symbol_comments]: AnyComment[];\n\trsParsedFile: SourceFile;\n\tcommentSpans: Map<number, number>;\n\tprinter: Printer<Node>;\n\tcursorNode: any;\n\n\tcomments: Comment[];\n\tdanglingAttributes: AttributeOrDocComment[];\n\tactuallyMethodNodes: WeakSet<MemberExpression>;\n}\n\nexport type NodeWithComments<T extends Node> = T & { comments: AnyComment[] };\nexport interface MutatedComment extends Comment, PrettierCommentInfo {}\nexport interface MutatedAttribute extends Attribute, PrettierCommentInfo {}\nexport interface MutatedDocComment extends DocCommentAttribute, PrettierCommentInfo {}\nexport type AnyComment = MutatedComment | MutatedAttribute | MutatedDocComment;\n\ntype keyofDelimitedArrayProps<T> = T extends never ? never : keyof PickProps<T, LocArray<any, \"()\" | \"[]\" | \"{}\" | \"<>\">>;\n\n__DEV__: AssertTypesEq<keyof typeof DCM, keyofDelimitedArrayProps<Node>>();\n\nexport enum DCM {\n\t\"arguments\" = \"arguments\",\n\t\"parameters\" = \"parameters\",\n\t\"items\" = \"items\",\n\t\"properties\" = \"properties\",\n\t\"members\" = \"members\",\n\t\"body\" = \"body\",\n\t\"cases\" = \"cases\",\n\t\"typeArguments\" = \"typeArguments\",\n\t\"ltParameters\" = \"ltParameters\",\n\t\"generics\" = \"generics\",\n\t\"specifiers\" = \"specifiers\",\n\t\"rules\" = \"rules\",\n\t\"match\" = \"match\",\n\t\"transform\" = \"transform\",\n\t\"segments\" = \"segments\",\n}\n\nexport interface PrettierCommentInfo {\n\ttrailing: boolean;\n\tleading: boolean;\n\tunignore: boolean;\n\tprinted: boolean;\n\tplacement: \"ownLine\" | \"endOfLine\" | \"remaining\";\n\t// nodeDescription?: any;\n\tmarker?: DCM;\n}\n\nexport interface AstPath<T = Node> {\n\tstack: (Node | string | number)[];\n\tcallParent<R>(callback: (path: this) => R, count?: number): R;\n\tgetName(): PropertyKey | null;\n\tgetValue(): T;\n\tgetNode(count?: number): T | null;\n\tgetParentNode(count?: number): T | null;\n\n\tmatch(...predicates: ((node: Node, name: string | null, number: number | null) => boolean)[]): boolean;\n\n\tcall<R>(callback: (path: AstPath, index: number, value: any) => R, ...props: (string | number)[]): R;\n\teach(callback: (path: AstPath, index: number, value: any) => void, ...props: (string | number)[]): void;\n\tmap<R>(callback: (path: AstPath, index: number, value: any) => R, ...props: (string | number)[]): R[];\n}\n"
  },
  {
    "path": "src/format/plugin.ts",
    "content": "import { AttributeOrComment, IfBlockExpression, Node, Program, rs } from \"jinx-rust\";\nimport {\n\tArrayProps,\n\tBoolProps,\n\tNodeProps,\n\tend,\n\thasAttributes,\n\tinsertNodes,\n\tis_Attribute,\n\tis_BlockCommentKind,\n\tis_BlockCommentNode,\n\tis_Comment,\n\tis_DocCommentAttribute,\n\tis_ElseBlock,\n\tis_LineCommentNode,\n\tis_MacroInvocation,\n\tis_MacroRule,\n\tis_MissingNode,\n\tis_Node,\n\tis_PunctuationToken,\n\tis_UnionPattern,\n\tstart,\n} from \"jinx-rust/utils\";\nimport { getCommentChildNodes, isTransformed, transform_ast } from \"../transform\";\nimport { Narrow, assert, color, each, exit, iLast, is_array, map_tagged_template, print_string } from \"../utils/common\";\nimport {\n\tCF,\n\tescapeComments,\n\tgetComments,\n\thandleEndOfLineComment,\n\thandleOwnLineComment,\n\thandleRemainingComment,\n\thasBreaklineAfter,\n\thasComment,\n\tisDangling,\n\tisPrettierIgnoreAttribute,\n\tsetDidPrintComment,\n\twithComments,\n} from \"./comments\";\nimport { withCheckContext } from \"./complexity\";\nimport { isNoopExpressionStatement, maybeEmptyLine } from \"./core\";\nimport { AstPath, CustomOptions, Doc, Plugin, Symbol_comments, group, hardline, indent, line, softline } from \"./external\";\nimport { printer } from \"./printer\";\nimport { needsInnerParens, needsOuterSoftbreakParens, shouldPrintOuterAttributesAbove } from \"./styling\";\n\nexport function is_printing_macro() {\n\treturn getContext().path.stack.some((node) => is_Node(node) && (is_MacroInvocation(node) || is_Attribute(node)));\n}\n\nexport function assertPathAtNode(name: string, node: Node, ...ctx: any[]) {\n\t__DEV__: if (getNode() !== node)\n\t\texit(`Attempted to call ${name}() in wrong prettier path context`, { asserted: node, actual: getNode() }, ...ctx);\n}\n\nexport function f(...args: [strings: TemplateStringsArray, ...values: Doc[]]) {\n\tlet cancel = false;\n\tconst res = map_tagged_template(args, (doc) => {\n\t\tcancel ||= !doc || (is_array(doc) && doc.length === 0);\n\t\treturn doc;\n\t});\n\treturn cancel ? \"\" : res;\n}\n\nexport function sg_single(s: TemplateStringsArray, v_0: Doc) {\n\treturn group([s[0], indent([softline, v_0]), softline, s[1]]);\n}\nexport function sg_duo(s: TemplateStringsArray, v_0: Doc, v_1: Doc) {\n\treturn group([s[0], indent([softline, v_0, s[1], line, v_1]), softline, s[2]]);\n}\n\nlet ctx: {\n\tpath: AstPath;\n\toptions: CustomOptions;\n\tprint: (path?: AstPath | string | [], args?: any) => Doc;\n\targs: any;\n};\n\nexport const getNode = () => ctx.path.stack[ctx.path.stack.length - 1] as Node;\nexport const stackIncludes = (x: Node | string | number) => ctx.path.stack.includes(x);\nexport const getContext = () => ctx;\nexport const getOptions = () => ctx.options;\nexport const getProgram = () => ctx.options.rsParsedFile.program;\nexport const getAllComments = () => ctx.options[Symbol_comments];\nexport const getParentNode = (child?: Node) => {\n\t__DEV__: if (child) assertPathAtNode(\"getParentNode\", child);\n\treturn ctx.path.getParentNode();\n};\nexport const getGrandParentNode = () => ctx.path.getParentNode(1) as Node;\nexport const getPrintFn = <T extends Node>(forNode?: T | undefined): print<T> => {\n\t__DEV__: if (forNode) assertPathAtNode(\"getPrintFn\", forNode);\n\treturn print as print<T>;\n};\n\nconst get = (property: keyof any) => getNode()[property];\nconst has = (property: keyof any) => !!get(property);\n\nexport function pathCall<T extends Node, K extends keyof NodeProps<T> & keyof T, R>(node: T, key: K, fn: (child: T[K]) => R): R {\n\treturn ctx.path.call(() => fn(getNode() as any), key as any);\n}\n\nexport function pathCallEach<T extends Node, K extends AK<T>>(\n\tnode: T,\n\tkey: K, // @ts-expect-error\n\tfn: (child: NonNullable<T[K]>[number], index: number) => void\n) {\n\t__DEV__: assertPathAtNode(\"\", node); // @ts-expect-error\n\tctx.path.each((_, i) => fn(getNode() as any, i), key);\n}\n\nexport function pathCallAtParent<T extends Node, R>(parent: T, fn: (parent: T) => R): R {\n\treturn ctx.path.callParent(() => {\n\t\t__DEV__: assertPathAtNode(\"pathCallParent\", parent);\n\t\treturn fn(parent);\n\t});\n}\nexport function pathCallParentOf<T extends Node, R>(child: Node, fn: (parent: T) => R): R {\n\t__DEV__: assertPathAtNode(\"pathCallParentOf\", child);\n\treturn ctx.path.callParent((p) => fn(getNode() as any));\n}\n\nexport function pathCallTopMostIfBlockExpression<R>(node: IfBlockExpression, fn: (node: IfBlockExpression) => R): R {\n\tconst parent = getParentNode(node)!;\n\treturn is_ElseBlock(node, parent) ? pathCallAtParent(parent, (parent) => pathCallTopMostIfBlockExpression(parent, fn)) : fn(node);\n}\n\nfunction print(property?: any, args?: any): Doc | Doc[] {\n\tif (!property) return ctx.print(undefined!, args);\n\tif (Array.isArray(property)) return ctx.print(property as any, args);\n\tconst value = get(property);\n\treturn !!value ? (Array.isArray(value) ? ctx.path.map(ctx.print, property) : ctx.print(property, args)) : \"\";\n}\n\nnamespace print {\n\texport function b(property: string, res = `${property} `): Doc {\n\t\treturn has(property) ? res : \"\";\n\t}\n\texport function map(property: string, mapItem?: MapFn<any, any>): Doc[] {\n\t\treturn !has(property) ? [] : ctx.path.map(mapItem ? (p, i, a) => mapItem(a[i], i, a) : () => ctx.print(), property);\n\t}\n\texport function join(property: string, sep: SepFn<any, any> | Doc, trailingSep: TrailingSepFn<any, any> | Doc = \"\"): Doc[] {\n\t\treturn map_join(property, () => ctx.print(), sep, trailingSep);\n\t}\n\texport function map_join(\n\t\tproperty: string,\n\t\tmapFn: MapFn<any, any>,\n\t\tsep: SepFn<any, any> | Doc,\n\t\tsepTrailing: TrailingSepFn<any, any> | Doc = \"\"\n\t) {\n\t\tconst sepFn = typeof sep === \"function\" ? sep : () => sep;\n\t\treturn map(property, (v, i, a) => [\n\t\t\tmapFn(v, i, a),\n\t\t\tiLast(i, a as any)\n\t\t\t\t? typeof sepTrailing === \"function\"\n\t\t\t\t\t? sepTrailing(v)\n\t\t\t\t\t: sepTrailing\n\t\t\t\t: sepFn(v, a[i + 1], i === 0 ? undefined : a[i - 1]),\n\t\t]);\n\t}\n}\n\n// prettier-ignore\ntype SepFn<T extends Node = Node, K extends AK<T> = AK<T>> = <A extends AV<T, K>>(item: A[number], next_item: A[number], prev_item: A[number] | undefined) => Doc;\ntype MapFn<T extends Node = Node, K extends AK<T> = AK<T>> = <A extends AV<T, K>>(item: A[number], index: number, arr: A) => Doc;\ntype TrailingSepFn<T extends Node = Node, K extends AK<T> = AK<T>> = <A extends AV<T, K>>(item: A[number]) => Doc;\ntype AV<T extends Node, K extends keyof T> = Extract<NonNullable<T[K]>, ReadonlyArray<unknown>>;\ntype AK<T extends Node> = keyof ArrayProps<T> & keyof T;\n// type AK<T extends Node> = keyof PickProps<T, {nodeType:number}|{nodeType:number}[]> & keyof T;\n\nexport interface print<T extends Node> {\n\t(property?: [], args?: any): Doc;\n\t(property?: [AK<T>, number], args?: any): Doc;\n\t(property?: AK<T>, args?: any): Doc[];\n\t// (property?: T extends {rules:{nodeType:number}|{nodeType:number}[]} ? \"rules\" : never, args?: any): Doc[];\n\t(property?: keyof NodeProps<T> & keyof T, args?: any): Doc;\n\tb(property: keyof BoolProps<T>, res?: string): Doc;\n\tmap<K extends AK<T>>(property: K & keyof ArrayProps<T>, mapFn?: MapFn<T, K>): Doc[];\n\tjoin<K extends AK<T>>(property: K, sep: SepFn<T, K> | Doc, trailingSep?: TrailingSepFn<T, K> | Doc): Doc[];\n\tmap_join<K extends AK<T>>(property: K, mapFn: MapFn<T, K>, sep: SepFn<T, K> | Doc, trailingSep?: TrailingSepFn<T, K> | Doc): Doc[];\n}\n\nfunction genericPrint() {\n\treturn withCheckContext(() => {\n\t\tconst node = getNode();\n\t\t__DEV__: assert(node.nodeType in printer);\n\n\t\tlet printed: Doc = hasPrettierIgnore(node) //\n\t\t\t? node.loc.getOwnText()\n\t\t\t: printer[node.nodeType]!(print as any, node as never);\n\n\t\tconst inner_parens = needsInnerParens(node);\n\n\t\tif (inner_parens) {\n\t\t\tprinted = group([\"(\", printed, \")\"]);\n\t\t}\n\n\t\tif (hasAttributes(node)) {\n\t\t\tconst print_above = shouldPrintOuterAttributesAbove(node); /*  || node.attributes.length > 1 */\n\t\t\tprinted = [\n\t\t\t\t...print.join(\n\t\t\t\t\t\"attributes\",\n\t\t\t\t\t(attr) =>\n\t\t\t\t\t\tprint_above\n\t\t\t\t\t\t\t? maybeEmptyLine(attr)\n\t\t\t\t\t\t\t: is_LineCommentNode(attr) || (is_BlockCommentNode(attr) && hasBreaklineAfter(attr))\n\t\t\t\t\t\t\t? hardline\n\t\t\t\t\t\t\t: \" \",\n\t\t\t\t\t(attr) =>\n\t\t\t\t\t\tprint_above && is_DocCommentAttribute(attr)\n\t\t\t\t\t\t\t? maybeEmptyLine(attr)\n\t\t\t\t\t\t\t: print_above || is_LineCommentNode(attr) || (is_BlockCommentNode(attr) && hasBreaklineAfter(attr))\n\t\t\t\t\t\t\t? hardline\n\t\t\t\t\t\t\t: \" \"\n\t\t\t\t),\n\t\t\t\tprinted,\n\t\t\t];\n\t\t}\n\n\t\tprinted = withComments(\n\t\t\tnode,\n\t\t\tprinted,\n\t\t\thasPrettierIgnore(node) || ((is_Attribute(node) || is_MacroInvocation(node)) && !isTransformed(node))\n\t\t\t\t? escapeComments(0, (comment) => node.loc.ownContains(comment))\n\t\t\t\t: is_MacroRule(node)\n\t\t\t\t? escapeComments(0, (comment) => node.transform.loc.contains(comment))\n\t\t\t\t: is_UnionPattern(getParentNode() ?? ({ nodeType: 0 } as any))\n\t\t\t\t? new Set(getComments(node, 0, (comment) => !isDangling(comment)))\n\t\t\t\t: undefined\n\t\t);\n\n\t\tif (!inner_parens && needsOuterSoftbreakParens(node)) {\n\t\t\tprinted = [group([\"(\", indent([softline, printed]), softline, \")\"])];\n\t\t}\n\n\t\treturn printed;\n\t});\n\n\tfunction hasPrettierIgnore(node: Node) {\n\t\treturn (\n\t\t\t(node as any).prettierIgnore ||\n\t\t\thasComment(node, CF.PrettierIgnore) ||\n\t\t\t(hasAttributes(node) && node.attributes.some(isPrettierIgnoreAttribute))\n\t\t);\n\t}\n}\n\nexport function canAttachComment(n: Node) {\n\treturn !is_Comment(n) && !isNoopExpressionStatement(n) && !is_MissingNode(n) && !is_PunctuationToken(n);\n}\n\nexport const plugin: Plugin<Node> = {\n\tlanguages: [\n\t\t{\n\t\t\tname: \"Rust\",\n\t\t\taliases: [\"rs\"],\n\t\t\tparsers: [\"jinx-rust\"],\n\t\t\textensions: [\".rs\", \".rs.in\"],\n\t\t\tlinguistLanguageId: 327,\n\t\t\tvscodeLanguageIds: [\"rust\"],\n\t\t\ttmScope: \"source.rust\",\n\t\t\taceMode: \"rust\",\n\t\t\tcodemirrorMode: \"rust\",\n\t\t\tcodemirrorMimeType: \"text/x-rustsrc\",\n\t\t},\n\t],\n\tparsers: {\n\t\t\"jinx-rust\": {\n\t\t\tastFormat: \"jinx-rust\",\n\t\t\tlocStart: start,\n\t\t\tlocEnd: end,\n\t\t\tparse(code, parsers, options: CustomOptions) {\n\t\t\t\tctx = { options } as any;\n\n\t\t\t\toptions.rsParsedFile = rs.parseFile((options.originalText = code), { filepath: options.filepath });\n\n\t\t\t\toptions.actuallyMethodNodes = new WeakSet();\n\t\t\t\toptions.danglingAttributes = [];\n\t\t\t\toptions.comments = [];\n\n\t\t\t\ttransform_ast(options);\n\n\t\t\t\tconst comments: AttributeOrComment[] = [];\n\t\t\t\tinsertNodes(comments, options.comments);\n\t\t\t\tinsertNodes(comments, options.danglingAttributes);\n\n\t\t\t\t// @ts-expect-error\n\t\t\t\toptions.rsParsedFile.program.comments = comments;\n\n\t\t\t\toptions.commentSpans = new Map(comments.map((n) => [start(n), end(n)]));\n\n\t\t\t\treturn options.rsParsedFile.program;\n\t\t\t},\n\t\t},\n\t},\n\tprinters: {\n\t\t\"jinx-rust\": {\n\t\t\tpreprocess: (node: Program) => node.loc.src,\n\t\t\tprint(path, options, print, args) {\n\t\t\t\tif (path.stack.length === 1) {\n\t\t\t\t\t__DEV__: Narrow<CustomOptions>(options);\n\t\t\t\t\tctx = { path, options, print, args };\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconst printed = genericPrint();\n\t\t\t\t\t\t__DEV__: devEndCheck(printed);\n\t\t\t\t\t\treturn printed;\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tctx = undefined!;\n\t\t\t\t\t}\n\t\t\t\t} else if (args || ctx.args) {\n\t\t\t\t\tconst prev_args = ctx.args;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tctx.args = args;\n\t\t\t\t\t\treturn genericPrint();\n\t\t\t\t\t} finally {\n\t\t\t\t\t\tctx.args = prev_args;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\treturn genericPrint();\n\t\t\t\t}\n\t\t\t},\n\t\t\thasPrettierIgnore: () => false,\n\t\t\twillPrintOwnComments: () => true,\n\t\t\tisBlockComment: is_BlockCommentKind,\n\t\t\tcanAttachComment: canAttachComment,\n\t\t\tgetCommentChildNodes: getCommentChildNodes,\n\t\t\tprintComment: genericPrint,\n\t\t\thandleComments: {\n\t\t\t\t// @ts-expect-error\n\t\t\t\tavoidAstMutation: true,\n\t\t\t\townLine: handleOwnLineComment,\n\t\t\t\tendOfLine: handleEndOfLineComment,\n\t\t\t\tremaining: handleRemainingComment,\n\t\t\t},\n\t\t},\n\t},\n\toptions: {},\n\tdefaultOptions: {\n\t\t// default prettier (2)  -> rustfmt (4)\n\t\ttabWidth: 4,\n\t\t// default prettier (80) -> rustfmt (100)\n\t\tprintWidth: 100,\n\t},\n};\n\nfunction devEndCheck(printed: Doc) {\n\tlet first = false;\n\tconst comments = getAllComments();\n\teach(comments, (comment, index) => {\n\t\tif (!comment.printed) {\n\t\t\tif (!first) (first = true), console.log(color.red(`Unprinted comments:`));\n\t\t\tconst len = 40;\n\t\t\tconst msg =\n\t\t\t\tcolor.magenta(\n\t\t\t\t\t(comment.marker ? `Dangling \"${comment.marker}\" ` : \"\") +\n\t\t\t\t\t\t(is_Attribute(comment) ? \"Attribute \" : is_DocCommentAttribute(comment) ? \"DocCommentAttribute\" : \"Comment\") +\n\t\t\t\t\t\t` ${index}/${comments.length}` +\n\t\t\t\t\t\tcolor.yellow(` ${print_string(comment.loc.sliceText(0, len))}${comment.loc.len() > len ? \" ...\" : \"\"}`)\n\t\t\t\t) + color.grey(`\\n    at ${comment.loc.url()}`);\n\t\t\tif (globalThis.TESTS_FORMAT_DEV) exit(msg);\n\t\t\telse console.log(msg);\n\t\t\tsetDidPrintComment(comment);\n\t\t}\n\t});\n}\n"
  },
  {
    "path": "src/format/printer.ts",
    "content": "import { DelimKind, Node, NodeType, NTMap } from \"jinx-rust\";\nimport {\n\tgetDelimChars,\n\thasSuffix,\n\tis_ArrayOrTupleLiteral,\n\tis_BlockExpression,\n\tis_ClosureFunctionExpression,\n\tis_Identifier,\n\tis_IfBlockExpression,\n\tis_LiteralNumberLike,\n\tis_StructLiteral,\n\tstart,\n} from \"jinx-rust/utils\";\nimport {\n\tBlockLikeMacroInvocation,\n\tCallLikeMacroInvocation,\n\tis_BlockLikeMacroInvocation,\n\tis_CallLikeMacroInvocation,\n\tisTransformed,\n} from \"../transform\";\nimport { exit } from \"../utils/common\";\nimport { hasComment, print_comment } from \"./comments\";\nimport { isSimpleType } from \"./complexity\";\nimport {\n\tadjustClause,\n\tparenthesize_if_break,\n\tprintAnnotatedPattern,\n\tprintArrayLike,\n\tprintArrowFunction,\n\tprintAssignment,\n\tprintBinaryishExpression,\n\tprintBlockBody,\n\tprintBodyOrCases,\n\tprintCallArguments,\n\tprintCallExpression,\n\tprintCondition,\n\tprintDanglingCommentsForInline,\n\tprintDeclarationTypeBounds,\n\tprintEnumBody,\n\tprintFlowControlExpression,\n\tprintGenerics_x_whereBounds,\n\tprintIfBlock,\n\tprintIfBlockCondition,\n\tprintImplTraitForType,\n\tprintLtBounds,\n\tprintLtParameters,\n\tprintMacroRules,\n\tprintMaybeBlockBody,\n\tprintMemberExpression,\n\tprintNumber,\n\tprintObject,\n\tprintParametersAndReturnType,\n\tprintRuleMatch,\n\tprintRuleTransform,\n\tprintTypeAnnotation,\n\tprintTypeArguments,\n\tprintTypeBounds,\n\tprintUnaryExpression,\n\tprintUnionPattern,\n} from \"./core\";\nimport { DCM, Doc, group, hardline, ifBreak, indent, join, line, softline, willBreak } from \"./external\";\nimport { f, getOptions, getParentNode, pathCall, sg_duo, sg_single, type print } from \"./plugin\";\nimport { needsParens, stmtNeedsSemi } from \"./styling\";\n\ntype nPrint<T extends Node> = (print: print<T>, node: T) => Doc | never;\n\nexport const printer: { [K in NodeType]: nPrint<Extract<NTMap[K], Node>> } = {\n\t[NodeType.MissingNode](print, node) {\n\t\treturn \"\";\n\t},\n\t[NodeType.SourceFile](print, node) {\n\t\treturn [\n\t\t\tprint.b(\"UTF8BOM\", \"\\uFEFF\"), //\n\t\t\tprint(\"shebang\"),\n\t\t\tprint(\"program\"),\n\t\t];\n\t},\n\t[NodeType.Shebang](print, node) {\n\t\treturn [`#!${node.value}`, hardline];\n\t},\n\t[NodeType.Program](print, node) {\n\t\treturn printBodyOrCases(print, node);\n\t},\n\t[NodeType.Snippet](print, node) {\n\t\texit.never();\n\t},\n\t[NodeType.Identifier](print, node) {\n\t\treturn node.name;\n\t},\n\t[NodeType.Index](print, node) {\n\t\treturn node.name;\n\t},\n\t[NodeType.LbIdentifier](print, node) {\n\t\treturn node.name;\n\t},\n\t[NodeType.McIdentifier](print, node) {\n\t\treturn node.name;\n\t},\n\t[NodeType.LtIdentifier](print, node) {\n\t\treturn node.name;\n\t},\n\t[NodeType.PunctuationToken](print, node) {\n\t\treturn node.token;\n\t},\n\t[NodeType.DelimGroup](print, node) {\n\t\treturn node.loc.getOwnText();\n\t},\n\t[NodeType.Literal](print, node) {\n\t\tlet { value } = node;\n\t\tif (is_LiteralNumberLike(node)) value = printNumber(value);\n\t\treturn hasSuffix(node) ? [value, print(\"suffix\")] : value;\n\t},\n\t[NodeType.ItemPath](print, node) {\n\t\treturn [print(\"namespace\"), \"::\", print(\"segment\")];\n\t},\n\t[NodeType.ExpressionPath](print, node) {\n\t\treturn [print(\"namespace\"), \"::\", print(\"segment\")];\n\t},\n\t[NodeType.TypePath](print, node) {\n\t\treturn [print(\"namespace\"), \"::\", print(\"segment\")];\n\t},\n\t[NodeType.Comment](print, node) {\n\t\treturn print_comment(node);\n\t},\n\t[NodeType.DocCommentAttribute](print, node) {\n\t\treturn print_comment(node);\n\t},\n\t[NodeType.Attribute](print, node) {\n\t\treturn [\n\t\t\tnode.inner ? \"#![\" : \"#[\",\n\t\t\tisTransformed(node)\n\t\t\t\t? [print(\"segments\"), printDanglingCommentsForInline(node)] //\n\t\t\t\t: node.segments.loc.sliceText(1, -1).trim(),\n\t\t\t\"]\",\n\t\t];\n\t},\n\t[NodeType.MacroInvocation](print, node) {\n\t\tconst hasCurlyBrackets = node.segments.dk === DelimKind[\"{}\"];\n\t\tconst delim = getDelimChars(node.segments);\n\t\tif (node.segments.length === 0) {\n\t\t\treturn [print(\"callee\"), \"!\", hasCurlyBrackets ? \" \" : \"\", delim.left, printDanglingCommentsForInline(node), delim.right];\n\t\t}\n\t\tif (isTransformed(node)) {\n\t\t\tif (is_CallLikeMacroInvocation(node)) {\n\t\t\t\treturn [print(\"callee\"), \"!\", printCallArguments(print as print<CallLikeMacroInvocation>, node)];\n\t\t\t}\n\t\t\tif (is_BlockLikeMacroInvocation(node)) {\n\t\t\t\treturn [print(\"callee\"), \"!\", \" \", printBlockBody(print as print<BlockLikeMacroInvocation>, node)];\n\t\t\t}\n\t\t}\n\t\tlet content = node.segments.loc.sliceText(1, -1);\n\t\tif (content.trim().length === 0) {\n\t\t\tcontent = \"\";\n\t\t} else if (!content.includes(\"\\n\")) {\n\t\t\tcontent = content.trim();\n\t\t\tif (hasCurlyBrackets) content = \" \" + content + \" \";\n\t\t}\n\t\treturn [print(\"callee\"), \"!\", hasCurlyBrackets ? \" \" : \"\", delim.left, content, delim.right];\n\t},\n\t[NodeType.MacroRulesDeclaration](print, node) {\n\t\treturn [\"macro_rules! \", print(\"id\"), printMacroRules(print, node)];\n\t},\n\t[NodeType.MacroRuleDeclaration](print, node) {\n\t\treturn [printRuleMatch(print, node), \" => \", printRuleTransform(print, node), \";\"];\n\t},\n\t[NodeType.MacroDeclaration](print, node) {\n\t\treturn [print(\"pub\"), \"macro \", print(\"id\"), printMacroRules(print, node)];\n\t},\n\t[NodeType.MacroInlineRuleDeclaration](print, node) {\n\t\treturn [printRuleMatch(print, node), \" \", printRuleTransform(print, node)];\n\t},\n\t[NodeType.MacroGroup](print, node) {\n\t\treturn node.loc.getOwnText();\n\t},\n\t[NodeType.MacroParameterDeclaration](print, node) {\n\t\treturn [print(\"id\"), \":\", print(\"ty\")];\n\t},\n\t[NodeType.PubSpecifier](print, node) {\n\t\tif (!node.location) return \"pub \";\n\t\tif (is_Identifier(node.location)) {\n\t\t\tswitch (node.location.name) {\n\t\t\t\tcase \"crate\":\n\t\t\t\t\tif (start(node) === start(node.location)) {\n\t\t\t\t\t\treturn \"crate \";\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn [\"pub(\", print(\"location\"), \") \"];\n\t\t\t\t\t}\n\t\t\t\tcase \"self\":\n\t\t\t\tcase \"super\":\n\t\t\t\t\treturn [\"pub(\", print(\"location\"), \") \"];\n\t\t\t}\n\t\t}\n\t\treturn [\"pub(in \", print(\"location\"), \") \"];\n\t},\n\t[NodeType.ExternSpecifier](print, node) {\n\t\treturn [\"extern \", f`${print(\"abi\")} `];\n\t},\n\t[NodeType.ExpressionStatement](print, node) {\n\t\treturn [print(\"expression\"), stmtNeedsSemi(node) ? \";\" : \"\"];\n\t},\n\t[NodeType.UseStatement](print, node) {\n\t\treturn [print(\"pub\"), \"use \", print(\"import\"), \";\"];\n\t},\n\t[NodeType.DestructuredImport](print, node) {\n\t\tif (node.specifiers.length === 0) return [print(\"source\"), \"::{\", printDanglingCommentsForInline(node, DCM[\"specifiers\"]), \"}\"];\n\t\tlet space = true;\n\t\t__DEV__: if (globalThis.TESTS_FORMAT_DEV) space = false;\n\t\treturn [\n\t\t\tprint(\"source\"),\n\t\t\tgroup([\n\t\t\t\t\"::{\",\n\t\t\t\tindent([space ? line : softline, join([\",\", line], print(\"specifiers\")), ifBreak(\",\")]),\n\t\t\t\tspace ? line : softline,\n\t\t\t\t\"}\",\n\t\t\t]),\n\t\t];\n\t},\n\t[NodeType.AmbientImport](print, node) {\n\t\treturn f`${print(\"source\")}::*` || \"*\";\n\t},\n\t[NodeType.AnonymousImport](print, node) {\n\t\treturn [print(\"source\"), \" as \", \"_\"];\n\t},\n\t[NodeType.NamedImport](print, node) {\n\t\treturn [print(\"source\"), f` as ${print(\"local\")}`];\n\t},\n\t[NodeType.ExternCrateStatement](print, node) {\n\t\treturn [print(\"pub\"), \"extern crate \", print(\"import\"), \";\"];\n\t},\n\t[NodeType.TypeAliasDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\t\"type\",\n\t\t\tprintAssignment(\n\t\t\t\tprintGenerics_x_whereBounds(print, node, printDeclarationTypeBounds(print, node, \":\")), //\n\t\t\t\t\" =\",\n\t\t\t\t\"typeExpression\"\n\t\t\t),\n\t\t\t\";\",\n\t\t];\n\t},\n\t[NodeType.LetVariableDeclaration](print, node) {\n\t\treturn [\n\t\t\t\"let \",\n\t\t\tprintAssignment(\n\t\t\t\tprintAnnotatedPattern(print, node), //\n\t\t\t\t\" =\",\n\t\t\t\t\"expression\"\n\t\t\t),\n\t\t\tf` else ${print(\"else\")}`,\n\t\t\t\";\",\n\t\t];\n\t},\n\t[NodeType.ConstVariableDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\t\"const \",\n\t\t\tprintAssignment(\n\t\t\t\tprintAnnotatedPattern(print, node), //\n\t\t\t\t\" =\",\n\t\t\t\t\"expression\"\n\t\t\t),\n\t\t\t\";\",\n\t\t];\n\t},\n\t[NodeType.StaticVariableDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\t\"static \",\n\t\t\tprintAssignment(\n\t\t\t\tprintAnnotatedPattern(print, node), //\n\t\t\t\t\" =\",\n\t\t\t\t\"expression\"\n\t\t\t),\n\t\t\t\";\",\n\t\t];\n\t},\n\t[NodeType.ModuleDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"), //\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"mod \",\n\t\t\tprint(\"id\"),\n\t\t\tprintMaybeBlockBody(print, node),\n\t\t];\n\t},\n\t[NodeType.ExternBlockDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"), //\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"extern \",\n\t\t\tf`${print(\"abi\")} `,\n\t\t\tprintBlockBody(print, node),\n\t\t];\n\t},\n\t[NodeType.FunctionDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprint.b(\"const\"),\n\t\t\tprint.b(\"async\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\tprint(\"extern\"),\n\t\t\t\"fn\",\n\t\t\tprintGenerics_x_whereBounds(print, node, printParametersAndReturnType(node)),\n\t\t\tprintMaybeBlockBody(print, node),\n\t\t];\n\t},\n\t[NodeType.FunctionSelfParameterDeclaration](print, node) {\n\t\treturn group([print.b(\"ref\", \"&\"), f`${print(\"lt\")} `, print.b(\"mut\"), \"self\", printTypeAnnotation(print, node)]);\n\t},\n\t[NodeType.FunctionParameterDeclaration](print, node) {\n\t\treturn group(printAnnotatedPattern(print, node));\n\t},\n\t[NodeType.FunctionSpread](print, node) {\n\t\treturn \"...\";\n\t},\n\t[NodeType.StructDeclaration](print, node) {\n\t\treturn [print(\"pub\"), \"struct\", printGenerics_x_whereBounds(print, node, \"\"), printObject(print, node)];\n\t},\n\t[NodeType.StructPropertyDeclaration](print, node) {\n\t\treturn [print(\"pub\"), print(\"id\"), printTypeAnnotation(print, node)];\n\t},\n\t[NodeType.TupleStructDeclaration](print, node) {\n\t\treturn [print(\"pub\"), \"struct\", printGenerics_x_whereBounds(print, node, printArrayLike(print, node)), \";\"];\n\t},\n\t[NodeType.TupleStructItemDeclaration](print, node) {\n\t\treturn [print(\"pub\"), print(\"typeAnnotation\")];\n\t},\n\t[NodeType.UnionDeclaration](print, node) {\n\t\treturn [print(\"pub\"), \"union\", printGenerics_x_whereBounds(print, node, \"\"), printObject(print, node)];\n\t},\n\t[NodeType.EnumDeclaration](print, node) {\n\t\treturn [print(\"pub\"), \"enum\", printGenerics_x_whereBounds(print, node, \"\"), printEnumBody(print, node)];\n\t},\n\t[NodeType.EnumMemberDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprintAssignment(\n\t\t\t\tprint(\"id\"), //\n\t\t\t\t\" =\",\n\t\t\t\t\"value\"\n\t\t\t),\n\t\t];\n\t},\n\t[NodeType.EnumMemberTupleDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprintAssignment(\n\t\t\t\t[print(\"id\"), printArrayLike(print, node)], //\n\t\t\t\t\" =\",\n\t\t\t\t\"value\"\n\t\t\t),\n\t\t];\n\t},\n\t[NodeType.EnumMemberStructDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprintAssignment(\n\t\t\t\t[print(\"id\"), printObject(print, node)], //\n\t\t\t\t\" =\",\n\t\t\t\t\"value\"\n\t\t\t),\n\t\t];\n\t},\n\t[NodeType.TraitDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"trait\",\n\t\t\tprintGenerics_x_whereBounds(print, node, printDeclarationTypeBounds(print, node, \":\")),\n\t\t\tadjustClause(node, printBlockBody(print, node)),\n\t\t];\n\t},\n\t[NodeType.AutoTraitDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"auto trait \",\n\t\t\tprint(\"id\"),\n\t\t\t\" \",\n\t\t\tprintBlockBody(print, node as any), // see \"transform.ts\"\n\t\t];\n\t},\n\t[NodeType.TraitAliasDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"trait\",\n\t\t\tprintGenerics_x_whereBounds(print, node, printDeclarationTypeBounds(print, node, \" =\")),\n\t\t\t\";\",\n\t\t];\n\t},\n\t[NodeType.ImplDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\t\"impl\",\n\t\t\tprintGenerics_x_whereBounds(print, node, [print.b(\"const\"), printImplTraitForType(print, node)]),\n\t\t\tadjustClause(node, printBlockBody(print, node)),\n\t\t];\n\t},\n\t[NodeType.NegativeImplDeclaration](print, node) {\n\t\treturn [\n\t\t\tprint(\"pub\"),\n\t\t\t\"impl\",\n\t\t\tprintGenerics_x_whereBounds(print, node, [\"!\", printImplTraitForType(print, node)]),\n\t\t\t\" \",\n\t\t\tprintBlockBody(print, node as any), // see \"transform.ts\"\n\t\t];\n\t},\n\t[NodeType.ExpressionTypeSelector](print, node) {\n\t\treturn group([\"<\", print(\"typeTarget\"), f` as ${print(\"typeExpression\")}`, \">\"]);\n\t},\n\t[NodeType.ExpressionTypeCast](print, node) {\n\t\treturn [print(\"typeCallee\"), f`::${printTypeArguments(print, node)}`];\n\t},\n\t[NodeType.ExpressionAsTypeCast](print, node) {\n\t\treturn [print(\"expression\"), \" as \", print(\"typeExpression\")];\n\t},\n\t[NodeType.ReturnExpression](print, node) {\n\t\treturn [\"return\", printFlowControlExpression(print, node)];\n\t},\n\t[NodeType.BreakExpression](print, node) {\n\t\treturn [\"break\", f` ${print(\"label\")}`, printFlowControlExpression(print, node)];\n\t},\n\t[NodeType.ContinueExpression](print, node) {\n\t\treturn [\"continue\", f` ${print(\"label\")}`];\n\t},\n\t[NodeType.YieldExpression](print, node) {\n\t\treturn [\"yield\", printFlowControlExpression(print, node)];\n\t},\n\t[NodeType.RangeLiteral](print, node) {\n\t\treturn [print(\"lower\"), \"..\", print.b(\"last\", \"=\"), print(\"upper\")];\n\t},\n\t[NodeType.CallExpression](print, node) {\n\t\treturn printCallExpression(print, node);\n\t},\n\t[NodeType.MemberExpression](print, node) {\n\t\treturn printMemberExpression(print, node);\n\t},\n\t[NodeType.AwaitExpression](print, node) {\n\t\treturn [print(\"expression\"), \".await\"];\n\t},\n\t[NodeType.UnwrapExpression](print, node) {\n\t\treturn [print(\"expression\"), \"?\"];\n\t},\n\t[NodeType.ParenthesizedExpression](print, node) {\n\t\texit.never();\n\t\tconst shouldHug = !hasComment(node.expression) && (is_ArrayOrTupleLiteral(node.expression) || is_StructLiteral(node.expression));\n\t\tif (shouldHug) return [\"(\", print(\"expression\"), \")\"];\n\t\treturn group([\"(\", indent([softline, print(\"expression\")]), softline, \")\"]);\n\t},\n\t[NodeType.MinusExpression](print, node) {\n\t\treturn printUnaryExpression(\"-\", node);\n\t},\n\t[NodeType.NotExpression](print, node) {\n\t\treturn printUnaryExpression(\"!\", node);\n\t},\n\t[NodeType.OrExpression](print, node) {\n\t\treturn printBinaryishExpression(print, node);\n\t},\n\t[NodeType.AndExpression](print, node) {\n\t\treturn printBinaryishExpression(print, node);\n\t},\n\t[NodeType.ReassignmentExpression](print, node) {\n\t\treturn printAssignment(print(\"left\"), \" =\", \"right\");\n\t},\n\t[NodeType.UnassignedExpression](print, node) {\n\t\treturn \"_\";\n\t},\n\t[NodeType.OperationExpression](print, node) {\n\t\treturn printBinaryishExpression(print, node);\n\t},\n\t[NodeType.ReassignmentOperationExpression](print, node) {\n\t\treturn printAssignment(print(\"left\"), \" \" + node.kind, \"right\");\n\t},\n\t[NodeType.ComparisonExpression](print, node) {\n\t\treturn printBinaryishExpression(print, node);\n\t},\n\t[NodeType.LetScrutinee](print, node) {\n\t\treturn [\"let \", printAssignment(print(\"pattern\"), \" =\", \"expression\")];\n\t},\n\t[NodeType.ClosureFunctionExpression](print, node) {\n\t\treturn printArrowFunction(print, node);\n\t},\n\t[NodeType.ClosureFunctionParameterDeclaration](print, node) {\n\t\treturn group(printAnnotatedPattern(print, node));\n\t},\n\t[NodeType.BlockExpression](print, node) {\n\t\treturn [\n\t\t\tf`${print(\"label\")}: `,\n\t\t\tprint.b(\"const\"),\n\t\t\tprint.b(\"async\"),\n\t\t\tprint.b(\"move\"),\n\t\t\tprint.b(\"unsafe\"),\n\t\t\tprintBlockBody(print, node),\n\t\t];\n\t},\n\t[NodeType.LoopBlockExpression](print, node) {\n\t\treturn [f`${print(\"label\")}: `, \"loop \", printBlockBody(print, node)];\n\t},\n\t[NodeType.WhileBlockExpression](print, node) {\n\t\treturn [f`${print(\"label\")}: `, \"while \", printCondition(print, node), printBlockBody(print, node)];\n\t},\n\t[NodeType.ForInBlockExpression](print, node) {\n\t\treturn [f`${print(\"label\")}: `, \"for \", print(\"pattern\"), \" in \", print(\"expression\"), \" \", printBlockBody(print, node)];\n\t},\n\t[NodeType.IfBlockExpression](print, node) {\n\t\treturn [f`${print(\"label\")}: `, printIfBlock(print, node)];\n\t},\n\t[NodeType.TryBlockExpression](print, node) {\n\t\treturn [f`${print(\"label\")}: `, \"try \", printBlockBody(print, node)];\n\t},\n\t[NodeType.MatchExpression](print, node) {\n\t\tconst id = Symbol(\"match\");\n\t\tconst expr = print(\"expression\");\n\t\tconst needs_parens = pathCall(node, \"expression\", needsParens);\n\n\t\tlet printed: Doc = [\n\t\t\tf`${print(\"label\")}: `,\n\t\t\t\"match \",\n\t\t\tneeds_parens ? expr : group([indent([softline, expr]), softline], { id }),\n\t\t\tneeds_parens ? \" \" : !willBreak(expr) ? ifBreak(\"\", \" \", { groupId: id }) : \"\" /*  ifBreak(\"\", \" \", { groupId: id }) */,\n\t\t\tprintBlockBody(print, node),\n\t\t];\n\n\t\tconst parent = getParentNode()!;\n\t\tif (is_ClosureFunctionExpression(parent) && parent.expression === node) {\n\t\t\tprinted = parenthesize_if_break([indent([softline, printed]), softline]);\n\t\t}\n\t\treturn printed;\n\t},\n\t[NodeType.MatchExpressionCase](print, node) {\n\t\treturn group([\n\t\t\tgroup(print(\"pattern\")),\n\t\t\t\" \",\n\t\t\tprintIfBlockCondition(print, node),\n\t\t\t\"=>\", //\n\t\t\t(is_BlockExpression(node.expression) || is_IfBlockExpression(node.expression)) &&\n\t\t\t!hasComment(node.expression, 0, (comment) => getOptions().danglingAttributes.includes(comment as any))\n\t\t\t\t? [\" \", print(\"expression\")]\n\t\t\t\t: group(indent([line, print(\"expression\")])),\n\t\t]);\n\t\treturn printAssignment(\n\t\t\t[print(\"pattern\"), \" \", printIfBlockCondition(print, node)], //\n\t\t\t\"=>\",\n\t\t\t\"expression\"\n\t\t);\n\t\treturn [print(\"pattern\"), \" \", printIfBlockCondition(print, node)];\n\t},\n\t[NodeType.StructLiteral](print, node) {\n\t\treturn [print(\"struct\"), printObject(print, node)];\n\t},\n\t[NodeType.StructLiteralPropertyShorthand](print, node) {\n\t\treturn print(\"value\");\n\t},\n\t[NodeType.StructLiteralProperty](print, node) {\n\t\treturn [print(\"key\"), \": \", print(\"value\")];\n\t},\n\t[NodeType.StructLiteralPropertySpread](print, node) {\n\t\treturn [\"..\", print(\"expression\")];\n\t},\n\t[NodeType.StructLiteralRestUnassigned](print, node) {\n\t\treturn \"..\";\n\t},\n\t[NodeType.ArrayLiteral](print, node) {\n\t\treturn printArrayLike(print, node);\n\t},\n\t[NodeType.SizedArrayLiteral](print, node) {\n\t\treturn sg_duo`[${print(\"initExpression\")};${print(\"sizeExpression\")}]`;\n\t},\n\t[NodeType.TupleLiteral](print, node) {\n\t\treturn printArrayLike(print, node);\n\t},\n\t[NodeType.ReferenceExpression](print, node) {\n\t\treturn printUnaryExpression([\"&\", print.b(\"mut\")], node);\n\t},\n\t[NodeType.RawReferenceExpression](print, node) {\n\t\treturn printUnaryExpression(`&raw ${node.kind} `, node);\n\t},\n\t[NodeType.DereferenceExpression](print, node) {\n\t\treturn printUnaryExpression(\"*\", node);\n\t},\n\t[NodeType.BoxExpression](print, node) {\n\t\treturn printUnaryExpression(\"box \", node);\n\t},\n\t[NodeType.UnionPattern](print, node) {\n\t\treturn printUnionPattern(print, node);\n\t},\n\t[NodeType.ParenthesizedPattern](print, node) {\n\t\texit.never();\n\t\treturn sg_single`(${print(\"pattern\")})`;\n\t},\n\t[NodeType.RestPattern](print, node) {\n\t\treturn \"..\";\n\t},\n\t[NodeType.WildcardPattern](print, node) {\n\t\treturn \"_\";\n\t},\n\t[NodeType.PatternVariableDeclaration](print, node) {\n\t\treturn [print.b(\"ref\"), print.b(\"mut\"), printAssignment(print(\"id\"), \" @\", \"pattern\")];\n\t},\n\t[NodeType.StructPattern](print, node) {\n\t\treturn [print(\"struct\"), printObject(print, node)];\n\t},\n\t[NodeType.StructPatternPropertyDestructured](print, node) {\n\t\treturn [print(\"key\"), \": \", print(\"pattern\")];\n\t},\n\t[NodeType.StructPatternPropertyShorthand](print, node) {\n\t\treturn [print.b(\"box\"), print.b(\"ref\"), print.b(\"mut\"), print(\"id\")];\n\t},\n\t[NodeType.TuplePattern](print, node) {\n\t\treturn [print(\"struct\"), printArrayLike(print, node)];\n\t},\n\t[NodeType.ArrayPattern](print, node) {\n\t\treturn printArrayLike(print, node);\n\t},\n\t[NodeType.ReferencePattern](print, node) {\n\t\treturn [\"&\", print.b(\"mut\"), print(\"pattern\")];\n\t},\n\t[NodeType.BoxPattern](print, node) {\n\t\treturn [\"box \", print(\"pattern\")];\n\t},\n\t[NodeType.MinusPattern](print, node) {\n\t\treturn [\"-\", print(\"pattern\")];\n\t},\n\t[NodeType.RangePattern](print, node) {\n\t\treturn [print(\"lower\"), \"..\", print.b(\"last\", \"=\"), print(\"upper\")];\n\t},\n\t[NodeType.TypeCall](print, node) {\n\t\treturn [print(\"typeCallee\"), printTypeArguments(print, node)];\n\t},\n\t[NodeType.TypeCallNamedArgument](print, node) {\n\t\treturn printAssignment(print(\"target\"), \" =\", \"typeExpression\");\n\t},\n\t[NodeType.TypeCallNamedBound](print, node) {\n\t\treturn [print(\"typeTarget\"), printTypeBounds(\":\", print, node)];\n\t},\n\t[NodeType.LtElided](print, node) {\n\t\treturn \"'_\";\n\t},\n\t[NodeType.LtStatic](print, node) {\n\t\treturn \"'static\";\n\t},\n\t[NodeType.TypeNever](print, node) {\n\t\treturn \"!\";\n\t},\n\t[NodeType.TypeInferred](print, node) {\n\t\treturn \"_\";\n\t},\n\t[NodeType.GenericTypeParameterDeclaration](print, node) {\n\t\treturn printAssignment(\n\t\t\t[print(\"id\"), printTypeBounds(\":\", print, node)], //\n\t\t\t\" =\",\n\t\t\t\"typeDefault\"\n\t\t);\n\t},\n\t[NodeType.ConstTypeParameterDeclaration](print, node) {\n\t\treturn [\n\t\t\t\"const \",\n\t\t\tprintAssignment(\n\t\t\t\t[print(\"id\"), printTypeAnnotation(print, node)], //\n\t\t\t\t\" =\",\n\t\t\t\t\"typeDefault\"\n\t\t\t),\n\t\t];\n\t},\n\t[NodeType.GenericLtParameterDeclaration](print, node) {\n\t\treturn [print(\"id\"), printLtBounds(\":\", print, node)];\n\t},\n\t[NodeType.WhereTypeBoundDeclaration](print, node) {\n\t\treturn [printLtParameters(print, node), print(\"typeTarget\"), printTypeBounds(\":\", print, node)];\n\t},\n\t[NodeType.WhereLtBoundDeclaration](print, node) {\n\t\treturn [print(\"ltTarget\"), printLtBounds(\":\", print, node)];\n\t},\n\t[NodeType.TypeTraitBound](print, node) {\n\t\treturn [print.b(\"maybeConst\", \"~const \"), print.b(\"optional\", \"?\"), printLtParameters(print, node), print(\"typeExpression\")];\n\t},\n\t[NodeType.TypeDynBounds](print, node) {\n\t\treturn printTypeBounds(\"dyn\", print, node);\n\t},\n\t[NodeType.TypeImplBounds](print, node) {\n\t\treturn printTypeBounds(\"impl\", print, node);\n\t},\n\t[NodeType.TypeFnPointer](print, node) {\n\t\treturn [printLtParameters(print, node), print.b(\"unsafe\"), print(\"extern\"), \"fn\", printParametersAndReturnType(node)];\n\t},\n\t[NodeType.TypeFnPointerParameter](print, node) {\n\t\treturn [f`${print(\"id\")}: `, print(\"typeAnnotation\")];\n\t},\n\t[NodeType.TypeFunction](print, node) {\n\t\treturn [print(\"callee\"), printParametersAndReturnType(node)];\n\t},\n\t[NodeType.TypeTuple](print, node) {\n\t\treturn printArrayLike(print, node);\n\t},\n\t[NodeType.TypeSizedArray](print, node) {\n\t\treturn sg_duo`[${print(\"typeExpression\")};${print(\"sizeExpression\")}]`;\n\t\tif (isSimpleType(node)) return [\"[\", print(\"typeExpression\"), \"; \", print(\"sizeExpression\"), \"]\"];\n\t},\n\t[NodeType.TypeSlice](print, node) {\n\t\tif (isSimpleType(node)) return [\"[\", print(\"typeExpression\"), \"]\"];\n\t\treturn sg_single`[${print(\"typeExpression\")}]`;\n\t},\n\t[NodeType.TypeReference](print, node) {\n\t\treturn [\"&\", f`${print(\"lt\")} `, print.b(\"mut\"), print(\"typeExpression\")];\n\t},\n\t[NodeType.TypeDereferenceConst](print, node) {\n\t\treturn [\"*const \", print(\"typeExpression\")];\n\t},\n\t[NodeType.TypeDereferenceMut](print, node) {\n\t\treturn [\"*mut \", print(\"typeExpression\")];\n\t},\n\t[NodeType.TypeParenthesized](print, node) {\n\t\texit.never();\n\t\treturn sg_single`(${print(\"typeExpression\")})`;\n\t},\n};\n"
  },
  {
    "path": "src/format/styling.ts",
    "content": "import {\n\tClosureFunctionExpression,\n\tComparisonExpression,\n\tConditionExpression,\n\tEnumDeclaration,\n\tEnumMemberStructDeclaration,\n\tExpressionAsTypeCast,\n\tExpressionNode,\n\tExpressionStatement,\n\tExpressionWithBody,\n\tLeftRightExpression,\n\tLogicalExpression,\n\tMacroDeclaration,\n\tMacroRulesDeclaration,\n\tMissingNode,\n\tNode,\n\tNodeType,\n\tNodeWithBody,\n\tNodeWithBodyOrCases,\n\tOperationExpression,\n\tPRCD,\n\tStructDeclaration,\n\tStructLiteral,\n\tStructPattern,\n\tTK,\n\tUnionDeclaration,\n} from \"jinx-rust\";\nimport {\n\tcan_have_OuterAttributes,\n\tgetAstPath,\n\tgetPrecedence,\n\thasAttributes,\n\thasBody,\n\thasCondition,\n\thasItems,\n\thasLetScrutineeCondition,\n\thasOuterAttributes,\n\thasProperties,\n\tis_Attribute,\n\tis_AttributeOrDocComment,\n\tis_AwaitExpression,\n\tis_BitwiseOperator,\n\tis_CallExpression,\n\tis_ClosureFunctionExpression,\n\tis_ComparisonExpression,\n\tis_DocCommentAttribute,\n\tis_ElseBlock,\n\tis_EnumMemberDeclaration,\n\tis_EqualityOperator,\n\tis_ExpressionAsTypeCast,\n\tis_ExpressionStatement,\n\tis_ExpressionWithBody,\n\tis_ExpressionWithBodyOrCases,\n\tis_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation,\n\tis_FlowControlExpression,\n\tis_FlowControlMaybeValueExpression,\n\tis_ForInBlockExpression,\n\tis_Identifier,\n\tis_IfBlockExpression,\n\tis_ImplicitReturnAbleNode,\n\tis_LeftRightExpression,\n\tis_LetScrutinee,\n\tis_Literal,\n\tis_LiteralNumberLike,\n\tis_LogicalExpression,\n\tis_LoopBlockExpression,\n\tis_MatchExpression,\n\tis_MatchExpressionCase,\n\tis_MemberExpression,\n\tis_NodeWithBodyNoBody,\n\tis_NodeWithMaybePatternNoUnionBody,\n\tis_OperationExpression,\n\tis_ParenthesizedNode,\n\tis_PatternVariableDeclaration,\n\tis_PostfixExpression,\n\tis_RangeLiteral,\n\tis_ReassignmentNode,\n\tis_ReturnExpression,\n\tis_StatementNode,\n\tis_StructLiteral,\n\tis_StructLiteralProperty,\n\tis_StructPatternProperty,\n\tis_StructPropertyDeclaration,\n\tis_TypeBoundsStandaloneNode,\n\tis_TypeFunctionNode,\n\tis_TypeTraitBound,\n\tis_UnaryExpression,\n\tis_UnaryType,\n\tis_UnionPattern,\n\tis_WhileBlockExpression,\n\tis_YieldExpression,\n\tis_bitshiftOperator,\n\tis_multiplicativeOperator,\n} from \"jinx-rust/utils\";\nimport { BlockLikeMacroInvocation, is_BlockLikeMacroInvocation, is_CallExpression_or_CallLikeMacroInvocation } from \"../transform\";\nimport { exit, last_of } from \"../utils/common\";\nimport { CF, hasBreaklineAfter, hasComment } from \"./comments\";\nimport { flowControlExpressionNeedsOuterParens } from \"./core\";\nimport { Doc, hardline, softline, willBreak } from \"./external\";\nimport {\n\tassertPathAtNode,\n\tgetContext,\n\tgetGrandParentNode,\n\tgetNode,\n\tgetOptions,\n\tgetParentNode,\n\tgetPrintFn,\n\tis_printing_macro,\n\tpathCallAtParent,\n\tpathCallParentOf,\n\tstackIncludes,\n} from \"./plugin\";\n\nexport function needsOuterSoftbreakParens(node: Node) {\n\tconst parent = getParentNode(node);\n\n\tif (!parent) return false;\n\n\tif (is_ExpressionAsTypeCast(node)) {\n\t\treturn precedenceNeedsParens(node, parent);\n\t}\n\n\tif (\n\t\tis_FlowControlMaybeValueExpression(parent) && //\n\t\tparent.expression === node &&\n\t\tflowControlExpressionNeedsOuterParens(parent)\n\t) {\n\t\treturn true;\n\t}\n\tif (\n\t\tis_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(node) &&\n\t\t(false ||\n\t\t\t(is_MemberExpression(parent) && parent.expression === node) ||\n\t\t\t(is_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(parent) && !is_ElseBlock(node, parent)))\n\t) {\n\t\treturn true;\n\t}\n\n\tif (is_UnionPattern(node) && is_NodeWithMaybePatternNoUnionBody(parent)) {\n\t\treturn true;\n\t}\n\n\tif (hasComment(node)) {\n\t\tif (is_UnaryExpression(parent)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (hasComment(node, CF.Line)) {\n\t\t\tif (is_ReturnExpression(parent) || (is_YieldExpression(parent) && parent.expression === node)) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\tif (\n\t\t\thasComment(node, CF.Leading, (comment) => is_Attribute(comment) && !comment.inner) &&\n\t\t\t!can_have_OuterAttributes(node, parent, true)\n\t\t) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n\nexport function needsInnerParens(node: Node) {\n\tif (needsOuterSoftbreakParens(node)) {\n\t\treturn false;\n\t}\n\n\tconst parent = getParentNode(node);\n\n\tif (!parent) {\n\t\treturn false;\n\t}\n\n\tif (is_Identifier(node)) {\n\t\treturn false;\n\t}\n\n\tif (is_Literal(node)) {\n\t\treturn is_LiteralNumberLike(node) && is_MemberExpression(parent) && node === parent.expression;\n\t}\n\n\tif (is_CallExpression(parent) && parent.callee === node && is_MemberExpression(node)) {\n\t\treturn !getOptions().actuallyMethodNodes.has(node);\n\t}\n\n\tif (is_ReassignmentNode(node)) {\n\t\tif (is_printing_macro()) {\n\t\t\treturn false;\n\t\t}\n\n\t\tif (is_ClosureFunctionExpression(parent) && node === parent.expression) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (is_ExpressionStatement(parent)) {\n\t\t\treturn is_StructLiteral(node.left);\n\t\t}\n\n\t\tif (is_ReassignmentNode(parent)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}\n\n\tif (is_ParenthesizedNode(parent)) {\n\t\treturn false;\n\t}\n\n\tif (is_ExpressionStatement(parent)) {\n\t\treturn false;\n\t}\n\n\tif (is_RangeLiteral(node)) {\n\t\treturn (\n\t\t\tis_ExpressionAsTypeCast(parent) ||\n\t\t\tis_LogicalExpression(parent) ||\n\t\t\tis_UnaryExpression(parent) ||\n\t\t\tis_PostfixExpression(parent) ||\n\t\t\t(is_MemberExpression(parent) && node === parent.expression) ||\n\t\t\t(is_CallExpression(parent) && node === parent.callee) ||\n\t\t\tis_OperationExpression(parent) ||\n\t\t\tis_ComparisonExpression(parent)\n\t\t);\n\t}\n\n\tif (is_LetScrutinee(parent) && is_LogicalExpression(node) && parent.expression === (node as any)) {\n\t\treturn true;\n\t}\n\n\tif (is_UnaryExpression(node)) {\n\t\tswitch (parent.nodeType) {\n\t\t\tcase NodeType.MemberExpression:\n\t\t\tcase NodeType.AwaitExpression:\n\t\t\t\treturn node === parent.expression;\n\t\t\tcase NodeType.CallExpression:\n\t\t\t\treturn node === parent.callee;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n\n\tif (is_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(node)) {\n\t\tif (is_ExpressionWithBodyOrCases(parent)) {\n\t\t\treturn !is_ElseBlock(node, parent);\n\t\t}\n\t\tif (is_LetScrutinee(parent) && parent.expression === node && is_ExpressionWithBodyOrCases(getGrandParentNode())) {\n\t\t\treturn true;\n\t\t}\n\t\treturn (\n\t\t\tis_ExpressionAsTypeCast(parent) ||\n\t\t\tis_LogicalExpression(parent) ||\n\t\t\tis_UnaryExpression(parent) ||\n\t\t\tis_PostfixExpression(parent) ||\n\t\t\t(is_MemberExpression(parent) && node === parent.expression) ||\n\t\t\t(is_CallExpression(parent) && node === parent.callee) ||\n\t\t\tis_OperationExpression(parent) ||\n\t\t\tis_ComparisonExpression(parent) ||\n\t\t\tis_RangeLiteral(parent)\n\t\t);\n\t}\n\n\tif (is_StructLiteral(node)) {\n\t\tif (is_ExpressionWithBodyOrCases(parent)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (is_LetScrutinee(parent) && parent.expression === node && is_ExpressionWithBodyOrCases(getGrandParentNode())) {\n\t\t\treturn true;\n\t\t}\n\t\tif (is_UnaryExpression(parent) || is_PostfixExpression(parent) || is_MemberExpression(parent)) {\n\t\t\treturn parent.expression === node;\n\t\t}\n\t\tif (is_CallExpression(parent)) {\n\t\t\treturn parent.callee === node;\n\t\t}\n\t}\n\n\tif (is_LogicalExpression(node) || is_OperationExpression(node) || is_ComparisonExpression(node) || is_ClosureFunctionExpression(node)) {\n\t\treturn precedenceNeedsParens(node, parent);\n\t}\n\n\tif (is_TypeFunctionNode(node)) {\n\t\tconst gp = getGrandParentNode();\n\t\tif (node.returnType && is_TypeTraitBound(parent) && is_TypeBoundsStandaloneNode(gp) && last_of(gp.typeBounds) !== parent) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\tif (is_TypeBoundsStandaloneNode(node)) {\n\t\treturn (\n\t\t\t(is_UnaryType(parent) && node.typeBounds.length > 1) ||\n\t\t\tis_TypeBoundsStandaloneNode(parent) ||\n\t\t\tis_TypeTraitBound(parent) ||\n\t\t\t(is_TypeFunctionNode(parent) && parent.returnType === node)\n\t\t);\n\t}\n\n\tif (is_PatternVariableDeclaration(parent)) {\n\t\treturn is_UnionPattern(node);\n\t}\n\n\treturn false;\n}\n\nfunction precedenceNeedsParens(node: LeftRightExpression | ClosureFunctionExpression | ExpressionAsTypeCast, parent: Node) {\n\tif (is_UnaryExpression(parent) || is_PostfixExpression(parent)) return true;\n\tif (is_ReassignmentNode(parent)) return parent.left === node;\n\tif (is_MemberExpression(parent)) return parent.expression === node;\n\tif (is_CallExpression(parent)) return parent.callee === node;\n\tif (is_ExpressionAsTypeCast(parent)) return !is_ExpressionAsTypeCast(node);\n\tif (is_LogicalExpression(parent)) return is_LogicalExpression(node) ? parent.nodeType !== node.nodeType : evalPrecedence(node, parent);\n\tif (is_OperationExpression(parent) || is_ComparisonExpression(parent)) return evalPrecedence(node, parent);\n\treturn false;\n\tfunction evalPrecedence(\n\t\tchild: LeftRightExpression | ClosureFunctionExpression | ExpressionAsTypeCast,\n\t\tparent: ComparisonExpression | OperationExpression | LogicalExpression\n\t) {\n\t\tif (is_ExpressionAsTypeCast(child) || is_ClosureFunctionExpression(child)) {\n\t\t\treturn true;\n\t\t}\n\t\tfunction getPrec(node, bool) {\n\t\t\t// if (is_EqualityOperator(node.tk)) {\n\t\t\t// \treturn 11.3;\n\t\t\t// }\n\t\t\t// if (is_LargerLesserOperator(node.tk)) {\n\t\t\t// \treturn 11.6;\n\t\t\t// }\n\t\t\treturn getPrecedence(node, bool);\n\t\t}\n\n\t\tconst childPRCD = getPrec(child, is_insideScrutinee(child));\n\t\tconst parentPRCD = getPrec(parent, is_insideScrutinee(parent));\n\n\t\tif (parentPRCD > childPRCD) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (parentPRCD === childPRCD && parent.right === child) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (parentPRCD === childPRCD && !shouldFlatten(parent, child)) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (parentPRCD < childPRCD && child.tk === TK[\"%\"]) {\n\t\t\treturn parentPRCD === PRCD[\"+-\"];\n\t\t}\n\n\t\tif (is_BitwiseOperator(parent.tk) || (is_BitwiseOperator(child.tk) && is_EqualityOperator(parent.tk))) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}\n}\n\nexport function shouldFlatten(parent: ExpressionNode | ConditionExpression, node: ExpressionNode | ConditionExpression) {\n\tif (getPrecedence(node, is_insideScrutinee(node)) !== getPrecedence(parent, is_insideScrutinee(parent))) return false;\n\tif (is_ComparisonExpression(parent) && is_ComparisonExpression(node)) return false;\n\tif (is_OperationExpression(parent) && is_OperationExpression(node)) {\n\t\tif (\n\t\t\t(node.tk === TK[\"%\"] && is_multiplicativeOperator(parent.tk)) ||\n\t\t\t(parent.tk === TK[\"%\"] && is_multiplicativeOperator(node.tk)) ||\n\t\t\t(node.tk !== parent.tk && is_multiplicativeOperator(node.tk) && is_multiplicativeOperator(parent.tk)) ||\n\t\t\t(is_bitshiftOperator(node.tk) && is_bitshiftOperator(parent.tk))\n\t\t)\n\t\t\treturn false;\n\t}\n\treturn true;\n}\n\nexport function needsParens(node: Node) {\n\treturn needsOuterSoftbreakParens(node) || needsInnerParens(node);\n}\n\nexport function stmtNeedsSemi(stmt: ExpressionStatement, disregardExprType = false) {\n\treturn pathCallParentOf(stmt, (parent) => needsSemi(parent as any, stmt, disregardExprType));\n}\n\nconst NoNode = { nodeType: 0 } as MissingNode;\n\nexport function needsSemi(parent: NodeWithBody, stmt: ExpressionStatement, disregardExprType = false) {\n\tconst expr = disregardExprType ? NoNode : stmt.expression!;\n\tconst hadSemi = !disregardExprType && stmt.semi;\n\n\treturn (\n\t\t!!expr &&\n\t\t(forcePreserveSemi()\n\t\t\t? true\n\t\t\t: shouldNeverSemi()\n\t\t\t? false\n\t\t\t: shouldPreserveSemi()\n\t\t\t? hadSemi || shouldAlwaysSemi() || canAutoCompleteSemi()\n\t\t\t: true)\n\t);\n\n\tfunction forcePreserveSemi() {\n\t\t/** Rust Compiler bug (preserve optional semicolon) */\n\t\t// rust-lang/rust#70844 https://github.com/rust-lang/rust/issues/70844\n\t\t// issue#22 https://github.com/jinxdash/prettier-plugin-rust/issues/22\n\t\treturn (\n\t\t\thadSemi &&\n\t\t\tstmt === last_of(parent.body!) &&\n\t\t\t((is_IfBlockExpression(expr) &&\n\t\t\t\thasLetScrutineeCondition(expr) &&\n\t\t\t\t!(is_LetScrutinee(expr.condition) && is_Identifier(expr.condition.expression))) ||\n\t\t\t\t(is_MatchExpression(expr) && !is_Identifier(expr.expression)))\n\t\t);\n\t}\n\tfunction shouldNeverSemi() {\n\t\treturn is_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(expr);\n\t}\n\tfunction shouldPreserveSemi() {\n\t\treturn stmt === last_of(parent.body!) && (is_ImplicitReturnAbleNode(parent) || is_BlockLikeMacroInvocation(parent));\n\t}\n\tfunction shouldAlwaysSemi() {\n\t\treturn is_FlowControlExpression(expr) || is_ReassignmentNode(expr);\n\t}\n\tfunction canAutoCompleteSemi() {\n\t\treturn withPathAt(parent, function checkParent(child: NodeWithBodyOrCases): boolean {\n\t\t\treturn pathCallParentOf(child, (parent) => {\n\t\t\t\tif (is_IfBlockExpression(parent) && parent.else === child) {\n\t\t\t\t\t// if ... { ... } else if { ... } ...\n\t\t\t\t\t// ^ ------------------------------- parent\n\t\t\t\t\t//                     ^ ----------- child\n\t\t\t\t\treturn checkParent(parent);\n\t\t\t\t}\n\t\t\t\tif (is_ExpressionStatement(parent)) {\n\t\t\t\t\t// { .... { ... } ... }\n\t\t\t\t\t// ^ -----------------^ grandparent\n\t\t\t\t\t//        ^ --- ^       ExpressionStatement<child>\n\t\t\t\t\tif (hasOuterAttributes(parent)) return false;\n\t\t\t\t\treturn stmtNeedsSemi(parent, true);\n\t\t\t\t}\n\t\t\t\tif (is_MatchExpressionCase(parent) && parent.expression === child) {\n\t\t\t\t\treturn pathCallParentOf(parent, checkParent);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t});\n\t\t});\n\t}\n}\n\nexport function canInlineBlockBody(node: NodeWithBodyOrCases | BlockLikeMacroInvocation): boolean {\n\tif (!is_ExpressionWithBody(node)) {\n\t\treturn false;\n\t}\n\tconst body = node.body;\n\n\tif (body.length === 0) {\n\t\treturn canInlineInlineable(node);\n\t}\n\n\tif (body.length === 1) {\n\t\tconst stmt = body[0];\n\t\tif (is_AttributeOrDocComment(stmt)) {\n\t\t\treturn true;\n\t\t}\n\t\tif (is_ExpressionStatement(stmt) && !needsSemi(node, stmt)) {\n\t\t\t/**\n\t\t\t * parent ( ExpressionStatement | StructLiteralProperty | LetVariableDeclaration | ... )\n\t\t\t *   ...\n\t\t\t *   node {\n\t\t\t *     expr\n\t\t\t *   }\n\t\t\t *   ...\n\t\t\t *\n\t\t\t *\n\t\t\t * Q: Can you inline \"node { expr }\" ?\n\t\t\t */\n\t\t\tconst expr = stmt.expression!;\n\n\t\t\tif (\n\t\t\t\tis_FlowControlExpression(expr) || //\n\t\t\t\tis_ClosureFunctionExpression(expr) ||\n\t\t\t\tis_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(expr)\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn canInlineInlineable(node);\n\t\t}\n\t}\n\treturn false;\n}\n\n// function q(node: ExpressionWithBody) {\n// \tpathCallTopMostIfBlockExpression(node, (node) => {});\n// }\n\nfunction canInlineInlineable(node: ExpressionWithBody) {\n\tif (is_ForInBlockExpression(node) || is_LoopBlockExpression(node)) {\n\t\treturn false;\n\t}\n\tif (is_WhileBlockExpression(node)) {\n\t\treturn true;\n\t}\n\n\tconst parent = getParentNode(node)!;\n\n\tif (\n\t\tis_ExpressionStatement(parent) &&\n\t\t(!is_ImplicitReturnAbleNode(node) || pathCallAtParent(parent, (parent) => stmtNeedsSemi(parent, true)))\n\t) {\n\t\treturn false;\n\t}\n\n\tif (is_ElseBlock(node, parent)) {\n\t\treturn pathCallAtParent(parent, canInlineBlockBody);\n\t}\n\t// if (is_CaseBlock(node, parent)) {\n\t// \treturn false;\n\t// }\n\tif (is_IfBlockExpression(node)) {\n\t\tif (\n\t\t\t!node.else ||\n\t\t\t// hasLetScrutineeCondition(node) ||\n\t\t\tis_ExpressionWithBodyOrCases_or_BlockLikeMacroInvocation(node.condition) ||\n\t\t\twillBreak(getPrintFn(node)(\"condition\"))\n\t\t) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst grandparent = getGrandParentNode();\n\t\tif (is_ExpressionStatement(parent) && hasBody(grandparent) && grandparent.body.length > 1) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n\treturn (\n\t\tis_CallExpression_or_CallLikeMacroInvocation(parent) ||\n\t\thasItems(parent) ||\n\t\thasProperties(parent) ||\n\t\tis_ClosureFunctionExpression(parent) ||\n\t\tis_MemberExpression(parent) ||\n\t\tis_AwaitExpression(parent) ||\n\t\tis_LeftRightExpression(parent)\n\t);\n}\n\ntype NodeWithBracketContent =\n\t| NodeWithBodyOrCases\n\t| BlockLikeMacroInvocation\n\t| EnumDeclaration\n\t| StructDeclaration\n\t| StructLiteral\n\t| StructPattern\n\t| EnumMemberStructDeclaration\n\t| UnionDeclaration\n\t| MacroRulesDeclaration\n\t| MacroDeclaration;\n\nexport function emptyContent(node: NodeWithBracketContent): Doc {\n\tswitch (node.nodeType) {\n\t\tcase NodeType.Program:\n\t\tcase NodeType.MacroRulesDeclaration:\n\t\tcase NodeType.MacroDeclaration:\n\t\tcase NodeType.ExternBlockDeclaration:\n\t\tcase NodeType.ModuleDeclaration:\n\t\tcase NodeType.TraitDeclaration:\n\t\tcase NodeType.StructDeclaration:\n\t\tcase NodeType.MacroInvocation:\n\t\tcase NodeType.FunctionDeclaration:\n\t\tcase NodeType.ImplDeclaration:\n\t\tcase NodeType.UnionDeclaration:\n\t\tcase NodeType.EnumDeclaration:\n\t\tcase NodeType.EnumMemberStructDeclaration:\n\t\tcase NodeType.StructLiteral:\n\t\tcase NodeType.StructPattern:\n\t\t\t// case NodeType.MatchExpression:\n\t\t\treturn \"\";\n\t\tcase NodeType.BlockExpression:\n\t\tcase NodeType.WhileBlockExpression:\n\t\tcase NodeType.ForInBlockExpression:\n\t\tcase NodeType.TryBlockExpression:\n\t\tcase NodeType.IfBlockExpression:\n\t\t\treturn canInlineInlineable(node)\n\t\t\t\t? is_IfBlockExpression(node) || is_ElseBlock(node, getParentNode()!)\n\t\t\t\t\t? softline\n\t\t\t\t\t: \"\"\n\t\t\t\t: hardline;\n\t\tcase NodeType.LoopBlockExpression:\n\t\tcase NodeType.MatchExpression:\n\t\t\treturn hardline;\n\t\tdefault:\n\t\t\tif (is_NodeWithBodyNoBody(node)) {\n\t\t\t\treturn \"\";\n\t\t\t}\n\t\t\t__DEV__: exit.never(node);\n\t\t\treturn \"\";\n\t}\n}\n\nexport function is_insideScrutinee(target: Node) {\n\treturn withPathAt(target, (n) => stackIncludes(\"condition\") && r(n));\n\tfunction r(CHILD: Node) {\n\t\tswitch (CHILD.nodeType) {\n\t\t\tcase NodeType.OrExpression:\n\t\t\tcase NodeType.AndExpression:\n\t\t\t\treturn pathCallParentOf(CHILD, (PARENT) =>\n\t\t\t\t\thasCondition(PARENT) && PARENT.condition === CHILD //\n\t\t\t\t\t\t? hasLetScrutineeCondition(PARENT)\n\t\t\t\t\t\t: r(PARENT)\n\t\t\t\t);\n\t\t\tcase NodeType.LetScrutinee:\n\t\t\t\treturn true;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t}\n}\n\nfunction withPathAt<T extends Node, R>(target: T, callback: (target: T) => R): R {\n\tif (target === getNode()) return callback(target);\n\tif (target === getParentNode()) return pathCallAtParent(target, () => callback(target));\n\tif (stackIncludes(target)) return pathCallAtParent(getParentNode()!, () => withPathAt(target, callback));\n\treturn getContext().path.call(() => {\n\t\t__DEV__: assertPathAtNode(\"withPathAt\", target);\n\t\treturn callback(target); // @ts-ignore\n\t}, ...getAstPath(getNode(), target));\n}\nexport function shouldPrintOuterAttributesAbove(node: Node) {\n\treturn (\n\t\tis_StatementNode(node) ||\n\t\tis_MatchExpressionCase(node) ||\n\t\t(hasAttributes(node) &&\n\t\t\tnode.attributes.some(\n\t\t\t\tcanInlineOuterAttribute(node)\n\t\t\t\t\t? (attr) => is_DocCommentAttribute(attr) || hasBreaklineAfter(attr) //\n\t\t\t\t\t: is_DocCommentAttribute\n\t\t\t))\n\t);\n\tfunction canInlineOuterAttribute(node: Node) {\n\t\treturn (\n\t\t\tis_EnumMemberDeclaration(node) ||\n\t\t\tis_StructPropertyDeclaration(node) ||\n\t\t\tis_StructLiteralProperty(node) ||\n\t\t\tis_StructPatternProperty(node)\n\t\t);\n\t}\n}\n"
  },
  {
    "path": "src/index.ts",
    "content": "import { plugin } from \"./format/plugin\";\n\nexport default plugin;\nexport const languages = plugin.languages;\nexport const parsers = plugin.parsers;\nexport const printers = plugin.printers;\nexport const options = plugin.options;\nexport const defaultOptions = plugin.defaultOptions;\n"
  },
  {
    "path": "src/transform/custom/attribute.ts",
    "content": "import {\n\tAttrSegment,\n\tCallExpression,\n\tDelimKind,\n\tExpressionPath,\n\tIdentifier,\n\tLiteral,\n\tLocArray,\n\tMacroInvocation,\n\tNodeType,\n\tPunctuationToken,\n\tReassignmentExpression,\n\tTK,\n\trs,\n} from \"jinx-rust\";\nimport { isTK, start } from \"jinx-rust/utils\";\nimport { assert, exit } from \"../../utils/common\";\nimport { isIdent } from \"./utils\";\n\ntype SimpleAttrItem =\n\t| Identifier //\n\t| Literal\n\t| ExpressionPath\n\t| CallExpression\n\t| ReassignmentExpression\n\t| MacroInvocation;\n\nexport function transform_simpleAttrSyntax(segments: MacroInvocation[\"segments\"]) {\n\tassert(segments.length !== 0, segments.loc.url());\n\treturn transform_segments(segments, false);\n\n\tfunction transform_segments<N extends boolean>(\n\t\tseq: LocArray<AttrSegment>,\n\t\tnestedCall: N\n\t): N extends true ? LocArray<SimpleAttrItem, \"()\"> : SimpleAttrItem {\n\t\tlet i = 0;\n\n\t\tif (nestedCall) {\n\t\t\tconst args = rs.createLocArray<SimpleAttrItem, any>(DelimKind[\"()\"], seq.loc.clone());\n\t\t\twhile (i !== seq.length) {\n\t\t\t\targs.push(read(true));\n\t\t\t\tif (i === seq.length) break;\n\t\t\t\tassert(isTK(seq[i++], TK[\",\"]));\n\t\t\t}\n\t\t\treturn args as any;\n\t\t} else {\n\t\t\tconst res = read(true);\n\t\t\tassert(i === seq.length, res.loc.url());\n\t\t\treturn res as any;\n\t\t}\n\n\t\tfunction read(allowEq: boolean): SimpleAttrItem {\n\t\t\tlet lhs: Identifier | ExpressionPath;\n\n\t\t\tswitch (seq[i].nodeType) {\n\t\t\t\tcase NodeType.Literal:\n\t\t\t\t\treturn seq[i++] as Literal;\n\t\t\t\tcase NodeType.Identifier:\n\t\t\t\t\tlhs = seq[i++] as Identifier;\n\t\t\t\t\tbreak;\n\t\t\t\tcase NodeType.PunctuationToken:\n\t\t\t\t\tassert((seq[i] as PunctuationToken).tk === TK[\"::\"], seq[i].loc.url());\n\t\t\t\t\tlhs = eatPathSegment(undefined);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\texit.never();\n\t\t\t}\n\n\t\t\twhile (true) {\n\t\t\t\tif (i === seq.length) return lhs;\n\t\t\t\tconst seg = seq[i];\n\t\t\t\tswitch (seg.nodeType) {\n\t\t\t\t\tcase NodeType.PunctuationToken:\n\t\t\t\t\t\tswitch (seg.tk) {\n\t\t\t\t\t\t\tcase TK[\",\"]:\n\t\t\t\t\t\t\t\tassert(nestedCall);\n\t\t\t\t\t\t\t\treturn lhs;\n\t\t\t\t\t\t\tcase TK[\"=\"]: {\n\t\t\t\t\t\t\t\tassert(allowEq);\n\t\t\t\t\t\t\t\tconst right = (i++, read(false));\n\t\t\t\t\t\t\t\treturn rs.mockNode(NodeType.ReassignmentExpression, right.loc.cloneFrom(start(lhs)), {\n\t\t\t\t\t\t\t\t\ttk: TK[\"=\"],\n\t\t\t\t\t\t\t\t\tkind: DelimKind[\"=\"],\n\t\t\t\t\t\t\t\t\tleft: lhs,\n\t\t\t\t\t\t\t\t\tright,\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase TK[\"::\"]:\n\t\t\t\t\t\t\t\tlhs = eatPathSegment(lhs);\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\texit.never();\n\t\t\t\t\t\t}\n\t\t\t\t\tcase NodeType.DelimGroup:\n\t\t\t\t\t\tassert(seg.segments.dk === DelimKind[\"()\"]);\n\t\t\t\t\t\treturn rs.mockNode(NodeType.CallExpression, seq[i++].loc.cloneFrom(start(lhs)), {\n\t\t\t\t\t\t\tcallee: lhs,\n\t\t\t\t\t\t\ttypeArguments: undefined,\n\t\t\t\t\t\t\tmethod: undefined,\n\t\t\t\t\t\t\targuments: transform_segments(seg.segments, true),\n\t\t\t\t\t\t});\n\t\t\t\t\tdefault:\n\t\t\t\t\t\texit.never();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction eatPathSegment(left: undefined | Identifier | ExpressionPath) {\n\t\t\tconst segment = seq[i + 1];\n\t\t\tassert(isIdent(segment));\n\t\t\tconst res = rs.mockNode(NodeType.ExpressionPath, segment.loc.cloneFrom(start(left ?? seq[i])), { namespace: left, segment });\n\t\t\ti += 2;\n\t\t\treturn res;\n\t\t}\n\t}\n}\n"
  },
  {
    "path": "src/transform/custom/cfg_if.ts",
    "content": "import {\n\tDelimGroup,\n\tDelimKind,\n\tIfBlockExpression,\n\tLocArray,\n\tMacroInvocation,\n\tNodeType,\n\tNodeWithBody,\n\trs,\n\tSegment,\n\tSnippet,\n\tStatementNode,\n\tTK,\n} from \"jinx-rust\";\nimport { insertNodes, start, transferAttributes } from \"jinx-rust/utils\";\nimport { assert, iLast } from \"../../utils/common\";\nimport { isGroup, isIdent, isToken } from \"./utils\";\n\nexport function transform_macro_cfg_if(segments: MacroInvocation[\"segments\"]) {\n\tconst danglingAttributes: Snippet[\"danglingAttributes\"] = [];\n\tconst comments: Snippet[\"comments\"] = [];\n\n\tconst block = (function create_if_block(i: number): IfBlockExpression | undefined {\n\t\tif (i >= segments.length) return undefined;\n\n\t\tconst _if = segments[i];\n\t\tconst pound = segments[i + 1];\n\t\tconst grp = segments[i + 2];\n\t\tconst block = segments[i + 3];\n\t\tconst _else = segments[i + 4];\n\n\t\tassert(\n\t\t\tisIdent(_if, \"if\") &&\n\t\t\t\tisToken(pound, TK[\"#\"]) &&\n\t\t\t\tisGroup(grp, DelimKind[\"[]\"]) &&\n\t\t\t\tisGroup(block, DelimKind[\"{}\"]) &&\n\t\t\t\t(!_else || isIdent(_else, \"else\"))\n\t\t);\n\n\t\treturn create_block(block, (body) =>\n\t\t\trs.mockNode(NodeType.IfBlockExpression, block.loc.cloneFrom(start(_if)), {\n\t\t\t\tlabel: undefined,\n\t\t\t\tcondition: rs.mockNode(NodeType.Attribute, grp.loc.cloneFrom(start(pound)), {\n\t\t\t\t\tsegments: grp.segments,\n\t\t\t\t\tvalue: grp.segments.loc.sliceText(),\n\t\t\t\t\tline: false,\n\t\t\t\t\tinner: false,\n\t\t\t\t}) as any,\n\t\t\t\tbody: body,\n\t\t\t\telse: (_else && iLast(i + 5, segments)\n\t\t\t\t\t? function create_else_block(i: number) {\n\t\t\t\t\t\t\tconst block = segments[i];\n\t\t\t\t\t\t\tassert(isGroup(block, DelimKind[\"{}\"]));\n\t\t\t\t\t\t\treturn create_block(block, (body) =>\n\t\t\t\t\t\t\t\trs.mockNode(NodeType.BlockExpression, body.loc.clone(), {\n\t\t\t\t\t\t\t\t\tlabel: undefined,\n\t\t\t\t\t\t\t\t\tbody,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t);\n\t\t\t\t\t  }\n\t\t\t\t\t: create_if_block)(i + 5),\n\t\t\t})\n\t\t);\n\t})(0);\n\n\tconst ast = rs.createLocArray(\n\t\tsegments.dk,\n\t\tsegments.loc,\n\t\tblock && [\n\t\t\trs.mockNode(NodeType.ExpressionStatement, block.loc.clone(), {\n\t\t\t\texpression: block,\n\t\t\t\tsemi: false,\n\t\t\t}),\n\t\t]\n\t);\n\n\treturn rs.mockNode(NodeType.Snippet, segments.loc.clone(), { ast, danglingAttributes, comments });\n\n\tfunction create_block<R extends NodeWithBody>(\n\t\tgroup: DelimGroup<Segment> & { segments: { dk: 3 } },\n\t\tfn: (statements: LocArray<StatementNode, \"{}\">) => R\n\t): R {\n\t\tconst snippet = rs.toBlockBody(group.segments);\n\n\t\tinsertNodes(danglingAttributes, snippet.danglingAttributes);\n\t\tinsertNodes(comments, snippet.comments);\n\n\t\tconst block = fn(snippet.ast);\n\t\ttransferAttributes(snippet, block);\n\t\treturn block;\n\t}\n}\n"
  },
  {
    "path": "src/transform/custom/utils.ts",
    "content": "import { DelimGroup, DelimKind, Identifier, LocArray, PunctuationToken, Segment, TK } from \"jinx-rust\";\nimport { isTK, is_DelimGroup, is_Identifier, is_PunctuationToken } from \"jinx-rust/utils\";\n\nexport function isIdent(node: Segment | undefined, name?: string): node is Identifier {\n\treturn !!node && is_Identifier(node) && (null == name || node.name === name);\n}\nexport function isToken(node: Segment | undefined, tk?: TK): node is PunctuationToken {\n\treturn !!node && (null == tk ? is_PunctuationToken(node) : isTK(node, tk));\n}\nexport function isGroup<D extends DelimKind>(node: Segment | undefined, dk?: D): node is DelimGroup & { segments: LocArray<any, D> } {\n\treturn !!node && is_DelimGroup(node) && (null == dk || node.segments.dk === dk);\n}\n\nexport function isCallLike(tk_1: Segment | undefined, tk_2: Segment | undefined): boolean {\n\treturn !!tk_1 && !!tk_2 && is_Identifier(tk_1) && is_DelimGroup(tk_2) && tk_2.segments.dk === DelimKind[\"()\"];\n}\n"
  },
  {
    "path": "src/transform/index.ts",
    "content": "import {\n\tAttribute,\n\tAttributeOrDocComment,\n\tCallExpression,\n\tDelimKind,\n\tExpressionNode,\n\tLocArray,\n\tMacroInvocation,\n\tMemberExpression,\n\tNode,\n\tNodeType,\n\tNodeWithBodyNoBody,\n\tNodeWithTypeBounds,\n\tNTMap,\n\tProgramLike,\n\trs,\n\tSnippet,\n\tStatementNode,\n\tStructLiteral,\n\tStructPattern,\n\tTK,\n\tTypeBound,\n\tTypeBoundsStandaloneNode,\n\tTypeDynBounds,\n\tTypeTraitBound,\n} from \"jinx-rust\";\nimport {\n\tcountActualNodeChildren,\n\tdeleteAttributes,\n\teach_childNode,\n\tend,\n\tgetActualNodeChildren,\n\tgetBodyOrCases,\n\tgetMacroName,\n\tgetNodeChildren,\n\thasAttributes,\n\thasMethod,\n\thasTypeBounds,\n\tincludesTK,\n\tinsertNode,\n\tinsertNodes,\n\tis_AttributeOrDocComment,\n\tis_BareTypeTraitBound,\n\tis_BlockExpression,\n\tis_CallExpression,\n\tis_ClosureFunctionExpression,\n\tis_DocCommentAttribute,\n\tis_ExpressionStatement,\n\tis_ExpressionWithBodyOrCases,\n\tis_FlowControlExpression,\n\tis_IfBlockExpression,\n\tis_MacroInvocation,\n\tis_Node,\n\tis_NodeWithBodyNoBody,\n\tis_NodeWithBodyOrCases,\n\tis_Program,\n\tis_PunctuationToken,\n\tis_ReassignmentNode,\n\tis_Snippet,\n\tis_TypeBoundsStandaloneNode,\n\tis_TypeDynBounds,\n\tis_TypeImplBounds,\n\tis_TypeTraitBound,\n\townStart,\n\treassignNodeProperty,\n\tstart,\n\ttransferAttributes,\n\tunsafe_set_nodeType,\n} from \"jinx-rust/utils\";\nimport { isPrettierIgnoreAttribute, setPrettierIgnoreTarget } from \"../format/comments\";\nimport { is_StructSpread } from \"../format/core\";\nimport { CustomOptions } from \"../format/external\";\nimport { getOptions } from \"../format/plugin\";\nimport {\n\tArray_replace,\n\tArray_splice,\n\tassert,\n\tbinarySearchIn,\n\teach,\n\texit,\n\tiLast,\n\tlast_of,\n\tMap_get,\n\tspliceAll,\n\ttry_eval,\n} from \"../utils/common\";\nimport { transform_simpleAttrSyntax } from \"./custom/attribute\";\nimport { transform_macro_cfg_if } from \"./custom/cfg_if\";\n\nexport interface ExpressionLikeAttribute extends Attribute {\n\tsegments: LocArray<any, \"[]\">;\n}\n\nexport interface CallLikeMacroInvocation extends MacroInvocation {\n\tsegments: LocArray<any, any>;\n\tcallee: MacroInvocation[\"callee\"];\n\tmethod: undefined;\n\ttypeArguments: undefined;\n\targuments: LocArray<ExpressionNode, \"()\" | \"[]\" | \"{}\">;\n}\n\nexport interface BlockLikeMacroInvocation extends MacroInvocation {\n\tsegments: LocArray<any, any>;\n\tbody: LocArray<StatementNode, \"()\" | \"[]\" | \"{}\">;\n\tattributes?: AttributeOrDocComment[];\n}\n\nexport function is_CallLikeMacroInvocation(node: Node): node is CallLikeMacroInvocation {\n\treturn is_MacroInvocation(node) && \"arguments\" in node;\n}\n\nexport function is_BlockLikeMacroInvocation(node: Node): node is BlockLikeMacroInvocation {\n\treturn is_MacroInvocation(node) && \"body\" in node;\n}\n\nexport function is_CallExpression_or_CallLikeMacroInvocation(node: any): node is CallExpression | CallLikeMacroInvocation {\n\treturn is_CallExpression(node) || is_CallLikeMacroInvocation(node);\n}\n\nconst IGNORED_MACROS = new Set([\n\t// std\n\t// crates\n\t\"quote\",\n]);\n\nconst HARDCODED_MACRO_DELIMS = new Map<string, MacroInvocation[\"segments\"][\"dk\"]>();\neach(\n\t{\n\t\t[DelimKind[\"{}\"]]: [\n\t\t\t// std\n\t\t\t\"thread_local\",\n\t\t\t// crates\n\t\t\t\"cfg_if\",\n\t\t],\n\t\t[DelimKind[\"()\"]]: [\n\t\t\t// std\n\t\t\t\"assert_eq\",\n\t\t\t\"assert_ne\",\n\t\t\t\"assert\",\n\t\t\t\"cfg\",\n\t\t\t\"concat_bytes\",\n\t\t\t\"concat_idents\",\n\t\t\t\"concat\",\n\t\t\t\"debug_assert_eq\",\n\t\t\t\"debug_assert_ne\",\n\t\t\t\"debug_assert\",\n\t\t\t\"eprint\",\n\t\t\t\"eprintln\",\n\t\t\t\"format_args_nl\",\n\t\t\t\"format_args\",\n\t\t\t\"format\",\n\t\t\t\"matches\",\n\t\t\t\"panic\",\n\t\t\t\"print\",\n\t\t\t\"println\",\n\t\t\t\"try\",\n\t\t\t\"unimplemented\",\n\t\t\t\"unreachable\",\n\t\t\t\"write\",\n\t\t\t\"writeln\",\n\t\t\t// crates\n\t\t],\n\t\t[DelimKind[\"[]\"]]: [\n\t\t\t// std\n\t\t\t\"vec\",\n\t\t\t// crates\n\t\t],\n\t},\n\t(names, tk) =>\n\t\teach(names, (name) => {\n\t\t\tHARDCODED_MACRO_DELIMS.set(name, +tk as MacroInvocation[\"segments\"][\"dk\"]);\n\t\t})\n);\n\nlet _COMMENTS: CustomOptions[\"comments\"] = undefined!;\nlet _DANGLING_ATTRIBUTES: CustomOptions[\"danglingAttributes\"] = undefined!;\n\nexport function transform_ast(options: CustomOptions) {\n\ttry {\n\t\t_COMMENTS = options.comments;\n\t\t_DANGLING_ATTRIBUTES = options.danglingAttributes;\n\t\ttransformNode(options.rsParsedFile);\n\t} finally {\n\t\t_depth = 0;\n\t\t_COMMENTS = undefined!;\n\t\t_DANGLING_ATTRIBUTES = undefined!;\n\t}\n}\n\nlet _depth = 0;\nconst isReadingSnippet = () => 0 !== _depth;\n\nfunction maybe_transform_node<T extends Node, S extends Snippet>(\n\tnode: T,\n\tread_snippet: () => S,\n\tfn: (node: T, snippet: S) => void\n): T | undefined {\n\tconst snippet = try_eval(read_snippet);\n\tif (snippet) {\n\t\t++_depth;\n\t\ttransformNode(snippet);\n\t\t--_depth;\n\t\tfn(node, snippet);\n\t\ttransformed.add(node);\n\t\treturn node;\n\t}\n}\nconst transformed = new WeakSet<Node>();\nexport function isTransformed(node: Node) {\n\treturn transformed.has(node);\n}\n\nconst transform: { [K in NodeType]?: (node: NTMap[K]) => void } = {\n\t[NodeType.Attribute](node) {\n\t\ttry_eval(() => {\n\t\t\tnode.segments = rs.createLocArray(node.segments.dk, node.segments.loc.clone(), [\n\t\t\t\ttransform_simpleAttrSyntax(node.segments),\n\t\t\t]) as any;\n\t\t\ttransformed.add(node);\n\t\t});\n\t},\n\t[NodeType.MacroInlineRuleDeclaration](node) {\n\t\tnode.match.dk = DelimKind[\"()\"];\n\t\tnode.transform.dk = DelimKind[\"{}\"];\n\t},\n\t[NodeType.MacroInvocation](node) {\n\t\tconst name = getMacroName(node);\n\n\t\tif (\n\t\t\tIGNORED_MACROS.has(name) ||\n\t\t\tnode.segments.length === 0 ||\n\t\t\t(node.segments.length === 1 && is_PunctuationToken(node.segments[0]))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst tk = transformMacroDelim(name, node);\n\n\t\tif (name === \"matches\") {\n\t\t\t//\n\t\t}\n\n\t\tif (name === \"if_chain\") {\n\t\t\t//\n\t\t}\n\n\t\tif (name === \"cfg_if\") {\n\t\t\ttransformBlockLike(() => transform_macro_cfg_if(node.segments) as any);\n\t\t} else if (tk === DelimKind[\"{}\"]) {\n\t\t\ttransformBlockLike(); /* || (includesTK(node, TK[\",\"]) && transformCallLike()); */\n\t\t} else {\n\t\t\ttransformCallLike(); /* || (includesTK(node, TK[\";\"]) && transformBlockLike()); */\n\t\t}\n\n\t\tfunction transformBlockLike(transform = () => rs.toBlockBody(node.segments)) {\n\t\t\treturn maybe_transform_node(node as BlockLikeMacroInvocation, transform, (node, snippet) => {\n\t\t\t\tconst _body = snippet.ast;\n\t\t\t\t_body.dk = tk;\n\n\t\t\t\tnode.body = _body;\n\t\t\t\tnode.segments = _body;\n\t\t\t\ttransferAttributes(snippet, node);\n\t\t\t});\n\t\t}\n\n\t\tfunction transformCallLike() {\n\t\t\treturn maybe_transform_node(\n\t\t\t\tnode as CallLikeMacroInvocation,\n\t\t\t\t() => rs.toCallExpressionArguments(node.segments),\n\t\t\t\t(node, snippet) => {\n\t\t\t\t\tconst _arguments = snippet.ast;\n\t\t\t\t\t_arguments.dk = tk;\n\n\t\t\t\t\tnode.method = undefined;\n\t\t\t\t\tnode.typeArguments = undefined;\n\t\t\t\t\tnode.arguments = _arguments;\n\t\t\t\t\tnode.segments = _arguments;\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\t},\n\t[NodeType.CallExpression](node) {\n\t\tif (hasMethod(node)) {\n\t\t\tnode.callee = rs.mockNode(NodeType.MemberExpression, node.method.loc.cloneFrom(start(node.callee)), {\n\t\t\t\texpression: node.callee,\n\t\t\t\tproperty: node.method,\n\t\t\t\tcomputed: false,\n\t\t\t});\n\t\t\tnode.method = undefined!;\n\t\t\tgetOptions().actuallyMethodNodes.add(node.callee as MemberExpression);\n\t\t}\n\t},\n\n\t[NodeType.AutoTraitDeclaration](node) {\n\t\tmockBodyNoBody(node);\n\t},\n\t[NodeType.NegativeImplDeclaration](node) {\n\t\tmockBodyNoBody(node);\n\t},\n\n\t[NodeType.StructLiteral](node) {\n\t\tmoveSpreadsToEnd(node);\n\t},\n\t[NodeType.StructPattern](node) {\n\t\tmoveSpreadsToEnd(node);\n\t},\n};\n\nfunction moveSpreadsToEnd(node: StructLiteral | StructPattern) {\n\tconst props = node.properties;\n\tif (props.some((p, i, a) => is_StructSpread(p) && !iLast(i, a))) {\n\t\tconst spreads: any[] = [];\n\t\tfor (let i = 0; i < props.length; i++) {\n\t\t\tconst prop = props[i];\n\t\t\tif (is_StructSpread(prop)) {\n\t\t\t\tArray_splice(props, prop, i--);\n\t\t\t\tspreads.push(prop);\n\t\t\t}\n\t\t}\n\t\tprops.push(...spreads);\n\t}\n}\n\nfunction mockBodyNoBody(node: NodeWithBodyNoBody) {\n\t// @ts-expect-error\n\tnode.body = rs.createLocArray(last_of(rs.toTokens(node).ast).loc.clone(), DelimKind[\"{}\"]);\n}\n\nfunction transformMacroDelim(name: string, node: MacroInvocation): 1 | 2 | 3 {\n\tif (HARDCODED_MACRO_DELIMS.has(name)) {\n\t\treturn HARDCODED_MACRO_DELIMS.get(name)!;\n\t}\n\tif (node.segments.dk === DelimKind[\"{}\"] && includesTK(node, TK[\",\"])) {\n\t\treturn DelimKind[\"()\"];\n\t}\n\tif (node.segments.dk === DelimKind[\"()\"] && includesTK(node, TK[\";\"])) {\n\t\treturn DelimKind[\"{}\"];\n\t}\n\treturn node.segments.dk;\n}\n\n// export function createTransformed<S extends Node>(create: () => S): S {\n// \treturn transformNode(create());\n// }\n\nconst seen = new WeakSet<Node>();\nfunction transformNode<T extends Node>(node: T, parent?: Node, key?: string, index?: any): T {\n\tif (!seen.has(node)) {\n\t\tseen.add(node);\n\t\tif (is_Snippet(node) || is_Program(node)) {\n\t\t\tregisterPogramLike(node);\n\t\t}\n\n\t\teach_childNode(node, transformNode);\n\n\t\tinsert_blocks(node, parent, key, index);\n\n\t\ttransform[node.nodeType]?.(node as any);\n\n\t\tflatten_typeBounds(node);\n\n\t\ttransform_nodeAttributes(node);\n\t}\n\treturn node;\n}\n\nfunction insert_blocks(node: Node, parent?: Node, key?: string, index?: any) {\n\tif (parent && key) {\n\t\tif (\n\t\t\t!is_ExpressionStatement(parent) &&\n\t\t\t(false ||\n\t\t\t\t// \"1 + break\" -> \"1 + { break; }\"\n\t\t\t\tis_FlowControlExpression(node) ||\n\t\t\t\t// \"1 + a = b\" -> \"1 + { a = b; }\"\n\t\t\t\t(!isReadingSnippet() && is_ReassignmentNode(node) && !(is_ReassignmentNode(parent) && parent.left === node)))\n\t\t) {\n\t\t\treassignNodeProperty(blockify(node), parent, key, index);\n\t\t} else if (\n\t\t\tis_ClosureFunctionExpression(node) &&\n\t\t\t(false ||\n\t\t\t\t// \"|| -> T x\" -> \"|| -> T { x }\"\n\t\t\t\t(!!node.returnType && !is_BlockExpression(node.expression)) ||\n\t\t\t\t// \"|| match x {}\" -> \"|| { match x {} }\"\n\t\t\t\t(is_ExpressionWithBodyOrCases(node.expression) &&\n\t\t\t\t\t!is_BlockExpression(node.expression) &&\n\t\t\t\t\t!is_IfBlockExpression(node.expression)))\n\t\t) {\n\t\t\tnode.expression = blockify(node.expression);\n\t\t}\n\t}\n\tfunction blockify(node: ExpressionNode) {\n\t\tconst block = rs.mockNode(NodeType.BlockExpression, node.loc.clone(), {\n\t\t\tlabel: undefined,\n\t\t\tbody: rs.createLocArray(DelimKind[\"{}\"], node.loc.clone(), [\n\t\t\t\trs.mockNode(NodeType.ExpressionStatement, node.loc.clone(), { semi: false, expression: node }),\n\t\t\t]),\n\t\t});\n\t\ttransferAttributes(node, block);\n\t\treturn block;\n\t}\n}\n\nfunction flatten_typeBounds(topNode: Node) {\n\tif (hasTypeBounds(topNode)) {\n\t\tconst nestedBounds: TypeTraitBound[] = topNode.typeBounds.filter(isBoundWithNestedBounds);\n\t\tconst [first, ...subsequent] = nestedBounds;\n\n\t\tconst flatten = (bound: TypeTraitBound) =>\n\t\t\tArray_replace(topNode.typeBounds, bound, ...(bound.typeExpression as unknown as TypeDynBounds).typeBounds);\n\n\t\tif (nestedBounds.every(isBareBoundWithNestedBoundsNoPrefix)) {\n\t\t\t// A + (B + C)\n\t\t\t// -> A + B + C\n\t\t\teach(nestedBounds, flatten);\n\t\t} else if (\n\t\t\t!hasDefinedPrefix(topNode) &&\n\t\t\tfirst === topNode.typeBounds[0] &&\n\t\t\t!isBareBoundWithNestedBoundsNoPrefix(first) &&\n\t\t\tsubsequent.every(isBareBoundWithNestedBoundsNoPrefix)\n\t\t) {\n\t\t\tif (is_TypeDynBounds(topNode)) {\n\t\t\t\tif (is_TypeImplBounds(first.typeExpression)) {\n\t\t\t\t\t// (impl A) + B\n\t\t\t\t\t// -> impl A + B\n\t\t\t\t\tunsafe_set_nodeType(topNode, NodeType.TypeImplBounds);\n\t\t\t\t} else {\n\t\t\t\t\t// (dyn A) + B\n\t\t\t\t\t// -> dyn A + B\n\t\t\t\t\ttopNode.dyn = true;\n\t\t\t\t}\n\t\t\t\teach(nestedBounds, flatten);\n\t\t\t} else {\n\t\t\t\teach(subsequent, flatten);\n\t\t\t\t(first.typeExpression as unknown as TypeDynBounds).typeBounds.push(...topNode.typeBounds.slice(1));\n\t\t\t\ttopNode.typeBounds.length = 1;\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction isBoundWithNestedBounds(bound: TypeBound): bound is TypeTraitBound & { typeExpression: TypeBoundsStandaloneNode } {\n\t\treturn is_TypeTraitBound(bound) && is_TypeBoundsStandaloneNode(bound.typeExpression);\n\t}\n\tfunction isBareBoundWithNestedBounds(bound: TypeBound): bound is TypeTraitBound & { typeExpression: TypeBoundsStandaloneNode } {\n\t\treturn isBoundWithNestedBounds(bound) && is_BareTypeTraitBound(bound);\n\t}\n\tfunction isBareBoundWithNestedBoundsNoPrefix(bound: TypeBound): bound is TypeTraitBound & { typeExpression: TypeDynBounds } {\n\t\treturn isBareBoundWithNestedBounds(bound) && !hasDefinedPrefix(bound.typeExpression);\n\t}\n\tfunction hasDefinedPrefix(node: NodeWithTypeBounds) {\n\t\treturn (is_TypeDynBounds(node) && node.dyn) || is_TypeImplBounds(node);\n\t}\n}\n\nfunction transform_nodeAttributes(node: Node) {\n\t/**\n\t * # Inside Token trees:\n\t *\n\t *  1. DocCommentAttribute \t--is parsed as--> \tComment\n\t *  2. Attribute \t\t\t--is parsed as--> \tToken<'#'>, DelimGroup<'[]'>\n\t *\n\t * # Transforming tokens into a Snippet:\n\t *\n\t *  1. DocCommentAttribute <--replace from-- Comment\n\t *    a) Remove node with same loc from comments\n\t *    b) Merge Snippet.danglingAttributes with Program.danglingAttributes\n\t *\n\t *  2. Attribute (no action needed)\n\t *\n\t */\n\tif (hasAttributes(node)) {\n\t\tconst attrs = node.attributes;\n\t\tfor (let i = 0; i < attrs.length; i++) {\n\t\t\tconst attr = attrs[i];\n\t\t\tif (isReadingSnippet() && is_DocCommentAttribute(attr)) {\n\t\t\t\tconst index = binarySearchIn(_COMMENTS, start(attr), start);\n\t\t\t\t__DEV__: assert(index !== -1), assert(end(_COMMENTS[index]) === end(attr));\n\t\t\t\t_COMMENTS.splice(index, 1);\n\t\t\t}\n\t\t\tif (attr.inner) {\n\t\t\t\tif (isPrettierIgnoreAttribute(attr)) {\n\t\t\t\t\tsetPrettierIgnoreTarget(is_Program(node) ? node.loc.src : node, attr);\n\t\t\t\t}\n\t\t\t\t// @ts-expect-error Inserting Attribute into StatementNode[]\n\t\t\t\tinsertNode(is_Snippet(node) ? node.ast : getBodyOrCases(node)!, attr);\n\t\t\t\tArray_splice(attrs, attr, i--);\n\t\t\t}\n\t\t}\n\t\tif (attrs.length === 0) {\n\t\t\tdeleteAttributes(node);\n\t\t}\n\t}\n}\n\nfunction registerPogramLike(program: Extract<Node, ProgramLike>) {\n\tconst comments = spliceAll(program.comments);\n\tconst danglingAttributes = spliceAll(program.danglingAttributes);\n\tfor (let i = 0; i < danglingAttributes.length; i++) {\n\t\tconst attr = danglingAttributes[i];\n\t\t// if (isReadingSnippet() && is_DocCommentAttribute(attr)) {\n\t\t// }\n\t\tif (is_DocCommentAttribute(attr)) {\n\t\t\tif (isReadingSnippet()) {\n\t\t\t\tconst index = binarySearchIn(_COMMENTS, start(attr), start);\n\t\t\t\t__DEV__: assert(index !== -1), assert(end(_COMMENTS[index]) === end(attr));\n\t\t\t\t_COMMENTS.splice(index, 1);\n\t\t\t}\n\t\t} else {\n\t\t\ttransformNode(danglingAttributes[i], program, \"danglingAttributes\", i);\n\t\t}\n\t}\n\tif (!isReadingSnippet()) insertNodes(_COMMENTS, comments);\n\tinsertNodes(_DANGLING_ATTRIBUTES, danglingAttributes);\n}\n\nconst CommentChildNodes = new WeakMap<Node, Node[]>();\n\nexport function getCommentChildNodes(n: any): Node[] {\n\tconst children = Map_get(CommentChildNodes, n, getTransformedNodeChildren);\n\t/**\n\t * parent {\n\t *  #[attr]\n\t * \t#![attr] <-------- list misplaced inner attrs as part of \"#[attr] child {}\"\n\t * \tchild {}\n\t * }\n\t */\n\tif (is_NodeWithBodyOrCases(n) || is_BlockLikeMacroInvocation(n)) {\n\t\tfor (let i = 0; i < children.length; i++) {\n\t\t\tconst attr = children[i];\n\t\t\tif (is_AttributeOrDocComment(attr)) {\n\t\t\t\tconst target = children.find((n) => start(n) <= start(attr) && ownStart(n) >= end(attr));\n\t\t\t\tif (target) {\n\t\t\t\t\tchildren.splice(i--, 1);\n\t\t\t\t\tinsertNode(Map_get(CommentChildNodes, target, getTransformedNodeChildren), attr);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn children;\n\n\tfunction getTransformedNodeChildren(node: Node) {\n\t\tif (is_Program(node)) node.comments ??= []; // prettier core deletes this property\n\t\tconst children = getNodeChildren(node);\n\n\t\tif (is_NodeWithBodyNoBody(node)) {\n\t\t\tinsertNodes(children, (node as any).body);\n\t\t}\n\n\t\t__DEV__: {\n\t\t\tconst actual_count = countActualNodeChildren(node);\n\t\t\tif (\n\t\t\t\tchildren.length !== actual_count &&\n\t\t\t\t!(is_MacroInvocation(node) && actual_count - node.segments.length === children.length)\n\t\t\t) {\n\t\t\t\tconst actual = getActualNodeChildren(node);\n\t\t\t\tconst missing = actual.filter((n) => !children.includes(n));\n\t\t\t\tconst unknown = children.filter((n) => !actual.includes(n));\n\t\t\t\tconst duplicates_in_object = actual.filter((n, i, a) => i !== 0 && n === a[i - 1]);\n\t\t\t\tconst duplicates_in_childNodes = children.filter((n, i, a) => i !== 0 && n === a[i - 1]);\n\t\t\t\tconst ctx = { missing, unknown, duplicates_in_object, duplicates_in_childNodes };\n\t\t\t\tfor (let key in ctx) if (ctx[key].length === 0) delete ctx[key];\n\t\t\t\texit(`${node.type} was transformed but did not patch its childNodes list`, ctx, node.loc.url(), node);\n\t\t\t}\n\t\t\tfor (const child of children)\n\t\t\t\tif (!is_Node(child)) exit(`${node.type}'s childNodes includes unexpected entries`, { node, child });\n\t\t}\n\t\treturn children;\n\t}\n}\n"
  },
  {
    "path": "src/utils/common.ts",
    "content": "import { createCustomError } from \"./debug\";\n\ndeclare global {\n\tvar console: { log(...args: any[]): void; error(...args: any[]): void };\n\tinterface ErrorConstructor {\n\t\tcaptureStackTrace(targetObject: object, constructorOpt?: Function): void;\n\t\tprepareStackTrace?: ((err: Error, stackTraces: any[]) => any) | undefined;\n\t\tstackTraceLimit: number;\n\t}\n\tinterface ImportMeta {\n\t\turl: string;\n\t}\n}\n\nexport function Narrow<T extends R, R = unknown>(value: R): asserts value is T {}\nexport function AssertTypesEq<A extends B, B>(...args: [B] extends [A] ? [] : [RIGHT_TYPES_NOT_ASSIGNABLE_TO_LEFT: Exclude<B, A>]) {}\n\n// prettier-ignore\ntype indexof<A> = A extends readonly any[] ? A extends 0 ? any : keyof A & number : A extends Set<unknown> ? never : A extends Map<infer U, unknown> ? U \n\t: A extends Iterable<unknown> ? never : A extends object ? keyof A & (number | string) : never;\n// prettier-ignore\ntype valueof<A> = A extends ReadonlyArray<infer U> ? A extends 0 ? any : U : A extends Set<infer U> ? U : A extends Map<unknown, infer U> ? U \n\t: A extends Iterable<infer U> ? U : A extends object ? A[keyof A & (number | string)] : never;\n// prettier-ignore\ntype vObject<V extends unknown = unknown, K extends unknown = unknown> = | object | readonly V[] | { [key: string]: V } | anySet<V> | anyMap<K, V>;\nexport type itfn<A, R> = (value: valueof<A>, key: indexof<A>) => R;\ntype anySet<V extends unknown = unknown> = Set<V>;\ntype anyMap<K extends unknown = unknown, V extends unknown = unknown> = Map<K, V>;\ntype anyfunction<A extends any[] = unknown[], R = unknown> = (...args: A) => R;\ntype objlike = object | anyfunction;\ntype anymap<K extends unknown = unknown, V extends unknown = unknown> = K extends objlike ? Map<K, V> | WeakMap<K, V> : Map<K, V>;\n\nexport function exit(message: string, ...ctx: any[]): never {\n\tif (ctx.length > 0) console.log(\"Error context:\", { ...ctx });\n\tthrow createCustomError({ message });\n}\nexit.never = function never(...ctx: any[]): never {\n\texit(\"Reached unreachable code\", ...ctx);\n};\nexport function assert(predicate: boolean, err?: string, ...ctx: any[]): asserts predicate {\n\t__DEV__: if (typeof predicate !== \"boolean\") exit(\"Expected boolean\", predicate);\n\tif (false === predicate) exit(err ?? \"Assertion failed\", ...ctx);\n}\nexport function Identity<T>(v: T): T {\n\treturn v;\n}\n\nexport function last_of<T extends ArrayLike<any>>(arr: T): T extends readonly [...infer A, infer U] ? U : T[number] {\n\t__DEV__: isArrayLike(arr) || exit(\"Expected Array\"), arr.length > 0 || exit(\"Attempted to retrieve last item of an empty array\", arr);\n\treturn arr[arr.length - 1];\n}\nexport function maybe_last_of<T extends readonly any[] | undefined>(\n\tarr: T\n): T extends any[] ? (T extends readonly [...infer A, infer U] ? U : T[number]) : undefined {\n\treturn undefined === arr || 0 === arr.length ? undefined : last_of(arr as any[]);\n}\n\nexport function normPath(filepath: string) {\n\treturn filepath.replace(/^file:\\/\\/\\//, \"\").replace(/\\\\\\\\?/g, \"/\");\n}\n\nexport function print_string(str: string) {\n\treturn /[\\u0000-\\u0020]/.test(str)\n\t\t? str\n\t\t\t\t.replace(/ /g, \"•\")\n\t\t\t\t.replace(/\\n/g, \"↲\")\n\t\t\t\t.replace(/\\t/g, \"╚\")\n\t\t\t\t.replace(/[\\u0000-\\u0020]/g, \"□\")\n\t\t: str;\n}\n\nfunction isArrayLike(value: any): value is ArrayLike<unknown> {\n\treturn is_object(value) && oisArrayLike(value);\n}\n\nfunction oisArrayLike(value: {}): value is ArrayLike<unknown> {\n\treturn \"length\" in value && (0 === (value as any).length || \"0\" in value);\n}\n\nexport function binarySearchIn<T extends {}>(array: ArrayLike<T>, target: number, toValue: (item: T) => number) {\n\tif (isEmpty(array)) return -1;\n\tlet i = 0;\n\tlet low = 0;\n\tlet high = array.length - 1;\n\tlet value = toValue(array[high]);\n\tif (target >= value) return high;\n\telse high--;\n\twhile (low <= high) {\n\t\ti = low + ((high - low) >> 1);\n\t\tvalue = toValue(array[i]);\n\t\tif (target === value) return i;\n\t\tif (target > value) low = i + 1;\n\t\telse high = i - 1;\n\t}\n\treturn low - 1;\n}\n\nexport function getTerminalWidth(fallbackWidth = 200) {\n\treturn globalThis?.process?.stdout?.columns ?? fallbackWidth;\n}\n\n// @ts-ignore\nconst isBrowser = typeof window !== \"undefined\" && typeof window.document !== \"undefined\";\nexport const color = ((cfn, mfn) => ({\n\tblack: cfn(30),\n\tred: cfn(31),\n\tgreen: cfn(32),\n\tyellow: cfn(33),\n\tblue: cfn(34),\n\tmagenta: cfn(35),\n\tcyan: cfn(36),\n\twhite: cfn(37),\n\tgrey: cfn(90),\n\tbold: mfn(1, 22),\n\titalic: mfn(3, 23),\n\tunderline: mfn(4, 24),\n\thidden: mfn(8, 28),\n\thiddenCursor: (str: string) => `\\x1B[?25l${str}\\x1B[?25h`,\n\tunstyle: (str: string) => str.replace(/\\x1B\\[[0-9][0-9]?m/g, \"\"),\n\tunstyledLength: (str: string) => str.replace(/\\x1B\\[[0-9][0-9]?m/g, \"\").length,\n\tlink: (str: string) => color.underline(color.blue(str)),\n}))(\n\t(c1: number) => (isBrowser ? Identity : (str: string) => `\\x1B[${c1}m${str.replace(/\\x1B\\[39m/g, `\\x1B[${c1}m`)}\\x1B[39m`),\n\t(c1: number, c2: number) => (isBrowser ? Identity : (str: string) => `\\x1B[${c1}m${str}\\x1B[${c2}m`)\n);\nexport function Map_get<K extends object, V>(map: WeakMap<K, V>, key: K, init: (key: K) => V): V;\nexport function Map_get<K, V>(map: Map<K, V>, key: K, init: (key: K) => V): V;\nexport function Map_get<K, V>(map: anymap<K, V>, key: K, init: (key: K) => V): V {\n\tif (!map.has(key)) map.set(key, init(key));\n\treturn map.get(key)!;\n}\nexport function isEmpty(array: ArrayLike<any>): boolean {\n\t__DEV__: assert(isArrayLike(array));\n\treturn 0 === array.length;\n}\nexport function Array_splice<T extends any[]>(array: T, target: T[number], index: number = array.indexOf(target)) {\n\t__DEV__: {\n\t\tconst i = arguments.length === 2 ? array.indexOf(target) : index;\n\t\tassert(i === index && i !== -1 && i === array.lastIndexOf(target), \"\", { array, target, index, i });\n\t}\n\tarray.splice(index, 1);\n}\nexport function Array_replace<T extends any[]>(array: T, target: T[number], ...replacements: T[number][]) {\n\tconst i = array.indexOf(target);\n\t__DEV__: if (i === -1 || i !== array.lastIndexOf(target))\n\t\texit(\"Array_replace\", { index: i, lastIndex: array.lastIndexOf(target), array, target, replacements });\n\tarray.splice(array.indexOf(target), 1, ...replacements);\n}\nexport function has_key_defined<T extends object, K extends T extends never ? never : keyof T>(\n\to: T,\n\tk: K\n): o is K extends never\n\t? never\n\t: T extends { [k in K]: any }\n\t? T & { [k in K]: {} }\n\t: T extends { [k in K]?: any }\n\t? T & { [k in K]: {} }\n\t: never {\n\treturn k in o && undefined !== o[k];\n}\n\nexport function is_object(data: unknown): data is object | ({ [key: string]: unknown } | unknown[]) {\n\treturn \"object\" === typeof data && null !== data;\n}\n\nexport function is_array(data: unknown): data is any[] {\n\treturn Array.isArray(data);\n}\n\nfunction ois_vobject(data: any) {\n\t__DEV__: assert(is_object(data));\n\tswitch (data.constructor) {\n\t\tcase Array:\n\t\tcase Object:\n\t\tcase Set:\n\t\tcase Map:\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn false;\n\t}\n}\n\nexport function each<A extends vObject>(data: A, callback: itfn<A, void>): void;\nexport function each(data: any, callback: (value: any, index: any) => void): void {\n\t__DEV__: assert(ois_vobject(data));\n\t// prettier-ignore\n\tswitch (data.constructor) {\n\t\tcase Array: { let i = 0; for (; i < data.length; i++) callback(data[i], i); return; }\n\t\tcase Object: { let k; for (k in data) callback(data[k], k); return; }\n\t\tcase Set: { let d; for (d of data) callback(d, undefined!); return; }\n\t\tcase Map: { let e; for (e of data) callback(e[1], e[0]); return; }\n\t\tdefault:  { let x; for (x of data) callback(x, undefined!); return; }\n\t}\n}\n\nexport function iLast(index: number, array: any[]) {\n\treturn 1 + index === array.length;\n}\n\nexport function find_last<T>(arr: T[], test: itfn<T[], boolean>): T | undefined {\n\tfor (var i = arr.length; --i !== -1; ) if (test(arr[i], i)) return arr[i];\n}\n\nexport function try_eval<T>(fn: () => T): T | undefined {\n\ttry {\n\t\treturn fn();\n\t} catch (e) {\n\t\treturn undefined;\n\t}\n}\n\nexport function clamp(min: number, max: number, value: number) {\n\treturn value > min ? (value < max ? value : max) : min;\n}\n\nexport type MaybeFlatten<T> = T extends ReadonlyArray<infer U> ? MaybeFlatten<Exclude<U, T>> : T;\nexport type FlatArray<T> = MaybeFlatten<T>[];\nexport function flat<T extends readonly any[]>(arr: T): FlatArray<T> {\n\treturn (arr as any as [any]).flat(Infinity);\n}\nexport function flatMap<T extends readonly any[], R>(arr: T, mapFn: (item: T[number], index: number, array: T) => R): FlatArray<R> {\n\treturn flat(arr.map(mapFn));\n}\n\nexport function joinln(...arr: string[]): string {\n\treturn arr.join(\"\\n\");\n}\n\nexport function join_lines(fn: () => Generator<string, void, void>): string {\n\treturn [...fn()].join(\"\\n\");\n}\n\nexport function reduce_tagged_template<T>(args: [strings: TemplateStringsArray, ...values: T[]], map: (value: T) => string) {\n\tfor (var str = \"\" + args[0][0], i = 1; i < args.length; i++) str += map(args[i] as T) + args[0][i];\n\treturn str;\n}\n\nexport function map_tagged_template<T, R>(args: [strings: TemplateStringsArray, ...values: T[]], map: (value: T) => R) {\n\tconst arr: (R | string)[] = [args[0][0]];\n\tfor (var i = 1; i < args.length; i++) arr.push(map(args[i] as T), args[0][i]);\n\treturn arr;\n}\n\nexport function spliceAll<T extends any[]>(array: T): [...T] {\n\tconst r: [...T] = [...array];\n\tarray.length = 0;\n\treturn r;\n}\n\nexport function spread<R>(fn: () => Iterable<R>): R[] {\n\treturn [...fn()];\n}\n"
  },
  {
    "path": "src/utils/debug.ts",
    "content": "import { clamp, color, getTerminalWidth, normPath } from \"./common\";\n\nconst cwd = // @ts-expect-error\n\ttypeof process === \"object\" && typeof process?.cwd === \"function\" ? /* @__PURE__ */ normPath(/* @__PURE__ */ process.cwd() ?? \"\") : \"\";\nfunction normPath_strip_cwd(filepath: string) {\n\tlet normFilePath = normPath(filepath);\n\treturn normFilePath.startsWith(cwd) ? normFilePath.slice(cwd.length + 1) : normFilePath;\n}\n\ntype StackStyleFn = (callee: string, item: StackItem) => (str: string) => string;\ninterface Stack extends Array<StackItem> {\n\tmessage: string;\n\tstyle?: { callee?: StackStyleFn; url?: StackStyleFn } | undefined;\n}\n\nclass StackLine {\n\tdeclare readonly raw: string;\n\tdeclare readonly callee: string;\n\tdeclare readonly filepath: string;\n\tdeclare readonly line: string;\n\tdeclare readonly col: string;\n\tdeclare readonly other: string;\n\tdeclare readonly url: string;\n\tconstructor(raw: string) {\n\t\t({\n\t\t\t1: this.callee = \"\",\n\t\t\t2: this.filepath = \"\",\n\t\t\t3: this.line = \"\",\n\t\t\t4: this.col = \"\",\n\t\t\t5: this.other = \"\",\n\t\t} = (this.raw = raw).match(/at (?:(.+?)\\s+\\()?(?:(.+?):([0-9]+)(?::([0-9]+))?|([^)]+))\\)?/) ?? [\"\", \"\", \"\", \"\", \"\", \"\"]);\n\t\tthis.url = this.filepath //\n\t\t\t? normPath_strip_cwd(this.filepath) + (this.line && this.col && `:${this.line}:${this.col}`)\n\t\t\t: this.other === \"native\"\n\t\t\t? \"<native>\"\n\t\t\t: \"\";\n\t}\n}\n\nfunction getPrintWidth() {\n\treturn clamp(0, getTerminalWidth(128), 200) - 4;\n}\n\nclass StackItem extends StackLine {\n\tconstructor(private readonly stack: Stack, readonly i: number, raw: string) {\n\t\tsuper(raw);\n\t}\n\thidden = false;\n\thide() {\n\t\tthis.hidden = true;\n\t\treturn this;\n\t}\n\thideNext(n: number) {\n\t\tfor (let i = 0; i < n; i++) this.at(i)?.hide();\n\t}\n\thideWhileTrue(test: (line: StackItem) => boolean) {\n\t\tlet line: StackItem | undefined = this;\n\t\twhile (line && test(line)) line = line.hide().next();\n\t}\n\tat(relIndex: number) {\n\t\treturn this.i + relIndex >= this.stack.length || this.i + relIndex < 0 ? undefined : this.stack[this.i + relIndex];\n\t}\n\tnext() {\n\t\treturn this.at(+1);\n\t}\n\ttoString() {\n\t\tconst url = this.url;\n\t\tconst calleeColor = this.stack.style?.callee?.(this.callee, this) ?? color.cyan;\n\t\tconst urlColor = this.stack.style?.url?.(url, this) ?? color.grey;\n\t\treturn compose2Cols(\"    at \" + calleeColor(this.callee), urlColor(url), getPrintWidth());\n\t}\n}\n\n// prettier-ignore\nfunction createStack(message: string, Error_stack: string, style: Stack[\"style\"]): Stack {\n\tfor (var STACK: Stack = [] as any, i = 0, stack = Error_stack.split(\"\\n\").slice(2); i < stack.length; i++) STACK[i] = new StackItem(STACK, i, stack[i]);\n\treturn (STACK.message = message), (STACK.style = style), STACK;\n}\n\nfunction composeStack(stack: Stack) {\n\tvar hidden = 0;\n\tvar str = stack.message;\n\tfor (var item of stack) item.hidden ? ++hidden : (str += \"\\n\" + item.toString());\n\treturn str + (hidden > 0 ? \"\\n\" + color.grey(compose2Cols(\"\", `...filtered ${hidden} lines`, getPrintWidth())) : \"\");\n}\n\nexport function get_caller_cmd(offset = 0) {\n\tconst obj: { stack: string } = {} as any;\n\tError.captureStackTrace(obj, get_caller_cmd);\n\tconst lines = obj.stack.split(\"\\n\");\n\treturn new StackLine(lines[1 + clamp(0, lines.length - 2, offset)]).url;\n}\n\nvar Error_prepareStackTrace;\nlet replaced_default_prepareStackTrace = false;\nfunction custom_prepareStackTrace(err, calls) {\n\treturn (Error_prepareStackTrace?.(err, calls) ?? calls.join(\"\\n\"))?.replace(/file:\\/\\/\\//g, \"\").replace(/\\\\\\\\?/g, \"/\") ?? calls;\n}\n\nexport function overrideDefaultError(silent = false) {\n\tif (replaced_default_prepareStackTrace === (replaced_default_prepareStackTrace = true)) return;\n\tError_prepareStackTrace = Error.prepareStackTrace ?? ((_, calls) => calls.join(\"\\n\"));\n\tError.prepareStackTrace = custom_prepareStackTrace;\n\tif (!silent) console.log(color.grey(`[devtools] Replaced Error.prepareStackTrace at ${get_caller_cmd(1)}`));\n}\n\nexport function createCustomError({\n\tmessage = \"Unknown Error\",\n\teditStack = (stack: StackItem[]) => {},\n\tstyle = undefined as Stack[\"style\"],\n\tstackTraceLimit = 20,\n}): Error {\n\tconst _stackTraceLimit = Error.stackTraceLimit;\n\tconst _prepareStackTrace = Error.prepareStackTrace;\n\tif (replaced_default_prepareStackTrace && _prepareStackTrace === custom_prepareStackTrace)\n\t\tError.prepareStackTrace = Error_prepareStackTrace;\n\n\tError.stackTraceLimit = stackTraceLimit;\n\n\tconst _ctx: { stack: string } = {} as any;\n\n\tError.captureStackTrace(_ctx, createCustomError);\n\n\tconst stack = createStack(message, _ctx.stack, style);\n\tError.prepareStackTrace = function (err, calls) {\n\t\teditStack(stack);\n\t\treturn composeStack(stack);\n\t};\n\n\tconst err = new Error(message); // @ts-expect-error (get) to trigger prepareStackTrace, (set) to prevent treeshaking\n\terr.stack = err.stack;\n\n\tError.stackTraceLimit = _stackTraceLimit;\n\tError.prepareStackTrace = _prepareStackTrace;\n\n\treturn err;\n}\n\nfunction compose2Cols(left: string, right: string, len = 64, min = 1) {\n\treturn left + \" \".repeat(clamp(min, len, len - (color.unstyledLength(left) + color.unstyledLength(right)))) + right;\n}\n"
  },
  {
    "path": "tests/output/comments/assignment.f.rs",
    "content": "f1 = |\n  //comment\n  a\n| {};\n\nf2 = |\n  a //comment\n| {};\n\nf3 = |\n  a\n  //comment\n| {};\n\nf4 = // Comment\n  || {};\n\nf5 =\n  // Comment\n\n  || {};\n\nf6 =\n  /* comment */\n\n  // Comment\n\n  || {};\n\nlet f4 = // Comment\n  || {};\n\nlet f5 =\n  // Comment\n\n  || {};\n\nlet f6 =\n  /* comment */\n\n  // Comment\n\n  || {};\n\nconst kochabCooieGameOnOboleUnweave = // ???\n  annularCooeedSplicesWalksWayWay;\n\nconst bifornCringerMoshedPerplexSawder = // !!!\n  glimseGlyphsHazardNoopsTieTie +\n  averredBathersBoxroomBuggyNurl -\n  anodyneCondosMalateOverateRetinol;\n\nfnNumber =\n  // Comment\n  3;\n\nfnNumber =\n  // Comment\n\n  3;\n\nfnNumber =\n  // Comment0\n  // Comment1\n  3;\n\nfnNumber = /* comment */ 3;\n\nfnNumber =\n  /* comments0 */\n  /* comments1 */\n  3;\n\nfnNumber =\n  // Comment\n  3;\n\nlet fnNumber =\n  // Comment\n\n  3;\n\nlet fnNumber =\n  // Comment0\n  // Comment1\n  3;\n\nlet fnNumber = /* comment */ 3;\n\nlet fnNumber =\n  /* comments0 */\n  /* comments1 */\n  3;\n\nfnString =\n  // Comment\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /* comment */\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /**\n   * multi-line\n   */\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /* inline */ \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\";\n\nfnString = // Comment0\n  // Comment1\n  \"some\" + \"long\" + \"string\";\n\nfnString = \"some\" + \"long\" + \"string\"; // Comment\n\nfnString =\n  // Comment\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /* comment */\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /**\n   * multi-line\n   */\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /* inline */ \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\" +\n  \"some\" +\n  \"long\" +\n  \"string\";\n\nlet fnString = // Comment0\n  // Comment1\n  \"some\" + \"long\" + \"string\";\n\nlet fnString = \"some\" + \"long\" + \"string\"; // Comment\n\nlet obj1 =\n  // 36_______\n  A {\n    key: \"val\",\n  };\n\nlet obj2 =\n  // 37_______\n  A {\n    key: \"val\",\n  };\n\nlet obj3 = A { // 38_______\n  key: \"val\",\n};\n\nlet obj4 = A {\n  // 39_______\n  key: \"val\",\n};\n\nlet obj5 =\n  // 40_______\n  [\"val\"];\n\nlet obj6 =\n  // 41_______\n  [\"val\"];\n\nlet obj7 = [\n  // 42_______\n  \"val\",\n];\n\nlet obj8 = [\n  // 43_______\n  \"val\",\n];\n\nconst A { a /* 0_______ */: 1 } = b;\n\nconst A { c: 1 /* 1_______ */ } = d;\n\nlet A {\n  d: b, //2_______\n} = c;\n\nconst foo = A {\n  a: \"a\" /* 3_______________ */,\n\n  /* 4_________ */\n  b: \"b\",\n};\n\nlet // 44_______\nfoo1 = \"val\";\n\nconst foo3 = 123;\n// 45_______\n[\"2\", \"3\"].forEach(|x| console.log(x));\n\nlet a = b || /** 46_______ */ c;\n\nlet a = A {\n  a /* 47_______ */: || 1,\n};\n\nlet a = /* 48 */ 0;\n\nlet b = /*\n * 4\n * 9\n */ 0;\n\nlet c = /*\n * 5\n * 0\n */ 0;\n\nlet d = /*\n       * 5\n\n       * 1\n       */ 0;\n\nfn foo() {\n  let x = foo.bar???.baz; // comment\n  let x =\n    // comment\n    foo.bar???.baz;\n  let x =\n    // comment\n    foo.bar???.baz; // comment\n  let x = foo.bar???????????????.baz; // comment\n  // comment\n  // comment\n  // comment\n  // comment\n  let x = /* Invisible comment */ try { foo()? };\n  let loooooooooooooooooooooooooooooooooooooooooong =\n    does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;\n\n  let x = y.z; // comment\n\n  self.rev_dep_graph\n    .iter()\n    // Remove nodes that are not dirty\n    .filter(|&(unit, _)| dirties.contains(&unit))\n    // Retain only dirty dependencies of the ones that are dirty\n    .map(|(k, deps)| {\n      (\n        k.clone(),\n        deps\n          .iter()\n          .cloned()\n          .filter(|d| dirties.contains(&d))\n          .collect(),\n      )\n    });\n\n  let y = expr /* comment */\n    .kaas()?;\n\n  (Foo {\n    // comment\n    ..a\n  } = a);\n}\n\n// source: \"../../samples/comments/assignment.rs\""
  },
  {
    "path": "tests/output/comments/binaryish.f.rs",
    "content": "a = b || /** 5_______ */ c;\n\na = b || /** 6_______ */ c;\n\na =\n  b ||\n  /** 7_____________________________________________________________________________ */\n  c;\n\na =\n  b ||\n  /** 8_____________________________________________________________________________ */ c;\n\na =\n  b ||\n  /** 9_____________________________________________________________________________ */ c;\n\na = b && /** 10_______ */ c;\n\na = b && /** 11_______ */ c;\n\na =\n  b &&\n  /** 12_____________________________________________________________________________ */\n  c;\n\na =\n  b &&\n  /** 13_____________________________________________________________________________ */ c;\n\na =\n  b &&\n  /** 14_____________________________________________________________________________ */ c;\n\na = b + /** 15_______ */ c;\n\na = b + /** 16_______ */ c;\n\na =\n  b +\n  /** 17_____________________________________________________________________________ */\n  c;\n\na =\n  b +\n  /** 18_____________________________________________________________________________ */ c;\n\na =\n  b +\n  /** 19_____________________________________________________________________________ */ c;\n\na =\n  b || // 20_______\n  c;\n\na =\n  b || // 21_____________________________________________________________________________\n  c;\n\na =\n  b && // 22_______\n  c;\n\na =\n  b && // 23_____________________________________________________________________________\n  c;\n\na =\n  b + // 24_______\n  c;\n\na =\n  b + // 25_____________________________________________________________________________\n  c;\n\n0 +\n  // 26_______\n  x;\n\n0 *\n  // 27_______\n  x;\n0 /\n  // 28_______\n  x;\n0 -\n  // 29_______\n  x;\n0 %\n  // 30_______\n  x;\n0 <<\n  // 31_______\n  x;\n0 >>\n  // 32_______\n  x;\n0 &\n  // 33_______\n  x;\n0 |\n  // 34_______\n  x;\n0 ^\n  // 35_______\n  x;\n\n// source: \"../../samples/comments/binaryish.rs\""
  },
  {
    "path": "tests/output/comments/blocks.f.rs",
    "content": "if 0 {\n  0;\n  //\n} else if 0 {\n}\n\nif 1 {\n  /*\n   * _______\n   */\n}\n\nif 1 {\n  // _______\n}\n\nif 1 {\n} else {\n  // _______\n}\n\nif\n  1\n  // if 1 (ln trailing)\n{\n  1;\n} else if\n  // else if 2 (leading)\n  2\n{\n  2;\n} else if\n  // else if 3 (leading)\n  // else if 3 (leading)\n  // else if 3 (leading)\n  3\n  // if 3 (ln trailing)\n{\n  3;\n} else if\n  // else if 4 (leading)\n  4\n{\n  // 4 body\n} else {\n  // else (leading)\n}\n\nif\n  5 // if 5 (trailing)\n{\n  1;\n}\n\nif\n  6 // if 6 (trailing)\n{\n  6;\n} else if\n  7 // else if 7 (trailing)\n{\n  7;\n} else {\n  // else (trailing)\n  0;\n}\n\nif\n  8 // if 8 (trailing)\n  // ^ if 8 (ln trailing)\n{\n  1;\n} else if\n  9 // else if 9\n  // else if 9 (ln trailing)\n{\n  1;\n} else {\n  // else (trailing)\n  // else (ln trailing)\n  1;\n}\n\nif\n  10 /* _______ */ // _______\n{\n  10;\n} else if 11 /* _______ */ {\n  11;\n} else if\n  12 // _______ /* _______ */ // _______\n{\n  12;\n} else if\n  13 /* _______ */ /* _______ */ // _______\n{\n  13;\n} else {\n  /* _______ */ 0;\n}\n\nif\n  14 // _______\n  /* _______ */\n  // _______\n{\n  14;\n} else if\n  15 // _______\n  /* _______ */\n  /* _______ */ // _______\n\n{\n  15;\n}\n\nfor // _______\na in b {\n}\n\nfor /* _______ */ a in b {\n}\n\nlet a = {/* _______ */};\nlet b = {\n  // _______\n};\n\nfor e in q {\n  r = *e; // c\n}\n\nwhile\n  true\n  // _______\n{}\n\nwhile\n  true // _______\n{}\n\nwhile true {} // _______\n\nwhile true /*_______*/ {}\nwhile true /* _______ */ {}\n\nwhile\n  true && // _______\n  true // _______\n{}\n\nwhile true {} // _______\n\nif cond {\n  stuff;\n} else if /* _______ */ cond {\n  stuff;\n} else {\n  // _______\n  stuff;\n}\n\nif cond {\n  stuff;\n} else {\n  // _______\n  stuff;\n}\n\nret = if\n  __DEV__\n  // _______\n{\n  vm.runInContext(source, ctx)\n} else {\n  a\n};\n\nif a == 0 {\n  doSomething(); // _______\n} else if a == 1 {\n  doSomethingElse(); // _______\n} else if a == 2 {\n  doSomethingElse(); // _______\n}\nif a == 0 {\n  doSomething(); /* _______ */\n} else if a == 1 {\n  doSomethingElse(); /* _______ */\n} else if a == 2 {\n  doSomethingElse(); /* _______ */\n}\nif a == 0 {\n  expr; // _______\n} else if a == 1 {\n  expr; // _______\n} else if a == 2 {\n  expr; // _______\n}\nif a == 0 {\n  expr; /* _______ */\n} else if a == 1 {\n  expr; /* _______ */\n} else if a == 2 {\n  expr; /* _______ */\n}\nif a == 0 {\n  looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n} else if a == 1 {\n  looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n} else if a == 2 {\n  looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n}\nif code == 92 /* _______ */ {\n}\nif code == 92 /* _______ */ /* _______ */ {\n}\n\nif code == 92 /* _______ */ {\n}\nif code == 92 {/* _______ */}\n\nif\n  1\n  // _______\n{\n  a;\n}\n\n{\n  // _______\n  'a: loop {\n  }\n}\n{\n  // _______\n  'a: loop {\n  }\n}\n\nfn f() {\n  a\n  /* _______ */\n}\n\nfn f() {\n  a\n\n  /* _______ */\n}\n\nfn d() {/* _______ */}\n\nfn f() {\n  // _______\n  f();\n\n  // _______\n  f()\n\n  // _______\n  // _______\n}\n\nfn f() {\n  // _______\n  return 1;\n}\n\nfn f() {\n  // _______\n  return 1;\n}\n\nfn f() {\n  // _______\n  return 1;\n}\n\nfn f() {\n  // _______\n  return 1;\n}\n\n// So this is a very long comment.\n// Multi-line, too.\n// Will it still format correctly?\nunsafe {\n  a;\n}\n\n{/* a block with a comment */}\n{\n}\n{\n  // A block with a comment.\n}\n\nfn foo() {\n  (async {\n    // Do\n    // some\n    // work\n  }).await;\n\n  (async {\n    // Do\n    // some\n    // work\n  }).await;\n}\n\n// source: \"../../samples/comments/blocks.rs\""
  },
  {
    "path": "tests/output/comments/chain.f.rs",
    "content": "_\n  .a(a)\n  /* _____________________________________________________________________________ */\n  .a();\n\n_\n  .a(\n    a\n  ) /* _____________________________________________________________________________ */\n  .a();\n\n_\n  .a(\n    a\n  ) /* _____________________________________________________________________________ */\n  .a();\n\nSomething\n  // _______\n  .getInstance(this.props.dao)\n  .getters();\n\n// _______\nmeasure().then(|| {\n  SomethingLong();\n});\n\nmeasure() // _______\n  .then(|| {\n    SomethingLong();\n  });\n\nconst configModel = this.baseConfigurationService\n  .getCache()\n  .consolidated // _______\n  .merge(this.cachedWorkspaceConfig);\n\nthis\n  .doWriteConfiguration(target, value, options) // _______\n  .then(\n    || null,\n    || {\n      return if options.donotNotifyError {\n        TPromise.wrapError(error)\n      } else {\n        this.onError(error, target, value)\n      };\n    }\n  );\n\nangular\n  .module(\"AngularAppModule\")\n  // _______\n  .constant(\"API_URL\", \"http://localhost:8080/api\");\n\n// _______\nObservable.of(process)\n  // _______\n  .merge(Observable.never())\n  // _______\n  .takeUntil(\n    if throwOnError {\n      errors.flatMap(Observable.throw)\n    } else {\n      errors\n    }\n  )\n  .takeUntil(exit);\n\n// source: \"../../samples/comments/chain.rs\""
  },
  {
    "path": "tests/output/comments/closure.f.rs",
    "content": "call(|/*_______*/ row| {});\nKEYPAD_NUMBERS.map(\n  |num|\n    // _______\n    1\n);\n\nconst obj = A {\n  f1: /* _______ */ || {},\n  f2: |/* _______ */| {},\n  f3: || /* _______ */ {},\n  f4: /* _______ */ |/* _______ */| /* _______ */ {},\n};\n\n/* _______ */ (|| {})();\n(|/* _______ */| {})();\n(|| /* _______ */ {})();\n/* _______ */ (|/* _______ */| /* _______ */ {})();\n\nlet commented = |\n  /* first */ a /*argument*/,\n  /* second*/ b: WithType /* argument*/,\n  /* ignored */ _\n| (\n  aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa,\n  bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb,\n);\n\nconst fn1 = |/*_______, _______*/| doSomething();\nconst fn2 = |/*_______, _______*/| doSomething(anything);\n\nfoo(\n  |\n    // _______\n  | {}\n);\n\nconst rootEpic = |actions, store|\n  combineEpics(epics)(actions, store)\n    // _______\n    .catch(|err, stream| {\n      getLogger().error(err);\n      return stream;\n    });\n\n// source: \"../../samples/comments/closure.rs\""
  },
  {
    "path": "tests/output/comments/dangling.f.rs",
    "content": "use std::{/* comment */};\n\nmacro_rules! m {/* comment */}\nmacro_rules! m {\n  /* comment */ /* comment */ (/* comment */) => {/* comment */};\n}\n\nmacro m/* comment */ (/* comment */) {/* comment */}\n\n{/* comment */}\n\nf(/* comment */);\n\nf /* comment */!(/* comment */);\nf /* comment */! {/* comment */}\nf /* comment */![/* comment */];\n\nf!([/* comment */]);\nf!({/* comment */});\nf!((/* comment */));\n\nf!(~[/* comment */]);\nf!(~{/* comment */});\nf!(~(/* comment */));\n\n[/* comment */];\n(/* comment */);\nA /* comment */ {/* comment */};\n\nif let A {/* comment */} | a(/* comment */) | [/* comment */] = (/* comment */) {\n}\n\nif 0 {/* comment */}\nif 0 {/* comment */} else {\n  /* comment */\n  /* comment */\n  /* comment */\n}\nif 0 {/* comment */} else if /* comment */ /* comment */ 0 {/* comment */}\nif 0 {/* comment */} else if\n  /* comment */ /* comment */ /* comment */ let _ = 0\n{/* comment */}\n\nmatch (/* comment */) {/* comment */}\n\nfn a(/* comment */) {\n  /* comment */\n  /* comment */\n}\n\n|/* comment */| 0;\n\nimpl A {/* comment */}\ntrait A {/* comment */}\nenum A {/* comment */}\nstruct A(/* comment */);\nstruct A {/* comment */}\nmod A {/* comment */}\nuse A::{/* comment */};\nunion A {/* comment */}\n\nA::</* comment */>;\nA::</* comment */>(/* comment */);\n\ntype A</* comment */>\n  : fn(/* comment */)\n  where\n    for</* comment */> A</* comment */>: for</* comment */> Fn(/* comment */) -> (/* comment */);\n\n#![/* comment */]\n#[/* comment */]\nstruct A;\n\n#![/* comment */]\n#[/* comment */]\nstruct A;\n\n#![/* comment */]\n#[/* comment */]\n#[/* comment */]\nstruct A;\n\n#![/* comment */]\n#![/* comment */]\n#[/* comment */]\nstruct A;\n\n#![/* comment */]\n#![/* comment */]\n#[/* comment */]\n#[/* comment */]\nstruct A;\n\n#![/* comment */]\n#![/* comment */]\n#[/* comment */]\n#[/* comment */]\nstruct A;\n\n// source: \"../../samples/comments/dangling.rs\""
  },
  {
    "path": "tests/output/comments/file.f.rs",
    "content": "// This file only\n// has comments. This comment\n// should still exist\n//\n// when printed.\n\n/**\n * @typedef {DataDrivenMapping|ConstantMapping} Mapping\n */\n/**\n * @typedef {Object.<String, Mapping>} ConfigurationMapping\n */\n\n/**\n * @typedef {Function} D3Scale - a D3 scale\n * @property {Function} ticks\n * @property {Function} tickFormat\n */\n// comment\n\n// comment\n\n// source: \"../../samples/comments/file.rs\""
  },
  {
    "path": "tests/output/comments/flow.f.rs",
    "content": "loop {\n  break /* _______ */;\n  continue /* _______ */;\n}\n\n'loop: loop {\n  break /* _______ */ 'loop;\n  break 'loop /* _______ */;\n  continue /* _______ */ 'loop;\n  continue 'loop /* _______ */;\n}\n\nreturn (\n  // _______\n  !!x\n);\n\nreturn 1337; // _______\n\nreturn (\n  // _______\n  42 && 84\n);\n\nreturn (\n  // _______\n  42 * 84\n);\n\nreturn if\n  // _______\n  42\n{\n  1\n} else {\n  2\n};\n\nreturn if\n  // _______\n  42 * 3\n{\n  1\n} else {\n  2\n};\n\nreturn (\n  // _______\n  a()\n);\n\nreturn (\n  // _______\n  a.b.c\n);\n\nreturn (\n  // _______\n  a.b.c\n);\n\nreturn (\n  afn\n    .b()\n    // _______\n    .c.d()\n);\n\nreturn (\n  // _______\n  if a.b() * 3 + 4 + (if (\"a`hi`\", 1) { 1 } else { 1 }) {\n  } else {\n    1\n  }\n);\n\nreturn (\n  // _______\n  a,\n  b,\n);\n\nreturn (\n  // _______\n  a\n);\n\nreturn /* _______ */ 42 || 42;\n\nreturn (\n  observableFromSubscribeFunction()\n    // _______\n    // _______\n    .debounceTime(debounceInterval)\n);\n\nreturn A {\n  // _______\n  bar: baz() + 1,\n};\n\n// source: \"../../samples/comments/flow.rs\""
  },
  {
    "path": "tests/output/comments/functions.f.rs",
    "content": "fn a(/* _______ */) {} // _______\nfn b() {} // _______\nfn c(/* _______ */ argA, argB, argC) {} // _______\nfn a(a /*_______*/) {}\nfn b(a /*_______*/) {}\nfn d(a /*_______*/, b /*_______*/, c /*_______*/, d /*_______*/) {}\nfn d(a /*_______*/, b /*_______*/, c /*_______*/, d /*_______*/) {/*_______*/}\n// prettier-ignore\nfn c(a /*_______*/\n) {}\n// prettier-ignore\nfn d(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) {}\n// prettier-ignore\nfn e(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) {} /* _______*/\n\nfn f1 /* _______ */() {}\nfn f2(/* _______ */) {}\nfn f3() {/* _______ */}\nfn f4 /* _______ */(/* _______ */) {/* _______ */}\nfn f5(/* _______ */ /* _______ */ a) {}\nfn f6(/* _______ */ a /* _______ */) {}\nfn f7(/* _______ */ /* _______ */ a) {/* _______ */}\n\n// source: \"../../samples/comments/functions.rs\""
  },
  {
    "path": "tests/output/comments/ignore.attr.f.rs",
    "content": "const baseline = 1 + 1;\n\nfn no() {\n  a(  a  ); #![rustfmt::skip]\n  // _______\n}\n\n#[rustfmt::skip]\nconst a    =   A {\n  b:\n          \"_______\",\n};\n\nfn   f()    {\n\t1    +  1;\n\t#[no   ]\n\t#![rustfmt::skip]\n\tfn f() {\n\t  1     + 1;\n\t}\n}\n\n// source: \"../../samples/comments/ignore.attr.rs\""
  },
  {
    "path": "tests/output/comments/ignore.f.rs",
    "content": "const baseline = 1 + 1;\n\n// prettier-ignore\nlet x =\n  \"\" + this.USE + \" \" + this.STRICT + \";\\n\" +\n  this.filterPrefix() +\n  \"var fn=\" + this.generateFunction(\"fn\", \"s,l,a,i\") +\n  extra +\n  this.watchFns() +\n  \"return fn;\";\n\n// prettier-ignore\nconst x = Matrix.create(\n  1, 0, 0,\n  0, 1, 0,\n  0, 0, 0\n);\n\n// prettier-ignore\nconst x =   A {\n  b:\n          \"_______\",\n};\n\nfn f() {\n  a(  a  ); // prettier-ignore\n  // _______\n}\n\n// prettier-ignore\nconsole.error(\n  \"_______\" + prompt + \"_______\" +\n  \"_______ _______\"\n);\n\nconst response = A {\n  // prettier-ignore\n  a: \"Turn on the lights\",\n  intent: \"lights\",\n};\n\nverylongidentifierthatwillwrap123123123123123(\n  a.b\n    // prettier-ignore\n    // _______\n    .c\n);\n\ncall(\n  // _______\n  a.\n    // prettier-ignore\n    b\n);\n\ncall(a(\n/*\n_______\n*/\n1,\n2.0000, 3\n)\n    // prettier-ignore\n    .c);\n\n#[attr]\n// prettier-ignore\nconst foo = 1 +      1;\n\nconst A {\n  // prettier-ignore\n  bar :           a,\n} = foo;\n\nconst A {\n  a,\n  // prettier-ignore\n  bar2 :           a,\n} = foo;\n\n/* _______ */\nconst A {\n  // prettier-ignore\n  bar3 :           a, // _______\n} = foo;\n\nconst A {\n  // prettier-ignore\n  bar4 :           a /* _______ */,\n} = foo;\n\nconst A {\n  // prettier-ignore\n  bar5 :           /* _______ */          a,\n} = foo;\n\nconst A {\n  // prettier-ignore\n  ..\n} = foo;\n\nconst A {\n  baz: A {\n    // prettier-ignore\n    foo2: [a, b,    c],\n  },\n  // prettier-ignore\n  bar7 :            a,\n} = foo;\n\n// source: \"../../samples/comments/ignore.rs\""
  },
  {
    "path": "tests/output/comments/ignore.file.f.rs",
    "content": "\tconst unformatted= 1;\n\n#![rustfmt::skip] // a\n\n fn unformatted () {\n\t struct a {\n\t\t \t\t\t// b\n\t\t c\n\t }\n }\n// source: \"../../samples/comments/ignore.file.rs\""
  },
  {
    "path": "tests/output/comments/imports.f.rs",
    "content": "use list::{\n  // Some item\n  SomeItem /* Comment */,\n  /* Another item */ AnotherItem /* Another Comment */, // Last Item\n  LastItem,\n};\nuse test::{ Other /* C   */, /*   A   */ self /*    B     */ };\nuse ::{ /* Pre-comment! */ Foo, Bar /* comment */ };\n\n// source: \"../../samples/comments/imports.rs\""
  },
  {
    "path": "tests/output/comments/macro.f.rs",
    "content": "a!(~ \" {    }  \");\na!(~ // 1\n);\na!(~ {  // 2\n});\n\ncfg_if::cfg_if! {\n  if #[attr] {\n    if 0 {\n    } else {\n      // ERROR!\n    }\n  }\n}\n\na! {\n    if #[attr] {\n        // ERROR!\n    } \n}\n\nx! {~ {\n    // ERROR!\n}\n}\n\n// source: \"../../samples/comments/macro.rs\""
  },
  {
    "path": "tests/output/comments/multiple.f.rs",
    "content": "/* _______ */ /* _______ */ /* _______ */ a;\na; /* _______ */ /* _______ */ /* _______ */\na; // _______\na;\n/*1*/ /*2*/ /*3*/\nb;\n\na; /*1*/ /*2*/ /*3*/\nb;\n\na;\n/*1*/ /*2*/ /*3*/ b;\n\na;\n/*\n1*/ /*2*/ /*3\n */\nb;\n\na; /*\n1*/ /*2*/\n/*3\n */\nb;\n\na;\n/*\n1*/ /*2*/ /*3\n */ b;\n\na;\n/*1*/ /*2*/\n/*3*/\nb;\n\na; /*1*/ /*2*/\n/*3*/\nb;\n\na;\n/*1*/ /*2*/\n/*3*/ b;\n\na;\n/*\n1*/ /*2*/\n/*3\n */\nb;\n\na; /*\n1*/ /*2*/\n/*3\n */\nb;\n\na; /*\n1*/ /*2*/\n/*3\n */ b;\n\na;\n/*1*/\n/*2*/ /*3*/\nb;\n\na; /*1*/\n/*2*/ /*3*/\nb;\n\na;\n/*1*/\n/*2*/ /*3*/ b;\n\na;\n/*\n1*/\n/*2*/ /*3\n */\nb;\n\na; /*\n1*/\n/*2*/ /*3\n */\nb;\n\na; /*\n1*/\n/*2*/ /*3\n */ b;\n\nuse foo; /*\n14\n*/ /* 1\n10\n*/ /*/ 13 */\n/*\n 9\n ****/\nuse bar;\n\nx; /*\n1 */ /* 2 */\n\ny;\n\nx; /*1*/ /*2*/\ny;\n\n/** 1 - OUTER DOC */\n\n/* 2 - COMMENT */\n\n/*! 3 - INNER DOC */\n\n/*! 4 - INNER DOC *//**\n\n/* 5A - COMMENT */\n * 5B - OUTER DOC\n */\n/**\n * 5C - OUTER DOC\n */\n\n// format: lost 1 comments\n// source: \"../../samples/comments/multiple.rs\""
  },
  {
    "path": "tests/output/comments/parens.f.rs",
    "content": "!x;\n!(x /* 0 */);\n!(/* 1 */ x);\n!(\n  /* 2 */\n  x\n);\n!(\n  x\n  /* 3 */\n);\n!(\n  x // 4\n);\n\n!(x + y);\n!(x + y /* 5 */);\n!(/* 6 */ x + y);\na!(!(/* 6 */ x + y));\n!(\n  /* 7 */\n  x + y\n);\n!(\n  x + y\n  /* 8 */\n);\n!(\n  x + y // 9\n);\n\n!(x || y);\n!(/* 10 */ x || y);\n!(x || y /* 11 */);\n!(\n  /* 12 */\n  x || y\n);\n!(\n  x || y\n  /* 13 */\n);\n!(\n  x || y // 14\n);\n\n![1, 2, 3];\n!([1, 2, 3] /* 15 */);\n!(/* 16 */ [1, 2, 3]);\n!(\n  /* 17 */\n  [1, 2, 3]\n);\n!(\n  [1, 2, 3]\n  /* 18 */\n);\n!(\n  [1, 2, 3] // 19\n);\n\n!(A { a: 1, b: 2 });\n!(A { a: 1, b: 2 } /* 20 */);\n!(/* 21 */ A { a: 1, b: 2 });\n!(\n  /* 22 */\n  A { a: 1, b: 2 }\n);\n!(\n  A { a: 1, b: 2 }\n  /* 23 */\n);\n!(\n  A { a: 1, b: 2 } // 24\n);\n\n!(|| {\n  return x;\n});\n!(\n  || {\n    return x;\n  } /* 25 */\n);\n!(\n  /* 26 */ || {\n    return x;\n  }\n);\n!(\n  /* 27 */\n  || {\n    return x;\n  }\n);\n!(\n  || {\n    return x;\n  }\n  /* 28 */\n);\n!(\n  || {\n    return x;\n  } // 29\n);\n\n!({\n  x = y;\n});\n!(\n  {\n    x = y;\n  } /* 30 */\n);\n!(\n  /* 31 */ {\n    x = y;\n  }\n);\n!(\n  /* 32 */\n  {\n    x = y;\n  }\n);\n!(\n  {\n    x = y;\n  }\n  /* 33 */\n);\n!(\n  {\n    x = y;\n  } // 34\n);\n\n!x.y;\n!(x.y /* 35 */);\n!(/* 36 */ x.y);\n!(\n  /* 37 */\n  x.y\n);\n!(\n  x.y\n  /* 38 */\n);\n!(\n  x.y // 39\n);\n\n!x();\n!(x() /* 40 */);\n!(/* 41 */ x());\n!(\n  /* 42 */\n  x()\n);\n!(\n  x()\n  /* 43 */\n);\n!(\n  x() // 44\n);\n\n!(x, y);\n!(x, y /* 45 */);\n!(/* 46 */ x, y);\n!(\n  /* 47 */\n  x,\n  y,\n);\n!(\n  x,\n  y,\n  /* 48 */\n);\n!(\n  x.y // 49\n);\n\n!(|| 3);\n!(|| 3 /* 50 */);\n!(/* 51 */ || 3);\n!(\n  /* 52 */\n  || 3\n);\n!(\n  || 3\n  /* 53 */\n);\n!(\n  || 3 // 54\n);\n\nloop {\n  !({\n    yield x;\n  });\n  !(\n    {\n      yield x;\n    } /* 55 */\n  );\n  !(\n    /* 56 */ {\n      yield x;\n    }\n  );\n  !(\n    /* 57 */\n    {\n      yield x;\n    }\n  );\n  !(\n    {\n      yield x;\n    }\n    /* 58 */\n  );\n  !(\n    {\n      yield x;\n    } // 59\n  );\n}\n\nasync || {\n  !x.await;\n  !(x.await /* 60 */);\n  !(/* 61 */ x.await);\n  !(\n    /* 62 */\n    x.await\n  );\n  !(\n    x.await\n    /* 63 */\n  );\n  !(\n    x.await // 64\n  );\n};\n\nMath.min(\n  /* ______________________________________________________________\n   * _______________________________________________________________\n   * _______ */\n  document.body.scrollHeight -\n    (window.scrollY + window.innerHeight) -\n    devsite_footer_height,\n  0\n);\n\n// source: \"../../samples/comments/parens.rs\""
  },
  {
    "path": "tests/output/comments/whitespace.f.rs",
    "content": "/*\n  1\n        */\n/*\n          2\n        */\n/*\n\t\t\t\t\t\t\t\t  3\n        */\n/*\n\n\n\n\n\n\n\n\n  4\n        */\n\n/*\n  5a                       5b\n    */\n/*\n\t\t6\n    */\n/*\n      7a                       7b\n    */\n/*\n\t\t\t\t  8a                     8b\n    */\n\n/*\n\u000b\u000b\u000b\u000b  VT4+2:                         9\n    */\n/*\n\f\f\f\f  FF4+2:                         10\n    */\n/*\n\n\n\n\n  CR4+2:                         11\n    */\n/*\n  NEL4+2:                        12\n    */\n/*\n      13a          13b\n    */\n/*\n      14\n    */\n/*\n      15a         15b\n    */\n\n/*\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n    */\n\n/* */\n/*\n        17a\n        17b                     17c\n        17d\n      */\n/* */\n/*\n        18a\n        18b                     18c\n        18d\n      */\n\n// source: \"../../samples/comments/whitespace.rs\""
  },
  {
    "path": "tests/output/common/arrays.f.rs",
    "content": "{\n  for srcPath in [src, \"${src}.js\", \"${src}/index\", \"${src}/index.js\"] {\n  }\n}\n{\n  for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43] {\n  }\n}\n{\n  for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432] {\n  }\n}\n{\n  for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321] {\n  }\n}\n\n[[]];\n[[], []];\n[[], [], []];\n[[], [0], []];\n[[], [0], [0]];\n[[], [0, 1], [0]];\n[[], [0, 1], [0, 1]];\n[[0]];\n[[0], []];\n[[0], [], []];\n[[0], [0], []];\n[[0], [0], [0]];\n[[0], [0, 1], [0]];\n[[0], [0, 1], [0, 1]];\n[[0, 1]];\n[[0, 1], []];\n[[0, 1], [], []];\n[[0, 1], [0], []];\n[[0, 1], [0], [0]];\n[[0, 1], [0, 1], [0]];\n[\n  [0, 1],\n  [0, 1],\n  [0, 1],\n];\n[[], [1, 2, 3]];\n[[1], [1]];\n[\n  [1, 2],\n  [1, 2, 3],\n];\n[\n  [1, 0],\n  [1, 0],\n];\n[A {}];\n[A {}, A {}];\n[A {}, A {}, A {}];\n[A {}, A { a }];\n[A {}, A { a, b }];\n[A {}, A { a, b, c }];\n[A { a }];\n[A { a }, A { a }];\n[A { a }, A { a }, A { a }];\n[A { a }, A { a, b }];\n[A { a }, A { a, b, c }];\n[A { a, b }];\n[A { a, b }, A { a }];\n[A { a, b }, A { a }, A { a }];\n[\n  A { a, b },\n  A { a, b },\n];\n[\n  A { a, b },\n  A { a, b, c },\n];\n\nexpect(|| {}).toTriggerReadyStateChanges([\n  // _______\n]);\n\nexpect(bifornCringerMoshedPerplexSawder.getArrayOfNumbers()).toEqual([\n  1, 2, 3, 4, 5,\n]);\n\nexpect(bifornCringerMoshedPerplexSawder.getLongArrayOfNumbers()).toEqual([\n  66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, 76,\n  41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, 33, 40,\n  58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, 91, 27, 83,\n  26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, 31, 86, 27,\n  39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, 35, 48, 78, 97,\n]);\n\nbifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers = [\n  1, 2, 3, 4, 5,\n];\n\nbifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers2 = [\n  66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, 76,\n  41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, 33, 40,\n  58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, 91, 27, 83,\n  26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, 31, 86, 27,\n  39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, 35, 48, 78, 97,\n];\n\nconst numbers = [\n  -2017,\n  -506252,\n  -744011292,\n  -7224,\n  -70.4,\n  -83353.6,\n  -708.4,\n  -174023963.52,\n  -40385,\n  -(\n    // comment1\n    380014\n  ),\n  -253951682,\n  -728,\n  -15.84,\n  -2058467564.56,\n  -43,\n  -33,\n  -85134845,\n  -67092,\n  -1,\n  -78820379,\n  -2371.6,\n  -16,\n  7,\n  // comment2\n  -62454,\n  -4282239912,\n  -10816495.36,\n  0.88,\n  -100622682,\n  8.8,\n  -67087.68000000001,\n  -3758276,\n  -25.5211,\n  -54,\n  -1184265243,\n  -46073628,\n  -280423.44,\n  -41833463,\n  -27961.12,\n  -305.36,\n  -199875.28,\n];\n\nc = [\n  -(/**/ 66),\n  66,\n  57,\n  45,\n  47,\n  33,\n  53,\n  82,\n  81,\n  76,\n  66,\n  57,\n  45,\n  47,\n  33,\n  53,\n  82,\n  81,\n  223323,\n];\n\nconst numbers1 = [\n  -2017, -506252, -744011292, -7224, -70.4, -83353.6, -708.4, -174023963.52,\n  -40385,\n  // comment1\n  -380014, -253951682, -728, -15.84, -2058467564.56, -43, -33, -85134845, -67092,\n  -1, -78820379, -2371.6, -16, 7,\n  // comment2\n  -62454, -4282239912, -10816495.36, 0.88, -100622682, 8.8, -67087.68000000001,\n  -3758276, -25.5211, -54, -1184265243, -46073628, -280423.44, -41833463, -27961.12,\n  -305.36, -199875.28,\n];\n\nconst numbers2 = [\n  -234,\n  -342, // comment3\n  -223,\n  -333333.33,\n  12345,\n];\n\nlet _v1 = [\n  // a\n  0,\n  // b\n  1,\n  // c\n  2,\n];\nlet _v2 = [\n  0, // a\n  1, // b\n  2,\n]; // c\nlet _v3 = [\n  /* a */\n  0,\n  /* b */\n  1,\n  /* c */\n  2,\n];\nlet _v4 = [0 /* a */, 1 /* b */, 2]; /* c */\n[\n  &(|x /*: r*/| {\n    x.e();\n  }),\n];\n\n// --------------- print-width -------------------------------------------------\n\nconst result = asyncExecute(\"non_existing_command\", /* _______ */ []);\n\nlet b = [/* _______ */];\n\nc = [\n  66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81,\n  223323,\n];\n\n[1 /* _______ _______ */, 2 /* _______ _______ */, 3];\n\nfn isUnusedDiagnostic(code) {\n  return [\n    6133, // '{0}' is declared but never used.\n    6138, // Property '{0}' is declared but its value is never read.\n    6192, // All imports in import declaration are unused.\n    6196, // '{0}' is declared but its value is never read.\n    6198,\n    6199,\n    6205, // All type parameters are unused.\n  ].includes(code);\n}\n\nconst lazyCatererNumbers = [\n  1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79, 92, 106, 121, 137, 154, 172, 191,\n  211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466 /*block*/,\n  // line\n  497, 529, 562, 596, 631, 667, 704, 742, 781, 821, 862, 904, 947, 991, 1036,\n  1082, 1129, 1177, 1226,\n  // line 2\n  1276, 1327, 1379,\n];\n\nconst numbers1 = [\n  7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166,\n  7234932843, 7234932978, 7234932436, 7234932687, 7234932269, 7234932573,\n  7234932913, 7234932873, 7234932748, 7234932354, 7234932153, 7234932181,\n  7234932947, 7234932563, 7234932324, 7234932952, 7234932885, 7234932911,\n  7234932698, 7234932248, 7234932764, 7234932431, 7234932811, 7234932344,\n  7234932855, 7234932430, 7234932396, 7234932981, 7234932594, 7234932131,\n  7234932489, 7234932552, 7234932116, 7234932833, 7234932521, 7234932252,\n  7234932503, 7234932540, 7234932893, 7234932736, 7234932969, 7234932145,\n  7234932925, 7234932417, 7234932344, 7234932108, 7234932161, 7234932777,\n  7234932971, 7234932159, 7234932158, 7234932908, 7234932511, 7234932876,\n  7234932768, 7234932284, 7234932640, 7234932309, 7234932651, 7234932292,\n  7234932898, 7234932284, 7234932201, 7234932506, 7234932654, 7234932840,\n  7234932334, 7234932246, 7234932376, 7234932398, 7234932714, 7234932134,\n  7234932435, 7234932181, 7234932980, 7234932594, 7234932396, 7234932100,\n  7234932743, 7234932812, 7234932583, 7234932622, 7234932800, 7234932310,\n  7234932111, 7234932537, 7234932751, 7234932920, 7234932872, 7234932700,\n  7234932702, 7234932655, 7234932515, 7234932298,\n];\n\nconst userIds1 = [7234932941, 7234932722, 7234932312, 7234932933];\n\nconst userIds2 = [\n  7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166,\n  7234932843, 7234932978, 7234932436,\n];\n\nconst userIds3 = [\n  7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166,\n  7234932843,\n\n  7234932978, 7234932436,\n];\n\nconst userIds4 = [\n  7234932941, 7234932722, 7234932312, 7234932933, 7234932841, 7234932166,\n  // comment 1\n  7234932843,\n\n  7234932978,\n\n  // comment 2\n  7234932436,\n  // comment 3\n];\n\nlet test_case = [\n  [\n    66, 57, 45, 47, 33, 53, 82, 81, 76, 78, 10, 78, 15, 98, 24, 29, 32, 27, 28, 76,\n    41, 65, 84, 35, 97, 90, 75, 24, 88, 45, 23, 75, 63, 86, 24, 39, 9, 51, 33, 40,\n    58, 17, 49, 86, 63, 59, 97, 91, 98, 99, 5, 69, 51, 44, 34, 69, 17, 91, 27, 83,\n    26, 34, 93, 29, 66, 88, 49, 33, 49, 73, 9, 81, 4, 36, 5, 14, 43, 31, 86, 27,\n    39, 75, 98, 99, 55, 19, 39, 21, 85, 86, 46, 82, 11, 44, 48, 77, 35, 48, 78, 97,\n  ],\n  [\n    41, 83, 31, 62, 15, 70, 10, 90, /*21,*/ 48, 39, 76, 14, 48, 63, 62, 16, 17, 61,\n    97, 86, 80, 34, 27, 39, 53, 90, 80, 56, 71, 31, 22, 29, 7, 71, 90, 65, 17, 48,\n    85, 14, 94, 16, 32, 4, 96, 49, 97, 53, 87, 54, 2, 78, 37, 21, 3, 97, 62, 93,\n    62, 11, 27, 14, 29, 64, 44, 11, 5, 39, 43, 94, 52, 0, 4, 86, 58, 63, 42, 97,\n    54, 2, 1, 53, 17, 92, 79, 52, 47, 81, 93, 34, 17, 93, 20, 61, 68, 58, 49, 27,\n    45,\n  ],\n];\n\n// source: \"../../samples/common/arrays.rs\""
  },
  {
    "path": "tests/output/common/assignments.f.rs",
    "content": "const computedDescriptionLines =\n  (showConfirm && descriptionLinesConfirming) ||\n  (focused && !loading && descriptionLinesFocused) ||\n  descriptionLines;\n\ncomputedDescriptionLines =\n  (focused && !loading && descriptionLinesFocused) || descriptionLines;\n\nconst result = template(r#\"\n  if (SOME_VAR == \"\") {}\n\"#)(A {\n  SOME_VAR: value,\n});\n\nconst output = template(\"function f() %%A%%\")(A {\n  A: t.blockStatement([]),\n});\n\ntt.parenR.updateContext = {\n  tt.braceR.updateContext = || {\n    if this.state.context.length == 1 {\n      return;\n    }\n  };\n};\nlet bifornCringerMoshedPerplexSawder = {\n  askTrovenaBeenaDependsRowans = {\n    glimseGlyphsHazardNoopsTieTie = {\n      averredBathersBoxroomBuggyNurl = {\n        anodyneCondosMalateOverateRetinol = {\n          annularCooeedSplicesWalksWayWay = kochabCooieGameOnOboleUnweave;\n        };\n      };\n    };\n  };\n};\n\nbifornCringerMoshedPerplexSawder = {\n  askTrovenaBeenaDependsRowans = {\n    glimseGlyphsHazardNoopsTieTie = {\n      x = {\n        averredBathersBoxroomBuggyNurl = {\n          anodyneCondosMal(\n            sdsadsa,\n            dasdas,\n            asd(|| sdf)\n          ).ateOverateRetinol = {\n            annularCooeedSplicesWalksWayWay = kochabCooieGameOnOboleUnweave;\n          };\n        };\n      };\n    };\n  };\n};\n\nbifornCringerMoshedPerplexSawder = {\n  askTrovenaBeenaDependsRowans = {\n    glimseGlyphsHazardNoopsTieTie = {\n      x = {\n        averredBathersBoxroomBuggyNurl = {\n          anodyneCondosMal(\n            sdsadsa,\n            dasdas,\n            asd(|| sdf)\n          ).ateOverateRetinol = {\n            annularCooeedSplicesWalksWayWay =\n              kochabCooieGameOnOboleUnweave + kochabCooieGameOnOboleUnweave;\n          };\n        };\n      };\n    };\n  };\n};\n\na = {\n  b = c;\n};\n\nconst [width, height, baseline] = measureText(nextText, getFontString(element));\n\n{\n  {\n    const A {\n      id,\n      statlc: isStatic,\n      method: isMethod,\n      methodId,\n      getId,\n      setId,\n    } = privateNamesMap.get(name);\n\n    const A { id1, method: isMethod1, methodId1 } = privateNamesMap.get(name);\n\n    const A {\n      id2,\n      method: isMethod2,\n      methodId2,\n    } = privateNamesMap.get(bifornCringerMoshedPerplexSawder);\n\n    const A {\n      id3,\n      method: isMethod3,\n      methodId3,\n    } = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder);\n  }\n}\n\nlet A {\n  bottom: offsetBottom,\n  left: offsetLeft,\n  right: offsetRight,\n  top: offsetTop,\n} = if getPressRectOffset == null {\n  DEFAULT_PRESS_RECT\n} else {\n  getPressRectOffset()\n};\n\nconst A {\n  accessibilityModule: FooAccessibilityModule,\n  accessibilityModule: FooAccessibilityModule2,\n  accessibilityModule: FooAccessibilityModule3,\n  accessibilityModule: FooAccessibilityModule4,\n} = foo || A {};\n\n(A {\n  prop: {\n    toAssign = \"default\";\n  },\n} = A { prop: \"propval\" });\n\nsomeReallyLongThingStoredInAMapWithAReallyBigName[pageletID] = if\n  _someVariableThatWeAreCheckingForFalsiness\n{\n  Date.now() - _someVariableThatWeAreCheckingForFalsiness\n} else {\n  0\n};\n\nconst aVeryLongNameThatGoesOnAndOn =\n  this.someOtherObject.someOtherNestedObject.someLongFunctionName();\n\nthis.someObject.someOtherNestedObject =\n  this.someOtherObject.whyNotNestAnotherOne.someLongFunctionName();\n\nthis.isaverylongmethodexpression.withmultiplelevels = {\n  this.isanotherverylongexpression.thatisalsoassigned = 0;\n};\n\nconst areaPercentageDiff = (\n  topRankedZoneFit.areaPercentageRemaining -\n  previousZoneFitNow.areaPercentageRemaining\n).toFixed(2);\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  \"a very long string for illustrative purposes\".length;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes();\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes.length;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes + 1;\n\ntrait foo {\n  fn bar() {\n    const median = if dates.length % 2 {\n      dates[half].getTime()\n    } else {\n      (dates[half - 1].getTime() + dates[half].getTime()) / 2.0\n    };\n  }\n}\n\nmanifestCache[templateId] = readFileSync(\n  \"${MANIFESTS_PATH}/${templateId}.json\",\n  A { encoding: \"utf-8\" }\n);\n\nthis.dummy.type1.dummyPropertyFunction = {\n  this.dummy.type2.dummyPropertyFunction = {\n    this.dummy.type3.dummyPropertyFunction = {\n      this.dummy.type4.dummyPropertyFunction = {\n        this.dummy.type5.dummyPropertyFunction = {\n          this.dummy.type6.dummyPropertyFunction = {\n            this.dummy.type7.dummyPropertyFunction = {\n              this.dummy.type8.dummyPropertyFunction = || {\n                return \"dummy\";\n              };\n            };\n          };\n        };\n      };\n    };\n  };\n};\n\nif something {\n  const otherBrandsWithThisAdjacencyCount123 = Object.values(\n    edge.to.edges\n  ).length;\n}\n\nconst A { qfwvfkwjdqgz, bctsyljqucgz, xuodxhmgwwpw } = qbhtcuzxwedz(\n  yrwimwkjeeiu,\n  njwvozigdkfi,\n  alvvjgkmnmhd\n);\n\nasync fn f() {\n  const A { data, status } = request.delete(\n    \"/account/${accountId}/documents/${type}/${documentNumber}\",\n    A { validateStatus: || true }\n  ).await;\n  return A { data, status };\n}\n\nconst data1 = request.delete(\n  \"----------------------------------------------\",\n  A { validateStatus: || true }\n);\n\nconst data2 = request.delete(\n  \"----------------------------------------------x\",\n  A { validateStatus: || true }\n);\n\nconst data3 = request.delete(\n  \"----------------------------------------------xx\",\n  A { validateStatus: || true }\n);\n\nconst data4 = request.delete(\n  \"----------------------------------------------xxx\",\n  A { validateStatus: || true }\n);\n\nconst A { imStore, showChat, customerServiceAccount } =\n  store[config.reduxStoreName];\n\nconst t = A {\n  hello__: world(),\n  __this_is_a_very_long_key_and_the_assignment_should_be_put_on_the_next_line: orMaybeIAmMisunderstandingAndIHaveSetSomethingWrongInMyConfig(),\n  can_someone_explain__: this(),\n};\n\nsomething.veeeeeery.looooooooooooooooooooooooooong =\n  some.other.rather.long.chain;\n\nsomething.veeeeeery.looooooooooooooooooooooooooong =\n  some.other.rather.long.chain.functionCall();\n\nconst pendingIndicators =\n  shield.alarmGeneratorConfiguration.getPendingVersionColumnValues;\nconst pendingIndicatorz =\n  shield.alarmGeneratorConfiguration.getPendingVersionColumnValues();\n\nconst _id1 =\n  data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty._id;\nconst A { _id2 } =\n  data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty;\nconst A { _id: id3 } =\n  data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty;\n\nlet vgChannel = pointPositionDefaultRef(A {\n  model,\n  defaultPos,\n  channel,\n})();\n\nlet vgChannel2 = pointPositionDefaultRef(A { model, defaultPos, channel })();\n\nconst bifornCringerMoshedPerplexSawderGlyphsHa =\n  someBigFunctionName(\"foo\")(\"bar\");\n\nif true {\n  node.id = this.flowParseTypeAnnotatableIdentifier(\n    /*allowPrimitiveOverride*/ true\n  );\n}\n\nconst bifornCringerMoshedPerplexSawderGlyphsHb = someBigFunctionName(r\"foo\n\")(\n  \"bar\"\n);\n\nfor i in 0..arr.length {\n  console.log(arr[i]);\n}\n\nconst loooooooooooooooooooooooooong1 =\n  -looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong2 =\n  -\"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong3 =\n  !looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong4 =\n  !\"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong5 =\n  --looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong6 =\n  --\"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong7 =\n  !!looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong8 =\n  !!\"looooooooooooooooooooooooooooooooooooooooooog\";\n\nthis.size = {\n  this._origin = {\n    this._capacity = 0;\n  };\n};\n\nlet value =\n  ____________________________________________________ ^\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________ &\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________ |\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________ <<\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________ >>\n  ____________________________________________________;\n\nif\n  ____________________________________________________ <\n  ____________________________________________________\n{\n  //\n}\n\nif\n  ____________________________________________________ <=\n  ____________________________________________________\n{\n  //\n}\n\nif\n  ____________________________________________________ >\n  ____________________________________________________\n{\n  //\n}\n\nif\n  ____________________________________________________ >=\n  ____________________________________________________\n{\n  //\n}\n\nif\n  ____________________________________________________ ==\n  ____________________________________________________\n{\n  //\n}\n\nif\n  (____________________________________________________ &&\n    ____________________________________________________) ||\n  ____________________________________________________\n{\n  //\n}\n\nlet value =\n  ____________________________________________________ +\n  ____________________________________________________ +\n  ____________________________________________________ +\n  ____________________________________________________ +\n  ____________________________________________________ +\n  ____________________________________________________ +\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________ +\n  ____________________________________________________ *\n    ____________________________________________________ -\n  ____________________________________________________ /\n    ____________________________________________________ +\n  (____________________________________________________ *\n    ____________________________________________________ *\n    ____________________________________________________) /\n    ____________________________________________________ /\n    ____________________________________________________ +\n  ____________________________________________________;\n\nlet value =\n  ____________________________________________________..____________________________________________________;\n\nlet value =\n  ____________________________________________________..=____________________________________________________;\n\n// source: \"../../samples/common/assignments.rs\""
  },
  {
    "path": "tests/output/common/binaryish.f.rs",
    "content": "fn f() {\n  const appEntities = getAppEntities(loadObject).filter(\n    |entity|\n      entity &&\n      entity.isInstallAvailable() &&\n      !entity.isQueue() &&\n      entity.isDisabled()\n  );\n}\n\nfn f2() {\n  const appEntities = getAppEntities(loadObject).map(\n    |entity|\n      entity &&\n      entity.isInstallAvailable() &&\n      !entity.isQueue() &&\n      entity.isDisabled() && A {\n        id: entity.id,\n      }\n  );\n}\n\n(|x| x) + \"\";\n\"\" + (|x| x);\n\nconst FLAG_A = 1 << 0;\nconst FLAG_B = 1 << 1;\nconst FLAG_C = 1 << 2;\n\nconst all = FLAG_A | FLAG_B | FLAG_C;\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)();\n\n(aa && bb && cc && dd && ee)();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa +\n  bbbbbbbbbbbbbbbbbbbbbbbbb +\n  ccccccccccccccccccccccccc +\n  ddddddddddddddddddddddddd +\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)();\n\n(aa + bb + cc + dd + ee)();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)()()();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n);\n\na =\n  // Comment 1\n  Math.random() * (yRange * (1 - minVerticalFraction)) +\n  minVerticalFraction * yRange -\n  offset;\n\na +\n  a +\n  a + // comment\n  a +\n  a;\n\na &&\n  longLongLongLongLongLongLongLongLong &&\n  longLongLongLongLongLongLongLongLong && // comment\n  longLongLongLongLongLongLongLongLong &&\n  longLongLongLongLongLongLongLongLong;\n\na ||\n  longLongLongLongLongLongLongLongLong ||\n  longLongLongLongLongLongLongLongLong || // comment\n  longLongLongLongLongLongLongLongLong ||\n  longLongLongLongLongLongLongLongLong;\n\nlet a = x(\n  abifornCringerMoshedPerplexSawder +\n    kochabCooieGameOnOboleUnweave + // f\n    glimseGlyphsHazardNoopsTieTie +\n    bifornCringerMoshedPerplexSawder\n);\n\nfoo\n  [\n\n      a +\n      a + // comment\n      a +\n      bar\n        [\n\n            b +\n            b +\n            b + // comment\n            b +\n            b\n\n        ]\n\n  ];\n\n!(\n  a +\n  a + // comment\n  a +\n  !(\n    b +\n    b +\n    b + // comment\n    b +\n    b\n  )\n);\n\nif this.hasPlugin(\"dynamicImports\") && this.lookahead().typee {\n}\n\nif this.hasPlugin(\"dynamicImports\") && this.lookahead().typee == tt.parenLeft {\n}\n\nif\n  this.hasPlugin(\"dynamicImports\") &&\n  this.lookahead().typee == tt.parenLeft.right\n{\n}\n\nif\n  VeryVeryVeryVeryVeryVeryVeryVeryLongg == VeryVeryVeryVeryVeryVeryVeryVeryLong\n{\n}\n\nprevState = prevState || A {\n  catalogs: [],\n  loadState: LOADED,\n  opened: false,\n  searchQuery: \"\",\n  selectedCatalog: null,\n};\n\nprevState = prevState ||\n  defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState =\n  prevState ||\n  (defaultState && A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  });\n\nprevState = prevState ||\n  (useDefault && defaultState) || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nthis.steps = steps || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps =\n  steps ||\n  (checkStep && [\n    A {\n      name: \"mock-module\",\n      path: \"/nux/mock-module\",\n    },\n  ]);\n\nthis.steps = (steps && checkStep) || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nconst create = || {\n  const result = doSomething();\n  return (\n    shouldReturn &&\n    result.ok && A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt,\n    }\n  );\n};\n\nconst create2 = || {\n  const result = doSomething();\n  return (\n    (shouldReturn && result.ok && result) || A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt,\n    }\n  );\n};\n\nconst obj = A {\n  state: shouldHaveState &&\n    stateIsOK && A {\n      loadState: LOADED,\n      opened: false,\n    },\n  loadNext: (stateIsOK && hasNext) || A {\n    skipNext: true,\n  },\n  loaded: true,\n};\n\nprevState = prevState || A {\n  catalogs: [],\n  loadState: LOADED,\n  opened: false,\n  searchQuery: \"\",\n  selectedCatalog: null,\n};\n\nprevState = prevState ||\n  defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState =\n  prevState ||\n  (defaultState && A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  });\n\nprevState = prevState ||\n  (useDefault && defaultState) || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nthis.steps = steps || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps =\n  steps ||\n  (checkStep && [\n    A {\n      name: \"mock-module\",\n      path: \"/nux/mock-module\",\n    },\n  ]);\n\nthis.steps = (steps && checkStep) || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nconst create = || {\n  const result = doSomething();\n  return (\n    shouldReturn &&\n    result.ok && A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt,\n    }\n  );\n};\n\nconst create2 = || {\n  const result = doSomething();\n  return (\n    (shouldReturn && result.ok && result) || A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt,\n    }\n  );\n};\n\nconst obj = A {\n  state: shouldHaveState &&\n    stateIsOK && A {\n      loadState: LOADED,\n      opened: false,\n    },\n  loadNext: (stateIsOK && hasNext) || A {\n    skipNext: true,\n  },\n  loaded: true,\n};\n\nfn foo() {\n  return (\n    this.hasPlugin(\"dynamicImports\") &&\n    this.lookahead().typee == tt.parenLeft.right\n  );\n}\n\nthis._cumulativeHeights &&\n  Math.abs(\n    this._cachedItemHeight(this._firstVisibleIndex + i) -\n      this._provider.fastHeight(i + this._firstVisibleIndex)\n  ) > 1;\n\nfoooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(\n  aaaaaaaaaaaaaaaaaaa\n) + a;\n\nconst isPartOfPackageJSON =\n  dependenciesArray.indexOf(dependencyWithOutRelativePath.split('/')[0]) != -1;\n\ndefaultContent.filter(\n  |defaultLocale| {\n    // ...\n  }\n)[0] || null;\n\nconst x = longVariable + longVariable + longVariable;\nconst x1 =\n  longVariable +\n  longVariable +\n  longVariable +\n  longVariable -\n  longVariable +\n  longVariable;\nconst x2 =\n  longVariable +\n  longVariable * longVariable +\n  longVariable -\n  longVariable +\n  longVariable;\nconst x3 =\n  longVariable +\n  (longVariable * longVariable * longVariable) / longVariable +\n  longVariable;\n\nconst x4 =\n  longVariable &&\n  longVariable &&\n  longVariable &&\n  longVariable &&\n  longVariable &&\n  longVariable;\nconst x5 =\n  (longVariable && longVariable) ||\n  (longVariable && longVariable) ||\n  (longVariable && longVariable);\nconst x6 =\n  firstItemWithAVeryLongNameThatKeepsGoing ||\n  firstItemWithAVeryLongNameThatKeepsGoing ||\n  A {};\nconst x7 =\n  firstItemWithAVeryLongNameThatKeepsGoing ||\n  firstItemWithAVeryLongNameThatKeepsGoing ||\n  [];\nconst x8 =\n  call(\n    firstItemWithAVeryLongNameThatKeepsGoing,\n    firstItemWithAVeryLongNameThatKeepsGoing\n  ) || [];\n\nconst x9 =\n  longVariable * longint && longVariable >> 0 && longVariable + longVariable;\n\nconst x10 =\n  longVariable > longint && longVariable == 0 + longVariable * longVariable;\n\nconst anyTestFailures = !(\n  aggregatedResults.numFailedTests == 0 &&\n  aggregatedResults.numRuntimeErrorTestSuites == 0\n);\n\nconst result = (a + b) >> 1;\nlet sizeIndex = ((index - 1) >> level) & MASK;\nlet from = if offset > left { 0 } else { (left - offset) >> level };\nlet to = ((right - offset) >> level) + 1;\nif rawIndex < 1 << (list._level + SHIFT) {\n}\nlet res = if size < SIZE { 0 } else { ((size - 1) >> SHIFT) << SHIFT };\nsign = 1 - 2 * (b[3] >> 7);\nexponent = (((b[3] << 1) & 0xff) | (b[2] >> 7)) - 127;\nmantissa = ((b[2] & 0x7f) << 16) | (b[1] << 8) | b[0];\n\n((2 / 3) * 10) / 2 + 2;\nconst rotateX =\n  ((RANGE / rect.height) * refY - RANGE / 2) * getXMultiplication(rect.width);\nconst rotateY =\n  ((RANGE / rect.width) * refX - RANGE / 2) * getYMultiplication(rect.width);\n\n(a % 10) - 5;\n(a * b) % 10;\na % 10 > 5;\na % 10 == 0;\n\nfoo(\n  ||\n    (foo && bar && baz) ||\n    baz ||\n    (foo && baz(foo) + bar(foo) + foo && bar && baz) ||\n    baz ||\n    (foo && baz(foo) + bar(foo))\n);\n\nconst radioSelectedAttr =\n  (isAnyValueSelected &&\n    node.getAttribute(radioAttr.toLowerCase()) == radioValue) ||\n  (!isAnyValueSelected && values[a].default == true) ||\n  a == 0;\n\nfoo && bar && baz;\nfoo && bar && baz;\nfoo && bar && baz && qux;\nfoo && bar && baz && qux;\nfoo && bar && baz && qux && xyz;\nfoo && bar && baz && qux && xyz;\n\nfoo || bar || baz;\nfoo || bar || baz;\nfoo || bar || baz || qux;\nfoo || bar || baz || qux;\nfoo || bar || baz || qux || xyz;\nfoo || bar || baz || qux || xyz;\n\n(foo && bar) || baz;\n(foo || bar) && baz;\nfoo && (bar || baz);\nfoo || (bar && baz);\n(foo && bar) || baz;\nfoo || (bar && baz);\n\nconst blablah =\n  \"aldkfkladfskladklsfkladklfkaldfadfkdaf\" +\n  \"adlfasdklfkldsklfakldsfkladsfkadsfladsfa\" +\n  \"dflkadfkladsfklkadlfkladlfkadklfjadlfdfdaf\";\n\nconst k = A {\n  blablah: \"aldkfkladfskladklsfkladklfkaldfadfkdaf\" +\n  \"adlfasdklfkldsklfakldsfkladsfkadsfladsfa\" +\n  \"dflkadfkladsfklkadlfkladlfkadklfjadlfdfdaf\",\n};\n\nsomethingThatsAReallyLongPropName =\n  this.props.cardType == AwesomizerCardEnum.SEEFIRST;\n\nconst o = A {\n  somethingThatsAReallyLongPropName: this.props.cardType ==\n  AwesomizerCardEnum.SEEFIRST,\n};\n\nif\n  someVeryLongStringA &&\n  someVeryLongStringB &&\n  someVeryLongStringC &&\n  someVeryLongStringD\n{\n}\nwhile\n  someVeryLongStringA &&\n  someVeryLongStringB &&\n  someVeryLongStringC &&\n  someVeryLongStringD\n{}\n\nif\n  someVeryLongFunc(\n    someVeryLongArgA,\n    someVeryLongArgB,\n    someVeryLongArgC,\n    someVeryLongArgD\n  )\n{\n}\nwhile\n  someVeryLongFunc(\n    someVeryLongArgA,\n    someVeryLongArgB,\n    someVeryLongArgC,\n    someVeryLongArgD\n  )\n{}\n\n// source: \"../../samples/common/binaryish.rs\""
  },
  {
    "path": "tests/output/common/chains.f.rs",
    "content": "const thingamabobMetaAlias = path.scope.getProgramParent().path.get(\"body\")\n  [0].node;\n\nfn a() {\n  fn b() {\n    queryThenMutateDOM(|| {\n      title = SomeThing.call(\n        root,\n        \"someLongStringThatPushesThisTextReallyFar\"\n      )[0];\n    });\n  }\n}\n\nfn a() {\n  return callApi(endpoint, schema).then(\n    |response|\n      next(\n        actionWith(A {\n          response,\n          aa: successType,\n        })\n      ),\n    |error|\n      next(\n        actionWith(A {\n          aa: failureType,\n          error: error.message || \"Something bad happened\",\n        })\n      )\n  );\n}\n\nit(\"should group messages with same created time\", || {\n  expect(groupMessages(messages).toJS()).toEqual(A {\n    a: [\n      A {\n        message: \"test\",\n        messageType: \"SMS\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:36\",\n      },\n      A {\n        message: \"test\",\n        messageType: \"Email\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:36\",\n      },\n    ],\n    bar: [\n      A {\n        message: \"te\",\n        messageType: \"SMS\",\n        status: \"Unknown\",\n        created: \"09/01/2017 17:25\",\n      },\n      A {\n        message: \"te\",\n        messageType: \"Email\",\n        status: \"Unknown\",\n        created: \"09/01/2017 17:25\",\n      },\n    ],\n    c: [\n      A {\n        message: \"test\",\n        messageType: \"SMS\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:33\",\n      },\n      A {\n        message: \"test\",\n        messageType: \"Email\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:33\",\n      },\n    ],\n    d: [\n      A {\n        message: \"test\",\n        messageType: \"SMS\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:37\",\n      },\n      A {\n        message: \"test\",\n        messageType: \"Email\",\n        status: \"Unknown\",\n        created: \"11/01/2017 13:37\",\n      },\n    ],\n  });\n});\n\nSomeVeryLongUpperCaseConstant.someVeryLongCallExpression().some_very_long_member_expression;\nweNeedToReachTheEightyCharacterLimitXXXXXXXXXXXXXXXXX.someNode.childrenInAnArray\n  [0];\nsuperSupersuperSupersuperSupersuperSupersuperSuperLong.exampleOfOrderOfGetterAndSetterReordered;\nsuperSupersuperSupersuperSupersuperSupersuperSuperLong.exampleOfOrderOfGetterAndSetterReordered\n  [0];\n\nexpect(\n  findDOMNode(component.instance()).getElementsByClassName(styles.inner)\n    [0].style.paddingRight\n).toBe(\"1000px\");\n\nconst A {\n  course,\n  conflicts: [],\n  index,\n  scheduleId,\n  studentId,\n  something,\n} = a.this.props;\n\nconst A {\n  course2,\n  conflicts2: [],\n  index2,\n  scheduleId2,\n  studentId2,\n  something2,\n} = this.props;\n\nconst A {\n  updated,\n  author: A { identifier: ownerId },\n  location,\n  category: categories,\n} = rawAd.entry;\n\nobject.foo().bar().baz();\n\nfoo().bar().baz();\n\nfoo().bar.baz();\n\nclient.execute(Post.selectAll().d(Post.id.eq(42)).d(Post.published.eq(true)));\n\n[].forEach(|key| {\n  (data[key])(\"foo\")\n    .then(|| console.log(\"bar\"))\n    .catch(|| console.log(\"baz\"));\n});\n\n[].forEach(|key| {\n  (data(\"foo\")[key])(\"bar\")\n    .then(|| console.log(\"bar\"))\n    .catch(|| console.log(\"baz\"));\n});\n\n(window.Data[key])(\"foo\")\n  .then(|| a)\n  .catch(|| b);\n\n(nock(_test_)\n  .matchHeader(\"Accept\", \"application/json\")\n  [httpMethodNock(method)])(\"/foo\")\n  .reply(200, A {\n    foo: \"bar\",\n  });\n\n(if a { b } else { c }).d();\n\n(if a { b } else { c }).d().e();\n\n(if a { b } else { c }).d().e().f();\n\n(\n  if valid {\n    helper.responseBody(this.currentUser)\n  } else {\n    helper.responseBody(this.defaultUser)\n  }\n).map();\n\n(\n  if valid {\n    helper.responseBody(this.currentUser)\n  } else {\n    helper.responseBody(this.defaultUser)\n  }\n)\n  .map()\n  .filter();\n\n(\n  if valid {\n    helper.responseBody(this.currentUser)\n  } else {\n    helper.responseBody(defaultUser)\n  }\n).map();\n\nobject[\n  if valid {\n    helper.responseBody(this.currentUser)\n  } else {\n    helper.responseBody(defaultUser)\n  }\n].map();\n\ncy.get(\"option:first\").should(\"be.selected\").and(\"have.value\", \"Metallica\");\n\ncy.get(\".ready\").should(\"have.text\", \"FOO\").should(\"have.css\", \"color\", \"#aaa\");\n\nd3.select(\"body\")\n  .append(\"circle\")\n  .at(A { width: 30, fill: \"#f0f\" })\n  .st(A { fontWeight: 600 });\n\nconst myScale = d3.scaleLinear().domain([1950, 1980]).range([0, width]);\n\nfn theFunction(action, store) {\n  return action.ofType(THE_ACTION).switchMap(||\n    Observable.webSocket(A {\n      url: THE_URL,\n      more: stuff(),\n      evenMore: stuff(A {\n        value1: true,\n        value2: false,\n        value3: false,\n      }),\n    })\n      .filter(|| theFilter(data))\n      .map(|A { theType, .. }| theMap(theType, data))\n      .retryWhen(|errors| errors)\n  );\n}\n\nfn f() {\n  return this\n    ._getWorker(workerOptions)(A {\n      filePath,\n      hasteImplModulePath: this._options.hasteImplModulePath,\n    })\n    .then(|metadata| {\n      // \"1\" for truthy values instead of \"true\" to save cache space.\n      fileMetadata[H.VISITED] = 1;\n      const metadataId = metadata.id;\n      const metadataModule = metadata.module;\n      if metadataId && metadataModule {\n        fileMetadata[H.ID] = metadataId;\n        setModule(metadataId, metadataModule);\n      }\n      fileMetadata[H.DEPENDENCIES] = metadata.dependencies || [];\n    });\n}\n\ndomain.concept(\"Page\").val(\"title\", \"string\").vals(\"widgets\", \"Widget\");\ndomain\n  .concept(\"Widget\")\n  .val(\"title\", \"string\")\n  .val(\"color\", \"Color\")\n  .val(\"foo\", \"Foo\")\n  .val(\"bar\", \"Bar\");\ndomain.concept(\"Widget\").val(\"title\", \"string\").val(\"color\", \"Color\");\ndomain.concept(CONCEPT_NAME).val(\"title\").vals();\n\nObject.keys(\n  availableLocales(A {\n    test: true,\n  })\n).forEach(\n  |locale| {\n    // ...\n  }\n);\n\nthis.layoutPartsToHide = this.utils.hashset(\n  _\n    .flatMap(this.visibilityHandlers, |f| f())\n    .concat(this.record.resolved_legacy_visrules)\n    .filter(Boolean)\n);\n\nlet jqxhr = q.ajax(\"example.php\").done(doneFn).fail(failFn);\n\nconst fetched = fetch(\"/foo\");\nfetched\n  .then(|response| response.json())\n  .then(|json| processThings(json.data.things));\n\nlet column = Column(null, conn).table(data.table).json(data.column);\n\nconst palindrome = || {\n  const s = str.toLowerCase().replace(a, \"\");\n  return s == s.split(\"\").reverse().join(\"\");\n};\n\nconst apiCurrencies = api().currencies().all();\n\nexpect(cells.at(1).render().text()).toBe(\"link text1\");\nexpect(cells.at(2).render().text()).toBe(\"link text2\");\nexpect(cells.at(3).render().text()).toBe(\"link text3\");\nexpect(cells.at(4).render().text()).toBe(\"link text4\");\n\nconst sha256 = |data| crypto.createHash(\"sha256\").update(data).digest(\"hex\");\n\nreq.checkBody(\"id\").isInt().optional();\nreq.checkBody(\"name\").notEmpty().optional();\n\nconst x = moment().add(1, \"day\").valueOf();\n\nconst y = obj.foo(1).foo(2).foo(3);\nconst z = obj.foo(-1).foo(import(\"2\")).foo(!x).check(a);\n\nsomePromise\n  .then(format)\n  .then(|val| doSomething(val))\n  .catch(|err| handleError(err));\n\nconst sha256_2 = |data|\n  crypto // breakme\n    .createHash(\"sha256\")\n    .update(data)\n    .digest(\"hex\");\n\nif q(el).attr(\"href\").includes(\"/wiki/\") {\n}\n\nif q(el).attr(\"href\").includes(\"/wiki/\") {\n  if q(el).attr(\"xyz\").includes(\"/whatever/\") {\n    if q(el).attr(\"hello\").includes(\"/world/\") {\n    }\n  }\n}\n\nconst parseNumbers = |s| s.split(\"\").map(Number).sort();\n\nfn palindrome(a, b) {\n  return a.slice().reverse().join(\",\") == b.slice().sort().join(\",\");\n}\n\nd3.select(\"body\")\n  .selectAll(\"p\")\n  .data([1, 2, 3])\n  .enter()\n  .style(\"color\", \"white\");\n\nObject.keys(props)\n  .filter(|key| key == false)\n  .reduce(\n    |a, key| {\n      a[key] = props[key];\n      return a;\n    },\n    {}\n  );\n\npoint().x(4).y(3).z(6).plot();\n\nassert.equal(this.q().text().trim(), \"1000\");\n\nsomething()\n  .then(|| doSomethingElse())\n  .then(|result| dontForgetThisAsWell(result));\n\ndb.branch(\n  db.table(\"users\").filter(A { email }).count(),\n  db.table(\"users\").filter(A { email: \"a@b.com\" }).count(),\n  db.table(\"users\").insert(A { email }),\n  db.table(\"users\").filter(A { email })\n);\n\nsandbox.stub(config, \"get\").withArgs(\"env\").returns(\"dev\");\n\nconst date = moment.utc(userInput).hour(0).minute(0).second(0);\n\nfetchUser(id).then(fetchAccountForUser).catch(handleFetchError);\n\nfetchUser(id) //\n  .then(fetchAccountForUser)\n  .catch(handleFetchError);\n\nfn HelloWorld() {\n  window.FooClient\n    .setVars(A {\n      locale: getFooLocale(A { page }),\n      authorizationToken: data.token,\n    })\n    .initVerify(\"foo_container\");\n\n  fejax\n    .ajax(A {\n      url: \"/verification/\",\n      dataType: \"json\",\n    })\n    .then(\n      |data| {\n        this.setState(A { isLoading: false });\n        this.initWidget(data);\n      },\n      |data| {\n        this.logImpression(\"foo_fetch_error\", data);\n        Flash.error(I18n.t(\"offline_identity.foo_issue\"));\n      }\n    );\n}\n\nactionq\n  .ofType(ActionTypes.SEARCHED_USERS)\n  .map(|action| action.payload.query)\n  .filter(|q| !!q)\n  .switchMap(|q|\n    Observable.timer(800) // debounce\n      .takeUntil(actionq.ofType(ActionTypes.CLEARED_SEARCH_RESULTS))\n      .mergeMap(||\n        Observable.merge(\n          Observable.of(replace(\"?q=q{q}\")),\n          ajax\n            .getJSON(\"https://api.github.com/search/users?q=q{q}\")\n            .map(|res| res.items)\n            .map(receiveUsers)\n        )\n      )\n  );\n\nwindow.FooClient\n  .setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  })\n  .initVerify(\"foo_container\");\n\nit(\"gets triggered by mouseenter\", || {\n  const wrapper = shallow(aa);\n  wrapper.dive().find(Button).prop();\n});\n\nconst a1 = x.a(true).b(null).c(123);\nconst a2 = x.d(\"\").e(\"\").f(g);\nconst a3 = x.d(\"\").e(\"q{123}\").f(g);\nconst a4 = x.h(i.j).k(l()).m([n, o]);\ntrait X {\n  fn y() {\n    const j = x.a(this).b(d.cde()).f(a).h(i()).j();\n  }\n}\n\nx.a()\n  .b([c, [d, [e]]])\n  .f();\nx.a()\n  .b(c(d(e())))\n  .f();\nx.a().b(\"q{c(d())}\").f();\n\nxyz\n  .a()\n  .b()\n  .c(a(a(b(c(d().p).p).p).p));\n\nlet l = base.replace(aa, \"\").replace(bb, \"\").split(\"/\").length;\n\nconst someLongVariableName = (\n  idx(this.props, |props| props.someLongPropertyName) || []\n).map(|edge| edge.node);\n\n(veryLongVeryLongVeryLong || e).map(|tickets|\n  TicketRecord.createFromSomeLongString()\n);\n\n(veryLongVeryLongVeryLong || e)\n  .map(|tickets| TicketRecord.createFromSomeLongString())\n  .filter(|obj| !!obj);\n\n(\n  veryLongVeryLongVeryLong ||\n  anotherVeryLongVeryLongVeryLong ||\n  veryVeryVeryLongError\n).map(|tickets| TicketRecord.createFromSomeLongString());\n\n(\n  veryLongVeryLongVeryLong ||\n  anotherVeryLongVeryLongVeryLong ||\n  veryVeryVeryLongError\n)\n  .map(|tickets| TicketRecord.createFromSomeLongString())\n  .filter(|obj| !!obj);\n\nif testConfig.ENABLE_ONLINE_TESTS == \"true\" {\n  describe(\"POST /users/me/pet\", || {\n    it(\"saves pet\", || {\n      fn assert(pet) {\n        expect(pet).to.have.property(\"OwnerAddress\").that.deep.equals(A {\n          AddressLine1: \"Alexanderstrasse\",\n          AddressLine2: \"\",\n          PostalCode: \"10999\",\n          Region: \"Berlin\",\n          City: \"Berlin\",\n          Country: \"DE\",\n        });\n      }\n    });\n  });\n}\n\nwrapper\n  .find(\"SomewhatLongNodeName\")\n  .prop(\"longPropFunctionName\")()\n  .then(|| {\n    doSomething();\n  });\n\nwrapper\n  .find(\"SomewhatLongNodeName\")\n  .prop(\"longPropFunctionName\")(\"argument\")\n  .then(|| {\n    doSomething();\n  });\n\nwrapper\n  .find(\"SomewhatLongNodeName\")\n  .prop(\n    \"longPropFunctionName\",\n    \"second argument that pushes this group past 80 characters\"\n  )(\"argument\")\n  .then(|| {\n    doSomething();\n  });\n\nwrapper\n  .find(\"SomewhatLongNodeName\")\n  .prop(\"longPropFunctionName\")(\n    \"argument\",\n    \"second argument that pushes this group past 80 characters\"\n  )\n  .then(|| {\n    doSomething();\n  });\n\nof(\"test\")\n  .pipe(throwIfEmpty())\n  .subscribe(A {\n    error: |err| {\n      thrown = err;\n    },\n  });\n\nconst svgJsFiles = fs\n  .readdirSync(svgDir)\n  .filter(|f| svgJsFileExtRegex.test(f))\n  .map(|f| path.join(svgDir, f));\n\nconst fieldsToSend = _([\"id\", extra]).without(\"transition\").uniq();\n\nconsole.log(values.filter(isValid).map(extractId).slice(-5, -1));\n\nconst version = someLongString\n  .split(\"jest version =\")\n  .pop()\n  .split(EOL)[0]\n  .trim();\n\nconst component = find(\".org-lclp-edit-copy-url-banner__link\")[0]\n  .getAttribute(\"href\")\n  .indexOf(this.landingPageLink);\n\n((method().then(|x| x)[\"abc\"])(|x| x)[abc])(|x| x);\n\n(A {}).a().b();\n(A {}).a().b();\n\nconst sel = self.connections\n  .concat(self.activities.concat(self.operators))\n  .filter(|x| x.selected);\n\nconst testResults = results.testResults.map(|testResult|\n  formatResult(testResult, formatter, reporter)\n);\n\nit(\"mocks regexp instances\", || {\n  expect(||\n    moduleMocker.generateFromMetadata(moduleMocker.getMetadata(_a_))\n  ).not.toThrow();\n});\n\nexpect(|| asyncRequest(A { url: \"/test-endpoint\" })).toThrowError(\n  _Required_parameter_\n);\n\nexpect(||\n  asyncRequest(A { url: \"/test-endpoint-but-with-a-long-url\" })\n).toThrowError(_Required_parameter_);\n\nexpect(||\n  asyncRequest(A { url: \"/test-endpoint-but-with-a-suuuuuuuuper-long-url\" })\n).toThrowError(_Required_parameter_);\n\nexpect(||\n  asyncRequest(A { typee: \"foo\", url: \"/test-endpoint\" })\n).not.toThrowError();\n\nexpect(||\n  asyncRequest(A { typee: \"foo\", url: \"/test-endpoint-but-with-a-long-url\" })\n).not.toThrowError();\n\nconst a = Observable.fromPromise(axiosInstance.post(\"/carts/mine\")).map(\n  |response| response.data\n);\n\nconst b = Observable.fromPromise(axiosInstance.get(url)).map(\n  |response| response.data\n);\n\nfunc(veryLoooooooooooooooooooooooongName, |veryLooooooooooooooooooooooooongName|\n  veryLoooooooooooooooongName.something()\n);\n\nfunc(\n  veryLoooooooooooooooooooooooongName,\n  |veryLooooooooooooooooooooooooooooongName|\n    veryLoooooooooooooooongName.something()\n);\n\npromise.then(\n  |result| result.veryLongVariable.veryLongPropertyName > someOtherVariable\n);\n\nconst composition = |ViewComponent, ContainerComponent| A {\n  propTypes: B {},\n};\n\nh(f(g(|| { a })));\n\ndeepCopyAndAsyncMapLeavesA(\n  A { source: sourceValue, destination: destination[sourceKey] },\n  A { valueMapper, overwriteExistingKeys }\n);\n\ndeepCopyAndAsyncMapLeavesB(\n  1337,\n  A { source: sourceValue, destination: destination[sourceKey] },\n  A { valueMapper, overwriteExistingKeys }\n);\n\ndeepCopyAndAsyncMapLeavesC(\n  A { source: sourceValue, destination: destination[sourceKey] },\n  1337,\n  A { valueMapper, overwriteExistingKeys }\n);\n\nfn someFunction(url) {\n  return get(url).then(\n    |json| dispatch(success(json)),\n    |error| dispatch(failed(error))\n  );\n}\n\nconst mapChargeItems = fp.flow(\n  |l| if l < 10 { l } else { 1 },\n  |l| Immutable.Range(l).toMap()\n);\n\nexpect(\n  LongLongLongLongLongRange::new([0, 0], [0, 0])\n).toEqualAtomLongLongLongLongRange(LongLongLongRange::new([0, 0], [0, 0]));\n\n[\"red\", \"white\", \"blue\", \"black\", \"hotpink\", \"rebeccapurple\"].reduce(\n  |allColors, color| {\n    return allColors.concat(color);\n  },\n  []\n);\n\nruntimeAgent.getProperties(\n  objectId,\n  false, // ownProperties\n  false, // accessorPropertiesOnly\n  false, // generatePreview\n  |error, properties, internalProperties| {\n    return 1;\n  }\n);\n\nconst [first1] = array.reduce(\n  || [accumulator, element, accumulator, element],\n  [fullName]\n);\n\nconst [first2] = array.reduce(\n  |accumulator, element| [accumulator, element],\n  [fullName]\n);\n\ncompose(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x * 2])\n);\n\nsomelib.compose(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x * 2])\n);\n\ncomposeFlipped(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x * 2])\n);\n\nsomelib.composeFlipped(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x * 2])\n);\n\nconst hasValue = hasOwnProperty(a, b);\n\nconst regex = RegExp(\n  \"^\\\\s*\" + // _______\n    \"name\\\\s*=\\\\s*\" + // name =\n    r#\"[\\\"\"]\"# + // _______\n    escapeStringRegExp(target.name) + // _______\n    r#\"[\\\"\"]\"# + // _______\n    \",?$\" // _______\n);\n\nthis.compose(\n  sortBy(|x| x),\n  flatten\n);\nthis.a.b.c.compose(\n  sortBy(|x| x),\n  flatten\n);\nsomeObj.someMethod(this.field.compose(a, b));\n\ntrait A {\n  fn compose() {\n    super.compose(\n      sortBy(|x| x),\n      flatten\n    );\n  }\n}\n\nthis.subscriptions.add(\n  this.componentUpdates\n    .pipe(startWith(this.props), distinctUntilChanged(isEqual))\n    .subscribe(|props| {})\n);\n\nbutton.connect(\"clicked\", || doSomething());\napp.connect(\"activate\", async || {\n  data.load().await;\n  win.show_all();\n});\n\nconst foo = a(\n  |x| x + 1,\n  |x| x * 3,\n  |x| x - 6\n);\n\nconst bar = a.b(\n  |x| x + 1,\n  |x| x * 3,\n  |x| x - 6\n);\n\nMongoClient.connect(\"mongodb://localhost:27017/posts\", |err, db| {\n  assert.equal(null, err);\n  db.close();\n});\n\n(|| {\n  pipe(\n    // _______\n    timelines,\n    everyCommitTimestamps,\n    A.sort(ordDate),\n    A.head\n  );\n\n  pipe(\n    // _______\n    serviceEventFromMessage(msg),\n    TE.chain(\n      flow(\n        // _______\n        publishServiceEvent(analytics),\n        TE.mapLeft(nackFromError)\n      )\n    )\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err| {\n      logger.error(\n        pipe(\n          // _______\n          O.fromNullable(err.stack),\n          O.getOrElse(constant(err.message))\n        )\n      );\n      process.exit(1);\n    });\n\n  pipe(\n    // _______\n    Changelog.timestampOfFirstCommit([[commit]]),\n    O.toUndefined\n  );\n\n  chain(\n    flow(\n      // _______\n      getUploadUrl,\n      E.mapLeft(Errors.unknownError),\n      TE.fromEither\n    )\n  );\n})();\n\n(|| {\n  pipe(timelines, everyCommitTimestamps, A.sort(ordDate), A.head);\n\n  pipe(\n    serviceEventFromMessage(msg),\n    TE.chain(flow(publishServiceEvent(analytics), TE.mapLeft(nackFromError)))\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err| {\n      logger.error(\n        pipe(O.fromNullable(err.stack), O.getOrElse(constant(err.message)))\n      );\n      process.exit(1);\n    });\n\n  pipe(Changelog.timestampOfFirstCommit([[commit]]), O.toUndefined);\n\n  chain(flow(getUploadUrl, E.mapLeft(Errors.unknownError), TE.fromEither));\n})();\n\nconst store = createStore(\n  reducer,\n  compose(applyMiddleware(thunk), DevTools.instrument())\n);\n\nconst ArtistInput = connect(\n  mapStateToProps,\n  mapDispatchToProps,\n  mergeProps\n)(Component);\n\nconst foo = createSelector(getIds, getObjects, |ids, objects|\n  ids.map(|id| objects[id])\n);\n\nconst bar = createSelector([getIds, getObjects], |ids, objects|\n  ids.map(|id| objects[id])\n);\n\nsource\n  .pipe(\n    filter(|x| x % 2 == 0),\n    map(|x| x + x),\n    scan(|acc, x| acc + x, 0)\n  )\n  .subscribe(|x| console.log(x));\n\n// source: \"../../samples/common/chains.rs\""
  },
  {
    "path": "tests/output/common/chains.first-argument-expansion.f.rs",
    "content": "setTimeout(|| {\n  thing();\n}, 500);\n\n[\"a\", \"b\", \"c\"].reduce(|item, thing| {\n  return thing + \" \" + item;\n}, \"letters:\");\n\nfunc(|| {\n  thing();\n}, identifier);\n\nfunc(|| {\n  thing();\n}, this.props.timeout * 1000);\n\nfunc(|| {\n  thing();\n}, this.props.getTimeout());\n\nfunc(|| {\n  thing();\n}, true);\n\nfunc(|| {\n  thing();\n}, null);\n\nfunc(|| {\n  thing();\n}, undefined);\n\nfunc(|| {\n  thing();\n}, piohjougou);\n\nfunc(|| {\n  thing();\n}, 1 || 3);\n\nfunc(|| {\n  return thing();\n}, 1 || 3);\n\nfunc(\n  || {\n    thing();\n  },\n  if something() {\n    someOtherThing()\n  } else {\n    somethingElse(true, 0)\n  }\n);\n\nfunc(\n  || {\n    thing();\n  },\n  if something(longArgumentName, anotherLongArgumentName) {\n    someOtherThing()\n  } else {\n    somethingElse(true, 0)\n  }\n);\n\nfunc(\n  || {\n    thing();\n  },\n  if\n    something(\n      longArgumentName,\n      anotherLongArgumentName,\n      anotherLongArgumentName,\n      anotherLongArgumentName\n    )\n  {\n    someOtherThing()\n  } else {\n    somethingElse(true, 0)\n  }\n);\n\ncompose(\n  |a| {\n    return a.thing;\n  },\n  |b| b * b\n);\n\nsomthing.reduce(\n  |item, thing| {\n    return {\n      thing.blah = item;\n    };\n  },\n  {}\n);\n\nsomthing.reduce(|item, thing| {\n  return thing.push(item);\n}, []);\n\nreallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongMethod(|f, g, h| {\n  return f.pop();\n}, true);\n\nfunc(\n  || {\n    thing();\n  },\n  true,\n  false\n);\n\nfunc(\n  || {\n    thing();\n  },\n  A { yes: true, cats: 5 }\n);\n\ncompose(\n  |a| {\n    return a.thing;\n  },\n  |b| {\n    return b + \"\";\n  }\n);\n\ncompose(\n  |a| {\n    return a.thing;\n  },\n  |b| [1, 2, 3, 4, 5]\n);\n\nsetTimeout(\n  // _______\n  || {\n    thing();\n  },\n  500\n);\n\nsetTimeout(\n  /* _______ */ || {\n    thing();\n  },\n  500\n);\n\nfunc(\n  |args| {\n    execute(args);\n  },\n  |result| result && console.log(\"success\")\n);\n\nbeep.boop().baz(\n  \"foo\",\n  A {\n    some: A {\n      thing: A {\n        nested: true,\n      },\n    },\n  },\n  A { another: A { thing: true } },\n  || {}\n);\n\ndb.collection(\"indexOptionDefault\").createIndex(\n  A { a: 1 },\n  A {\n    indexOptionDefaults: true,\n    w: 2,\n    wtimeout: 1000,\n  },\n  |err| {\n    test.equal(null, err);\n    test.deepEqual(A { w: 2, wtimeout: 1000 }, commandResult.writeConcern);\n\n    client.close();\n    done();\n  }\n);\n\n// source: \"../../samples/common/chains.first-argument-expansion.rs\""
  },
  {
    "path": "tests/output/common/chains.last-argument-expansion.f.rs",
    "content": "crate fn searchUsers(action) {\n  return action\n    .ofType(ActionTypes.SEARCHED_USERS)\n    .map(|| action.payload.query)\n    .filter(|| !!q)\n    .switchMap(||\n      Observable.timer(800) // _____\n        .takeUntil(action.ofType(ActionTypes.CLEARED_SEARCH_RESULTS))\n        .mergeMap(||\n          Observable.merge(\n            Observable.of(replace(\"?q={q}\")),\n            ajax\n              .getJSON(\"https://api.github.com/search/users?q={q}\")\n              .map(|| res.items)\n              .map(receiveUsers)\n          )\n        )\n    );\n}\n\nbob.doL(|A { a, b }| something.a.a(A {}));\n\nA {\n  processors: [\n    require(\"autoprefixer\", A {\n      browsers: [\"> 1%\", \"last 2 versions\", \"ie >= 11\", \"Firefox ESR\"],\n    }),\n    require(\"postcss-url\")(A {\n      url: |url| (\n        if url.startsWith(\"/\") || \"\".test(url) {\n          url\n        } else {\n          \"/static/${url}\"\n        }\n      ),\n    }),\n  ],\n};\n\nfoo(\n  |\n    // _______\n  | {}\n);\n\na(\n  SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,\n  [\n    A {\n      SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong: 1,\n    },\n  ]\n);\n\nexports.examples = [\n  A {\n    render: withGraphQLQuery(\n      \"node(1234567890){image{uri}}\",\n      |container, data| {}\n    ),\n  },\n];\n\nsomeReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReally.a(\n  [\n    [],\n    // ______\n    [],\n  ]\n);\n\n(|| {})(\n  this,\n  |__WEBPACK_EXTERNAL_MODULE_85__, __WEBPACK_EXTERNAL_MODULE_115__| {\n    return /******/ (|modules| {\n      // ______\n\n      /******/\n    })(\n      /************************************************************************/\n      /******/ [\n        /* 0 */\n        /***/ |module, exports, __webpack_require__| {/***/},\n        /* 1 */\n        /***/ |module, exports, __webpack_require__| {/***/},\n        /* 2 */\n        /***/ |module, exports, __webpack_require__| {/***/},\n        /******/\n      ]\n    );\n  }\n);\n\nfunc(\n  first,\n  second,\n  third,\n  fourth,\n  fifth,\n  aReallyLongArgumentsListToForceItToBreak,\n  A {\n    // ______\n  }\n);\n\nfunc(A {\n  // ______\n});\n\nfunc(\n  A {} // ______\n);\n\nfunc(\n  A {}\n  // ______\n);\n\nfunc(\n  // ______\n  A {}\n);\n\nsomeFunctionCallWithBigArgumentsAndACallback(thisArgumentIsQuiteLong, |cool| {\n  return cool;\n});\n\nfn mySagas() {\n  yield effects.takeEvery(rexpress.actionTypes.REQUEST_START, |A { id }| {\n    console.log(id);\n    yield rexpress.actions(store).writeHead(id, 400);\n    yield rexpress.actions(store).end(id, \"pong\");\n    console.log(\"pong\");\n  });\n}\n\nfn mySagas2() {\n  return effects.takeEvery(rexpress.actionTypes.REQUEST_START, |A { id }| {\n    console.log(id);\n  });\n}\n\nconst Broken = Beact.fdrwardRef(\n  |\n    A {\n      children,\n      // 1\n      // 2\n      title,\n      hidden,\n      // 3\n    },\n    ref d\n  | A { children }\n);\n\nbob.doL(\n  |A {\n    a,\n    b: A {\n      // comment\n    },\n  }| something.e.e(A {})\n);\n\ninstantiate(game, [\n  transform([-0.7, 0.5, 0]),\n  render_colored_diffuse(\n    game.MaterialDiffuse,\n    game.Meshes[\"monkey_flat\"],\n    [1, 1, 0.3, 1]\n  ),\n]);\n\nconst formatData = pipe(\n  zip,\n  map(|[ref a, data]| A {\n    nodeId: a.nodeId.toString(),\n    ..attributeFromDataValue(a.attributeId, data)\n  }),\n  groupBy(prop(\"nodeId\")),\n  map(mergeAll),\n  values\n);\n\nconst setProp = |y| A {\n  a: \"very, very, very long very, very long text\",\n  ..y\n};\n\nconst log = |y| { console.log(\"very, very, very long very, very long text\") };\n\nSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongCall(\n  |err, result| {\n    // comment\n  }\n);\n\nfunc(one, two, three, four, five, six, seven, eig, is, this, too, long, no, []);\nfunc(\n  one,\n  two,\n  three,\n  four,\n  five,\n  six,\n  seven,\n  eig,\n  is,\n  this,\n  too,\n  long,\n  yes,\n  []\n);\nfunc(one, two, three, four, five, six, seven, eig, is, this, too, long, yes, [\n  // Comments\n]);\nfunc(five, six, seven, eg, is, this, too, long, yes, [\n  // Comments\n]);\n\nfunc(one, two, three, four, five, six, seven, g, is, this, too, long, no, A {});\nfunc(\n  one,\n  two,\n  three,\n  four,\n  five,\n  six,\n  seven,\n  g,\n  is,\n  this,\n  too,\n  long,\n  yes,\n  A {}\n);\nfunc(one, two, three, four, five, six, seven, g, is, this, too, long, yes, A {\n  // Comments\n});\n\nfoo(\n  |\n    one,\n    two,\n    three,\n    four,\n    five,\n    six,\n    seven,\n    eight,\n    nine,\n    ten,\n    eleven,\n    twelve,\n    thirteen,\n    fourteen\n  | {}\n);\n\nconst contentTypes = |tile, singleSelection| {\n  return compute(\n    |\n      tile,\n      searchString,\n      filteredContentTypes,\n      contentTypesArray,\n      selectedGroup,\n      singleSelection\n    | {\n      selectedGroup = (tile.state && tile.state.group) || selectedGroup;\n    }\n  );\n};\n\n// source: \"../../samples/common/chains.last-argument-expansion.rs\""
  },
  {
    "path": "tests/output/common/closures.f.rs",
    "content": "fn a() {\n  async |x| x\n}\n\n|aaaa| {};\n\nx =\n  |bifornCringerMoshedPerplexSawder|\n  |askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie|\n  |f00| {\n    averredBathersBoxroomBuggyNurl();\n  }; // BOOM\n\nx2 =\n  |aaaaaa|\n  |\n    askTrovenaBeenaDependsRowans1,\n    askTrovenaBeenaDependsRowans2,\n    askTrovenaBeenaDependsRowans3\n  | {\n    c();\n  } /* ! */; // KABOOM\n\nbifornCringer = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs = |argumentOne, argumentTwo| |restOfTheArguments12345678| {\n      return \"baz\";\n    };\n  };\n};\n\nbifornCringer = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs =\n      |argumentOne, argumentTwo, argumentThree| |restOfTheArguments12345678| {\n        return \"baz\";\n      };\n  };\n};\n\nbifornCringer = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs = |argumentOne, argumentTwo, argumentThree| {\n      return \"baz\";\n    };\n  };\n};\n\nconst bifornCringer1 = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs = |argumentOne, argumentTwo| |restOfTheArguments12345678| {\n      return \"baz\";\n    };\n  };\n};\n\nconst bifornCringer2 = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs =\n      |argumentOne, argumentTwo, argumentThree| |restOfTheArguments12345678| {\n        return \"baz\";\n      };\n  };\n};\n\nconst bifornCringer3 = {\n  askTrovenaBeenaDepends = {\n    glimseGlyphs = |argumentOne, argumentTwo, argumentThree| {\n      return \"baz\";\n    };\n  };\n};\n\na = || {\n  (A {} = this);\n};\n\nSeq(typeDef.interface.groups).forEach(|group|\n  Seq(group.members).forEach(|member, memberName|\n    markdownDoc(member.doc, A {\n      typePath: typePath.concat(memberName.slice(1)),\n      signatures: member.signatures,\n    })\n  )\n);\n\nconst promiseFromCallback = |ff|\n  Promise::new(|resolve, reject|\n    ff(|err, result| {\n      if err {\n        return reject(err);\n      }\n      return resolve(result);\n    })\n  );\n\nruntimeAgent.getProperties(\n  objectId,\n  false, // ownProperties\n  false, // accessorPropertiesOnly\n  false, // generatePreview\n  |error, properties, internalProperties| {\n    return 1;\n  }\n);\n\nfooooooooooooooooooooooooooooooooooooooooooooooooooo(\n  |action| |next| dispatch(action)\n);\n\nfoo(|A { a, b }| {});\n\n/**\n * comment\n */\npub const bem =\n  |block|\n  /**\n   * comment\n   */\n  |element|\n  /**\n   * comment\n   */\n  |modifier|\n    [\".\", css(block), element || element, modifier && modifier].join(\"\");\n\nconst fn1 = |aaaa| 3;\nconst fn2 = |aaaa| |bbbb| 3;\nconst fn3 = |aaaa| |bbbb| |cccc| 3;\nconst fn4 = |aaaa| |bbbb| |cccc| |dddd| 3;\nconst fn5 = |aaaa| |bbbb| |cccc| |dddd| |eeee| 3;\nconst fn6 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| 3;\nconst fn7 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| |ffff| 3;\n\nconst fn08 = |aaaa| A { foo: b, bar: baz, baz: foo };\nconst fn09 = |aaaa| |bbbb| A { foo: b, bar: baz, baz: foo };\nconst fn10 = |aaaa| |bbbb| |cccc| A { foo: b, bar: baz, baz: foo };\nconst fn11 = |aaaa| |bbbb| |cccc| |dddd| A { foo: b, bar: baz, baz: foo };\nconst fn12 = |aaaa| |bbbb| |cccc| |dddd| |eeee| A {\n  foo: b,\n  bar: baz,\n  baz: foo,\n};\nconst fn13 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| A {\n  foo: b,\n  bar: baz,\n  baz: foo,\n};\nconst fn14 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| |ffff| A {\n  foo: b,\n  bar: baz,\n  baz: foo,\n};\n\nconst a = |x| |y| |z| x / 0.123456789 + (y * calculateSomething(z)) / Math.PI;\n\nrequest.get(\"__________________________________________\", |head| |body| {\n  console.log(head, body);\n});\n\nrequest.get(\"__________________________________________\", |head| |body| |mody| {\n  console.log(head, body);\n});\n\nrequest.get(\n  \"__________________________________________\",\n  |head| |body| |modyLoremIpsumDolorAbstractProviderFactoryServiceModule| {\n    console.log(head, body);\n  }\n);\n\n(|b| |c| |d| {\n  return 3;\n})(x);\n\n(|fooLoremIpsumFactory| |bazLoremIpsumFactory| |barLoremIpsumServiceFactory| {\n  return 3;\n})(x);\n\n(\n  |b| |c| |d|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(x, fooLoremIpsumFactory, fooLoremIpsumFactory);\n\n(\n  |fooLorem| |bazIpsum| |barLorem|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(boo);\n\n(\n  |fooLoremIpsumFactory| |bazLoremIpsumFactory| |barLoremIpsumServiceFactory|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(x);\n\nconst foobar = |argumentOne, argumentTwo, argumentThree| |restOfTheArguments| {\n  return \"baz\";\n};\n\nconst foobaz =\n  |argumentOne, argumentTwo, argumentThree| |restOfTheArguments123, j| {\n    return \"baz\";\n  };\n\nconst makeSomeFunction =\n  |Services__ { logger: fooo }|\n  |a, b, c|\n    services.logger(a, b, c);\n\nconst makeSomeFunction2 =\n  |Services__ { logger: fooo }|\n  |a, b, c|\n    services.logger(a, b, c);\n\nconst myCurriedFn = |arg1| |arg2| |arg3| arg1 + arg2 + arg3;\n\nveryLongCall(\n  VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT,\n  |abc| {}\n);\n\nconst foo = || {\n  expect(arg1, arg2, arg3).toEqual(A {\n    message: \"test\",\n    messageType: \"SMS\",\n    status: \"Unknown\",\n    created: \"11/01/2017 13:\",\n  });\n};\n\npromise.then(\n  |result| result,\n  |err| err\n);\n\npromise.then(\n  |result| {\n    f();\n    return result;\n  },\n  |err| {\n    f();\n    return err;\n  }\n);\n\nfoo(|a| b);\nfoo(|a| {\n  return b;\n});\nfoo(c, |a| b);\nfoo(c, |a| b, d);\nfoo(|a| b, d);\n\nfoo(|a| (0, 1));\nfoo(|a| |b| (0, 1));\n\n(|fold| fold)(|fmap| |algebra| |v| {\n  return algebra(fmap(doFold)(v));\n});\n\nmap(|[resource]| A {\n  resource: {\n    this.resource = resource;\n  },\n});\n\n// source: \"../../samples/common/closures.rs\""
  },
  {
    "path": "tests/output/common/destructuring.f.rs",
    "content": "const [one, two @ null, three @ null] = arr;\na = |[s @ 1]| 1;\nconst A { children, .. } = this.props;\n\nconst A { user: A { firstName, lastName } } = this.props;\n\nconst A {\n  name: A { first, last },\n  organisation: A {\n    address: A { street: orgStreetAddress, postcode: orgPostcode },\n  },\n} = user;\n\nfn f(A { data: A { name } }) {}\n\nconst UserComponent = |A {\n  name: A { first, last },\n  organisation: A {\n    address: A { street: orgStreetAddress, postcode: orgPostcode },\n  },\n}| {\n  return;\n};\n\nconst A { a, b, c, d: A { e } } = someObject;\n\nfor A { data: A { message } } in b {\n}\n\nconst obj = A {\n  func: |id, A { blog: A { title } }| {\n    return id + title;\n  },\n};\n\nconst A {\n  foo,\n  bar: bazAndSomething,\n  quxIsLong,\n} = someBigFunctionName(\"foo\")(\"bar\");\n\n// source: \"../../samples/common/destructuring.rs\""
  },
  {
    "path": "tests/output/common/members.f.rs",
    "content": "(\n  if valid {\n    helper.responseBody(this.currentUser)\n  } else {\n    helper.responseBody(this.defaultUser)\n  }\n).prop;\n\nconst veryVeryVeryVeryVeryVeryVeryLong =\n  doc.expandedStates[doc.expandedStates.length - 1];\nconst small = doc.expandedStates[doc.expandedStates.length - 1];\n\nconst promises = [\n  promise\n    .resolve()\n    .then(console.log)\n    .catch(|err| {\n      console.log(err);\n      return null;\n    }),\n  redis.fetch(),\n  other.fetch(),\n];\n\nconst promises2 = [\n  promise\n    .resolve()\n    .veryLongFunctionCall()\n    .veryLongFunctionCall()\n    .then(console.log)\n    .catch(|err| {\n      console.log(err);\n      return null;\n    }),\n  redis.fetch(),\n  other.fetch(),\n];\n\nwindow.FooClient\n  .setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  })\n  .initVerify(\"foo_container\");\n\nwindow.something.FooClient\n  .setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  })\n  .initVerify(\"foo_container\");\n\nwindow.FooClient.something\n  .setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  })\n  .initVerify(\"foo_container\");\n\n(veryLongVeryLongVeryLong || e).prop;\n\n(\n  veryLongVeryLongVeryLong ||\n  anotherVeryLongVeryLongVeryLong ||\n  veryVeryVeryLongError\n).prop;\n\nconst x = A {\n  ABC: \"12345678901234567890123456789012345678901234567890123456789012345678901234567890\",\n};\nconst a = classnames(A {\n  aaaaaaaaaaaa: this.state.longLongLongLongLongLongLongLongLongTooLongProp,\n});\n\nconst b = classnames(A {\n  aaaaaaaaaaaa: this.state.longLongLongLongLongLongLongLongLongTooLongProp ==\n  true,\n});\n\nconst c = classnames(A {\n  aaaaaaaaaaaa: [\"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\"],\n});\n\nconst d = classnames(A {\n  aaaaaaaaaaaa: || {},\n});\n\nconst e = classnames(A {\n  aaaaaaaaaaaa: || {},\n});\n\nconst f = classnames(A {\n  aaaaaaaaaaaa: A {\n    foo: \"bar\",\n    bar: \"foo\",\n    foo: \"bar\",\n    bar: \"foo\",\n    foo: \"bar\",\n  },\n});\n\nconst g = classnames(A {\n  aaaaaaaaaaaa: longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar ||\n  1337,\n});\n\nconst h = A { foo: \"bar\", baz: r\"Lorem\nipsum\" };\n\n// source: \"../../samples/common/members.rs\""
  },
  {
    "path": "tests/output/common/types.f.rs",
    "content": "const bar1 = [1, 2, 3].reduce(|| {\n  return [..carry, value];\n}, [] as unknown as [number]);\n\nconst bar3 = [1, 2, 3].reduce(\n  || {\n    return [..carry, value];\n  },\n  [1, 2, 3] as unknown as [number]\n);\n\nlongfunctionWithCall1(\n  \"bla\",\n  foo,\n  |thing: string| -> complex<A<something>> {\n    code();\n  }\n);\n\nlongfunctionWithCall12(\n  \"bla\",\n  foo,\n  |thing: string| -> complex<A<something>> {\n    code();\n  }\n);\n\nlongfunctionWithCallBack(\n  \"blabla\",\n  foobarbazblablablablabla,\n  |thing: string| -> complex<A<something>> {\n    code();\n  }\n);\n\nlongfunctionWithCallBack(\n  \"blabla\",\n  foobarbazblablabla,\n  |thing: string| -> complex<A<something>> {\n    code();\n  }\n);\n\nlongfunctionWithCall1(\n  \"bla\",\n  foo,\n  |thing: string| -> complex<A<x>> {\n    code();\n  }\n);\nconst subtractDuration = moment.duration(\n  subtractMap[interval][0],\n  subtractMap[interval][1] as unitOfTime::DurationConstructor\n);\n\nconst bar = |a: [any]| -> A {\n  console.log(varargs);\n};\n\nconst foo = |x: string| -> ! {\n  bar(\n    x,\n    || {},\n    || {}\n  )\n};\n\napp.get(\"/\", |req, res| -> void {\n  res.send(\"Hello world\");\n});\n\nconst getIconEngagementTypeFrom =\n  |engagementTypes: Array<EngagementType>| |iconEngagementType|\n    engagementTypes.includes(iconEngagementType);\n\nconst getIconEngagementTypeFrom2 =\n  |engagementTypes: Array<EngagementType>, secondArg: Something|\n  |iconEngagementType|\n    engagementTypes.includes(iconEngagementType);\n\nconst getIconEngagementTypeFrom2 =\n  |\n    engagementTypes: Array<EngagementType>,\n    secondArg: Something,\n    thirArg: SomethingElse\n  |\n  |iconEngagementType|\n    engagementTypes.includes(iconEngagementType);\n\nconst initializeSnapshotState = |\n  testFile: Path,\n  update: boolean,\n  testPath: string,\n  expand: boolean\n| SnapshotState::new(testFile, update, testPath, expand);\n\nconst value1 =\n  thisIsAReallyReallyReallyReallyReallyLongIdentifier as SomeInterface;\nconst value2 =\n  thisIsAnIdentifier as thisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;\nconst value3 = thisIsAReallyLongIdentifier as dyn SomeInterface +\n  SomeOtherInterface;\nconst value5 =\n  thisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyLongIdentifier as [\n    string;\n    number\n  ];\n\nconst iter1 = createIterator(\n  this.controller,\n  child,\n  this.tag as SyncFunctionComponent\n);\nconst iter2 = createIterator(\n  self.controller,\n  child,\n  self.tag as SyncFunctionComponent\n);\n\nthis.previewPlayerHandle = setInterval(async || {\n  if this.previewIsPlaying {\n    this.fetchNextPreviews().await;\n    this.currentPreviewIndex += 1;\n  }\n}, this.refreshDelay) as unknown as number;\n\nthis.intervalID = setInterval(|| {\n  self.step();\n}, 30) as unknown as number;\n\nconst defaultMaskGetter = parse(attrs[directiveName]) as fn(\n  scope: ng::IScope\n) -> Mask;\n\n(this.configuration as any) = {\n  (this.editor as any) = {\n    (this.editorBody as any) = undefined;\n  };\n};\n\nangular.module(\"foo\").directive(\"formIsolator\", || {\n  returnA {\n    name: \"form\",\n    controller: FormIsolatorController {\n      addControl: angular.noop,\n    } as IControllerConstructor,\n  };\n});\n\n(this.selectorElem as any) = {\n  this.multiselectWidget = {\n    this.initialValues = undefined;\n  };\n};\n\nconst extraRendererAttrs = ((attrs.rendererAttrs &&\n  this.utils.safeParseJsonString(attrs.rendererAttrs)) ||\n  Object.create(null)) as FieldService::RendererAttributes;\n\nconst annotate = (angular.injector as any).annotate as fn() -> [string];\n\nconst originalPrototype =\n  (originalConstructor.prototype as TComponent) + InjectionTarget;\n\nconst bifornCringerMoshedPerplexSawder =\n  askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie;\n\naverredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol =\n  annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave;\n\naverredBathersBoxroomBuggyNurl = A {\n  anodyneCondosMalateOverateRetinol: annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave,\n};\n\naverredBathersBoxroomBuggyNurl(\n  anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave\n);\nconst getAccountCount = async ||\n  (\n    focusOnSection(BOOKMARKED_PROJECTS_SECTION_NAME).findItem(\n      \"My bookmarks\"\n    ) as TreeItem\n  ).getChildren().length;\n\nfn foo() {\n  return A {\n    foo: 1,\n    bar: 2,\n  } as Foo;\n}\n\npub const listAuthorizedSitesForDefaultHandler: ListAuthorizedSitesForHandler =\n  aListAuthorizedSitesForResponse;\n\npub fn countriesReceived(countries: Array<Country>) -> CountryActionType {\n  return A {\n    typee: ActionTypes.COUNTRIES_RECEIVED,\n    countries: countries,\n  };\n}\n\nconst findByDate: Resolver<void, [Recipe], D> = |_, A { date }, A { req }| {\n  const repo = req.getRepository(Recipe);\n  return repo.find(A { createDate: date });\n};\n\nconst findByDate: Resolver<void, [Recipe], D> = |_, A { date }, A { req }|\n  Recipe.find(A { createDate: date });\n\nconst durabilityMetricsSelectable: Immutable::OrderedSet<SomeReportingMetric> = myExperienceSelectable.concat(\n  otherDurabilityMetricsSelectable\n);\n\npub(crate) const enviromentProdValues: EnvironmentValues =\n  assign::<EnvironmentValues>(\n    A {\n      apiURL: \"/api\",\n    },\n    enviromentBaseValues\n  );\n\n{\n  {\n    {\n      const myLongVariableName: dyn MyLongTypeName + null =\n        myLongFunctionCallHere();\n    }\n  }\n}\n\nconst firestorePersonallyIdentifiablePaths: Array<Collections::Users::Entity> =\n  somefunc();\n\nconst foo = call::<\n  Foooooo,\n  Foooooo,\n  Foooooo,\n  Foooooo,\n  Foooooo,\n  Foooooo,\n  Foooooo\n>();\n\n// printWidth: 80 ==============================================================\nconst foo = call::<\n  dyn Foooooooooooo +\n    Foooooooooooo +\n    Foooooooooooo +\n    Foooooooooooo +\n    Foooooooooooo\n>();\n\nconst map: Map<\n  Function,\n  FunctionFunctionFunctionFunctionffFunction\n> = Map::new();\n\nif true {\n  if condition {\n    const secondType = sourceCode.getNodeByRangeIndex1234(\n      second.range[0]\n    )?.typee;\n  }\n}\n\nx!() = null;\n(a as any) = null;\n(a as number) = 42;\n(a as any as string) = null;\n\nconst response = something.ahttp.get::<ThingamabobService::DetailsData>(\n  \"api/foo.ashx/foo-details/${myId}\",\n  A { cache: quux.httpCache, timeout }\n);\n(x as bool) != y;\n(a as number) = 42;\n\nwindow.postMessage(A {\n  context: item.context,\n  topic: item.topic,\n} as IActionMessage);\n\ntype X = fn(\n  options: AbstractCompositeThingamabobberFactoryProvidereeeeeeeeeee\n) -> Q;\n\n(|| {\n  pipe(\n    serviceEventFromMessage(msg),\n    TE.chain(flow(publishServiceEvent(analytics), TE.mapLeft(nackFromError)))\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err: Error| {\n      logger.error(\n        pipe(O.fromNullable(err.stack), O.getOrElse(constant(err.message)))\n      );\n      process.exit(1);\n    });\n})();\n\ncrate const getVehicleDescriptor = async |\n  vehicleId: string\n| -> Promise<Collections::Parts::PrintedCircuitBoardAssemblyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy> {};\n\nconst getUnusedAuthorizationHoldDocuments =\n  async || -> Promise<[DocumentData]> {};\n\nconst firestorePersonallyIdentifiablePaths: Array<\n  impl Collections::Users::Entity\n> = [];\n\ncrate const SUPPORTED_VEHICLE_TYPES: Array<Collections::VehiclesStates::Entity::ty> =\n  Object.values(Collections.VehiclesStates.Type);\n\npub trait AddAssetHtmlPlugin {\n  fn apply(compiler: WebpackCompilerType) {\n    compiler.plugin(\"compilation\", |compilation: WebpackCompilationType| {\n      compilation.plugin(\n        \"html-webpack-plugin-before-html\",\n        |callback: Callback<any>| {\n          addAllAssetsToCompilation(\n            this.assets,\n            compilation,\n            htmlPluginData,\n            callback\n          );\n        }\n      );\n    });\n  }\n}\n\nlet listener = DOM.listen(\n  introCard,\n  \"click\",\n  sigil,\n  |event: JavelinEvent| -> void {\n    BanzaiLogger.log(config, A {\n      ..logData,\n      ..DataStore.get(event.getNode(sigil))\n    })\n  }\n);\n\nthis.firebase\n  .object(\"/shops/${shopLocation.shop}\")\n  // keep distance info\n  .first(\n    |\n      shop: ShopQueryResult,\n      index: number,\n      source: Observable<ShopQueryResult>\n    | -> any {\n      // add distance to result\n      const s = shop;\n      s.distance = shopLocation.distance;\n      return s;\n    }\n  );\n\nlet bar: Bar<\n  AAAAAAA,\n  BBBBBBB,\n  CCCCCCC,\n  DDDDDDD,\n  EEEEEEE,\n  FFFFFFF,\n  GGGGGGG,\n  HHHHHHH\n>;\n\nconst baz = Array::<\n  FooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo,\n  BarBarBarBarBarBarBarBarBarBarBarBarBarBarBar\n>();\n\ncrate type RequestNextDealAction =\n  BaseAction<DealsActionTypes::REQUEST_NEXT_DEAL>;\n\ncrate impl Thing for OtherThing {\n  const ffff: fn(typee: Type) -> Provider<Prop> = memoize(\n    |ty: ObjectType| -> Provider<Opts> {}\n  );\n}\n\nconst appIDs = createSelector(\n  PubXURLParams.APP_IDS,\n  |rawAppIDs| -> Array<AppID> { deserializeList(rawAppIDs) }\n);\n\n// source: \"../../samples/common/types.rs\""
  },
  {
    "path": "tests/output/issues/0.f.rs",
    "content": "//! Expect 1 empty line below\n\n//! Expect 0 empty line below\n//! Expect 1 empty line below\n\n1;\n//! Expect 1 empty line below\n\n//! Expect 0 empty line below\n1;\n\n{\n  #![attr] // comment after #![attr]\n}\n\nmatch () {\n  #![attr] // comment after #![attr]\n}\n\nimpl Foo<\n  [\n    u8;\n    {\n      #![cfg_attr(not(FALSE), rustc_dummy(cursed_inner))]\n      #![allow(unused)]\n      struct Inner {\n        field: [\n          u8;\n          {\n            #![cfg_attr(not(FALSE), rustc_dummy(another_cursed_inner))]\n            1\n          }\n        ],\n      }\n\n      0\n    }\n  ]\n> {\n  #![cfg_eval]\n  #![print_attr]\n  #![cfg_attr(not(FALSE), rustc_dummy(evaluated_attr))]\n\n  fn bar() {\n    #[cfg(FALSE)]\n    let a = 1;\n  }\n}\n\n#[cfg_eval]\n#[print_attr]\nstruct S1 {\n  #[cfg(FALSE)]\n  field_false: u8,\n  #[cfg(all(/*true*/))]\n  #[cfg_attr(FALSE, unknown_attr)]\n  #[cfg_attr(all(/*true*/), allow())]\n  field_true: u8,\n}\n\nfn main() {\n  //\n  //\n  let _ = #[cfg_eval] #[print_attr] #[cfg_attr(not(FALSE), rustc_dummy)] (\n    #[cfg(FALSE)] 0, #[cfg(all(/*true*/))] 1,\n  );\n}\n\n#[empty_helper] // a\n// b\n// c\n#[derive(Empty)]\nstruct S {\n  #[empty_helper] // d\n  field: [\n    u8;\n    {\n      use empty_helper; // e\n\n      #[empty_helper] // f\n      struct U;\n\n      mod inner {\n        // g\n        #[empty_helper]\n        struct V;\n\n        gen_helper_use!();\n\n        #[derive(GenHelperUse)] // h\n        struct Owo;\n\n        use empty_helper as renamed;\n        #[renamed] // i\n        struct Wow;\n      }\n\n      0\n    }\n  ],\n}\n\nfn f() {\n  return (\n    property.isIdentifier() &&\n    FUNCTIONS[property.node.name] &&\n    (object.isIdentifier(JEST_GLOBAL) ||\n      (callee.isMemberExpression() && shouldHoistExpression(object))) &&\n    (FUNCTIONS[property.node.name])(expr.get(\"arguments\"))\n  );\n\n  return (\n    chalk.bold(\"No tests found related to files changed since last commit.\\n\") +\n    chalk.dim(\n      if patternInfo.watch {\n        r#\"Press \"a\" to run all tests, or run Jest with \"--watchAll\".\"#\n      } else {\n        r#\"Run Jest without \"-o\" to run all tests.\"#\n      }\n    )\n  );\n\n  return (\n    !filePath.includes(coverageDirectory) &&\n    !filePath.endsWith(\".${SNAPSHOT_EXTENSION}\")\n  );\n\n  return (\n    someVeryLongStringA &&\n    someVeryLongStringB &&\n    someVeryLongStringC &&\n    someVeryLongStringD\n  );\n}\n\nfn f() {\n  if position {\n    return A { name: pair };\n  } else {\n    return A {\n      name: pair.substring(0, position),\n      value: pair.substring(position + 1),\n    };\n  }\n}\n\nfn f() {\n  if position {\n    return A { name: pair };\n  } else {\n    return A {\n      name: pair.substring(0, position),\n      value: pair.substring(position + 1),\n    };\n  }\n}\n\nfn f() {\n  if let Some(_) = (try {}) {\n  }\n}\n\npub fn delete_upload_session(&self, sess: &UploadSession) -> Result<()> {\n  self.client.delete(&sess.upload_url).send()?.parse_empty()\n}\n\nlet contents = fs\n  ::read_to_string(config.filename)\n  .expect(\"Something went wrong reading the file\");\n\nfn very_very_very_very_very_long_fun_name(x: i32) -> Vec<i32> {\n  vec![x]\n}\n\nfn main() {\n  let very_very_very_very_very_very_very_very_very_long_var_name = 13;\n  let all = very_very_very_very_very_long_fun_name(\n    very_very_very_very_very_very_very_very_very_long_var_name\n  )\n    .iter()\n    .map(|x| x + very_very_very_very_very_very_long_var_name);\n  let more = 13;\n  let other = vec![1, 2, 3]\n    .iter()\n    .map(|x| x + very_very_very_very_very_very_long_var_name);\n\n  Pin::new(&mut self.0).poll(cx).is_ready();\n}\n\nfn f() {\n  something.do_stuff(|| {\n    {\n      \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n    }\n  });\n}\nlet kind = match rvalue {\n  Rvalue::Ref(_, borrow_kind, _) if borrow_kind.allows_two_phase_borrow() => {\n    RetagKind::TwoPhase\n  }\n  Rvalue::AddressOf(..) => RetagKind::Raw,\n  _ => RetagKind::Default,\n};\n\nuse exonum::{\n  api::{ Api, ApiError },\n  blockchain::{ self, BlockProof, Blockchain, Transaction, TransactionSet },\n  crypto::{ Hash, PublicKey },\n  helpers::Height,\n  node::TransactionSend,\n  storage::{ ListProof, MapProof },\n};\n\nlet mut arms = variants\n  .iter()\n  .enumerate()\n  .map(|(i, &(ident, v_span, ref summary))| {\n    let i_expr = cx.expr_usize(v_span, i);\n    let pat = cx.pat_lit(v_span, i_expr);\n\n    let path = cx.path(v_span, vec![substr.type_ident, ident]);\n    let thing = rand_thing(cx, v_span, path, summary, |cx, sp|\n      rand_call(cx, sp)\n    );\n    cx.arm(v_span, vec![pat], thing)\n  })\n  .collect::<Vec<ast::Arm>>();\n\nlet input = Input {\n  foo: 42,\n};\nsome_fn_with_struct_and_closure(input, |foo| {\n  println!(\"foo: {:?}\", foo);\n});\nsome_fn_with_struct_and_closure(\n  Input {\n    foo: 42,\n  },\n  |foo| {\n    println!(\"foo: {:?}\", foo);\n  }\n);\nfn main() {\n  assert_eq!(\n    code,\n    unindent(\n      r#\"\n        def hello():\n            print(\"Hello, world!\")\n        \n        hello()\n    \"#\n    )\n  );\n  assert_eq(\n    code,\n    unindent(\n      r#\"\n        def hello():\n            print(\"Hello, world!\")\n        \n        hello()\n    \"#\n    )\n  );\n  assert_eq!(\n    s,\n    wrap(A {\n      x: 10,\n      y: 20,\n      z: 30,\n    })\n  );\n  assert_eq(\n    s,\n    wrap(A {\n      x: 10,\n      y: 20,\n      z: 30,\n    })\n  );\n  assert_eq!(s, wrap(A { x: 10, y: 20, z: 30 }));\n  assert_eq(s, wrap(A { x: 10, y: 20, z: 30 }));\n}\n\nfn speak_raw(\n  self,\n  seed: u32,\n  language: Language<B, P>,\n  speaker: Speaker<N, M>\n) -> Synthesize<\n  Jitter<\n    Sequence<\n      Select<\n        Intonate<\n          Phonemize<\n            core::iter::Map<Self::IntoIter, fn(char) -> Event<char>>,\n            B,\n            N,\n            M\n          >,\n          P\n        >,\n        N,\n        M\n      >,\n      N,\n      M\n    >,\n    N,\n    M\n  >,\n  N,\n  M\n> {\n  self\n    .parse_raw()\n    .phonemize(&language, &speaker)\n    .intonate(&language, &speaker)\n    .select(&speaker)\n    .sequence(speaker.sample_rate)\n    .jitter(seed, &speaker)\n    .synthesize()\n}\n\nuse ::{\n  fidl::endpoints::RequestStream,\n  fuchsia_async as fasync,\n  fuchsia_zircon as zx,\n  std::marker::PhantomData,\n};\n\nfn f() -> Vec<u32> {\n  [1, 2, 3]\n    .iter()\n    .map(|&x| {\n      return x * 2;\n    })\n    .collect()\n}\n\nClient::new()\n  .request(\n    Request::get(&req.state().upstream)\n      .header(header::ACCEPT, HeaderValue::from_static(CONTENT_TYPE_GRAPH_V1))\n      .body(Body::empty())\n      .expect(\"unable to form request\")\n  )\n  .from_err::<Error>()\n  .and_then(|res| {\n    if res.status().is_success() {\n      future::ok(res)\n    } else {\n      future::err(\n        format_err!(\"failed to fetch upstream graph: {}\", res.status())\n      )\n    }\n  })\n  .and_then(|res| res.into_body().concat2().from_err::<Error>())\n  .and_then(|body| {\n    let graph: Graph = serde_json::from_slice(&body)?;\n    Ok(\n      HttpResponse::Ok()\n        .content_type(CONTENT_TYPE_GRAPH_V1)\n        .body(serde_json::to_string(&graph)?)\n    )\n  });\n\nfn foo() {\n  parse_simple_ok(\n    \"() ()\",\n    vec![\n      SimpleSexpr::List {\n        opening: \"(\".into(),\n        closing: \")\".into(),\n        entire: \"()\".into(),\n        children: vec![],\n      },\n      SimpleSexpr::List {\n        opening: \"(\".into(),\n        closing: \")\".into(),\n        entire: \"()\".into(),\n        children: vec![],\n      }\n    ]\n  );\n}\n\nimpl X {\n  pub const SOMETHING: usize =\n    mem::size_of::<i64>() + // field A\n    mem::size_of::<i64>() + // field B\n    mem::size_of::<i64>() + // field C\n    mem::size_of::<i64>() + // field D\n    mem::size_of::<i64>() + // field E\n    mem::size_of::<i64>() + // field F\n    mem::size_of::<i64>() + // field G\n    mem::size_of::<i64>(); // field H\n}\n\npub type Iter<'a, D> =\n  impl DoubleEndedIterator<Item = SomethingSomethingSomethingLongType<D>> +\n    ExactSizeIterator +\n    'a;\n\npub type Iter<'a, D>: BoundDoubleEndedIterator<Item = SomethingSomethingSomethingLongType> +\n  ExactSizeIterator +\n  'a;\n\npub type Iter<'a, D>: BoundDoubleEndedIterator<Item = SomethingSomethingSomethingLongType<D>> +\n  ExactSizeIterator +\n  'a;\n\nlet a = Some(2)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .map(|v| v)\n  .unwrap(/* fine because we know it's a Some */);\n\nuse module::{\n  submodule_A::{ Type_A1, Type_A2 },\n  submodule_B::{ Type_B1, Type_B2 },\n};\n\nfn f1() -> Box<\n  FnMut1() -> Thing1<\n    WithType = LongItemName,\n    Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger\n  >\n> {}\nfn f2() -> Box<\n  dyn (FnMu2t() -> Thing2<\n    WithType = LongItemName,\n    Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger\n  >) +\n    fmt::Write\n> {}\n\nflags! {\n    enum Permissions: c_int {\nR = 1,\nW = 2,\nX = 16,\n}\n}\n\nimpl CalibrationType {\n  #[rustfmt::skip] // In this case aligning the match branches makes for more readable code.\n  pub fn parse(value: &str) -> Option<Self> {\n        match value {\n            \"alpha-beta\" => Some(Self::AlphaBeta),\n            \"bin-shift\"  => Some(Self::BinShift),\n            \"enum\"       => Some(Self::Enum),\n            \"none\"       => Some(Self::None),\n            _            => None\n        }\n    }\n\n  #[rustfmt::skip] // In this case aligning the match branches makes for more readable code.\n  pub fn to_str(&self) -> &'static str {\n        match self {\n            Self::AlphaBeta => \"alpha-beta\",\n            Self::BinShift  => \"bin-shift\",\n            Self::Enum      => \"enum\",\n            Self::None      => \"none\"\n        }\n    }\n}\n\npub trait PrettyPrinter<'tcx>: Printer<\n  'tcx,\n  Error = fmt::Error,\n  Path = Self,\n  Region = Self,\n  Type = Self,\n  DynExistential = Self,\n  Const = Self\n> {\n  //\n}\n\npub trait PrettyPrinter<'tcx>: Printer<\n  'tcx,\n  Error = fmt::Error,\n  Path = Self,\n  Region = Self,\n  Type = Self,\n  DynExistential = Self,\n  Const = Self\n> +\n  Send\n{\n  //\n}\n\nArc::get_mut(&mut runtest).unwrap().get_mut().unwrap().take().unwrap()();\n\nstruct X<'a>(\n  #[X(\n    X = \"_________________________________________________________________________\"\n  )] pub &'a u32,\n  // ^^\n);\n\nenum Foo {\n  Bar,\n  Baz = /* Block comment */ 123,\n  Quux = 124, // Line comment\n}\n\n#![feature(trait_alias)]\ntrait Foo = /*comment*/ std::fmt::Debug + Send;\ntrait Bar = /*comment*/ Foo + Sync;\n\ntype Kilometers = /*comment*/ i32;\n\nmod tests {\n  fn test_datetime() {\n    for &(year, month, day, hour, min, sec, micro, is_leap) in &[\n      (2021, 1, 20, 22, 39, 46, 186605, false), // time of writing :)\n      (2020, 2, 29, 0, 0, 0, 0, false), // leap day hehe\n      (2016, 12, 31, 23, 59, 59, 123456, false), // latest leap second\n      (2016, 12, 31, 23, 59, 59, 123456, true), // latest leap second\n      (1156, 3, 31, 11, 22, 33, 445566, false), // long ago\n      (1, 1, 1, 0, 0, 0, 0, false), // Jan 01, 1 AD - can't go further than this\n      (3000, 6, 5, 4, 3, 2, 1, false), // the future\n      (9999, 12, 31, 23, 59, 59, 999999, false), // Dec 31, 9999 AD - can't go further than this\n    ] {\n    }\n  }\n}\n\n#[cfg(windows)]\nuse glium::glutin::platform::windows::EventLoopExtWindows;\n#[cfg(windows)]\nuse glium::glutin::{ platform::windows::IconExtWindows, window::Icon };\n\nfn main() {\n  println!(\"\");\n  println!(\"\" /* \" */);\n  println!(\"\" /* \\\" */);\n}\n\nstruct Bar(());\nstruct Foo(Bar);\n\nfn main() {\n  let foo = Foo(Bar(()));\n\n  foo.0.0;\n}\n\ntokio::select! {\n\tresult = reader => {\n            match result {\n\t\tOk(v) => {\n\t\t    eprintln!(\n                    \"message: {}\",\n                    v\n                    );\n                },\n\t\tErr(_) => {\n\t\t    eprintln!(\n                        \"error: {}\",\n                        e\n                    );\n                },\n            }\n\t},\n\t_ = writer => {\n            // Comment\n            eprintln!(\n                \"completed: {}\",\n                some_other_field\n            );\n\t}\n}\n\n//! Some docs here\n#![cfg_attr(bootstrap, doc = \"xxx\")]\n\n#![cfg_attr(debug_assertions, stable(feature = \"rust1\", since = \"1.0.0\"))]\n\nfn main() {\n  let condition_a = true;\n  let condition_b = false;\n  let x =\n    123.456789 +\n    (if condition_a { x + y + z + w } else { 123.456789 }) +\n    (if condition_b { x - y - z - w } else { 123.456789 });\n}\n\n#[cfg(not(miri))] // Miri does not deduplicate consts\nfn test() {\n  self.1.0;\n}\n\nfn main() {\n  let x = 111;\n  /* First Comment line 1\n   * First Comment line 2 */\n\n  let x = 222;\n  /* Second Comment line 1\n   * Second Comment line 2 */\n}\n\nfn main() {\n  if /*w*/ 5 /*x*/ == /*y*/ 6 /*z*/ {\n  }\n}\n\nfn printsomething() {\n  println!(\"line__1\nline______2\nline________3\nline___________4\");\n}\n\nconst USAGE: &'static str =\n  \"\ntoyunda-player.\n\nUsage:\n  toyunda-player [options] <file>\n  toyunda-player -h | --help\n  toyunda-player --version\n\nOptions:\n  -h --help     Show this screen.\n  --version     Show version.\n  --invert      Invert the screen.\n\";\n\nfn main() {\n  x.f(\n    \"\nArticle(id, title).\nVote(user, id).\nVC(id, votes) = votes:COUNT(u, Vote(u, id)).\nAwV(id, title, votes) = Article(id, title) * VC(id, votes).\nVote_n(user, id, strength=1) <- Vote(user, id).\nVS(id, score) = score:SUM(strength, Vote_n+(_, id, strength)).\nAwV_n(id, title, score) = Article(id, title) * VS(id, score).\n\"\n  ).unwrap();\n}\n\nconst USAGE: &'static str = \" \n...\n\";\n\nlet program = glium::Program\n  ::from_source(\n    &display,\n    &include_str!(\"./shaders/vertex.glsl\"),\n    &include_str!(\"./shaders/fragment.glsl\"),\n    None\n  )\n  .unwrap();\n\nlet mut g_buffer = MultiOutputFrameBuffer::with_depth_buffer(\n  api.facade,\n  [(\"color\", &g_albedo)].iter().cloned(),\n  &g_depth\n);\n\nmacro_rules! foo {\n  ($a:ident: $b:ty) => {};\n  ($a:ident $b:ident $c:ident) => {};\n  (\n    $(\n      if #[cfg($meta:meta)]\n      { $($tokens:tt)* }\n    )else*\n    else { $($tokens2:tt)* }\n  ) => {};\n  (\n    if #[cfg($i_met:meta)]\n    { $($i_tokens:tt)* }\n    $(\n      else if #[cfg($e_met:meta)]\n      { $($e_tokens:tt)* }\n    )*\n  ) => {};\n  (\n    $expression:expr,\n    $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?\n  ) => {};\n  (\n    @main($($not:meta,)*);\n    (\n      ($($m:meta),*)\n      ($($tokens:tt)*)\n    ),\n    $($rest:tt)*\n  ) => {};\n  (\n    @main {}\n    if let $pat:pat = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main {}\n    if $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)* }\n    let $pat:pat = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)* }\n    let $ident:ident: $ty:ty = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)* }\n    let $pat1:pat | $($pat:pat)|+ = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)+ }\n    if let $pat:pat = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)* }\n    if let $pat1:pat | $($pat:pat)|+ = $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)+ }\n    if $expr:expr;\n    $($tt:tt)+\n  ) => {};\n  (\n    @main { $($other:tt)* }\n    then { $($then:tt)* }\n  ) => {};\n  (\n    @main($($tt:tt)*)\n    then { $($then:tt)* }\n    else { $($other:tt)* }\n  ) => {};\n  (\n    @main($($tt:tt)*)\n    then { $($then:tt)* }\n  ) => {};\n  (\n    @main($($tt:tt)*)\n    $head:tt\n    $($tail:tt)*\n  ) => {};\n}\n\nself.0\n  .take_action(Log)\n  .result()\n  .map_err(|()| LoggerError);\n\nlet n: i32 = std::env::args().nth(1).map(parse).unwrap_or(Ok(100))?;\n\nfn main() {\n  return doughnutFryer\n    .start()\n    .then(|_| _frostingGlazer.start())\n    .then(|_|\n      Future.wait([\n        _conveyorBelts.start(),\n        sprinkleSprinkler.start(),\n        sauceDripper.start(),\n      ])\n    )\n    .catchError(cannotGetConveyorBeltRunning)\n    .then(|_| tellEveryoneDonutsAreJustAboutDone())\n    .then(|_|\n      Future.wait([\n        croissantFactory.start(),\n        _giantBakingOvens.start(),\n        butterbutterer.start(),\n      ])\n        .catchError(_handleBakingFailures)\n        .timeout(scriptLoadingTimeout, _handleBakingFailures)\n        .catchError(cannotGetConveyorBeltRunning)\n    )\n    .catchError(cannotGetConveyorBeltRunning)\n    .then(|_| {\n      _logger.info(\"Let's eat!\");\n    });\n}\nself.projection_matrix = Matrix4::new(\n  1.0 / r,\n  0.0,\n  0.0,\n  0.0, // NOTE: first column!\n  0.0,\n  1.0 / t,\n  0.0,\n  0.0, // 2nd\n  0.0,\n  0.0,\n  2.0 / (n - f),\n  0.0, // 3rd\n  0.0,\n  0.0,\n  (f + n) / (n - f),\n  1.0 // 4th\n);\n\nlet explicit_conversion_preserves_semantics = ||\n  !is_mod || (is_mod && attrs.map_or(true, |a| a.is_empty()));\n\nfn default_user_agent_string(agent: UserAgent) -> String {\n  (\n    match agent {\n      UserAgent::Desktop => { DESKTOP_UA_STRING }\n      UserAgent::Android => {\n        \"Mozilla/5.0 (Android; Mobile; rv:37.0) Servo/1.0 Firefox/37.0\"\n      }\n    }\n  ).to_owned()\n}\n\n#![allow(\n  clippy::needless_pass_by_value,\n  clippy::new_ret_no_self,\n  clippy::new_without_default_derive\n)]\ncopysign(\n  0.5 * P2_HI - (2.0 * s * r_ - (P2_LO - 2.0 * c) - (0.5 * P2_HI - 2.0 * f)),\n  i\n);\n\nimpl Foo {\n  fn foo(&self) -> Box<FnMut(i64) -> i64> {\n    Box::new(move |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {\n      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n    })\n  }\n}\n\nm.map_data(|mut rs| {\n  rs.retain(|r| {\n    r.iter()\n      .enumerate()\n      .all(|(i, v)| {\n        if let Some(ref rv) = on[i] { rv == v } else { true }\n      })\n  });\n  rs.retain(|r| {\n    r.iter()\n      .enumerate()\n      .all(|(i, v)| if let Some(ref rv) = on[i] { rv == v } else { true })\n  });\n});\n\npub fn uumain(args: Vec<String>) -> i32 {\n  let matches = App::new(executable!())\n    .arg(Arg::with_name(OPT_CHANGE).short(\"c\").long(\"ch\"))\n    .arg(\n      Arg::with_name(OPT_DEREFERENCE).help(\n        \"aazezae affect the referent of each symbolic link this is qthe default the symbolic link itself\"\n      )\n    );\n}\n\nimpl S {\n  fn f() {\n    self.g({\n      if b {\n        Err(\n          w(\n            i(\"expected float or integer types for both operands of {}, got '{}' and '{}'\", token)\n          ),\n          left\n        );\n      }\n      match d {\n        _ => h(m, b),\n      }\n    })\n  }\n}\n\nmatch () {\n  | (AngleBracketedArg::Arg(_), None)\n  | (AngleBracketedArg::Constraint(_), Some(_)) => {}\n}\n\nmacro_rules! map_and_then_print {\n  ($value:expr, | $pat:pat | $map:expr) => {\n    {\n        let $pat = $value;\n        let s = $map;\n        println!(\"{}\", s);\n    }\n  };\n}\n\nmap_and_then_print!(1, |x| x + 3);\n// Prints \"4\"\n\nmatch head.packet_type()? {\n  p @ (\n    | PacketType::Connect\n    | PacketType::ConnAck\n    | PacketType::SubAck\n    | PacketType::UnsubAck\n  ) => {\n    return Err(Error::WrongPacket(p));\n  }\n}\n\n#![feature(raw)]\n#![panic_runtime]\n#![feature(panic_runtime)]\n\n// `real_imp` is unused with Miri, so silence warnings.\n#![cfg_attr(miri, allow(dead_code))]\n\nfn foo() -> () {}\n\nfor i in 0..n + 1 {\n}\n\nif\n  alpha >\n  x_m * (f1 / x1).ln() +\n    (n - (m as f64) + 0.5) * (z / w).ln() +\n    ((y - m) as f64) * ((w * p) / (x1 * q)).ln() +\n    // ________\n    stirling(f1) +\n    stirling(z) -\n    stirling(x1) -\n    stirling(w)\n{\n  continue;\n}\n\nmatch (self, other) {\n  (&U32(ref v1), &U32(ref v2)) => v1 == v2,\n  (&USize(ref v1), &USize(ref v2)) => v1 == v2,\n  (&U32(ref v1), &USize(ref v2)) => {\n    v1.len() == v2.len() &&\n      v1\n        .iter()\n        .zip(v2.iter())\n        .all(|(x, y)| (*x as usize) == *y);\n  }\n  (&USize(ref v1), &U32(ref v2)) => {\n    v1.len() == v2.len() &&\n      v1\n        .iter()\n        .zip(v2.iter())\n        .all(|(x, y)| *x == (*y as usize));\n  }\n}\n\nfn main() {\n  let o_num = Some(123);\n\n  let x = if\n    let Some(n) =\n      // ________\n      o_num\n  {\n    n * 2\n  } else {\n    0\n  };\n\n  println!(\"Number: {}\", x);\n}\n\nstruct Foo {\n  // a: i32,\n  //\n  // b: i32,\n}\n\nstruct Foo {\n  a: i32,\n  //\n  // b: i32,\n}\n\nmacro_rules! m {\n  ($a:expr) => {\n\t\tif $a {\n\t\t\treturn;\n\t\t\t}\n  };\n}\n\nlet write_status = |\n  status: &mut Vec<ansi_term::ANSIString>,\n  diff: &Diff,\n  heading: &str,\n  color: &Style,\n  show_hints: bool,\n  hints: &[&str]\n| -> Result<bool> {};\n\nmacro_rules! member_mut {\n  ($self:expr, $member:expr) => {\n    {\n\t\tuse self::Member::*;\n\t\tlet r = &mut *$self;\n\t\tmatch $member {\n\t\t\tA => &mut r.a,\n\t\t\tB => &mut r.b,\n\t\t\t}\n    }\n  };\n}\nif let Some(ref /*mut*/ state) = foo {\n}\n\nimpl<\n  Target: FromEvent<A> + FromEvent<B>,\n  A: Widget2<Ctx = C>,\n  B: Widget2<Ctx = C>,\n  C: for<'a> CtxFamily<'a>\n> Widget2 for WidgetEventLifter<Target, A, B> {\n  type Ctx = C;\n  type Event = Vec<Target>;\n}\n\n(async {\n  // Do\n  // some\n  // work\n}).await;\n\nfn main() {\n  token!(dyn);\n}\n\nfn build_sorted_static_get_entry_names(\n  mut entries: Vec<(u8, &'static str)>\n) -> impl (Fn(\n  AlphabeticalTraversal,\n  Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>\n) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>) +\n  Send +\n  Sync +\n  'static {}\n\nfn main() {\n  bbbbbbbbbbbbbbbbbb::ccccccccccccccccccccccccccccccccccccccc::dddddddddddddddddddd(\n    eeeeeeeeeeeeeeeeeeee::ffffffffffffffffffff(\n      ggggggggg(hhhhhhhhhhhhhhhh),\n      iiiiiiiii(jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj)\n    )\n  );\n}\n\nfn f() -> Box<\n  dyn FnMut() -> Thing<\n    WithType = LongItemName,\n    Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger\n  >\n> {}\n\ntrait Foo {}\nstruct Bar {}\nimpl<> Foo<> for Bar<> {}\n\nimpl Foo {\n  fn foo() {\n    self.report.add_non_formatted_ranges(visitor.skipped_range.clone());\n  }\n}\n\nfn test() {\n  let aaaaaaaaaaaaaaaa = ffffffffffffffffffffffff\n    .iter()\n    .filter_map(|_| {\n      if\n        bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ==\n        ccccccccccccccccccccccc\n          .dddddddddddddddddddddddd()\n          .eeeeeeeeeeeeeeeeeeeeee()\n      {\n        ();\n      }\n    })\n    .collect();\n}\n\nfn main() {\n  let visual_studio_path = {\n    let vswhere_stdout = String::from_utf8(vswhere_output.stdout).expect(\n      \"vswhere output is not valid UTF-8\"\n    );\n    String::from(vswhere_stdout.trim())\n  };\n}\n\n#[cfg(test)]\nmod tests {\n  #[test]\n  fn handles_mid_demangling() {\n    assert_eq!(\n      crate::demangle_line(\n        \"        lea     rax, [rip + _ZN55_$LT$$RF$$u27$a$u20$T$u20$as$u20$core..fmt..Display$GT$3fmt17h510ed05e72307174E]\"\n      ),\n      \"        lea     rax, [rip + <&\\'a T as core::fmt::Display>::fmt]\"\n    );\n  }\n}\n\nfn main() {\n  let i = test::<-1>();\n  println!(\"Hello, {}!\", i);\n}\n\nfn test<const T: i8>() -> i8 {\n  { T }\n}\n\nvm.get_method_or_type_error(obj.clone(), \"__getitem__\", ||\n  format!(\"'{}' object is not iterable\", obj.class().name)\n)?;\n\ntype ProposeTransactionsFuture: Future<\n  Item = ProposeTransactionsResponse<Self::MessageId>,\n  Error = Error\n>;\n\ntype ProposeTransactionsFuture: Future<\n  Item = ProposeTransactionsResponse<Self::MessageId>,\n  Error = Error\n> +\n  Send +\n  'static;\n\nfn main() {\n  /* Common case: The double precision result is fine. */\n  if\n    (ui & 0x1fffffff) != 0x10000000 /* not a halfway case */ ||\n    e == 0x7ff /* NaN */ ||\n    (result - xy == (z as f64) && result - (z as f64) == xy) /* exact */ ||\n    fegetround() != FE_TONEAREST /* not round-to-nearest */\n  {\n  }\n}\n\npub fn foo(config: &Config) {\n  let csv = RefCell::new(create_csv(config, \"foo\"));\n  {\n    let mut csv = csv.borrow_mut();\n    for (i1, i2, i3) in iproduct!(0..2, 0..3, 0..3) {\n      csv.write_field(format!(\"γ[{}.{}.{}]\", i1, i2, i3)).unwrap();\n      csv.write_field(format!(\"d[{}.{}.{}]\", i1, i2, i3)).unwrap();\n      csv.write_field(format!(\"i[{}.{}.{}]\", i1, i2, i3)).unwrap();\n    }\n    csv.write_record(None::<&[u8]>).unwrap();\n  }\n}\n\nfn main() {\n  let a = Foo {\n    something: Some(1),\n    bar: 2,\n  };\n  if let Foo { something: Some(something), .. } = a {\n    println!(\"{}\", something);\n  }\n}\n\nfn main() {\n  let dv =\n    (2.0 * m * l * dtheta * dtheta * theta.sin() +\n      3.0 * m * g * theta.sin() * theta.cos() +\n      4.0 * u -\n      4.0 * b * v) /\n    (4.0 * (M + m) - 3.0 * m * theta.cos().powi(2));\n  let ddtheta =\n    (-3.0 * m * l * dtheta * dtheta * theta.sin() * theta.cos() -\n      6.0 * (M + m) * g * theta.sin() -\n      6.0 * (u - b * v) * theta.cos()) /\n    (4.0 * l * (m + M) - 3.0 * m * l * theta.cos().powi(2));\n  let V: Array2<_> =\n    (((&lq + &vi).mapv(f64::exp) - &q) * mi_minus_mi_t.mapv(f64::cos) -\n      ((&lq - &vi).mapv(f64::exp) - &q) * mi_plus_mi_t.mapv(f64::cos)) *\n    e.as_row() *\n    e.as_column() *\n    0.5;\n  dVdm\n    .slice_mut(s![.., .., j])\n    .assign(\n      &(\n        ((Array2::zeros((d, d)) + u.as_column() - u.as_row()) * &U1 +\n          (Array2::<f64>::zeros((d, d)) + u.as_column() + u.as_row()) * &U2) *\n        e.as_column() *\n        e.as_row()\n      )\n    );\n  {\n    {\n      {\n        {\n          {\n            let LdXi: Array2<_> =\n              (dmahai +\n                kdX.slice(s![.., i, d]).into_column() +\n                kdX.slice(s![.., j, d])) *\n              &L;\n          }\n        }\n      }\n    }\n  }\n  let dnlml = Array1::from_shape_fn(ln_hyperparams.len(), |i| {\n    0.5 *\n      (\n        self.covfunc.deriv_covariance(ln_hyperparams, train_inputs, i) * &W\n      ).scalar_sum()\n  });\n  dVdi\n    .slice_mut(s![.., output_index, .., input_index])\n    .assign(\n      &(\n        c *\n        (iR.column(input_index).into_column().dot(&lb.view().into_row()) -\n          (&t * &tlb_view.into_column()).reversed_axes() +\n          tlbdi2)\n      )\n    );\n  {\n    let tdX: Array1<_> =\n      -0.5 *\n      t *\n      (\n        &iR.t() *\n        test_covariance *\n        (-2.0 * &inv_sq_len_scales_i - 2.0 * &inv_sq_len_scales_i)\n      ).sum_axis(Axis(0));\n  }\n  {\n    let dSds: Array2<_> =\n      r2 *\n        (\n          2.0 * i2SpW.dot(&m_minus_z.as_column()).dot(&m_minus_z.as_row()) -\n          Array2::<f64>::eye(D)\n        ).dot(&i2SpW) -\n      2.0 * L * &dLds;\n  }\n  let f = future::poll_fn(move || {\n    match tokio_threadpool::blocking(|| f.poll()).unwrap() {\n      Async::Ready(v) => v,\n      Async::NotReady => Ok(Async::NotReady),\n    }\n  });\n  test(\"Your number: \", match input {\n    BigEnum::One => 0,\n    BigEnum::Two => 0,\n    BigEnum::Three => 0,\n    BigEnum::Four => 0,\n    BigEnum::Five => 0,\n    BigEnum::Six => 0,\n    BigEnum::Seven => 0,\n    BigEnum::Eight => 0,\n    BigEnum::Nine => 0,\n    BigEnum::Ten => 0,\n    BigEnum::Eleven => 0,\n    BigEnum::Twelve => 0,\n  });\n  window\n    .task_manager()\n    .dom_manipulation_task_source()\n    .queue(\n      task!(fire_dom_content_loaded_event: move || {\n\t\t\t\tlet document = document.root();\n\t\t\t\tdocument.upcast::<EventTarget>().fire_bubbling_event(atom!(\"DOMContentLoaded\"));\n\t\t\t\tupdate_with_current_time_ms(&document.dom_content_loaded_event_end);\n\t\t\t}),\n      window.upcast()\n    )\n    .unwrap();\n\n  foo(|| {\n    loop {\n      foo();\n    }\n  });\n  foo(|| {\n    while true {\n      foo();\n    }\n  });\n  foo(|| {\n    if true {\n      foo();\n    }\n  });\n  tokio::spawn(async {\n    println!();\n  });\n\n  // this block will be properly formatted\n  {\n    let a = 1;\n    let b = 2;\n    let c =\n      \" very very very very very very very very very very very very very very very very very very long string in a block\";\n  }\n\n  let v = vec![1, 2];\n\n  // this block won't be formatted\n  v.iter().for_each(|_| {\n    let a = 1;\n    let b = 2;\n    let c =\n      \" very very very very very very very very very very very very very very very very very very long string in a block\";\n  });\n\n  // this block with shorter str will be properly formatted\n  v.iter().for_each(|_| {\n    let a = 1;\n    let b = 2;\n    let c = \" less very very long string in a block\";\n  });\n\n  async fn forty_two() -> i32 {\n    42\n  }\n\n  fn spawn_async(_f: impl Future<Output = ()>) {\n    unimplemented!();\n  }\n\n  fn main() {\n    spawn_async(async {\n      println!(\"{}\", await!(forty_two()));\n    });\n  }\n  if 1 {\n  } else if\n    eq!(b[1] == b'o' b'n' b't' b'e' b'n' b't' b'-' b'r' b'a' b'n' b'g' b'e')\n  {\n  }\n}\nstatic REPRO: &[usize] = &[#[cfg(feature = \"zero\")] 0];\n\nlazy_static! {\n  pub static ref BLOCKING_POOL: tokio_threadpool::ThreadPool = {\n    tokio_threadpool::Builder::new().pool_size(1).build()\n  };\n\n  static ref FOO: Foo = unsafe {\n    very_long_function_name().another_function_with_really_long_name()\n  };\n}\n\nstatic DEFAULT_HOOK: SyncLazy<\n  Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>\n> = SyncLazy::new(|| {\n  let hook = panic::take_hook();\n  panic::set_hook(\n    Box::new(|info| {\n      // Invoke the default handler, which prints the actual panic message and optionally a backtrace\n      (*DEFAULT_HOOK)(info);\n\n      // Separate the output with an empty line\n      eprintln!();\n\n      // Print the ICE message\n      rustc_driver::report_ice(info, BUG_REPORT_URL);\n    })\n  );\n  hook\n});\n\nfn main() {\n  let factorial = |recur: &dyn Fn(u32) -> u32, arg: u32| -> u32 {\n    if arg == 0 { 1 } else { arg * recur(arg - 1) }\n  };\n  self.time_passes =\n    config.opts.prints.is_empty() &&\n    (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);\n  config.opts.maybe_sysroot = Some(\n    config.opts.maybe_sysroot\n      .clone()\n      .unwrap_or_else(|| {\n        std::env\n          ::current_exe()\n          .unwrap()\n          .parent()\n          .unwrap()\n          .parent()\n          .unwrap()\n          .to_owned()\n      })\n  );\n  Box::new(\n    rustc_codegen_ssa::base::codegen_crate(\n      LlvmCodegenBackend(()),\n      tcx,\n      crate::llvm_util::target_cpu(tcx.sess).to_string(),\n      metadata,\n      need_metadata_module\n    )\n  );\n  let (codegen_results, work_products) = ongoing_codegen\n    .downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>()\n    .expect(\"Expected GccCodegenBackend's OngoingCodegen, found Box<Any>\")\n    .join(sess);\n  if let Some(old) = old {\n    self.cur = unsafe { (self.step)(old) };\n  }\n  let _prof_timer = tcx.prof.generic_activity_with_args(\n    \"codegen_module\",\n    &[cgu_name.to_string(), cgu.size_estimate().to_string()]\n  );\n  let tm = match (cgcx.tm_factory)(tm_factory_config) {\n  };\n  let _ = [\n    0;\n    {\n      struct Foo;\n      impl Foo {\n        const fn get(&self) -> usize {\n          5\n        }\n      }\n      Foo.get()\n    }\n  ];\n  syntactically_correct(\n    loop {\n      sup('?');\n    },\n    if cond {\n      0\n    } else {\n      1\n    }\n  );\n  unsafe {\n    &*self.llmod_raw;\n  }\n  llvm::LLVMRustDisposeTargetMachine(&mut *(self.tm as *mut _));\n  let tm = (cgcx.tm_factory)(tm_factory_config).map_err(|e|\n    write::llvm_err(&diag_handler, &e)\n  )?;\n  target_machine_factory(\n    sess,\n    config::OptLevel::No,\n    &features\n  )(config).unwrap_or_else(|err| llvm_err(sess.diagnostic(), &err).raise());\n  let TestOutcome {\n    completed: ok,\n    errors: err,\n    ..\n  } = forest.process_obligations(\n    &mut C(\n      |obligation| {\n        match *obligation {\n          \"D'\" => {\n            d_count += 1;\n            ProcessResult::Error(\"operation failed\")\n          }\n          _ => unreachable!(),\n        }\n      },\n      |_| {}\n    )\n  );\n  let adjusted_span = (|| {\n    if\n      let ExprKind::Block { body } = &expr.kind &&\n      let Some(tail_ex) = body.expr\n    {\n      let mut expr = &this.thir[tail_ex];\n      while\n        let\n        | ExprKind::Block { body: Block { expr: Some(nested_expr), .. } }\n        | ExprKind::Scope { value: nested_expr, .. } = expr.kind\n      {\n        expr = &this.thir[nested_expr];\n      }\n      this.block_context.push(BlockFrame::TailExpr {\n        tail_result_is_ignored: true,\n        span: expr.span,\n      });\n      return Some(expr.span);\n    }\n    None\n  })();\n  match (test.end, pat.end, lo, hi) {\n    // pat < test\n    | (_, _, Greater, _)\n    | (_, Excluded, Equal, _)\n    // pat > test\n    | (_, _, _, Less) // <-\n    | (Excluded, _, _, Equal) => Some(true),\n    _ => Some(false),\n  }\n  let overlaps: Vec<_> = pats\n    .filter_map(|pat| Some((pat.ctor().as_int_range()?, pat.span())))\n    .filter(|(range, _)| self.suspicious_intersection(range))\n    .map(|(range, span)| (self.intersection(&range).unwrap(), span))\n    .collect();\n  match bb_data.terminator().kind {\n    (JustBefore(n), JustBefore(m)) if n < m => n..=m - 1,\n    (JustBefore(n), AfterMax) => n..=u128::MAX,\n    _ => unreachable!(), // Ruled out by the sorting and filtering we did\n    (Some(to), Some(from)) => {\n      (from == Ordering::Greater || from == Ordering::Equal) &&\n        (to == Ordering::Less ||\n          (other_end == self_end && to == Ordering::Equal));\n    }\n    Return | Resume | Abort | GeneratorDrop | Unreachable => {}\n\n    Goto { target } => propagate(target, exit_state),\n\n    | Assert { target, cleanup: unwind, expected: _, msg: _, cond: _ }\n    | Drop { target, unwind, place: _ }\n    | DropAndReplace { target, unwind, value: _, place: _ }\n    | FalseUnwind { real_target: target, unwind } => {\n      if let Some(unwind) = unwind {\n        if dead_unwinds.map_or(true, |dead| !dead.contains(bb)) {\n          propagate(unwind, exit_state);\n        }\n      }\n\n      propagate(target, exit_state);\n    }\n    | mir::Rvalue::Ref(_, mir::BorrowKind::Mut { .. }, place)\n    | mir::Rvalue::AddressOf(_, place) => (self.0)(place),\n\n    _ => {}\n    | suggestion_kind @ \"suggestion\"\n    | suggestion_kind @ \"suggestion_short\"\n    | suggestion_kind @ \"suggestion_hidden\"\n    | suggestion_kind @ \"suggestion_verbose\" => {\n      let (span, applicability) = (|| {\n        match &info.ty {\n          ty @ syn::Type::Path(..) if\n            type_matches_path(ty, &[\"rustc_span\", \"Span\"])\n          => {\n            let binding = &info.binding.binding;\n            Ok((\n              quote!(*#binding),\n              quote!(rustc_errors::Applicability::Unspecified),\n            ))\n          }\n          _ =>\n            throw_span_err!(\n              info.span.unwrap(),\n              \"wrong field type for suggestion\",\n              |diag| {\n                diag.help(\n                  \"#[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)\"\n                )\n              }\n            ),\n        }\n      })()?;\n      for arg in list.nested.iter() {\n        if\n          let syn::NestedMeta::Meta(syn::Meta::NameValue(arg_name_value)) = arg\n        {\n          if\n            let syn::MetaNameValue { lit: syn::Lit::Str(s), .. } =\n              arg_name_value\n          {\n            let name = arg_name_value.path.segments\n              .last()\n              .unwrap()\n              .ident.to_string();\n            let name = name.as_str();\n            let formatted_str = self.build_format(&s.value(), arg.span());\n            match name {\n              \"message\" => {\n                msg = Some(formatted_str);\n              }\n              \"code\" => {\n                code = Some(formatted_str);\n              }\n              other =>\n                throw_span_err!(\n                  arg.span().unwrap(),\n                  &format!(\"`{}` is not a valid key for `#[suggestion(...)]`\", other)\n                ),\n            }\n          }\n        }\n      }\n      let msg = if let Some(msg) = msg {\n        quote!(#msg.as_str())\n      } else {\n        throw_span_err!(\n          list.span().unwrap(),\n          \"missing suggestion message\",\n          |diag| {\n            diag.help(\n              \"provide a suggestion message using #[suggestion(message = \\\"...\\\")]\"\n            )\n          }\n        );\n      };\n      let code = code.unwrap_or_else(|| quote! { String::new() });\n      quote! {\n\t\t\t\t#diag.#suggestion_method(#span, #msg, #code, #applicability);\n\t\t\t}\n    }\n    other =>\n      throw_span_err!(\n        list.span().unwrap(),\n        &format!(\"invalid annotation list `#[{}(...)]`\", other)\n      ),\n    _ => {\n      self.failed |= !(self.cb)(expr);\n    }\n  }\n  ListItem {\n    pre_comment,\n    pre_comment_style,\n    item: if self.inner.peek().is_none() && self.leave_last {\n      None\n    } else {\n      (self.get_item_string)(&item)\n    },\n    post_comment,\n    new_lines,\n  };\n  comment_len(item.pre_comment.as_ref().map(|x| &(*x)[..])) +\n    comment_len(item.post_comment.as_ref().map(|x| &(*x)[..])) +\n    item.item.as_ref().map_or(0, |s| unicode_str_width(s));\n  Some(match rel {\n    Rel::Lt => {\n      match (lx, rx) {\n        (Some(l @ ExtremeExpr { which: Maximum, .. }), _) => (l, AlwaysFalse), // max < x\n        (_, Some(r @ ExtremeExpr { which: Minimum, .. })) => (r, AlwaysFalse), // x < min\n        _ => {\n          return None;\n        }\n      }\n    }\n    Rel::Le => {\n      match (lx, rx) {\n        (Some(l @ ExtremeExpr { which: Minimum, .. }), _) => (l, AlwaysTrue), // min <= x\n        (Some(l @ ExtremeExpr { which: Maximum, .. }), _) =>\n          (l, InequalityImpossible), // max <= x\n        (_, Some(r @ ExtremeExpr { which: Minimum, .. })) =>\n          (r, InequalityImpossible), // x <= min\n        (_, Some(r @ ExtremeExpr { which: Maximum, .. })) => (r, AlwaysTrue), // x <= max\n        _ => {\n          return None;\n        }\n      }\n    }\n    Rel::Ne | Rel::Eq => {\n      return None;\n    }\n  });\n  pat.each_binding_or_first(\n    &mut (|_, id, span, _| {\n      match\n        cx.typeck_results().extract_binding_mode(cx.sess(), id, span).unwrap()\n      {\n        BindingMode::BindByValue(_) if\n          !is_copy(cx, cx.typeck_results().node_type(id))\n        => {\n          capture = CaptureKind::Value;\n        }\n        BindingMode::BindByReference(Mutability::Mut) if\n          capture != CaptureKind::Value\n        => {\n          capture = CaptureKind::Ref(Mutability::Mut);\n        }\n        _ => (),\n      }\n    })\n  );\n  for (parent_id, parent) in cx.tcx.hir().parent_iter(e.hir_id) {\n    if\n      let [\n        Adjustment {\n          kind: Adjust::Deref(_) | Adjust::Borrow(AutoBorrow::Ref(..)),\n          target,\n        },\n        ref adjust @ ..,\n      ] = *cx\n        .typeck_results()\n        .adjustments()\n        .get(child_id)\n        .map_or(&[][..], |x| &**x)\n    {\n      if\n        let\n        | rustc_ty::RawPtr(TypeAndMut { mutbl: mutability, .. })\n        | rustc_ty::Ref(_, _, mutability) = *adjust\n          .last()\n          .map_or(target, |a| a.target)\n          .kind()\n      {\n        return CaptureKind::Ref(mutability);\n      }\n    }\n  }\n  while\n    let Some(higher::IfOrIfLet { cond, then, r#else }) =\n      higher::IfOrIfLet::hir(expr)\n  {\n    if let Some(else_expr) = r#else {\n      expr = else_expr;\n    } else {\n      break;\n    }\n  }\n  let lorem = vec![\n    \"ipsum\",\n    \"dolor\",\n    \"sit\",\n    \"amet\",\n    \"consectetur\",\n    \"adipiscing\",\n    \"elit\"\n  ];\n  let hyper = Arc::new(\n    Client::with_connector(HttpsConnector::new(TlsClient::new()))\n  );\n  {\n    {\n      let creds = self.client.client_credentials(\n        &self.config.auth.oauth2.id,\n        &self.config.auth.oauth2.secret\n      )?;\n    }\n  }\n  given(r#\"\n        # Getting started\n        ...\n    \"#).running(waltz);\n  conn.query_row(\n    r#\"\n            SELECT title, date\n            FROM posts,\n            WHERE DATE(date) = $1\n        \"#,\n    &[],\n    |row| {\n      Post {\n        title: row.get(0),\n        date: row.get(1),\n      }\n    }\n  )?;\n  ThreadPool::new(Configuration::new().num_threads(1))\n    .unwrap()\n    .install(|| {\n      scope(|s| {\n        use std::sync::mpsc::channel;\n        let (tx, rx) = channel();\n        let a = s.spawn_future(\n          lazy(move || Ok::<usize, ()>(rx.recv().unwrap()))\n        );\n        //                          ^^^^ FIXME: why is this needed?\n        let b = s.spawn_future(a.map(|v| v + 1));\n        let c = s.spawn_future(b.map(|v| v + 1));\n        s.spawn(move |_| tx.send(20).unwrap());\n        result = Some(c.rayon_wait().unwrap());\n      });\n    });\n  bootstrap.checks.register(\"PERSISTED_LOCATIONS\", move || (\n    if locations2.0.inner_mut.lock().poisoned {\n      Check::new(\n        State::Error,\n        \"Persisted location storage is poisoned due to a write failure\"\n      )\n    } else {\n      Check::new(State::Healthy, \"Persisted location storage is healthy\")\n    }\n  ));\n  self\n    .cur_type()\n    .num_template_args()\n    .or_else(|| {\n      let n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };\n\n      if n >= 0 {\n        Some(n as u32)\n      } else {\n        debug_assert_eq!(n, -1);\n        None\n      }\n    })\n    .or_else(|| {\n      let canonical = self.canonical();\n      if canonical != *self {\n        canonical.num_template_args()\n      } else {\n        None\n      }\n    });\n\n  if let VrMsg::ClientReply { request_num: reply_req_num, value, .. } = msg {\n    let _ = safe_assert_eq!(reply_req_num, request_num, op);\n    return Ok((request_num, op, value));\n  }\n  pub struct FileInput {\n    input: StringInput,\n    file_name: OsString,\n  }\n  match len {\n    Some(len) => Ok(new(self.input, self.pos + len)),\n    None => Err(self),\n  }\n}\nfn x() {\n  {\n    let type_list: Vec<_> = try_opt!(\n      types\n        .iter()\n        .map(|ty| ty.rewrite(context, shape))\n        .collect()\n    );\n  }\n}\nimpl Foo {\n  fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {\n    unsafe {\n      Vector2f::from_raw(\n        ffi::sfRenderTexture_mapPixelToCoords(\n          self.render_texture,\n          point.raw(),\n          view.raw()\n        )\n      )\n    }\n  }\n}\n\nextern \"C\" {\n  pub fn GetConsoleHistoryInfo(\n    console_history_info: *mut ConsoleHistoryInfo\n  ) -> Boooooooooooooool;\n  pub fn variadic_fn(\n    first_parameter: FirstParameterType,\n    second_parameter: SecondParameterType,\n    ...\n  ); // no trailing comma\n}\n\nfn deconstruct(\n  foo: Bar\n) -> (\n  SocketAddr,\n  Header,\n  Method,\n  RequestUri,\n  HttpVersion,\n  AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,\n) {\n  let if_method_break: SocketAddr = (\n    if remote_addr.is_ipv4() {\n      \"0.0.0.0:0\"\n    } else {\n      \"[::]:0\"\n    }\n  ).parse()?;\n  let method_chain_middle_await_break = reader\n    .next_line().await\n    .unwrap_or_else(|_| Some(String::new()))\n    .expect(\"failed to read line\");\n}\n\nfn needs_paren(op: AssocOp, other: AssocOp, dir: Associativity) -> bool {\n  other.precedence() < op.precedence() ||\n    (other.precedence() == op.precedence() &&\n      ((op != other && associativity(op) != dir) ||\n        (op == other && associativity(op) != Associativity::Both))) ||\n    (is_shift(op) && is_arith(other)) ||\n    (is_shift(other) && is_arith(op))\n}\n\npub fn peel_blocks<'a>(mut expr: &'a Expr<'a>) -> &'a Expr<'a> {\n  while\n    let ExprKind::Block(\n      Block {\n        stmts: [],\n        expr: Some(inner),\n        rules: BlockCheckMode::DefaultBlock,\n        ..\n      },\n      _,\n    ) = expr.kind\n  {\n    expr = inner;\n  }\n  expr\n}\n\npub fn target_features(sess: &Session) -> Vec<Symbol> {\n  supported_target_features(sess)\n    .iter()\n    .filter_map(|&(feature, gate)| {\n      if sess.is_nightly_build() || gate.is_none() {\n        Some(feature)\n      } else {\n        None\n      }\n    })\n    .filter(|_feature| {\n      // TODO(antoyo): implement a way to get enabled feature in libgccjit.\n      false\n    })\n    .map(|feature| Symbol::intern(feature))\n    .collect()\n}\n\nfn a() {\n  Arc::new(|_| { Ok(()) })\n}\nfn g<'a>(&self, x: usize, y: usize) -> Box<dyn (Fn(bool) -> usize) + 'a> {\n  let f = move |t: bool| if t { x } else { y };\n  return Box::new(f);\n}\n\nstruct Compose<F, G>(F, G);\nimpl<T, F, G> FnOnce<(T,)>\n  for Compose<F, G>\n  where F: FnOnce<(T,)>, G: FnOnce<(F::Output,)>\n{\n  type Output = G::Output;\n  extern \"rust-call\" fn call_once(self, (x,): (T,)) -> G::Output {\n    (self.1)((self.0)(x))\n  }\n}\n\nfn build_sorted_static_get_entry_names(\n  mut entries: Vec<(u8, &'static str)>\n) -> impl (Fn(\n  AlphabeticalTraversal,\n  Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>\n) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>) +\n  Send +\n  Sync +\n  'static {}\nfn qcxbfds() {\n  {\n    {\n      {\n        let explicit_arg_decls = explicit_arguments\n          .into_iter()\n          .enumerate()\n          .map(|(index, (ty, pattern))| {\n            let lvalue = Lvalue::Arg(index as u32);\n            block = this.pattern(\n              block,\n              argument_extent,\n              hair::PatternRef::Hair(pattern),\n              &lvalue\n            );\n            ArgDecl { ty: ty }\n          });\n      }\n    }\n  }\n}\n\n#[print_target_and_args(first_outer)]\n#[print_target_and_args(second_outer)]\nimpl Bar<{ 1 > 0 }> for Foo<{ true }> {\n  #![print_target_and_args(first_inner)]\n  #![print_target_and_args(second_inner)]\n}\n\n/// `cfg(...)`'s that are feature gated.\nconst GATED_CFGS: &[GatedCfg] = &[\n  // (name in cfg, feature, function to check if the feature is enabled)\n  (sym::target_abi, sym::cfg_target_abi, cfg_fn!(cfg_target_abi)),\n  (\n    sym::target_thread_local,\n    sym::cfg_target_thread_local,\n    cfg_fn!(cfg_target_thread_local),\n  ),\n  (\n    sym::target_has_atomic_equal_alignment,\n    sym::cfg_target_has_atomic_equal_alignment,\n    cfg_fn!(cfg_target_has_atomic_equal_alignment),\n  ),\n  (\n    sym::target_has_atomic_load_store,\n    sym::cfg_target_has_atomic,\n    cfg_fn!(cfg_target_has_atomic),\n  ),\n  (sym::sanitize, sym::cfg_sanitize, cfg_fn!(cfg_sanitize)),\n  (sym::version, sym::cfg_version, cfg_fn!(cfg_version)),\n];\n[\n  {\n    while\n      let Ok(flag) = input.try_parse(|input| {\n        Ok(\n          match_ignore_ascii_case! { &input.expect_ident().map_err(|_| ())?,\n\t\t\t\t\t\"jis78\" =>\n\t\t\t\t\t\texclusive_value!((result, VariantEastAsian::JIS78 | VariantEastAsian::JIS83 |\n\t\t\t\t\t\t\t\t\t\t\t\tVariantEastAsian::JIS90 | VariantEastAsian::JIS04 |\n\t\t\t\t\t\t\t\t\t\t\t\tVariantEastAsian::SIMPLIFIED | VariantEastAsian::TRADITIONAL\n\t\t\t\t\t\t\t\t\t\t) => VariantEastAsian::JIS78)\n\t\t\t\t\t_ => return Err(()),\n\t\t\t\t}\n        )\n      })\n    {\n      result.insert(flag);\n    }\n  },\n];\n\n#[cfg_attr(doc_cfg, doc(cfg(feature = \"beep boop\")))]\nimpl Foo for Bar {\n  fn stuff(data: Leet) -> Result<Self> {\n    let manual_clone = node.data == Data::Private || node.ident == \"beep\";\n    if data.boop(Foo) && !(data.boop(Bar) && data.boop2(Too![=])) {\n      data.stuff().map(A::B);\n    } else if\n      data.boop(Ident::abc) ||\n      (data.boop(Too![::]) && data.boop3(Ident::abc))\n    {\n      data.stuff().map(NestedMeta::Meta);\n    } else {\n      Err(data.error(\"brrr\"));\n    }\n    s.match_indices(prefix).any(|(i, _)| {\n      s[i + prefix.len()..].trim_start_matches('[')\n    });\n    if args.len() >= 2 && args[1] == \"fail\" {\n      foo();\n    } else if args.len() >= 2 && args[1] == \"double-fail\" {\n      double();\n    } else {\n      runtest(&args[0]);\n    }\n  }\n}\n\nimpl<T1, F1, T2, F2, T3, F3, E> Future\n  for TryJoin3<F1, F2, F3>\n  where\n    F1: Future<Output = Result<T1, E>>,\n    F2: Future<Output = Result<T2, E>>,\n    F3: Future<Output = Result<T3, E>>\n{\n  fn c() {}\n}\n\nc! {\n  impl<E: A> A<E> {\n    //\n    pub(crate) unsafe fn no_extra_indent_in_params<'a>(\n      &'a self,\n      cx: &mut Context<'_>,\n      buf: &mut ReadBuf<'_>\n    ) -> Poll<io::Result<()>>\n      where &'a E: io::Read + 'a {}\n  }\n  pub trait AsyncBufReadExt: AsyncBufRead {\n    fn read_until<'a>(\n      &'a mut self,\n      byte: u8,\n      buf: &'a mut Vec<u8>\n    ) -> ReadUntil<'a, Self>\n      where Self: Unpin\n    {\n      read_until(self, byte, buf)\n    }\n  }\n}\n\nlet BufWriter {\n  inner: BufReader { inner, buf: rbuf, pos, cap, seek_state: rseek_state },\n  buf: wbuf,\n  written,\n  seek_state: wseek_state,\n} = b;\n\n{\n  {\n    fn clock() {\n      match\n        CONTEXT.try_with(|ctx|\n          (*ctx.borrow()).as_ref().map(|ctx| ctx.as_inner().clock.clone())\n        )\n      {\n      }\n      match\n        s\n          .match_indices(prefix)\n          .any(|(i, _)| { s[i + prefix.len()..].trim_start_matches('[') })\n      {\n      }\n      match\n        a && //\n        b\n      {\n      }\n    }\n  }\n}\n\npub(super) fn shutdown(self) {\n  let (task1, _) = super::unowned(async {});\n  let (task2, _) = super::unowned(async { 1 });\n  let (task3, _) = super::unowned(async {\n    f();\n    2\n  });\n  let vtable = self.header().vtable;\n  unsafe { (vtable.shutdown)(self.ptr) }\n}\n\nfn inlining_last_if_else_block_is_awkward() {\n  poll_fn(move |cx| {\n    if !fired {\n      return Poll::Pending;\n    }\n\n    if gate.load(SeqCst) {\n      Poll::Ready\n    } else {\n      Poll::Pending\n    }\n  })\n}\n\npub(super) fn vtable<T: Future, S: Schedule>() -> &'static Vtable {\n  &(Vtable {\n    poll: poll::<T, S>,\n    dealloc: dealloc::<T, S>,\n    try_read_output: try_read_output::<T, S>,\n    try_set_join_waker: try_set_join_waker::<T, S>,\n    drop_join_handle_slow: drop_join_handle_slow::<T, S>,\n    drop_abort_handle: drop_abort_handle::<T, S>,\n    remote_abort: remote_abort::<T, S>,\n    shutdown: shutdown::<T, S>,\n  })\n}\n\n// comment\nconst ________________ =\n  self.exp != S::MIN_EXP && (self.sig[0] & sig_mask) == 0;\n\nlet r = if s.starts_with(\"0x\") || s.starts_with(\"0X\") {\n  zzzzzzzzzzzzzz\n} else {\n  2\n};\n\npub trait Float: Copy +\n  Default +\n  FromStr<Err = ParseError> +\n  PartialOrd +\n  fmt::Display +\n  Neg<Output = Self> +\n  AddAssign +\n  SubAssign +\n  MulAssign +\n  DivAssign +\n  RemAssign +\n  Add<Output = StatusAnd<Self>> +\n  Sub<Output = StatusAnd<Self>> +\n  Mul<Output = StatusAnd<Self>> +\n  Div<Output = StatusAnd<Self>> +\n  Rem<Output = StatusAnd<Self>>\n{\n  const BITS: usize;\n}\n\n// print-width: 80 -------------------------------------------------------------\n\nfn space_before_where</**/>(_: F) where F: X {}\n\nimpl<'a, I, T: 'a, E> Iterator\n  for Y<'a, I, E>\n  where I: Iterator<Item = &'a (T, E)> {}\n\nimpl<'a, I, T: 'a, E> IteratorIterator\n  for Y<'a, I, E>\n  where I: Iterator<Item = &'a (T, E)> {}\n\nimpl<'a, I, T: 'a, E> Iterator\n  for Y<'a, I, E>\n  where I: Iterator<Item = &'a (T, E)>\n{\n  type Y;\n}\n\nprettier_always_breaks_this(\n  b(|| ()),\n  c\n);\n\nself\n  .and_this()\n  .map(|| 1)\n  .unwrap_or(0);\n\npub fn noop_visit_constraint<T: MutVisitor>(\n  AssocConstraint { id, ident, gen_args, kind, span }: &mut AssocConstraint,\n  vis: &mut T\n) {}\n\nmatch kind {\n  AssocConstraintKind::Equality { ref mut term } => {\n    1;\n  }\n}\n\nimpl X {\n  pub fn ident(&self) -> Option<Ident> {\n    match self.kind {\n      AttrKind::Normal(ref item, _) => {\n        if item.path.segments.len() == 1 {\n          Some(item.path.segments[0].ident)\n        } else {\n          None\n        }\n      }\n      AttrKind::DocComment(..) => None,\n    }\n  }\n}\n\n#![attr] // comment to the right of attr\n\n/*\n */\n\na!(/**/);\n\nThing(/* _______ */);\npub const /* _______ */ a = {};\n\nconst a = \"💖\";\n// ______________\n// _______ _______ _______\n\n/*\n _______\n*/ foo /*\n _______\n*/;\n\nthis.call(a, /* _______ */ b);\n\n/*\nfoo\n\ntext\n*/\n\n/*\nfn a() {\n    println!(\"b\");\n}\n// */\n\n#[a = \"a\"]\n#[b] // v\n#[cfg_attr(rustfmt, rustfmt::skip)]\npub static x: [i32; 0] = [];\n\nf!() /* comment */;\nf! {} /* comment */\nf![] /* comment */;\n\npub enum Foo {\n  A, // `/** **/`\n  B, // `/*!`\n  C,\n}\n\nProcessSystemError(A {\n  code: acc.error.code, // _______\n  originalError: acc.error, // _______\n});\n\nfoo(\n  A {}\n  // _______\n);\n\nfn c() {} /*\n          a\n\n          b\n          */\n\nconst f = static async |source, block, opts| {\n  for entry in source {\n    yield async move || {\n      const cid = persist(entry.content.serialize(), block, opts).await;\n      return A {\n        cid,\n        path: entry.path,\n        unixfs: UnixFS.unmarshal(entry.content.Data),\n        node: entry.content,\n      };\n    };\n  }\n};\n\ntype Expect_Parenthesized_dyn = Pin<&mut (dyn Future<Output = T> + Send)>;\n\nlet mut Expect_Comma_after_first_match = match 0 {\n  RuntimeFlavor::CurrentThread =>\n    quote_spanned! {last_stmt_start_span=>\n        #crate_ident::runtime::Builder::new_current_thread()\n    },\n  RuntimeFlavor::Threaded =>\n    quote_spanned! {last_stmt_start_span=>\n        #crate_ident::runtime::Builder::new_multi_thread()\n    },\n};\n\nExpectNoSpreadComma {\n  ..a //\n};\nExpectNoSpreadComma {\n  ..a //\n};\nExpectNoSpreadComma {\n  a,\n  b: b,\n  ..c //\n};\nExpectNoSpreadComma {\n  a,\n  b: b,\n  ..c //\n};\nExpectNoSpreadComma {\n  a, //\n  ..\n};\nExpectNoSpreadComma {\n  .. //\n};\n\nlet notify::event::Event {\n  kind: notify::event::EventKind::Modify(_),\n  paths,\n  ..\n} = event;\n\nlet notify::event::Event {\n  kind: notify::event::EventKind::Modify(_),\n  paths,\n  ..\n} = event;\n\n// source: \"../../samples/issues/0.rs\""
  },
  {
    "path": "tests/output/issues/14.f.rs",
    "content": "[10.0, 10.0, 10.0, 10];\n\n// source: \"../../samples/issues/14.rs\""
  },
  {
    "path": "tests/output/issues/21/fn_comment.f.rs",
    "content": "fn eof() {}\n// comment\n\n// source: \"../../../samples/issues/21/fn_comment.rs\""
  },
  {
    "path": "tests/output/issues/21/fn_fn.f.rs",
    "content": "fn eof1() {}\nfn eof2() {}\n\n// source: \"../../../samples/issues/21/fn_fn.rs\""
  },
  {
    "path": "tests/output/issues/21/fn_ln.f.rs",
    "content": "fn eof() {}\n\n// source: \"../../../samples/issues/21/fn_ln.rs\""
  },
  {
    "path": "tests/output/issues/21/ln_fn_ln.f.rs",
    "content": "fn eof() {}\n\n// source: \"../../../samples/issues/21/ln_fn_ln.rs\""
  },
  {
    "path": "tests/output/issues/21/mod.f.rs",
    "content": "mod eof {}\n\n// source: \"../../../samples/issues/21/mod.rs\""
  },
  {
    "path": "tests/output/issues/22.f.rs",
    "content": "fn preserve_last_semicolon() {\n  if let Some(left) = node.borrow().left.as_ref() {\n    deque.push_back(left.clone());\n  }\n  if let Some(right) = node.borrow().right.as_ref() {\n    deque.push_back(right.clone());\n  };\n}\n\nfn a() {\n  if let Ok(_) = lock.try_lock() {\n  };\n}\n\nfn b() {\n  let lock = std::sync::Mutex::new(10);\n  match lock.try_lock() {\n    Ok(_) => {}\n    Err(_) => {}\n  }\n  match lock.try_lock() {\n    Ok(_) => {}\n    Err(_) => {}\n  };\n}\n\nfn c() {\n  if let Ok(_) = lock.try_lock() {\n  };\n  // comment\n}\n\nfn d() {\n  if let Ok(_) = lock.try_lock() {\n  }; // comment\n}\n\nfn e() {\n  if let Ok(_) = lock.try_lock() {\n  } /** comment */;\n}\n\nfn f() {\n  if let Ok(_) = lock.try_lock() {\n  };\n}\n\nfn g() {\n  if let Ok(_) = lock.try_lock() {\n  };\n  // comment\n}\n\nfn h() {\n  if let Ok(_) = lock {\n  }\n  if let Ok(_) = lock {\n  }\n}\n\nfn i() {\n  match lock {\n  }\n  match lock {\n  }\n}\n\nfn inner_attr() {\n  if let Ok(_) = lock.try_lock() {\n  }\n  #![attr]\n}\n\n// source: \"../../samples/issues/22.rs\""
  },
  {
    "path": "tests/output/issues/25.f.rs",
    "content": "#[generator(yield(i32))]\nfn nums() {\n  yield_!(3);\n}\n\n// some extra samples to track changes\n#[// 0\ngenerator(\n  // 1\n  // 2\n  yield(\n    // 3\n    // 4\n    i32\n    // 5\n  )\n  // 6\n)]\n// 7\n\n// non-conventional syntax (does not format)\n#[#[a] generator(  #[b] yield(  #[c] i32  ))]\n#[generator  (a(  #[generator(b(i32))]   i32  )  )]\n#[generator  (a(  #[generator(yield(i32))]   i32  )  )]\n#[generator  (yield(  #[generator(b(i32))]   i32  )  )]\n#[generator  (yield(  #[generator(yield(i32))]   i32  )  )]\nfn f() {\n  yield_!(3);\n}\n\n// macros in attr (does not format)\n#[attr(foo!(   ))]\nfn f() {}\n\n// source: \"../../samples/issues/25.rs\""
  },
  {
    "path": "tests/output/issues/nth-pass.f.1.rs",
    "content": "// prettier for javascript cannot format those in one pass\n\nreturn (\n  // _______\n  42 * 84 + 2\n);\nreturn (\n  // _______\n  42 + 84 * 2\n);\n\nfoo.x.y // comment after parent // foo\n  // comment 1\n  .bar() // comment after bar()\n  // comment 2\n  .foobar // comment after\n  // comment 3\n  .baz(x, y, z);\n\nlet zzzz =\n  // comment 0\n  expr?.another???.another????.another?.another?; // comment after parent // comment 1 // comment 2 // comment 3\n\n[\n  {\n    a = b;\n  },\n\n  c, //\n];\n\n// format: lost 4 comments\n// source: \"../../samples/issues/nth-pass.rs\""
  },
  {
    "path": "tests/output/issues/nth-pass.f.rs",
    "content": "// prettier for javascript cannot format those in one pass\n\nreturn (\n  // _______\n  42 *\n    84 +\n  2\n);\nreturn (\n  // _______\n  42 +\n  84 * 2\n);\n\nfoo// comment after parent // foo\n.x.y\n  // comment 1\n  .bar() // comment after bar()\n  // comment 2\n  .foobar// comment after\n  // comment 3\n  .baz(x, y, z);\n\nlet zzzz =\n  // comment 0\n  expr?.another???.another????.another?.another?; // comment after parent // comment 1 // comment 2 // comment 3\n\n[\n  {\n    a = b;\n  },\n\n  c, //\n];\n\n// format: lost 4 comments\n// source: \"../../samples/issues/nth-pass.rs\""
  },
  {
    "path": "tests/output/macros/cfg_if.f.rs",
    "content": "[\n  cfg_if! {\n    if #[cfg(def)] {\n      use std;\n      0\n    }\n  },\n  cfg_if! {\n    if #[cfg(def)] {\n      use std;\n      0\n    } else {\n      1\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] { 0 } else { 1 }\n  },\n  cfg_if! {\n    if #[cfg(abc)] { 0 } else if #[cfg(def)] { 1 }\n  },\n  cfg_if! {\n    if #[cfg(abc)] { 0 } else if #[cfg(def)] { 1 } else { 0 }\n  },\n\n  cfg_if! {},\n  cfg_if! { // comment\n    if #[cfg(abc)] {\n      0\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] {\n      /// comment\n      /// comment\n      /// comment\n      struct A {\n        //! comment\n        a: u8,\n      }\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] {\n      struct A {\n        //! comment\n        // comment\n        /// comment\n        a: u8,\n      }\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] {\n      struct A {\n        /// comment\n        a: u8,\n      }\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] {\n      struct A {\n        //! comment\n      }\n    }\n  },\n  cfg_if! {\n    if #[cfg(abc)] {\n      struct A {\n        /// comment\n      }\n    }\n  },\n  cfg_if! { if true{} },\n];\n\n// source: \"../../samples/macros/cfg_if.rs\""
  },
  {
    "path": "tests/output/macros/if_chain.f.rs",
    "content": "[\n  if_chain! {\n\t\tif let Some(a) = b;\n\t\tif let Err(a) = b;\n\t\tlet (a, b) = c;\n\t\tif 1 + 2;\n\t\tthen { d=0; }\n\t},\n  if_chain! {\n\t\tthen { d=0; }\n\t},\n  if_chain! {\n\t\tthen { d=0; }\n\t\telse { d!(); }\n\t},\n  if_chain! {\n\t\tif let A::B | A::C = D;\n\t\tthen { 0 } else { 1 }\n\t},\n  if_chain! {\n\t\tlet Ok(a) | Err(b) = c;\n\t\tthen { d!(); }\n\t\telse { d!(); }\n\t},\n  if_chain! {\n\t\tif 1 + 1;\n\t\tlet a: u32 = 3;\n\n\t\tthen { d!(); }\n\t\telse { d!(); }\n\t},\n];\n\n// source: \"../../samples/macros/if_chain.rs\""
  },
  {
    "path": "tests/output/macros/matches.f.rs",
    "content": "[\n  matches!(1 + 1, Some(_)),\n  matches!(1 + 1,   Some(_) | None if 1 + 1 == 2),\n  matches!(1 + 1, | Some(_) | None if 1 + 1 == 2),\n];\n\n// source: \"../../samples/macros/matches.rs\""
  },
  {
    "path": "tests/output/styling/blockify.f.rs",
    "content": "[\n  || 0,\n  || {\n    match 0 {\n    }\n  },\n  || (\n    if 0 {\n    }\n  ),\n  || {\n    loop {\n    }\n  },\n  || const {},\n  || async {},\n\n  || -> T { 0 },\n  || -> T {\n    match 0 {\n    }\n  },\n  || -> T {\n    if 0 {\n    }\n  },\n  || -> T {\n    loop {\n    }\n  },\n  || -> T const {},\n  || -> T async {},\n];\n\n// source: \"../../samples/styling/blockify.rs\""
  },
  {
    "path": "tests/output/styling/canInlineBlockBody.f.rs",
    "content": "[\n  {\n    if 0 {\n      0\n    }\n  },\n  {\n    if 0 { 0 } else { 0 }\n  },\n  {\n    while 0 {\n      0;\n    }\n  },\n  {\n    unsafe { 0 }\n  },\n\n  {\n    0;\n    if 0 {\n      0\n    }\n  },\n  {\n    0;\n    if 0 {\n      0\n    } else {\n      0\n    }\n  },\n  {\n    0;\n    while 0 {\n      0;\n    }\n  },\n  {\n    0;\n    unsafe { 0 }\n  },\n\n  f(async {}),\n  f(async { 1 }),\n  f(async {\n    1;\n  }),\n\n  {\n    async {}\n  },\n  {\n    async { 1 }\n  },\n  {\n    async {\n      1;\n    }\n  },\n\n  {\n    0;\n    async {}\n  },\n  {\n    0;\n    async { 1 }\n  },\n  {\n    0;\n    async {\n      1;\n    }\n  },\n\n  if (0 as u8) < 1 {} else {},\n  {\n    0;\n    if (0 as u8) < 1 {\n    } else {\n    }\n  },\n  if (0 as u8) < 1 {} else if (0 as u8) < 1 {},\n\n  if 0 {\n  } else {\n    0;\n  },\n  if 0 {\n  } else if 1 {\n    0;\n  } else {\n  },\n  if 0 {\n  } else if 1 {\n  } else {\n    0;\n  },\n\n  if 0 {\n    0;\n  } else {\n  },\n\n  if 0 {\n    0;\n  } else {\n    2\n  },\n  if 0 {\n    2\n  } else {\n    0;\n  },\n\n  match 0 {\n    0 => 0,\n    0 => { 0 }\n  },\n\n  f(if 0 { 1 } else { 2 }),\n  f(\n    {\n      0;\n    },\n    if 0 {\n      1\n    } else {\n      2\n    }\n  ),\n  0 + (if 0 { 1 } else { 2 }),\n  { 0 + (if 0 { 1 } else { 2 }) },\n  ({\n    0;\n  }) + (if 0 { 1 } else { 2 }),\n\n  match 0 {\n    0 => {\n      break 0;\n    }\n    0 => {\n      o = 0;\n    }\n    0 =>\n      match 0 {\n      }\n    0 => if 0 {} else {}\n    0 => if 0 {\n    }\n  },\n\n  || {\n    loop {\n      match 0 {\n        0 => {\n          break 0;\n        }\n        0 => {\n          o = 0;\n        }\n        0 =>\n          match 0 {\n          }\n        0 => if 0 {} else {}\n        0 => if 0 {\n        }\n      }\n    }\n  },\n];\n\n// source: \"../../samples/styling/canInlineBlockBody.rs\""
  },
  {
    "path": "tests/output/styling/needsParens.f.rs",
    "content": "let (A {} | a() | []) = ();\nif let A {} | a() | [] = () {\n}\n\ntype A: B + C;\ntype A: (impl B + C);\n\ntrait A = B + C;\ntrait A = (impl B + C);\n\n// source: \"../../samples/styling/needsParens.rs\""
  },
  {
    "path": "tests/output/styling/needsSemi.f.rs",
    "content": "fn f() {\n  #[cfg(unix)]\n  {\n    0\n  }\n  #[cfg(windows)]\n  {\n    1\n  }\n}\n\n// source: \"../../samples/styling/needsSemi.rs\""
  },
  {
    "path": "tests/output-ext/errors/foo.rs",
    "content": "> Error.toString()\n> \n----------------------------------------------------------------------------------------------------\n  -1   \n       \n  1  | ~\n       ^ Unexpected End Of File, expected Expression\n  2    \n  3    \n----------------------------------------------------------------------------------------------------\nParserError at ext/jinx-rust/tests/samples/errors/foo.rs:1:1\n> inspect(Error)\n> Unexpected End Of File, expected Expression\n    at read_expression_lhs                   ext/jinx-rust/src/parser/read/expressions.ts:851:11\n    at fn                                    ext/jinx-rust/src/parser/read/expressions.ts:875:13\n    at ES_withPrecedence                          ext/jinx-rust/src/parser/state/index.ts:784:14\n    at ES_withContext                             ext/jinx-rust/src/parser/state/index.ts:777:14\n    at read_stmt_expression                   ext/jinx-rust/src/parser/read/expressions.ts:874:9\n    at ExpressionStatement.read                ext/jinx-rust/src/parser/read/statements.ts:78:22\n    at READ_NODE                            ext/jinx-rust/src/parser/state/constructor.ts:259:46\n    at ExpressionStatement.call              ext/jinx-rust/src/parser/state/constructor.ts:245:4\n    at read_expr_or_macroInvocation_stmt       ext/jinx-rust/src/parser/read/statements.ts:85:29\n    at read_statement                         ext/jinx-rust/src/parser/read/statements.ts:814:11\n    at EACH                                   ext/jinx-rust/src/parser/read/statements.ts:821:42\n    at fn                                         ext/jinx-rust/src/parser/state/index.ts:500:66\n    at with_outerAttributes                        ext/jinx-rust/src/parser/state/index.ts:957:9\n    at with_outerAttributes_fromStatementContext   ext/jinx-rust/src/parser/state/index.ts:975:9\n    at read_group_noDelim                         ext/jinx-rust/src/parser/state/index.ts:500:18\n                                                                             ...filtered 5 lines {\n  [stack]: 'Unexpected End Of File, expected Expression\\n' +\n    '    at \\x1B[36mread_expression_lhs\\x1B[39m                   \\x1B[90mext/jinx-rust/src/parser/read/expressions.ts:851:11\\x1B[39m\\n' +\n    '    at \\x1B[36mfn\\x1B[39m                                    \\x1B[90mext/jinx-rust/src/parser/read/expressions.ts:875:13\\x1B[39m\\n' +\n    '    at \\x1B[36mES_withPrecedence\\x1B[39m                          \\x1B[90mext/jinx-rust/src/parser/state/index.ts:784:14\\x1B[39m\\n' +\n    '    at \\x1B[36mES_withContext\\x1B[39m                             \\x1B[90mext/jinx-rust/src/parser/state/index.ts:777:14\\x1B[39m\\n' +\n    '    at \\x1B[36mread_stmt_expression\\x1B[39m                   \\x1B[90mext/jinx-rust/src/parser/read/expressions.ts:874:9\\x1B[39m\\n' +\n    '    at \\x1B[34mExpressionStatement.read\\x1B[39m                \\x1B[90mext/jinx-rust/src/parser/read/statements.ts:78:22\\x1B[39m\\n' +\n    '    at \\x1B[36mREAD_NODE\\x1B[39m                            \\x1B[90mext/jinx-rust/src/parser/state/constructor.ts:259:46\\x1B[39m\\n' +\n    '    at \\x1B[36mExpressionStatement.call\\x1B[39m              \\x1B[90mext/jinx-rust/src/parser/state/constructor.ts:245:4\\x1B[39m\\n' +\n    '    at \\x1B[36mread_expr_or_macroInvocation_stmt\\x1B[39m       \\x1B[90mext/jinx-rust/src/parser/read/statements.ts:85:29\\x1B[39m\\n' +\n    '    at \\x1B[36mread_statement\\x1B[39m                         \\x1B[90mext/jinx-rust/src/parser/read/statements.ts:814:11\\x1B[39m\\n' +\n    '    at \\x1B[36mEACH\\x1B[39m                                   \\x1B[90mext/jinx-rust/src/parser/read/statements.ts:821:42\\x1B[39m\\n' +\n    '    at \\x1B[36mfn\\x1B[39m                                         \\x1B[90mext/jinx-rust/src/parser/state/index.ts:500:66\\x1B[39m\\n' +\n    '    at \\x1B[36mwith_outerAttributes\\x1B[39m                        \\x1B[90mext/jinx-rust/src/parser/state/index.ts:957:9\\x1B[39m\\n' +\n    '    at \\x1B[36mwith_outerAttributes_fromStatementContext\\x1B[39m   \\x1B[90mext/jinx-rust/src/parser/state/index.ts:975:9\\x1B[39m\\n' +\n    '    at \\x1B[36mread_group_noDelim\\x1B[39m                         \\x1B[90mext/jinx-rust/src/parser/state/index.ts:500:18\\x1B[39m\\n' +\n    '\\x1B[90m                                                                             ...filtered 5 lines\\x1B[39m',\n  [message]: 'Unexpected End Of File, expected Expression',\n  loc: { url: 'ext/jinx-rust/tests/samples/errors/foo.rs:1:1', start: { line: 1, column: 1 } },\n  ctx: [ [length]: 0 ],\n  toString: <ref *1> [Function (anonymous)] { [length]: 0, [name]: '', [prototype]: { [constructor]: [Circular *1] } },\n  parserState: {\n    nodes: [ 'SourceFile (--1)', 'Program (...parsing)', 'ExpressionStatement (...parsing)', [length]: 3 ],\n    discarded_nodes: [ [length]: 0 ],\n    __ctx_Precedence: [ 0, 3, [length]: 2 ],\n    max_Precedence_depth: 20,\n    max_ES_ctx_depth: 12,\n    max_TY_depth: 12,\n    __es_optional_start: -1,\n    __ctx_ES_i: 1,\n    __ctx_ES_PRCD_i: 1,\n    __ctx_TY_i: 0,\n    __ctx_MC_i: 0\n  }\n}"
  },
  {
    "path": "tests/output-ext/expressions/block.f.rs",
    "content": "fn f() {\n  ({ foo.0 }).0 = 0;\n  (async {}).await;\n  async move {\n  }\n  ({ a }).0 += { 0 };\n  try {\n  }\n  match (try {}) {\n  }\n  for lhs in &mut self.0 {\n    *lhs += rhs;\n  }\n  for lhs in self.0.iter_mut() {\n  }\n  for _ in [1, 2, 3].into_iter() {\n  }\n  for elt in self {\n    r = r + f(*elt);\n  }\n  for _ in [1, 2] {\n  }\n  for _ in [1.0, 2.0] {\n  }\n  if (\n    loop {\n    }\n  ) {\n  }\n  if let 0 = 1 {\n  }\n  if a % 5 == 0 {\n  }\n  let x: A = if a % 5 == 0 {\n  };\n  let x = if let 0 = 1 {\n  };\n  if let 0 = 1 {\n    3;\n  }\n  if (\n    {\n      y = Foo { foo: x };\n    }\n  ) {\n  }\n  if q == \"\" {\n  }\n  if ('x' as char) < ('y' as char) {\n  } else {\n  }\n  let a = if 1 {\n    1\n  };\n  let a = if 1 { 0 } else if 1 { 0 };\n  let a = if (if 0 { 0 } else { 0 }) {\n    0\n  } else {\n    0\n  };\n  let a = if 0 {\n    if 0 { 0 } else { 0 }\n  } else {\n    0\n  };\n  let a = if 0 { 0 } else if 0 { 0 } else { 1 };\n  let a = if let 0 = (if let 0 = 0 { 0 } else { 0 }) { 0 } else { 0 };\n  for x in 0..10 {\n    (async { Some(x) }).await.unwrap();\n  }\n  for _ in 1.. {\n    call_forever();\n  }\n  unsafe {\n    (Foo { b: () }).a;\n  }\n  if 1 {\n  } else if let Some(a) = Some(1) {\n  }\n}\n[\n  m::Pub {\n    0: loop {\n    },\n  },\n  2_usize +\n    (loop {\n    }),\n  [\n    ();\n    &({\n      loop {\n        continue;\n      }\n    })\n  ],\n  [\n    ();\n    loop {\n      break;\n    }\n  ],\n  [\n    ();\n    {\n      while true {\n        break;\n      }\n      0\n    }\n  ],\n  [\n    ();\n    {\n      for _ in 0usize.. {\n      }\n      0\n    }\n  ],\n  unsafe { *&raw mut y },\n];\n\na::b(async move {\n  if let Err(e) = c(d).await {\n    f!(\"g: {}\", h);\n  }\n});\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/block.rs\""
  },
  {
    "path": "tests/output-ext/expressions/closure.f.rs",
    "content": "fn main() {\n  let lam = |(a, ref b, c, ref mut d): (X, X, X, X)| {};\n  let x = |_: ()| ();\n  let y = || x(());\n  let mut x = |_: ()| {\n    outer = 4;\n    ()\n  };\n  let x = move |_: ()| {\n    let inner = outer;\n    ()\n  };\n  const VTABLE: &'static VTable<DST> = &(VTable {\n    _to_dst_ptr: |_: *mut ()| unsafe { std::mem::zeroed() },\n  });\n  let z = a(&mut (|x| x - 22));\n  let mut unboxed = || {};\n  Box::new(move |y| { x + y });\n  s(\n    |f| (*f)(),\n    Box::new(|| {})\n  );\n  (0..42).e(|_x| {\n    match E(()) as R<(), _> {\n      O(()) => s.push(()),\n      E(_) => (),\n    }\n  });\n  <()>::a(|| ());\n  let f: &mut dyn FnMut<(_,), E = ()> = &mut (|_: <() as Lt<'_>>::T| {});\n  Box::new(move |v| {\n    (|_| e.d()())(v);\n    X\n  }) as Box<dyn Fn(i32) -> Q<i32>>;\n  let _c = || {\n    match b.0.c(1) as D<(), _> {\n      _ => 0,\n    }\n  };\n  let f: &dyn Fn(i32) -> _ = &(|x| x + x);\n  let f = |x: u32| -> u32 { 1 };\n  for f in &[d, g, |x| x] {\n    a!(\"{}\", f(6));\n  }\n  (|| {\n    (|| { c.d })();\n    (move || { a.b })();\n  })();\n  let q = a.e(async move { b(move || async move { d!() }) });\n  let g = {\n    || z(i)\n  };\n  let _ = || a.e(async { r });\n  let _ = E(0)\n    .d()\n    .q(|ref _a| true);\n  let _ = !(4..5).a(|x| (x == 1 || x == 3 || x == 5));\n  let _ = !(1..3).a(|x| [1, 2, 3].b(&x));\n  let _ = !(1..3).a(|x| (x == 0 || [1, 2, 3].b(&x)));\n  let _ = !(1..3).a(|x| ([1, 2, 3].b(&x) || x == 0));\n  let _ = !(1..3).a(\n    |x| ([1, 2, 3].b(&x) || x == 0 || [4, 5, 6].c(&x) || x == -1)\n  );\n  let hash: &Fn(&&Block) -> u64 = &(|block| -> u64 { 1 });\n  if\n    outer_guard.map_or(\n      true,\n      |(Guard::If(e) | Guard::IfLet(_, e))| !is_local_used(cx, *e, binding_id)\n    )\n  {\n  }\n  a = || b;\n  [\n    foo(|| ()),\n    |x: u32| x + 1,\n    (|| Box::new(|| {}) as Box<dyn Fn()>)(),\n    |_: T| 3,\n    move |x: isize, y| x + y + z,\n    &mut (|| 22),\n    &(|| 22),\n    || {\n      x += 1;\n    },\n    call(&(|| {}), ()),\n    <()>::drive(|| ()),\n    h2(|_: (), _: (), _: (), _: ()| {}),\n    move |a: isize, b| { a + b },\n    move |a: isize, b| {\n      z;\n      zz;\n      a + b\n    },\n    |x: usize| x * 2,\n    |x: usize| ({ x }) * 2,\n    |x: usize| ({ x })(),\n    |x| lib::d!(x),\n    |x| {\n      match x {\n        a => { g(a) }\n      }\n    },\n    |x| d!(x),\n    |_| async { () },\n    |x, y| {},\n    |x: &u64, y: &u64| {},\n    |x: &u64, y| {},\n    |x, y: &u64| {},\n    match 0 {\n      2 => |a| 2,\n      1 => 0,\n    },\n    [b, |a| 2],\n    [|a| 2, b],\n    async || 1,\n    |ctx: Ctx<(String, String)>| -> io::Result<Response> {\n      Ok(Response::new().with_body(ctx.params.0))\n    },\n    rayon::join(\n      || recurse(left, is_less, pred, limit),\n      || recurse(right, is_less, Some(pivot), limit)\n    ),\n    rayon::join(\n      1,\n      || recurse(left, is_less, pred, limit),\n      2,\n      || recurse(right, is_less, Some(pivot), limit)\n    ),\n  ];\n  bifornCringer = {\n    askTrovenaBeenaDepends = {\n      glimseGlyphs =\n        |argumentOne, argumentTwo, argumentThree| |restOfTheArguments12345678| {\n          return \"baz\";\n        };\n    };\n  };\n  aaaaaaaaaaaaaaaa.map(|x| {\n    x += 1;\n    x\n  }).filter;\n  let f = |x| {\n    {\n      {\n        { x }\n      }\n    }\n  };\n  let f = |x| {\n    {\n      { x }\n    }\n  };\n  let f = |x| {\n    { x }\n  };\n  let f = |x| { x };\n  let f = |x| x;\n}\n\nfn f(_n: isize) -> isize {\n  id(|| { 1 }) - 0\n}\nfn f() {\n  || {\n    x += y;\n  }\n}\nstruct A {\n  b: [\n    ();\n    match || 1 {\n      a => 0,\n    }\n  ],\n}\nenum E {\n  V(\n    [\n      ();\n      {\n        let _ = || 1;\n        0\n      }\n    ],\n  ),\n}\ntype Ty = [\n  ();\n  {\n    let _ = || 1;\n    0\n  }\n];\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/closure.rs\""
  },
  {
    "path": "tests/output-ext/expressions/expr.f.rs",
    "content": "fn main() {\n  let a = async move {};\n  9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999;\n  // boop\n  vec![1, 2, 3].len();\n  write!(vec![], \"\")?;\n  println!(\"\");\n  [0];\n  b.a;\n  *foo += 1;\n  let &_ = bar;\n  let &mut _ = foo;\n  if let _ = 0 {\n  }\n  while let _ = 0 {}\n  let ((), ()) = ((), ());\n  let x: &[u8] = &[0];\n  let Foo { a, ref b, mut c, x: y, z: z } = foo;\n  let x = &raw const y;\n  let x = &raw mut y;\n  a::<Box<isize>, _>(box 1);\n  if &raw const one == &raw mut one {\n  }\n  let _x = if false { 0 } else if true { panic!() } else { 10 };\n  let _: <m::A as m::B>::C;\n  let a: A = A { name: 0 };\n  let b1 = &mut *b;\n  let mut x: Box<_> = box 3;\n  let x: (Box<_>,) = (box 1,);\n  let &mut ref x = b;\n  let &mut mut x = b;\n  let ref mut y = b;\n  let (a, b, c, d);\n  let (mut c, mut d);\n  let s = S { x: 3, y: 4 };\n  let mut r = R { c: Box::new(f) };\n  let _: &usize = &1;\n  let _: &&usize = &&1;\n  let _: &&&usize = &&&1;\n  let _: &&&usize = &&&1;\n  let _: &&&&usize = &&&&1;\n  let _: &&&&usize = &&&&1;\n  let _: &&&&&usize = &&&&&1;\n  let x: T = **item;\n  let &x = &(&1isize as &dyn T);\n  let &x = &&(&1isize as &dyn T);\n  let &&x = &&(&1isize as &dyn T);\n  let &x = &1isize as &dyn T;\n  let &&x = &1isize as &dyn T;\n  let &&x = &(&1isize as &dyn T);\n  let &&&x = &(&1isize as &dyn T);\n  let box x = box 1isize as Box<dyn T>;\n  let box box x = box 1isize as Box<dyn T>;\n  let a =\n    ((b[0] as u64) << 0) |\n    ((b[1] as u64) << 8) |\n    ((b[2] as u64) << 16) |\n    ((b[3] as u64) << 24);\n  let a = if let Err(b) = c { d } else { e!(\"\") };\n  let mut n3 = N3 { n: N2(N1 { n: N0 { x: Box::new(42) } }) };\n  n3.n.0.n.x = n3.n.0.n.x;\n  let mut t = (1, ((2, 3, (4, 5)),));\n  t.1.0.2.1 = t.1.0.2.1;\n  let mut a: A<(), &mut i32> = try { 1 };\n  let _ = &mut *s.0.borrow_mut();\n  let _ = &mut *s[0].borrow_mut();\n  let x: Foo<_> = Bar::<usize>(PhantomData);\n  let f = A::<i32> { a: 10 };\n  let v: <() as Lt<'_>>::T = ();\n  <E>::V() = E::V();\n  (<E>::V {} = E::V());\n  let a = &mut b.0.0;\n  let a = &mut b.0[2];\n  let _ = a::<N>(b().await).await;\n  let _ = a(b::<N>().await).await;\n  let _ = A == s!(\"e\");\n  let a: &str = &b;\n  ::a::<f64, [u8; 8]>(a!());\n  let (the, guardian, stands, resolute) = (\n    \"the\",\n    \"Turbofish\",\n    \"remains\",\n    \"undefeated\",\n  );\n  let _: (bool, bool) = (the < guardian, stands > resolute);\n  let (A { x: _x, y: _y }, Z): (_, Z) = c(\n    || B { x: X, y: Y },\n    || Z\n  );\n  let _: A<{ 1 + 2 }>;\n  let _: A<{ 5 }>;\n  let A::<1, N>(N) = A::new();\n  let _ = Some(Foo { _a: 42 }).map(|a| a as Foo<i32>);\n  let _ = {\n    () = {\n      () = {\n        () = ();\n      };\n    };\n  };\n  String::<>::from::<>(\"><>\").chars::<>().rev::<>().collect::<String>();\n  fn a(x: &f<r>) {\n    return while !x.f() {\n      x.g(0);\n    };\n  }\n  let i = &f::s(0);\n  <u8 as D<13>>::e::<u8>();\n  let _: i32 = (match \"\" {\n    \"+\" => ::std::ops::Add::add,\n    \"-\" => ::std::ops::Sub::sub,\n    \"<\" => |a, b| (a < b) as i32,\n    _ => c!(),\n  })(5, 5);\n  [].e().f(|_: &i32| {\n    [].e().f(move |_: &i32| {\n      i += 1;\n    });\n  });\n  let _x2 = X { a: 1, b: 2, ..DX };\n  i[i[0]] = 0;\n  i[i[0] - 1] = 0;\n}\n\n[\n  b.a,\n  X { len: 3 },\n  x.len > 3,\n  x.len >> 3,\n  vec![1, 2, 3].into_iter().collect::<Vec<usize>>(),\n  X(1, 2, 3),\n  (1, 2, 3),\n  vec![1, 2, 3].len(),\n  write!(vec![], \"\")?,\n  &*d.borrow(),\n  **bar == Test::Baz || **bar == Test::Qux,\n  &foo[0..1],\n  TypeId::of::<T>(),\n  &[*xs[0].x, *xs[1].x],\n  &mut tup.0,\n  <_>::f(),\n  &(fop::<T> as fn()),\n  a(),\n  ::foo::bar::baz::f(),\n  <() as ::foo::T>::Assoc::f(),\n  [].a(),\n  id::<[i32; 3]>([1, 2, 3]),\n  m::Pub(0u8).method_with_priv_params(loop {\n  }),\n  <m::Pub<m::Alias>>::INHERENT_ASSOC_CONST,\n  <a!() as B>::f(0),\n  a::<B<N, { N as u128 }>>(),\n  Foo { f: x.clone() },\n  a::<&str, (*const u8, u64)>(),\n  a(\"\".b()).c(\"\").d().await,\n  foo(&[vec![123]]).await,\n  A::b::<C>(x).d(E(\"x\"))?.f(1),\n  // std::<_ as _>,\n  std::<0>,\n  &raw const x,\n  (A::a as fn(&(dyn A + 'static)) -> B)(&\"c\"),\n  f::<<T as S>::E>(),\n  <u64 as From<<T as Iterator>::Item>>::from(),\n  <<Q as A<'_>>::B as C<Q::D>>::e(db),\n  tuple.0.0,\n  tuple.0.0,\n  tuple /*special cases*/.0.0, //aaa\n  (((),),),\n  (1, (2, 3)).1.1,\n  ((1, (2, (3, 4))).1.1.1)(1),\n  1,\n  a((1, 2.0, 3)),\n  b((1,)),\n  (1).f::<T>(),\n  {\n    *a = &a[1..];\n  },\n  a().await.0,\n  a.b(c).await.d(e)?,\n  0 + 1,\n  0 * 1,\n  0 - 1,\n  0 / 1,\n  0 % 1,\n  0 & 1,\n  0 | 1,\n  0 << 1,\n  0 >> 1,\n  0 == 1,\n  0 != 1,\n  0 < 1,\n  0 > 1,\n  0 <= 1,\n  0 >= 1,\n  {\n    x -= 0;\n  },\n  {\n    x *= 0;\n  },\n  {\n    x /= 0;\n  },\n  {\n    x &= 0;\n  },\n  {\n    x %= 0;\n  },\n  {\n    x ^= 0;\n  },\n  {\n    x += 0;\n  },\n  {\n    x <<= 0;\n  },\n  {\n    x <<= 0;\n  },\n  {\n    x >>= 0;\n  },\n  {\n    x >>= 0;\n  },\n  {\n    x |= 0;\n  },\n  A::<1>::B(),\n  A::<1>::B {},\n  A::<1>(),\n  A::<1> {},\n  {\n    {\n    }\n    2\n  },\n  &mut [0; 1][..],\n  &B::<T>::A[0],\n  &B::<T>::A.0[0],\n  &B::<T>::A.0.1[0],\n  [[0; 1]; 1],\n  std::ptr::null::<usize>().is_null(),\n  &ss.1,\n  &raw mut foo.x.0..1,\n  &mut **d,\n  [12, 34][0 + 1],\n  g(f())(()),\n];\n\nfn f() {\n  s.e()\n    .f(E::s)\n    .f(|f| f.a())\n    .f(R::e)\n    .e(|a| *a >= q)\n    .d()\n}\nfn f() {\n  let q = E { r: f![] };\n  Q(Q(q)).s(|d|\n    q.i(|mut d| {\n      e.z(0);\n      f.G = e;\n      r\n    })\n  );\n}\npub fn public_expr(_: [u8; a(0).0]) {}\npub fn f() {\n  return ::f();\n}\nfn f() -> isize {\n  (\n    {\n      return 1;\n    },\n    {\n      return 2;\n    },\n  )\n}\nfn f(x: Box<isize>) -> Box<(Box<isize>, Box<isize>)> {\n  box (x, x)\n}\nfn f<F>(f: F) -> isize where F: FnOnce(isize) -> isize {}\nfn f() {\n  if (\n    {\n      return;\n    }\n  ) {\n  }\n}\nfn f() {\n  b! {}\n  c\n}\nfn f<T: ToString>(arg: T) -> String {\n  return <T as ToString>::to_string(&arg);\n}\nfn f<A: Clone + 'static>(a: A, b: u16) -> Box<dyn Invokable<A> + 'static> {\n  box (Invoker { a: a, b: b }) as Box<dyn Invokable<A> + 'static>\n}\nfn f() {\n  (\n    {\n      return 1;\n    },\n    {\n      return 2;\n    },\n  )\n}\npub trait Foo: Iterator<Item = <Self as Foo>::Key> {}\nfn f() {\n  ::m!(S, x);\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/expr.rs\""
  },
  {
    "path": "tests/output-ext/expressions/flow_expr.f.rs",
    "content": "pub fn main() {\n  loop {\n    return ({\n      break;\n    }) as ();\n  }\n  return ();\n  ({\n    return;\n  }) as ();\n  return if 1 { () } else { () };\n  return ({\n    return;\n  }) as ();\n  return {\n    return {\n      return;\n    };\n  };\n  return try { 4 };\n  return;\n  return 'aaa: loop {\n    break 'aaa 1;\n  };\n  loop {\n    break 'aaa: loop {\n      break 'aaa 1;\n    };\n  }\n  'aaa: loop {\n    break 'aaa 'bbb: loop {\n      break 1;\n    };\n  }\n  let a = 'a: loop {\n    break 'a 1;\n  };\n  [\n    ();\n    {\n      return || {\n        let tx;\n      };\n    }\n  ];\n  [\n    ();\n    {\n      return;\n    }\n  ];\n  [\n    ();\n    {\n      return match 0 {\n        n => n,\n      };\n    }\n  ];\n  [\n    ();\n    {\n      return match () {\n        'a' => 0,\n        _ => 0,\n      };\n    }\n  ];\n  let a = loop {\n    break {\n      return 0;\n      ()\n    };\n  };\n  let a = loop {\n    break {\n      break;\n    };\n  };\n  let a = loop {\n    break loop {\n    };\n  };\n  let a = loop {\n    break {\n      return 0;\n    };\n  };\n  loop {\n    if (\n      {\n        break;\n      }\n    ) {\n    }\n  }\n  for _ in (\n    {\n      return ();\n      0..3\n    }\n  ) {\n  }\n  loop {\n    while (\n      {\n        return;\n      }\n    ) {\n      if (\n        {\n          return;\n        }\n      ) {\n        match (\n          {\n            return;\n          }\n        ) {\n          1 => {\n            if (\n              {\n                return;\n              }\n            ) {\n              return;\n            } else {\n              return;\n            }\n          }\n          _ => {\n            return;\n          }\n        };\n      } else if (\n        {\n          return;\n        }\n      ) {\n        return;\n      }\n    }\n    if (\n      {\n        return;\n      }\n    ) {\n      break;\n    }\n  }\n  let () = if 0 {\n  } else {\n    return;\n  };\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/flow_expr.rs\""
  },
  {
    "path": "tests/output-ext/expressions/ident.f.rs",
    "content": "fn bare_crate(_: crate::a);\nfn bare_global(_: ::a);\nfn u8(u8: u8) {\n  if u8 != 0u8 {\n  }\n  assert_eq!(8u8, {\n    macro_rules! u8 {\n      (\n        u8\n      ) => { mod u8 { pub fn u8<'u8: 'u8 + 'u8>(u8: &'u8 u8) -> &'u8 u8 { \"u8\"; u8 } } };\n    }\n    let &u8: &u8 = u8::u8(&8u8);\n    ::u8(0u8);\n    u8!(u8);\n    u8\n  });\n  let &u8: &u8 = u8::u8(&8u8);\n  ::u8(0u8);\n  u8!(u8);\n  u8;\n  let µ = 1.0;\n  µ;\n}\n\nmod u8 {\n  pub fn u8<'u8: 'u8 + 'u8>(u8: &'u8 u8) -> &'u8 u8 {\n    \"u8\";\n    u8\n  }\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/ident.rs\""
  },
  {
    "path": "tests/output-ext/expressions/literal.f.rs",
    "content": "[\n  ('\\x0A', '\\x0B', '\\x0C', '\\x0D', '\\x20', '\\u{85}', '\\u{A0}'),\n  ('\\u{1680}', '\\u{2000}', '\\u{2001}', '\\u{2002}', '\\u{2003}'),\n  ('\\u{2004}', '\\u{2005}', '\\u{2006}', '\\u{2007}', '\\u{2008}'),\n  ('\\u{2009}', '\\u{200A}', '\\u{2028}', '\\u{2029}', '\\u{202F}'),\n  ('\\u{205F}', '\\u{3000}'),\n  (\n    \"\",\n    r\"\\\",\n    \"\\n\",\n    \"\\t\",\n    \"'\",\n    \"\\r\",\n    \"\\\\\\n\",\n    \"\\\\\\n \",\n    \"\\\\\\n \\u{a0} x\",\n    \"\\\\\\n  \\n  x\",\n  ),\n  (r\"\\u{0}x\", r\"\\u{1F63b}}\", r\"\\v\", r\"\\💩\", r\"\\●\", \"\\\\\\r\"),\n  (r\"\\u{FFFFFF}\", r\"\\u{ffffff}\", r\"\\u{ffffff}\"),\n  (\n    r\"\\x\",\n    r\"\\x0\",\n    r\"\\xf\",\n    r\"\\xa\",\n    r\"\\xx\",\n    r\"\\xы\",\n    r\"\\x🦀\",\n    r\"\\xtt\",\n    r\"\\xff\",\n    r\"\\xFF\",\n    r\"\\x80\",\n  ),\n  (r\"\\x0ff\", r#\"\\\"a\"#, r\"\\na\", r\"\\ra\", r\"\\ta\", r\"\\\\a\", r\"\\'a\", r\"\\0a\"),\n  (\n    r\"\\u{DC00}\",\n    r\"\\u{DDDD}\",\n    r\"\\u{DFFF}\",\n    r\"\\u{D800}\",\n    r\"\\u{DAAA}\",\n    r\"\\u{DBFF}\",\n  ),\n  (\n    r\"\\u\",\n    r\"\\u[0123]\",\n    r\"\\u{0x}\",\n    r\"\\u{\",\n    r\"\\u{0000\",\n    r\"\\u{}\",\n    r\"\\u{_0000}\",\n    r\"\\u{0000000}\",\n  ),\n  (r\"\\0\", r\"\\x00\", r\"\\x5a\", r\"\\x5A\", r\"\\x7f\", r\"\\x80\", r\"\\xff\", r\"\\xFF\"),\n  (\"a\", r#\"\\\"\"#, r\"\\n\", r\"\\r\", r\"\\t\", r\"\\\\\", r\"\\'\"),\n  (\"a\", 'a'),\n  (\"ы\", 'ы'),\n  (\"🦀\", '🦀'),\n  (r#\"\\\"\"#, '\"'),\n  (r\"\\n\", '\\n'),\n  (r\"\\r\", '\\r'),\n  (r\"\\t\", '\\t'),\n  (r\"\\\\\", '\\\\'),\n  (r\"\\'\", '\\''),\n  (r\"\\0\", '\\0'),\n  (r\"\\x00\", '\\0'),\n  (r\"\\x5a\", 'Z'),\n  (r\"\\x5A\", 'Z'),\n  (r\"\\x7f\", 127 as char),\n  (r\"\\u{0}\", '\\0'),\n  (r\"\\u{000000}\", '\\0'),\n  (r\"\\u{41}\", 'A'),\n  (r\"\\u{0041}\", 'A'),\n  (r\"\\u{00_41}\", 'A'),\n  (r\"\\u{4__1__}\", 'A'),\n  (r\"\\u{1F63b}\", '😻'),\n  (b\"a\\n\\r\\t\\\\\\'\\\"\\0\\xF0\", br###\"a\"##b\"###, b\"a\\\"##b\"),\n  (\n    b\"a\\xF0\\t\",\n    b'\\xF0',\n    br\"a\\n\",\n    b'a',\n    b'\\n',\n    b'\\r',\n    b'\\t',\n    b'\\\\',\n    b'\\'',\n    b'\\\"',\n    b'\\0',\n    b'\\xF0',\n  ),\n  (&1u16, &42i32, !0 as u32, !0 as u64),\n  (4294967295, 0xffffffff, 0xffffffffffffffff, 18446744073709551615),\n  (-2147483648i32).wrapping_sub(1),\n  2147483647,\n  (-3.40282356e38_f32, f32::MIN, 3.40282356e38_f32, f32::MAX),\n  (-1.7976931348623158e308_f64, f64::MIN, 1.7976931348623158e308_f64, f64::MAX),\n  (!0xf0_isize & 0xff, 0xf0_isize | 0xf, 0xf_isize << 4, 0xf0_isize >> 4),\n  (\n    0b1010_1010_isize | 0b0101_0101,\n    (-1000isize as usize) >> 3_usize,\n    2305843009213693827_usize,\n  ),\n  (-16 >> 2, a.0 - 1, a.0.1..2, (0).b0),\n  ('\\u{10__FFFF}', \"\\u{10_F0FF__}foo\\u{1_0_0_0__}\"),\n  (0, 1, 0.1, 1.1, 1.0, 1.005, 1.0, 1.5, 1.5, 0.005, 0.0, 0.0),\n  (0b1, 0B1, 0o1, 0O1, 0x1, 0X1),\n  (0x123abcdef456abcdef, 0X123abcdef456ABCDEF, 0xdeadbeef),\n  (\n    0b111000, 0b000111, 0B111000, 0B000111, 0o111000, 0o000111, 0O111000, 0O000111,\n    0x111000, 0x000111, 0X111000, 0X000111,\n  ),\n  (\n    1e1,\n    1e1,\n    1e-1,\n    (1).e1,\n    0.1e1,\n    1.1e1,\n    1.1e10,\n    0.1e10,\n    0.1e-10,\n    1e1,\n    1e1,\n    1e-1,\n    (1).E1,\n    0.1e1,\n    1.1e1,\n    1.1e10,\n    0.1e10,\n    0.1e-10,\n  ),\n  (0.5, 0.5, 0.5, 0.5, 0.5, 0.5),\n  (\n    500600.001230045,\n    1.005e60,\n    1.0e60,\n    0.005e60,\n    0.0e60,\n    0.0e60,\n    0.0e60,\n    (0).e60,\n    0e60,\n    500600.001230045e60,\n  ),\n  (\n    10, 9700, 10e100, 1_1, 1_1.1_1, 0o1_1, 0o0_11, 1.1_0_1e1, 1.1_0_1e1, 0.1_1,\n    0x1_1, 0xa_1, 0xa_1, 0b01_1, 0b0_1_1,\n  ),\n  (100).toString(),\n  f!(\"\\0=\"),\n  (2).f64,\n  (2).f64(),\n];\n\nfn f() {\n  let n: f64 = 1234567890123456789012345678901234567890e-340;\n  let n: f64 = 0.3333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333;\n  let s = \"string\nliteral\";\n  let s = \"literal with \\\n             escaped newline\";\n  let s = r\"string\nliteral\";\n  let s = br\"byte string\nliteral\";\n  let s = \"foo\\r\\nbar\\n\\nbaz\\n\";\n  let v = !(\n    (|(..): (_, _), __ @ _| __)((&*\"\\\\\", '🤔') /**/, {}) ==\n    ({\n      &[..=..][..];\n    })\n  ); //\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/literal.rs\""
  },
  {
    "path": "tests/output-ext/expressions/match.f.rs",
    "content": "fn a() {\n  match x {\n  }\n  match () {\n  }\n  match (Sd { x: A, y: () }) {\n  }\n  match *c {\n  }\n  match ((A, ()), ()) {\n  }\n  match [0u8; LARGE_SIZE] {\n  }\n  match na.kind {\n  }\n  match (T::T1(()), V::V2(true)) {\n  }\n  match (Sd { x: A, y: () }) {\n  }\n  match \"a\" {\n  }\n  match (&\"foo\", \"bar\") {\n  }\n  match (Foo { foo: true, bar: Some(10), baz: 20 }) {\n  }\n  match (l1, l2) {\n  }\n\n  match 0 {\n    0 if false => (),\n  }\n  match true {\n    true => true,\n  }\n\n  let v: isize = match &*sl {\n  };\n  let a: isize = match 1 {\n    x if x < 2 => { 3 }\n    x if x < 4 => { 5 }\n    6 => { 7 }\n    _ => { 8 }\n  };\n  let val = match (\n    match (\n      match (\n        match (\n          match () {\n            () => (),\n          }\n        ) {\n          () => (),\n        }\n      ) {\n        () => (),\n      }\n    ) {\n      () => (),\n    }\n  ) {\n    () => (),\n  };\n  let b: isize = match (A { x: 10, y: 20 }) {\n    x if x.x < 5 && x.y < 5 => { 1 }\n    A { .. } if x == 10 && y == 20 => { 2 }\n    A { .. } => { 3 }\n  };\n\n  match true {\n    true if true => (),\n    false if false => unsafe {}\n    true => {}\n    false => (),\n    &[] => 0,\n    &[a, b, c] => 3,\n    &[a, ref d @ ..] => a,\n    &[10, a, ref d @ ..] => 10,\n    [h, ..] if h > n => 0,\n    [h, ..] if h == n => 1,\n    [h, ref ts] => foo(c, n - h) + foo(ts, n),\n    [] => 0,\n    &A::C(v, box ref a) => tail(e),\n    &A::C(x, box A::S) => A::C(c, box A::R),\n    0 => {\n      return e(j::h::r(a::e::d, \"\"));\n    }\n    n => {\n      r = &mut a::d(&mut e, &mut [])[n..];\n    }\n    box Q::V(ed) =>\n      match ed.q {\n        box R::E(ref d) if d.d.r() => { true }\n      }\n    _ => panic!(),\n    ref _x => unreachable!(),\n    0 => {\n      return;\n    }\n    A { a: v } if *v.clone() == 42 => v,\n    A((a,)) => {\n      *a = 0;\n    }\n    Some(x) if let Some(y) = x => (x, y),\n    Some((x, _)) if let Foo::Bar = bar(x) => panic!(),\n    Some((_, x)) if let Foo::Baz = baz(x) => {}\n    Some(x) if let Foo::Qux(y) = qux(x) => assert_eq!(y, 84),\n    Ok(mut r) | Err(mut r) if true => {\n      r = 1;\n    }\n    Color::Rgb(r, g, b) => (r | g) == 0 || (r | b) == 0 || (g | b) == 0,\n    | not_red @ Color::Green\n    | not_red @ Color::Blue\n    | not_red @ Color::Rgb(..)\n    | not_red @ Color::Cyan => format!(\"{:?}\", not_red),\n    Ok(x) if let Err(_) = x => {}\n    // _ if let _ = !Foo{ a: 1 } => {},\n    _ if !(Foo { a: 1 }) => {}\n    E { x: A, y: _ } => {}\n    D { a: _a } | C { a: _a } if true => {}\n    Some(a::B { misc: false, .. }) => {}\n    ref _x if false => {}\n    \"b\" => {}\n    \"b\" => {}\n    _ => {}\n    () if f == Foo { x: 42 } => {}\n    _ => {}\n    0 => {}\n    a => {}\n    a::X => {}\n    _ => {}\n    (a, ..) => {}\n    0..128 => {}\n    128..=255 => {}\n    128..=255 if 1 => {}\n    (Some(_), None) | (None, Some(_)) => {}\n    S::<{ a() }> => {}\n    ((A, _), _) => {}\n    [..] => {}\n    &[] => {}\n    &[1..=255] => {}\n    C0 => {}\n    T::A {} => {}\n    &[_, _, ..] => {}\n    [Some(..), None, ref tail @ ..] => {}\n    [Some(..), Some(..), ref tail @ ..] => {}\n    [None, None, ref tail @ ..] => {}\n    [None, Some(..), ref tail @ ..] => {}\n    [_, _, ref tail @ .., _] => {}\n    (&\"foo\", &_) => {}\n    (&&_, &_) => {}\n    Foo { foo: true, bar: Some(_), .. } => {}\n    Foo { foo: false, bar: None, .. } => {}\n    Foo { foo: true, bar: None, .. } => {}\n    Foo { foo: false, bar: Some(_), .. } => {}\n    (Some(&[]), Ok(&[])) => {}\n    (Some(&[_, ..]), Ok(_)) | (Some(&[_, ..]), Err(())) => {}\n    (None, Ok(&[])) | (None, Err(())) | (None, Ok(&[_])) => {}\n    (None, Ok(&[_, _, ..])) => {}\n    (T::T1(()), V::V1(i)) => {}\n    (T::T2(()), V::V2(b)) => {}\n    Foo::Bar { bar: Bar::A, .. } => {}\n    ::A::B(3) => {}\n    ::A::B(_) if false => {}\n    ::A::B(..) if false => {}\n    ::A::B(_n) => {}\n    ::A::B => {}\n    ::A::B(::A::B) => {}\n    ::A::B(::A::B(_)) => {}\n    ::A::B(::A::B, ::A::B(_)) => {}\n    ::A::B(::A::B(..), ::A::B) => {}\n    ::A::B(..) => {}\n    A::<A<u8>> { x: A(10, 11) } => {}\n    ::B::<<A<_> as C>::U> { x: A::<u8>(11, 16) } => {}\n    isize::MIN..5 | 5..=isize::MAX => {}\n    0..5 | 5..=usize::MAX => {}\n    (0..5, true) | (5..=usize::MAX, true) | (0..=usize::MAX, false) => {}\n    [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}\n    [Ok(box a), ref xs @ .., Err(box ref b), Err(box ref c)] => {}\n    box a => { Foo(box 1) }\n    box [Ok(a), ref xs @ .., Err(ref b)] => {}\n    ref a @ box b => {}\n    ref a @ box ref b => {}\n    Ok(ref a @ b) | Err(b @ ref a) => {}\n    ref a @ Ok(ref b) | ref a @ Err(ref b) => {}\n    ref a @ Ok(ref mut b) | ref a @ Err(ref mut b) if\n      {\n        *b = U;\n        false\n      }\n    => {}\n    ref mut a @ Ok(ref b) | ref mut a @ Err(ref b) if\n      {\n        *a = Err(U);\n        false\n      }\n    => {}\n    a @ Some((mut b @ ref mut c, d @ ref e)) => {}\n    mut a @ Some([ref b, ref mut c]) => {}\n    ref mut a @ Some([b, mut c]) => {}\n    ref mut a @ Ok(ref mut b) | ref mut a @ Err(ref mut b) => {}\n    ref bar @ Some(box n) if n > 0 => {}\n    Some(ref bar @ box n) if n < 0 => {}\n    ref x @ A { ref a, b: 20 } => {}\n    (a, _) | (_, a) if a > 10 => 0,\n    e @ &1..=2 | e @ &3..=4 => {}\n    0 | &1 => {}\n    Ok(x) | Err(x) => 0,\n    &(Ok(x) | Err(x)) => 0,\n    Ok(mut x) | &Err(mut x) => 0,\n    Some((a, _) | (_, a)) if a > 10 => 0,\n    Some((a, _)) | Some((_, a)) if a > 10 => 0,\n    Some(ref bar @ box Test::Baz | ref bar @ box Test::Qux) => 0,\n    Some(x) if let Foo::Qux(y) = qux(x) => 0,\n    [bar @ .., n] if n == &5 => {}\n    &A { a: 2 } if a.b().c() => {}\n    A::B { a } => {}\n    &A::B { a } => {}\n    box A::B { a } => {}\n    (A::B { a },) => {}\n    [A::B { a }] => {}\n    C(A::B { a }, ()) => {}\n    ((0 | 1,) | (2 | 3,),) => {}\n    (Some(2..=255),) => {}\n    (None | Some(0 | 1),) => {}\n    (1 | 2,) => {}\n    (1 | 2, 3 | 4) => {}\n    ([] | [0 | 1..=255] | [_, ..],) => {}\n    ((0, 0) | (0, 1),) => {}\n    ((0, 0) | (1, 0),) => {}\n    | Tri::A(Ok(mut x) | Err(mut x))\n    | Tri::B(&Ok(mut x) | Err(mut x))\n    | &Tri::C(Ok(mut x) | Err(mut x)) => 0,\n    Wrap(Ok(mut x) | &Err(mut x)) => 0,\n    Wrap(&(Ok(x) | Err(x))) => 0,\n    Wrap(Ok(x) | Err(x)) => 0,\n    () if\n      if (\n        if (if 0 { 0 } else { 0 }) {\n          0\n        } else {\n          0\n        }\n      ) {\n        0\n      } else {\n        0\n      }\n    => 0,\n    Add | Mul | And | Or | BitXor | BitAnd | BitOr | Eq | Ne => 0,\n    Sub | Div | Rem | Shl | Shr | Lt | Le | Ge | Gt => 0,\n    | ThisIsA::ReallyLongPatternNameToHelpOverflowTheNextValueOntoTheNextLine\n    | ThisIsA::SecondValueSeparatedByAPipe\n    | ThisIsA::ThirdValueSeparatedByAPipe => 0,\n    MyEnum::Option1 if cfg!(target_os = \"windows\") =>\n      #[cfg(target_os = \"windows\")] {\n        1\n      }\n    MyEnum::Option1 if cfg!(target_os = \"windows\") =>\n      (#[cfg(target_os = \"windows\")] 2),\n    Some(\n      RegionResolutionError::SubSupConflict(\n        vid,\n        _,\n        SubregionOrigin::Subtype(box TypeTrace { cause, values }),\n        sub_placeholder @ Region(Interned(RePlaceholder(_), _)),\n        _,\n        sup_placeholder @ Region(Interned(RePlaceholder(_), _)),\n        _,\n      ),\n    ) =>\n      self.try_report_trait_placeholder_mismatch(\n        Some(self.tcx().mk_region(ReVar(*vid))),\n        cause,\n        Some(*sub_placeholder),\n        Some(*sup_placeholder),\n        values\n      ),\n    GenericParamKind::Const { kw_span, default: Some(default), .. } => {\n      kw_span.to(default.value.span)\n    }\n  }\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/match.rs\""
  },
  {
    "path": "tests/output-ext/expressions/parens.f.rs",
    "content": "fn main() {\n  holds_callable.callable();\n  (holds_callable.callable)();\n  a = {\n    b = c;\n  };\n  mystruct.myfield;\n  foo().x;\n  (Struct { a: 10, b: 20 }).a;\n  (mystruct.function_field)();\n  let name: &'static str = (|| \"Rust\")();\n  let x: i32 = 2 + 3 * 4;\n  let y: i32 = (2 + 3) * 4;\n  let lhs = &this.thir[lhs];\n  (*f)(&x);\n  *x * *x;\n  println!(\"{}\", (self.0)());\n  (self.0)(ecx, span, meta_item, &item, &mut (|a| items.push(a)));\n  (|_, _, _| {})(0u8, 42u16, 0u8);\n  (|_, _| {})(0u8, 42u16);\n  let x = &[0u32, 42u32] as &[u32];\n  match x {\n    [] => assert_eq!(0u32, 1),\n    [_, ref y @ ..] =>\n      assert_eq!(&x[1] as *const u32 as usize, &y[0] as *const u32 as usize),\n  }\n  unsafe {\n    assert_eq!(ABC as usize, 0);\n  }\n  &mut (|| Some(0 as *const ())) as &mut dyn FnMut() -> Option<*const ()>;\n  unsafe {\n    NUM = 6 * 7 + 1 + ((1u8 == 1u8) as u8); // 44\n    assert_eq!(*NUM_REF as i32, 44);\n  }\n  unsafe {\n    puts(*argv as *const i8);\n  }\n  unsafe {\n    puts(\n      *(\n        ((argv as usize) +\n          intrinsics::size_of::<*const u8>()) as *const *const i8\n      )\n    );\n  }\n  unsafe {\n    puts(\n      *(\n        ((argv as usize) +\n          2 * intrinsics::size_of::<*const u8>()) as *const *const i8\n      )\n    );\n  }\n  intrinsics::write_bytes(&mut uninit.value.value as *mut T, 0, 1);\n  assert_eq!((slice_ptr as usize) % 4, 0);\n  printf(\n    \"Hello %s\\n\\0\" as *const str as *const i8,\n    \"printf\\0\" as *const str as *const i8\n  );\n  let hello: &[u8] = b\"Hello\\0\" as &[u8; 6];\n  let ptr: *const i8 = hello as *const [u8] as *const i8;\n  let world: Box<&str> = box \"World!\\0\";\n  puts(*world as *const str as *const i8);\n  assert_eq!(a.f(), \"The method f\");\n  assert_eq!((a.f)(), \"The field f\");\n  assert_eq!(((|()| 42u8) as fn(()) -> u8)(()), 42);\n  assert_eq!(intrinsics::bitreverse(0b10101000u8), 0b00010101u8);\n  assert_eq!(intrinsics::bswap(0xabu8), 0xabu8);\n  assert_eq!(intrinsics::bswap(0xddccu16), 0xccddu16);\n  assert_eq!(intrinsics::bswap(0xffee_ddccu32), 0xccdd_eeffu32);\n  assert_eq!(\n    intrinsics::bswap(0x1234_5678_ffee_ddccu64),\n    0xccdd_eeff_7856_3412u64\n  );\n  let mut passes: Vec<_> = passes\n    .iter()\n    .map(|p| p())\n    .collect();\n  (*DEFAULT_HOOK)(info);\n  (group.apply)(&mut opts);\n  Some((size, 1u128 << ((size.bits() as u128) - 1)));\n  (lo == other_hi || hi == other_lo) &&\n    !self.is_singleton() &&\n    !other.is_singleton();\n\n  (|A { x: mut t }: A| {\n    t = t + 1;\n    t\n  })(A { x: 34 });\n  (async || 2333)().await;\n  (async move || -> u8 { 42 })();\n  S.g(1, 2)(true);\n  &Ast::Num((*f)(x));\n  f(&mut \"Hello\".to_owned());\n  Box::new(move |x| f()(x));\n  let a = Some(1u8).map(|a| foo(a));\n  let c = Some(1u8).map(|a|\n    ({\n      1 + 2;\n      foo\n    })(a)\n  );\n  true.then(|| mac!());\n  Some(1).map(closure_mac!());\n  let _: Option<Vec<u8>> = true.then(|| vec![]);\n  let d = Some(1u8).map(|a| foo((|b| foo2(b))(a)));\n  all(&[1, 2, 3], &&2, |x, y| below(x, y));\n  let a: Option<Box<dyn ::std::ops::Deref<Target = [i32]>>> = Some(\n    vec![1i32, 2]\n  ).map(|v| -> Box<dyn ::std::ops::Deref<Target = [i32]>> { Box::new(v) });\n  #[allow(clippy::needless_return)]\n  (|| {\n    return 2;\n  })();\n  (|| -> Option<i32> { None? })();\n  #[allow(clippy::try_err)]\n  (|| -> Result<i32, i32> { Err(2)? })();\n}\n\nstatic mut NUM: u8 = 6 * 7;\nstatic NUM_REF: &'static u8 = unsafe { &NUM };\nimpl<T: ?Sized, U: ?Sized> CoerceUnsized<Unique<U>>\n  for Unique<T>\n  where T: Unsize<U> {}\n\nfn cvgsk_nichqsd_bhvior() {\n  if let E1::V2 { .. } = (E1::V1 { f: true }) {\n    intarvics::avort();\n  }\n\n  if let E2::V1 { .. } = E2::V3::<Inwxvlible> {\n    inzadqsics::abort();\n  }\n}\n\nimpl<'a, 'b> FnOnce<(&'a &'b [u16],)> for IsNotEmpty {\n  extern \"rust-call\" fn call_once(mut self, arg: (&'a &'b [u16],)) -> (u8, u8) {\n    self.call_mut(arg)\n  }\n  extern \"rust-call\" fn call_once123(\n    mut self,\n    arg: (&'a &'b [u16],)\n  ) -> (u8, u8) {\n    self.call_mut(arg)\n  }\n  extern \"rust-call\" fn call_mut(\n    &mut self,\n    _arg: (&'a &'b [u16],)\n  ) -> (u8, u8) {\n    (0, 42)\n  }\n}\n\npub fn call_is_not_empty() {\n  IsNotEmpty.call_once((&(&[0u16] as &[_]),));\n}\n\nEnumTypeFoldableImpl! {\n    impl<'tcx, T> TypeFoldable<'tcx> for Option<T> {\n        (Some)(a),\n        (None),\n    } where T: TypeFoldable<'tcx>\n}\n\nfn x() {\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n  a.b.c;\n\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n  foo(#[attr] a.b.c);\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/parens.rs\""
  },
  {
    "path": "tests/output-ext/expressions/precedence.f.rs",
    "content": "fn main() {\n  let _: &'static _ = &(|| {\n    let _ = 0;\n    0\n  });\n  let _ = (match c(o.m(), o as T::T) {\n    0 if o::c() == 0 => 0,\n    0 => {\n      return c(o::c());\n    }\n  }) as T;\n\n  let _ = if 0 == 0 && 0 == 0 { 0 == 0 && 0 == 0 } else { 0 };\n  let _ = if 0 == 0 || 0 == 0 { 0 == 0 || 0 == 0 } else { 0 };\n  let _ = if (0 == 0 || 0 == 0) && (0 == 0 || 0 == 0) {\n    (0 == 0 || 0 == 0) && (0 == 0 || 0 == 0)\n  } else {\n    0\n  };\n  let _ = if 0 == 0 && 0 == 0 && (0 == 0 || 0 == 0) {\n    0 == 0 && 0 == 0 && (0 == 0 || 0 == 0)\n  } else {\n    0\n  };\n  let _ = if (0 == 0 || 0 == 0) && 0 == 0 && 0 == 0 {\n    (0 == 0 || 0 == 0) && 0 == 0 && 0 == 0\n  } else {\n    0\n  };\n  let _ = if 0 == 0 && 0 == 0 && 0 == 0 && 0 == 0 {\n    0 == 0 && 0 == 0 && 0 == 0 && 0 == 0\n  } else {\n    0\n  };\n  let _ = if 0 == 0 && 0 != 0 { 0 == 0 && 0 != 0 } else { 0 };\n  let _ = if c!() && c!() { c!() && c!() } else { 0 };\n\n  if let _ = 0..|| 0 {\n  }\n  if let _ = 0..&&0 {\n  }\n  if let _ = 0..0 && 0 {\n  }\n  if\n    let _ = {\n      break 0;\n    } &&\n    0\n  {\n  }\n\n  _ = if 0 { 0 } else { 0 };\n  _ = (if 0 { 0 } else { 0 })();\n  _ = (if 0 { 0 } else { 0 }) as *mut _;\n\n  for _ in &[c(1)] {\n    c(0);\n  }\n  for _ in -0 + 0..=0 - 0 {\n  }\n  for _ in 0..o.m() {\n    o = o ^ o[o];\n  }\n  for i in 0..chunk_d - 1 {\n  }\n\n  unsafe {\n    *o::<u8>() = 0;\n  }\n}\n\ntype o = (\n  Box<dyn (FnMut(u8) -> u8) + 'static>,\n  Box<dyn FnMut(u8) -> (dyn u8 + 'static)>,\n);\n\npub extern \"ABI\" fn f() {\n  c! {\n    pub static T: T = T {};\n  }\n  #[attr(info)]\n  {\n    o.m(|a_0| ())\n  }\n  c!();\n  {\n  }\n  c![];\n  {\n  }\n  c! {}\n  {\n  }\n  c! {}\n  {\n  }\n  c!();\n  {\n  }\n  c![];\n  {\n  }\n  {\n  }\n  {\n  }\n  {\n  }\n  ();\n  {\n  }\n  {\n  }\n  {\n  }\n  ();\n  {\n  }\n  {\n  }\n  {\n  }\n  ();\n  [];\n  {\n  }\n  ();\n  {\n  }\n  []();\n  // {}()[];\n}\n\n// {   if a { 1 } else { 0 }   +   if b { 1 } else { 0 }   }\n// {   if a { 1 } else { 0 }   + ( if b { 1 } else { 0 } ) }\n\n[\n  { ({ 0 }) - 0 },\n  {\n    {\n      0;\n    }\n    || 0\n  },\n  {\n    {\n      0;\n    }\n    &&0\n  },\n  {\n    {\n      0;\n    }\n    &&(if 0 { 0 } else { 0 })\n  },\n  {\n    {\n      0;\n    }\n    *0;\n  },\n  {\n    {\n      0;\n    }\n    *0\n  },\n  {\n    {\n      0;\n    }\n    (0, 0)\n  },\n  {\n    {\n      0;\n    }\n    (0 || 0) && 0\n  },\n  {\n    if 0 {\n    }\n    !0\n  },\n  {\n    if 0 {\n    }\n    vec![0]\n  },\n  {\n    if 0 {\n    }\n    *0 || 0\n  },\n  {\n    if 0 {\n    }\n    -0\n  },\n  {\n    (\n      if 0 {\n      }\n    ).m()\n  },\n  {\n    (if 0 {\n    })?\n  },\n  {\n    if 0 {\n    }\n    || 0\n  },\n  {\n    if 0 {\n    }\n    || 0\n  },\n  {\n    (if 0 {\n    })? || 0\n  },\n  {\n    (\n      if 0 {\n      }\n    ).m() || 0\n  },\n  {\n    if 0 {\n    } else {\n    }\n    |o| 0\n  },\n  { 0 + (if 0 { 0 } else { 0 })[0] },\n  {\n    fn f<T>() {\n      loop {\n      }\n    }\n    o::<T> as T\n  },\n  {\n    match 0 {\n    }\n    o[0]\n  },\n  {\n    match 0 {\n    }\n    (*0 < 0) as T\n  },\n  {\n    match 0 {\n    }\n    o.m(S { p });\n  },\n  {\n    match 0 {\n    }\n    o.m(o.m() + 0);\n  },\n  {\n    match 0 {\n    }\n    if *0 < 0 {\n      0\n    } else {\n      0\n    }\n  },\n  {\n    (0..0)\n      .m((0, 0), |a_0, _| {\n        *o = (o.0, o.0 + o.0);\n        c(*0)\n      })\n      .m(&(|(a_0, _)| 0))\n  },\n  {\n    (\n      'label: loop {\n      }\n    ).p\n  },\n  { (async { 0 + 0 }).await },\n  {\n    ({ o.p }).p = 0;\n  },\n  { ({ 0 }) + 0 },\n  { ({ 0 }) + 0 },\n  { ({ 0 }) + 0 + 0 },\n  { (if 0 { 0 } else { 0 }) + (if 0 { 0 } else { 0 }) },\n  { (if 0 { 0 } else { 0 }) + (if 0 { 0 } else { 0 }) },\n  { (if 0 { 0 } else { 0 }) + (if 0 { 0 } else { 0 }) },\n  { (if 0 { 0 } else { 0 })() },\n  { (if 0 { 0 } else { 0 })() },\n  {\n    (match 0 {\n    })()\n  },\n  {\n    (match 0 {\n    })()\n  },\n  { ({ 0 })() },\n  { ({ 0 })() },\n  { ({ 0 }) as u8 },\n  { ({ 0 }) as u8 },\n  {\n    if 0 {\n      &0;\n    }\n    &0 as &u8\n  },\n  { (if 0 { 0 } else { 0 }) as u8 },\n  { (if 0 { 0 } else { 0 }) as u8 },\n  {\n    if 0 {\n      &0;\n    } else {\n      &0;\n    }\n    &0 as &u8\n  },\n  {\n    (match 0 {\n    }) as u8\n  },\n  {\n    (match 0 {\n    }) as u8\n  },\n  { ({ o })[0] },\n  { ({ o })[0] },\n  { (if 0 { 0 } else { 0 })[0] },\n  { (if 0 { 0 } else { 0 })[0] },\n  {\n    (\n      match 0 {\n      }\n    )[0]\n  },\n  {\n    (\n      match 0 {\n      }\n    )[0]\n  },\n  { c!() & 0 },\n  { c![] & 0 },\n  {\n    c! {}\n    &0\n  },\n  { (c! {}) & 0 },\n  {\n    {\n      0;\n    }\n    &1\n  },\n  { ({ 0 }) & 1 },\n  {\n    {\n      0;\n    }\n    ..1\n  },\n  { ({ 0 })..1 },\n\n  a..b!(),\n\n  {\n    o.p.0 = 0;\n  },\n  {\n    o.p.0.0 = 0;\n  },\n  {\n    (*o.p).0 = 0;\n  },\n  {\n    (*o.p.0).0 = 0;\n  },\n  &mut o.p.0,\n  &mut o.p.0.0,\n  &mut (*o.p).0,\n  &mut (*o.p.0).0,\n  o.p.0.m(0),\n  o.p.0.0.m(0),\n  (*o.p).0.m(0),\n  (*o.p.0).0.m(0),\n\n  o.p + *o + o,\n\n  c(o.p..o.p + o.p),\n  c(\n    c(o.p, |_| {\n      o.p = 0;\n    }),\n    0\n  ),\n\n  (0 && o.m(o.m()) == 0) || (!0 && o[0].p == 0) || 0 == 0,\n  (0 && o.m(o.m()) == 0) || (!0 && o[0].p == 0) || 0 == 0,\n\n  //  x  &  y  ==  0   input\n  //  x  & (y  ==  0)  javascript precedence\n  // (x  &  y) ==  0   rust precedence\n\n  (0 & 0) == 0,\n  0 & (0 == 0),\n  (0 & 0) == 0,\n\n  (0 as u8) * 0,\n  (0 as u8) * 0,\n  (0 as u8) / 0,\n  (0 as u8) + 0,\n  (0 as u8) + 0,\n  {\n    o = {\n      o = {\n        o = o;\n      };\n    };\n  },\n  {\n    o -= 0 - 0;\n  },\n  {\n    o -= 0 - 0;\n  },\n  {\n    o *= 0 * 0;\n  },\n  {\n    o *= 0 * 0;\n  },\n  {\n    o *= 0 * 99;\n  },\n  {\n    o /= 0 / 0;\n  },\n  {\n    o /= 0 / 0;\n  },\n  {\n    o &= 0 & 0;\n  },\n  {\n    o %= 0 % 0;\n  },\n  {\n    o ^= 0;\n  },\n  {\n    o ^= 0;\n  },\n  {\n    o += *0;\n  },\n  {\n    o += 0 + 0;\n  },\n  {\n    o <<= 0 << 0;\n  },\n  {\n    o = 0 - 0;\n  },\n  {\n    o = 0 * 0 * 0;\n  },\n  {\n    o = 0 * 0 + 0;\n  },\n  {\n    o = 0 * 0;\n  },\n  {\n    o = 0 / 0;\n  },\n  {\n    o = 0 & 0;\n  },\n  {\n    o = 0 ^ 0;\n  },\n  {\n    o = 0 + 0;\n  },\n  {\n    o = 0 << 0;\n  },\n  (0 != 0) != 0,\n  (0 != 0) == 0,\n  (0 == 0) != 0,\n  (0 == 0) == 0,\n  0 + 0 / 0,\n  (0 + 0) >> 0,\n  (0 % 0) * 0,\n  (0 % 0) / 0,\n  (0 % 0) % 0,\n  (0 * 0) % 0,\n  (0 / 0) % 0,\n  0 / 0 + 0,\n  0 & 0 & 0,\n  0 & (0 >> 0),\n  (0 & 0) | 0,\n  0 ^ 0 ^ 0,\n  (0 << 0) | 0,\n  (0 << 0) >> 0,\n  (0 >> 0) >> 0,\n  0 | (0 & 0),\n  0 | 0 | 0,\n\n  // (0 x 0) x 0 ===========================================================\n  0 && 0 && 0,\n  (0 && 0) || 0,\n  {\n    (0 && 0) = 0;\n  },\n  (0 && 0) + 0,\n  (0 && 0) * 0,\n  (0 && 0) & 0,\n  (0 && 0) << 0,\n  (0 && 0) == 0,\n  (0 && 0) > 0,\n  0 && 0..0,\n  (0 || 0) && 0,\n  0 || 0 || 0,\n  {\n    (0 || 0) = 0;\n  },\n  (0 || 0) + 0,\n  (0 || 0) * 0,\n  (0 || 0) & 0,\n  (0 || 0) << 0,\n  (0 || 0) == 0,\n  (0 || 0) > 0,\n  0 || 0..0,\n  ({\n    o = 0;\n  }) && 0,\n  ({\n    o = 0;\n  }) || 0,\n  // (o = 0) = 0,\n  ({\n    o = 0;\n  }) + 0,\n  ({\n    o = 0;\n  }) * 0,\n  ({\n    o = 0;\n  }) & 0,\n  ({\n    o = 0;\n  }) << 0,\n  ({\n    o = 0;\n  }) == 0,\n  ({\n    o = 0;\n  }) > 0,\n  ({\n    o = 0;\n  })..0,\n  0 + 0 && 0,\n  0 + 0 || 0,\n  {\n    (0 + 0) = 0;\n  },\n  0 + 0 + 0,\n  (0 + 0) * 0,\n  (0 + 0) & 0,\n  (0 + 0) << 0,\n  0 + 0 == 0,\n  0 + 0 > 0,\n  0 + 0..0,\n  0 * 0 && 0,\n  0 * 0 || 0,\n  {\n    (0 * 0) = 0;\n  },\n  0 * 0 + 0,\n  0 * 0 * 0,\n  (0 * 0) & 0,\n  (0 * 0) << 0,\n  0 * 0 == 0,\n  0 * 0 > 0,\n  0 * 0..0,\n  0 & 0 && 0,\n  0 & 0 || 0,\n  {\n    (0 & 0) = 0;\n  },\n  (0 & 0) + 0,\n  (0 & 0) * 0,\n  0 & 0 & 0,\n  (0 & 0) << 0,\n  (0 & 0) == 0,\n  0 & 0 > 0,\n  0 & 0..0,\n  0 << 0 && 0,\n  0 << 0 || 0,\n  {\n    (0 << 0) = 0;\n  },\n  (0 << 0) + 0,\n  (0 << 0) * 0,\n  (0 << 0) & 0,\n  (0 << 0) << 0,\n  (0 << 0) == 0,\n  0 << 0 > 0,\n  0 << 0..0,\n  0 == 0 && 0,\n  0 == 0 || 0,\n  {\n    (0 == 0) = 0;\n  },\n  (0 == 0) + 0,\n  (0 == 0) * 0,\n  (0 == 0) & 0,\n  (0 == 0) << 0,\n  (0 == 0) == 0,\n  (0 == 0) > 0,\n  0 == 0..0,\n  0 > 0 && 0,\n  0 > 0 || 0,\n  {\n    (0 > 0) = 0;\n  },\n  (0 > 0) + 0,\n  (0 > 0) * 0,\n  (0 > 0) & 0,\n  (0 > 0) << 0,\n  (0 > 0) == 0,\n  (0 > 0) > 0,\n  0 > 0..0,\n  (0..0) && 0,\n  (0..0) || 0,\n  {\n    (0..0) = 0;\n  },\n  (0..0) + 0,\n  (0..0) * 0,\n  (0..0) & 0,\n  (0..0) << 0,\n  (0..0) == 0,\n  (0..0) > 0,\n  0..0..0,\n  // 0 x 0 x 0 ===========================================================\n  0 && 0 && 0,\n  (0 && 0) || 0,\n  {\n    (0 && o) = 0;\n  },\n  0 && 0 + 0,\n  0 && 0 * 0,\n  0 && 0 & 0,\n  0 && 0 << 0,\n  0 && 0 == 0,\n  0 && 0 > 0,\n  0 && 0..0,\n  0 || (0 && 0),\n  0 || 0 || 0,\n  {\n    (0 || o) = 0;\n  },\n  0 || 0 + 0,\n  0 || 0 * 0,\n  0 || 0 & 0,\n  0 || 0 << 0,\n  0 || 0 == 0,\n  0 || 0 > 0,\n  0 || 0..0,\n  {\n    o = 0 && 0;\n  },\n  {\n    o = 0 || 0;\n  },\n  {\n    o = {\n      o = 0;\n    };\n  },\n  {\n    o = 0 + 0;\n  },\n  {\n    o = 0 * 0;\n  },\n  {\n    o = 0 & 0;\n  },\n  {\n    o = 0 << 0;\n  },\n  {\n    o = 0 == 0;\n  },\n  {\n    o = 0 > 0;\n  },\n  {\n    o = 0..0;\n  },\n  0 + 0 && 0,\n  0 + 0 || 0,\n  {\n    (0 + o) = 0;\n  },\n  0 + 0 + 0,\n  0 + 0 * 0,\n  (0 + 0) & 0,\n  (0 + 0) << 0,\n  0 + 0 == 0,\n  0 + 0 > 0,\n  0 + 0..0,\n  0 * 0 && 0,\n  0 * 0 || 0,\n  {\n    (0 * o) = 0;\n  },\n  0 * 0 + 0,\n  0 * 0 * 0,\n  (0 * 0) & 0,\n  (0 * 0) << 0,\n  0 * 0 == 0,\n  0 * 0 > 0,\n  0 * 0..0,\n  0 & 0 && 0,\n  0 & 0 || 0,\n  {\n    (0 & o) = 0;\n  },\n  0 & (0 + 0),\n  0 & (0 * 0),\n  0 & 0 & 0,\n  0 & (0 << 0),\n  (0 & 0) == 0,\n  0 & 0 > 0,\n  0 & 0..0,\n  0 << 0 && 0,\n  0 << 0 || 0,\n  {\n    (0 << o) = 0;\n  },\n  0 << (0 + 0),\n  0 << (0 * 0),\n  (0 << 0) & 0,\n  (0 << 0) << 0,\n  (0 << 0) == 0,\n  0 << 0 > 0,\n  0 << 0..0,\n  0 == 0 && 0,\n  0 == 0 || 0,\n  {\n    (0 == o) = 0;\n  },\n  0 == 0 + 0,\n  0 == 0 * 0,\n  0 == (0 & 0),\n  0 == (0 << 0),\n  (0 == 0) == 0,\n  (0 == 0) > 0,\n  0 == 0..0,\n  0 > 0 && 0,\n  0 > 0 || 0,\n  {\n    (0 > o) = 0;\n  },\n  0 > 0 + 0,\n  0 > 0 * 0,\n  0 > 0 & 0,\n  0 > 0 << 0,\n  (0 > 0) == 0,\n  (0 > 0) > 0,\n  0 > 0..0,\n  0..0 && 0,\n  0..0 || 0,\n  {\n    0..o = 0;\n  },\n  0..0 + 0,\n  0..0 * 0,\n  0..0 & 0,\n  0..0 << 0,\n  0..0 == 0,\n  0..0 > 0,\n  0..0..0,\n  // 0 x (0 x 0) ===========================================================\n  0 && 0 && 0,\n  0 && (0 || 0),\n  0 &&\n    ({\n      o = 0;\n    }),\n  0 && 0 + 0,\n  0 && 0 * 0,\n  0 && 0 & 0,\n  0 && 0 << 0,\n  0 && 0 == 0,\n  0 && 0 > 0,\n  0 && (0..0),\n  0 || (0 && 0),\n  0 || 0 || 0,\n  0 ||\n    ({\n      o = 0;\n    }),\n  0 || 0 + 0,\n  0 || 0 * 0,\n  0 || 0 & 0,\n  0 || 0 << 0,\n  0 || 0 == 0,\n  0 || 0 > 0,\n  0 || (0..0),\n  {\n    o = 0 && 0;\n  },\n  {\n    o = 0 || 0;\n  },\n  {\n    o = {\n      o = 0;\n    };\n  },\n  {\n    o = 0 + 0;\n  },\n  {\n    o = 0 * 0;\n  },\n  {\n    o = 0 & 0;\n  },\n  {\n    o = 0 << 0;\n  },\n  {\n    o = 0 == 0;\n  },\n  {\n    o = 0 > 0;\n  },\n  {\n    o = 0..0;\n  },\n  0 + (0 && 0),\n  0 + (0 || 0),\n  0 +\n    ({\n      o = 0;\n    }),\n  0 + (0 + 0),\n  0 + 0 * 0,\n  0 + (0 & 0),\n  0 + (0 << 0),\n  0 + (0 == 0),\n  0 + (0 > 0),\n  0 + (0..0),\n  0 * (0 && 0),\n  0 * (0 || 0),\n  0 *\n    ({\n      o = 0;\n    }),\n  0 * (0 + 0),\n  0 * (0 * 0),\n  0 * (0 & 0),\n  0 * (0 << 0),\n  0 * (0 == 0),\n  0 * (0 > 0),\n  0 * (0..0),\n  0 & (0 && 0),\n  0 & (0 || 0),\n  0 &\n    ({\n      o = 0;\n    }),\n  0 & (0 + 0),\n  0 & (0 * 0),\n  0 & (0 & 0),\n  0 & (0 << 0),\n  0 & (0 == 0),\n  0 & (0 > 0),\n  0 & (0..0),\n  0 << (0 && 0),\n  0 << (0 || 0),\n  0 <<\n    ({\n      o = 0;\n    }),\n  0 << (0 + 0),\n  0 << (0 * 0),\n  0 << (0 & 0),\n  0 << (0 << 0),\n  0 << (0 == 0),\n  0 << (0 > 0),\n  0 << (0..0),\n  0 == (0 && 0),\n  0 == (0 || 0),\n  0 ==\n    ({\n      o = 0;\n    }),\n  0 == 0 + 0,\n  0 == 0 * 0,\n  0 == (0 & 0),\n  0 == (0 << 0),\n  0 == (0 == 0),\n  0 == (0 > 0),\n  0 == (0..0),\n  0 > (0 && 0),\n  0 > (0 || 0),\n  0 >\n    ({\n      o = 0;\n    }),\n  0 > 0 + 0,\n  0 > 0 * 0,\n  0 > 0 & 0,\n  0 > 0 << 0,\n  0 > (0 == 0),\n  0 > (0 > 0),\n  0 > (0..0),\n];\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/precedence.rs\""
  },
  {
    "path": "tests/output-ext/expressions/range.f.rs",
    "content": "fn q() {\n  if let 0..3 = 0 {\n  }\n  if let 0..Y = 0 {\n  }\n  if let X..3 = 0 {\n  }\n  if let X..Y = 0 {\n  }\n\n  if let 0..=3 = 0 {\n  }\n  if let 0..=Y = 0 {\n  }\n  if let X..=3 = 0 {\n  }\n  if let X..=Y = 0 {\n  }\n\n  if let 0..=3 = 0 {\n  }\n  if let 0..=Y = 0 {\n  }\n  if let X..=3 = 0 {\n  }\n  if let X..=Y = 0 {\n  }\n\n  if let 0.. = 0 {\n  }\n  if let X.. = 0 {\n  }\n\n  if let ..0 = 0 {\n  }\n  if let ..Y = 0 {\n  }\n\n  if let ..=3 = 0 {\n  }\n  if let ..=Y = 0 {\n  }\n\n  let 0..1;\n  let 0..=1;\n  let 0..=1;\n\n  let ..0;\n  let ..=0;\n  let 0..;\n\n  for _ in [0..1] {\n  }\n  for _ in [0..=1] {\n  }\n  for _ in [0..] {\n  }\n  for _ in [..1] {\n  }\n  for _ in [..=1] {\n  }\n  for _ in [b..c] {\n  }\n  for _ in [0..1, 2..3] {\n  }\n  for _ in [0..=1] {\n  }\n  for _ in 0..2 {\n  }\n  for _ in 0..=2 {\n  }\n  for _ in 0..=3 {\n  }\n  for _ in 0..=3 + 1 {\n  }\n  for _ in 0..=5 {\n  }\n  for _ in 0..=1 + 5 {\n  }\n  for _ in 1..=1 {\n  }\n  for _ in 1..=1 + 1 {\n  }\n  for _ in 0..13 + 13 {\n  }\n  for _ in 0..=13 - 7 {\n  }\n  for _ in 0..=f() {\n  }\n  for _ in 0..=1 + f() {\n  }\n  let _ = ..11 - 1;\n  let _ = ..11;\n  let _ = ..11;\n  let _ = 1..=11;\n  let _ = f() + 1..=f();\n  for _ in 1..=ONE {\n  }\n\n  let a = 0.0..1.1;\n  if let 2..=0 = 3 {\n  }\n  if let 2..=0 = 3 {\n  }\n  if let 2..0 = 3 {\n  }\n  if let ..0 = 3 {\n  }\n  if let ..=0 = 3 {\n  }\n  if let 0.. = 5 {\n  }\n  if let 0..5 = 4 {\n  }\n  if let 0..=5 = 4 {\n  }\n  if let -1..=0 | 2..3 | 4 = x {\n  }\n  for x in -9 + 1..=9 - 2 {\n  }\n  if let [3..=14, ..] = xs {\n  }\n  match 0 {\n    X.. | 0.. | 'a'.. | 0.0f32.. => {}\n    ..=X | ..X => {}\n    ..=0 | ..0 => {}\n    ..='a' | ..'a' => {}\n    ..=0.0f32 | ..0.0f32 => {}\n    ..a => {}\n    a.. => {}\n    1 | -3..0 => {}\n    y @ (0..5 | 6) => {}\n    y @ -5.. => {}\n    y @ ..-7 => {}\n    box 0..=9 => {}\n    box 10..=15 => {}\n    box 16..=20 => {}\n    0..1 => {}\n    0..1 => {}\n    0..1 => {}\n  }\n  [\n    0..1,\n    0..1,\n    0..1,\n    0..1,\n    1..,\n    ..,\n    0..=1,\n    0..=1,\n    0..=1,\n    // 0...1,\n    // &0...9,\n    &10..=15,\n    // box 0...9,\n    box 0..=9,\n    ..1,\n    ..=1,\n    0u32..10i32,\n    *a..,\n  ];\n}\nfn f() {\n  a..\n}\nfn f() {\n  a..b\n}\nfn f() {\n  a()..b()\n}\nfn foo(-128..=127: i8) {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/expressions/range.rs\""
  },
  {
    "path": "tests/output-ext/features/arbitrary_enum_discriminant.f.rs",
    "content": "#![feature(arbitrary_enum_discriminant)]\n\nenum Enum {\n  Unit = 1,\n  Tuple() = 2,\n  Struct {} = 3,\n}\n#[repr(u8)]\nenum Enum {\n  Unit = 3,\n  Tuple(u16) = 2,\n  Struct {\n    a: u8,\n    b: u16,\n  } = 1,\n}\n#[repr(i8)]\nenum E2 {\n  A = 7,\n  B = -2,\n}\n#[repr(C)]\nenum E3 {\n  A = 42,\n  B = 100,\n}\n#[repr(i128)]\nenum E4 {\n  A = 0x1223_3445_5667_7889,\n  B = -0x1223_3445_5667_7889,\n}\nenum ADT {\n  First(u32, u32),\n  Second(u64),\n}\nenum CLike1 {\n  A,\n  B,\n  C,\n  D,\n}\nenum CLike2 {\n  A = 5,\n  B = 2,\n  C = 19,\n  D,\n}\n#[repr(i8)]\nenum CLike3 {\n  A = 5,\n  B,\n  C = -1,\n  D,\n}\nenum ADT {\n  First(u32, u32),\n  Second(u64),\n}\nenum NullablePointer {\n  Something(&'static u32),\n  Nothing,\n}\n#[repr(isize)]\nenum Mixed {\n  Unit = 3,\n  Tuple(u16) = 2,\n  Struct {\n    a: u8,\n    b: u16,\n  } = 1,\n}\nenum MyWeirdOption<T> {\n  None = 0,\n  Some(T) = std::mem::size_of::<T>(),\n}\nenum Test {\n  A(Box<u64>) = 0,\n  B(usize) = (u64::MAX as i128) + 1,\n}\npub enum Foo {\n  A = 2,\n}\npub enum Bar {\n  A(Foo),\n  B,\n  C,\n}\npub enum Size {\n  One = 1,\n  Two = 2,\n  Three = 3,\n}\n#[repr(i128)]\nenum Signed {\n  Zero = 0,\n  Staircase = 0x01_02_03_04_05_06_07_08_09_0a_0b_0c_0d_0e_0f,\n  U64Limit = (u64::MAX as i128) + 1,\n  SmallNegative = -1,\n  BigNegative = i128::MIN,\n  Next,\n}\n#[repr(u128)]\nenum Unsigned {\n  Zero = 0,\n  Staircase = 0x01_02_03_04_05_06_07_08_09_0a_0b_0c_0d_0e_0f,\n  U64Limit = (u64::MAX as u128) + 1,\n  Next,\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/arbitrary_enum_discriminant.rs\""
  },
  {
    "path": "tests/output-ext/features/associated_type_bounds.f.rs",
    "content": "#![feature(associated_type_bounds)]\n\ntype X = A<B: C>;\n\nfn f<F>(_: F) where F: for<'a> Trait<Output: 'a> {}\nfn f<'b, F>() where for<'a> F: Iterator<Item: 'a> + 'b {}\n\ntrait A: MP {\n  fn f<IM>(&self) -> i32 where for<'a> IM: T<T: U<<Self as MP>::T<'a>>>;\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/associated_type_bounds.rs\""
  },
  {
    "path": "tests/output-ext/features/async_closure.f.rs",
    "content": "#![feature(async_closure)]\n\nconst X = async |x| 0;\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/async_closure.rs\""
  },
  {
    "path": "tests/output-ext/features/auto_traits.f.rs",
    "content": "#![feature(auto_traits)]\n\nauto trait T {}\nunsafe auto trait T {}\npub auto trait T {}\npub unsafe auto trait T {}\n\nauto trait T {\n  #![attr]\n}\n\n#[attr_0]\nauto trait T {\n  #![attr_1] // comment\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/auto_traits.rs\""
  },
  {
    "path": "tests/output-ext/features/const_generics_defaults.f.rs",
    "content": "#![feature(const_generics_defaults)]\n\nstruct Foo<const N: usize = 1, const N2: usize = 2>;\nstruct Bar<const N: usize, const N2: usize = { N + 1 }>;\nstruct Lots<\n  const N1BlahFooUwU: usize = { 10 + 28 + (1872 / 10) * 3 },\n  const N2SecondParamOhmyyy: usize = { N1BlahFooUwU / 2 + 10 * 2 }\n>;\nstruct Lott<\n  const N1BlahFooUwU: usize = {\n    // 1\n    1\n  },\n  const N2SecondParamOhmyyy: usize = { 2 }\n>;\nstruct NamesRHard<const N: usize = { 1 + 1 + 1 + 1 + 1 + 1 }>;\nstruct FooBar<\n  const LessThan100ButClose: usize = {\n    1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1\n  }\n>;\nstruct FooBarrrrrrrr<\n  const N: usize = {\n    13478234326456456444323871 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1 +\n      1\n  }\n>;\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/const_generics_defaults.rs\""
  },
  {
    "path": "tests/output-ext/features/const_trait_impl.f.rs",
    "content": "#![feature(const_trait_impl)]\n\nimpl const T for S {}\nimpl<T> const T for S {}\n\nimpl const T for S {\n  #![attr]\n}\n\n#[attr_0]\nimpl const T for S {\n  #![attr_1] // comment\n}\n\nfn foo() -> u8 where Self: ~const Bar {}\nstruct S {\n  D: dyn ~const ?Q,\n  E: dyn ~const Q + 'a,\n  F: dyn ~const Q,\n}\n\nstruct S<\n  T: ~const ?for<'a> Tr<'a> + 'static + ~const std::ops::Add,\n  T: ~const ?for<'a: 'b> m::Trait<'a>\n>;\ntrait F {\n  fn bar() where Self: ~const Foo;\n  fn c<T: ~const Bar>();\n}\nconst fn qux<T: ~const Foo>() {}\nconst fn test1<T: ~const Foo + Bar>() {}\nconst fn test2<T: ~const Foo + ~const Bar>() {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/const_trait_impl.rs\""
  },
  {
    "path": "tests/output-ext/features/decl_macro.f.rs",
    "content": "#![feature(decl_macro)]\n\nmacro m() {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/decl_macro.rs\""
  },
  {
    "path": "tests/output-ext/features/destructuring_assignment.f.rs",
    "content": "#![feature(destructuring_assignment)]\n\nfn main() {\n  _ = 1;\n  _ = DropRecorder(1);\n  _val = DropRecorder(2);\n  (_,) = (1, 2);\n  (.., a) = (1, 2);\n  (..) = (3, 4);\n  ((a, b), c) = ((2, 3), d);\n  ((a, .., b), .., ..) = ((4, 5), ());\n  (a, b) = (0, 1);\n  (*foo(&mut x), *foo(&mut x)) = (5, 6);\n  (a, _) = (8, 9);\n  (a, .., b) = (1, 2);\n  (a, a, b) = (1, 2);\n  (a, b) += (3, 4);\n  (a, b) = (0, 1);\n  (a, b) = (3, 4);\n  (b, ..) = (5, 6, 7);\n  (b, a) = (a, b);\n  (C, ..) = (0, 1);\n  (c, d) = (\"c\".to_owned(), \"d\".to_owned());\n  (d, c) = (c, d);\n  test() = TupleStruct(0, 0);\n  (x, _) = (DropRecorder(3), DropRecorder(4));\n  [_, a, _] = [1, 2, 3];\n  [_] = [1, 2];\n  [..] = [1, 2, 3];\n  [a, .., b, ..] = [0, 1];\n  [a, .., b, c] = [1, 2, 3, 4, 5];\n  [a, a, b] = [1, 2];\n  [a, b] += [3, 4];\n  [a, b] = [0, 1];\n  [a, b] = [3, 4];\n  [c, ..] = [5, 6, 6];\n  <Alias<isize> as Test>::test() = TupleStruct(0, 0);\n  Alias::SingleVariant(a, b) = Alias::SingleVariant(9, 10);\n  Enum::SingleVariant(_) = Enum::SingleVariant(1, 2);\n  Enum::SingleVariant(a, .., b, ..) = Enum::SingleVariant(0, 1);\n  Enum::SingleVariant(a, a, b) = Enum::SingleVariant(1, 2);\n  Enum::SingleVariant(a, b) = Enum::SingleVariant(7, 8);\n  (S { x: a, ..s } = S { x: 3, y: 4 });\n  (S { x: a, y: b } += s);\n  (S { x: a, y: b } = s);\n  (Struct { .. } = Struct { a: 1, b: 4 });\n  (Struct { a, .. } = Struct { a: 1, b: 3 });\n  Struct { a, .. };\n  (Struct { a, ..d } = Struct { a: 1, b: 2 });\n  (Struct { a, b } = Struct { a: 0, b: 1 });\n  (Struct { a, b, c } = Struct { a: 0, b: 1 });\n  (Struct { a: _, b } = Struct { a: 1, b: 2 });\n  (Struct { a: b, b: a } = Struct { a: 1, b: 2 });\n  (Struct { a: TupleStruct((a, b), c), b: [d] } = Struct {\n    a: TupleStruct((0, 1), 2),\n    b: [3],\n  });\n  test() = TupleStruct(0, 0);\n  TupleStruct(_, a) = TupleStruct(2, 2);\n  TupleStruct(_) = TupleStruct(1, 2);\n  TupleStruct(..) = TupleStruct(3, 4);\n  TupleStruct(5, 6).assign(&mut a, &mut b);\n  TupleStruct(a, .., b, ..) = TupleStruct(0, 1);\n  TupleStruct(a, .., b) = TupleStruct(1, 2);\n  TupleStruct(a, a, b) = TupleStruct(1, 2);\n  TupleStruct(a, b) = TupleStruct(0, 1);\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/destructuring_assignment.rs\""
  },
  {
    "path": "tests/output-ext/features/generators.f.rs",
    "content": "#![feature(generators)]\n\n[\n  static move || {\n    let a = A::<Box<dyn D>> { b: E::r() };\n    yield ();\n  },\n  |_| {\n    a!(\"-> {}\", {\n      yield;\n    });\n  },\n];\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/generators.rs\""
  },
  {
    "path": "tests/output-ext/features/if_let_guard.f.rs",
    "content": "#![feature(if_let_guard)]\n\nfn main() {\n  match e {\n    A(ref u) if let a = b && let c = d => {}\n    A(ref u) if let x { a: b, c: d } = e && let f = g => {}\n    A(a) if let A(b) = a && let A(p) = b && p == z => {}\n  }\n  match e {\n    A(a) if let A(b) = a && let A(p) = b && p == z => {}\n    _ => {}\n  }\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/if_let_guard.rs\""
  },
  {
    "path": "tests/output-ext/features/inline_const.f.rs",
    "content": "#![feature(inline_const_pat)]\n\nfn f() {\n  const {}\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/inline_const.rs\""
  },
  {
    "path": "tests/output-ext/features/inline_const_pat.f.rs",
    "content": "#![feature(inline_const_pat)]\n\nfn f() {\n  match () {\n    y @ 0..const { 5 + 1 } => {}\n    1..=const { two() } => {}\n    const { one() } => {}\n  }\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/inline_const_pat.rs\""
  },
  {
    "path": "tests/output-ext/features/let_chains.f.rs",
    "content": "#![feature(let_chains)]\n\nfn f() {\n  if h && let A(x) = e {\n  }\n  if a && let c = d && 1 == 1 {\n  }\n  if a && let c = d && 1 == 1 {\n  }\n  if true && let x = 1 {\n    let _ = x;\n  }\n  if let a = b && let c = d && 1 == 1 {\n  }\n  if let A { .. } = d(7, B) && let C { .. } = d(8, D) {\n  }\n  if let a = &e && let A(ref b) = a && let B = b.c {\n  }\n  if let a = b && let c = d && 1 == 1 {\n  }\n  if let A(_) = d(2, B(2)).c && let D { .. } = d(3, E) {\n  } else {\n  }\n  if let A(a) = e && let A(b) = a && let A(p) = b && p == z {\n  } else {\n  }\n  if let A(v) = x && v.q() {\n  }\n  if let A(_) = Q(0) && let E(_) = R(1) {\n  } else if let G(1) = F(2) {\n  }\n  if let A(ref a) = e && let b = a && let _p = b {\n  }\n  if let A(ref a) = e && let R { c: d, y: _ } = a && let B = d {\n  }\n  while let a = &e && let A(ref b) = a && let B = b.c {}\n  while let A(a) = e && let A(b) = a && let A(p) = b && p == z {}\n  while let A(ref a) = e && let b = a && let _p = b {}\n  while let A(ref a) = e && let R { c: d, y: _ } = a && let B = d {}\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/let_chains.rs\""
  },
  {
    "path": "tests/output-ext/features/let_else.f.rs",
    "content": "#![feature(let_else)]\n\nlet a = 1 else { 2 };\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/let_else.rs\""
  },
  {
    "path": "tests/output-ext/features/negative_impls.f.rs",
    "content": "#![feature(negative_impls)]\n\nimpl !Send for Test {}\nimpl !Send for Foo {}\nimpl !Sync for Foo {}\nimpl !std::marker::Unpin for Foo {}\nimpl !std::panic::RefUnwindSafe for Foo {}\nimpl !std::panic::UnwindSafe for Foo {}\nimpl<T: Send> !A::B for C where T: Copy {}\nimpl<T: Clone> !A for B where T: Sync {}\nimpl !Send for A {}\nimpl !Sync for A {}\nimpl<'a, T> !MyPredicate<'a> for &T where T: 'a {}\nimpl<T> !Foo for &T where T: 'static {}\nimpl<E> !Future for Option<E> where E: Sized {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/negative_impls.rs\""
  },
  {
    "path": "tests/output-ext/features/trait_alias.f.rs",
    "content": "#![feature(trait_alias)]\n\ntrait A =;\ntrait A = std::fmt::Debug + Send;\n\n// source: \"../../../ext/jinx-rust/tests/samples/features/trait_alias.rs\""
  },
  {
    "path": "tests/output-ext/macro/attributes.f.rs",
    "content": "// a\n\n/// b\nfn a() {}\n\nfn b() {\n  //! c\n}\n\n//////////////////////////////////\n// d\n/// let heart = '❤️';\n//////////////////////////////////\n/// e\n/// f\nfn c() {}\n\n/*\n * g\n */\n\n/**\n * h\n */\nfn d() {}\n\nfn e() {\n  /*!\n   * i\n   */\n  //! ```a\n  //! b\n  //! ```\n}\n\n/********************************/\n/*\n * j\n */\n\n/********************************/\n/**\n * k\n */\nfn f() {}\n\n// before\n#[macro_use]\n// after\nextern crate x;\n\na! {\n  /// line 2\n  /// line 3\n  #[a(b, c(d(e(f = \"g\", h = \"i\"))))]\n  pub enum X {\n    /// line 6\n    /// line 7\n    A(B),\n\n    /// line 10\n    C(D),\n  }\n}\n// 5 comments inside a!{}\n\n/// ____\n/// ____\n#[attr_0]\npub type A = Vec<B>;\n\n#[attr_1]\nextern crate b as d;\n\n#![attr_2]\n#![attr_3]\n/**\n * directly below attr_2 and 1 line above attr_3\n */\n\nfn attr_3_3a_target() {\n  #![attr_3a]\n  #[attr_3b]\n  fn attr_3b_target() {}\n\n  #[attr_3c]\n  fn attr_3c_target() {}\n}\n\ntrait foo_C {\n  #![attr_4]\n}\n\n#![attr_6]\n#[attr_5]\nfn main() {\n  // comment\n  #[attr]\n  ();\n  #[attr]\n  [1; 4];\n  #[attr]\n  Foo { data: () };\n  #[attr]\n  if let Some(_) = Some(true) {\n  }\n  #[attr]\n  if let Some(_) = Some(true) {\n  } else if let Some(false) = Some(true) {\n  }\n  #[attr]\n  if true {\n  }\n  #[attr]\n  let _ = 0;\n  #[attr]\n  if true {\n  } else if false {\n  } else {\n  }\n  {\n    #![attr]\n    foo();\n  }\n  #[attr]\n  if true {\n  }\n  #[attr]\n  (0, 1);\n  #[attr]\n  (0,);\n  #[attr]\n  0;\n  #[attr]\n  [1, 2, 3];\n  #[attr]\n  {\n    #![attr]\n  }\n  #[attr]\n  {\n    foo();\n  }\n  #[attr]\n  0;\n  #[attr]\n  expr_mac!();\n  #[attr]\n  foo();\n  #[attr]\n  let x = 1;\n  #[attr]\n  match () {\n    _ => {}\n  }\n  #[attr]\n  match () {\n    #![attr]\n    _ => (),\n  }\n  #[attr]\n  unsafe {/**/}\n  ||\n    #[attr] {\n      return;\n    };\n  let a = #[attr] [1; 4];\n  let a = #[attr] box 0;\n  let a = #[attr] [1, 2, 3];\n  let a = #[attr] Foo { data: () };\n  let a = (#[attr] s).data;\n  let a = (#[attr] t).0;\n  let a = (#[attr] v)[0];\n  let a = #[attr] -0i32;\n  let a = #[attr] !0;\n  let a = #[attr] 'c';\n  let a = #[attr] ..;\n  let a = #[attr] ..0;\n  let a = #[attr] (#[attr] 0,);\n  let a = #[attr] (#[attr] 0, 0);\n  let a = #[attr] ();\n  let a = #[attr] (0, 0);\n  let a = #[attr] (0,);\n  let a = #[attr] 0..;\n  let a = #[attr] 0..0;\n  let a = #[attr] 0;\n  let a = #[attr] 0;\n  let a = #[attr] [0, 0];\n  let a = #[attr] [0; 0];\n  let a = #[attr] { #![attr] };\n  let a = #[attr] {\n    #![attr]\n    let _ = ();\n    ()\n  };\n  let a = #[attr] {\n    #![attr]\n    let _ = ();\n  };\n  let a = #[attr] &(#[attr] 0);\n  let a = #[attr] &0;\n  let a = #[attr] &mut (#[attr] 0);\n  let a = #[attr] &mut 0;\n  let a = #[attr] || {\n    #![attr]\n    #[attr]\n    ()\n  };\n  let a = #[attr] || (#[attr] ());\n  let a = #[attr] 0 + (#[attr] 0);\n  let a = #[attr] 0 as usize;\n  let a = #[attr] 0;\n  let a = #[attr] 0..;\n  let a = #[attr] 0..(#[attr] 0);\n  let a = #[attr] (1i32).clone();\n  let a = #[attr] x! {};\n  let a = #[attr] x!();\n  let a = #[attr] x![];\n  let a = #[attr] false;\n  let a = #[attr] x();\n  let a = #[attr] x!();\n  let a =\n    #[attr] x!(\n      #![attr]\n    );\n  let a = #[attr] x![];\n  let a =\n    #[attr] x![\n      #![attr]\n    ];\n  let a = #[attr] x! {};\n  let a = #[attr] x! {\n    #![attr]\n  };\n  let a = #[attr] Foo { ..s };\n  let a = #[attr] Foo { data: (), ..s };\n  let a = #[attr] Foo { data: () };\n  let a = #[attr] for _ in 0..0 { #![attr] };\n  let a = #[attr] loop { #![attr] };\n  let a = #[attr] match 0 {\n    #![attr]\n    () => (),\n  };\n  let a = #[attr] match 0 {\n    #![attr]\n    _ => (),\n  };\n  let a = #[attr] move || {\n    #![attr]\n    #[attr]\n    ()\n  };\n  let a = #[attr] move || (#[attr] ());\n  let a = #[attr] s.data;\n  let a = #[attr] t.0;\n  let a = #[attr] v[0];\n  let a = #[attr] while false { #![attr] };\n  let a = #[attr] while let None = Some(()) { #![attr] };\n  let a = #[attr] {\n    x += 15;\n  };\n  let a = #[attr] {\n    x += 15;\n  };\n  let a = #[attr] {\n    x = 15;\n  };\n  let a = #[attr] {\n    x = 15;\n  };\n  let a: [(); 0] = #[attr] [];\n  let a: fn(&u32) -> u32 = #[attr] std::clone::Clone::clone;\n  let a = #[attr] 1;\n  let a = |\n    #[allow(C)] a: u32,\n    #[cfg(something)] b: i32,\n    #[cfg_attr(something, cfg(nothing))] #[deny(C)] c: i32\n  | {};\n  qux(3 + (#[attr] 2));\n  foo3(x, #[attr] y, z);\n  while false {\n    let _ = #[attr] {\n      continue;\n    };\n  }\n  while true {\n    let _ = #[attr] {\n      break;\n    };\n  }\n  match (Q { #[attr] C: 1 }) {\n    Q { #[attr] C } => {}\n    Q(#[attr] C) => {}\n    #[attr]\n    _ => {}\n  }\n}\nstatic X: &[Y] = &[#[a(b = \"c\")] 0];\n#[attr]\nconst C: C = C { #[attr] field: 0, #[attr] field: 1 };\n#[attr]\nstruct S;\n#[attr]\nstruct I {\n  #[attr] i: u8,\n  #[attr] pub i: u8,\n}\n#[attr]\nstruct I(#[attr] u8, #[attr] pub u8);\n#[attr]\nstruct BreaksWithComment(\n  #[attr] u8,\n  #[attr] // comment\n  pub u8,\n);\nstruct C {\n  #[attr]\n  /// below attr\n  a: b,\n}\nstruct Q {\n  #[attr] C: i32,\n}\nstruct A<#[attr] 'a>();\nstruct A<#[attr] I>(I);\nenum E {\n  #[attr] C(i32),\n}\nenum E<#[attr] 'b> {}\nenum E<#[attr] J> {}\ntrait T {\n  #![attr]\n}\ntrait T<#[attr] 'c> {}\ntrait T<#[attr] K> {}\ntype Y<#[attr] 'd> = ();\ntype Y<#[attr] L> = ();\n#[attr]\ntype A = fn(#[a1] u8, #[a2] ...);\nimpl<#[attr] 'e> A<'e> {}\nimpl<#[attr] M> A<M> {}\nimpl<#[attr] 'f> T<'f> for A<'f> {}\nimpl<#[attr] N> T<N> for A<N> {}\n#[attr]\n#[attr]\nmacro_rules! m_e {}\n#[attr]\nmacro_rules! m {}\n\n#[attr]\nfn f() {}\n#[attr]\nfn f(#[a1] a: u8) {\n  let f = |#[a2] W(x), #[a3] y| ();\n}\nfn f<#[attr] 'g>() {}\nfn f<'e, #[attr] 'g>() {}\nfn f<#[attr] G>() {}\nfn f<E, #[attr] G>() {}\nfn f() where for<#[attr] 'i> X: for<#[attr] 'i> Y {}\nfn f(#[d(true)] a: i32, #[a2] b: i32, #[what = \"how\"] c: u32) {}\nfn f(#[a1] #[a2] a: i32, #[what = \"how\"] b: i32, #[e(true)] c: u32) {}\nfn b(#[cfg(x)] x: i32, y: i32) -> i32 {}\nfn f(\n  #[a1] #[a2] &self,\n  #[a1] #[a2] a: i32,\n  #[what = \"how\"] b: i32,\n  #[f(true)] c: u32\n) {}\nfn c(#[cfg(foo)] &mut self, #[deny(C)] b: i32) {}\n\n#[a = \"q\"]\n#[b = \"q\"]\nmod a {\n  #![c = \"q\"]\n}\n#[a = \"q\"]\npub static X: u8 = ();\n#[a = \"q\"]\npub fn f() {}\n#[a = \"q\"]\npub mod a {}\n#[a = \"q\"]\nextern \"C\" {}\n\n//(#[b(c(#(d = #e),*))]);\na!(#[b(c(#(d = #e),*))]);\n\n//(#![b(c(#(d = #e),*))]);\na!(\n  #![b(c(#(d = #e),*))]\n);\n\n#[attr]\nextern \"C\" {\n  fn ffi(#[a1] a: i32, #[a2] ...);\n}\n#[attr]\nunsafe extern \"C\" fn f(a: i32, #[a1] mut args: ...) {}\n\nimpl W {\n  #[attr]\n  fn f(#[a1] self, #[a2] a: u8) {}\n  #[attr]\n  fn f(#[a1] &self, #[a2] a: u8) {}\n  #[attr]\n  fn f<'a>(#[a1] &'a mut self, #[a2] a: u8) {}\n  #[attr]\n  fn f<'a>(#[a1] self: Box<Self>, #[a2] a: u8) {}\n  #[attr]\n  fn f(#[a1] #[a2] a: u8, #[a3] b: u8) {}\n}\n\ntrait A {\n  #[attr]\n  fn f(#[a1] self, #[a2] a: u8);\n  #[attr]\n  fn f(#[a1] &self, #[a2] a: u8);\n  #[attr]\n  fn f<'a>(#[a1] &'a mut self, #[a2] a: u8);\n  #[attr]\n  fn f<'a>(#[a1] self: Box<Self>, #[a2] a: u8, #[a3] b: Vec<u8>);\n  #[attr]\n  fn f(#[a1] #[a2] a: u8, #[a3] b: u8);\n}\n\n// directly above #![doc(...\n#![doc(\n  ___ = \"____________________________________________________________\",\n  ___________________ = \"_________________________________________________\",\n  ______________ = \"_________________________________________________\",\n  ___________________ = \"_________________________________________________\",\n  a(b(c(d)))\n)]\n\n//! 1 line below #![doc(...\n\n#![attr]\n\n//! aaa\n\n// bbb\n\n// ccc\n#![attr(b)]\n\n// ddd\n\n/// eee\n/// eee\n/// eee\n/// eee\n\n/// fff\nimpl Bar {\n  /// 0\n  /// 1\n  /// 2\n  /// 3\n  #[attr]\n  #[doc = \" ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ ___ \"]\n  fn foo(&mut self) -> isize {}\n\n  /// \\n 4\n  /// 5\n  /// 6\n\n  /// \\n\\n 7\n  /// 8\n  /// 9\n  pub fn f2(self) {\n    (foo, bar)\n  }\n\n  #[attr]\n  fn f3(self) -> Q {}\n\n  /// \\n 10 \\n\n\n  #[attrib1]\n  /// 11\n  #[attrib2]\n  // 12\n  /// 13\n  fn f4(self) -> A {}\n\n  // \\n 14\n  #[a(b = \"c\")]\n  fn f5(self) -> X {}\n}\n\nstruct Foo {\n  #[derive(A, B, C, D, E)]\n  foo: usize,\n}\n\n// expected_{x} comments inside each attribute\n\n#[should_panic]\n#[should_panic(expected_0 = \"(\")]\n#[should_panic(expected_1 = /* ( */ \"(\")]\n#[should_panic(\n  /* ((((( */ expected_4 = /* ((((( */ /* ((((( */ \"(\" /* ((((( */\n)]\n#[should_panic(\n  /* (((((((( */ /*\n    (((((((((()(((((((( */\n  expected_3 = \"(\"\n  // ((((((((\n)]\nfn f() {}\n\nfn f() {\n  #[allow(unreachable_code)] // right of attr\n  Some(Err(error));\n\n  #[allow(unreachable_code)]\n  // below attr\n  Some(Err(error));\n}\n\nfn f() {\n  #![this_is_an_inner_attribute(foo)]\n\n  foo();\n}\n\nimpl InnerAttributes() {\n  #![this_is_an_inner_attribute(foo)]\n\n  fn f() {}\n}\n\nmod InnerAttributes {\n  #![this_is_an_inner_attribute(foo)]\n}\n\nfn f() {\n  // Local\n  #[attr(on(local))]\n  let x = 3;\n\n  // Item\n  #[attr(on(item))]\n  use foo;\n\n  // Expr\n  #[attr(on(expr))]\n  {\n  }\n\n  // Semi\n  #[attr(on(semi))]\n  foo();\n\n  // Mac\n  #[attr(on(mac))]\n  foo!();\n}\n\n#[derive(\n  Add,\n  Sub,\n  Mul,\n  Div,\n  Clone,\n  Copy,\n  Eq,\n  PartialEq,\n  Ord,\n  PartialOrd,\n  Debug,\n  Hash,\n  Serialize,\n  Mul\n)]\n\n///\n\n#[derive(\n  Add,\n  Sub,\n  Mul,\n  Div,\n  Clone,\n  Copy,\n  Eq,\n  PartialEq,\n  Ord,\n  PartialOrd,\n  Debug,\n  Hash,\n  Serialize,\n  Deserialize\n)]\npub struct HP(pub u8);\n\n//\nstruct A {\n  #[doc = \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"] b: i32,\n}\n\n#[cfg(\n  feature = \"this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n)]\npub fn foo() {}\n\n//\n#[clippy::bar]\n#[clippy::bar(a, b, c)]\npub fn foo() {}\n\nmod v {\n  #[derive(Debug, StructOpt)]\n  #[structopt(about = \"x\")]\n  pub struct Params {\n    #[structopt(help = \"x\")]\n    server: String,\n    #[structopt(help = \"x\")]\n    first_name: String,\n    #[structopt(help = \"x\")]\n    last_name: String,\n    #[structopt(\n      short = \"j\",\n      long = \"job\",\n      help = \"The job to look at\",\n      parse(try_from_str)\n    )]\n    job: Option<Job>,\n  }\n}\n\n#[cfg(\n  not(\n    all(\n      feature = \"std\",\n      any(\n        target_os = \"linux\",\n        target_os = \"android\",\n        target_os = \"netbsd\",\n        target_os = \"dragonfly\",\n        target_os = \"haiku\",\n        target_os = \"emscripten\",\n        target_os = \"solaris\",\n        target_os = \"cloudabi\",\n        target_os = \"macos\",\n        target_os = \"ios\",\n        target_os = \"freebsd\",\n        target_os = \"openbsd\",\n        target_os = \"redox\",\n        target_os = \"fuchsia\",\n        windows,\n        all(target_arch = \"wasm32\", feature = \"stdweb\"),\n        all(target_arch = \"wasm32\", feature = \"wasm-bindgen\")\n      )\n    )\n  )\n)]\ntype Os = NoSource;\n\nfn stmt_expr_attributes() {\n  let foo;\n  #[must_use]\n  foo = false;\n}\n\nfn a() {\n  match () {\n    #![attr]\n  }\n  match () {#[attr]}\n}\n\nfn x() {\n  match MyEnum {\n  }\n}\n\n// 2 comments inside this attribute\n#[derive(\n  /* ---------- ------------------------------------------------------------------- --------- */\n  Debug,\n  Clone,\n  /* --------------- */ Eq,\n  PartialEq\n)]\nstruct Foo {\n  a: i32,\n  b: T,\n}\n\n// 1 comment inside this attribute\n#[derive(/*Debug, */ Clone)]\nstruct Foo;\n\n#[cfg(\n  all(\n    any(\n      target_arch = \"x86\",\n      target_arch = \"x86_64\",\n      target_arch = \"aarch64\",\n      target_arch = \"powerpc64\",\n      target_arch = \"powerpc64le\",\n      target_arch = \"mips64\",\n      target_arch = \"s390x\",\n      target_arch = \"sparc64\"\n    )\n  )\n)]\nconst MIN_ALIGN: usize = 16;\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/attributes.rs\""
  },
  {
    "path": "tests/output-ext/macro/macro.invocation.f.rs",
    "content": "declare_clippy_lint! {\n    /// ### q\n    /// ```rust\n    /// let b: Vec<&str> = vec![];\n    /// if !b.is_empty() {\n    ///     panic!(q: {:?}\", b);\n    /// }\n    /// ```\n    /// Use instead:\n    /// ```rust\n    /// let b: Vec<&str> = vec![];\n    /// assert!(b.is_empty(), \"there are sad people: {:?}\", b);\n    /// ```\n    #[clippy::version = \"1.57.0\"]\n    pub MANUAL_ASSERT,\n    pedantic,\n    \"`panic!` and only a `panic!` in `if`-then statement\"\n}\n\nfn aux<Xs: HList, Ys: HList>(xs: Xs, ys: Ys) -> Expr!(Xs + Ys) where Xs: Add<Ys> {\n  xs + ys\n}\n\ndeclare_lint_pass!(Attributes => [\n    INLINE_ALWAYS,\n    DEPRECATED_SEMVER,\n    USELESS_ATTRIBUTE,\n    BLANKET_CLIPPY_RESTRICTION_LINTS,\n]);\n\nfn main() {\n  let xs: HList!(&str, bool, Vec<u64>) = hlist!(\"foo\", false, vec![]);\n  let ys: HList!(u64, [u8; 3], ()) = hlist!(0, [0, 1, 2], ());\n  let zs: Expr!(\n    HList![&str] +\n      HList![bool] +\n      HList![Vec<u64>] +\n      (HList![u64] + HList![[u8; 3], ()]) +\n      HList![]\n  ) = aux(xs, ys);\n  higher_order!(subst ($x:expr, $y:expr, $foo:expr) => (($x + $y, $foo)));\n  assert_eq!(zs, hlist![\"foo\", false, vec![], 0, [0, 1, 2], ()]);\n  quote!(fn $name() -> bool { true });\n  impl_lint_pass!(Arithmetic => [INTEGER_ARITHMETIC, FLOAT_ARITHMETIC]);\n  let result =\n    quote! {\n        macro_rules! generated_foo {\n            (1 $$x:expr $$($$y:tt,)* $$(= $$z:tt)*) => {};\n        }\n    };\n  if\n    !matches!(\n      macro_name.as_str(),\n      \"assert_eq\" | \"debug_assert_eq\" | \"assert_ne\" | \"debug_assert_ne\"\n    )\n  {\n  }\n  if\n    matches!(cx.tcx.type_of(id).kind(), ty::Adt(adt, _) if ty_adt.did() == adt.did())\n  {\n  }\n  if\n    !matches!(\n      get_expr_use_or_unification_node(tcx, expr),\n      None |\n        Some((\n          Node::Stmt(Stmt {\n            kind: StmtKind::Expr(_) |\n            StmtKind::Semi(_) |\n            StmtKind::Local(Local {\n              pat: Pat {\n                kind: PatKind::Wild,\n                ..\n              },\n              ..\n            }),\n            ..\n          }),\n          _,\n        ))\n    )\n  {\n  }\n  if_chain! {\n        if let ExprKind::If(cond, then, None) = expr.kind;\n        if !matches!(cond.kind, ExprKind::Let(_));\n        if !expr.span.from_expansion();\n        let then = peel_blocks_with_stmt(then);\n        if let Some(macro_call) = root_macro_call(then.span);\n        if cx.tcx.item_name(macro_call.def_id) == sym::panic;\n        if !cx.tcx.sess.source_map().is_multiline(cond.span);\n        if let Some(format_args) = FormatArgsExpn::find_nested(cx, then, macro_call.expn);\n        then {\n            let mut applicability = Applicability::MachineApplicable;\n            let format_args_snip = snippet_with_applicability(cx, format_args.inputs_span(), \"..\", &mut applicability);\n            let cond = cond.peel_drop_temps();\n            let (cond, not) = match cond.kind {\n                ExprKind::Unary(UnOp::Not, e) => (e, \"\"),\n                _ => (cond, \"!\"),\n            };\n            let cond_sugg = sugg::Sugg::hir_with_applicability(cx, cond, \"..\", &mut applicability).maybe_par();\n            let sugg = format!(\"assert!({not}{cond_sugg}, {format_args_snip});\");\n            span_lint_and_sugg(\n                cx,\n                MANUAL_ASSERT,\n                expr.span,\n                \"only a `panic!` in `if`-then statement\",\n                \"try\",\n                sugg,\n                Applicability::MachineApplicable,\n            );\n        }\n    }\n  if_chain! {\n        if meets_msrv(msrv.as_ref(), &msrvs::TOOL_ATTRIBUTES);\n        // check cfg_attr\n        if attr.has_name(sym::cfg_attr);\n        if let Some(items) = attr.meta_item_list();\n        if items.len() == 2;\n        // check for `rustfmt`\n        if let Some(feature_item) = items[0].meta_item();\n        if feature_item.has_name(sym::rustfmt);\n        // check for `rustfmt_skip` and `rustfmt::skip`\n        if let Some(skip_item) = &items[1].meta_item();\n        if skip_item.has_name(sym!(rustfmt_skip)) ||\n            skip_item.path.segments.last().expect(\"empty path in attribute\").ident.name == sym::skip;\n        // Only lint outer attributes, because custom inner attributes are unstable\n        // Tracking issue: https://github.com/rust-lang/rust/issues/54726\n        if attr.style == AttrStyle::Outer;\n        then {\n            span_lint_and_sugg(\n                cx,\n                DEPRECATED_CFG_ATTR,\n                attr.span,\n                \"`cfg_attr` is deprecated for rustfmt and got replaced by tool attributes\",\n                \"use\",\n                \"#[rustfmt::skip]\".to_string(),\n                Applicability::MachineApplicable,\n            );\n        }\n    }\n  if_chain! {\n        if let ExprKind::Binary(ref op, left, right) = &expr.kind;\n        if let Some((candidate, check)) = normalize_le_ge(op, left, right);\n        if let Some((from, to)) = get_types_from_cast(check, INTS, \"max_value\", \"MAX\");\n\n        then {\n            Conversion::try_new(candidate, from, to)\n        } else {\n            None\n        }\n    }\n  let help = format!(\n    \"because `{}` is the {} value for this type, {}\",\n    snippet(cx, culprit.expr.span, \"x\"),\n    match culprit.which {\n      ExtremeType::Minimum => \"minimum\",\n      ExtremeType::Maximum => \"maximum\",\n    },\n    conclusion\n  );\n\n  let msg = format!(\n    \"this `{}` can be collapsed into the outer `{}`\",\n    if matches!(inner, IfLetOrMatch::Match(..)) {\n      \"match\"\n    } else {\n      \"if let\"\n    },\n    if outer_is_match {\n      \"match\"\n    } else {\n      \"if let\"\n    }\n  );\n  let mut contents = format!(\n    indoc! {\n      \"\n            #![warn(clippy::{})]\n\n            fn main() {{\n                // test code goes here\n            }}\n        \"\n    },\n    lint_name\n  );\n  format!(\n    \"store.register_{lint_pass}_pass(move || Box::new({module_name}::{camel_name}::new(msrv)));\\n    \",\n    lint_pass = lint.pass,\n    module_name = lint.name,\n    camel_name = to_camel_case(lint.name)\n  );\n  format!(\n    indoc! {\n      r#\"\n            # {}\n\n            [package]\n            name = \"{}\"\n            version = \"0.1.0\"\n            publish = false\n\n            [workspace]\n        \"#\n    },\n    hint,\n    lint_name\n  );\n  match iter.next() {\n    // #[clippy::version = \"version\"] pub\n    Some((TokenKind::Pound, _)) => {\n      match_tokens!(iter, OpenBracket Ident Colon Colon Ident Eq Literal{..} CloseBracket Ident);\n    }\n    // pub\n    Some((TokenKind::Ident, _)) => (),\n    _ => {\n      continue;\n    }\n  }\n  let (name, group, desc) =\n    match_tokens!(\n        iter,\n        // LINT_NAME\n        Ident(name) Comma\n        // group,\n        Ident(group) Comma\n        // \"description\" }\n        Literal{..}(desc) CloseBrace\n        // #[clippy::version = \"version\"]\n        Pound OpenBracket Ident Colon Colon Ident Eq Literal{..} CloseBracket\n        // pub LINT_NAME,\n        Ident Ident(name) Comma\n        // \"description\"\n        Literal{kind: LiteralKind::Str{..},..}(reason)\n        // (\"old_name\",\n        Whitespace OpenParen Literal{kind: LiteralKind::Str{..},..}(old_name) Comma\n        // \"new_name\"),\n        Whitespace Literal{kind: LiteralKind::Str{..},..}(new_name) CloseParen Comma\n    );\n\n  info!(\n    //debug\n    \"{}: sending function_code={:04x} data={:04x} crc=0x{:04X} data={:02X?}\",\n    self.name,\n    function_code,\n    data,\n    crc,\n    output_cmd\n  );\n}\n\ncfg_if! {\n  if #[cfg(feature = \"std_detect_file_io\")] {\n    #[cfg_attr(test, macro_use(println))]\n    extern crate std;\n\n    #[allow(unused_imports)]\n    use std::{ arch, fs, io, mem, sync };\n  } else {\n    #[cfg(test)]\n    #[macro_use(println)]\n    extern crate std;\n\n    #[allow(unused_imports)]\n    use core::{ arch, mem, sync };\n  }\n}\n\nop_utils! {\n  Add;\n  AddAssign;\n  Sub;\n  SubAssign;\n  Mul;\n  MulAssign;\n  Div;\n  DivAssign;\n  Rem;\n  RemAssign;\n  BitXor;\n  BitXorAssign;\n  BitAnd;\n  BitAndAssign;\n  BitOr;\n  BitOrAssign;\n  Shl;\n  ShlAssign;\n  Shr;\n  ShrAssign;\n}\n\nmsrv_aliases! {\n    1,53,0 { OR_PATTERNS, MANUAL_BITS }\n    1,52,0 { STR_SPLIT_ONCE }\n    1,51,0 { BORROW_AS_PTR, UNSIGNED_ABS }\n    1,50,0 { BOOL_THEN }\n    1,47,0 { TAU }\n    1,46,0 { CONST_IF_MATCH }\n    1,45,0 { STR_STRIP_PREFIX }\n    1,43,0 { LOG2_10, LOG10_2 }\n    1,42,0 { MATCHES_MACRO, SLICE_PATTERNS, PTR_SLICE_RAW_PARTS }\n    1,41,0 { RE_REBALANCING_COHERENCE, RESULT_MAP_OR_ELSE }\n    1,40,0 { MEM_TAKE, NON_EXHAUSTIVE, OPTION_AS_DEREF }\n    1,38,0 { POINTER_CAST }\n    1,37,0 { TYPE_ALIAS_ENUM_VARIANTS }\n    1,36,0 { ITERATOR_COPIED }\n    1,35,0 { OPTION_COPIED, RANGE_CONTAINS }\n    1,34,0 { TRY_FROM }\n    1,30,0 { ITERATOR_FIND_MAP, TOOL_ATTRIBUTES }\n    1,28,0 { FROM_BOOL }\n    1,17,0 { FIELD_INIT_SHORTHAND, STATIC_IN_CONST, EXPECT_ERR }\n    1,16,0 { STR_REPEAT }\n    1,24,0 { IS_ASCII_DIGIT }\n}\n\nkot! {\n  struct W {\n    foo: u8,\n    bar: u16,\n  }\n  impl Clone for W {\n    fn clone() -> W {\n      panic!();\n    }\n  }\n}\n\nkot! {\n    a(mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\n    mushkins mushkins) a\n    [mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\n    mushkins mushkins] a\n    {\n        mushkins mushkins mushkins mushkins mushkins mushkins mushkins\n        mushkins mushkins mushkins\n    } a\n}\n\nkot!(mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\nmushkins mushkins);\nkot![mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\nmushkins mushkins];\nkot! {\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n  mushkins;\n}\n\n#[rustc_dummy(mushkins mushkins mushkins mushkins mushkins mushkins mushkins\nmushkins mushkins mushkins)]\n#[rustc_dummy[mushkins mushkins mushkins mushkins mushkins mushkins mushkins\nmushkins mushkins mushkins]]\n#[rustc_dummy {\n    mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\n    mushkins mushkins\n}]\n#[rustc_dummy = \"mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins mushkins\"]\nmatch t.kind() {\n  ty::Int(i) =>\n    find_fit!(i, val, negative,\n                  I8 => [U8] => [I16, I32, I64, I128],\n                  I16 => [U16] => [I32, I64, I128],\n                  I32 => [U32] => [I64, I128],\n                  I64 => [U64] => [I128],\n                  I128 => [U128] => []),\n  ty::Uint(u) =>\n    find_fit!(u, val, negative,\n                  U8 => [U8, U16, U32, U64, U128] => [],\n                  U16 => [U16, U32, U64, U128] => [],\n                  U32 => [U32, U64, U128] => [],\n                  U64 => [U64, U128] => [],\n                  U128 => [U128] => []),\n  _ => None,\n}\nx! {\n    /// [d]: ../b.md#a\n    pub G,\n    d,\n    \"c\",\n    @d = x {\n        b: \"a\",\n    };\n}\nthrow_span_err!(\n  attr.span().unwrap(),\n  &format!(\n    \"the `#[{}{}]` attribute can only be applied to fields of type {}\",\n    name,\n    match meta {\n      Meta::Path(_) => \"\",\n      Meta::NameValue(_) => \" = ...\",\n      Meta::List(_) => \"(...)\",\n    },\n    ty_name\n  )\n);\n\nprovide! { \n    <'tcx> tcx, def_id, other, cdata,\n    explicit_item_bounds => { table }\n    explicit_predicates_of => { table }\n    adt_destructor => {\n        let _ = cdata;\n        tcx.calculate_dtor(def_id, |_,_| Ok(()))\n    }\n    extern_crate => {\n        let r = *cdata.extern_crate.lock();\n        r.map(|c| &*tcx.arena.alloc(c))\n    }\n    reachable_non_generics => {\n        let reachable_non_generics = tcx\n            .exported_symbols(cdata.cnum)\n            .iter()\n            .filter_map(|&(exported_symbol, export_info)| {\n                if let ExportedSymbol::NonGeneric(def_id) = exported_symbol {\n                    Some((def_id, export_info))\n                } else {\n                    None\n                }\n            })\n            .collect();\n\n        reachable_non_generics\n    }\n    dep_kind => {\n        let r = *cdata.dep_kind.lock();\n        r\n    }\n    module_children => {\n        let mut result = SmallVec::<[_; 8]>::new();\n        cdata.for_each_module_child(def_id.index, |child| result.push(child), tcx.sess);\n        tcx.arena.alloc_slice(&result)\n    }\n\n    missing_extern_crate_item => {\n        let r = matches!(*cdata.extern_crate.borrow(), Some(extern_crate) if !extern_crate.is_direct());\n        r\n    }\n\n    used_crate_source => { Lrc::clone(&cdata.source) }\n    debugger_visualizers => { cdata.get_debugger_visualizers() }\n\n    exported_symbols => {\n        let syms = cdata.exported_symbols(tcx);\n\n        // a\n\n        syms\n    }\n}\n\ncfg_if::cfg_if! {\n  if #[cfg(unix)] {\n  } else if\n    #[cfg(\n      any(\n        target_os = \"hermit\",\n        target_os = \"solid_asp3\",\n        all(target_vendor = \"fortanix\", target_env = \"sgx\")\n      )\n    )]\n  {\n  } else if #[cfg(all(windows, not(miri)))] {\n  }\n}\n\nast_fragments! {\n    Expr(P<ast::Expr>) { \"expression\"; one fn visit_expr; fn visit_expr; fn make_expr; }\n    Pat(P<ast::Pat>) { \"pattern\"; one fn visit_pat; fn visit_pat; fn make_pat; }\n    Ty(P<ast::Ty>) { \"type\"; one fn visit_ty; fn visit_ty; fn make_ty; }\n    Stmts(SmallVec<[ast::Stmt; 1]>) {\n        \"statement\"; many fn flat_map_stmt; fn visit_stmt(); fn make_stmts;\n    }\n    Items(SmallVec<[P<ast::Item>; 1]>) {\n        \"item\"; many fn flat_map_item; fn visit_item(); fn make_items;\n    }\n    TraitItems(SmallVec<[P<ast::AssocItem>; 1]>) {\n        \"trait item\";\n        many fn flat_map_trait_item;\n        fn visit_assoc_item(AssocCtxt::Trait);\n        fn make_trait_items;\n    }\n    ImplItems(SmallVec<[P<ast::AssocItem>; 1]>) {\n        \"impl item\";\n        many fn flat_map_impl_item;\n        fn visit_assoc_item(AssocCtxt::Impl);\n        fn make_impl_items;\n    }\n    ForeignItems(SmallVec<[P<ast::ForeignItem>; 1]>) {\n        \"foreign item\";\n        many fn flat_map_foreign_item;\n        fn visit_foreign_item();\n        fn make_foreign_items;\n    }\n    Arms(SmallVec<[ast::Arm; 1]>) {\n        \"match arm\"; many fn flat_map_arm; fn visit_arm(); fn make_arms;\n    }\n    ExprFields(SmallVec<[ast::ExprField; 1]>) {\n        \"field expression\"; many fn flat_map_expr_field; fn visit_expr_field(); fn make_expr_fields;\n    }\n    PatFields(SmallVec<[ast::PatField; 1]>) {\n        \"field pattern\";\n        many fn flat_map_pat_field;\n        fn visit_pat_field();\n        fn make_pat_fields;\n    }\n    GenericParams(SmallVec<[ast::GenericParam; 1]>) {\n        \"generic parameter\";\n        many fn flat_map_generic_param;\n        fn visit_generic_param();\n        fn make_generic_params;\n    }\n    Params(SmallVec<[ast::Param; 1]>) {\n        \"function parameter\"; many fn flat_map_param; fn visit_param(); fn make_params;\n    }\n    FieldDefs(SmallVec<[ast::FieldDef; 1]>) {\n        \"field\";\n        many fn flat_map_field_def;\n        fn visit_field_def();\n        fn make_field_defs;\n    }\n    Variants(SmallVec<[ast::Variant; 1]>) {\n        \"variant\"; many fn flat_map_variant; fn visit_variant(); fn make_variants;\n    }\n    Crate(ast::Crate) { \"crate\"; one fn visit_crate; fn visit_crate; fn make_crate; }\n}\n\nsides_mapping_methods! {\n    MainStartCrossStart::InlineStartBlockStart => {\n        main_start <=> inline_start,\n        cross_start <=> block_start,\n        main_end <=> inline_end,\n        cross_end <=> block_end,\n    }\n}\n\nfuzz_target!(|data: &[u8]| (\n  if let Some(first) = data.first() {\n    let index = *first as usize;\n    if index >= ENCODINGS.len() {\n      return;\n    }\n    let encoding = ENCODINGS[index];\n    dispatch_test(encoding, &data[1..]);\n  }\n));\n\nassert_eq!(count_compound_ops!(foo<=>bar <<<! -baz ++), 4);\n\nprint_bang! {\n  /**\n   *******\n   * DOC *\n   * DOC *\n   * DOC *\n   *******\n   */\n  pub struct S;\n}\n\nc! {\n  pub const A: i32 = 0;\n}\nc! {\n  pub enum B {}\n}\nc! {\n  pub extern \"C\" fn c() {}\n}\nc! {\n  pub mod d {}\n}\nc! {\n  pub static E: i32 = 0;\n}\nc! {\n  pub struct F;\n}\nc! {\n  pub trait G {}\n}\nc! {\n  pub type H = i32;\n}\nc! {\n  pub use A as I;\n}\nc! {\n  const A: i32 = 0;\n}\nc! {\n  enum B {}\n}\nc! {\n  extern \"C\" fn c() {}\n}\nc! {\n  mod d {}\n}\nc! {\n  static E: i32 = 0;\n}\nc! {\n  struct F;\n}\nc! {\n  trait G {}\n}\nc! {\n  type H = i32;\n}\nc! {\n  use A as I;\n}\nc! {\n  pub(crate) const A: i32 = 0;\n}\nc! {\n  pub(crate) enum B {}\n}\nc! {\n  pub(crate) extern \"C\" fn c() {}\n}\nc! {\n  pub(crate) mod d {}\n}\nc! {\n  pub(crate) static E: i32 = 0;\n}\nc! {\n  pub(crate) struct F;\n}\nc! {\n  pub(crate) trait G {}\n}\nc! {\n  pub(crate) type H = i32;\n}\nc! {\n  pub(crate) use A as I;\n}\nc! {\n  crate const A: i32 = 0;\n}\nc! {\n  crate enum B {}\n}\nc! {\n  crate extern \"C\" fn c() {}\n}\nc! {\n  crate mod d {}\n}\nc! {\n  crate static E: i32 = 0;\n}\nc! {\n  crate struct F;\n}\nc! {\n  crate trait G {}\n}\nc! {\n  crate type H = i32;\n}\nc! {\n  crate use A as I;\n}\nc! {\n  pub(in foo) const A: i32 = 0;\n}\nc! {\n  pub(in foo) enum B {}\n}\nc! {\n  pub(in foo) extern \"C\" fn c() {}\n}\nc! {\n  pub(in foo) mod d {}\n}\nc! {\n  pub(in foo) static E: i32 = 0;\n}\nc! {\n  pub(in foo) struct F;\n}\nc! {\n  pub(in foo) trait G {}\n}\nc! {\n  pub(in foo) type H = i32;\n}\nc! {\n  pub(in foo) use A as I;\n}\nc! {\n  pub(crate) struct A {\n    pub a: i32,\n    b: i32,\n    pub(crate) c: i32,\n  }\n}\nc! {\n  pub struct B {\n    a: i32,\n    pub(crate) b: i32,\n    pub c: i32,\n  }\n}\nc! {\n  struct C {\n    pub(crate) a: i32,\n    pub b: i32,\n    c: i32,\n  }\n}\n\nc! {\n  pub(crate) struct D(pub i32, i32, pub(crate) i32);\n}\nc! {\n  pub struct E(i32, pub(crate) i32, pub i32);\n}\nc! {\n  struct F(pub(crate) i32, pub i32, i32);\n}\n\nc!(pub(crate);\nc!(pub(self)));\nc!(pub(super));\nc!(pub(in self));\nc!(pub(in super));\nc!(pub(in path::to));\nc!(pub(in ::path::to));\nc!(pub(in self::path::to));\nc!(pub(in super::path::to));\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/macro.invocation.rs\""
  },
  {
    "path": "tests/output-ext/macro/macro.item.f.rs",
    "content": "macro_rules! spaced {}\nmacro_rules! brace {\n  () => { };\n}\nmacro_rules! bracket {\n  () => { };\n}\nmacro_rules! paren {\n  () => { };\n}\nmacro_rules! macro_rules {\n  () => {};\n}\nmacro_rules! {}\n\nmacro m($S:ident, $x:ident) {}\npub macro create_struct($a:ident) {}\npub(crate) macro mac {\n  ($arg:expr) => { $arg + $arg };\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/macro.item.rs\""
  },
  {
    "path": "tests/output-ext/macro/macro.match.f.rs",
    "content": "pub macro c {\n  () => ();\n  // _______\n  // _______\n  ($msg:expr $(,)?) => ();\n  (\n    $fmt:expr,\n    $($arg:tt)*\n  ) => ();\n  ($foo:expr) => {};\n  ($($t:tt)+) => ();\n  ($left:expr, $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?) => ();\n  (\n    $left:expr,\n    $(|)? $($pattern:pat_param)|+ $(if $guard:expr)?,\n    $($arg:tt)+\n  ) => ();\n  // ______\n  (\"{}\", $aze:expr $(,)?) => ();\n  ($($t:tt)+) => ();\n  ($x:pat | $y:pat) => {};\n  ($($x:pat)+ | $($y:pat)+) => {};\n  ($x:pat_param | $y:pat_param) => {};\n  ($x:pat_param | $y:pat) => {};\n  ($x:pat | $y:pat_param) => {};\n}\n\nmacro_rules! c {\n  // ____\n  // ____\n  // ____\n  //\n  // ____\n  // ____\n  // ____\n  // ____\n  //\n  // ____\n  // ____\n\n  // ____\n  (\n    @ {\n      // ____\n      // ____\n      start = $start:expr;\n\n      // ____\n      // ____\n      ($($count:tt)*)\n\n      // ____\n      // ____\n      // ____\n      // ____\n      // ____\n      // ____\n      $(\n        ($($skip:tt)*)\n        $bind:pat = $fut:expr,\n        if $c:expr => $handle:expr,\n      )+;\n      // ____\n      $else:expr\n    }\n  ) => {};\n\n  // ____\n\n  // ____\n  // ____\n\n  (\n    @ {\n      start = $start:expr;\n      ($($s:tt)*)\n      $($t:tt)*\n    }\n    $p:pat = $f:expr,\n    if $c:expr => $h:block,\n    $($r:tt)*\n  ) => {};\n  (\n    @ {\n      start = $start:expr;\n      ($($s:tt)*)\n      $($t:tt)*\n    }\n    $p:pat = $f:expr,\n    if $c:expr => $h:expr\n  ) => {};\n  (\n    @ {\n      start = $start:expr;\n      ($($s:tt)*)\n      $($t:tt)*\n    }\n    $p:pat = $f:expr => $h:expr,\n    $($r:tt)*\n  ) => {};\n  (\n    @ {\n      start = $start:expr;\n      ($($s:tt)*)\n      $($t:tt)*\n    }\n    $p:pat = $f:expr => $h:expr\n  ) => {};\n  (\n    @ {\n      start = $start:expr;\n      $($t:tt)*\n    }\n    else => $else:expr $(,)?\n  ) => {};\n  (\n    @ {\n      start = $start:expr;\n      $($t:tt)*\n    }\n  ) => {};\n\n  (($($id:ident),*)) => (());\n  ([$($id:ident),*]) => (());\n  ({ $($id:ident),* }) => (());\n\n  // ____\n\n  (\n    biased;\n    $p:pat = $($t:tt)*\n  ) => {};\n\n  (\n    $p:pat = $($t:tt)*\n  ) => {};\n  () => {};\n  ($($tts:tt)+) => { loom::thread_local!{ $($tts)+ } };\n  (\n    @ {\n      // ____\n      // ____\n      ($($count:tt)*)\n\n      // ____\n      $(\n        ($($skip:tt)*)\n        $e:expr,\n      )*\n    }\n  ) => {};\n\n  // ____\n\n  (\n    @ {\n      ($($s:tt)*)\n      $($t:tt)*\n    }\n    $e:expr,\n    $($r:tt)*\n  ) => {};\n  (\n    $(\n      $(#[$cfg:meta])*\n      $name:ident,\n    )*\n  ) => {};\n\n  // ____\n\n  ($($e:expr),* $(,)?) => {};\n  () => {};\n\n  (\n    $(#[$attr:meta])*\n    $vis:vis static $name:ident: $t:ty;\n    $($rest:tt)*\n  ) => {};\n\n  (\n    $(#[$attr:meta])*\n    $vis:vis static $name:ident: $t:ty\n  ) => {};\n  (Send & $(!)?Sync & $(!)?Unpin, $value:expr) => {};\n  (!Send & $(!)?Sync & $(!)?Unpin, $value:expr) => {};\n  (\n    $($f:ident $(< $($generic:ty),* >)?)::+($($arg:ty),*): $($tok:tt)*\n  ) => {};\n  ($i:ident, $start:ident, $($delta:expr),* $(,)?) => {};\n  ($i:ident, $start:ident) => {};\n  ($($name:ident = $sem:ident($bits:tt: $exp_bits:tt)),*) => {};\n  ($ty:ident < $t:tt >) => {};\n  (\n    const SUPPORTS_CUSTOM_INNER_ATTRS: bool = $inner_attrs:literal;\n    $($ty:path),*\n  ) => {};\n  ($($name:literal => $feature:ident)*) => {};\n  ($($T:ident { $($field:ident: $A:ident),* $(,)? })*) => {};\n  ($wr:ident.write_facts_to_path($this:ident.[$($field:ident,)*])) => {};\n  (\n    $in_:expr,\n    {\n      $param:expr,\n      $flags:expr,\n      $width:expr,\n      $prec:expr,\n      $len:expr,\n      $type_:expr,\n      $pos:expr,\n    }\n  ) => {};\n  (\n    ($($dollar:tt $placeholder:ident)*);\n    $($($values:ident),+);*: $($test:tt)*\n  ) => {};\n  ($($name:ident: $($($p:ident),* => $call:ident),*;)*) => {};\n  ($($name:ident($($arg:ident),*) => $llvm_capi:ident),+ $(,)?) => {};\n  ($name:expr, fn() -> $ret:expr) => {};\n  ($name:expr, fn(...) -> $ret:expr) => {};\n  ($name:expr, fn($($arg:expr),*) -> $ret:expr) => {};\n  ($($field_ty:expr),*) => {};\n  ($($name:ident: $($($p:ident),* => $call:ident),*;)*) => {};\n  (\n    $where:expr,\n    { $($what_fmt:expr),+ }\n    $(expected { $($expected_fmt:expr),+ })?\n  ) => {};\n  (\n    $e:expr,\n    $where:expr,\n    $(\n      $($p:pat_param)|+ => { $($what_fmt:expr),+ }\n      $(expected { $($expected_fmt:expr),+ })?\n    ),+\n    $(,)?\n  ) => {};\n  (\n    $(#[$attr:meta])*\n    pub enum $name:ident {\n      $(\n        $(#[$var_attr:meta])*\n        $variant:ident = $e:expr,\n      )*\n    }\n  ) => {};\n  (\n    $(#[$attr:meta])*\n    pub enum $name:ident {\n      $(\n        $(#[$var_attr:meta])*\n        $variant:ident,\n      )*\n    }\n  ) => {};\n  (impl $fblock:tt [$($c:tt,)*] [$block:tt $(, $rest:tt)*]) => {};\n  (impl $fblock:tt [$($blocks:tt,)*] []) => {};\n  ($($ecode:ident: $message:expr,)*; $($code:ident,)*) => {};\n  (\n    $(#[$attrs:meta])*\n    pub fn $n:ident(&self, $($name:ident: $ty:ty),* $(,)?) -> &Self\n  ) => {};\n  (\n    $enc:expr, // _______\n    $idx:expr, // _______\n    $struct:expr, // _______\n    $struct_name:ident, // _______\n    [$($name:ident),+ $(,)?], // _______\n    [$($ignore:ident),+ $(,)?] // _______\n  ) => {};\n  (\n    $(\n      $Kind:ident($AstTy:ty)\n      {\n        $kind_name:expr;\n        $(\n          one fn $mut_visit_ast:ident;\n          fn $visit_ast:ident;\n        )?\n        $(\n          many fn $flat_map_ast_elt:ident;\n          fn $visit_ast_elt:ident($($args:tt)*);\n        )?\n        fn $make_ast:ident;\n      }\n    )*\n  ) => {};\n  ($ty:ident { $($field:ident $(: $value:expr)*),+ $(,)? }) => {};\n  ($ty:ident::$method:ident($($value:expr),*)) => {};\n  (\n    $(\n      $(#[doc = $doc:tt])*\n      (accepted, $feature:ident, $ver:expr, $issue:expr, None),\n    )+\n  ) => {};\n  (\n    $(\n      $(#[$attr:meta])*\n      $variant:ident $($group:expr)?,\n      $module:ident::$name:ident,\n      $method:ident,\n      $target:expr,\n      $generics:expr;\n    )*\n  ) => {};\n  (\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => {};\n  (\n    [$hir:tt],\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => {};\n  (\n    [\n      $span:expr,\n      $($fmt:tt)*\n    ] $arg:expr,\n    $($rest:tt)*\n  ) => {};\n  ($($T:ty),*) => {};\n  (#$var:ident) => {};\n  (\n    $call:ident! $extra:tt\n    ($($b1:tt)*)\n    ($($curr:tt)*)\n  ) => {};\n  (\n    $call:ident!($($extra:tt)*)\n    #$var:ident\n  ) => {};\n  (\n    $tokens:ident\n    ($($b3:tt)*)\n    ($($b2:tt)*)\n    ($($b1:tt)*)\n    ($($curr:tt)*)\n    ($($a1:tt)*)\n    ($($a2:tt)*)\n    ($($a3:tt)*)\n  ) => {};\n  ($tokens:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {};\n  (\n    $tokens:ident $b3:tt $b2:tt $b1:tt (#)\n    ($($inner:tt)*)\n    *$a3:tt\n  ) => {};\n  (\n    [$($attrs_pub:tt)*]\n    enum $name:ident #no_visit\n    $($rest:tt)*\n  ) => {};\n  (\n    $(#[$enum_attr:meta])*\n    $pub:ident $enum:ident $name:ident #$tag:ident $body:tt\n    $($remaining:tt)*\n  ) => {};\n  (\n    $pub:ident $enum:ident $name:ident {\n      $(\n        $(#[$variant_attr:meta])*\n        $variant:ident $(($($member:ident)::+))*,\n      )*\n    }\n    $($remaining:tt)*\n  ) => {};\n  (\n    ($($arms:tt)*)\n    $tokens:ident $name:ident {\n      $variant:ident $member:ident,\n      $($next:tt)*\n    }\n  ) => {};\n  (\n    $mac:ident!(\n      $(#[$m:meta])*\n      $pub:ident\n      $($t:tt)*\n    )\n  ) => {};\n  ($($token:tt pub struct $name:ident #[$doc:meta])*) => {};\n  ($($token:tt pub struct $name:ident / $len:tt #[$doc:meta])*) => {};\n  {\n    $($name:ident)::+$(< $param:ident >)?\n    $([$field:tt $this:ident $other:ident])*\n    $(![$ignore:tt])*;\n    !$next:tt\n    $($rest:tt)*\n  } => {};\n  {\n    $($name:ident)::+;\n    $([\n      $($variant:ident)::+;\n      $([$field:tt $this:ident $other:ident])*\n      $(![$ignore:tt])*\n    ])*\n  } => {};\n  {\n    $($name:ident)::+;\n    $([\n      $($variant:ident)::+;\n      $($fields:tt)*\n    ])*\n    $next:ident\n    $($rest:tt)*\n  } => {};\n  (($expr:ident) as $t:ty, @ $snapshot:literal) => {};\n  (\n    $(#[$smeta:meta])*\n    pub struct $stratname:ident\n    [$($sgen:tt)*]\n    [$($swhere:tt)*]\n    ($innerstrat:ty) -> $stratvtty:ty;\n    $(#[$vmeta:meta])*\n    pub struct $vtname:ident\n    [$($vgen:tt)*]\n    [$($vwhere:tt)*]\n    ($innervt:ty) -> $actualty:ty;\n  ) => {};\n\n  { $ head: expr } => { Cons ( $ head , Nil ) };\n  {\n    $ head: expr,\n    $ ($ tail: expr),\n    *\n  } => { Cons ( $ head , hlist ! ( $ ( $ tail ) , * ) ) };\n  { $ head: ty } => { Cons < $ head , Nil > };\n  {\n    $ head: ty,\n    $ ($ tail: ty),\n    *\n  } => { Cons < $ head , HList ! ( $ ( $ tail ) , * ) > };\n  { ($ ($ LHS: tt) +) } => { Expr ! ( $ ( $ LHS ) + ) };\n  {\n    HList![$ ($ LHS: tt) *] + $ ($ RHS: tt) +\n  } => { < Expr ! ( HList ! [ $ ( $ LHS ) * ] ) as Add < Expr ! ( $ ( $ RHS ) + ) >> :: Output };\n  {\n    $ LHS: tt + $ ($ RHS: tt) +\n  } => { < Expr ! ( $ LHS ) as Add < Expr ! ( $ ( $ RHS ) + ) >> ::  Output };\n  { $ LHS: ty } => { $ LHS };\n  (\n    $(\n      $name:ident {\n        $(\n          fn $method:ident($($arg:ident: $arg_ty:ty),* $(,)?)\n          $(-> $ret_ty:ty)*;\n        )*\n      }\n    ),*\n    $(,)?\n  ) => {};\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/macro.match.rs\""
  },
  {
    "path": "tests/output-ext/macro/macro.tokens.f.rs",
    "content": "macro_rules! a {\n  (+) => { + };\n  (+=) => { += };\n  (&) => { & };\n  (&&) => { && };\n  (&=) => { &= };\n  (@) => { @ };\n  (!) => { ! };\n  (^) => { ^ };\n  (^=) => { ^= };\n  (:) => { : };\n  (::) => { :: };\n  (,) => { , };\n  (/) => { / };\n  (/=) => { /= };\n  (.) => { . };\n  (..) => { .. };\n  (...) => { ... };\n  (..=) => { ..= };\n  (=) => { = };\n  (==) => { == };\n  (>=) => { >= };\n  (>) => { > };\n  (<=) => { <= };\n  (<) => { < };\n  (*=) => { *= };\n  (!=) => { != };\n  (|) => { | };\n  (|=) => { |= };\n  (||) => { || };\n  (#) => { # };\n  (?) => { ? };\n  (->) => { -> };\n  (< -) => { <- };\n  (%) => { % };\n  (%=) => { %= };\n  (=>) => { => };\n  (;) => { ; };\n  (<<) => { << };\n  (<<=) => { <<= };\n  (>>) => { >> };\n  (>>=) => { >>= };\n  (*) => { * };\n  (-) => { - };\n  (-=) => { -= };\n  (~) => { ~ };\n}\n\na! { + }\na! { += }\na! { & }\na! { && }\na! { &= }\na! { @ }\na! { ! }\na! { ^ }\na! { ^= }\na! { : }\na! { :: }\na! { , }\na! { / }\na! { /= }\na! { . }\na! { .. }\na! { ... }\na! { ..= }\na! { = }\na! { == }\na! { >= }\na! { > }\na! { <= }\na! { < }\na! { *= }\na! { != }\na! { | }\na! { |= }\na! { || }\na! { # }\na! { ? }\na! { -> }\na! { <- }\na! { % }\na! { %= }\na! { => }\na! { ; }\na! { << }\na! { <<= }\na! { >> }\na! { >>= }\na! { * }\na! { - }\na! { -= }\na! { ~ }\n\nb![+];\nb![+=];\nb![&];\nb![&&];\nb![&=];\nb![@];\nb![!];\nb![^];\nb![^=];\nb![:];\nb![::];\nb![,];\nb![/];\nb![/=];\nb![.];\nb![..];\nb![...];\nb![..=];\nb![=];\nb![==];\nb![>=];\nb![>];\nb![<=];\nb![<];\nb![*=];\nb![!=];\nb![|];\nb![|=];\nb![||];\nb![#];\nb![?];\nb![->];\nb![<-];\nb![%];\nb![%=];\nb![=>];\nb![;];\nb![<<];\nb![<<=];\nb![>>];\nb![>>=];\nb![*];\nb![-];\nb![-=];\nb![~];\n\nc!(+);\nc!(+=);\nc!(&);\nc!(&&);\nc!(&=);\nc!(@);\nc!(!);\nc!(^);\nc!(^=);\nc!(:);\nc!(::);\nc!(,);\nc!(/);\nc!(/=);\nc!(.);\nc!(..);\nc!(...);\nc!(..=);\nc!(=);\nc!(==);\nc!(>=);\nc!(>);\nc!(<=);\nc!(<);\nc!(*=);\nc!(!=);\nc!(|);\nc!(|=);\nc!(||);\nc!(#);\nc!(?);\nc!(->);\nc!(<-);\nc!(%);\nc!(%=);\nc!(=>);\nc!(;);\nc!(<<);\nc!(<<=);\nc!(>>);\nc!(>>=);\nc!(*);\nc!(-);\nc!(-=);\nc!(~);\n\nmacro_rules! x {\n  ($p:pat =>) => {};\n  ($p:pat,) => {};\n  ($p:pat =) => {};\n  ($p:pat |) => {};\n  ($p:pat if) => {};\n  ($p:pat in) => {};\n  ($e:expr =>) => {};\n  ($e:expr,) => {};\n  ($e:expr;) => {};\n  ($t:ty {}) => {};\n  ($t:ty,) => {};\n  ($t:ty =>) => {};\n  ($t:ty:) => {};\n  ($t:ty =) => {};\n  ($t:ty >) => {};\n  ($t:ty;) => {};\n  ($t:ty |) => {};\n  ($t:ty as) => {};\n  ($t:ty where) => {};\n  ($t:ty []) => {};\n  ($t:ty $b:block) => {};\n  ($s:stmt =>) => {};\n  ($s:stmt,) => {};\n  ($s:stmt;) => {};\n  ($p:path {}) => {};\n  ($p:path,) => {};\n  ($p:path =>) => {};\n  ($p:path:) => {};\n  ($p:path =) => {};\n  ($p:path >) => {};\n  ($p:path;) => {};\n  ($p:path |) => {};\n  ($p:path as) => {};\n  ($p:path where) => {};\n  ($p:path []) => {};\n  ($p:path $b:block) => {};\n  ($b:block ()) => {};\n  ($b:block []) => {};\n  ($b:block {}) => {};\n  ($b:block,) => {};\n  ($b:block =>) => {};\n  ($b:block:) => {};\n  ($b:block =) => {};\n  ($b:block >) => {};\n  ($b:block;) => {};\n  ($b:block |) => {};\n  ($b:block +) => {};\n  ($b:block ident) => {};\n  ($b:block $p:pat) => {};\n  ($b:block $e:expr) => {};\n  ($b:block $t:ty) => {};\n  ($b:block $s:stmt) => {};\n  ($b:block $p:path) => {};\n  ($b:block $c:block) => {};\n  ($b:block $i:ident) => {};\n  ($b:block $t:tt) => {};\n  ($b:block $i:item) => {};\n  ($b:block $m:meta) => {};\n  ($i:ident()) => {};\n  ($i:ident []) => {};\n  ($i:ident {}) => {};\n  ($i:ident,) => {};\n  ($i:ident =>) => {};\n  ($i:ident:) => {};\n  ($i:ident =) => {};\n  ($i:ident >) => {};\n  ($i:ident;) => {};\n  ($i:ident |) => {};\n  ($i:ident +) => {};\n  ($i:ident ident) => {};\n  ($i:ident $p:pat) => {};\n  ($i:ident $e:expr) => {};\n  ($i:ident $t:ty) => {};\n  ($i:ident $s:stmt) => {};\n  ($i:ident $p:path) => {};\n  ($i:ident $b:block) => {};\n  ($i:ident $j:ident) => {};\n  ($i:ident $t:tt) => {};\n  ($i:ident $j:item) => {};\n  ($i:ident $m:meta) => {};\n  ($t:tt ()) => {};\n  ($t:tt []) => {};\n  ($t:tt {}) => {};\n  ($t:tt,) => {};\n  ($t:tt =>) => {};\n  ($t:tt:) => {};\n  ($t:tt =) => {};\n  ($t:tt >) => {};\n  ($t:tt;) => {};\n  ($t:tt |) => {};\n  ($t:tt +) => {};\n  ($t:tt ident) => {};\n  ($t:tt $p:pat) => {};\n  ($t:tt $e:expr) => {};\n  ($t:tt $v:ty) => {};\n  ($t:tt $s:stmt) => {};\n  ($t:tt $p:path) => {};\n  ($t:tt $b:block) => {};\n  ($t:tt $i:ident) => {};\n  ($t:tt $v:tt) => {};\n  ($t:tt $i:item) => {};\n  ($t:tt $m:meta) => {};\n  ($i:item ()) => {};\n  ($i:item []) => {};\n  ($i:item {}) => {};\n  ($i:item,) => {};\n  ($i:item =>) => {};\n  ($i:item:) => {};\n  ($i:item =) => {};\n  ($i:item >) => {};\n  ($i:item;) => {};\n  ($i:item |) => {};\n  ($i:item +) => {};\n  ($i:item ident) => {};\n  ($i:item $p:pat) => {};\n  ($i:item $e:expr) => {};\n  ($i:item $t:ty) => {};\n  ($i:item $s:stmt) => {};\n  ($i:item $p:path) => {};\n  ($i:item $b:block) => {};\n  ($i:item $j:ident) => {};\n  ($i:item $t:tt) => {};\n  ($i:item $j:item) => {};\n  ($i:item $m:meta) => {};\n  ($m:meta ()) => {};\n  ($m:meta []) => {};\n  ($m:meta {}) => {};\n  ($m:meta,) => {};\n  ($m:meta =>) => {};\n  ($m:meta:) => {};\n  ($m:meta =) => {};\n  ($m:meta >) => {};\n  ($m:meta;) => {};\n  ($m:meta |) => {};\n  ($m:meta +) => {};\n  ($m:meta ident) => {};\n  ($m:meta $p:pat) => {};\n  ($m:meta $e:expr) => {};\n  ($m:meta $t:ty) => {};\n  ($m:meta $s:stmt) => {};\n  ($m:meta $p:path) => {};\n  ($m:meta $b:block) => {};\n  ($m:meta $i:ident) => {};\n  ($m:meta $t:tt) => {};\n  ($m:meta $i:item) => {};\n  ($m:meta $n:meta) => {};\n  ($ty:ty <) => (); //~ ERROR `$ty:ty` is followed by `<`, which is not allowed for `ty`\n  ($ty:ty < foo,) => (); //~ ERROR `$ty:ty` is followed by `<`, which is not allowed for `ty`\n  ($ty:ty,) => ();\n  (($ty:ty)) => ();\n  ({ $ty:ty }) => ();\n  ([$ty:ty]) => ();\n  ($bl:block <) => ();\n  ($pa:pat >) => (); //~ ERROR `$pa:pat` is followed by `>`, which is not allowed for `pat`\n  ($pa:pat,) => ();\n  ($pa:pat $pb:pat $ty:ty,) => ();\n  //~^ ERROR `$pa:pat` is followed by `$pb:pat`, which is not allowed\n  //~^^ ERROR `$pb:pat` is followed by `$ty:ty`, which is not allowed\n  ($($ty:ty)* -) => (); //~ ERROR `$ty:ty` is followed by `-`\n  ($($a:ty, $b:ty)* -) => (); //~ ERROR `$b:ty` is followed by `-`\n  ($($ty:ty)-+) => (); //~ ERROR `$ty:ty` is followed by `-`, which is not allowed for `ty`\n  (\n    $($a:expr)*\n    $($b:tt)*\n  ) => { };\n  //~^ ERROR `$a:expr` is followed by `$b:tt`, which is not allowed for `expr` fragments\n  (\n    $b:block,\n    $e:expr,\n    $i:ident,\n    $it:item,\n    $l:lifetime,\n    $lit:literal,\n    $m:meta,\n    $p:pat,\n    $pth:path,\n    $s:stmt,\n    $tt:tt,\n    $ty:ty,\n    $vis:vis\n  ) => { };\n}\n\n#![rustc_dummy(\"hi\", 1, 2, 1.012, pi = 3.14, bye, name(\"John\"))]\n#[rustfmt::r#final(final)]\nlexes! { a #foo }\nlexes! {\n  continue 'foo;\n}\nlexes! {\n  match \"...\" {\n  }\n}\nlexes! { r#let#foo } // Identifier<\"r#let\"; raw: true> PunctuationToken<#> Identifier<\"foo\">\n\nfn f() {\n  unsafe {\n    asm!(\"\");\n    asm!(\"\", options());\n    asm!(\"\", options(nostack, nomem));\n    asm!(\"{}\", in(reg) 4);\n    asm!(\"{0}\", out(reg) a);\n    asm!(\"{name}\", name = inout(reg) b);\n    asm!(\"{} {}\", out(reg) _, inlateout(reg) b => _);\n    asm!(\"\", out(\"al\") _, lateout(\"rcx\") _);\n    asm!(\"beep~\", \"boop!\");\n    asm!(\"beep~ {}, 42\", \"boop! {}, 24\", in(reg) a, out(reg) b);\n    asm!(\"boop! {1}, 24\", \"beep~ {0}, 42\", in(reg) a, out(reg) b);\n    asm!(\"beep~ {}, 42\", \"boop! {name}, 24\", in(reg) a, name = out(reg) b);\n    asm!(\"beep~\nboop!\");\n    asm!(\"beep~\\nboop!\");\n    asm!(\"beep~\\n\\tboop!\");\n    asm!(\"beep~\\nboop!\", \"boop3\\nboop4\");\n  }\n}\ndebug!(?value);\ndebug!(\n  \"VariantDef::new(name = {:?}, variant_did = {:?}, ctor_def_id = {:?}, discr = {:?},\n     fields = {:?}, ctor_kind = {:?}, adt_kind = {:?}, parent_did = {:?})\",\n  name,\n  variant_did,\n  ctor_def_id,\n  discr,\n  fields,\n  ctor_kind,\n  adt_kind,\n  parent_did\n);\nslice_interners!(\n    substs: _intern_substs(GenericArg<'tcx>),\n    canonical_var_infos: _intern_canonical_var_infos(CanonicalVarInfo<'tcx>),\n    poly_existential_predicates:\n        _intern_poly_existential_predicates(ty::Binder<'tcx, ExistentialPredicate<'tcx>>),\n    predicates: _intern_predicates(Predicate<'tcx>),\n    projs: _intern_projs(ProjectionKind),\n    place_elems: _intern_place_elems(PlaceElem<'tcx>),\n    bound_variable_kinds: _intern_bound_variable_kinds(ty::BoundVariableKind),\n);\n\nimpl_binder_encode_decode! {\n    &'tcx ty::List<Ty<'tcx>>,\n    ty::FnSig<'tcx>,\n    ty::ExistentialPredicate<'tcx>,\n    ty::TraitRef<'tcx>,\n    Vec<ty::GeneratorInteriorTypeCause<'tcx>>,\n}\nimpl_arena_copy_decoder! {<'tcx>\n    Span,\n    rustc_span::symbol::Ident,\n    ty::Variance,\n    rustc_span::def_id::DefId,\n    rustc_span::def_id::LocalDefId,\n    (rustc_middle::middle::exported_symbols::ExportedSymbol<'tcx>, rustc_middle::middle::exported_symbols::SymbolExportInfo),\n}\n\nbitflags! {\n    #[derive(HashStable, TyEncodable, TyDecodable)]\n    pub struct AdtFlags: u32 {\n        const NO_ADT_FLAGS        = 0;\n        /// Indicates whether the ADT is an enum.\n        const IS_ENUM             = 1 << 0;\n        /// Indicates whether the ADT is a union.\n        const IS_UNION            = 1 << 1;\n        /// Indicates whether the ADT is a struct.\n        const IS_STRUCT           = 1 << 2;\n        /// Indicates whether the ADT is a struct and has a constructor.\n        const HAS_CTOR            = 1 << 3;\n        /// Indicates whether the type is `PhantomData`.\n        const IS_PHANTOM_DATA     = 1 << 4;\n        /// Indicates whether the type has a `#[fundamental]` attribute.\n        const IS_FUNDAMENTAL      = 1 << 5;\n        /// Indicates whether the type is `Box`.\n        const IS_BOX              = 1 << 6;\n        /// Indicates whether the type is `ManuallyDrop`.\n        const IS_MANUALLY_DROP    = 1 << 7;\n        /// Indicates whether the variant list of this ADT is `#[non_exhaustive]`.\n        /// (i.e., this flag is never set unless this ADT is an enum).\n        const IS_VARIANT_LIST_NON_EXHAUSTIVE = 1 << 8;\n    }\n}\nrustc_dep_node_append!([define_dep_nodes!][ <'tcx>\n    // We use this for most things when incr. comp. is turned off.\n    [] Null,\n\n    [anon] TraitSelect,\n\n    // WARNING: if `Symbol` is changed, make sure you update `make_compile_codegen_unit` below.\n    [] CompileCodegenUnit(Symbol),\n\n    // WARNING: if `MonoItem` is changed, make sure you update `make_compile_mono_item` below.\n    // Only used by rustc_codegen_cranelift\n    [] CompileMonoItem(MonoItem),\n]);\n\ndecl_derive!([Decodable] => serialize::decodable_derive);\n\nlet ret = structure.gen_impl(\n  quote! {\n    gen impl rustc_errors::AddSubdiagnostic for @Self {\n        fn add_to_diagnostic(self, #diag: &mut rustc_errors::Diagnostic) {\n            use rustc_errors::{Applicability, IntoDiagnosticArg};\n            #implementation\n        }\n    }\n}\n);\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/macro.tokens.rs\""
  },
  {
    "path": "tests/output-ext/macro/macro.transform.f.rs",
    "content": "macro_rules! x {\n  () => {\n\t\t$cx.pass.$f(&$cx.context, $($args),*);\n        $(pub struct $sem;)*\n        $(pub type $name = IeeeFloat<$sem>;)*\n        $(impl Semantics for $sem {\n            const BITS: usize = $bits;\n            const PRECISION: usize = ($bits - 1 - $exp_bits) + 1;\n            const MAX_EXP: ExpInt = (1 << ($exp_bits - 1)) - 1;\n        })*\n\t\tfor elem in $list {\n            $visitor.$method(elem)\n        }\n\t\tfor elem in $list {\n            $visitor.$method(elem, $($extra_args,)*)\n        }\n  };\n  ($this:expr; $($x:expr),*) => (\n        $this.arena.alloc_from_iter([$($x),*])\n  );\n  (path, < $type:ty as $trait:path > ::$name:ident) => {\n        <$type as $trait>::$name\n  };\n\n  (ty, < $type:ty as $trait:ty > ::$name:ident) => {\n        <$type as $trait>::$name\n  };\n  (\n    $fnname:ident,\n    $arg:ident,\n    $ty:ty,\n    $body:block,\n    $val:expr,\n    $pat:pat,\n    $res:path\n  ) => (\n    {\n        fn $fnname($arg: $ty) -> Option<$ty> $body\n        match $fnname($val) {\n          Some($pat) => {\n            $res\n          }\n          _ => { panic!(); }\n        }\n    }\n  );\n  ($l:lifetime, $l2:lifetime) => {\n        fn f<$l: $l2, $l2>(arg: &$l str, arg2: &$l2 str) -> &$l str {\n            arg\n        }\n  };\n  ($a:lifetime) => {\n        $a: loop {\n            break $a;\n            panic!(\"failed\");\n        }\n  };\n  ($a:lifetime) => {\n        break $a;\n  };\n  ($b:lifetime) => {\n        'b: loop { // comment\n            break $b; // comment\n        }\n  };\n  ($l:lifetime) => {\n        fn f(arg: &$l str) -> &$l str {\n            arg\n        }\n  };\n  ($l:lifetime) => {\n        fn f<$l>(arg: &$l str) -> &$l str {\n            arg\n        }\n  };\n  ($s:literal ..= $e:literal) => {\n        match 3 {\n            $s ..= $e => \"literal, in range\",\n            _ => \"literal, other\",\n        }\n  };\n  ($s:pat) => {\n        match 3 {\n            $s => \"pat, single\",\n            _ => \"pat, other\",\n        }\n  };\n  ($s:literal ..= $e:literal) => {\n        &format!(\"macro caught literal: {} ..= {}\", $s, $e)\n  };\n  (\n    ($s:expr) ..= ($e:expr)\n  ) => { // comment\n        &format!(\"macro caught expr: {} ..= {}\", $s, $e)\n    };\n  ($s:expr, $e:expr) => {\n        {\n            let mut v = Vec::new();\n            for i in $s .. $e {\n                v.push(i);\n            }\n            \"expr\"\n        }\n  };\n  ($at:meta) => {\n        #[cfg($at)]\n        static MISTYPED: () = \"foo\";\n  };\n  ($($x:tt)*) => { $($x)* };\n  (subst $lhs:tt => $rhs:tt) => (\n    {\n        macro_rules! anon { $lhs => $rhs }\n        anon!(1_usize, 2_usize, \"foo\")\n    }\n  );\n  ($x:expr; $fragment:ident) => {\n        macro_rules! inner { ($y:$fragment) => { $x + $y } }\n  };\n  ($expr:expr, $($($pat:pat)|+ => $expr_arm:expr),+) => {\n        match $expr {\n            $(\n                $( $pat => $expr_arm, )+\n            )+\n        }\n  };\n  ($nm:ident, #[$a:meta], $i:item) => (mod $nm { #[$a] $i });\n  ($p:pat | $p2:pat) => {\n    {\n        match Some(1u8) {\n            $p | $p2 => {}\n            _ => {}\n        }\n    }\n  };\n  ($p:pat in $e:expr) => {\n    {\n        let mut iter = $e.into_iter();\n        while let $p = iter.next() {}\n    }\n  };\n  ($p:pat if $e:expr) => {\n    {\n        match Some(1u8) {\n            $p if $e => {}\n            _ => {}\n        }\n    }\n  };\n  ($name:ident { $($variant:ident = $value:expr,)* }) => {\n        enum $name {\n            $($variant = $value,)*\n        }\n\n        fn foo(value: i32) -> Option<$name> {\n            match value {\n                $( $value => Some($name::$variant), )*\n                _ => None\n            }\n        }\n  };\n  ($f:ident, ($($x:ident),*), $body:block) => (\n        fn $f( $( $x : isize),* ) -> isize $body\n  );\n  (\n    < $a:expr;\n    > $($b:tt)*\n  ) => { Keep(parse_item!($a),parse_list!($($b)*)) };\n  (\n    $a:tt\n    $($b:tt)*\n  ) => { Skip(parse_item!($a), parse_list!($($b)*)) };\n  ($x:tt) => (type Alias = $x<i32>;);\n  ($($code:tt)*) => {\n        expr!(thread::spawn(move|| {$($code)*}).join())\n  };\n  ($($m:ident $($f:ident $v:tt)+),*) => {\n        $($(macro_rules! $f { () => { $v } })+)*\n        $(macro_rules! $m { () => { $(fn $f() -> i32 { $v })+ } })*\n  };\n  ($n:ident $x:expr) => { macro_rules! $n { ($y:expr) => { $x + $y }; } };\n  ($name:ident) => {\n        #[derive(Debug)]\n        struct Foo {\n            #[cfg(not(FALSE))]\n            field: fn($name: bool)\n        }\n  };\n  { $A:ty, $B:ty } => { ($A, $B) };\n  ($id1:ident, $id2:ident, $e:expr) => (\n        fn foo(a:T, b:T) -> T {\n            match (a, b) {\n                (T::A($id1), T::A($id2)) => T::A($e),\n                (T::B($id1), T::B($id2)) => T::B($e),\n                _ => panic!()\n            }\n        }\n  );\n  ($expression:expr, $($pattern:pat)|+ $(if $guard:expr)? $(,)?) => {\n        match $expression {\n            $( $pattern )|+ $( if $guard )? => true,\n            _ => false\n        }\n  };\n  (\n    $dst:expr,\n    $($arg:tt)*\n  ) => ($dst.write_fmt(format_args!($($arg)*)));\n  ($x:pat |) => ();\n  () => {\n\t\t// comment\n\t\t// comment\n\t\tmod bar {\n\t\t\t#[derive(Double)]\n\t\t\tstruct Bar($crate::Foo);\n\t\t}\n\t\n\t\tmod qself {\n\t\t\t#[derive(Double)]\n\t\t\tstruct QSelf(<::Foo as $crate::Trait>::Assoc);\n\t\t}\n\t\n\t\tmod qself_recurse {\n\t\t\t#[derive(Double)]\n\t\t\tstruct QSelfRecurse(<<$crate::Foo as $crate::Trait>::Assoc as $crate::Trait>::Assoc);\n\t\t}\n\t\n\t\tmod qself_in_const {\n\t\t\t#[derive(Double)]\n\t\t\t#[repr(u32)]\n\t\t\tenum QSelfInConst {\n\t\t\t\tVariant = <::Foo as $crate::Trait>::CONST,\n\t\t\t}\n\t\t}\n  };\n  ($item:item) => {\n        #[derive(Print)]\n        struct Foo {\n            #[cfg(FALSE)] removed: bool,\n            field: [bool; {\n                $item\n                0\n            }]\n        }\n  };\n  {\n    $(#[$attr:meta])*\n    pub $name:ident,\n    $_reason:expr\n  } => {\n        $(#[$attr])*\n        #[allow(dead_code)]\n        pub static $name: ClippyDeprecatedLint = ClippyDeprecatedLint {};\n  };\n  ($($name:ident $assign:ident)*) => {\n        /// comment\n        pub static BINOP_TRAITS: &[LangItem] = &[$(LangItem::$name,)*];\n\n        /// comment\n        pub static OP_ASSIGN_TRAITS: &[LangItem] = &[$(LangItem::$assign,)*];\n\n        /// comment\n        pub fn binop_traits(kind: hir::BinOpKind) -> Option<(LangItem, LangItem)> {\n            match kind {\n                $(hir::BinOpKind::$name => Some((LangItem::$name, LangItem::$assign)),)*\n                _ => None,\n            }\n        }\n  };\n  ($($t:ident),*) => {\n        $(impl HirNode for hir::$t<'_> {\n            fn hir_id(&self) -> HirId {\n                self.hir_id\n            }\n            fn span(&self) -> Span {\n                self.span\n            }\n        })*\n  };\n  (\n    $(\n      $major:literal,\n      $minor:literal,\n      $patch:literal { $($name:ident),* $(,)? }\n    )*\n  ) => {\n        $($(\n        pub const $name: RustcVersion = RustcVersion::new($major, $minor, $patch);\n        )*)*\n  };\n  (\n    impl $imp:ident,\n    $method:ident for $t:ty,\n    type Output = $o:ty\n  ) => {\n        impl $imp<$t> for &$t {\n            type Output = $o;\n\n            fn $method(self, other: $t) -> $o {\n                $imp::$method(self, &other)\n            }\n        }\n\n        impl $imp<&$t> for $t {\n            type Output = $o;\n\n            fn $method(self, other: &$t) -> $o {\n                $imp::$method(&self, other)\n            }\n        }\n\n        impl $imp for $t {\n            type Output = $o;\n\n            fn $method(self, other: $t) -> $o {\n                $imp::$method(&self, &other)\n            }\n        }\n  };\n  (\n    $iter:ident,\n    $($token:ident $({ $($fields:tt)* })? $(($capture:ident))?)*\n  ) => {\n        {\n           $($(let $capture =)? if let Some((TokenKind::$token $({$($fields)*})?, _x)) = $iter.next() {\n               _x\n           } else {\n               continue;\n           };)*\n           #[allow(clippy::unused_unit)]\n           { ($($($capture,)?)*) }\n       }\n  };\n  (exp $e:expr) => { $e };\n  (\n    exp\n    $($t:tt)+\n  ) => { exp!($($t)+) };\n  {} => { Nil };\n  { $ head: expr } => { Cons ( $ head , Nil ) };\n  {\n    $ head: expr,\n    $ ($ tail: expr),\n    *\n  } => { Cons ( $ head , hlist ! ( $ ( $ tail ) , * ) ) };\n  {} => { Nil };\n  { $ head: ty } => { Cons < $ head , Nil > };\n  {\n    $ head: ty,\n    $ ($ tail: ty),\n    *\n  } => { Cons < $ head , HList ! ( $ ( $ tail ) , * ) > };\n  { ($ ($ LHS: tt) +) } => { Expr ! ( $ ( $ LHS ) + ) };\n  {\n    HList![$ ($ LHS: tt) *] + $ ($ RHS: tt) +\n  } => { < Expr ! ( HList ! [ $ ( $ LHS ) * ] ) as Add < Expr ! ( $ ( $ RHS ) + ) >> :: Output };\n  {\n    $ LHS: tt + $ ($ RHS: tt) +\n  } => { < Expr ! ( $ LHS ) as Add < Expr ! ( $ ( $ RHS ) + ) >> :: Output };\n  { $ LHS: ty } => { $ LHS };\n  (\n    [$elem_ty:ident; $elem_count:expr]: $id:ident | $test_tt:tt | $source:ident\n  ) => {\n        impl From<$source> for $id {\n            #[inline]\n            fn from(source: $source) -> Self {\n                fn static_assert_same_number_of_lanes<T, U>()\n                where\n                    T: crate::sealed::Simd,\n                    U: crate::sealed::Simd<LanesType = T::LanesType>,\n                {\n                }\n                use llvm::simd_cast;\n                static_assert_same_number_of_lanes::<$id, $source>();\n                Simd(unsafe { simd_cast(source.0) })\n            }\n        }\n\n        // comment\n                // comment\n                /*\n                comment\n                */\n\n        test_if!{\n            $test_tt:\n            interpolate_idents! {\n                mod [$id _from_ $source] {\n                    use super::*;\n                    #[test]\n                    fn from() {\n                        assert_eq!($id::lanes(), $source::lanes());\n                        let source: $source = Default::default();\n                        let vec: $id = Default::default();\n\n                        let e = $id::from(source);\n                        assert_eq!(e, vec);\n\n                        let e: $id = source.into();\n                        assert_eq!(e, vec);\n                    }\n                }\n            }\n        }\n  };\n  (\n    [\n      $elem_ty:ident;\n      $elem_count:expr\n    ]: $id:ident | $test_tt:tt | $($source:ident),*\n  ) => {\n        $(\n            impl_from_vector!([$elem_ty; $elem_count]: $id | $test_tt | $source);\n        )*\n  };\n  (\n    $(\n      $(#[$cfg:meta])*\n      $name:ident,\n    )*\n  ) => {\n        [$($(#[$cfg])* (b!($name), $name::bench as fn(&str) -> C<(), ()>),)*]\n  };\n  (\n    $(\n      $(#[$attr:meta])*\n      pub fn $func:ident($input:ident: &str) -> String;\n    )+\n  ) => {\n        $(\n            $( #[$attr] )*\n            #[proc_macro_derive($func)]\n            pub fn $func(_input: ::proc_macro::TokenStream) -> ::proc_macro::TokenStream {\n                panic!()\n            }\n        )+\n  };\n  (\n    $(\n      $(#[$attr:meta])*\n      pub fn $func:ident($input:ident: &str) -> String $body:block\n    )+\n  ) => {\n        $(\n            // comment\n            $( #[$attr] )*\n            #[proc_macro_derive($func)]\n            pub fn $func(input: f!()) -> f!() {\n                unsafe { a(0); }\n                panic!()\n            }\n        )+\n  };\n  (\n    $context:ty,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(#[inline(always)] fn $name(&mut self, _: $context, $(_: $arg),*) {})*\n  );\n  (\n    [],\n    [$hir:tt],\n    [$($methods:tt)*]\n  ) => (\n        pub trait LateLintPass<$hir>: LintPass {\n            expand_lint_pass_methods!(&LateContext<$hir>, [$($methods)*]);\n        }\n  );\n  ([$($passes:ident),*], $self:ident, $name:ident, $params:tt) => (\n    {\n        $($self.$passes.$name $params;)*\n    }\n  );\n  (\n    $passes:tt,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(fn $name(&mut self, context: &LateContext<'tcx>, $($param: $arg),*) {\n            expand_combined_late_lint_pass_method!($passes, self, $name, (context, $($param),*));\n        })*\n  );\n  (\n    [$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]],\n    [$hir:tt],\n    $methods:tt\n  ) => (\n        #[allow(non_snake_case)]\n        $v struct $name {\n            $($passes: $passes,)*\n        }\n\n        impl $name {\n            $v fn new() -> Self {\n                Self {\n                    $($passes: $constructor,)*\n                }\n            }\n\n            $v fn get_lints() -> LintArray {\n                let mut lints = Vec::new();\n                $(lints.extend_from_slice(&$passes::get_lints());)*\n                lints\n            }\n        }\n\n        impl<'tcx> LateLintPass<'tcx> for $name {\n            expand_combined_late_lint_pass_methods!([$($passes),*], $methods);\n        }\n\n        #[allow(rustc::lint_pass_impl_without_macro)]\n        impl LintPass for $name {\n            fn name(&self) -> &'static str {\n                panic!()\n            }\n        }\n  );\n  ($macro:path, $args:tt) => (\n        $macro!($args, [\n            fn check_param(a: &ast::Param);\n        ]);\n  );\n  (\n    $context:ty,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(#[inline(always)] fn $name(&mut self, _: $context, $(_: $arg),*) {})*\n  );\n  (\n    [],\n    [$($methods:tt)*]\n  ) => (\n        pub trait EarlyLintPass: LintPass {\n            expand_early_lint_pass_methods!(&EarlyContext<'_>, [$($methods)*]);\n        }\n  );\n  ([$($passes:ident),*], $self:ident, $name:ident, $params:tt) => (\n    {\n        $($self.$passes.$name $params;)*\n    }\n  );\n  (\n    $passes:tt,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(fn $name(&mut self, context: &EarlyContext<'_>, $($param: $arg),*) {\n            expand_combined_early_lint_pass_method!($passes, self, $name, (context, $($param),*));\n        })*\n  );\n  (\n    [$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]],\n    $methods:tt\n  ) => (\n        #[allow(non_snake_case)]\n        $v struct $name {\n            $($passes: $passes,)*\n        }\n\n        impl $name {\n            $v fn new() -> Self {\n                Self {\n                    $($passes: $constructor,)*\n                }\n            }\n\n            $v fn get_lints() -> LintArray {\n                let mut lints = Vec::new();\n                $(lints.extend_from_slice(&$passes::get_lints());)*\n                lints\n            }\n        }\n\n        impl EarlyLintPass for $name {\n            expand_combined_early_lint_pass_methods!([$($passes),*], $methods);\n        }\n\n        #[allow(rustc::lint_pass_impl_without_macro)]\n        impl LintPass for $name {\n            fn name(&self) -> &'static str {\n                panic!()\n            }\n        }\n  );\n  (\n    $ty:expr,\n    $val:expr,\n    $negative:expr,\n    $($type:ident => [$($utypes:expr),*] => [$($itypes:expr),*]),+\n  ) => {\n           {\n               let _neg = if negative { 1 } else { 0 };\n               match $ty {\n                   $($type => {\n                       $(if !negative && val <= uint_ty_range($utypes).1 {\n                           return Some($utypes.name_str())\n                       })*\n                       $(if val <= int_ty_range($itypes).1 as u128 + _neg {\n                           return Some($itypes.name_str())\n                       })*\n                       None\n                   },)+\n                   _ => None\n               }\n           }\n  };\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr\n  ) => (\n        $crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, false}\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    report_in_external_macro: $rep:expr\n  ) => (\n         $crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, $rep}\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $external:expr\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: &concat!(stringify!($tool), \"::\", stringify!($NAME)),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: None,\n            report_in_external_macro: $external,\n            future_incompatible: None,\n            is_plugin: true,\n            feature_gate: None,\n            crate_level_only: false,\n        };\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr\n  ) => (\n        $crate::declare_lint!(\n            $(#[$attr])* $vis $NAME, $Level, $desc,\n        );\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $(@feature_gate = $gate:expr;)? $(\n      @future_incompatible = FutureIncompatibleInfo {\n        $($field:ident: $val:expr),*\n        $(,)*\n      };\n    )? $($v:ident),*\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: stringify!($NAME),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: None,\n            is_plugin: false,\n            $($v: true,)*\n            $(feature_gate: Some($gate),)*\n            $(future_incompatible: Some($crate::FutureIncompatibleInfo {\n                $($field: $val,)*\n                ..$crate::FutureIncompatibleInfo::default_fields_for_macro()\n            }),)*\n            ..$crate::Lint::default_fields_for_macro()\n        };\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $lint_edition:expr => $edition_level:ident\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: stringify!($NAME),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: Some(($lint_edition, $crate::Level::$edition_level)),\n            report_in_external_macro: false,\n            is_plugin: false,\n        };\n  );\n  ($($lint:expr),*,) => { lint_array!( $($lint),* ) };\n  ($($lint:expr),*) => {\n    {\n        vec![$($lint),*]\n    }\n  };\n  ($ty:ty => [$($lint:expr),* $(,)?]) => {\n        impl $crate::LintPass for $ty {\n            fn name(&self) -> &'static str { stringify!($ty) }\n        }\n        impl $ty {\n            pub fn get_lints() -> $crate::LintArray { $crate::lint_array!($($lint),*) }\n        }\n  };\n  (\n    $(#[$m:meta])*\n    $name:ident => [$($lint:expr),* $(,)?]\n  ) => {\n        $(#[$m])* #[derive(Copy, Clone)] pub struct $name;\n        $crate::impl_lint_pass!($name => [$($lint),*]);\n  };\n  ($cfg:meta, $($method:ident),*) => {\n    {\n        #[cfg($cfg)]\n        fn init() {\n            extern \"C\" {\n                $(fn $method();)*\n            }\n            unsafe {\n                $($method();)*\n            }\n        }\n        #[cfg(not($cfg))]\n        fn init() { }\n        init();\n    }\n  };\n  (\n    $attr:expr,\n    $nested_attr:expr\n  ) => {{ throw_invalid_nested_attr!($attr, $nested_attr, |diag| diag) }};\n  ($attr:expr, $nested_attr:expr, $f:expr) => {\n    {\n        let diag = crate::diagnostics::error::invalid_nested_attr($attr, $nested_attr);\n        return Err(crate::diagnostics::error::_throw_err(diag, $f));\n    }\n  };\n  (\n    $attr:expr,\n    $meta:expr\n  ) => {{ throw_invalid_attr!($attr, $meta, |diag| diag) }};\n  ($attr:expr, $meta:expr, $f:expr) => {\n    {\n        let diag = crate::diagnostics::error::invalid_attr($attr, $meta);\n        return Err(crate::diagnostics::error::_throw_err(diag, $f));\n    }\n  };\n  ($span:expr, $msg:expr) => {{ throw_span_err!($span, $msg, |diag| diag) }};\n  ($span:expr, $msg:expr, $f:expr) => {\n    {\n        let diag = span_err($span, $msg);\n        return Err(crate::diagnostics::error::_throw_err(diag, $f));\n    }\n  };\n  ($ty:ty { $(($($pat:tt)*))* }) => {\n        impl FixedSizeEncoding for Option<$ty> {\n            type ByteArray = [u8;1];\n\n            #[inline]\n            fn from_bytes(b: &[u8;1]) -> Self {\n                use $ty::*;\n                if b[0] == 0 {\n                    return None;\n                }\n                match b[0] - 1 {\n                    $(${index()} => Some($($pat)*),)*\n                    _ => panic!(\"Unexpected ImplPolarity code: {:?}\", b[0]),\n                }\n            }\n\n            #[inline]\n            fn write_to_bytes(self, b: &mut [u8;1]) {\n                use $ty::*;\n                b[0] = match self {\n                    None => 0,\n                    $(Some($($pat)*) => 1 + ${index()},)*\n                }\n            }\n        }\n  };\n  ($msg:expr) => ({ $crate::util::bug::bug_fmt(::std::format_args!($msg)) });\n  ($msg:expr,) => ({ $crate::bug!($msg) });\n  (\n    $fmt:expr,\n    $($arg:tt)+\n  ) => (\n    {\n        $crate::util::bug::bug_fmt(::std::format_args!($fmt, $($arg)+))\n    }\n  );\n  (\n    $span:expr,\n    $msg:expr\n  ) => ({ $crate::util::bug::span_bug_fmt($span, ::std::format_args!($msg)) });\n  ($span:expr, $msg:expr,) => ({ $crate::span_bug!($span, $msg) });\n  (\n    $span:expr,\n    $fmt:expr,\n    $($arg:tt)+\n  ) => (\n    {\n        $crate::util::bug::span_bug_fmt($span, ::std::format_args!($fmt, $($arg)+))\n    }\n  );\n  (for < $tcx:lifetime > { $($ty:ty,)+ }) => {\n        $(\n            impl<$tcx> $crate::ty::Lift<$tcx> for $ty {\n                type Lifted = Self;\n                fn lift_to_tcx(self, _: $crate::ty::TyCtxt<$tcx>) -> Option<Self> {\n                    Some(self)\n                }\n            }\n        )+\n  };\n\n  ($($ty:ty,)+) => {\n        CloneLiftImpls! {\n            for <'tcx> {\n                $($ty,)+\n            }\n        }\n  };\n  (for < $tcx:lifetime > { $($ty:ty,)+ }) => {\n        $(\n            impl<$tcx> $crate::ty::fold::TypeFoldable<$tcx> for $ty {\n                fn try_super_fold_with<F: $crate::ty::fold::FallibleTypeFolder<$tcx>>(\n                    self,\n                    _: &mut F\n                ) -> ::std::result::Result<$ty, F::Error> {\n                    Ok(self)\n                }\n\n                fn super_visit_with<F: $crate::ty::fold::TypeVisitor<$tcx>>(\n                    &self,\n                    _: &mut F)\n                    -> ::std::ops::ControlFlow<F::BreakTy>\n                {\n                    ::std::ops::ControlFlow::CONTINUE\n                }\n            }\n        )+\n  };\n\n  ($($ty:ty,)+) => {\n        TrivialTypeFoldableImpls! {\n            for <'tcx> {\n                $($ty,)+\n            }\n        }\n  };\n  ($($t:tt)*) => {\n        TrivialTypeFoldableImpls! { $($t)* }\n        CloneLiftImpls! { $($t)* }\n  };\n  (\n    impl < $($p:tt),*\n    > TypeFoldable < $tcx:tt > for $s:path { $($variants:tt)* }\n    $(\n      where\n      $($wc:tt)*\n    )*\n  ) => {\n        impl<$($p),*> $crate::ty::fold::TypeFoldable<$tcx> for $s\n            $(where $($wc)*)*\n        {\n            fn try_super_fold_with<V: $crate::ty::fold::FallibleTypeFolder<$tcx>>(\n                self,\n                folder: &mut V,\n            ) -> ::std::result::Result<Self, V::Error> {\n                EnumTypeFoldableImpl!(@FoldVariants(self, folder) input($($variants)*) output())\n            }\n\n            fn super_visit_with<V: $crate::ty::fold::TypeVisitor<$tcx>>(\n                &self,\n                visitor: &mut V,\n            ) -> ::std::ops::ControlFlow<V::BreakTy> {\n                EnumTypeFoldableImpl!(@VisitVariants(self, visitor) input($($variants)*) output())\n            }\n        }\n  };\n  ($($ty:ty),+ $(,)?) => {\n        $(\n            impl $crate::ty::ParameterizedOverTcx for $ty {\n                #[allow(unused_lifetimes)]\n                type Value<'tcx> = $ty;\n            }\n        )*\n  };\n  ($($ident:ident),+ $(,)?) => {\n        $(\n            impl $crate::ty::ParameterizedOverTcx for $ident<'static> {\n                type Value<'tcx> = $ident<'tcx>;\n            }\n        )*\n  };\n  ($($field:ident: $method:ident($ty:ty)),+ $(,)?) => (\n        impl<'tcx> TyCtxt<'tcx> {\n            $(pub fn $method(self, v: &[$ty]) -> &'tcx List<$ty> {\n                self.interners.$field.intern_ref(v, || {\n                    InternedInSet(List::from_arena(&*self.arena, v))\n                }).0\n            })+\n        }\n  );\n  ($($name:ident: $method:ident($ty:ty): $ret_ctor:ident -> $ret_ty:ty,)+) => {\n        $(impl<'tcx> Borrow<$ty> for InternedInSet<'tcx, $ty> {\n            fn borrow<'a>(&'a self) -> &'a $ty {\n                &self.0\n            }\n        }\n\n        impl<'tcx> PartialEq for InternedInSet<'tcx, $ty> {\n            fn eq(&self, other: &Self) -> bool {\n                // comment\n                // comment\n                self.0 == other.0\n            }\n        }\n\n        impl<'tcx> Eq for InternedInSet<'tcx, $ty> {}\n\n        impl<'tcx> Hash for InternedInSet<'tcx, $ty> {\n            fn hash<H: Hasher>(&self, s: &mut H) {\n                // comment\n                // comment\n                self.0.hash(s)\n            }\n        }\n\n        impl<'tcx> TyCtxt<'tcx> {\n            pub fn $method(self, v: $ty) -> $ret_ty {\n                $ret_ctor(Interned::new_unchecked(self.interners.$name.intern(v, |v| {\n                    InternedInSet(self.interners.arena.alloc(v))\n                }).0))\n            }\n        })+\n  };\n  ($DecoderName:ident < $($typaram:tt),* >) => {\n        mod __ty_decoder_impl {\n            use std::borrow::Cow;\n            use rustc_serialize::Decoder;\n\n            use super::$DecoderName;\n\n            impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {\n                $crate::__impl_decoder_methods! {\n                    read_u128 -> u128;\n                    read_u64 -> u64;\n                    read_u32 -> u32;\n                    read_u16 -> u16;\n                    read_u8 -> u8;\n                    read_usize -> usize;\n\n                    read_i128 -> i128;\n                    read_i64 -> i64;\n                    read_i32 -> i32;\n                    read_i16 -> i16;\n                    read_i8 -> i8;\n                    read_isize -> isize;\n\n                    read_bool -> bool;\n                    read_f64 -> f64;\n                    read_f32 -> f32;\n                    read_char -> char;\n                    read_str -> &str;\n                }\n\n                #[inline]\n                fn read_raw_bytes(&mut self, len: usize) -> &[u8] {\n                    self.opaque.read_raw_bytes(len)\n                }\n            }\n        }\n  };\n  ($($t:ty),+ $(,)?) => {\n        $(\n            impl<'tcx, E: TyEncoder<I = TyCtxt<'tcx>>> Encodable<E> for ty::Binder<'tcx, $t> {\n                fn encode(&self, e: &mut E) -> Result<(), E::Error> {\n                    self.bound_vars().encode(e)?;\n                    self.as_ref().skip_binder().encode(e)\n                }\n            }\n            impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> Decodable<D> for ty::Binder<'tcx, $t> {\n                fn decode(decoder: &mut D) -> Self {\n                    let bound_vars = Decodable::decode(decoder);\n                    ty::Binder::bind_with_vars(Decodable::decode(decoder), bound_vars)\n                }\n            }\n        )*\n  };\n  (< $tcx:tt > $($ty:ty,)*) => {\n        $(impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for $ty {\n            #[inline]\n            fn decode(decoder: &mut D) -> &'tcx Self {\n                decoder.interner().arena.alloc(Decodable::decode(decoder))\n            }\n        }\n\n        impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for [$ty] {\n            #[inline]\n            fn decode(decoder: &mut D) -> &'tcx Self {\n                decoder.interner().arena.alloc_from_iter(<Vec<_> as Decodable<D>>::decode(decoder))\n            }\n        })*\n  };\n  ([$($a:tt $name:ident: $ty:ty,)*]) => {\n        $(\n            impl_arena_allocatable_decoder!($a [$name: $ty]);\n        )*\n  };\n  ([] $args:tt) => {};\n  ([decode $(, $attrs:ident)*] [$name:ident: $ty:ty]) => {\n        impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for $ty {\n            #[inline]\n            fn decode(decoder: &mut D) -> &'tcx Self {\n                decode_arena_allocable(decoder)\n            }\n        }\n\n        impl<'tcx, D: TyDecoder<I = TyCtxt<'tcx>>> RefDecodable<'tcx, D> for [$ty] {\n            #[inline]\n            fn decode(decoder: &mut D) -> &'tcx Self {\n                decode_arena_allocable_slice(decoder)\n            }\n        }\n  };\n  ($($name:ident -> $ty:ty;)*) => {\n        $(\n            #[inline]\n            fn $name(&mut self) -> $ty {\n                self.opaque.$name()\n            }\n        )*\n  };\n  (@ $lit:literal) => {\n        write!(scoped_cx!(), $lit)?\n  };\n  (@write($($data:expr),+)) => {\n        write!(scoped_cx!(), $($data),+)?\n  };\n  (@print($x:expr)) => {\n        scoped_cx!() = $x.print(scoped_cx!())?\n  };\n  (@$method:ident($($arg:expr),*)) => {\n        scoped_cx!() = scoped_cx!().$method($($arg),*)?\n  };\n  ($($elem:tt $(($($args:tt)*))?),+) => {\n    {\n        $(p!(@ $elem $(($($args)*))?);)+\n    }\n  };\n  ($cx:ident) => {\n        #[allow(unused_macros)]\n        macro_rules! scoped_cx {\n            () => {\n                $cx\n            };\n        }\n  };\n  (\n    $(\n      $(#[$a:meta])*\n      fn $name:ident($helper:ident, $tl:ident);\n    )+\n  ) => {\n        $(\n            #[must_use]\n            pub struct $helper(bool);\n\n            impl $helper {\n                pub fn new() -> $helper {\n                    $helper($tl.with(|c| c.replace(true)))\n                }\n            }\n\n            $(#[$a])*\n            pub macro $name($e:expr) {\n                {\n                    let _guard = $helper::new();\n                    $e\n                }\n            }\n\n            impl Drop for $helper {\n                fn drop(&mut self) {\n                    $tl.with(|c| c.set(self.0))\n                }\n            }\n        )+\n  };\n  ($($ty:ty),+) => {\n        // comment\n        $(#[allow(unused_lifetimes)] impl<'tcx> fmt::Display for $ty {\n            fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {\n                ty::tls::with(|tcx| {\n                    let cx = tcx.lift(*self)\n                        .expect(\"could not lift for printing\")\n                        .print(FmtPrinter::new(tcx, Namespace::TypeNS))?;\n                    f.write_str(&cx.into_buffer())?;\n                    Ok(())\n                })\n            }\n        })+\n  };\n  (($self:ident, $cx:ident): $($ty:ty $print:block)+) => {\n        $(impl<'tcx, P: PrettyPrinter<'tcx>> Print<'tcx, P> for $ty {\n            type Output = P;\n            type Error = fmt::Error;\n            fn print(&$self, $cx: P) -> Result<Self::Output, Self::Error> {\n                #[allow(unused_mut)]\n                let mut $cx = $cx;\n                define_scoped_cx!($cx);\n                let _: () = $print;\n                #[allow(unreachable_code)]\n                Ok($cx)\n            }\n        })+\n\n        forward_display_to_print!($($ty),+);\n  };\n  ($($ty:ty),*) => {\n        $(\n            impl From<$ty> for ScalarInt {\n                #[inline]\n                fn from(u: $ty) -> Self {\n                    Self {\n                        data: u128::from(u),\n                        size: std::mem::size_of::<$ty>() as u8,\n                    }\n                }\n            }\n        )*\n  };\n  ($($ty:ty),*) => {\n        $(\n            impl TryFrom<ScalarInt> for $ty {\n                type Error = Size;\n                #[inline]\n                fn try_from(int: ScalarInt) -> Result<Self, Size> {\n                    // comment\n                    // comment\n                    int.to_bits(Size::from_bytes(std::mem::size_of::<$ty>()))\n                       .map(|u| u.try_into().unwrap())\n                }\n            }\n        )*\n  };\n  (\n    < $tcx:tt > $(\n      [$($attrs:tt)*]\n      $variant:ident $(($tuple_arg_ty:ty $(,)?))*,\n    )*\n  ) => (\n            #[macro_export]\n            macro_rules! make_dep_kind_array {\n                ($mod:ident) => {[ $($mod::$variant()),* ]};\n            }\n    \n            /// comment\n            #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Encodable, Decodable)]\n            #[allow(non_camel_case_types)]\n            pub enum DepKind {\n                $($variant),*\n            }\n    \n            fn dep_kind_from_label_string(label: &str) -> Result<DepKind, ()> {\n                match label {\n                    $(stringify!($variant) => Ok(DepKind::$variant),)*\n                    _ => Err(()),\n                }\n            }\n    \n            /// comment\n            /// comment\n            #[allow(dead_code, non_upper_case_globals)]\n            pub mod label_strs {\n               $(\n                    pub const $variant: &str = stringify!($variant);\n                )*\n            }\n  );\n  ($ty:ty { $(($($pat:tt)*))* }) => {\n        impl FixedSizeEncoding for Option<$ty> {\n            type ByteArray = [u8;1];\n\n            #[inline]\n            fn from_bytes(b: &[u8;1]) -> Self {\n                use $ty::*;\n                if b[0] == 0 {\n                    return None;\n                }\n                match b[0] - 1 {\n                    $(${index()} => Some($($pat)*),)*\n                    _ => panic!(\"Unexpected ImplPolarity code: {:?}\", b[0]),\n                }\n            }\n\n            #[inline]\n            fn write_to_bytes(self, b: &mut [u8;1]) {\n                use $ty::*;\n                b[0] = match self {\n                    None => 0,\n                    $(Some($($pat)*) => 1 + ${index()},)*\n                }\n            }\n        }\n  };\n  ($($name:ident: Table < $IDX:ty, $T:ty >),+ $(,)?) => {\n        #[derive(MetadataEncodable, MetadataDecodable)]\n        pub(crate) struct LazyTables {\n            $($name: LazyTable<$IDX, $T>),+\n        }\n\n        #[derive(Default)]\n        struct TableBuilders {\n            $($name: TableBuilder<$IDX, $T>),+\n        }\n\n        impl TableBuilders {\n            fn encode(&self, buf: &mut Encoder) -> LazyTables {\n                LazyTables {\n                    $($name: self.$name.encode(buf)),+\n                }\n            }\n        }\n  };\n  ($($name:ident($ty:ty);)*) => {\n        $(fn $name(&mut self, value: $ty) -> Result<(), Self::Error> {\n            self.opaque.$name(value)\n        })*\n  };\n  ($self:ident.$tables:ident.$table:ident [$def_id:expr] < -$value:expr) => {\n    {\n        {\n            let value = $value;\n            let lazy = $self.lazy(value);\n            $self.$tables.$table.set($def_id.index, lazy);\n        }\n    }\n  };\n  (\n    < $lt:tt > $tcx:ident,\n    $def_id:ident,\n    $other:ident,\n    $cdata:ident,\n    $name:ident => { table }\n  ) => {\n        provide_one! {\n            <$lt> $tcx, $def_id, $other, $cdata, $name => {\n                $cdata\n                    .root\n                    .tables\n                    .$name\n                    .get($cdata, $def_id.index)\n                    .map(|lazy| lazy.decode(($cdata, $tcx)))\n                    .process_decoded($tcx, || panic!(\"{:?} does not have a {:?}\", $def_id, stringify!($name)))\n            }\n        }\n  };\n  (\n    < $lt:tt > $tcx:ident,\n    $def_id:ident,\n    $other:ident,\n    $cdata:ident,\n    $(\n      $name:ident => { $($compute:tt)* }\n    )*\n  ) => {\n          pub fn provide_extern(providers: &mut ExternProviders) {\n              $(provide_one! {\n                  <$lt> $tcx, $def_id, $other, $cdata, $name => { $($compute)* }\n              })*\n  \n              *providers = ExternProviders {\n                  $($name,)*\n                  ..*providers\n              };\n          }\n  };\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr\n  ) => (\n        $crate::declare_lint!(\n            $(#[$attr])* $vis $NAME, $Level, $desc,\n        );\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $(@feature_gate = $gate:expr;)? $(\n      @future_incompatible = FutureIncompatibleInfo {\n        $($field:ident: $val:expr),*\n        $(,)*\n      };\n    )? $($v:ident),*\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: stringify!($NAME),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: None,\n            is_plugin: false,\n            $($v: true,)*\n            $(feature_gate: Some($gate),)*\n            $(future_incompatible: Some($crate::FutureIncompatibleInfo {\n                $($field: $val,)*\n                ..$crate::FutureIncompatibleInfo::default_fields_for_macro()\n            }),)*\n            ..$crate::Lint::default_fields_for_macro()\n        };\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $lint_edition:expr => $edition_level:ident\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: stringify!($NAME),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: Some(($lint_edition, $crate::Level::$edition_level)),\n            report_in_external_macro: false,\n            is_plugin: false,\n        };\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr\n  ) => (\n        $crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, false}\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    report_in_external_macro: $rep:expr\n  ) => (\n         $crate::declare_tool_lint!{$(#[$attr])* $vis $tool::$NAME, $Level, $desc, $rep}\n  );\n  (\n    $(#[$attr:meta])*\n    $vis:vis $tool:ident::$NAME:ident,\n    $Level:ident,\n    $desc:expr,\n    $external:expr\n  ) => (\n        $(#[$attr])*\n        $vis static $NAME: &$crate::Lint = &$crate::Lint {\n            name: &concat!(stringify!($tool), \"::\", stringify!($NAME)),\n            default_level: $crate::$Level,\n            desc: $desc,\n            edition_lint_opts: None,\n            report_in_external_macro: $external,\n            future_incompatible: None,\n            is_plugin: true,\n            feature_gate: None,\n            crate_level_only: false,\n        };\n  );\n  ($($lint:expr),*,) => { lint_array!( $($lint),* ) };\n  ($($lint:expr),*) => {\n    {\n        vec![$($lint),*]\n    }\n  };\n  ($ty:ty => [$($lint:expr),* $(,)?]) => {\n        impl $crate::LintPass for $ty {\n            fn name(&self) -> &'static str { stringify!($ty) }\n        }\n        impl $ty {\n            pub fn get_lints() -> $crate::LintArray { $crate::lint_array!($($lint),*) }\n        }\n  };\n  (\n    $(#[$m:meta])*\n    $name:ident => [$($lint:expr),* $(,)?]\n  ) => {\n        $(#[$m])* #[derive(Copy, Clone)] pub struct $name;\n        $crate::impl_lint_pass!($name => [$($lint),*]);\n  };\n  (\n    [$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]],\n    [$hir:tt],\n    $methods:tt\n  ) => (\n        #[allow(non_snake_case)]\n        $v struct $name {\n            $($passes: $passes,)*\n        }\n\n        impl $name {\n            $v fn new() -> Self {\n                Self {\n                    $($passes: $constructor,)*\n                }\n            }\n\n            $v fn get_lints() -> LintArray {\n                let mut lints = Vec::new();\n                $(lints.extend_from_slice(&$passes::get_lints());)*\n                lints\n            }\n        }\n\n        impl<'tcx> LateLintPass<'tcx> for $name {\n            expand_combined_late_lint_pass_methods!([$($passes),*], $methods);\n        }\n\n        #[allow(rustc::lint_pass_impl_without_macro)]\n        impl LintPass for $name {\n            fn name(&self) -> &'static str {\n                panic!()\n            }\n        }\n  );\n  (\n    $passes:tt,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(fn $name(&mut self, context: &LateContext<'tcx>, $($param: $arg),*) {\n            expand_combined_late_lint_pass_method!($passes, self, $name, (context, $($param),*));\n        })*\n  );\n  ([$($passes:ident),*], $self:ident, $name:ident, $params:tt) => (\n    {\n        $($self.$passes.$name $params;)*\n    }\n  );\n  (\n    $context:ty,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(#[inline(always)] fn $name(&mut self, _: $context, $(_: $arg),*) {})*\n  );\n  (\n    $context:ty,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(#[inline(always)] fn $name(&mut self, _: $context, $(_: $arg),*) {})*\n  );\n  ([$($passes:ident),*], $self:ident, $name:ident, $params:tt) => (\n    {\n        $($self.$passes.$name $params;)*\n    }\n  );\n  (\n    $passes:tt,\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(fn $name(&mut self, context: &EarlyContext<'_>, $($param: $arg),*) {\n            expand_combined_early_lint_pass_method!($passes, self, $name, (context, $($param),*));\n        })*\n  );\n  (\n    [$v:vis $name:ident, [$($passes:ident: $constructor:expr,)*]],\n    $methods:tt\n  ) => (\n        #[allow(non_snake_case)]\n        $v struct $name {\n            $($passes: $passes,)*\n        }\n\n        impl $name {\n            $v fn new() -> Self {\n                Self {\n                    $($passes: $constructor,)*\n                }\n            }\n\n            $v fn get_lints() -> LintArray {\n                let mut lints = Vec::new();\n                $(lints.extend_from_slice(&$passes::get_lints());)*\n                lints\n            }\n        }\n\n        impl EarlyLintPass for $name {\n            expand_combined_early_lint_pass_methods!([$($passes),*], $methods);\n        }\n\n        #[allow(rustc::lint_pass_impl_without_macro)]\n        impl LintPass for $name {\n            fn name(&self) -> &'static str {\n                panic!()\n            }\n        }\n  );\n  ($cx:expr, $f:ident, $($args:expr),*) => (\n    {\n        $cx.pass.$f(&$cx.context, $($args),*);\n    }\n  );\n  (\n    [\n      $(\n        $(#[$attr:meta])*\n        fn $name:ident($($param:ident: $arg:ty),*);\n      )*\n    ]\n  ) => (\n        $(fn $name(&mut self, context: &EarlyContext<'_>, $($param: $arg),*) {\n            for obj in self.lints.iter_mut() {\n                obj.$name(context, $($param),*);\n            }\n        })*\n  );\n  ($ty:ty, $size:expr) => {\n        const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];\n  };\n  (\n    $(\n      $(#[$attr:meta])*\n      $variant:ident $($group:expr)?,\n      $module:ident::$name:ident,\n      $method:ident,\n      $target:expr,\n      $generics:expr;\n    )*\n  ) => {\n\n        enum_from_u32! {\n            /// comment\n            #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable)]\n            pub enum LangItem {\n                $(\n                    #[doc = concat!(\"The `\", stringify!($name), \"` lang item.\")]\n                    /// comment\n                    $(#[$attr])*\n                    $variant,\n                )*\n            }\n        }\n        // comment\n  };\n  (\n    $(\n      $(#[doc = $doc:tt])*\n      (removed, $feature:ident, $ver:expr, $issue:expr, None, $reason:expr),\n    )+\n  ) => {\n        /// comment\n        pub const REMOVED_FEATURES: &[Feature] = &[\n            $(\n                Feature {\n                    state: State::Removed { reason: $reason },\n                    name: sym::$feature,\n                    since: $ver,\n                    issue: to_nonzero($issue),\n                    edition: None,\n                }\n            ),+\n        ];\n  };\n\n  (\n    $(\n      $(#[doc = $doc:tt])*\n      (stable_removed, $feature:ident, $ver:expr, $issue:expr, None),\n    )+\n  ) => {\n        /// comment\n        pub const STABLE_REMOVED_FEATURES: &[Feature] = &[\n            $(\n                Feature {\n                    state: State::Stabilized { reason: None },\n                    name: sym::$feature,\n                    since: $ver,\n                    issue: to_nonzero($issue),\n                    edition: None,\n                }\n            ),+\n        ];\n  };\n  (Word) => { template!(@ true, None, None) };\n  (List: $descr:expr) => { template!(@ false, Some($descr), None) };\n  (NameValueStr: $descr:expr) => { template!(@ false, None, Some($descr)) };\n  (Word, List: $descr:expr) => { template!(@ true, Some($descr), None) };\n  (\n    Word,\n    NameValueStr: $descr:expr\n  ) => { template!(@ true, None, Some($descr)) };\n  (List: $descr1:expr, NameValueStr: $descr2:expr) => {\n        template!(@ false, Some($descr1), Some($descr2))\n  };\n  (Word, List: $descr1:expr, NameValueStr: $descr2:expr) => {\n        template!(@ true, Some($descr1), Some($descr2))\n  };\n  (\n    @ $word:expr,\n    $list:expr,\n    $name_value_str:expr\n  ) => { AttributeTemplate {\n        word: $word, list: $list, name_value_str: $name_value_str\n    } };\n  (\n    $attr:ident,\n    $typ:expr,\n    $tpl:expr,\n    $duplicates:expr $(, @ only_local: $only_local:expr)? $(,)?\n  ) => {\n        BuiltinAttribute {\n            name: sym::$attr,\n            only_local: or_default!(false, $($only_local)?),\n            type_: $typ,\n            template: $tpl,\n            gate: Ungated,\n            duplicates: $duplicates,\n        }\n  };\n  ($attr:ident) => {\n        concat!(\"the `#[\", stringify!($attr), \"]` attribute is an experimental feature\")\n  };\n  (\n    $(\n      $(#[doc = $doc:tt])*\n      ($status:ident, $feature:ident, $ver:expr, $issue:expr, $edition:expr),\n    )+\n  ) => {\n        /// comment\n        /// comment\n        pub const ACTIVE_FEATURES:\n            &[Feature] =\n            &[$(\n                // comment\n                Feature {\n                    state: State::Active { set: set!($feature) },\n                    name: sym::$feature,\n                    since: $ver,\n                    issue: to_nonzero($issue),\n                    edition: $edition,\n                }\n            ),+];\n\n        /// comment\n        #[derive(Clone, Default, Debug)]\n        pub struct Features {\n            /// comment\n            pub declared_lang_features: Vec<(Symbol, Span, Option<Symbol>)>,\n            /// comment\n            pub declared_lib_features: Vec<(Symbol, Span)>,\n            /// comment\n            pub active_features: FxHashSet<Symbol>,\n            $(\n                $(#[doc = $doc])*\n                pub $feature: bool\n            ),+\n        }\n\n        impl Features {\n            pub fn walk_feature_fields(&self, mut f: impl FnMut(&str, bool)) {\n                $(f(stringify!($feature), self.$feature);)+\n            }\n\n            /// comment\n            pub fn active(&self, feature: Symbol) -> bool {\n                self.active_features.contains(&feature)\n            }\n\n            /// comment\n            /// comment\n            /// comment\n            pub fn enabled(&self, feature: Symbol) -> bool {\n                match feature {\n                    $( sym::$feature => self.$feature, )*\n\n                    _ => panic!(\"`{}` was not listed in `declare_features`\", feature),\n                }\n            }\n\n            /// comment\n            /// comment\n            /// comment\n            pub fn incomplete(&self, feature: Symbol) -> bool {\n                match feature {\n                    $(\n                        sym::$feature => declare_features!(__status_to_bool $status),\n                    )*\n                    // comment\n                    _ if self.declared_lang_features.iter().any(|f| f.0 == feature) => false,\n                    _ if self.declared_lib_features.iter().any(|f| f.0 == feature) => false,\n                    _ => panic!(\"`{}` was not listed in `declare_features`\", feature),\n                }\n            }\n        }\n  };\n  (\n    $(\n      $Kind:ident($AstTy:ty)\n      {\n        $kind_name:expr;\n        $(\n          one fn $mut_visit_ast:ident;\n          fn $visit_ast:ident;\n        )?\n        $(\n          many fn $flat_map_ast_elt:ident;\n          fn $visit_ast_elt:ident($($args:tt)*);\n        )?\n        fn $make_ast:ident;\n      }\n    )*\n  ) => {\n        /// comment\n        /// comment\n        pub enum AstFragment {\n            OptExpr(Option<P<ast::Expr>>),\n            $($Kind($AstTy),)*\n        }\n\n        /// comment\n        #[derive(Copy, Clone, PartialEq, Eq)]\n        pub enum AstFragmentKind {\n            OptExpr,\n            $($Kind,)*\n        }\n\n        impl AstFragmentKind {\n            pub fn name(self) -> &'static str {\n                match self {\n                    AstFragmentKind::OptExpr => \"expression\",\n                    $(AstFragmentKind::$Kind => $kind_name,)*\n                }\n            }\n\n            fn make_from<'a>(self, result: Box<dyn MacResult + 'a>) -> Option<AstFragment> {\n                match self {\n                    AstFragmentKind::OptExpr =>\n                        result.make_expr().map(Some).map(AstFragment::OptExpr),\n                    $(AstFragmentKind::$Kind => result.$make_ast().map(AstFragment::$Kind),)*\n                }\n            }\n        }\n\n        impl AstFragment {\n            pub fn add_placeholders(&mut self, placeholders: &[NodeId]) {\n                if placeholders.is_empty() {\n                    return;\n                }\n                match self {\n                    $($(AstFragment::$Kind(ast) => ast.extend(placeholders.iter().flat_map(|id| {\n                        ${ignore(flat_map_ast_elt)}\n                        placeholder(AstFragmentKind::$Kind, *id, None).$make_ast()\n                    })),)?)*\n                    _ => panic!(\"unexpected AST fragment kind\")\n                }\n            }\n\n            pub fn make_opt_expr(self) -> Option<P<ast::Expr>> {\n                match self {\n                    AstFragment::OptExpr(expr) => expr,\n                    _ => panic!(\"AstFragment::make_* called on the wrong kind of fragment\"),\n                }\n            }\n\n            $(pub fn $make_ast(self) -> $AstTy {\n                match self {\n                    AstFragment::$Kind(ast) => ast,\n                    _ => panic!(\"AstFragment::make_* called on the wrong kind of fragment\"),\n                }\n            })*\n\n            fn make_ast<T: InvocationCollectorNode>(self) -> T::OutputTy {\n                T::fragment_to_output(self)\n            }\n\n            pub fn mut_visit_with<F: MutVisitor>(&mut self, vis: &mut F) {\n                match self {\n                    AstFragment::OptExpr(opt_expr) => {\n                        visit_clobber(opt_expr, |opt_expr| {\n                            if let Some(expr) = opt_expr {\n                                vis.filter_map_expr(expr)\n                            } else {\n                                None\n                            }\n                        });\n                    }\n                    $($(AstFragment::$Kind(ast) => vis.$mut_visit_ast(ast),)?)*\n                    $($(AstFragment::$Kind(ast) =>\n                        ast.flat_map_in_place(|ast| vis.$flat_map_ast_elt(ast)),)?)*\n                }\n            }\n\n            pub fn visit_with<'a, V: Visitor<'a>>(&'a self, visitor: &mut V) {\n                match *self {\n                    AstFragment::OptExpr(Some(ref expr)) => visitor.visit_expr(expr),\n                    AstFragment::OptExpr(None) => {}\n                    $($(AstFragment::$Kind(ref ast) => visitor.$visit_ast(ast),)?)*\n                    $($(AstFragment::$Kind(ref ast) => for ast_elt in &ast[..] {\n                        visitor.$visit_ast_elt(ast_elt, $($args)*);\n                    })?)*\n                }\n            }\n        }\n\n        impl<'a> MacResult for crate::mbe::macro_rules::ParserAnyMacro<'a> {\n            $(fn $make_ast(self: Box<crate::mbe::macro_rules::ParserAnyMacro<'a>>)\n                           -> Option<$AstTy> {\n                Some(self.make(AstFragmentKind::$Kind).$make_ast())\n            })*\n        }\n  };\n  ($($fld:ident: $t:ty,)*) => {\n        /// comment\n        /// comment\n        #[derive(Default)]\n        pub struct MacEager {\n            $(\n                pub $fld: Option<$t>,\n            )*\n        }\n\n        impl MacEager {\n            $(\n                pub fn $fld(v: $t) -> Box<dyn MacResult> {\n                    Box::new(MacEager {\n                        $fld: Some(v),\n                        ..Default::default()\n                    })\n                }\n            )*\n        }\n  };\n  (\n    $session:expr,\n    $span:expr,\n    $code:ident,\n    $($message:tt)*\n  ) => (\n    {\n        $session.struct_span_err_with_code(\n            $span,\n            &format!($($message)*),\n            $crate::error_code!($code),\n        )\n    }\n  );\n  (\n    $(#[$attr:meta])*\n    pub enum $name:ident {\n      $(\n        $(#[$var_attr:meta])*\n        $variant:ident = $e:expr,\n      )*\n    }\n  ) => {\n        $(#[$attr])*\n        pub enum $name {\n            $($(#[$var_attr])* $variant = $e),*\n        }\n\n        impl $name {\n            pub fn from_u32(u: u32) -> Option<$name> {\n                $(if u == $name::$variant as u32 {\n                    return Some($name::$variant)\n                })*\n                None\n            }\n        }\n  };\n  (\n    $(#[$attr:meta])*\n    pub enum $name:ident {\n      $(\n        $(#[$var_attr:meta])*\n        $variant:ident,\n      )*\n    }\n  ) => {\n        $(#[$attr])*\n        pub enum $name {\n            $($(#[$var_attr])* $variant,)*\n        }\n\n        impl $name {\n            pub fn from_u32(u: u32) -> Option<$name> {\n                $(if u == $name::$variant as u32 {\n                    return Some($name::$variant)\n                })*\n                None\n            }\n        }\n  };\n  (\n    $e:expr,\n    $where:expr,\n    $(\n      $($p:pat_param)|+ => { $($what_fmt:expr),+ }\n      $(expected { $($expected_fmt:expr),+ })?\n    ),+\n    $(,)?\n  ) => {\n    {\n        match $e {\n            Ok(x) => x,\n            // comment\n            // comment\n            Err(e) => match e.kind() {\n                $(\n                    $($p)|+ =>\n                       throw_validation_failure!(\n                            $where,\n                            { $( $what_fmt ),+ } $( expected { $( $expected_fmt ),+ } )?\n                        )\n                ),+,\n                #[allow(unreachable_patterns)]\n                _ => Err::<!, _>(e)?,\n            }\n        }\n    }\n  };\n  (\n    $where:expr,\n    { $($what_fmt:expr),+ }\n    $(expected { $($expected_fmt:expr),+ })?\n  ) => {\n    {\n        let mut msg = String::new();\n        msg.push_str(\"encountered \");\n        write!(&mut msg, $($what_fmt),+).unwrap();\n        $(\n            msg.push_str(\", but expected \");\n            write!(&mut msg, $($expected_fmt),+).unwrap();\n        )?\n        let path = rustc_middle::ty::print::with_no_trimmed_paths!({\n            let where_ = &$where;\n            if !where_.is_empty() {\n                let mut path = String::new();\n                write_path(&mut path, where_);\n                Some(path)\n            } else {\n                None\n            }\n        });\n        throw_ub!(ValidationFailure { path, msg })\n    }\n  };\n  ($($name:ident: $($($p:ident),* => $call:ident),*;)*) => {\n        $(if name == sym::$name {\n            match in_elem.kind() {\n                $($(ty::$p(_))|* => {\n                    return Ok(bx.$call(args[0].immediate()))\n                })*\n                _ => {},\n            }\n            require!(false,\n                     \"unsupported operation on `{}` with element `{}`\",\n                     in_ty,\n                     in_elem)\n        })*\n  };\n  ($($name:ident: $($($p:ident),* => $call:ident),*;)*) => {\n        $(if name == sym::$name {\n            match in_elem.kind() {\n                $($(ty::$p(_))|* => {\n                    return Ok(bx.$call(args[0].immediate(), args[1].immediate()))\n                })*\n                _ => {},\n            }\n            require!(false,\n                     \"unsupported operation on `{}` with element `{}`\",\n                     in_ty,\n                     in_elem)\n        })*\n  };\n  (\n    $register:ident;\n    $(fn $name:ident($($arg_name:ident: $arg_ty:ty),*) -> $ret_ty:ty;)*\n  ) => {\n        #[cfg(feature = \"jit\")]\n        #[allow(improper_ctypes)]\n        extern \"C\" {\n            $(fn $name($($arg_name: $arg_ty),*) -> $ret_ty;)*\n        }\n\n        #[cfg(feature = \"jit\")]\n        pub(crate) fn $register(builder: &mut cranelift_jit::JITBuilder) {\n            for (name, val) in [$((stringify!($name), $name as *const u8)),*] {\n                builder.symbol(name, val);\n            }\n        }\n  };\n  (\n    $fx:expr,\n    $intrinsic:expr,\n    $args:expr,\n    _ => $unknown:block;\n    $(\n      $($($name:tt).*)|+ $(if $cond:expr)?,\n      ($($a:ident $arg:ident),*) $content:block;\n    )*\n  ) => {\n        match $intrinsic {\n            $(\n                $(intrinsic_pat!($($name).*))|* $(if $cond)? => {\n                    if let [$($arg),*] = $args {\n                        $(intrinsic_arg!($a $fx, $arg);)*\n                        $content\n                    } else {\n                        bug!(\"wrong number of args for intrinsic {:?}\", $intrinsic);\n                    }\n                }\n            )*\n            _ => $unknown,\n        }\n  };\n  ($($t:ty => $variant:path,)*) => {\n        $(\n            impl From<$t> for PrefValue {\n                fn from(other: $t) -> Self {\n                    $variant(other.into())\n                }\n            }\n        )+\n        $(\n            impl From<Option<$t>> for PrefValue {\n                fn from(other: Option<$t>) -> Self {\n                    other.map(|val| $variant(val.into())).unwrap_or(PrefValue::Missing)\n                }\n            }\n        )+\n  };\n  ($($variant:path => $t:ty,)*) => {\n        $(\n            impl From<PrefValue> for $t {\n                #[allow(unsafe_code)]\n                fn from(other: PrefValue) -> Self {\n                    if let $variant(value) = other {\n                        value.into()\n                    } else {\n                        panic!(\"Cannot convert {:?} to {:?}\", other, std::any::type_name::<$t>())\n                    }\n                }\n            }\n        )+\n        $(\n            impl From<PrefValue> for Option<$t> {\n                fn from(other: PrefValue) -> Self {\n                    if let PrefValue::Missing = other {\n                        None\n                    } else {\n                        Some(other.into())\n                    }\n                }\n            }\n        )+\n  };\n  (\n    $(\n      $variant:path => {\n        $($flex_relative_side:ident <= > $flow_relative_side:ident,)+\n      },\n    )+\n  ) => {\n        pub fn sides_to_flex_relative<T>(self, flow_relative: Sides<T>) -> FlexRelativeSides<T> {\n            match self {\n                $(\n                    $variant => FlexRelativeSides {\n                        $( $flex_relative_side: flow_relative.$flow_relative_side, )+\n                    },\n                )+\n            }\n        }\n\n        pub fn sides_to_flow_relative<T>(self, flex_relative: FlexRelativeSides<T>) -> Sides<T> {\n            match self {\n                $(\n                    $variant => Sides {\n                        $( $flow_relative_side: flex_relative.$flex_relative_side, )+\n                    },\n                )+\n            }\n        }\n  };\n  ($($name:expr,)+) => {\n        {\n            $(\n                atom_type.atom($name);\n            )+\n        }\n  };\n  ($tryer:ident, $getter:ident, $gltype:ty, $glcall:ident, $rstype:ty) => {\n        #[allow(unsafe_code)]\n        fn $tryer(self, parameter: GLenum) -> Option<$rstype> {\n            let mut value = [<$gltype>::default()];\n            unsafe {\n                self.$glcall(parameter, &mut value);\n            }\n            if self.get_error() != gl::NO_ERROR {\n                None\n            } else {\n                Some(value[0] as $rstype)\n            }\n        }\n\n        fn $getter(self, parameter: GLenum) -> $rstype {\n            self.$tryer(parameter).unwrap()\n        }\n  };\n  (\n    $name:ident {\n      $($variant:ident($kind:ident { $($param:ident = gl::$value:ident,)+ }),)+\n    }\n  ) => {\n        #[derive(Clone, Copy, Debug, Deserialize, Serialize)]\n        pub enum $name { $(\n            $variant($kind),\n        )+}\n\n        $(\n            #[derive(Clone, Copy, Debug, Deserialize, Serialize)]\n            #[repr(u32)]\n            pub enum $kind { $(\n                $param = gl::$value,\n            )+}\n        )+\n\n        impl $name {\n            pub fn from_u32(value: u32) -> WebGLResult<Self> {\n                match value {\n                    $($(gl::$value => Ok($name::$variant($kind::$param)),)+)+\n                    _ => Err(WebGLError::InvalidEnum)\n                }\n            }\n        }\n  };\n  (\n    $(\n      pub enum $name:ident { $($variant:ident = $mod:ident::$constant:ident,)+ }\n    )*\n  ) => {\n        $(\n            #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf)]\n            #[derive(PartialEq, Serialize)]\n            #[repr(u32)]\n            pub enum $name { $($variant = $mod::$constant,)+ }\n\n            impl $name {\n                pub fn from_gl_constant(constant: u32) -> Option<Self> {\n                    Some(match constant {\n                        $($mod::$constant => $name::$variant, )+\n                        _ => return None,\n                    })\n                }\n\n                #[inline]\n                pub fn as_gl_constant(&self) -> u32 {\n                    *self as u32\n                }\n            }\n        )*\n  };\n  ($t1:expr, $t2:expr, $t3:expr, $t4:expr) => {\n        (($t1 as u32) << 24) | (($t2 as u32) << 16) | (($t3 as u32) << 8) | ($t4 as u32)\n  };\n  ($result:expr) => ($result.map_err(|_| (()))?);\n  (\n    $(\n      $variant:path => {\n        $($flex_relative_side:ident <= > $flow_relative_side:ident,)+\n      },\n    )+\n  ) => {\n        pub fn sides_to_flex_relative<T>(self, flow_relative: Sides<T>) -> FlexRelativeSides<T> {\n            match self {\n                $(\n                    $variant => FlexRelativeSides {\n                        $( $flex_relative_side: flow_relative.$flow_relative_side, )+\n                    },\n                )+\n            }\n        }\n\n        pub fn sides_to_flow_relative<T>(self, flex_relative: FlexRelativeSides<T>) -> Sides<T> {\n            match self {\n                $(\n                    $variant => Sides {\n                        $( $flow_relative_side: flex_relative.$flex_relative_side, )+\n                    },\n                )+\n            }\n        }\n  };\n  (\n    $prev:ident,\n    $name:ident,\n    $($rest:ident,)* [$($tt:tt)*]\n  ) => {\n        capabilities!($name, $($rest,)* [$($tt)* $name = Self::$prev.bits << 1;]);\n  };\n  (\n    [$($InSelector:tt)*]\n    [$($CommonBounds:tt)*]\n    [$($FromStr:tt)*]\n  ) => {\n        /// comment\n        /// comment\n        pub trait SelectorImpl: Clone + Debug + Sized + 'static {\n            type ExtraMatchingData: Sized + Default + 'static;\n            type AttrValue: $($InSelector)*;\n            type Identifier: $($InSelector)*;\n            type LocalName: $($InSelector)* + Borrow<Self::BorrowedLocalName>;\n            type NamespaceUrl: $($CommonBounds)* + Default + Borrow<Self::BorrowedNamespaceUrl>;\n            type NamespacePrefix: $($InSelector)* + Default;\n            type BorrowedNamespaceUrl: ?Sized + Eq;\n            type BorrowedLocalName: ?Sized + Eq;\n\n            /// comment\n            /// comment\n            type NonTSPseudoClass: $($CommonBounds)* + NonTSPseudoClass<Impl = Self>;\n\n            /// comment\n            type PseudoElement: $($CommonBounds)* + PseudoElement<Impl = Self>;\n        }\n  };\n  (\n    [$($CommonBounds:tt)*]\n    [$($FromStr:tt)*]\n  ) => {\n        with_all_bounds! {\n            [$($CommonBounds)* + $($FromStr)* + ToCss]\n            [$($CommonBounds)*]\n            [$($FromStr)*]\n        }\n  };\n  ($({ $name:ident, $boxed:expr })+) => {\n        /// comment\n        /// comment\n        /// comment\n        pub mod computed_values {\n            $(\n                pub use crate::properties::longhands::$name::computed_value as $name;\n            )+\n            // comment\n            pub use crate::properties::longhands::border_top_style::computed_value as border_style;\n        }\n  };\n  ($($fun:ident = $flag:path;)*) => (\n        impl ThreadState {\n            /// comment\n            pub fn is_worker(self) -> bool {\n                self.contains(ThreadState::IN_WORKER)\n            }\n    \n            $(\n                #[allow(missing_docs)]\n                pub fn $fun(self) -> bool {\n                    self.contains($flag)\n                }\n            )*\n        }\n  );\n  ($self:ident.$checker:ident($value:ident)) => {\n        if !$self.$checker(&$value) {\n            return false;\n        }\n  };\n  (\n    $(\n      #[$doc:meta] $name:tt $ident:ident / $setter:ident [$checker:tt]: $ty:ty,\n    )+\n  ) => {\n        /// comment\n        #[derive(Clone, Debug, ToShmem)]\n        pub struct CounterStyleRuleData {\n            name: CustomIdent,\n            generation: Wrapping<u32>,\n            $(\n                #[$doc]\n                $ident: Option<$ty>,\n            )+\n            /// comment\n            pub source_location: SourceLocation,\n        }\n\n        impl CounterStyleRuleData {\n            fn empty(name: CustomIdent, source_location: SourceLocation) -> Self {\n                CounterStyleRuleData {\n                    name: name,\n                    generation: Wrapping(0),\n                    $(\n                        $ident: None,\n                    )+\n                    source_location,\n                }\n            }\n\n            $(\n                #[$doc]\n                pub fn $ident(&self) -> Option<&$ty> {\n                    self.$ident.as_ref()\n                }\n            )+\n\n            $(\n                #[$doc]\n                pub fn $setter(&mut self, value: $ty) -> bool {\n                    checker!(self.$checker(value));\n                    self.$ident = Some(value);\n                    self.generation += Wrapping(1);\n                    true\n                }\n            )+\n        }\n  };\n  ([$(($css:expr, $name:ident, $state:tt, $flags:tt),)*]) => {\n        /// comment\n        #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]\n        pub enum NonTSPseudoClass {\n            $(\n                #[doc = $css]\n                $name,\n            )*\n            /// comment\n            Lang(Lang),\n            /// comment\n            Dir(Direction),\n            /// comment\n            MozLocaleDir(Direction),\n        }\n  };\n  ([$(($css:expr, $name:ident, $state:tt, $flags:tt),)*]) => {\n        match *self {\n            $(NonTSPseudoClass::$name => concat!(\":\", $css),)*\n            NonTSPseudoClass::Lang(ref s) => {\n                dest.write_str(\":lang(\")?;\n                s.to_css(dest)?;\n                return dest.write_char(')');\n            },\n            NonTSPseudoClass::MozLocaleDir(ref dir) => {\n                dest.write_str(\":-moz-locale-dir(\")?;\n                dir.to_css(&mut CssWriter::new(dest))?;\n                return dest.write_char(')')\n            },\n            NonTSPseudoClass::Dir(ref dir) => {\n                dest.write_str(\":dir(\")?;\n                dir.to_css(&mut CssWriter::new(dest))?;\n                return dest.write_char(')')\n            },\n        }\n  };\n  ([$(($css:expr, $name:ident, $state:tt, $flags:tt),)*]) => {\n        match_ignore_ascii_case! { &name,\n            $($css => Some(NonTSPseudoClass::$name),)*\n            \"-moz-full-screen\" => Some(NonTSPseudoClass::Fullscreen),\n            \"-moz-read-only\" => Some(NonTSPseudoClass::ReadOnly),\n            \"-moz-read-write\" => Some(NonTSPseudoClass::ReadWrite),\n            \"-moz-focusring\" => Some(NonTSPseudoClass::FocusVisible),\n            \"-moz-ui-valid\" => Some(NonTSPseudoClass::UserValid),\n            \"-moz-ui-invalid\" => Some(NonTSPseudoClass::UserInvalid),\n            \"-webkit-autofill\" => Some(NonTSPseudoClass::Autofill),\n            _ => None,\n        }\n  };\n  ($t:ty, $addref:path, $release:path) => {\n        unsafe impl RefCounted for $t {\n            #[inline]\n            fn addref(&self) {\n                unsafe { $addref(self as *const _ as *mut _) }\n            }\n\n            #[inline]\n            unsafe fn release(&self) {\n                $release(self as *const _ as *mut _)\n            }\n        }\n  };\n  ($($name:ident: $value:expr),+) => {\n        expanded!( $( $name: $value, )+ )\n  };\n  ($($name:ident: $value:expr,)+) => {\n        Longhands {\n            $(\n                $name: MaybeBoxed::maybe_boxed($value),\n            )+\n        }\n  };\n  (< $t:ident > for $ty:ty) => {\n        impl<$t> ListAnimation<$t> for $ty {\n            fn animate_repeatable_list(\n                &self,\n                other: &Self,\n                procedure: Procedure,\n            ) -> Result<Self, ()>\n            where\n                T: Animate,\n            {\n                // comment\n                if self.is_empty() || other.is_empty() {\n                    return Err(());\n                }\n                use num_integer::lcm;\n                let len = lcm(self.len(), other.len());\n                self.iter().cycle().zip(other.iter().cycle()).take(len).map(|(this, other)| {\n                    this.animate(other, procedure)\n                }).collect()\n            }\n\n            fn squared_distance_repeatable_list(\n                &self,\n                other: &Self,\n            ) -> Result<SquaredDistance, ()>\n            where\n                T: ComputeSquaredDistance,\n            {\n                if self.is_empty() || other.is_empty() {\n                    return Err(());\n                }\n                use num_integer::lcm;\n                let len = lcm(self.len(), other.len());\n                self.iter().cycle().zip(other.iter().cycle()).take(len).map(|(this, other)| {\n                    this.compute_squared_distance(other)\n                }).sum()\n            }\n\n            fn animate_with_zero(\n                &self,\n                other: &Self,\n                procedure: Procedure,\n            ) -> Result<Self, ()>\n            where\n                T: Animate + Clone + ToAnimatedZero\n            {\n                if procedure == Procedure::Add {\n                    return Ok(\n                        self.iter().chain(other.iter()).cloned().collect()\n                    );\n                }\n                self.iter().zip_longest(other.iter()).map(|it| {\n                    match it {\n                        EitherOrBoth::Both(this, other) => {\n                            this.animate(other, procedure)\n                        },\n                        EitherOrBoth::Left(this) => {\n                            this.animate(&this.to_animated_zero()?, procedure)\n                        },\n                        EitherOrBoth::Right(other) => {\n                            other.to_animated_zero()?.animate(other, procedure)\n                        }\n                    }\n                }).collect()\n            }\n\n            fn squared_distance_with_zero(\n                &self,\n                other: &Self,\n            ) -> Result<SquaredDistance, ()>\n            where\n                T: ToAnimatedZero + ComputeSquaredDistance\n            {\n                self.iter().zip_longest(other.iter()).map(|it| {\n                    match it {\n                        EitherOrBoth::Both(this, other) => {\n                            this.compute_squared_distance(other)\n                        },\n                        EitherOrBoth::Left(list) | EitherOrBoth::Right(list) => {\n                            list.to_animated_zero()?.compute_squared_distance(list)\n                        },\n                    }\n                }).sum()\n            }\n        }\n  };\n  ($name:path) => {\n        impl From<u8> for $name {\n            fn from(bits: u8) -> $name {\n                $name(crate::values::specified::align::AlignFlags::from_bits(bits)\n                      .expect(\"bits contain valid flag\"))\n            }\n        }\n\n        impl From<$name> for u8 {\n            fn from(v: $name) -> u8 {\n                v.0.bits()\n            }\n        }\n  };\n  ($($method:ident($variant:ident => $rule_type:ident),)+) => {\n        $(\n            #[allow(missing_docs)]\n            fn $method<F>(&self, device: &Device, guard: &SharedRwLockReadGuard, mut f: F)\n                where F: FnMut(&crate::stylesheets::$rule_type),\n            {\n                use crate::stylesheets::CssRule;\n\n                for rule in self.effective_rules(device, guard) {\n                    if let CssRule::$variant(ref lock) = *rule {\n                        let rule = lock.read_with(guard);\n                        f(&rule)\n                    }\n                }\n            }\n        )+\n  };\n  ($($variant_name:expr => $variant:ident($data:ident),)+) => {\n        declare_viewport_descriptor_inner!([] [ $( $variant_name => $variant($data), )+ ] 0);\n  };\n  (\n    [\n      $(\n        $assigned_variant_name:expr => $assigned_variant:ident($assigned_data:ident) = $assigned_discriminant:expr,\n      )*\n    ]\n    [\n      $next_variant_name:expr => $next_variant:ident($next_data:ident),\n      $($variant_name:expr => $variant:ident($data:ident),)*\n    ]\n    $next_discriminant:expr\n  ) => {\n        declare_viewport_descriptor_inner! {\n            [\n                $( $assigned_variant_name => $assigned_variant($assigned_data) = $assigned_discriminant, )*\n                $next_variant_name => $next_variant($next_data) = $next_discriminant,\n            ]\n            [ $( $variant_name => $variant($data), )* ]\n            $next_discriminant + 1\n        }\n  };\n\n  (\n    [\n      $(\n        $assigned_variant_name:expr => $assigned_variant:ident($assigned_data:ident) = $assigned_discriminant:expr,\n      )*\n    ]\n    []\n    $number_of_variants:expr\n  ) => {\n        #[derive(Clone, Debug, PartialEq, ToShmem)]\n        #[cfg_attr(feature = \"servo\", derive(MallocSizeOf))]\n        #[allow(missing_docs)]\n        pub enum ViewportDescriptor {\n            $(\n                $assigned_variant($assigned_data),\n            )+\n        }\n        impl ViewportDescriptor {\n            #[allow(missing_docs)]\n            pub fn discriminant_value(&self) -> usize {\n                match *self {\n                    $(\n                        ViewportDescriptor::$assigned_variant(..) => $assigned_discriminant,\n                    )*\n                }\n            }\n        }\n  };\n  {\n    $(\n      $(#[$($meta:tt)+])*\n      $ident:ident / $css:expr => $gecko:ident = $value:expr,\n    )+\n  } => {\n        bitflags! {\n            #[derive(MallocSizeOf, ToResolvedValue, ToShmem)]\n            /// comment\n            pub struct VariantEastAsian: u16 {\n                /// comment\n                const NORMAL = 0;\n                $(\n                    $(#[$($meta)+])*\n                    const $ident = $value;\n                )+\n            }\n        }\n\n        impl ToCss for VariantEastAsian {\n            fn to_css<W>(&self, dest: &mut CssWriter<W>) {\n                $(\n                    if self.intersects(VariantEastAsian::$ident) {\n                        writer.raw_item($css)?;\n                    }\n                )+\n                Ok(())\n            }\n        }\n\n        /// comment\n        #[cfg(feature = \"gecko\")]\n        #[inline]\n        pub fn assert_variant_east_asian_matches() {\n            use crate::gecko_bindings::structs;\n            $(debug_assert_eq!(structs::$gecko as u16, VariantEastAsian::$ident.bits());)+\n        }\n        impl SpecifiedValueInfo for VariantEastAsian {\n            fn collect_completion_keywords(f: KeywordsCollectFn) {\n                f(&[\"normal\", $($css,)+]);\n            }\n        }\n  };\n  (\n    $parser:ident,\n    $abs:ident,\n    $enum:ident,\n    [$para:ident => $func:ident $(, $other_para:ident => $other_func:ident)*]\n  ) => {\n        {\n            loop {\n                let $para = $func(&mut $parser.chars)?;\n                $(\n                    skip_comma_wsp(&mut $parser.chars);\n                    let $other_para = $other_func(&mut $parser.chars)?;\n                )*\n                $parser.path.push(PathCommand::$enum { $para $(, $other_para)*, $abs });\n\n                // comment\n                if !skip_wsp(&mut $parser.chars) ||\n                   $parser.chars.peek().map_or(true, |c| c.is_ascii_alphabetic()) {\n                    break;\n                }\n                skip_comma_wsp(&mut $parser.chars);\n            }\n            Ok(())\n        }\n  };\n  (pub enum $name:ident { $($variant:ident = $css:expr,)+ }) => {\n        #[allow(missing_docs)]\n        #[cfg_attr(feature = \"servo\", derive(Deserialize, Serialize))]\n        #[derive(Clone, Copy, Debug, Eq, Hash, MallocSizeOf, PartialEq, ToShmem)]\n        pub enum $name {\n            $($variant),+\n        }\n\n        impl $name {\n            /// comment\n            pub fn parse<'i, 't>(input: &mut ::cssparser::Parser<'i, 't>) -> Result<$name, $crate::ParseError<'i>> {\n                use cssparser::Token;\n                let location = input.current_source_location();\n                match *input.next()? {\n                    Token::Ident(ref ident) => {\n                        Self::from_ident(ident).map_err(|()| {\n                            location.new_unexpected_token_error(\n                                Token::Ident(ident.clone()),\n                            )\n                        })\n                    }\n                    ref token => {\n                        Err(location.new_unexpected_token_error(token.clone()))\n                    }\n                }\n            }\n\n            /// comment\n            pub fn from_ident(ident: &str) -> Result<$name, ()> {\n                match_ignore_ascii_case! { ident,\n                    $($css => Ok($name::$variant),)+\n                    _ => Err(())\n                }\n            }\n        }\n\n        impl $crate::ToCss for $name {\n            fn to_css<W>(\n                &self,\n                dest: &mut $crate::CssWriter<W>,\n            ) -> ::std::fmt::Result\n            where\n                W: ::std::fmt::Write,\n            {\n                match *self {\n                    $( $name::$variant => ::std::fmt::Write::write_str(dest, $css) ),+\n                }\n            }\n        }\n  };\n  ($($ty:ty),*) => {\n        $(\n            impl $crate::ToShmem for $ty {\n                fn to_shmem( &self, _builder: &mut $crate::SharedMemoryBuilder, ) -> $crate::Result<Self> {\n                    $crate::Result::Ok(::std::mem::ManuallyDrop::new(*self))\n                }\n            }\n        )*\n  };\n  ($($fun:ident = $flag:ident;)*) => ();\n  ($($name:expr,)+) => {\n        {\n            $(\n                atom_type.atom($name);\n            )+\n        }\n  };\n  (\n    $name:ident {\n      $($variant:ident($kind:ident { $($param:ident = gl::$value:ident,)+ }),)+\n    }\n  ) => {\n        #[derive(Clone, Copy, Debug, Deserialize, Serialize)]\n        pub enum $name { $(\n            $variant($kind),\n        )+}\n\n        $(\n            #[derive(Clone, Copy, Debug, Deserialize, Serialize)]\n            #[repr(u32)]\n            pub enum $kind { $(\n                $param = gl::$value,\n            )+}\n        )+\n\n        impl $name {\n            pub fn from_u32(value: u32) -> WebGLResult<Self> {\n                match value {\n                    $($(gl::$value => Ok($name::$variant($kind::$param)),)+)+\n                    _ => Err(WebGLError::InvalidEnum)\n                }\n            }\n        }\n  };\n  (\n    $(\n      pub enum $name:ident { $($variant:ident = $mod:ident::$constant:ident,)+ }\n    )*\n  ) => {\n        $(\n            #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, MallocSizeOf)]\n            #[derive(PartialEq, Serialize)]\n            #[repr(u32)]\n            pub enum $name { $($variant = $mod::$constant,)+ }\n\n            impl $name {\n                pub fn from_gl_constant(constant: u32) -> Option<Self> {\n                    Some(match constant {\n                        $($mod::$constant => $name::$variant, )+\n                        _ => return None,\n                    })\n                }\n\n                #[inline]\n                pub fn as_gl_constant(&self) -> u32 {\n                    *self as u32\n                }\n            }\n        )*\n  };\n  ($({ $name:ident, $boxed:expr })+) => {\n        /// comment\n        /// comment\n        /// comment\n        pub mod computed_values {\n            $(pub use crate::properties::longhands::$name::computed_value as $name;)+\n            // comment\n            pub use crate::properties::longhands::border_top_style::computed_value as border_style;\n        }\n  };\n  ($($fun:ident = $flag:path;)*) => (\n        impl ThreadState {\n            /// comment\n            pub fn is_worker(self) -> bool {\n                self.contains(ThreadState::IN_WORKER)\n            }\n    \n            $(\n                #[allow(missing_docs)]\n                pub fn $fun(self) -> bool {\n                    self.contains($flag)\n                }\n            )*\n        }\n  );\n  ([$(($css:expr, $name:ident, $state:tt, $flags:tt),)*]) => {\n        /// comment\n        #[derive(Clone, Debug, Eq, MallocSizeOf, PartialEq, ToShmem)]\n        pub enum NonTSPseudoClass {\n            $(\n                #[doc = $css]\n                $name,\n            )*\n        }\n  };\n  ($($name:ident: $value:expr),+) => {\n        expanded!( $( $name: $value, )+ )\n  };\n  ($($name:ident: $value:expr,)+) => {\n        Longhands { $( $name: MaybeBoxed::maybe_boxed($value), )+ }\n  };\n  ($($variant_name:expr => $variant:ident($data:ident),)+) => {\n        declare_viewport_descriptor_inner!([] [ $( $variant_name => $variant($data), )+ ] 0);\n  };\n  (\n    [\n      $(\n        $assigned_variant_name:expr => $assigned_variant:ident($assigned_data:ident) = $assigned_discriminant:expr,\n      )*\n    ]\n    [\n      $next_variant_name:expr => $next_variant:ident($next_data:ident),\n      $($variant_name:expr => $variant:ident($data:ident),)*\n    ]\n    $next_discriminant:expr\n  ) => {\n        declare_viewport_descriptor_inner! {\n            [\n                $( $assigned_variant_name => $assigned_variant($assigned_data) = $assigned_discriminant, )*\n                $next_variant_name => $next_variant($next_data) = $next_discriminant,\n            ]\n            [ $( $variant_name => $variant($data), )* ]\n            $next_discriminant + 1\n        }\n  };\n  ($($name:expr,)+) => {\n        f(&[\"symbols\", $($name,)+])\n  };\n  (\n    $parser:ident,\n    $abs:ident,\n    $enum:ident,\n    [$para:ident => $func:ident $(, $other_para:ident => $other_func:ident)*]\n  ) => {\n        {\n            loop {\n                let $para = $func(&mut $parser.chars)?;\n                $(\n                    skip_comma_wsp(&mut $parser.chars);\n                    let $other_para = $other_func(&mut $parser.chars)?;\n                )*\n                $parser.path.push(PathCommand::$enum { $para $(, $other_para)*, $abs });\n\n                // comment\n                if !skip_wsp(&mut $parser.chars) ||\n                   $parser.chars.peek().map_or(true, |c| c.is_ascii_alphabetic()) {\n                    break;\n                }\n                skip_comma_wsp(&mut $parser.chars);\n            }\n            Ok(())\n        }\n  };\n  ($({ $name:ident, $boxed:expr })+) => {\n        $(\n            let size = size_of::<style::properties::longhands::$name::SpecifiedValue>();\n            let is_boxed = $boxed;\n            if (!is_boxed && size > threshold) || (is_boxed && size <= threshold) {\n                bad_properties.push((stringify!($name), size, is_boxed));\n            }\n        )+\n  };\n\n  (\n    $vis:vis const $name:ident: $ty:ty = $e:expr;\n  ) => { $vis const $name: $ty = $e; };\n  ($vis:vis enum $name:ident {}) => { $vis struct $name {} };\n  (\n    $vis:vis extern \"C\" fn $name:ident()\n    {}\n  ) => { $vis extern \"C\" fn $name() {} };\n  ($vis:vis fn $name:ident() {}) => { $vis fn $name() {} };\n  ($vis:vis mod $name:ident {}) => { $vis mod $name {} };\n  (\n    $vis:vis static $name:ident: $ty:ty = $e:expr;\n  ) => { $vis static $name: $ty = $e; };\n  ($vis:vis struct $name:ident;) => { $vis struct $name; };\n  ($vis:vis trait $name:ident {}) => { $vis trait $name {} };\n  ($vis:vis type $name:ident = $ty:ty;) => { $vis type $name = $ty; };\n  (\n    $vis:vis use $path:ident as $name:ident;\n  ) => { $vis use self::$path as $name; };\n\n  (\n    $(#[$($attrs:tt)*])*\n    $vis:vis struct $name:ident { $($body:tt)* }\n  ) => {\n        c! { @parse_fields $(#[$($attrs)*])*, $vis, $name, $($body)* }\n  };\n\n  (\n    $(#[$($attrs:tt)*])*\n    $vis:vis struct $name:ident($($body:tt)*);\n  ) => {\n        c! { @parse_tuple $(#[$($attrs)*])*, $vis, $name, $($body)* }\n  };\n\n  (\n    @parse_fields $(#[$attrs:meta])*,\n    $vis:vis,\n    $name:ident,\n    $($fvis:vis $fname:ident: $fty:ty),*\n    $(,)*\n  ) => {\n        $(#[$attrs])* $vis struct $name { $($fvis $fname: $fty,)* }\n  };\n\n  (\n    @parse_tuple $(#[$attrs:meta])*,\n    $vis:vis,\n    $name:ident,\n    $($fvis:vis $fty:ty),*\n    $(,)*\n  ) => {\n        $(#[$attrs])* $vis struct $name ( $($fvis $fty,)* );\n  };\n  (\n    $(\n      $(#[$attr:meta])*\n      struct $Name:ident impl $(< $($lifetime:lifetime),+ >)? Fn = | $(\n        $arg:ident: $ArgTy:ty\n      ),*\n      | -> $ReturnTy:ty $body:block;\n    )+\n  ) => {\n        $(\n            $( #[$attr] )*\n            struct $Name;\n\n            impl $( <$( $lifetime ),+> )? Fn<($( $ArgTy, )*)> for $Name {\n                #[inline]\n                extern \"rust-call\" fn call(&self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {\n                    $body\n                }\n            }\n\n            impl $( <$( $lifetime ),+> )? FnMut<($( $ArgTy, )*)> for $Name {\n                #[inline]\n                extern \"rust-call\" fn call_mut(\n                    &mut self,\n                    ($( $arg, )*): ($( $ArgTy, )*)\n                ) -> $ReturnTy {\n                    Fn::call(&*self, ($( $arg, )*))\n                }\n            }\n\n            impl $( <$( $lifetime ),+> )? FnOnce<($( $ArgTy, )*)> for $Name {\n                type Output = $ReturnTy;\n\n                #[inline]\n                extern \"rust-call\" fn call_once(self, ($( $arg, )*): ($( $ArgTy, )*)) -> $ReturnTy {\n                    Fn::call(&self, ($( $arg, )*))\n                }\n            }\n        )+\n  };\n  (\n    $(\n      if #[cfg($i_meta:meta)]\n      { $($i_tokens:tt)* }\n    )else+\n    else { $($e_tokens:tt)* }\n  ) => {\n        cfg_if! {\n            @__items () ;\n            $(\n                (( $i_meta ) ( $( $i_tokens )* )) ,\n            )+\n            (() ( $( $e_tokens )* )) ,\n        }\n  };\n  (@__items($($_:meta,)*);) => {};\n  (\n    @__items($($no:meta,)*);\n    (\n      ($($yes:meta)?)\n      ($($tokens:tt)*)\n    ),\n    $($rest:tt,)*\n  ) => {\n        #[cfg(all(\n            $( $yes , )?\n            not(any( $( $no ),* ))\n        ))]\n        cfg_if! { @__identity $( $tokens )* }\n        cfg_if! {\n            @__items ( $( $no , )* $( $yes , )? ) ;\n            $( $rest , )*\n        }\n  };\n  (\n    @__identity\n    $($tokens:tt)*\n  ) => {\n        $( $tokens )*\n  };\n  (impl $imp:ident, $method:ident for $t:ty, $u:ty) => {\n        forward_ref_op_assign!(impl $imp, $method for $t, $u,\n                #[stable(feature = \"op_assign_builtins_by_ref\", since = \"1.22.0\")]);\n  };\n  (\n    impl const $imp:ident,\n    $method:ident for $t:ty,\n    $u:ty\n  ) => {\n        forward_ref_op_assign!(impl const $imp, $method for $t, $u,\n                #[stable(feature = \"op_assign_builtins_by_ref\", since = \"1.22.0\")]);\n  };\n  // comment\n  (\n    impl const $imp:ident,\n    $method:ident for $t:ty,\n    $u:ty,\n    #[$attr:meta]\n  ) => {\n        #[$attr]\n        #[rustc_const_unstable(feature = \"const_ops\", issue = \"90080\")]\n        impl const $imp<&$u> for $t {\n            #[inline]\n            fn $method(&mut self, other: &$u) {\n                $imp::$method(self, *other);\n            }\n        }\n  };\n  (impl $imp:ident, $method:ident for $t:ty, $u:ty, #[$attr:meta]) => {\n        #[$attr]\n        impl $imp<&$u> for $t {\n            #[inline]\n            fn $method(&mut self, other: &$u) {\n                $imp::$method(self, *other);\n            }\n        }\n  };\n  (@impl $($T:ident)+) => {\n        maybe_tuple_doc! {\n            $($T)+ @\n            #[stable(feature = \"rust1\", since = \"1.0.0\")]\n            impl<$($T:PartialEq),+> PartialEq for ($($T,)+)\n            where\n                last_type!($($T,)+): ?Sized\n            {\n                #[inline]\n                fn eq(&self, other: &($($T,)+)) -> bool {\n                    $( ${ignore(T)} self.${index()} == other.${index()} )&&+\n                }\n                #[inline]\n                fn ne(&self, other: &($($T,)+)) -> bool {\n                    $( ${ignore(T)} self.${index()} != other.${index()} )||+\n                }\n            }\n        }\n\n        maybe_tuple_doc! {\n            $($T)+ @\n            #[stable(feature = \"rust1\", since = \"1.0.0\")]\n            impl<$($T:Eq),+> Eq for ($($T,)+)\n            where\n                last_type!($($T,)+): ?Sized\n            {}\n        }\n\n        maybe_tuple_doc! {\n            $($T)+ @\n            #[stable(feature = \"rust1\", since = \"1.0.0\")]\n            impl<$($T:PartialOrd + PartialEq),+> PartialOrd for ($($T,)+)\n            where\n                last_type!($($T,)+): ?Sized\n            {\n                #[inline]\n                fn partial_cmp(&self, other: &($($T,)+)) -> Option<Ordering> {\n                    lexical_partial_cmp!($( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n                #[inline]\n                fn lt(&self, other: &($($T,)+)) -> bool {\n                    lexical_ord!(lt, $( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n                #[inline]\n                fn le(&self, other: &($($T,)+)) -> bool {\n                    lexical_ord!(le, $( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n                #[inline]\n                fn ge(&self, other: &($($T,)+)) -> bool {\n                    lexical_ord!(ge, $( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n                #[inline]\n                fn gt(&self, other: &($($T,)+)) -> bool {\n                    lexical_ord!(gt, $( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n            }\n        }\n\n        maybe_tuple_doc! {\n            $($T)+ @\n            #[stable(feature = \"rust1\", since = \"1.0.0\")]\n            impl<$($T:Ord),+> Ord for ($($T,)+)\n            where\n                last_type!($($T,)+): ?Sized\n            {\n                #[inline]\n                fn cmp(&self, other: &($($T,)+)) -> Ordering {\n                    lexical_cmp!($( ${ignore(T)} self.${index()}, other.${index()} ),+)\n                }\n            }\n        }\n\n        maybe_tuple_doc! {\n            $($T)+ @\n            #[stable(feature = \"rust1\", since = \"1.0.0\")]\n            impl<$($T:Default),+> Default for ($($T,)+) {\n                #[inline]\n                fn default() -> ($($T,)+) {\n                    ($({ let x: $T = Default::default(); x},)+)\n                }\n            }\n        }\n  };\n  ($left:expr, $right:expr $(,)?) => {\n        match (&$left, &$right) {\n            (left_val, right_val) => {\n                if !(*left_val == *right_val) {\n                    let kind = $crate::panicking::AssertKind::Eq;\n                    // comment\n                    // comment\n                    // comment\n                    $crate::panicking::assert_failed(kind, &*left_val, &*right_val, $crate::option::Option::None);\n                }\n            }\n        }\n  };\n  (\n    $left:expr,\n    $right:expr,\n    $($arg:tt)+\n  ) => {\n        match (&$left, &$right) {\n            (left_val, right_val) => {\n                if !(*left_val == *right_val) {\n                    let kind = $crate::panicking::AssertKind::Eq;\n                    // comment\n                    // comment\n                    // comment\n                    $crate::panicking::assert_failed(kind, &*left_val, &*right_val, $crate::option::Option::Some($crate::format_args!($($arg)+)));\n                }\n            }\n        }\n  };\n  ($left:expr, $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?) => {\n        match $left {\n            $( $pattern )|+ $( if $guard )? => {}\n            ref left_val => {\n                $crate::panicking::assert_matches_failed(\n                    left_val,\n                    $crate::stringify!($($pattern)|+ $(if $guard)?),\n                    $crate::option::Option::None\n                );\n            }\n        }\n  };\n  (\n    $left:expr,\n    $(|)? $($pattern:pat_param)|+ $(if $guard:expr)?,\n    $($arg:tt)+\n  ) => {\n        match $left {\n            $( $pattern )|+ $( if $guard )? => {}\n            ref left_val => {\n                $crate::panicking::assert_matches_failed(\n                    left_val,\n                    $crate::stringify!($($pattern)|+ $(if $guard)?),\n                    $crate::option::Option::Some($crate::format_args!($($arg)+))\n                );\n            }\n        }\n  };\n  (\n    $expression:expr,\n    $(|)? $($pattern:pat_param)|+ $(if $guard:expr)? $(,)?\n  ) => {\n        match $expression {\n            $( $pattern )|+ $( if $guard )? => true,\n            _ => false\n        }\n  };\n  (\n    enum $name:ident < $($T:ident),+\n    > { $($variant:ident $(($field:ident))?),* $(,)? }\n  ) => {\n        impl<$($T: Mark),+> Mark for $name <$($T),+> {\n            type Unmarked = $name <$($T::Unmarked),+>;\n            fn mark(unmarked: Self::Unmarked) -> Self {\n                match unmarked {\n                    $($name::$variant $(($field))? => {\n                        $name::$variant $((Mark::mark($field)))?\n                    })*\n                }\n            }\n        }\n\n        impl<$($T: Unmark),+> Unmark for $name <$($T),+> {\n            type Unmarked = $name <$($T::Unmarked),+>;\n            fn unmark(self) -> Self::Unmarked {\n                match self {\n                    $($name::$variant $(($field))? => {\n                        $name::$variant $((Unmark::unmark($field)))?\n                    })*\n                }\n            }\n        }\n  };\n  (struct $name:ident $(< $($T:ident),+ >)? { $($field:ident),* $(,)? }) => {\n        impl<S, $($($T: Encode<S>),+)?> Encode<S> for $name $(<$($T),+>)? {\n            fn encode(self, w: &mut Writer, s: &mut S) {\n                $(self.$field.encode(w, s);)*\n            }\n        }\n\n        impl<'a, S, $($($T: for<'s> DecodeMut<'a, 's, S>),+)?> DecodeMut<'a, '_, S>\n            for $name $(<$($T),+>)?\n        {\n            fn decode(r: &mut Reader<'a>, s: &mut S) -> Self {\n                $name {\n                    $($field: DecodeMut::decode(r, s)),*\n                }\n            }\n        }\n  };\n  (\n    enum $name:ident $(< $($T:ident),+ >)? {\n      $($variant:ident $(($field:ident))*),* $(,)?\n    }\n  ) => {\n        impl<S, $($($T: Encode<S>),+)?> Encode<S> for $name $(<$($T),+>)? {\n            fn encode(self, w: &mut Writer, s: &mut S) {\n                // comment\n                // comment\n                #[allow(non_upper_case_globals)]\n                mod tag {\n                    #[repr(u8)] enum Tag { $($variant),* }\n\n                    $(pub const $variant: u8 = Tag::$variant as u8;)*\n                }\n\n                match self {\n                    $($name::$variant $(($field))* => {\n                        tag::$variant.encode(w, s);\n                        $($field.encode(w, s);)*\n                    })*\n                }\n            }\n        }\n\n        impl<'a, S, $($($T: for<'s> DecodeMut<'a, 's, S>),+)?> DecodeMut<'a, '_, S>\n            for $name $(<$($T),+>)?\n        {\n            fn decode(r: &mut Reader<'a>, s: &mut S) -> Self {\n                // comment\n                // comment\n                #[allow(non_upper_case_globals)]\n                mod tag {\n                    #[repr(u8)] enum Tag { $($variant),* }\n\n                    $(pub const $variant: u8 = Tag::$variant as u8;)*\n                }\n\n                match u8::decode(r, s) {\n                    $(tag::$variant => {\n                        $(let $field = DecodeMut::decode(r, s);)*\n                        $name::$variant $(($field))*\n                    })*\n                    _ => unreachable!(),\n                }\n            }\n        }\n  };\n  (\n    $(\n      fn $name:ident $(< $($param:ident),* >)? for $(extern $abi:tt)? fn(\n        $($arg:ident: $arg_ty:ty),*\n      ) -> $ret_ty:ty;\n    )+\n  ) => {\n        $(pub const fn $name<\n            $($($param,)*)?\n            F: Fn($($arg_ty),*) -> $ret_ty + Copy\n        >(f: F) -> $(extern $abi)? fn($($arg_ty),*) -> $ret_ty {\n            // comment\n            // comment\n            assert!(mem::size_of::<F>() == 0, \"selfless_reify: closure must be zero-sized\");\n\n            $(extern $abi)? fn wrapper<\n                $($($param,)*)?\n                F: Fn($($arg_ty),*) -> $ret_ty + Copy\n            >($($arg: $arg_ty),*) -> $ret_ty {\n                let f = unsafe {\n                    // comment\n                    // comment\n                    mem::MaybeUninit::<F>::uninit().assume_init()\n                };\n                f($($arg),*)\n            }\n            let _f_proof = f;\n            wrapper::<\n                $($($param,)*)?\n                F\n            >\n        })+\n  };\n  (\n    fn drop(&mut self, $arg:ident: $arg_ty:ty)\n  ) => (fn drop(&mut self, $arg: $arg_ty) { mem::drop($arg) });\n\n  (\n    fn clone(&mut self, $arg:ident: $arg_ty:ty) -> $ret_ty:ty\n  ) => (fn clone(&mut self, $arg: $arg_ty) -> $ret_ty { $arg.clone() });\n\n  ($e:expr) => {\n    {\n        loop {\n            match $e {\n                Err(ref e) if e.kind() == io::ErrorKind::Interrupted => {}\n                res => break res,\n            }\n        }\n    }\n  };\n  ($($x:ident),*) => {\n    $(\n        // comment\n    )*\n  };\n}\n\nmacro path_local($x:ident) {\n    generic::ty::Path::new_local(sym::$x)\n}\n\nmacro pathvec_std($($rest:ident)::+) {\n    {\n    vec![ $( sym::$rest ),+ ]\n    }\n}\n\nmacro path_std($($x:tt)*) {\n    generic::ty::Path::new( pathvec_std!( $($x)* ) )\n}\nmacro takes_u32_returns_u32($ident:ident) {\n    fn $ident(arg: u32) -> u32;\n}\nmacro simple_nonterminal($nt_ident:ident, $nt_lifetime:lifetime, $nt_tt:tt) {\n    macro n(a $nt_ident b $nt_lifetime c $nt_tt d) {\n        struct S;\n    }\n\n    n!(a $nt_ident b $nt_lifetime c $nt_tt d);\n}\nmacro complex_nonterminal($nt_item:item) {\n    macro n(a $nt_item b) {\n        struct S;\n    }\n\n    n!(a $nt_item b); // comment\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/macro/macro.transform.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/ast-program-locs-attr-dangling.f.rs",
    "content": "#!shebang\n// comment\nstruct T;#[attr]\n// comment\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/ast-program-locs-attr-dangling.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/ast-program-locs-attr.f.rs",
    "content": "#!shebang\n// comment\n#[attr]\nstruct T;\n// comment\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/ast-program-locs-attr.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/ast-program-locs.f.rs",
    "content": "#!shebang\n// comment\nstruct T;\n// comment\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/ast-program-locs.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-attr-dangling-x.f.rs",
    "content": "#[attr]\n#[attr]\n#[attr]\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-attr-dangling-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-attr-dangling.f.rs",
    "content": "#[attr]\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-attr-dangling.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-attr-x.f.rs",
    "content": "#![attr]\n\n#![attr]\n\n#![attr]\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-attr-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-attr.f.rs",
    "content": "#![attr]\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-attr.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-comment-block-x.f.rs",
    "content": "/* */\n\n/* */\n\n/* */\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-comment-block-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-comment-block.f.rs",
    "content": "/* */\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-comment-block.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-comment-x.f.rs",
    "content": "//\n\n//\n\n//\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-comment-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-comment.f.rs",
    "content": "//\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-comment.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-doc-block-x.f.rs",
    "content": "/** */\n\n/** */\n\n/** */\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-doc-block-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-doc-block.f.rs",
    "content": "/** */\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-doc-block.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-doc-x.f.rs",
    "content": "///\n\n///\n\n///\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-doc-x.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty-doc.f.rs",
    "content": "///\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty-doc.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/empty.f.rs",
    "content": "\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/empty.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/shebang-b.f.rs",
    "content": "#!/usr/bin/env bash\n#![forbid(unsafe_code)] /* This line is ignored by bash\n# This block is ignored by rustc\n#*/\n\n//!\n\nuse std;\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/shebang-b.rs\""
  },
  {
    "path": "tests/output-ext/miscellaneous/shebang.f.rs",
    "content": "#!/usr/bin/env rustx\n\n// source: \"../../../ext/jinx-rust/tests/samples/miscellaneous/shebang.rs\""
  },
  {
    "path": "tests/output-ext/patterns/pattern.f.rs",
    "content": "fn a() {\n  fn eq(&&other: S) {\n    false\n  }\n  let -2147483648..=2147483647 = 1;\n  let 0..=255 = 0u8;\n  let -128..=127 = 0i8;\n  let '\\u{0000}'..='\\u{10FFFF}' = 'v';\n  let f = |3: isize| println!(\"hello\");\n\n  match *self {\n    Foo::<T>(ref x, ref y) => x,\n  }\n\n  let A { foo } = mka();\n  let A { foo } = mka();\n\n  let B { a, b, c } = mkb();\n\n  match mka() {\n    A { foo: _foo } => {}\n  }\n\n  match Some(mka()) {\n    S { .. } => (),\n    Some(A { foo: _foo }) => {}\n    None => {}\n    _ => (),\n  }\n  match (x, y) {\n    (1, 1) => 1,\n    (2, 2) => 2,\n    (1..=2, 2) => 3,\n    _ => 4,\n  }\n\n  if let Some([b'@', filename @ ..]) = Some(b\"@abc123\") {\n    println!(\"filename {:?}\", filename);\n  }\n\n  fn f(X(_): A) {}\n\n  let Ok(0): Option<u8> = 42u8;\n  let Ok(0): Option<u8>;\n  let Ok(0) = 42u8;\n\n  match t {\n    Bar::T1(_, Some(x)) => {\n      return x * 3;\n    }\n    _ => {\n      panic!();\n    }\n  }\n\n  match t {\n    Bar::T1(_, Some::<isize>(x)) => {\n      println!(\"{}\", x);\n    }\n    _ => {\n      panic!();\n    }\n  }\n\n  match unimplemented!() {\n    &&&42 => {}\n    FOO => {}\n    _ => {}\n  }\n  fn f4(ref a @ box ref b: Box<NC>) {}\n  fn f1(a @ ref b: U) {}\n  fn _f(_a @ _b: u8) {}\n  let s: &[bool] = &[true];\n  let s0: &[bool; 0] = &[];\n  let s1: &[bool; 1] = &[false; 1];\n  let s2: &[bool; 2] = &[false; 2];\n  let [] = s0;\n  let [_] = s1;\n  let [_, _] = s2;\n  while let 0..=2 | 1 = 0 {}\n  if let 0..=2 | 1 = 0 {\n  }\n  match 0u8 {\n    0 | 0 => {}\n  }\n  if let 0 | 0 = 0 {\n  } else {\n    return;\n  }\n  let mut arr = [U, U, U, U, U, U, U, U];\n  let mut tup = (U, U, U, U, U);\n  let (Ok((V1(a) | V2(a) | V3(a), b)) | Err(Ok((a, b)) | Err((a, b)))): Result<\n    _,\n    Result<_, _>\n  > = Ok((V1(1), 1));\n  let (\n    Ok((V1(a) | V2(a) | V3(a), ref b)) | Err(Ok((a, ref b)) | Err((a, ref b)))\n  ): Result<_, Result<_, _>> = Ok((V1(1), 1));\n  let (\n    a,\n    | Err((ref mut b, ref c, d))\n    | Ok(\n        (\n          | Ok(\n              | V1((ref c, d))\n              | V2((d, ref c))\n              | V3((ref c, Ok((_, d)) | Err((d, _)))),\n            )\n          | Err((ref c, d)),\n          ref mut b,\n        ),\n      ),\n  ): (_, Result<_, _>) = (1, Ok((Ok(V3((1, Ok::<_, (i32, i32)>((1, 1))))), 1)));\n  let [ref mut _x0, _, ref _x2, _, _x4, ref mut _x5, _x6, _] = arr;\n  let [_, _, _x2, _, _, _x5, _, _] = arr;\n  *_x0 = U;\n  let a @ (b, c) = (S, S);\n  let mut x @ B { b, .. } = B { a: 10, b: C { c: 20 } };\n  if let Some(x @ B { b: mut b @ C { c }, .. }) = some_b {\n  }\n  match x {\n    Some(ref mut _y @ ..) => {}\n  }\n  let ref a @ box ref b = Box::new(NC);\n  let a @ b @ c @ d = C;\n  let a @ (b, c) = (C, mk_c());\n  let a @ P(b, P(c, d)) = P(mk_c(), P(C, C));\n  let a @ [b, c] = [C, C];\n  let a @ &(b, c) = &(C, C);\n  let a @ &(b, &P(c, d)) = &(mk_c(), &P(C, C));\n  let a @ (mut b @ ref mut c, d @ ref e) = (u(), u());\n  let a @ ref b = U;\n  let ref mut a @ ref mut b = U;\n  let a @ &mut ref mut b = &mut U;\n  let a @ &mut (ref mut b, ref mut c) = &mut (U, U);\n  let a @ NC(b, c) = NC(C, C);\n  let a @ NC(b, c @ NC(d, e)) = NC(C, NC(C, C));\n  let _a @ _b: u8 = 0;\n  let &_ = &1_usize;\n  let &&_ = &&1_usize;\n  let &&&_ = &&&1_usize;\n  let &&&_ = &&&1_usize;\n  let &&&&_ = &&&&1_usize;\n  let &&&&_ = &&&&1_usize;\n  let &&&&&_ = &&&&&1_usize;\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/patterns/pattern.rs\""
  },
  {
    "path": "tests/output-ext/patterns/rest.f.rs",
    "content": "fn b() {\n  // fn foo(..: u8) {}\n  let ..;\n  let box ..;\n  match x {\n    .. | .. => {}\n  }\n  let &..;\n  let &mut ..;\n  let x @ ..;\n  let ref x @ ..;\n  let ref mut x @ ..;\n  let (..);\n  let (..);\n  let (.., .., ..);\n  let (.., P, ..);\n  let A(..);\n  let A(..);\n  let A(.., .., ..);\n  let A(.., P, ..);\n  let [..];\n  let [..];\n  let [.., .., ..];\n  let [.., P, ..];\n  match x {\n    .. | [(box .., &(..), &mut .., x @ ..), ref x @ ..] | ref mut x @ .. if\n      x[..]\n    => {}\n  }\n  a!(..);\n\n  let [..]: &[u8];\n  let [..]: &[u8];\n  let (..): (u8,);\n  let (..): (u8,);\n\n  let (1, (Some(1), 2..=3)) = (1, (None, 2));\n  fn func((1, (Some(1), 2..=3)): (isize, (Option<isize>, isize))) {}\n  fn fun([a, ref mut b, ref xs @ .., ref c, d]: [X; 6]) {}\n  fn foo(a @ [b, mid @ .., c]: [C; 3]) {}\n\n  let [..] = s;\n  let [..] = s0;\n  let [..] = s1;\n  let [..] = s2;\n  let [_, ..] = s1;\n  let [.., _] = s1;\n  let [_, ..] = s2;\n  let [.., _] = s2;\n  let [_, _, ..] = s2;\n  let [_, .., _] = s2;\n  let [.., _, _] = s2;\n  let Box { 0: _, .. }: Box<()>;\n  let Box { 1: _, .. }: Box<()>;\n\n  let [ref _x0, _x1, _, mut _x3, .., ref _x6, _x7] = arr;\n  let [ref _x0, ..] = arr;\n  let [_x0, ..] = arr;\n  let (.., ref mut _x3) = tup;\n  let a @ [b, .., c] = [C, mk_c(), C];\n  let a @ [b, mid @ .., c] = [C, mk_c(), C];\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/patterns/rest.rs\""
  },
  {
    "path": "tests/output-ext/patterns/union.f.rs",
    "content": "fn fw1(H(Ok(mut x) | &Err(mut x)): H<R<'_>>) {}\nfn f1((Ok(mut x) | &Err(mut x)): R<'_>) {}\nfn fw2(H(&(Ok(x) | Err(x))): H<R<'_>>) {}\nfn fw3(H(Ok(x) | Err(x)): H<R<'_>>) {}\nfn f2(&(Ok(x) | Err(x)): R<'_>) {}\nfn f3((Ok(x) | Err(x)): R<'_>) {}\nfn fun((A | B): _) {}\nfn f(x @ (A::R(_) | D::E(_)): Q) {}\n\nfn x() {\n  let (0 | 1 | _) = 0;\n  if let 0 | 1 | 2 = 0 {\n  }\n  if let x @ 0 | x @ (1 | 2) = 0 {\n  }\n  if let H(Ok(mut x) | &Err(mut x)) = a {\n  }\n  if let H(&(Ok(x) | Err(x))) = a {\n  }\n  if let H(Ok(x) | Err(x)) = a {\n  }\n  for H(Ok(mut x) | &Err(mut x)) in std::iter::once(wres) {\n  }\n  for H(&(Ok(x) | Err(x))) in std::iter::once(wres) {\n  }\n  for H(Ok(x) | Err(x)) in std::iter::once(wres) {\n  }\n\n  let H(Ok(mut x) | &Err(mut x)) = wres;\n  let H(Ok(x) | Err(x)) = wres;\n  let H(&(Ok(x) | Err(x))) = wres;\n\n  let (\n    | Tri::A(Ok(mut x) | Err(mut x))\n    | Tri::B(&Ok(mut x) | Err(mut x))\n    | &Tri::C(Ok(mut x) | Err(mut x))\n  ) = tri;\n\n  let (B(A(a, _) | B(a)) | A(a, A(a, _) | B(a))) = B(B(1));\n  let (B(_) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));\n  let (B(A(a, _) | B(a)) | A(A(a, _) | B(a), A(a, _) | B(a))) = B(B(1));\n\n  let (Ok(a) | Err(a)) = Ok(0);\n  let (Ok(ref a) | Err(ref a)) = Ok(0);\n  let (Ok(ref mut a) | Err(ref mut a)) = Ok(0);\n  let (Ok((V1(a) | V2(a) | V3(a), b)) | Err(Ok((a, b)) | Err((a, b)))): Result<\n    _,\n    Result<_, _>\n  > = Ok((V1(1), 1));\n\n  let (\n    Ok((V1(a) | V2(a) | V3(a), ref b)) | Err(Ok((a, ref b)) | Err((a, ref b)))\n  ): Result<_, Result<_, _>> = Ok((V1(1), 1));\n\n  let (\n    a,\n    | Err((ref mut b, ref c, d))\n    | Ok(\n        (\n          | Ok(\n              | V1((ref c, d))\n              | V2((d, ref c))\n              | V3((ref c, Ok((_, d)) | Err((d, _)))),\n            )\n          | Err((ref c, d)),\n          ref mut b,\n        ),\n      ),\n  ): (_, Result<_, _>) = (1, Ok((Ok(V3((1, Ok::<_, (i32, i32)>((1, 1))))), 1)));\n\n  for &(Ok(i) | Err(i)) in &v {\n  }\n  for Ok(i) | Err(i) in v {\n  }\n  if let &(None | Some(6 | 7)) = &opt {\n  }\n  if let Some(x @ (4 | 5 | 6)) = opt {\n  } else {\n  }\n  while let Some(ref mut val @ (3 | 4 | 6)) = opt {}\n\n  let (A | B);\n  let (A | B);\n  let (A | B): u8;\n  let (A | B) = 0;\n  let (A | B): u8 = 0;\n  for A | B in 0 {\n  }\n  for A | B in 0 {\n  }\n  while let A | B = 0 {}\n  while let A | B = 0 {}\n  if let A | B = 0 {\n  }\n  if let A | B = 0 {\n  }\n  if let Ok(mut x) | &Err(mut x) = res {\n  }\n  if let &(Ok(x) | Err(x)) = res {\n  }\n  let (Ok(mut x) | &Err(mut x)) = res;\n  let &(Ok(x) | Err(x)) = res;\n  let (Ok(x) | Err(x)) = res;\n  for Ok(mut x) | &Err(mut x) in std::iter::once(res) {\n  }\n  for &(Ok(x) | Err(x)) in std::iter::once(res) {\n  }\n  for Ok(x) | Err(x) in std::iter::once(res) {\n  }\n  let _ = |(A | B): u8| ();\n  let (A | B);\n  let (A | B,);\n  let _ = |(A | B): u8| ();\n  let (A | B);\n  let (A | B,);\n  let A(B | C);\n  let E::V(B | C);\n  let S { f1: B | C, f2 };\n  let E::V { f1: B | C, f2 };\n  let [A | B, .. | ..];\n  let (box 0 | 1);\n  let (&0 | 1);\n  let (&mut 0 | 1);\n  let (x @ 0 | 1);\n  let (ref x @ 0 | 1);\n  let (ref mut x @ 0 | 1);\n\n  let (a, A(a, _) | B(a)) = (0, A(1, 2));\n  let (A(a, _) | B(a), a) = (A(0, 1), 2);\n  let (A(a, a) | B(a)) = A(0, 1);\n  let (B(a) | A(a, a)) = A(0, 1);\n  match A(0, 1) {\n    A | B => 0,\n    A | B => 0,\n    B(a) | A(a, a) => 0,\n    Ok(x @ 4) | Err(x @ (6 | 8)) => 0,\n    Ok(x @ 1 | x @ 2) => 0,\n    Err(x @ (0..=10 | 30..=40)) if x % 2 == 0 => 0,\n    Err(x @ 0..=40) => 0,\n    Some(box Test::Foo | box Test::Bar) => 0,\n    &((true, y) | (y, true), z @ (0 | 4)) => (y as u8) + z,\n    Foo::One(0) | Foo::One(1) | Foo::One(2) => 0,\n    Foo::One(42 | 255) => 0,\n    Foo::Two(42 | 255, 1024 | 2048) => 0,\n    Foo::One(100 | 110..=120 | 210..=220) => 0,\n    Foo::Two(0..=10 | 100..=110, 0 | _) => 0,\n    ([] | [0 | 1..=255] | [_, ..],) => 0,\n    ((0, 0) | (0, 1),) => 0,\n    (a, _) | (_, a) if a > 10 => 0,\n    Some((a, _)) | Some((_, a)) if a > 10 => 0,\n    Some((a, _) | (_, a)) if a > 10 => 0,\n    e @ &1..=2 | e @ &3..=4 => 0,\n    Ok(mut x) | &Err(mut x) => 0,\n    | Tri::A(Ok(mut x) | Err(mut x))\n    | Tri::B(&Ok(mut x) | Err(mut x))\n    | &Tri::C(Ok(mut x) | Err(mut x)) => 0,\n    A | B => 0,\n    A | B => 0,\n    [.., Some(Test::Qux | Test::Foo)] => 0,\n    [Some(Test::Foo), .., Some(Test::Baz | Test::Bar)] => 0,\n    [.., Some(Test::Bar | Test::Baz), _] => 0,\n    Some(\n      | Test::Foo { first: 1024 | 2048, second: 2048 | 4096 }\n      | Test::Bar { other: Some(Other::One | Other::Two) },\n    ) => 0,\n    (\n      (a, _) | (_, a),\n      (b @ _, _) | (_, b @ _),\n      (c @ false, _) | (_, c @ true),\n    ) if\n      {\n        guard_count += 1;\n        (a, b, c) == target\n      }\n    => 0,\n    | ((a, _), (b @ _, _), (c @ false, _))\n    | ((a, _), (b @ _, _), (_, c @ true))\n    | ((a, _), (_, b @ _), (c @ false, _))\n    | ((a, _), (_, b @ _), (_, c @ true))\n    | ((_, a), (b @ _, _), (c @ false, _))\n    | ((_, a), (b @ _, _), (_, c @ true))\n    | ((_, a), (_, b @ _), (c @ false, _))\n    | ((_, a), (_, b @ _), (_, c @ true)) if\n      {\n        guard_count += 1;\n        (a, b, c) == target\n      }\n    => 0,\n  }\n}\n\naccept_pat!(p | q);\naccept_pat!((p | q,));\naccept_pat!(TS(p | q));\naccept_pat!(NS { f: p | q });\naccept_pat!([p | q]);\n\n// source: \"../../../ext/jinx-rust/tests/samples/patterns/union.rs\""
  },
  {
    "path": "tests/output-ext/specifiers/extern.f.rs",
    "content": "type funky_func = extern \"C\" fn(\n  unsafe extern \"rust-call\" fn(\n    *const JSJitInfo,\n    *mut JSContext,\n    HandleObject,\n    *mut libc::c_void,\n    u32,\n    *mut JSVal\n  ) -> u8\n);\nextern \"C\" fn sup() {}\nextern \"C\" {\n  fn some_fn() -> ();\n}\nextern {\n  fn quux() -> (); // Post comment\n  fn syscall(\n    number: libc::c_long /* comment 1 */,\n    /* comm 2 */ ... /* sup? */\n  ) -> libc::c_long;\n  unsafe fn foo() -> *mut Bar;\n  pub(super) const fn foo() -> *mut Bar;\n  pub(crate) unsafe fn foo() -> *mut Bar;\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/specifiers/extern.rs\""
  },
  {
    "path": "tests/output-ext/specifiers/pub.f.rs",
    "content": "enum E {\n  pub U,\n  pub(crate) T(u8),\n  pub(super) T {\n    f: String,\n  },\n}\npub impl Tr for S {\n  pub fn f() {}\n  pub const C: u8 = 0;\n  pub type T = u8;\n  pub(in foo) fn f(&self) -> i32 {\n    0\n  }\n}\npub struct Pub(Priv2);\nmod bar {\n  pub use *;\n}\npub trait Sized {}\nconst MAIN: u8 = {\n  pub trait Tr {\n    fn f();\n    const C: u8;\n    type T;\n  }\n  pub struct S {\n    pub a: u8,\n  }\n  struct Ts(pub u8);\n  pub impl Tr for S {\n    pub fn f() {}\n    pub const C: u8 = 0;\n    pub type T = u8;\n  }\n  pub impl S {\n    pub fn f() {}\n    pub const C: u8 = 0;\n    // pub type T = u8;\n  }\n  pub extern \"C\" {\n    pub fn f();\n    pub static St: u8;\n  }\n  ()\n};\npub(super) fn f(_: Priv) {}\npub(crate) fn g(_: Priv) {}\ncrate fn h(_: Priv) {}\npub(crate) struct S1;\npub(super) struct S2;\npub(self) struct S3;\npub(in ::core) struct S4;\npub(in a::b) struct S5;\npub type A;\npub static b: Q;\npub extern crate core;\nstruct Bar(pub ());\npub struct C(pub isize, isize);\npub struct D(pub isize);\npub struct bool;\npub struct Pub<T = Alias>(pub T);\npub type A;\npub mod bar {\n  pub use a::b::c;\n  pub mod b {}\n  pub struct S {\n    pub(in foo) x: i32,\n  }\n}\npub macro m() {}\npub(in Self::f) struct Z;\npub extern crate self as name;\npub use name::name as bug;\n\n// source: \"../../../ext/jinx-rust/tests/samples/specifiers/pub.rs\""
  },
  {
    "path": "tests/output-ext/statements/const.f.rs",
    "content": "const X: u8;\nconst B;\nconst A: u8;\npub const A: Self::AssocTy = 1;\nconst FOO: dyn Fn() -> _ = \"\";\npub const FOO: &'static *const i32 = &(&0 as _);\nconst TEST: fn() -> _ = 1;\nconst MY_A: A = A {\n  e: |s, a, b| {\n    if s {\n      let _ = ();\n    } else if let Q(s) = b.r(|p| p.d()) {\n      let _ = ();\n    }\n  },\n};\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/const.rs\""
  },
  {
    "path": "tests/output-ext/statements/enum.f.rs",
    "content": "enum E {}\n\nenum E {\n  Foo {\n    limb_with_align16: Align16,\n  },\n  Bar,\n}\nenum E {\n  Foo {\n    foo: u32,\n  },\n  Bar {\n    bar: u32,\n  },\n}\n\nenum A {\n  Ok = u8::MAX - 1,\n  Ok2 = -1,\n  OhNo = u8::MIN,\n  Bi64 = 0x8000_0000,\n  orange = 8 >> 1,\n}\nenum A {\n  union,\n}\nenum B {\n  union {},\n}\nenum C {\n  union(),\n}\n\nenum E {\n  A = {\n    enum F {\n      B,\n    }\n    0\n  },\n}\nenum E<T> {\n  _None,\n  _Some(T),\n}\nenum E<W: ?Sized, X: ?Sized, Y: ?Sized, Z: ?Sized> {\n  EM(W),\n  EM {\n    x: X,\n  },\n  EM(isize, Y),\n  EM {\n    u: isize,\n    x: Z,\n  },\n  EM([u8]),\n  EM {\n    x: str,\n  },\n  EM(isize, [f32]),\n  EM {\n    u: isize,\n    x: [u32],\n  },\n  EM(Path1),\n  EM {\n    x: Path2,\n  },\n  EM(isize, Path3),\n  EM {\n    u: isize,\n    x: Path4,\n  },\n  EM(dyn Foo),\n  EM {\n    x: dyn Bar,\n  },\n  EM(isize, dyn FooBar),\n  EM {\n    u: isize,\n    x: dyn BarFoo,\n  },\n  EM(<&'static [i8] as Deref>::Target),\n  EM {\n    x: <&'static [char] as Deref>::Target,\n  },\n  EM(isize, <&'static [f64] as Deref>::Target),\n  EM {\n    u: isize,\n    x: <&'static [i32] as Deref>::Target,\n  },\n}\nenum E<'a, 'b, 'c: 'b> {\n  A(extern \"Rust\" fn(&'a isize)),\n  B(&'b [isize]),\n  C(&'b mut &'c str),\n}\n\npub enum X<D> where D: Copy + Debug + Eq {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/enum.rs\""
  },
  {
    "path": "tests/output-ext/statements/impl.f.rs",
    "content": "impl X {}\nimpl X {\n  fn f();\n  fn f() {}\n  type Y;\n  type Z: Ord;\n  type W: Ord where Self: Eq;\n  type W where Self: Eq;\n  fn foo() {\n    struct S;\n    impl S {\n      pub const X: u8 = 0;\n      pub const fn bar() {}\n      async fn qux() {}\n    }\n  }\n}\nimpl X for () {}\nimpl X for Y {}\nimpl ! {}\nimpl ! where u8: A {}\nimpl ! where u8: A {}\nimpl !Send for A {}\nimpl <*const u8>::C {}\nimpl <A as B>::C {}\nimpl <dyn 'a + B>::C {}\nimpl <<A>::B>::C {}\nimpl<'a, I, T: 'a, E> Iterator\n  for Y<'a, I, E>\n  where I: Iterator<Item = &'a (T, E)> {}\nimpl<T: Q> S for E<T> {}\nunsafe impl A for isize {}\nunsafe impl Send for A {}\nunsafe impl Sync for A {}\nimpl<'a> A for &'a [isize] {}\nimpl ::A::B for ::C {}\nimpl ::A for () {}\nimpl ::A {}\nimpl A for [B; 1] {}\nimpl A for (<B as C>::D, E) {}\nimpl ::A for [B; 0] {}\nimpl<'a> A for &'a [isize] {}\nimpl<'a> dyn T + 'a {}\nimpl<'a> dyn T + 'a {}\nimpl<'a> dyn ::Foo::Trait + 'a {}\nimpl<T: ?Sized> A for T {}\nimpl<'a, 'b, 'c> S for &'a &'b &'c Q {}\nimpl<A, F: Fn(A)> Foo<A> for F {}\nimpl<T> A for T where for<'a> T: B<'a> {}\nimpl<'a, T, const N: usize> IntoIterator for &'a Table<T, N> {}\nimpl A for (B,) {}\nimpl !A for (B,) {}\nimpl A for Box<C> {}\nimpl A for lib::Something<C> {}\nimpl A for D<C> {}\nimpl<T: ::std::fmt::Display> A<T> {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/impl.rs\""
  },
  {
    "path": "tests/output-ext/statements/self.f.rs",
    "content": "fn f(self) {}\nfn f(&self) {}\nfn f(mut self) {}\nfn f(&mut self) {}\nfn f(&'a self) {}\nfn f(&'a mut self) {}\nfn f(self: u8) {}\nfn f(mut self: u8) {}\ntype X = fn(self);\ntype X = fn(&self);\n// type X = fn(mut self);\ntype X = fn(&mut self);\ntype X = fn(&'a self);\ntype X = fn(&'a mut self);\ntype X = fn(self: u8);\n// type X = fn(mut self: u8);\nasync fn foo<'b>(self: &'b Foo<'a>) -> &() {\n  self.0\n}\nfn f<'b>(self: &'b Foo<'a>) -> &() {\n  self.0\n}\nfn f<'a>(self: &Alias, arg: &'a ()) -> &() {\n  arg\n}\nfn f(&mut self) -> u32;\nfn f(mut self: Box<Self>);\nfn f(self: _) {}\nfn f(self: &_) {}\nfn f(&self) -> Self;\n// fn f(self::S: S) {}\n// fn g(&self::S: &S) {}\n// fn h(&mut self::S: &mut S) {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/self.rs\""
  },
  {
    "path": "tests/output-ext/statements/spread.f.rs",
    "content": "fn main() {}\nfn f1_1(x: isize, ...) {}\nfn f1_2(...) {}\nextern \"C\" fn f2_1(x: isize, ...) {}\nextern \"C\" fn f2_2(...) {}\nextern \"C\" fn f2_3(..., x: isize) {}\nextern fn f3_1(x: isize, ...) {}\nextern fn f3_2(...) {}\nextern fn f3_3(..., x: isize) {}\nextern {\n  fn e_f1(...);\n  fn e_f2(..., x: isize);\n}\nstruct X;\nimpl X {\n  fn i_f1(x: isize, ...) {}\n  fn i_f2(...) {}\n  fn i_f3(..., x: isize, ...) {}\n  fn i_f4(..., x: isize, ...) {}\n}\ntrait T {\n  fn t_f1(x: isize, ...) {}\n  fn t_f2(x: isize, ...);\n  fn t_f3(...) {}\n  fn t_f4(...);\n  fn t_f5(..., x: isize) {}\n  fn t_f6(..., x: isize);\n}\n\nextern \"C\" {\n  pub fn foo(x: i32, ...);\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/spread.rs\""
  },
  {
    "path": "tests/output-ext/statements/statements.f.rs",
    "content": "const _: () = {\n  pub trait A {\n    const _: () = ();\n  }\n  impl A for () {\n    const _: () = ();\n  }\n  impl dyn A {\n    const _: () = ();\n  }\n};\n\nextern r#\"C\"# {\n  fn bar();\n}\nextern r#\"C\"# fn foo() {}\ntype T = extern r#\"C\"# fn();\nextern \"\\x43\" fn foo() {}\nextern \"\\x43\" {\n  fn bar();\n}\ntype T = extern \"\\x43\" fn();\n\n// extern crate async;\n// extern crate async as something_else;\n\nfn f1();\nfn f2() {}\nfn f3();\n\ntrait X {\n  fn f();\n  fn f() {}\n  const Y: u8;\n}\n\nextern \"C\" {\n  fn f();\n  fn f();\n  static X: u8;\n  static mut Y: u8;\n  // type E: where;\n  type A: Ord;\n  type A<'a> where 'a: 'static;\n  type A<T: Ord> where T: 'static;\n  type A = u8;\n  type A<'a: 'static, T: Ord + 'static>\n    : Eq + PartialEq\n    where T: 'static + Copy = Vec<u8>;\n}\nconst async fn test() {}\nasync unsafe fn test() {}\nconst unsafe fn test() {}\nunsafe extern fn test() {}\nfn f() {\n  async fn f();\n  unsafe fn f();\n  const fn f();\n  extern \"C\" fn f();\n  const async unsafe extern \"C\" fn f();\n}\nconst fn f(a: *const i32, b: i32) -> bool {}\nunsafe fn f(&self) -> u32;\nconst unsafe fn f(v: u32) -> u32 {}\nunsafe fn f(func: unsafe fn() -> ()) -> () {}\nstruct Range<\n  const FROM: usize = 0,\n  const LEN: usize = 0,\n  const TO: usize = FROM\n>;\nimpl<T> From<[u8; 1 + 1]> for Foo<T, [u8; 1 + 1]> {}\nfn f(d: [u8; 1 + 1]) -> A<T, [u8; 1 + 1]>\n  where [u8; 1 + 1]: From<[u8; 1 + 1]> {}\nfn f<'a, 'b, 'c, T>(x: foo::X<'a, T, 'b, 'c>) {}\nfn f() -> Option<fn() -> Option<bool>> {\n  Some(|| Some(true))\n}\nfn a() {\n  let a = 0;\n  let _b = 0;\n  let _ = 0;\n  let mut b = 0;\n  let mut _b = 0;\n}\n\nenum Test3 {\n  Var1,\n  Var2(String),\n  StillFine {\n    def: i32,\n  },\n}\nenum E {\n  UnitVariant,\n  TupleVariant(),\n  BracedVariant {},\n  T(T, [!; 0]),\n  #[allow(dead_code)] U(U),\n}\nfn foobar<F, G>() -> usize where (): Foobar<F, G> {}\n\nmod a {\n  extern \"C\" {\n    pub fn free(x: *const u8);\n  }\n}\npub union U {\n  pub a: u8,\n  pub(super) b: u8,\n  c: u8,\n}\n\ntrait C<A> {\n  fn D<B, F>(&self, f: F) where F: FnMut(A) -> Q<B>;\n}\ntrait A<T: B = Self> {}\ntrait A: B::C {}\ntrait A<T>: B::C {}\nfn f() -> () {}\nfn f<T: X<Y<()> = i32>>() {}\nfn f<F>(mut f: F) where F: FnMut(&mut R, bool) {}\nfn f<F>(f: F) where F: for<'a> Fn(&'a isize, &'a isize) -> isize {}\nfn f<F>(f: F) -> isize where F: Fn() -> isize {\n  f()\n}\nasync fn g(((ref a, ref mut b), (ref mut c, ref d)): ((A, A), (A, A))) {}\npub unsafe extern \"C\" fn bar(_: i32, mut ap: ...) -> usize {}\nunsafe fn f(&self, x: &usize) {\n  *self + *x;\n}\nfn f<B: ?Sized + Q>() {}\nfn f<A, F: for<'a> F<(&'a A,)>>(_: F) {}\nfn f<M>(a: M) where M: A, M::B: C {}\nfn f<T, A>(t: fn(&A)) where fn(&A): for<'a> F<(&'a A,)> {}\n#[no_mangle]\npub extern \"C\" fn rust_no_mangle() -> i32 {}\npub fn foo<'a, 'b>(x: Foo<'a, 'b>, _o: Option<&&()>) {\n  let _y = x.foo;\n}\nconst x: &'static dyn Fn() = &(|| e!(\"q\"));\nconst fn foo() -> i32 {}\nextern \"\\x43\" fn foo() {}\n\nextern \"\\x43\" {\n  fn bar();\n}\n\ntype T = extern \"\\x43\" fn();\nextern r#\"C\"# fn foo() {}\n\nextern r#\"C\"# {\n  fn bar();\n}\n\ntype T = extern r#\"C\"# fn();\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/statements.rs\""
  },
  {
    "path": "tests/output-ext/statements/static.f.rs",
    "content": "static A: u8;\nstatic B;\n\nstatic mut C: u8;\nstatic mut D;\nstatic X: u8;\npub static B: &'static a = unsafe { &q };\nstatic A: fn(_) -> u8 = |_| 8;\nstatic BOO: dyn Fn() -> _ = \"\";\nstatic x: _;\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/static.rs\""
  },
  {
    "path": "tests/output-ext/statements/struct.f.rs",
    "content": "struct S<A: ?for<'a> Q, B: 'a + Q, C: 'a, G: Q + 'a, H: Q, I:>;\nstruct Empty1 {}\nstruct Empty2;\nstruct Empty7();\nstruct Align8Many {\n  a: i32,\n  b: i32,\n  c: i32,\n  d: u8,\n}\nstruct A<T>([T]);\nstruct A<T>(T);\nstruct cat {\n  done: extern \"C\" fn(usize),\n  meows: usize,\n}\nstruct Test3<'a, 'b, 'c> {\n  x: extern \"Rust\" fn(&'a isize),\n  y: extern \"Rust\" fn(&'b [isize]),\n  c: extern \"Rust\" fn(&'c str),\n  a: fn(u32) -> u32,\n  b: extern \"C\" fn(u32) -> u32,\n  c: unsafe fn(u32) -> u32,\n  d: unsafe extern \"C\" fn(u32) -> u32,\n}\nstruct Test4<'a, 'b: 'a> {\n  x: &'a mut &'b isize,\n}\nstruct Test6<'a, 'b: 'a> {\n  x: &'a mut extern \"Rust\" fn(&'b isize),\n}\nstruct Foo<'a> {\n  x: Box<dyn (Fn(i32) -> &'a i32) + 'static>,\n}\nstruct X;\nstruct U {}\nstruct P<T>(T);\nstruct A<U> where U: E(U);\nstruct A<U> where U: E(U) -> R;\nstruct A<U>(U) where U: Eq;\nstruct K<'a>(&'a ());\npub struct A([u8; 1]);\npub(crate) struct S<'a, I, E>(I, &'a E);\npub struct A<T: B>(C);\npub struct A<T = u8>(T);\npub struct Table<T, const N: usize>([Option<T>; N]);\nstruct B;\nstruct A<T: ?Sized>(C<T>, ());\nstruct A<T = i32, U = i32>(B<T, U>) where B<T, U>: Marker;\nstruct A<T = u32, U = i32>(T, U) where B<T, U>: Marker;\nstruct A<'a, S: B<'a> = i32>(S, &'a ());\nstruct S1(pub(in foo) (), pub T, pub(crate) (), pub ((), T));\nstruct G<T, U>(*const T, *const U);\npub struct Unique<T: ?Sized> {\n  s: *const T,\n}\nunsafe impl<T: Send + ?Sized> Send for Unique<T> {}\npub struct A(u32, ::b::Q);\nstruct S(<AT as A<DT>>::AS);\npub struct A<I> where I: B<C: D> {\n  w: <I::E as F>::G,\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/struct.rs\""
  },
  {
    "path": "tests/output-ext/statements/trait.f.rs",
    "content": "trait A {}\ntrait A<B: C> {}\ntrait T2<'x, 'y>: T1<'x> {}\ntrait T<E, R> = S<A> where <Self as B<D>>::T: H<R>;\ntrait A<B: C>: B<B::S> + E<()> {}\ntrait A<S: B<C = S>>: D<S> {}\ntrait A = B<C = D>;\ntrait A<T> = B where T: C<D>;\ntrait A: B<B = u32> + C<Self::A> {}\ntrait A = std::fmt::Display + std::fmt::Debug;\ntrait B = std::fmt::Display + std::fmt::Debug;\ntrait A = Default;\ntrait A<T> = B<C = D>;\ntrait A = B<C>;\ntrait A<'a, T: 'a> = B<&'a D>;\ntrait A = 'static;\ntrait A<B, C> = D + E where F<(G, H)>: I;\ntrait A<B, C> = where D<E>: F<G>;\ntrait A<X: T1>: T2 {}\ntrait A<X: ?Sized> {}\ntrait A<X: ?Sized, Y> {}\ntrait A<Y, X: ?Sized> {}\ntrait A<X: ?Sized, Y: ?Sized> {}\ntrait A<X: ?Sized + T2> {}\ntrait A<X: T2 + ?Sized> {}\n\npub trait A {}\npub trait C = A + B;\npub trait A<R: D>: Sized {}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/trait.rs\""
  },
  {
    "path": "tests/output-ext/statements/union.f.rs",
    "content": "union {};\nunion::b {};\nunion union<'union> {\n  union: &'union union<'union>,\n}\nstruct union;\n\nimpl union {\n  pub fn new() -> Self {\n    union {}\n  }\n}\n\nfn main() {\n  let _u = union::new();\n  let mut r#async = 1;\n  union as T;\n}\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/union.rs\""
  },
  {
    "path": "tests/output-ext/statements/use.f.rs",
    "content": "pub use self::bb::{ aa, bb };\npub use self::cc::*;\nuse Self::f;\nuse ::super::{ S, Z };\nuse ::super::main;\nuse a::*;\nuse m::S;\nuse ::{ ::{}, ::{} };\nextern crate x;\nuse std::mem::self;\nuse foo::bar::self as abc;\nextern crate priv_impl_prim_ty as bar;\nextern crate crate_method_reexport_grrrrrrr2;\nuse std::io::{ self, Error as IoError };\nuse std::net::{ self as stdnet, TcpStream };\nuse foo::{ Foo, bar::{ baz::{}, foobar::* }, * };\nuse foo::bar::baz::{ *, * };\nuse foo::{};\nmod m {\n  use S;\n  use self::{ self };\n  use super::{ self };\n}\npub use ::E::*;\nuse crate as _;\npub use ::E::V::{ self };\nuse std::{ ops::A, marker::{ C, B } };\nmod bar {\n  pub use bar::*;\n  pub use main as f;\n  pub use super::*;\n  use ::std::mem;\n  use crate_method_reexport_grrrrrrr2::rust::add;\n  crate struct Foo;\n}\nuse rustc_hir::BinOpKind::{\n  Add,\n  And,\n  BitAnd,\n  BitOr,\n  BitXor,\n  Div,\n  Eq,\n  Ge,\n  Gtab,\n};\nuse rustc_ast::ast::{\n  ItemForeignMod,\n  ItemImpl,\n  ItemMac,\n  ItemMod,\n  ItemStatic,\n  ItemDefaultImpl,\n};\nuse exceedingly::looooooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{\n  ItemA,\n  ItemB,\n};\nuse exceedingly::loooooooooooooooooooooooooooooooooooooooooooooooooooooooong::import::path::{\n  ItemA,\n  ItemB,\n};\n\nuse list::{\n  // Some item\n  SomeItem /* Comment */,\n  /* Another item */ AnotherItem /* Another Comment */, // Last Item\n  LastItem,\n};\n\nuse test::{ Other /* C   */, /*   A   */ self /*    B     */ };\n\nuse rustc_ast::{ self };\nuse ::{ /* Pre-comment! */ Foo, Bar /* comment */ };\nuse Foo::{ Bar, Baz };\npub use rustc_ast::ast::{\n  Expr_,\n  Expr,\n  ExprAssign,\n  ExprCall,\n  ExprMethodCall,\n  ExprPath,\n};\n\nuse rustc_ast::some::{};\n\nuse self;\nuse std::io::{ self };\nuse std::io::self;\n\nmod Foo {\n  pub use rustc_ast::ast::{ A };\n  mod Foo2 {\n    pub use rustc_ast::ast::{ A, self, B };\n  }\n}\n\nfn test() {\n  use Baz::*;\n  use Qux;\n}\nuse foo::bar::baz as baz;\nuse bar::quux as kaas;\nuse foo;\nuse foo::{ self as bar, baz };\nuse foo::{ self as bar };\nuse foo::{ qux as bar };\nuse foo::{ baz, qux as bar };\nuse ::foo;\nuse ::foo::{ Bar };\nuse ::foo::{ Bar, Baz };\nuse ::{ Foo };\nuse ::{ Bar, Baz };\nuse *;\nuse *;\nerror;\nuse super::*;\nuse foo::issue_1356::*;\n#[cfg(unix)]\nuse self::unix::{};\nuse foo::{\n  a,\n  bar::{\n    baz,\n    qux,\n    xxxxxxxxxxx,\n    yyyyyyyyyyyyy,\n    zzzzzzzzzzzzzzzz,\n    foo::{ a, b, cxxxxxxxxxxxxx, yyyyyyyyyyyyyy, zzzzzzzzzzzzzzzz },\n  },\n  b,\n  boo,\n  c,\n};\nuse fooo::{\n  baar::{\n    foobar::{\n      xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,\n      yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,\n      zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,\n    },\n  },\n  z,\n  bar,\n  bar::*,\n  x,\n  y,\n};\nuse exonum::{\n  api::{ Api, ApiError },\n  blockchain::{ self, BlockProof, Blockchain, Transaction, TransactionSet },\n  crypto::{ Hash, PublicKey },\n  helpers::Height,\n  node::TransactionSend,\n  storage::{ ListProof, MapProof },\n};\nuse a::{ b::{ c::* } };\nuse a::{ b::{ c::{} } };\nuse a::{ b::{ c::d } };\nuse a::{ b::{ c::{ xxx, yyy, zzz } } };\n/// a\n// b\nuse c;\n#[macro_use]\nuse imports_with_attr;\nuse std::f64::consts::{ SQRT_2, E, PI };\n#[rustfmt::skip]\nuse std::fmt::{self, {Display, Formatter}};\n\n// source: \"../../../ext/jinx-rust/tests/samples/statements/use.rs\""
  },
  {
    "path": "tests/output-ext/types/cast.f.rs",
    "content": "fn a() {\n  if (5u64 as i32 as u16) == 0u16 {\n  }\n  [\n    (u64 as u8 as i8) == 9i8,\n    &[1, 2, 3] as *const _ as *const [i32; 3],\n    -0i16 as i8,\n    !0u16 as u8,\n    (0u16 << 15) as u8,\n    (0u32 << 31) as u16,\n    Foo::Bar as i8,\n    0 as i32 as i32,\n    // 0 as i32: i32,\n    // 0i32: i32 as i32,\n    // 0i32: i32: i32 as u32 as i32,\n    // 0i32: i32: i32,\n    0u8 as u32,\n    a as fn(u8),\n    // <T as Foo>::Assoc<3>,\n    drop as fn(u8),\n    &x as *const _,\n    Box::new(A) as &dyn B<C = usize>,\n    box (move |y: i32| -> i32 { x + y }) as Box<\n      dyn (FnMut(i32) -> i32) + 'static\n    >,\n    &x as *const i16 as f32,\n    &(|_| ()) as &dyn for<'x> Fn(<u32 as T<'x>>::V),\n    TestStruct { x: 0x1234 as *const [isize; 2] },\n    !(FOO as *const usize).a(),\n    !(42 as *const usize).a(),\n    (0 as *const usize).a(),\n    !(\"foo\" as *const str).a(),\n    (&x as T)[0],\n  ]\n}\nconst A: *const u8 = &0 as *const _ as *const Q as *const u8;\n\n// source: \"../../../ext/jinx-rust/tests/samples/types/cast.rs\""
  },
  {
    "path": "tests/output-ext/types/never.f.rs",
    "content": "fn a() {\n  a::<!>();\n  let x: ! = a!();\n  let x: ! = unsafe { a::<B, !>(C) };\n  <E as From<!>>::from(never);\n}\nfn a(x: !) -> ! {\n  x\n}\nfn foo(never: !) {}\nfn a(x: !) {}\nfn a(ref x: !) {}\nfn a(x: &[!]) {}\nfn a(x: B<(), !>) {}\n\nimpl A<!> for B {\n  fn c(&self, d: &!) -> E {}\n}\nimpl A for ! {}\ntype A = !;\n\n// source: \"../../../ext/jinx-rust/tests/samples/types/never.rs\""
  },
  {
    "path": "tests/output-ext/types/types.f.rs",
    "content": "type A where 'a: 'b + 'c = u8;\ntype A where 'a: 'b + 'c = u8;\ntype A where 'a: 'b = u8;\ntype A where 'a: 'b = u8;\ntype A where 'a:  = u8;\ntype A where 'a:  = u8;\ntype A = u8;\n\n// type A = for<'a, T>       fn();\ntype A = for<'a: 'b + 'c> fn();\ntype A = for<'a: 'b> fn();\ntype A = for<'a: 'b> fn();\ntype A = for<'a: > fn();\ntype A = for<'a: > fn();\ntype A = for<'a> fn();\ntype A = for<> fn();\n\ntype A = Box<dyn (Fn(u8) -> u8) + 'static + Send + Sync>;\ntype A = impl B;\n\ntype A = u8;\ntype A where for<'a> dyn for<'b> Trait1 + ?Trait2: 'a + Trait = u8;\ntype A where T: = u8;\ntype A where T: Trait = u8;\ntype A where T: Trait + Trait = u8;\ntype A where T: Trait = u8;\ntype A where T: = u8;\n\ntype A = <m::Alias as m::Trait>::X;\n\npub type A<T> where T: B = T;\n\ntype A: Ord;\ntype B: Ord = u8;\ntype C: Ord where 'static: 'static = u8;\ntype D<_T>: Ord;\ntype E<_T>: Ord = u8;\ntype F<_T>: Ord where 'static: 'static = u8;\n\ntype Y<T> where Self: Sized = u32;\ntype Y<T>: A where Self: Sized;\n\npub const FN: &'static fn() = &(fop::<i32> as fn());\nconst A: &&&u32 = &&&42;\nconst CONST1: &[bool; 1] = &[true];\nconst CONST: &[Option<()>; 1] = &[Some(())];\nconst A: [u32; 1] = [4];\nconst F: &'static dyn PartialEq<u32> = &7u32;\nstruct R<'a> {\n  c: Box<dyn FnMut(&mut R, bool) + 'a>,\n}\nfn g() -> impl Tr2<m::Alias> {}\nfn leak_dyn_nonprincipal() -> Box<dyn PubPrincipal + PrivNonPrincipal> {}\nfn method() -> Self::Pub {}\nfn f<T: PrivTr>(arg: T) {}\npub fn unused<const T: usize>() -> usize {}\nfn start(_: isize, _: *const *const u8) -> isize {}\nfn as_ptr(&self) -> *const Self::Item;\nfn as_mut_ptr(&mut self) -> *mut Self::Item;\nfn as_ptr(&self) -> *const T {\n  self as *const _ as *const _\n}\nfn as_mut_ptr(&mut self) -> *mut T {\n  self as *mut _ as *mut _\n}\nfn y_uses_f(f: impl Fn()) {}\nfn infer<T: a::B>(c: T) -> T {\n  c\n}\nfn f1<'a, 'b, 'c>(_x: &'a u32, _y: &'b u32, _z: &'c u32) where 'c: 'a + 'b {}\nfn syntax() {\n  A::<T = u8, T: Ord, String>();\n  A::<T = u8, 'a, T: Ord>();\n  fn y<'a>(y: &mut (dyn 'a + Send));\n  let z = y as &mut (dyn 'a + Send);\n  let x: &'static str = \"A\";\n  fn A() -> Box<<Self as A>::T>;\n  let a = |a, b: _| -> _ { 0 };\n  let a: &usize = &1;\n  let a: &&usize = &&1;\n  let a: &&&usize = &&&1;\n  let a: &&&usize = &&&1;\n  let a: &&&&usize = &&&&1;\n  let a: &&&&usize = &&&&1;\n  let a: &&&&&usize = &&&&&1;\n  let a: Box<dyn Debug> = box 3 as Box<dyn Debug>;\n  let a: Box<dyn A + B>;\n  let a: Box<dyn A + B + C>;\n  let a: Box<dyn A + B>;\n  let a: Box<dyn A + B>;\n  let a: Box<dyn A + B + C>;\n  let a: Box<impl A + B + C>;\n  let a: Box<impl A + B + C>;\n  let a: Box<impl A + B + C + D>;\n  let a: Box<dyn A + B + C + D + E>;\n  let a: &(dyn for<'a> Trait<'a> + 'static);\n  let a: &dyn PartialEq<u32> = &7u32;\n  let a: Option<!> = None;\n  let a = &() as *const () as *const Bottom;\n  let a = id(|_: &isize, _: &isize| {});\n  let a = id(|_: &isize, _: &isize| {});\n\n  fn equal1<T>(_: &T, _: &T) -> bool {}\n  fn equal2<T>(_: &T, _: &T) -> bool where T: {}\n  fn A<'a>() where 'a:  {}\n  pub fn A<T: 'static>(_: T) -> TypeId {}\n  pub fn unused<'a, T>(_: &'a u32) {}\n  let f: fn(_, i32) -> i32 = q;\n  let _ = S::<>;\n  let _ = E::<>::V;\n  let a: i32<>;\n  let a = (\n    A::b::<fn(&'static isize, &'static isize)>(),\n    A::b::<for<'a> fn(&'static isize, &'a isize)>(),\n    A::b::<for<'a, 'b> fn(&'a isize, &'b isize)>(),\n    A::b::<for<'a, 'b> fn(&'b isize, &'a isize)>(),\n    A::b::<for<'a> fn(fn(&'a isize) -> &'a isize)>(),\n    A::b::<fn(for<'a> fn(&'a isize) -> &'a isize)>(),\n    A::b::<for<'a> fn(&'a dyn Trait<'a>) -> Struct<'a>>(),\n    A::b::<for<'a> fn(&'a dyn Trait<'a>) -> Struct<'static>>(),\n    A::b::<for<'a, 'b> fn(&'a dyn Trait<'b>) -> Struct<'b>>(),\n    A::b::<fn(for<'a> fn(&'a isize) -> &'a usize)>(),\n    A::b::<fn(for<'b> fn(&'b isize) -> &'b usize)>(),\n    A::b::<Box<dyn Fn(&'static isize, &'static isize)>>(),\n    A::b::<Box<dyn for<'a> Fn(&'static isize, &'a isize)>>(),\n    A::b::<Box<dyn for<'a, 'b> Fn(&'a isize, &'b isize)>>(),\n    A::b::<Box<dyn for<'a, 'b> Fn(&'b isize, &'a isize)>>(),\n    A::b::<Box<dyn for<'a> Fn(Box<dyn Fn(&'a isize) -> &'a isize>)>>(),\n    A::b::<Box<dyn Fn(Box<dyn for<'a> Fn(&'a isize) -> &'a isize>)>>(),\n    a::<L64<L64<()>>>(),\n    a::<L<L64<L64<()>>>>(),\n    <&dyn A<B = u8>>::x(&e::r(1)),\n    <&'static str>::f(&\"\"),\n    a::<>(),\n    a as &[&dyn Fn(usize) -> ()],\n    a::<&U>(a),\n    a::<U>(a),\n    a::<&mut U>(a),\n  );\n  let s: Foo<'a'> = Foo;\n  let _: Foo<'b'> = s.into();\n  let s2: Foo<'a'> = Foo;\n  let _: Foo<'a'> = s2;\n  let s3: Foo<'a'> = Foo;\n  let _ = s3;\n  let s4: Foo<'a'> = Foo;\n}\nfn A(x: Option<fn(i32)>) -> Option<unsafe fn(i32)> {}\nfn f(x: fn(i32)) -> unsafe fn(i32) {}\nfn f<'b, L: X<&'b Q<K>>>() {}\nstruct A<T, U = [u8; a::<T>()]>(T, U);\nimpl Q for () {}\ntrait Q<P = Self> {}\ntrait Q<P: Sized = [Self]> {}\ntrait H<'d, 'e>: for<'f> I<'d, 'f, 'e> + 'd {}\ntrait F<'f>: for<'a> A<'a> + for<'e> E<'e> {}\nstruct Q<A = S, T>(A, T);\nstruct Q<A, B = Vec<C>, C>(A, B, C);\nimpl<'a> A<'a> for &'a str {\n  fn f<T: B<'a>>(self) -> &'a str {}\n}\nextern \"C\" fn A<T: Add>(a: T, b: T) -> T::Output {\n  a + b\n}\nextern \"C\" {\n  pub fn f<'a>(x: &'a i32);\n  pub fn f<'b>(x: &'a i32, y: &'b i32);\n  pub fn f<'a>(x: &'a i32, y: &i32) -> &'a i32;\n  pub fn f<'b>(x: for<'c> fn(&'a i32));\n  pub fn f<'b>(x: for<'c> fn(&'b i32));\n  pub fn f<'b>(x: for<'c> fn(&'c i32));\n  pub fn f<'b>() -> for<'c> fn(&'a i32);\n  pub fn f<'b>() -> for<'c> fn(&'b i32);\n  pub fn f<'b>() -> for<'c> fn(&'c i32);\n}\nstruct X<'x, 'y> {\n  x: std::marker::PhantomData<&'x ()>,\n  y: std::marker::PhantomData<&'y ()>,\n}\nstruct G<T> where for<'f> T: F<'f, As: E<'f>> + 'f {\n  t: std::marker::PhantomData<T>,\n}\nstruct D<T> where T: for<'c> C<'c, As: A<'c>> {\n  t: std::marker::PhantomData<T>,\n}\nfn f<T>() where T: A, T::U: B {}\nfn f(a: isize, b: *const *const u8) -> isize {}\nfn f<G: FnMut(A, A) -> A>(mut a: G, b: A, c: A) -> A {}\nfn f<T: A<B = T> + C>(x: T) -> T {}\nfn f<A, B: a<A>>(x: B) -> C<A> {}\nstruct Whitespace<T: Clone = ()> {\n  t: T,\n}\nstruct TokenSplit<T: Clone = ()> {\n  t: T,\n}\nfn f<'a, 'b, T>(t: T) -> isize where T: 'a, 'a: 'b, T: Eq {\n  0\n}\nimpl<T: ?Sized, U: ?Sized> A<B<U>> for C<T> where T: D<U> {}\nfn f() where T: for<'a> A<'a> + 'a {}\nfn f() where T: for<'g> H<'g, 'g, As: for<'h> H<'h, 'g> + 'g> {}\nfn f()\n  where\n    T: for<'i> H<\n      'i,\n      'i,\n      As: for<'j> H<'j, 'i, As: for<'k> I<'i, 'k, 'j> + 'j> + 'i\n    > {}\nfn f()\n  where\n    T: for<'l, 'i> H<\n      'l,\n      'i,\n      As: for<'j> H<'j, 'i, As: for<'k> I<'l, 'k, 'j> + 'j> + 'i\n    > {}\nfn f()\n  where\n    T: for<'l, 'i> H<\n      'l,\n      'i,\n      As: for<'j> H<'j, 'i, As: for<'k> H<'j, 'k, As = X<'j, 'k>> + 'j> + 'i\n    > {}\nfn f() where T: Fn(&(), &()) {}\nfn f() where T: Fn(&'a (), &()) {}\nfn f() where T: Fn(&(), Box<dyn Fn(&())>) {}\nfn f() where T: Fn(&(), fn(&())) {}\nfn f() where T: Fn(&(), for<'a> fn(&'a ())) {}\nfn f() where T: Fn(&(), Box<dyn Fn(&())>, &(), fn(&(), &())) {}\nfn f() where T: for<'a> Fn(&'a (), &()) {}\nfn f() where T: for<'a> Fn(&(), &'a ()) {}\nfn f() where T: for<'a> Fn(&'a (), &'a ()) {}\nfn f() where T: for<'a> Fn(&'a (), Box<dyn Fn(&())>) {}\nfn f() where T: for<'a> Fn(&(), Box<dyn Fn(&())>, &'a (), fn(&(), &())) {}\nfn f() where T: A, F: FnOnce(B<T>) -> bool {}\nfn f() -> impl std::borrow::Borrow<<u8 as A>::S> {}\nfn f(_: <() as A<Self::B>>::C) {}\nstruct S<>;\ntrait T<> {}\nenum E<> {\n  V,\n}\nimpl<> T<> for S<> {}\nfn f<'a>(x: for<'b, 'c: 'a + 'b> fn(&'a A, &'b B) -> &'c C)\n  where\n    F: for<'a, 'b: 'a> Fn(&'a A, &'b B) -> &'c C,\n    for<'a, 'b: 'a> F: Fn(&'a A, &'b B) -> &'c C {}\nstruct S<F: for<'a, 'b: 'a> Fn(&'a A, &'b B) -> &'c C>(F);\nstruct S<F>(F) where F: for<'a, 'b: 'a> Fn(&'a A, &'b B) -> &'c C;\nstruct S(dyn for<'a, 'b: 'a> Fn(&'a A, &'b B) -> &'c C);\ntype T = Box<dyn for<'a, 'b: 'a> Fn(&'a A, &'b B) -> &'c C>;\ntype L8<T> = L<L<L<L<L<L<L<L<T>>>>>>>>;\ntype L64<T> = L8<L8<L8<L8<T>>>>;\nimpl<T> A for T where T: B {\n  type C<'a> = <T as D>::E<'a, 'static>;\n}\nimpl<T> A<<() as B<T::C>>::D> for E<T> where T: F, (): G<T::H> {}\ntype Y<'a> = &'a ();\ntype Q<'a>;\ntype Q<'a, 'b>;\ntype Q<'a, 'b>;\ntype Q<'a, 'b, T>;\ntype Q<'a, 'b, T, U>;\ntype Q<'a, 'b, T, U>;\ntype Q<'a, 'b, T: S, U>;\ntype Q<'a, 'b, T: S, U>: S;\ntype Q<'a, 'b, T: S, U>: E<Target = T> + Into<U>;\ntype Q<'a, 'b, T: S, U> where T: E<Target = U>, U: Into<T>;\ntype Q<'a, 'b, T: S, U>\n  : E<Target = T> + Into<U>\n  where T: E<Target = U>, U: Into<T>;\ntype Q<'a>: E<Target = <Self::D<'a> as B>::A<'a, 'static>> where Self: 'a;\ntype S<'a>: Iterator<Q = Self::A<'a>> + E<R = Self::B<'b>>;\ntype Z = dyn for<'x> Send;\ntype A = (*const E::R, D);\nfn f(&self) -> Pin<Box<dyn Future<Output = Self::B> + '_>>;\nfn f(&self) -> Self::Y<'_> {}\nfn f(x: &()) -> &() {}\nfn f(x: &impl for<'a> X<Y<'a> = &'a ()>) -> &() {}\nfn f<'a, T: for<'b> Fun<F<'b> = T>>(t: T) -> T::F<'a> {}\nfn f<'a, T: Fun<F<'a> = T>>(t: T) -> T::F<'a> {}\nfn f<T: ?for<'a> Sized>() {}\nfn f<'a, T1: X<Y = T1>>(t: T1) -> T1::Y<'a>;\nfn f<'a>(s: Box<dyn X<Y<'a> = &'a ()>>) {}\nfn f<'a>(t: Self::Y<'a>) -> Self::Y<'a>;\nfn f<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &() {}\nfn f<'a, T: ?Sized + Fun<F<'a> = [u8]>>(_: Box<T>) -> &'static T::F<'a> {}\nfn f<'a>(t: &'a Self::F<'a>) -> &'a Self::F<'a> {}\nfn f<T>() where T: S, for<'a> T::Item<'a>: Q {}\nfn f<'c, 'd>(s: Box<dyn X<Y = (&'c u32, &'d u32)>>) {}\nfn f(e: &impl for<'a> X<Y<'a> = &'a ()>) -> &'static () {}\nfn f<T: for<'a> X<Y<'a> = &'a ()>>(x: &T) -> &'static () {}\nfn f(x: &mut dyn for<'a> E<R<'a> = &'a i32>) -> usize {}\nfn f() where 'static: 'static, dyn 'static: 'static + Copy {}\nfn f() where 'static: 'static, dyn 'static + ::Foo: 'static + Copy {}\nfn f<F: A>() where F::B: Copy {}\nfn f<F: A>() where <F as A>::B: Copy {}\nfn f<F: A<B: A>>() where F::B: Copy {}\nfn f<T: S<<Self as A>::Q>>(&self, r: &T) -> u64;\nfn f() -> impl Default {}\nfn f(t: Box<dyn for<'a> Get<i32, i32>>) {}\nfn f(t: Box<dyn for<'a> Fn(i32) -> i32>) {}\nfn f(t: for<'a> fn(i32) -> i32) {}\nfn f(t: for<'a> unsafe fn(i32) -> i32) {}\nfn f(t: for<'a> extern \"C\" fn(i32) -> i32) {}\nfn f(t: for<'a> unsafe extern \"C\" fn(i32) -> i32) {}\nimpl<T: Trait1, F: FnMut(<T as Trait1>::C)> Callback<T> for F {}\nimpl Bar<N, M> for Foo<N, M> where A<{ N > 1 }>: B, A<{ M > 1 }>: B {}\nasync fn f(_: impl for<'a> Add<&'a u8>, _: impl for<'b> Add<&'b u8>) {}\nasync fn f<'a>(_: &'a ()) -> impl A<dyn B> {}\nfn f<D: A>() where D::S: {}\ntype T: Iterator<Item = <S as T>::T>;\nstruct R<'a> {\n  s: dyn for<'b> E<D<&'b ()>> + 'a,\n}\nfn f() -> [u8; 4 * 1024 * 1024 * 1024 * 1024] {}\ntrait Foo where T: Borrow<U> + ?Sized, U: ?Sized + 'b, 'a: 'b, Box<T>: {}\ntrait Map\n  where\n    for<'a> &'a Self: IntoIterator<Item = (&'a Self::Key, &'a Self::Value)> {}\ntrait S: A + AsRef<Self::B> {}\nstruct Bar<const N: u8>([u8; (N + 2) as usize]) where [(); (N + 2) as usize]:;\nfn f<const N: u8>() where D<{ N as usize as u16 }>: {}\nfn f<T>()\n  where\n    for<'a> T: TraitA<\n      'a,\n      AsA: for<'b> TraitB<'a, 'b, AsB: for<'c> TraitC<'a, 'b, 'c>>\n    > {}\nfn f<'u, 'a, F>()\n  where for<'b> F: Iterator<Item: for<'c> B<'a, 'b, 'c> + for<'c> A<'a, 'c>> {}\nfn f(&self, db: &<Q as QueryDb<'_>>::DynDb) {}\npub fn f<'a, I>() -> impl B<I, D = (), C = impl S + 'a>\n  where I: A<E = &'a [()]> {}\ntype S<T: A<B: for<'a> C<&'a u8>>> = D;\ntype S<T>;\ntype A = a::b!();\ntype S where Self: Sized;\nfn f(&self, a: &!) {}\ntype S<T> where T: Display;\ntype S<'a, T: Debug + 'a>: ?Sized = dyn Iterator<Item = T>;\ntype S<'x> where T: 'x = &'x ();\ntype S<'u, 'v> where 'u: 'v = &'v &'u ();\ntype S where Self: Q + S = E;\ntype S<'a: 'b, 'b> = (&'a (), &'b ());\ntype S<'a> where Self: 'static = &'a ();\ntype S<'a, 'b> where 'b: 'a = (&'a (), &'b ());\ntype S<'a>: B<&'a [u8]>;\ntype S<'a>: 'a;\ntype S<'a: 'a>;\ntype S<'a> = &'a ();\ntype S<B>: S<A = B>;\ntype S<'a, const N: usize>;\ntype S<'a> where <A as B>::T: 'a, <A as B>::T: 'a = R<&'a S::T, &'a E::T>;\ntype S<T> = Self::E<'static, T>;\ntype S = Self::E<'static, 'static>;\nimpl<'b> ATy for &'b () {}\nimpl<T: Copy + std::ops::Deref> UnsafeCopy<T> for T {}\nimpl<T: X<Y<i32> = i32>> M for T {}\ntype S: Sized where <Self as B>::C: Sized;\ntype S = Q<<T as R>::E>;\nstruct B<'a, T: for<'r> X<Y<'r> = &'r ()>> {\n  f: <T as X>::Y<'a>,\n}\nenum E<'a> {\n  S(<S as A>::B<'a>),\n}\npub type T<P: Send + Send + Send> = P;\ntype S<'b, 'a: 'b + 'b> = (&'b u32, Vec<&'a i32>);\ntype S<'b, T: 'b + 'b> = (&'b u32, Vec<T>);\ntype S<'b, T> where T: 'b, T: 'b = (&'b u32, Vec<T>);\ntype A = dyn S + ?Sized + ?Sized;\ntype R = dyn ?Sized + A;\ntype Q = dyn for<'a> E<'a> + for<'b> R<'b>;\ntype S = dyn Q<for<'a> fn(&'a u8)> + G<for<'b> fn(&'b u8)>;\ntype A = dyn ?Sized;\ntype A = <S as Tr>::A::f<u8>;\ntrait A: B<i32> + std::fmt::Debug + Send + Sync {}\nstruct R<Z: ?Sized = E<i32, i32>>(Z);\nmod a {\n  trait A {\n    const A: u8 = 0;\n  }\n\n  pub trait B {\n    const B: u8 = 0;\n  }\n\n  pub trait C: A + B {\n    const C: u8 = 0;\n  }\n\n  impl A for ::S {}\n  impl B for ::S {}\n  impl C for ::S {}\n}\n\npub type b = Box<dyn t + sync::Send + sync::Sync + 'static>;\npub type b = Box<dyn for<'tcx> e<'tcx> + sync::Send + sync::Sync + 'static>;\n\n// source: \"../../../ext/jinx-rust/tests/samples/types/types.rs\""
  },
  {
    "path": "tests/print.ts",
    "content": "import { createPrettierPrinter, rs_print_samples } from \"../ext/jinx-rust/scripts/utils\";\nimport plugin from \"../src/index\";\n\n// for_each_ts_file(path.resolve(\"src\"), (file) => {\n// \tconsole.log(cmd(file.path), file.content.includes(\"\\r\"));\n// \tupdate_file(file.path, file.content.replace(/\\r/g, \"\"), { force: true, sync: true, prettier: false });\n// });\nconst printer = createPrettierPrinter(\n\t{\n\t\tparser: \"jinx-rust\",\n\t\tplugins: [plugin],\n\t\tprintWidth: 80,\n\t\ttabWidth: 2,\n\t},\n\tfalse\n);\nrs_print_samples([\"tests/samples/\"], \"tests/output/\", [printer]);\nrs_print_samples([\"ext/jinx-rust/tests/samples\"], \"tests/output-ext/\", [printer]);\n"
  },
  {
    "path": "tests/samples/comments/assignment.rs",
    "content": "f1 = |\n  //comment\n  a \n| {};\n  \nf2 = |\n  a //comment\n| {};\n  \nf3 = |\n  a\n  //comment\n| {};\n  \nf4 = // Comment\n  || {};\n\nf5 =\n  \n  // Comment\n  \n || {}\n  \nf6 = /* comment */\n  \n  // Comment\n  \n  || {}\n  \nlet f4 = // Comment\n  || {};\n  \nlet f5 =\n  \n  // Comment\n  \n  || {}\n  \nlet f6 = /* comment */\n  \n  // Comment\n  \n  || {}\n\nconst kochabCooieGameOnOboleUnweave = // ???\n      annularCooeedSplicesWalksWayWay;\n\nconst bifornCringerMoshedPerplexSawder = // !!!\n  glimseGlyphsHazardNoopsTieTie +\n  averredBathersBoxroomBuggyNurl -\n  anodyneCondosMalateOverateRetinol;\n\nfnNumber =\n  // Comment\n  3;\n\nfnNumber =\n\n  // Comment\n\n  3;\n\nfnNumber =\n  // Comment0\n  // Comment1\n  3;\n\nfnNumber = /* comment */\n  3;\n\nfnNumber = /* comments0 */\n  /* comments1 */\n  3;\n\nfnNumber =\n  // Comment\n  3;\n\nlet fnNumber =\n\n  // Comment\n\n  3;\n\nlet fnNumber =\n  // Comment0\n  // Comment1\n  3;\n\nlet fnNumber = /* comment */\n  3;\n\nlet fnNumber = /* comments0 */\n  /* comments1 */\n  3;\n\nfnString =\n  // Comment\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /* comment */\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /**\n   * multi-line\n   */\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  /* inline */ \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\";\n\nfnString = // Comment0\n  // Comment1\n  \"some\" + \"long\" + \"string\";\n\nfnString = // Comment\n  \"some\" + \"long\" + \"string\";\n\nfnString =\n  // Comment\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n\n  // Comment\n\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /* comment */\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /**\n   * multi-line\n   */\n  \"some\" + \"long\" + \"string\";\n\nlet fnString =\n  /* inline */ \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\" + \"some\" + \"long\" + \"string\";\n\nlet fnString = // Comment0\n  // Comment1\n  \"some\" + \"long\" + \"string\";\n\nlet fnString = // Comment\n  \"some\" + \"long\" + \"string\";\n\n\nlet obj1 = // 36_______\nA {\n  key: \"val\"\n}\n\nlet obj2 // 37_______\n= A {\n  key: \"val\"\n}\n\nlet obj3 = A { // 38_______\n  key: \"val\"\n}\n\nlet obj4 = A {\n  // 39_______\n  key: \"val\"\n}\n\nlet obj5 = // 40_______\n[\n  \"val\"\n]\n\nlet obj6 // 41_______\n= [\n  \"val\"\n]\n\nlet obj7 = [ // 42_______\n  \"val\"\n]\n\nlet obj8 = [\n  // 43_______\n  \"val\"\n]\n\n\nconst A{ a /* 0_______ */ : 1 } = b;\n\nconst A{ c : 1 /* 1_______ */ } = d;\n\nlet A{d //2_______\n: b} = c\n\nconst foo = A {\n  a: \"a\" /* 3_______________ */,\n\n   /* 4_________ */\n  b: \"b\",\n};\n\nlet // 44_______\n  foo1 = \"val\";\n\nconst foo3 = 123\n// 45_______\n;[\"2\", \"3\"].forEach(|x| console.log(x))\n\nlet a = b || /** 46_______ */\n  (c);\n\nlet a = A {\n\ta /* 47_______ */: || 1\n};\n\nlet a /* 48 */ = 0;\n\nlet b /*\n       * 4\n       * 9\n       */ = 0;\n\nlet c = /*\n       * 5\n       * 0\n       */ 0;\n\nlet d /*\n       * 5\n\n       * 1\n       */ = 0;\n       \nfn foo() {\n  let x = foo\n      .bar??  ? // comment\n      .baz;\n  let x = foo\n      .bar?  ??\n  // comment\n      .baz;\n  let x = foo\n      .bar? ? ? // comment\n  // comment\n      .baz;\n  let x = foo\n      .bar? ?? // comment\n  // comment\n      ? ??\n  // comment\n      ?  ??\n  // comment\n      ???  \n  // comment\n      ? ? ?\n      .baz;\n  let x = try /* Invisible comment */ { foo()? };\n  let loooooooooooooooooooooooooooooooooooooooooong = does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;\n \n      let x = y // comment\n        .z;\n\n    self.rev_dep_graph\n        .iter()\n       // Remove nodes that are not dirty\n        .filter(|&(unit, _)| dirties.contains(&unit))\n     // Retain only dirty dependencies of the ones that are dirty\n       .map(|(k, deps)| {\n            (\n                k.clone(),\n                deps.iter()\n                .cloned()\n               .filter(|d| dirties.contains(&d))\n              .collect(),\n            )\n        });\n\n    let y = expr /* comment */.kaas()?;\n\n    (Foo {\n        ..// comment\n        a\n    } = a);\n}\n"
  },
  {
    "path": "tests/samples/comments/binaryish.rs",
    "content": "a = b || /** 5_______ */\nc;\n\na = b /** 6_______ */ ||\nc;\n\na = b || /** 7_____________________________________________________________________________ */\nc;\n\na = b /** 8_____________________________________________________________________________ */ ||\nc;\n\na = b || /** 9_____________________________________________________________________________ */ c;\n\na = b && /** 10_______ */\nc;\n\na = b /** 11_______ */ &&\nc;\n\na = b && /** 12_____________________________________________________________________________ */\nc;\n\na = b /** 13_____________________________________________________________________________ */ &&\nc;\n\na = b && /** 14_____________________________________________________________________________ */ c;\n\na = b + /** 15_______ */\nc;\n\na = b /** 16_______ */ +\nc;\n\na = b + /** 17_____________________________________________________________________________ */\nc;\n\na = b /** 18_____________________________________________________________________________ */ +\nc;\n\na = b + /** 19_____________________________________________________________________________ */ c;\n\n\na = b || // 20_______\nc;\n\na = b || // 21_____________________________________________________________________________\nc;\n\na = b && // 22_______\nc;\n\na = b && // 23_____________________________________________________________________________\nc;\n\na = b + // 24_______\nc;\n\na = b + // 25_____________________________________________________________________________\nc;\n\n0\n// 26_______\n+ x;\n\n0\n// 27_______\n* x;\n0\n// 28_______\n/ x;\n0\n// 29_______\n- x;\n0\n// 30_______\n% x;\n0\n// 31_______\n<< x;\n0\n// 32_______\n>> x;\n0\n// 33_______\n& x;\n0\n// 34_______\n| x;\n0\n// 35_______\n^ x;\n"
  },
  {
    "path": "tests/samples/comments/blocks.rs",
    "content": "if 0 {\n\t0;\n\t//\n} else if 0 {\n}\n\nif 1 {\n\t/*\n\t * _______\n\t */\n}\n\nif 1 {\n  // _______\n}\n\nif 1 {\n}\n// _______\nelse {\n\n}\n\nif 1\n// if 1 (ln trailing)\n{\n  1\n}\n// else if 2 (leading)\nelse if 2\n  { 2 }\n// else if 3 (leading)\n// else if 3 (leading)\n// else if 3 (leading)\nelse if 3\n  // if 3 (ln trailing)\n  { 3 }\n// else if 4 (leading)\nelse if 4 {\n  // 4 body\n}\n// else (leading)\nelse {\n}\n\nif 5 // if 5 (trailing)\n{ 1 }\n\nif 6 // if 6 (trailing)\n{ 6 }\nelse if 7 // else if 7 (trailing)\n{ 7 }\nelse // else (trailing)\n{ 0 }\n\nif 8 // if 8 (trailing)\n// ^ if 8 (ln trailing)\n{ 1 }\nelse if 9 // else if 9 \n// else if 9 (ln trailing)\n{ 1 }\nelse // else (trailing)\n// else (ln trailing)\n{ 1 }\n\nif 10 /* _______ */ // _______\n{ 10 }\nelse if 11 /* _______ */\n{ 11 }\nelse if 12 // _______ /* _______ */ // _______\n{ 12 }\nelse if 13 /* _______ */ /* _______ */ // _______\n{ 13 }\nelse /* _______ */\n{ 0 }\n\nif 14 // _______\n/* _______ */\n// _______\n{ 14 }\nelse if 15 // _______\n/* _______ */\n/* _______ */ // _______\n{ 15 }\n\n\nfor // _______\na in b {}\n\nfor /* _______ */ a in b {}\n\nlet a = {/* _______ */};\nlet b = {\n  // _______\n};\n\nfor e in q {\n  r = *e; // c \n}\n\nwhile \n  true\n  // _______\n {}\n\nwhile true // _______\n{}\n\nwhile true {}// _______\n\nwhile true /*_______*/{}\nwhile true  /* _______ */ {}\n\nwhile \ntrue // _______\n&& true // _______\n {}\n\nwhile true  {} // _______\n\n\nif (cond) {\n  stuff;\n} /* _______ */ else if (cond) {\n  stuff;\n}\n// _______\nelse {\n  stuff;\n}\n\nif (cond){ stuff;}\n// _______\nelse {stuff;}\n\nret = if __DEV__ \n  // _______\n{vm.runInContext(source, ctx)}\nelse {a}\n\nif (a == 0) {doSomething(); // _______\n}else if (a == 1){ doSomethingElse(); // _______\n}else if (a == 2) {doSomethingElse(); // _______\n}\nif (a == 0) {doSomething(); /* _______ */\n}else if (a == 1){ doSomethingElse(); /* _______ */\n}else if (a == 2){ doSomethingElse(); /* _______ */\n}\nif (a == 0){ expr; // _______\n}else if (a == 1){ expr; // _______\n}else if (a == 2){ expr; // _______\n}\nif (a == 0){ expr; /* _______ */\n}else if (a == 1){ expr; /* _______ */\n}else if (a == 2){ expr; /* _______ */\n}\nif (a == 0) {looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n}else if (a == 1){ looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n}else if (a == 2){ looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong; // _______\n}\nif (code == 92 /* _______ */) {}\nif (code == 92 /* _______ */ /* _______ */) {}\n\nif (code == 92) /* _______ */ {}\nif (code == 92) { /* _______ */ }\n\nif (\n  1\n  // _______\n) {\n  a;\n}\n\n{\n  'a: // _______\n  loop {}\n}\n{\n  'a:\n  // _______\n  loop { }\n}\n\n\nfn f() {\n  a\n  /* _______ */\n}\n\nfn f() {\n  a\n\n  /* _______ */\n}\n\nfn d() {\n  /* _______ */\n}\n\nfn f() {\n  // _______\n  f()\n\n  // _______\n  f()\n\n  // _______\n  // _______\n}\n\n\nfn f() \n// _______\n{\n  return 1\n}\n\nfn f() // _______\n{\n  return 1\n}\n\nfn f() { // _______\n  return 1\n}\n\nfn f() {\n  // _______\n  return 1;\n}\n\nunsafe // So this is a very long comment.\n// Multi-line, too.\n// Will it still format correctly?\n{\n  a\n}\n\n{ /* a block with a comment */ }\n{\n\n}\n{\n    // A block with a comment.\n}\n\nfn foo() {\n  async {\n      // Do\n      // some\n      // work\n  }\n  .await;\n\n  async {\n      // Do\n      // some\n      // work\n  }\n      .await;\n}\n"
  },
  {
    "path": "tests/samples/comments/chain.rs",
    "content": "_.a(a)\n/* _____________________________________________________________________________ */\n.a()\n\n_.a(\na\n)/* _____________________________________________________________________________ */\n.a();\n\n_.a(\na\n) /* _____________________________________________________________________________ */.a();\n\nSomething\n// _______\n.getInstance(this.props.dao)\n.getters()\n\n// _______\nmeasure()\n.then(|| {\n  SomethingLong();\n});\n\nmeasure() // _______\n.then(|| {\n  SomethingLong();\n});\n\nconst configModel = this.baseConfigurationService.getCache().consolidated\t\t// _______\n.merge(this.cachedWorkspaceConfig);\n\nthis.doWriteConfiguration(target, value, options) // _______\n.then(|| null,\n|| {\n  return if options.donotNotifyError  {TPromise.wrapError(error)} else {this.onError(error, target, value)};\n});\n\nangular.module(\"AngularAppModule\")\n// _______\n.constant(\"API_URL\", \"http://localhost:8080/api\");\n\n\n// _______\nObservable.of(process)\n  // _______\n  .merge(Observable.never())\n  // _______\n  .takeUntil(if throwOnError  {errors.flatMap(Observable.throw)} else {errors})\n  .takeUntil(exit);\n\n"
  },
  {
    "path": "tests/samples/comments/closure.rs",
    "content": "\ncall(|/*_______*/ row| {});\nKEYPAD_NUMBERS.map(|num| ( // _______\n  1\n));\n\n\nconst obj = A {\n  f1: /* _______ */|| {},\n  f2: |/* _______ */| {},\n  f3: || /* _______ */ {},\n  f4: /* _______ */|/* _______ */| /* _______ */ {},\n};\n\n(/* _______ */|| {})();\n(|/* _______ */| {})();\n(|| /* _______ */ {})();\n(/* _______ */|/* _______ */| /* _______ */ {})();\n\nlet commented = |/* first */ a /*argument*/, /* second*/ b: WithType /* argument*/, /* ignored */ _ |\n        (aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb);\n\nconst fn1 = |/*_______, _______*/| doSomething();\nconst fn2 = |/*_______, _______*/| doSomething(anything);\n\nfoo(\n  |\n    // _______\n  | {}\n);\n\nconst rootEpic = |actions, store| (\n  combineEpics(epics)(actions, store)\n    // _______\n    .catch(|err, stream| {\n      getLogger().error(err);\n      return stream;\n    })\n);\n"
  },
  {
    "path": "tests/samples/comments/dangling.rs",
    "content": "use std::{/* comment */};\n\nmacro_rules! m {/* comment */}\nmacro_rules! m { (/* comment */) /* comment */ => /* comment */ {/* comment */} }\n\nmacro m (/* comment */) /* comment */ {/* comment */}\n\n{/* comment */}\n\nf(/* comment */);\n\nf!/* comment */(/* comment */);\nf!/* comment */{/* comment */};\nf!/* comment */[/* comment */];\n\nf!([/* comment */]);\nf!({/* comment */});\nf!((/* comment */));\n\nf!(~[/* comment */]);\nf!(~{/* comment */});\nf!(~(/* comment */));\n\n[/* comment */];\n(/* comment */);\nA /* comment */ {/* comment */};\n\nif let A {/* comment */} | a(/* comment */) | [/* comment */] = (/* comment */) {}\n\nif 0 {/* comment */}\nif 0 {/* comment */}/* comment */else/* comment */     {/* comment */}\nif 0 {/* comment */}/* comment */else/* comment */if 0 {/* comment */}\nif 0 {/* comment */}/* comment */else/* comment */if    /* comment */  let _ = 0 {/* comment */}\n\nmatch (/* comment */) { /* comment */ }\n\nfn a(/* comment */) /* comment */ {/* comment */}\n\n|/* comment */| 0;\n\nimpl A {/* comment */}\ntrait A {/* comment */}\nenum A {/* comment */}\nstruct A(/* comment */)\nstruct A{/* comment */}\nmod A {/* comment */}\nuse A::{/* comment */}\nunion A {/* comment */}\n\nA::</* comment */>;\nA::</* comment */>(/* comment */);\n\ntype A</* comment */>: fn(/* comment */) where for</* comment */> A</* comment */>: for</* comment */> Fn(/* comment */) -> (/* comment */)\n\n#![/* comment */]\n#[/* comment */]\nstruct A;\n\n#[/* comment */]\n#![/* comment */]\nstruct A;\n\n#[/* comment */]\n#[/* comment */]\n#![/* comment */]\nstruct A;\n\n#[/* comment */]\n#![/* comment */]\n#![/* comment */]\nstruct A;\n\n#[/* comment */]\n#![/* comment */]\n#![/* comment */]\n#[/* comment */]\nstruct A;\n\n#[/* comment */]\n#![/* comment */]\n#[/* comment */]\n#![/* comment */]\nstruct A;"
  },
  {
    "path": "tests/samples/comments/file.rs",
    "content": "// This file only\n// has comments. This comment\n// should still exist\n//\n// when printed.\n\n/**\n * @typedef {DataDrivenMapping|ConstantMapping} Mapping\n */\n/**\n * @typedef {Object.<String, Mapping>} ConfigurationMapping\n */\n\n/**\n * @typedef {Function} D3Scale - a D3 scale\n * @property {Function} ticks\n * @property {Function} tickFormat\n */\n// comment\n\n// comment\n"
  },
  {
    "path": "tests/samples/comments/flow.rs",
    "content": "loop {\n  break /* _______ */;\n  continue /* _______ */;\n}\n  \n'loop: loop {\n  break /* _______ */ 'loop;\n  break 'loop /* _______ */;\n  continue /* _______ */ 'loop;\n  continue 'loop /* _______ */;\n}\n\n\nreturn (\n  // _______\n  !!x\n);\n\nreturn 1337; // _______\n\nreturn (\n  // _______\n  42\n) && 84;\n\nreturn (\n  // _______\n  42\n) * 84;\n\nreturn if (\n  // _______\n  42\n) {1} else {2};\n\nreturn if (\n  // _______\n  42\n) * 3 { 1 } else { 2 };\n\nreturn (\n  // _______\n  a\n)();\n\nreturn (\n  // _______\n  a.b\n).c;\n\nreturn (\n  // _______\n  a\n).b.c\n\nreturn (\n  // _______\n  afn.b()\n).c.d()\n\nreturn (\n  // _______\n  if a.b() * 3 + 4 + (if (\"a`hi`\", 1) { 1 } else {1}) {} else {1}\n)\n\nreturn ( // _______\n  a, b\n);\n\nreturn (\n  // _______\n  a\n);\n\nreturn (\n  /* _______ */ 42\n) || 42;\n\nreturn observableFromSubscribeFunction()\n// _______\n// _______\n.debounceTime(debounceInterval);\n\nreturn A {\n  // _______\n  bar: baz() + 1\n};\n"
  },
  {
    "path": "tests/samples/comments/functions.rs",
    "content": "\nfn a(/* _______ */) {} // _______\nfn b() {} // _______\nfn c(/* _______ */ argA, argB, argC) {} // _______\nfn a(a /*_______*/) {}\nfn b(a /*_______*/\n) {}\nfn d(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) {}\nfn d(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) /*_______*/ {}\n// prettier-ignore\nfn c(a /*_______*/\n) {}\n// prettier-ignore\nfn d(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) {}\n// prettier-ignore\nfn e(\n  a /*_______*/,\n  b /*_______*/,\n  c /*_______*/,\n  d /*_______*/\n) {} /* _______*/\n\nfn f1 /* _______ */() {}\nfn f2 (/* _______ */) {}\nfn f3 () /* _______ */ {}\nfn f4 /* _______ */(/* _______ */) /* _______ */ {}\nfn f5 /* _______ */(/* _______ */ a) {}\nfn f6 /* _______ */(a /* _______ */) {}\nfn f7 /* _______ */(/* _______ */ a) /* _______ */ {}"
  },
  {
    "path": "tests/samples/comments/ignore.attr.rs",
    "content": "const baseline = 1 +        1;\n\nfn no() {\n  a(  a  ); #![rustfmt::skip]\n  // _______\n}\n\n#[rustfmt::skip]\nconst a    =   A {\n  b:\n          \"_______\",\n};\n\nfn   f()    {\n\t1    +  1;\n\t#[no   ]\n\t#![rustfmt::skip]\n\tfn f() {\n\t  1     + 1;\n\t}\n}"
  },
  {
    "path": "tests/samples/comments/ignore.file.rs",
    "content": "\tconst unformatted= 1;\n\n#![rustfmt::skip] // a\n\n fn unformatted () {\n\t struct a {\n\t\t \t\t\t// b\n\t\t c\n\t }\n }"
  },
  {
    "path": "tests/samples/comments/ignore.rs",
    "content": "const baseline = 1 +        1;\n\n// prettier-ignore\nlet x =\n  \"\" + this.USE + \" \" + this.STRICT + \";\\n\" +\n  this.filterPrefix() +\n  \"var fn=\" + this.generateFunction(\"fn\", \"s,l,a,i\") +\n  extra +\n  this.watchFns() +\n  \"return fn;\";\n\n// prettier-ignore\nconst x = Matrix.create(\n  1, 0, 0,\n  0, 1, 0,\n  0, 0, 0\n);\n\n// prettier-ignore\nconst x =   A {\n  b:\n          \"_______\",\n};\n\n\nfn f() {\n  a(  a  ); // prettier-ignore\n  // _______\n}\n\n// prettier-ignore\nconsole.error(\n  \"_______\" + prompt + \"_______\" +\n  \"_______ _______\"\n);\n\nconst response = A {\n  // prettier-ignore\n  a: \"Turn on the lights\",\n  intent: \"lights\",\n};\n\nverylongidentifierthatwillwrap123123123123123(\n  a.b\n    // prettier-ignore\n    // _______\n    .c\n);\n\ncall(\n  // _______\n  a.\n    // prettier-ignore\n    b\n)\n\ncall(\n  a(\n/*\n_______\n*/\n1,\n2.0000, 3\n)\n    // prettier-ignore\n    .c\n)\n\n#[attr]\n// prettier-ignore\nconst foo = 1 +      1;\n\n\n\nconst A {\n  // prettier-ignore\n  bar :           a,\n} = foo\n\nconst A {\n  a,\n  // prettier-ignore\n  bar2 :           a,\n} = foo\n\n/* _______ */\nconst A {\n  // prettier-ignore\n  bar3 :           a,         // _______\n} = foo\n\nconst A {\n  // prettier-ignore\n  bar4 :           a,         /* _______ */\n} = foo\n\nconst A {\n  // prettier-ignore\n  bar5 :           /* _______ */          a,\n} = foo\n\nconst A {\n  // prettier-ignore\n  ..\n} = foo\n\nconst A {\n  baz: A {\n  // prettier-ignore\n  foo2: [a, b,    c]\n},\n  // prettier-ignore\n  bar7 :            a,\n} = foo\n\n"
  },
  {
    "path": "tests/samples/comments/imports.rs",
    "content": "use list::{\n    // Some item\n    SomeItem /* Comment */, /* Another item */ AnotherItem /* Another Comment */, // Last Item\n    LastItem\n};\nuse test::{  Other          /* C   */  , /*   A   */ self  /*    B     */    };\nuse {/* Pre-comment! */\n\tFoo, Bar /* comment */};"
  },
  {
    "path": "tests/samples/comments/macro.rs",
    "content": "a!(~ \" {    }  \");\na!(~ // 1\n);\na!(~ {  // 2\n});\n\ncfg_if::cfg_if! {\n    if #[attr] {\n        if 0 {\n        } else {\n            // ERROR!\n        }\n    } \n}\n\na! {\n    if #[attr] {\n        // ERROR!\n    } \n}\n\nx! {~ {\n    // ERROR!\n}\n}"
  },
  {
    "path": "tests/samples/comments/multiple.rs",
    "content": "/* _______ */ /* _______ */ /* _______ */ a;\na; /* _______ */ /* _______ */ /* _______ */\na // _______\na;\n/*1*//*2*//*3*/\nb;\n\na;/*1*//*2*//*3*/\nb;\n\na;\n/*1*//*2*//*3*/b;\n\na;\n/*\n1*//*2*//*3\n*/\nb;\n\na;/*\n1*//*2*//*3\n*/\nb;\n\na;/*\n1*//*2*//*3\n*/b;\n\na;\n/*1*//*2*/\n/*3*/\nb;\n\na;/*1*//*2*/\n/*3*/\nb;\n\na;\n/*1*//*2*/\n/*3*/b;\n\na;\n/*\n1*//*2*/\n/*3\n*/\nb;\n\na;/*\n1*//*2*/\n/*3\n*/\nb;\n\na;/*\n1*//*2*/\n/*3\n*/b;\n\na;\n/*1*/\n/*2*//*3*/\nb;\n\na;/*1*/\n/*2*//*3*/\nb;\n\na;\n/*1*/\n/*2*//*3*/b;\n\na;\n/*\n1*/\n/*2*//*3\n*/\nb;\n\na;/*\n1*/\n/*2*//*3\n*/\nb;\n\na;/*\n1*/\n/*2*//*3\n*/b;\n\nuse foo; /*\n14\n*/ /* 1\n10\n*/ /*/ 13 */\n/*\n 9\n ****/\nuse bar;\n\nx; /*\n1 */ /* 2 */\n\ny\n\nx; /*1*//*2*/\ny;\n\n\n/** 1 - OUTER DOC */\n\n/* 2 - COMMENT */\n\n/*! 3 - INNER DOC */\n\n/*! 4 - INNER DOC */\n\n/* 5A - COMMENT */ /**\n* 5B - OUTER DOC\n*/ /**\n* 5C - OUTER DOC\n*/"
  },
  {
    "path": "tests/samples/comments/parens.rs",
    "content": "!x;\n!(x /* 0 */);\n!(/* 1 */ x);\n!(\n  /* 2 */\n  x\n);\n!(\n  x\n  /* 3 */\n);\n!(\n  x // 4\n);\n\n!(x + y);\n!(x + y /* 5 */);\n!(/* 6 */ x + y);\na!(!(/* 6 */ x + y));\n!(\n  /* 7 */\n  x + y\n);\n!(\n  x + y\n  /* 8 */\n);\n!(\n  x + y // 9\n);\n\n!(x || y);\n!(/* 10 */ x || y);\n!(x || y /* 11 */);\n!(\n  /* 12 */\n  x || y\n);\n!(\n  x || y\n  /* 13 */\n);\n!(\n  x || y // 14\n);\n\n![1, 2, 3];\n!([1, 2, 3] /* 15 */);\n!(/* 16 */ [1, 2, 3]);\n!(\n  /* 17 */\n  [1, 2, 3]\n);\n!(\n  [1, 2, 3]\n  /* 18 */\n);\n!(\n  [1, 2, 3] // 19\n);\n\n!A { a: 1, b: 2 };\n!(A { a: 1, b: 2 } /* 20 */);\n!(/* 21 */ A { a: 1, b: 2 });\n!(\n  /* 22 */\n  A { a: 1, b: 2 }\n);\n!(\n  A { a: 1, b: 2 }\n  /* 23 */\n);\n!(\n  A { a: 1, b: 2 } // 24\n);\n\n!|| {\n  return x;\n};\n!(\n  || {\n    return x;\n  } /* 25 */\n);\n!(\n  /* 26 */ || {\n    return x;\n  }\n);\n!(\n  /* 27 */\n  || {\n    return x;\n  }\n);\n!(\n  || {\n    return x;\n  }\n  /* 28 */\n);\n!(\n  || {\n    return x;\n  } // 29\n);\n\n!(x = y);\n!(x = y /* 30 */);\n!(/* 31 */ x = y);\n!(\n  /* 32 */\n  x = y\n);\n!(\n  x = y\n  /* 33 */\n);\n!(\n  x = y // 34\n);\n\n!x.y;\n!(x.y /* 35 */);\n!(/* 36 */ x.y);\n!(\n  /* 37 */\n  x.y\n);\n!(\n  x.y\n  /* 38 */\n);\n!(\n  x.y // 39\n);\n\n!x();\n!(x() /* 40 */);\n!(/* 41 */ x());\n!(\n  /* 42 */\n  x()\n);\n!(\n  x()\n  /* 43 */\n);\n!(\n  x() // 44\n);\n\n\n!(x, y);\n!(x, y /* 45 */);\n!(/* 46 */ x, y);\n!(\n  /* 47 */\n  x, y\n);\n!(\n  x, y\n  /* 48 */\n);\n!(\n  x.y // 49\n);\n\n!(|| 3);\n!(|| 3 /* 50 */);\n!(/* 51 */ || 3);\n!(\n  /* 52 */\n  || 3\n);\n!(\n  || 3\n  /* 53 */\n);\n!(\n  || 3 // 54\n);\n\nloop {\n  !(yield x);\n  !(yield x /* 55 */);\n  !(/* 56 */ yield x);\n  !(\n    /* 57 */\n    yield x\n  );\n  !(\n    yield x\n    /* 58 */\n  );\n  !(\n    yield x // 59\n  );\n}\n\nasync || {\n\t!(x.await);\n\t!(x.await /* 60 */);\n\t!(/* 61 */ x.await);\n\t!(\n\t  /* 62 */\n\t  x.await\n\t);\n\t!(\n\t\tx.await\n\t\t/* 63 */\n\t);\n\t!(\n\t\tx.await // 64\n\t);\n};\n\nMath.min(\n  (\n    /* ______________________________________________________________\n     * _______________________________________________________________\n     * _______ */\n    document.body.scrollHeight -\n    (window.scrollY + window.innerHeight)\n  ) - devsite_footer_height,\n  0,\n);\n"
  },
  {
    "path": "tests/samples/comments/whitespace.rs",
    "content": "        /*\n  1\n        */\n        /*\n          2\n        */\n        /*\n\t\t\t\t\t\t\t\t  3\n        */\n        /*\n\n\n\n\n\n\n\n\n  4\n        */\n\n    /*\n  5a                       5b\n    */\n    /*\n\t\t6\n    */\n    /*\n      7a                       7b\n    */\n    /*\n\t\t\t\t  8a                     8b\n    */\n\n    /*\n\u000b\u000b\u000b\u000b  VT4+2:                         9\n    */\n    /*\n\f\f\f\f  FF4+2:                         10\n    */\n    /*\n\n\n\n\n  CR4+2:                         11\n    */\n    /*\n  NEL4+2:                        12\n    */\n    /*\n      13a          13b\n    */\n    /*\n      14\n    */\n    /*\n      15a         15b\n    */\n\n    /*\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n      16\n    */\n\n\n/* */ /*\n        17a\n        17b                     17c\n        17d\n      */\n/* */ /*\n        18a\n        18b                     18c\n        18d\n      */"
  },
  {
    "path": "tests/samples/common/arrays.rs",
    "content": "{for srcPath in [src, \"${src}.js\", \"${src}/index\", \"${src}/index.js\"] {}}\n{for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_43] {}}\n{for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_432] {}}\n{for srcPath in [123, 123_123_123, 123_123_123_1, 13_123_3123_31_4321] {}}\n\n[[]];\n[[], []];\n[[], [], []];\n[[], [0], []];\n[[], [0], [0]];\n[[], [0, 1], [0]];\n[[], [0, 1], [0, 1]];\n[[0]];\n[[0], []];\n[[0], [], []];\n[[0], [0], []];\n[[0], [0], [0]];\n[[0], [0, 1], [0]];\n[[0], [0, 1], [0, 1]];\n[[0, 1]];\n[[0, 1], []];\n[[0, 1], [], []];\n[[0, 1], [0], []];\n[[0, 1], [0], [0]];\n[[0, 1], [0, 1], [0]];\n[[0, 1], [0, 1], [0, 1]];\n[[], [1, 2, 3]];\n[[1], [1]];\n[[1, 2], [1, 2, 3]];\n[[1, 0], [1, 0]];\n[A {}];\n[A {}, A {}];\n[A {}, A {}, A {}];\n[A {}, A { a }];\n[A {}, A { a, b }];\n[A {}, A { a, b, c }];\n[A { a }];\n[A { a }, A { a }];\n[A { a }, A { a }, A { a }];\n[A { a }, A { a, b }];\n[A { a }, A { a, b, c}];\n[A { a, b }];\n[A { a, b }, A { a }];\n[A { a, b }, A { a }, A { a }];\n[A { a, b }, A { a, b }];\n[A { a, b }, A { a, b, c }];\n\nexpect(|| {}).toTriggerReadyStateChanges([\n  // _______\n]);\n\nexpect(bifornCringerMoshedPerplexSawder.getArrayOfNumbers()).toEqual(\n  [1, 2, 3, 4, 5]\n);\n\nexpect(bifornCringerMoshedPerplexSawder.getLongArrayOfNumbers()).toEqual(\n  [\n\t\t66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35,\n\t\t97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91,\n\t\t98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4,\n\t\t36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35,\n\t\t48,78,97\n\t]\n);\n\nbifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers = [\n  1,\n  2,\n  3,\n  4,\n  5\n];\n\nbifornCringerMoshedPerplex.bifornCringerMoshedPerplexSawder.arrayOfNumbers2 = [\n  66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35,\n  97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91,\n  98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4,\n  36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35,\n  48,78,97\n];\n\nconst numbers = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385,-// comment1\n380014,\n-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7,\n// comment2\n-62454,-4282239912,\n-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44,\n-41833463,-27961.12,-305.36,-199875.28];\n\nc = [\n  - /**/ 66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323\n];\n\nconst numbers1 = [-2017,-506252,-744011292,-7224,-70.4,-83353.6,-708.4,-174023963.52,-40385,\n// comment1\n-380014,\n-253951682,-728,-15.84,-2058467564.56,-43,-33,-85134845,-67092,-1,-78820379,-2371.6,-16,7,\n// comment2\n-62454,-4282239912,\n-10816495.36,0.88,-100622682,8.8,-67087.68000000001,-3758276,-25.5211,-54,-1184265243,-46073628,-280423.44,\n-41833463,-27961.12,-305.36,-199875.28];\n\nconst numbers2 = [-234, -342 // comment3\n, -223, -333333.33,12345]\n\nlet _v1 =\n\t   [\n\t\t// a\n\t\t0,\n\t\t// b\n\t\t1,\n\t\t// c\n\t\t2];\nlet _v2 =\n\t   [0, // a\n\t\t1, // b\n\t\t2]; // c\nlet _v3 =\n\t   [\n\t\t/* a */\n\t\t0,\n\t\t/* b */\n\t\t1,\n\t\t/* c */\n\t\t2];\nlet _v4 =\n\t   [0, /* a */\n\t\t1, /* b */\n\t\t2]; /* c */\n[\n\t&|x /*: r*/ | { x.e(); },\n\n];\n\n// --------------- print-width -------------------------------------------------\n\nconst result = asyncExecute(\"non_existing_command\", /* _______ */ []);\n\nlet b = [/* _______ */];\n\nc = [\n  66, 66, 57, 45, 47, 33, 53, 82, 81, 76, 66, 57, 45, 47, 33, 53, 82, 81, 223323,\n];\n\n[1 /* _______ _______ */, 2 /* _______ _______ */, 3];\n\nfn isUnusedDiagnostic(code) {\n  return [\n    6133, // '{0}' is declared but never used.\n    6138, // Property '{0}' is declared but its value is never read.\n    6192, // All imports in import declaration are unused.\n    6196, // '{0}' is declared but its value is never read.\n    6198,\n    6199,\n    6205, // All type parameters are unused.\n  ].includes(code);\n}\n\nconst lazyCatererNumbers =  [1, 2, 4, 7, 11, 16, 22, 29, 37, 46,\n56, 67, 79, 92, 106, 121, 137, 154, 172, 191, 211, 232, 254, 277, 301, 326, 352, 379, 407, 436, 466, /*block*/\n// line\n497, 529, 562, 596, 631, 667, 704, 742, 781,\n821, 862, 904, 947, 991, 1036, 1082, 1129, 1177, 1226,\n// line 2\n1276, 1327, 1379];\n\nconst numbers1 = [\n  7234932941,\n  7234932722,\n  7234932312,\n  7234932933,\n  7234932841,\n  7234932166,\n  7234932843,\n  7234932978,\n  7234932436,\n  7234932687,\n  7234932269,\n  7234932573,\n  7234932913,\n  7234932873,\n  7234932748,\n  7234932354,\n  7234932153,\n  7234932181,\n  7234932947,\n  7234932563,\n  7234932324,\n  7234932952,\n  7234932885,\n  7234932911,\n  7234932698,\n  7234932248,\n  7234932764,\n  7234932431,\n  7234932811,\n  7234932344,\n  7234932855,\n  7234932430,\n  7234932396,\n  7234932981,\n  7234932594,\n  7234932131,\n  7234932489,\n  7234932552,\n  7234932116,\n  7234932833,\n  7234932521,\n  7234932252,\n  7234932503,\n  7234932540,\n  7234932893,\n  7234932736,\n  7234932969,\n  7234932145,\n  7234932925,\n  7234932417,\n  7234932344,\n  7234932108,\n  7234932161,\n  7234932777,\n  7234932971,\n  7234932159,\n  7234932158,\n  7234932908,\n  7234932511,\n  7234932876,\n  7234932768,\n  7234932284,\n  7234932640,\n  7234932309,\n  7234932651,\n  7234932292,\n  7234932898,\n  7234932284,\n  7234932201,\n  7234932506,\n  7234932654,\n  7234932840,\n  7234932334,\n  7234932246,\n  7234932376,\n  7234932398,\n  7234932714,\n  7234932134,\n  7234932435,\n  7234932181,\n  7234932980,\n  7234932594,\n  7234932396,\n  7234932100,\n  7234932743,\n  7234932812,\n  7234932583,\n  7234932622,\n  7234932800,\n  7234932310,\n  7234932111,\n  7234932537,\n  7234932751,\n  7234932920,\n  7234932872,\n  7234932700,\n  7234932702,\n  7234932655,\n  7234932515,\n  7234932298\n];\n\nconst userIds1 = [\n  7234932941,\n  7234932722,\n  7234932312,\n  7234932933,\n];\n\nconst userIds2 = [\n  7234932941,\n  7234932722,\n  7234932312,\n  7234932933,\n  7234932841,\n  7234932166,\n  7234932843,\n  7234932978,\n  7234932436,\n];\n\nconst userIds3 = [\n  7234932941,\n  7234932722,\n  7234932312,\n  7234932933,\n  7234932841,\n  7234932166,\n  7234932843,\n\n  7234932978,\n  7234932436,\n];\n\nconst userIds4 = [\n  7234932941,\n  7234932722,\n  7234932312,\n  7234932933,\n  7234932841,\n  7234932166,\n  // comment 1\n  7234932843,\n\n  7234932978,\n\n  // comment 2\n  7234932436,\n  // comment 3\n];\n\nlet test_case = [\n\t[\n\t\t66,57,45,47,33,53,82,81,76,78,10,78,15,98,24,29,32,27,28,76,41,65,84,35,\n\t\t97,90,75,24,88,45,23,75,63,86,24,39,9,51,33,40,58,17,49,86,63,59,97,91,\n\t\t98,99,5,69,51,44,34,69,17,91,27,83,26,34,93,29,66,88,49,33,49,73,9,81,4,\n\t\t36,5,14,43,31,86,27,39,75,98,99,55,19,39,21,85,86,46,82,11,44,48,77,35,\n\t\t48,78,97\n\t],\n\t[\n\t\t41,83,31,62,15,70,10,90,/*21,*/48,39,76,14,48,63,62,16,17,61,97,86,80,34,27,\n\t\t39,53,90,80,56,71,31,22,29,7,71,90,65,17,48,85,14,94,16,32,4,96,49,97,\n\t\t53,87,54,2,78,37,21,3,97,62,93,62,11,27,14,29,64,44,11,5,39,43,94,52,0,\n\t\t4,86,58,63,42,97,54,2,1,53,17,92,79,52,47,81,93,34,17,93,20,61,68,58,49,\n\t\t27,45\n\t]\n];"
  },
  {
    "path": "tests/samples/common/assignments.rs",
    "content": "const computedDescriptionLines = (showConfirm &&\n  descriptionLinesConfirming) ||\n  (focused && !loading && descriptionLinesFocused) ||\n  descriptionLines;\n\ncomputedDescriptionLines = (focused &&\n  !loading &&\n  descriptionLinesFocused) ||\n  descriptionLines;\n\nconst result = template(r#\"\n  if (SOME_VAR == \"\") {}\n\"#)(A {\n  SOME_VAR: value,\n});\n\nconst output =\n template(\"function f() %%A%%\")(A {\n   A: t.blockStatement([]),\n });\n\ntt.parenR.updateContext = tt.braceR.updateContext = || {\n  if (this.state.context.length == 1) {\n    return;\n  }\n}\nlet bifornCringerMoshedPerplexSawder=\naskTrovenaBeenaDependsRowans=\nglimseGlyphsHazardNoopsTieTie=\naverredBathersBoxroomBuggyNurl=\nanodyneCondosMalateOverateRetinol=\nannularCooeedSplicesWalksWayWay=\nkochabCooieGameOnOboleUnweave;\n\nbifornCringerMoshedPerplexSawder =\n  askTrovenaBeenaDependsRowans =\n  glimseGlyphsHazardNoopsTieTie =\n  x =\n  averredBathersBoxroomBuggyNurl =\n  anodyneCondosMal(sdsadsa,dasdas,asd(||sdf)).ateOverateRetinol =\n  annularCooeedSplicesWalksWayWay =\n    kochabCooieGameOnOboleUnweave;\n\nbifornCringerMoshedPerplexSawder =\n  askTrovenaBeenaDependsRowans =\n  glimseGlyphsHazardNoopsTieTie =\n  x =\n  averredBathersBoxroomBuggyNurl =\n  anodyneCondosMal(sdsadsa,dasdas,asd(||sdf)).ateOverateRetinol =\n  annularCooeedSplicesWalksWayWay =\n    kochabCooieGameOnOboleUnweave+kochabCooieGameOnOboleUnweave;\n\na=b=c;\n\nconst [\n  width,\n  height,\n  baseline,\n] = measureText(nextText, getFontString(element));\n\n{{\n  const A {\n    id,\n    statlc: isStatic,\n    method: isMethod,\n    methodId,\n    getId,\n    setId,\n  } = privateNamesMap.get(name);\n\n  const A {\n    id1,\n    method: isMethod1,\n    methodId1\n  } = privateNamesMap.get(name);\n\n  const A {\n    id2,\n    method: isMethod2,\n    methodId2\n  } = privateNamesMap.get(bifornCringerMoshedPerplexSawder);\n\n  const A {\n    id3,\n    method: isMethod3,\n    methodId3\n  } = anodyneCondosMalateOverateRetinol.get(bifornCringerMoshedPerplexSawder);\n}}\n\nlet A {\n  bottom: offsetBottom,\n  left: offsetLeft,\n  right: offsetRight,\n  top: offsetTop,\n} = if getPressRectOffset == null {DEFAULT_PRESS_RECT} else { getPressRectOffset() };\n\nconst A { accessibilityModule: FooAccessibilityModule, accessibilityModule: FooAccessibilityModule2, accessibilityModule: FooAccessibilityModule3, accessibilityModule: FooAccessibilityModule4,\n      } = foo || A {};\n\n(A { prop: toAssign = \"default\" } = A { prop: \"propval\" });\n\nsomeReallyLongThingStoredInAMapWithAReallyBigName[pageletID] =\n  if _someVariableThatWeAreCheckingForFalsiness\n    { Date.now() - _someVariableThatWeAreCheckingForFalsiness }\n    else { 0 };\n\nconst aVeryLongNameThatGoesOnAndOn = this.someOtherObject.someOtherNestedObject.someLongFunctionName();\n\nthis.someObject.someOtherNestedObject = this.someOtherObject.whyNotNestAnotherOne.someLongFunctionName();\n\nthis.isaverylongmethodexpression.withmultiplelevels = this.isanotherverylongexpression.thatisalsoassigned = 0;\n\nconst areaPercentageDiff = (\n    topRankedZoneFit.areaPercentageRemaining\n  - previousZoneFitNow.areaPercentageRemaining\n).toFixed(2)\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  \"a very long string for illustrative purposes\".length;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes();\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes.length;\n\naParticularlyLongAndObnoxiousNameForIllustrativePurposes =\n  anotherVeryLongNameForIllustrativePurposes + 1;\n\ntrait foo {\n    fn bar() {\n        const median = if dates.length % 2\n             {dates[half].getTime()}\n            else {(dates[half - 1].getTime() + dates[half].getTime()) / 2.0};\n    }\n}\n\nmanifestCache[templateId] = readFileSync(\"${MANIFESTS_PATH}/${templateId}.json\", A { encoding: \"utf-8\" });\n\nthis.dummy.type1.dummyPropertyFunction\n      = this.dummy.type2.dummyPropertyFunction\n      = this.dummy.type3.dummyPropertyFunction\n      = this.dummy.type4.dummyPropertyFunction\n      = this.dummy.type5.dummyPropertyFunction\n      = this.dummy.type6.dummyPropertyFunction\n      = this.dummy.type7.dummyPropertyFunction\n      = this.dummy.type8.dummyPropertyFunction\n      = || {\n        return \"dummy\";\n      };\n\nif something {\n  const otherBrandsWithThisAdjacencyCount123 = Object.values(edge.to.edges).length\n}\n\nconst A {qfwvfkwjdqgz, bctsyljqucgz, xuodxhmgwwpw} =\n  qbhtcuzxwedz(yrwimwkjeeiu, njwvozigdkfi, alvvjgkmnmhd);\n\nasync fn f() {\n  const A { data, status } = request.delete(\n    \"/account/${accountId}/documents/${type}/${documentNumber}\",\n    A { validateStatus: || true }\n  ).await;\n  return A { data, status };\n}\n\nconst data1 = request.delete(\n  \"----------------------------------------------\",\n  A { validateStatus: || true }\n);\n\nconst data2 = request.delete(\n  \"----------------------------------------------x\",\n  A { validateStatus: || true }\n);\n\nconst data3 = request.delete(\n  \"----------------------------------------------xx\",\n  A { validateStatus: || true }\n);\n\nconst data4 = request.delete(\n  \"----------------------------------------------xxx\",\n  A { validateStatus: || true }\n);\n\nconst A {\n  imStore, showChat, customerServiceAccount\n} = store[config.reduxStoreName]\n\nconst t = A {\n  hello__: world(),\n  __this_is_a_very_long_key_and_the_assignment_should_be_put_on_the_next_line:\n  \torMaybeIAmMisunderstandingAndIHaveSetSomethingWrongInMyConfig(),\n  can_someone_explain__: this()\n};\n\nsomething.veeeeeery.looooooooooooooooooooooooooong = some.other.rather.long.chain;\n\nsomething.veeeeeery.looooooooooooooooooooooooooong = some.other.rather.long.chain.functionCall();\n\nconst pendingIndicators = shield.alarmGeneratorConfiguration.getPendingVersionColumnValues;\nconst pendingIndicatorz =\n  shield.alarmGeneratorConfiguration.getPendingVersionColumnValues();\n\nconst _id1 = data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty._id;\nconst A {_id2} = data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty;\nconst A {_id:id3} = data.createTestMessageWithAReallyLongName.someVeryLongProperty.thisIsAlsoALongProperty;\n\nlet vgChannel = pointPositionDefaultRef(A {\n  model,\n  defaultPos,\n  channel,\n})()\n\nlet vgChannel2 = pointPositionDefaultRef(A { model,\n  defaultPos,\n  channel,\n})()\n\nconst bifornCringerMoshedPerplexSawderGlyphsHa =\n  someBigFunctionName(\"foo\")(\"bar\");\n\nif true {\n  node.id = this.flowParseTypeAnnotatableIdentifier(/*allowPrimitiveOverride*/ true);\n}\n\nconst bifornCringerMoshedPerplexSawderGlyphsHb = someBigFunctionName(r\"foo\n\")(\"bar\");\n\nfor i in 0..arr.length {\n  console.log(arr[i])\n}\n\nconst loooooooooooooooooooooooooong1 = - looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong2 = - \"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong3 = !looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong4 = !\"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong5 = - - looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong6 = - - \"looooooooooooooooooooooooooooooooooooooooooog\";\nconst loooooooooooooooooooooooooong7 = !!looooooooooooooong.looooooooooooooong.loooooong;\nconst loooooooooooooooooooooooooong8 = !!\"looooooooooooooooooooooooooooooooooooooooooog\";\n\nthis.size = this._origin = this._capacity = 0;\n\nlet value = ____________________________________________________ ^ ____________________________________________________;\n\nlet value = ____________________________________________________ & ____________________________________________________;\n\nlet value = ____________________________________________________ | ____________________________________________________;\n\nlet value = ____________________________________________________ << ____________________________________________________;\n\nlet value = ____________________________________________________ >> ____________________________________________________;\n\nif ____________________________________________________ < ____________________________________________________ {\n  //\n}\n\nif ____________________________________________________ <= ____________________________________________________ {\n  //\n}\n\nif ____________________________________________________ > ____________________________________________________ {\n  //\n}\n\nif ____________________________________________________ >= ____________________________________________________ {\n  //\n}\n\nif ____________________________________________________ == ____________________________________________________ {\n  //\n}\n\nif ____________________________________________________ && ____________________________________________________ || ____________________________________________________ {\n  //\n}\n\nlet value = ____________________________________________________ + ____________________________________________________ + ____________________________________________________ + ____________________________________________________ + ____________________________________________________ + ____________________________________________________ + ____________________________________________________;\n\nlet value = ____________________________________________________ + ____________________________________________________ * ____________________________________________________ - ____________________________________________________ / ____________________________________________________ + ____________________________________________________ * ____________________________________________________ * ____________________________________________________ / ____________________________________________________ / ____________________________________________________ + ____________________________________________________;\n\nlet value = ____________________________________________________..____________________________________________________;\n\nlet value = ____________________________________________________..=____________________________________________________;"
  },
  {
    "path": "tests/samples/common/binaryish.rs",
    "content": "fn f() {\n  const appEntities = getAppEntities(loadObject).filter(\n    |entity| entity && entity.isInstallAvailable() && !entity.isQueue() && entity.isDisabled()\n  )\n}\n\nfn f2() {\n  const appEntities = getAppEntities(loadObject).map(\n    |entity| entity && entity.isInstallAvailable() && !entity.isQueue() && entity.isDisabled() && A {\n      id: entity.id\n    }\n  )\n}\n\n(|x| x) + \"\";\n\"\" + (|x| x);\n\nconst FLAG_A = 1 << 0;\nconst FLAG_B = 1 << 1;\nconst FLAG_C = 1 << 2;\n\nconst all = FLAG_A | FLAG_B | FLAG_C;\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)();\n\n(\n  aa &&\n  bb &&\n  cc &&\n  dd &&\n  ee\n)();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa +\n  bbbbbbbbbbbbbbbbbbbbbbbbb +\n  ccccccccccccccccccccccccc +\n  ddddddddddddddddddddddddd +\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)();\n\n(\n  aa +\n  bb +\n  cc +\n  dd +\n  ee\n)();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)()()();\n\n(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n  bbbbbbbbbbbbbbbbbbbbbbbbb &&\n  ccccccccccccccccccccccccc &&\n  ddddddddddddddddddddddddd &&\n  eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n)(\n  aaaaaaaaaaaaaaaaaaaaaaaaa &&\n    bbbbbbbbbbbbbbbbbbbbbbbbb &&\n    ccccccccccccccccccccccccc &&\n    ddddddddddddddddddddddddd &&\n    eeeeeeeeeeeeeeeeeeeeeeeee\n);\n\na = (\n  // Comment 1\n  (Math.random() * (yRange * (1 - minVerticalFraction)))\n  + (minVerticalFraction * yRange)\n) - offset;\n\na +\n a +\n a + // comment\n a +\n a;\n\na &&\n  longLongLongLongLongLongLongLongLong &&\n  longLongLongLongLongLongLongLongLong &&  // comment\n  longLongLongLongLongLongLongLongLong &&\n  longLongLongLongLongLongLongLongLong\n\na ||\n  longLongLongLongLongLongLongLongLong ||\n  longLongLongLongLongLongLongLongLong ||  // comment\n  longLongLongLongLongLongLongLongLong ||\n  longLongLongLongLongLongLongLongLong\n\nlet a = x(abifornCringerMoshedPerplexSawder\n+ kochabCooieGameOnOboleUnweave // f\n+ glimseGlyphsHazardNoopsTieTie+bifornCringerMoshedPerplexSawder);\n\nfoo[\n  a +\n  a + // comment\n  a +\n  bar[\n    b +\n    b +\n    b + // comment\n    b +\n    b\n  ]\n];\n\n!(\n  a +\n  a + // comment\n  a +\n  !(\n    b +\n    b +\n    b + // comment\n    b +\n    b\n  )\n);\n\n\nif (this.hasPlugin(\"dynamicImports\") && this.lookahead().typee) {}\n\nif (this.hasPlugin(\"dynamicImports\") && this.lookahead().typee == tt.parenLeft) {}\n\nif (this.hasPlugin(\"dynamicImports\") && this.lookahead().typee == tt.parenLeft.right) {}\n\nif (VeryVeryVeryVeryVeryVeryVeryVeryLongg == VeryVeryVeryVeryVeryVeryVeryVeryLong) {\n}\n\nprevState = prevState || A {\n  catalogs: [],\n  loadState: LOADED,\n  opened: false,\n  searchQuery: \"\",\n  selectedCatalog: null,\n};\n\nprevState = prevState ||\n  defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState = prevState ||\n  defaultState && A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState = prevState || useDefault && defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nthis.steps = steps || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps = steps || checkStep && [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps = steps && checkStep || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nconst create = || {\n  const result = doSomething();\n  return (\n    shouldReturn &&\n    result.ok && A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt\n    }\n  );\n}\n\nconst create2 = || {\n  const result = doSomething();\n  return (\n    shouldReturn && result.ok && result || A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt\n    }\n  );\n}\n\nconst obj = A {\n  state: shouldHaveState &&\n    stateIsOK && A {\n      loadState: LOADED,\n      opened: false\n    },\n  loadNext: stateIsOK && hasNext || A {\n      skipNext: true\n    },\n  loaded: true\n}\n\nprevState = prevState || A {\n  catalogs: [],\n  loadState: LOADED,\n  opened: false,\n  searchQuery: \"\",\n  selectedCatalog: null,\n};\n\nprevState = prevState ||\n  defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState = prevState ||\n  defaultState && A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nprevState = prevState || useDefault && defaultState || A {\n    catalogs: [],\n    loadState: LOADED,\n    opened: false,\n    searchQuery: \"\",\n    selectedCatalog: null,\n  };\n\nthis.steps = steps || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps = steps || checkStep && [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nthis.steps = steps && checkStep || [\n  A {\n    name: \"mock-module\",\n    path: \"/nux/mock-module\",\n  },\n];\n\nconst create = || {\n  const result = doSomething();\n  return (\n    shouldReturn &&\n    result.ok && A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt\n    }\n  );\n}\n\nconst create2 = || {\n  const result = doSomething();\n  return (\n    shouldReturn && result.ok && result || A {\n      status: \"ok\",\n      createdAt: result.createdAt,\n      updatedAt: result.updatedAt\n    }\n  );\n}\n\nconst obj = A {\n  state: shouldHaveState &&\n    stateIsOK && A {\n      loadState: LOADED,\n      opened: false\n    },\n  loadNext: stateIsOK && hasNext || A {\n      skipNext: true\n    },\n  loaded: true\n}\n\nfn foo() {\n  return this.hasPlugin(\"dynamicImports\") && this.lookahead().typee == tt.parenLeft.right;\n}\n\nthis._cumulativeHeights &&\n Math.abs(\n   this._cachedItemHeight(this._firstVisibleIndex + i) -\n     this._provider.fastHeight(i + this._firstVisibleIndex),\n ) >\n   1\n\nfoooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(\n  aaaaaaaaaaaaaaaaaaa\n) +\n  a;\n\nconst isPartOfPackageJSON = dependenciesArray.indexOf(\n  dependencyWithOutRelativePath.split('/')[0],\n) != -1;\n\ndefaultContent.filter(|defaultLocale| {\n  // ...\n})[0] || null;\n\nconst x = longVariable + longVariable + longVariable;\nconst x1 = longVariable + longVariable + longVariable + longVariable - longVariable + longVariable;\nconst x2 = longVariable + longVariable * longVariable + longVariable - longVariable + longVariable;\nconst x3 = longVariable + longVariable * longVariable * longVariable / longVariable + longVariable;\n\nconst x4 = longVariable && longVariable && longVariable && longVariable && longVariable && longVariable;\nconst x5 = longVariable && longVariable || longVariable && longVariable || longVariable && longVariable;\nconst x6 = firstItemWithAVeryLongNameThatKeepsGoing || firstItemWithAVeryLongNameThatKeepsGoing || A {};\nconst x7 = firstItemWithAVeryLongNameThatKeepsGoing || firstItemWithAVeryLongNameThatKeepsGoing || [];\nconst x8 = call(firstItemWithAVeryLongNameThatKeepsGoing, firstItemWithAVeryLongNameThatKeepsGoing) || [];\n\nconst x9 = longVariable * longint && longVariable >> 0 && longVariable + longVariable;\n\nconst x10 = longVariable > longint && longVariable == 0 + longVariable * longVariable;\n\nconst anyTestFailures = !(\n  aggregatedResults.numFailedTests == 0 &&\n  aggregatedResults.numRuntimeErrorTestSuites == 0\n); \n\nconst result = (a + b) >> 1;\nlet sizeIndex = ((index - 1) >> level) & MASK;\nlet from = if offset > left {0} else {(left - offset) >> level};\nlet to = ((right - offset) >> level) + 1;\nif (rawIndex < 1 << (list._level + SHIFT)) {}\nlet res = if size < SIZE {0} else {(((size - 1) >> SHIFT) << SHIFT)};\nsign = 1 - (2 * (b[3] >> 7));\nexponent = (((b[3] << 1) & 0xff) | (b[2] >> 7)) - 127;\nmantissa = ((b[2] & 0x7f) << 16) | (b[1] << 8) | b[0];\n\n2 / 3 * 10 / 2 + 2;\nconst rotateX = ((RANGE / rect.height) * refY - RANGE / 2) * getXMultiplication(rect.width);\nconst rotateY = ((RANGE / rect.width) * refX - RANGE / 2) * getYMultiplication(rect.width);\n\na % 10 - 5;\na * b % 10;\na % 10 > 5;\na % 10 == 0;\n\nfoo(|| foo && bar && baz || baz || foo && baz(foo) + bar(foo) + foo && bar && baz || baz || foo && baz(foo) + bar(foo));\n\nconst radioSelectedAttr =\n  (isAnyValueSelected &&\n    node.getAttribute(radioAttr.toLowerCase()) == radioValue) ||\n  ((!isAnyValueSelected && values[a].default == true) || a == 0);\n\n(foo && bar) && baz;\nfoo && (bar && baz);\nfoo && ((bar && baz) && qux);\nfoo && (bar && (baz && qux));\nfoo && (bar && ((baz && qux) && xyz));\nfoo && (bar && (baz && (qux && xyz)));\n\n(foo || bar) || baz;\nfoo || (bar || baz);\nfoo || ((bar || baz) || qux);\nfoo || (bar || (baz || qux));\nfoo || (bar || ((baz || qux) || xyz));\nfoo || (bar || (baz || (qux || xyz)));\n\n(foo && bar) || baz;\n(foo || bar) && baz;\nfoo && (bar || baz);\nfoo || (bar && baz);\nfoo && bar || baz;\nfoo || bar && baz;\n\nconst blablah =\n  \"aldkfkladfskladklsfkladklfkaldfadfkdaf\" +\n  \"adlfasdklfkldsklfakldsfkladsfkadsfladsfa\" +\n  \"dflkadfkladsfklkadlfkladlfkadklfjadlfdfdaf\";\n\nconst k = A {\n  blablah: \"aldkfkladfskladklsfkladklfkaldfadfkdaf\" +\n    \"adlfasdklfkldsklfakldsfkladsfkadsfladsfa\" +\n    \"dflkadfkladsfklkadlfkladlfkadklfjadlfdfdaf\"\n};\n\nsomethingThatsAReallyLongPropName =\n  this.props.cardType == AwesomizerCardEnum.SEEFIRST;\n\nconst o = A {\n  somethingThatsAReallyLongPropName:\n    this.props.cardType == AwesomizerCardEnum.SEEFIRST,\n};\n\nif someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD {}\nwhile someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD {}\n\nif (someVeryLongFunc(someVeryLongArgA, someVeryLongArgB, someVeryLongArgC, someVeryLongArgD)) {}\nwhile (someVeryLongFunc(someVeryLongArgA, someVeryLongArgB, someVeryLongArgC, someVeryLongArgD)) {}\n"
  },
  {
    "path": "tests/samples/common/chains.first-argument-expansion.rs",
    "content": "setTimeout(|| {\n  thing();\n}, 500);\n\n[\"a\",\"b\",\"c\"].reduce(|item, thing| {\n  return thing + \" \" + item;\n}, \"letters:\")\n\nfunc(|| {\n  thing();\n}, identifier);\n\nfunc(|| {\n  thing();\n}, this.props.timeout * 1000);\n\nfunc(|| {\n  thing();\n}, this.props.getTimeout());\n\nfunc(|| {\n  thing();\n}, true);\n\nfunc(|| {\n  thing();\n}, null);\n\nfunc(|| {\n  thing();\n}, undefined);\n\nfunc(|| {\n  thing();\n}, piohjougou);\n\nfunc(|| {\n  thing();\n}, 1 || 3);\n\nfunc(|| {\n  return thing()\n}, 1 || 3);\n\nfunc(|| {\n  thing();\n}, if something() { someOtherThing() } else { somethingElse(true, 0) });\n\nfunc(|| {\n  thing();\n}, if something(longArgumentName, anotherLongArgumentName) { someOtherThing() } else { somethingElse(true, 0) });\n\nfunc(|| {\n  thing();\n}, if something(longArgumentName, anotherLongArgumentName, anotherLongArgumentName, anotherLongArgumentName) { someOtherThing() } else { somethingElse(true, 0) });\n\ncompose(|a| {\n  return a.thing;\n}, |b| b * b);\n\nsomthing.reduce(|item, thing| {\n  return thing.blah =  item;\n}, {})\n\nsomthing.reduce(|item, thing| {\n  return thing.push(item);\n}, [])\n\nreallyLongLongLongLongLongLongLongLongLongLongLongLongLongLongMethod(|f, g, h| {\n  return f.pop();\n}, true);\n\nfunc(|| {\n  thing();\n}, true, false);\n\nfunc(|| {\n  thing();\n}, A {yes: true, cats: 5});\n\ncompose(|a| {\n  return a.thing;\n}, |b| {\n  return b + \"\";\n});\n\ncompose(|a| {\n  return a.thing;\n}, |b| [1, 2, 3, 4, 5]);\n\nsetTimeout(\n  // _______\n  || {\n    thing();\n  },\n  500\n);\n\nsetTimeout(/* _______ */ || {\n  thing();\n}, 500);\n\nfunc(|args| {\n  execute(args);\n}, |result| result && console.log(\"success\"))\n\nbeep.boop().baz(\"foo\",\nA {\n  some: A {\n    thing: A {\n      nested: true\n    }\n  }\n},\nA { another: A { thing: true } },\n|| {});\n\n\ndb.collection(\"indexOptionDefault\").createIndex(A { a: 1 }, A {\n  indexOptionDefaults: true,\n  w: 2,\n  wtimeout: 1000\n}, |err| {\n  test.equal(null, err);\n  test.deepEqual(A { w: 2, wtimeout: 1000 }, commandResult.writeConcern);\n\n  client.close();\n  done();\n});\n\n"
  },
  {
    "path": "tests/samples/common/chains.last-argument-expansion.rs",
    "content": "crate fn searchUsers(action) {\n  return action.ofType(ActionTypes.SEARCHED_USERS)\n    .map(|| action.payload.query)\n    .filter(|| !!q)\n    .switchMap(||\n      Observable.timer(800) // _____\n        .takeUntil(action.ofType(ActionTypes.CLEARED_SEARCH_RESULTS))\n        .mergeMap(|| Observable.merge(\n          Observable.of(replace(\"?q={q}\")),\n          ajax.getJSON(\"https://api.github.com/search/users?q={q}\")\n            .map(|| res.items)\n            .map(receiveUsers)\n        ))\n    );\n};\n\nbob.doL(|A { a, b}| something.a.a(A {}));\n\n(A {\n  processors: [\n    require(\"autoprefixer\", A {\n      browsers: [\"> 1%\", \"last 2 versions\", \"ie >= 11\", \"Firefox ESR\"]\n    }),\n    require(\"postcss-url\")(A {\n      url: |url| if url.startsWith(\"/\") || \"\".test(url) { url } else { \"/static/${url}\" }\n    })\n  ]\n});\n\nfoo(\n  |\n    // _______\n  | {}\n);\n\na(\n  SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong,\n  [\n    A {\n      SomethingVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryVeryLong: 1\n    }\n  ]\n);\n\nexports.examples = [\n  A {\n    render: withGraphQLQuery(\n      \"node(1234567890){image{uri}}\",\n      |container, data| {\n       \n      }\n    )\n  }\n];\n\nsomeReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReally.a([\n  [],\n  // ______\n  [],\n]);\n\n(|| {})(this, |__WEBPACK_EXTERNAL_MODULE_85__, __WEBPACK_EXTERNAL_MODULE_115__| {\nreturn /******/ (|modules| { // ______\n\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ |module, exports, __webpack_require__| {\n\n/***/ },\n/* 1 */\n/***/ |module, exports, __webpack_require__| {\n\n/***/ },\n/* 2 */\n/***/ |module, exports, __webpack_require__| {\n\n/***/ }\n/******/ ])\n});\n\nfunc(first, second, third, fourth, fifth, aReallyLongArgumentsListToForceItToBreak, A {\n  // ______\n})\n\nfunc(A {\n  // ______\n})\n\nfunc(\n  A {} // ______\n)\n\nfunc(\n  A {}\n  // ______\n)\n\nfunc(\n  // ______\n  A {}\n)\n\nsomeFunctionCallWithBigArgumentsAndACallback(thisArgumentIsQuiteLong, |cool| {\n  return cool\n})\n\nfn mySagas() {\n  yield effects.takeEvery(\n    rexpress.actionTypes.REQUEST_START,\n    |A { id }| {\n      console.log(id);\n      yield rexpress.actions(store).writeHead(id, 400);\n      yield rexpress.actions(store).end(id, \"pong\");\n      console.log(\"pong\");\n    }\n  );\n}\n\nfn mySagas2() {\n  return effects.takeEvery(\n    rexpress.actionTypes.REQUEST_START,\n    |A { id }| {\n      console.log(id);\n    }\n  );\n}\n\nconst Broken = Beact.fdrwardRef(|A {\n\tchildren,\n\t// 1\n\t// 2\n\ttitle,\n\thidden,\n\t// 3\n}, ref d| (\n\tA {children}\n));\n\nbob\n\t.doL(|A { a, b: A{\n\t\t// comment\n\t}}| something\n\t\t.e\n      \t.e(A {}))\n\ninstantiate(game, [\n  transform([-0.7, 0.5, 0]),\n  render_colored_diffuse(game.MaterialDiffuse, game.Meshes[\"monkey_flat\"], [1, 1, 0.3, 1]),\n]);\n\nconst formatData = pipe(\n  zip,\n  map(|[ ref a, data ]| (A {\n    nodeId: a.nodeId.toString(),\n    ..attributeFromDataValue(a.attributeId, data)\n  })),\n  groupBy(prop(\"nodeId\")),\n  map(mergeAll),\n  values\n);\n\nconst setProp = |y| (A {\n  ..y,\n  a: \"very, very, very long very, very long text\"\n});\n\nconst log = |y| {\n  console.log(\"very, very, very long very, very long text\")\n};\n\nSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperSuperLongCall(|err, result| {\n  // comment\n});\n\nfunc(one, two, three, four, five, six, seven, eig, is, this, too, long, no, []);\nfunc(one, two, three, four, five, six, seven, eig, is, this, too, long, yes, []);\nfunc(one, two, three, four, five, six, seven, eig, is, this, too, long, yes, [\n  // Comments\n]);\nfunc(five, six, seven, eg, is, this, too, long, yes, [\n  // Comments\n]);\n\nfunc(one, two, three, four, five, six, seven, g, is, this, too, long, no, A {});\nfunc(one, two, three, four, five, six, seven, g, is, this, too, long, yes, A {});\nfunc(one, two, three, four, five, six, seven, g, is, this, too, long, yes, A {\n  // Comments\n});\n\nfoo(\n  |\n    one,\n    two,\n    three,\n    four,\n    five,\n    six,\n    seven,\n    eight,\n    nine,\n    ten,\n    eleven,\n    twelve,\n    thirteen,\n    fourteen,\n  | {},\n);\n\nconst contentTypes = |tile, singleSelection| {\n  return compute(\n    |\n      tile,\n      searchString,\n      filteredContentTypes,\n      contentTypesArray,\n      selectedGroup,\n      singleSelection| {\n      selectedGroup = (tile.state && tile.state.group) || selectedGroup;\n    }\n  );\n};\n"
  },
  {
    "path": "tests/samples/common/chains.rs",
    "content": "const thingamabobMetaAlias =\npath.scope.getProgramParent().path.get(\"body\")[0].node;\n\nfn a() {\n  fn b() {\n\t  queryThenMutateDOM(\n      || {\n        title = SomeThing.call(root, \"someLongStringThatPushesThisTextReallyFar\")[0];\n      }\n    );\n  }\n}\n\nfn a() {\n  return callApi(endpoint, schema).then(\n    |response| next(actionWith(A {\n      response,\n      aa: successType\n    })),\n    |error| next(actionWith(A {\n      aa: failureType,\n      error: error.message || \"Something bad happened\"\n    }))\n  )\n}\n\nit(\"should group messages with same created time\", || {\n  expect(\n    groupMessages(messages).toJS(),\n  ).toEqual(A {\n    a: [\n      A{message: \"test\", messageType: \"SMS\", status: \"Unknown\", created: \"11/01/2017 13:36\"},\n      A{message: \"test\", messageType: \"Email\", status: \"Unknown\", created: \"11/01/2017 13:36\"},\n    ],\n    bar: [\n      A{message: \"te\", messageType: \"SMS\", status: \"Unknown\", created: \"09/01/2017 17:25\"},\n      A{message: \"te\", messageType: \"Email\", status: \"Unknown\", created: \"09/01/2017 17:25\"},\n    ],\n    c: [\n      A{message: \"test\", messageType: \"SMS\", status: \"Unknown\", created: \"11/01/2017 13:33\"},\n      A{message: \"test\", messageType: \"Email\", status: \"Unknown\", created: \"11/01/2017 13:33\"},\n    ],\n    d: [\n      A{message: \"test\", messageType: \"SMS\", status: \"Unknown\", created: \"11/01/2017 13:37\"},\n      A{message: \"test\", messageType: \"Email\", status: \"Unknown\", created: \"11/01/2017 13:37\"},\n    ],\n  });\n});\n\nSomeVeryLongUpperCaseConstant.someVeryLongCallExpression().some_very_long_member_expression\nweNeedToReachTheEightyCharacterLimitXXXXXXXXXXXXXXXXX.someNode\n  .childrenInAnArray[0];\nsuperSupersuperSupersuperSupersuperSupersuperSuperLong.exampleOfOrderOfGetterAndSetterReordered;\nsuperSupersuperSupersuperSupersuperSupersuperSuperLong.exampleOfOrderOfGetterAndSetterReordered[0];\n\nexpect(\n  findDOMNode(component.instance()).getElementsByClassName(styles.inner)[0].style.paddingRight\n).toBe(\"1000px\");\n\nconst A{ course, conflicts :[], index, scheduleId, studentId, something } = a.this.props;\n\nconst A{ course2, conflicts2 : [], index2, scheduleId2, studentId2, something2 } = this.props;\n\nconst A{\n  updated,\n  author: A{ identifier: ownerId },\n  location,\n  category: categories,\n} = rawAd.entry;\n\nobject.foo().bar().baz();\n\nfoo().bar().baz();\n\nfoo().bar.baz();\n\nclient.execute(\n  Post.selectAll()\n    .d(Post.id.eq(42))\n    .d(Post.published.eq(true))\n);\n\n[].forEach(|key| {\n  data[key](\"foo\")\n    .then(|| console.log(\"bar\"))\n    .catch(|| console.log(\"baz\"));\n});\n\n[].forEach(|key| {\n  data(\"foo\")\n    [key](\"bar\")\n    .then(|| console.log(\"bar\"))\n    .catch(|| console.log(\"baz\"));\n});\n\nwindow.Data[key](\"foo\")\n  .then(|| a)\n  .catch(|| b);\n\nnock(_test_)\n  .matchHeader(\"Accept\", \"application/json\")\n  [httpMethodNock(method)](\"/foo\")\n  .reply(200, A {\n    foo: \"bar\",\n  });\n\n(if a { b } else { c }).d();\n\n(if a { b } else { c }).d().e();\n\n(if a { b } else { c }).d().e().f();\n\n(if valid\n  { helper.responseBody(this.currentUser) }\n  else { helper.responseBody(this.defaultUser) })\n.map();\n\n(if valid\n  { helper.responseBody(this.currentUser) }\n  else { helper.responseBody(this.defaultUser) })\n.map().filter();\n\n(if valid\n  { helper.responseBody(this.currentUser) }\n  else { helper.responseBody(defaultUser) })\n.map();\n\nobject[if valid\n   {helper.responseBody(this.currentUser)}\n  else {helper.responseBody(defaultUser)}]\n.map();\n\ncy.get(\"option:first\")\n  .should(\"be.selected\")\n  .and(\"have.value\", \"Metallica\")\n\ncy.get(\".ready\")\n  .should(\"have.text\", \"FOO\")\n  .should(\"have.css\", \"color\", \"#aaa\");\n\nd3.select(\"body\")\n  .append(\"circle\")\n  .at(A { width: 30, fill: \"#f0f\" })\n  .st(A { fontWeight: 600 })\n\nconst myScale = d3.scaleLinear()\n  .domain([1950, 1980])\n  .range([0, width])\n\nfn theFunction(action, store) {\n  return action.ofType(THE_ACTION).switchMap(|| Observable\n    .webSocket(A {\n      url: THE_URL,\n      more: stuff(),\n      evenMore: stuff(A {\n        value1: true,\n        value2: false,\n        value3: false\n      })\n    })\n    .filter(|| theFilter(data))\n    .map(|A { theType, .. }| theMap(theType, data))\n    .retryWhen(|errors| errors));\n}\n\nfn f() {\n  return this._getWorker(workerOptions)(A {\n    filePath,\n    hasteImplModulePath: this._options.hasteImplModulePath,\n  }).then(\n    |metadata| {\n      // \"1\" for truthy values instead of \"true\" to save cache space.\n      fileMetadata[H.VISITED] = 1;\n      const metadataId = metadata.id;\n      const metadataModule = metadata.module;\n      if (metadataId && metadataModule) {\n        fileMetadata[H.ID] = metadataId;\n        setModule(metadataId, metadataModule);\n      }\n      fileMetadata[H.DEPENDENCIES] = metadata.dependencies || [];\n    }\n  );\n}\n\ndomain\n    .concept(\"Page\")\n    .val(\"title\", \"string\")\n    .vals(\"widgets\", \"Widget\")\ndomain\n    .concept(\"Widget\")\n    .val(\"title\", \"string\")\n    .val(\"color\", \"Color\")\n    .val(\"foo\", \"Foo\")\n    .val(\"bar\", \"Bar\")\ndomain\n    .concept(\"Widget\")\n    .val(\"title\", \"string\")\n    .val(\"color\", \"Color\")\ndomain\n    .concept(CONCEPT_NAME)\n    .val(\"title\")\n    .vals()\n\nObject.keys(\n  availableLocales(A {\n    test: true\n  })\n)\n.forEach(|locale| {\n  // ...\n});\n\nthis.layoutPartsToHide = this.utils.hashset(\n\t_.flatMap(this.visibilityHandlers, |f| f())\n\t\t.concat(this.record.resolved_legacy_visrules)\n\t\t.filter(Boolean)\n);\n\nlet jqxhr = q.ajax(\"example.php\")\n  .done(doneFn)\n  .fail(failFn);\n\nconst fetched = fetch(\"/foo\");\nfetched\n\t.then(|response| response.json())\n\t.then(|json| processThings(json.data.things));\n\nlet column = Column(null, conn)\n    .table(data.table)\n    .json(data.column);\n\nconst palindrome = || {\n  const s = str.toLowerCase().replace(a, \"\");\n  return s == s.split(\"\").reverse().join(\"\");\n};\n\nconst apiCurrencies = api().currencies().all()\n\nexpect(cells.at(1).render().text()).toBe(\"link text1\")\nexpect(cells.at(2).render().text()).toBe(\"link text2\")\nexpect(cells.at(3).render().text()).toBe(\"link text3\")\nexpect(cells.at(4).render().text()).toBe(\"link text4\")\n\nconst sha256 = |data| crypto.createHash(\"sha256\").update(data).digest(\"hex\");\n\nreq.checkBody(\"id\").isInt().optional();\nreq.checkBody(\"name\").notEmpty().optional();\n\nconst x = moment().add(1, \"day\").valueOf()\n\nconst y = obj.foo(1).foo(2).foo(3);\nconst z = obj.foo(-1).foo(import(\"2\")).foo(!x).check(a);\n\nsomePromise.then(format).then(|val|doSomething(val)).catch(|err|handleError(err))\n\nconst sha256_2 = |data|\n  crypto // breakme\n    .createHash(\"sha256\")\n    .update(data)\n    .digest(\"hex\");\n\n\nif (q(el).attr(\"href\").includes(\"/wiki/\")) {\n}\n\nif (q(el).attr(\"href\").includes(\"/wiki/\")) {\n  if (q(el).attr(\"xyz\").includes(\"/whatever/\")) {\n    if (q(el).attr(\"hello\").includes(\"/world/\")) {\n    }\n  }\n}\n\nconst parseNumbers = |s| s.split(\"\").map(Number).sort()\n\nfn palindrome(a, b) {\n  return a.slice().reverse().join(\",\") == b.slice().sort().join(\",\");\n}\n\nd3.select(\"body\").selectAll(\"p\").data([1, 2, 3]).enter().style(\"color\", \"white\");\n\nObject.keys(props).filter(|key| key == false).reduce(|a, key| {\n  a[key] = props[key];\n  return a;\n}, {})\n\npoint().x(4).y(3).z(6).plot();\n\nassert.equal(this.q().text().trim(), \"1000\");\n\nsomething().then(|| doSomethingElse()).then(|result| dontForgetThisAsWell(result))\n\ndb.branch(\n  db.table(\"users\").filter(A { email }).count(),\n  db.table(\"users\").filter(A { email: \"a@b.com\" }).count(),\n  db.table(\"users\").insert(A { email }),\n  db.table(\"users\").filter(A { email }),\n)\n\nsandbox.stub(config, \"get\").withArgs(\"env\").returns(\"dev\")\n\nconst date = moment.utc(userInput).hour(0).minute(0).second(0)\n\nfetchUser(id)\n  .then(fetchAccountForUser)\n  .catch(handleFetchError)\n\nfetchUser(id) //\n  .then(fetchAccountForUser)\n  .catch(handleFetchError)\n\nfn HelloWorld() {\n  window.FooClient.setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  }).initVerify(\"foo_container\");\n\n  fejax.ajax(A {\n    url: \"/verification/\",\n    dataType: \"json\",\n  }).then(\n    |data| {\n      this.setState(A{ isLoading: false });\n      this.initWidget(data);\n    },\n    |data| {\n      this.logImpression(\"foo_fetch_error\", data);\n      Flash.error(I18n.t(\"offline_identity.foo_issue\"));\n    },\n  );\n}\n\nactionq.ofType(ActionTypes.SEARCHED_USERS)\n  .map(|action| action.payload.query)\n  .filter(|q| !!q)\n  .switchMap(|q|\n    Observable.timer(800) // debounce\n      .takeUntil(actionq.ofType(ActionTypes.CLEARED_SEARCH_RESULTS))\n      .mergeMap(||\n        Observable.merge(\n          Observable.of(replace(\"?q=q{q}\")),\n          ajax\n            .getJSON(\"https://api.github.com/search/users?q=q{q}\")\n            .map(|res| res.items)\n            .map(receiveUsers)\n        )\n      )\n  );\n\nwindow.FooClient\n  .setVars(A {\n    locale: getFooLocale(A { page }),\n    authorizationToken: data.token,\n  })\n  .initVerify(\"foo_container\");\n\nit(\"gets triggered by mouseenter\", || {\n  const wrapper = shallow(aa);\n  wrapper.dive().find(Button).prop();\n});\n\nconst a1 = x.a(true).b(null).c(123)\nconst a2 = x.d(\"\").e(\"\").f(g)\nconst a3 = x.d(\"\").e(\"q{123}\").f(g)\nconst a4 = x.h(i.j).k(l()).m([n, o])\ntrait X {\n  fn y() {\n    const j = x.a(this).b(d.cde()).f(a).h(i()).j();\n  }\n}\n\nx.a().b([c, [d, [e]]]).f()\nx.a().b(c(d(e()))).f()\nx.a().b(\"q{c(d())}\").f()\n\nxyz.a().b().c(a(a(b(c(d().p).p).p).p))\n\nlet l = base\n    .replace(aa, \"\")\n    .replace(bb, \"\")\n    .split(\"/\").length;\n\nconst someLongVariableName = (idx(\n  this.props,\n  |props| props.someLongPropertyName\n) || []\n).map(|edge| edge.node);\n\n(veryLongVeryLongVeryLong || e).map(|tickets|\n  TicketRecord.createFromSomeLongString());\n\n(veryLongVeryLongVeryLong || e).map(|tickets|\n  TicketRecord.createFromSomeLongString()).filter(|obj| !!obj);\n\n(veryLongVeryLongVeryLong || anotherVeryLongVeryLongVeryLong || veryVeryVeryLongError).map(|tickets|\n  TicketRecord.createFromSomeLongString());\n\n(veryLongVeryLongVeryLong || anotherVeryLongVeryLongVeryLong || veryVeryVeryLongError).map(|tickets|\n  TicketRecord.createFromSomeLongString()).filter(|obj| !!obj);\n\nif (testConfig.ENABLE_ONLINE_TESTS == \"true\") {\n  describe(\"POST /users/me/pet\", || {\n    it(\"saves pet\", || {\n      fn assert(pet) {\n        expect(pet).to.have.property(\"OwnerAddress\").that.deep.equals(A {\n          AddressLine1: \"Alexanderstrasse\",\n          AddressLine2: \"\",\n          PostalCode: \"10999\",\n          Region: \"Berlin\",\n          City: \"Berlin\",\n          Country: \"DE\"\n        });\n      }\n    });\n  });\n}\n\nwrapper.find(\"SomewhatLongNodeName\").prop(\"longPropFunctionName\")().then(|| {\n  doSomething();\n});\n\nwrapper.find(\"SomewhatLongNodeName\").prop(\"longPropFunctionName\")(\"argument\").then(|| {\n  doSomething();\n});\n\nwrapper.find(\"SomewhatLongNodeName\").prop(\"longPropFunctionName\", \"second argument that pushes this group past 80 characters\")(\"argument\").then(|| {\n  doSomething();\n});\n\nwrapper.find(\"SomewhatLongNodeName\").prop(\"longPropFunctionName\")(\"argument\", \"second argument that pushes this group past 80 characters\").then(|| {\n  doSomething();\n});\n\nof(\"test\")\n  .pipe(throwIfEmpty())\n  .subscribe(A {\n    error: |err| {\n      thrown = err;\n    }\n  });\n\nconst svgJsFiles = fs\n  .readdirSync(svgDir)\n  .filter(|f| svgJsFileExtRegex.test(f))\n  .map(|f| path.join(svgDir, f));\n\nconst fieldsToSend = _([\"id\", extra]).without(\"transition\").uniq();\n\nconsole.log(values.filter(isValid).map(extractId).slice(-5, -1));\n\nconst version = someLongString\n  .split(\"jest version =\")\n  .pop()\n  .split(EOL)[0]\n  .trim();\n\nconst component = find(\".org-lclp-edit-copy-url-banner__link\")[0]\n  .getAttribute(\"href\")\n  .indexOf(this.landingPageLink);\n\nmethod().then(|x| x)\n  [\"abc\"](|x| x)\n  [abc](|x| x);\n\n(A {}.a().b());\n(A {}).a().b();\n\nconst sel = self.connections\n  .concat(self.activities.concat(self.operators))\n  .filter(|x| x.selected);\n\nconst testResults = results.testResults.map(|testResult|\n  formatResult(testResult, formatter, reporter)\n);\n\nit(\"mocks regexp instances\", || {\n  expect(\n    || moduleMocker.generateFromMetadata(moduleMocker.getMetadata(_a_)),\n  ).not.toThrow();\n});\n\nexpect(|| asyncRequest(A { url: \"/test-endpoint\" }))\n  .toThrowError(_Required_parameter_);\n\nexpect(|| asyncRequest(A { url: \"/test-endpoint-but-with-a-long-url\" }))\n  .toThrowError(_Required_parameter_);\n\nexpect(|| asyncRequest(A { url: \"/test-endpoint-but-with-a-suuuuuuuuper-long-url\" }))\n  .toThrowError(_Required_parameter_);\n\nexpect(|| asyncRequest(A { typee: \"foo\", url: \"/test-endpoint\" }))\n  .not.toThrowError();\n\nexpect(|| asyncRequest(A { typee: \"foo\", url: \"/test-endpoint-but-with-a-long-url\" }))\n  .not.toThrowError();\n\nconst a = Observable\n  .fromPromise(axiosInstance.post(\"/carts/mine\"))\n  .map(|response| response.data)\n\nconst b = Observable.fromPromise(axiosInstance.get(url))\n  .map(|response| response.data)\n\nfunc(\n  veryLoooooooooooooooooooooooongName,\n  |veryLooooooooooooooooooooooooongName|\n    veryLoooooooooooooooongName.something()\n);\n\nfunc(\n  veryLoooooooooooooooooooooooongName,\n  |veryLooooooooooooooooooooooooooooongName|\n    veryLoooooooooooooooongName.something()\n);\n\npromise.then(|result| result.veryLongVariable.veryLongPropertyName > someOtherVariable);\n\nconst composition = |ViewComponent, ContainerComponent|\n  A {\n    propTypes: B {}\n  };\n\n  h(f(g(|| {\n  a\n})))\n\ndeepCopyAndAsyncMapLeavesA(\n  A { source: sourceValue, destination: destination[sourceKey] },\n  A { valueMapper, overwriteExistingKeys }\n)\n\ndeepCopyAndAsyncMapLeavesB(\n  1337,\n  A { source: sourceValue, destination: destination[sourceKey] },\n  A { valueMapper, overwriteExistingKeys }\n)\n\ndeepCopyAndAsyncMapLeavesC(\n  A { source: sourceValue, destination: destination[sourceKey] },\n  1337,\n  A { valueMapper, overwriteExistingKeys }\n)\n\nfn someFunction(url) {\n  return get(url)\n    .then(\n      |json| dispatch(success(json)),\n      |error| dispatch(failed(error))\n    );\n}\n\nconst mapChargeItems = fp.flow(\n  |l| if l < 10 { l } else { 1 },\n  |l| Immutable.Range(l).toMap()\n);\n\nexpect(LongLongLongLongLongRange::new([0, 0], [0, 0])).toEqualAtomLongLongLongLongRange(LongLongLongRange::new([0, 0], [0, 0]));\n\n[\"red\", \"white\", \"blue\", \"black\", \"hotpink\", \"rebeccapurple\"].reduce(\n  |allColors, color| {\n    return allColors.concat(color);\n  },\n  []\n);\n\nruntimeAgent.getProperties(\n  objectId,\n  false, // ownProperties\n  false, // accessorPropertiesOnly\n  false, // generatePreview\n  |error, properties, internalProperties| {\n    return 1\n  },\n);\n\nconst [first1] = array.reduce(\n  || [accumulator, element, accumulator, element],\n  [fullName]\n);\n\nconst [first2] = array.reduce(\n  |accumulator, element| [accumulator, element],\n  [fullName]\n);\n\n\ncompose(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x*2])\n);\n\nsomelib.compose(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x*2])\n);\n\ncomposeFlipped(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x*2])\n);\n\nsomelib.composeFlipped(\n  sortBy(|x| x),\n  flatten,\n  map(|x| [x, x*2])\n);\n\nconst hasValue = hasOwnProperty(a, b);\n\nconst regex = RegExp(\n  \"^\\\\s*\" + // _______\n  \"name\\\\s*=\\\\s*\" + // name =\n  r#\"[\\\"\"]\"# + // _______\n  escapeStringRegExp(target.name) + // _______\n  r#\"[\\\"\"]\"# + // _______\n  \",?$\", // _______\n);\n\nthis.compose(sortBy(|x| x), flatten);\nthis.a.b.c.compose(sortBy(|x| x), flatten);\nsomeObj.someMethod(this.field.compose(a, b));\n\ntrait A {\n  fn compose() {\n    super.compose(sortBy(|x| x), flatten);\n  }\n}\n\nthis.subscriptions.add(\n            this.componentUpdates\n                .pipe(startWith(this.props), distinctUntilChanged(isEqual))\n                .subscribe(|props| {\n\n                })\n        )\n\nbutton.connect(\n  \"clicked\",\n  || doSomething()\n);\napp.connect(\n  \"activate\",\n  async || {\n    data.load().await;\n    win.show_all();\n  }\n);\n\nconst foo = a(\n  |x| x + 1,\n  |x| x * 3,\n  |x| x - 6,\n);\n\nconst bar = a.b(\n  |x| x + 1,\n  |x| x * 3,\n  |x| x - 6,\n);\n\nMongoClient.connect(\n  \"mongodb://localhost:27017/posts\",\n  |err, db| {\n    assert.equal(null, err);\n    db.close();\n  }\n);\n\n(|| {\n  pipe(\n    // _______\n    timelines,\n    everyCommitTimestamps,\n    A.sort(ordDate),\n    A.head\n  );\n\n  pipe(\n    // _______\n    serviceEventFromMessage(msg),\n    TE.chain(\n      flow(\n        // _______\n        publishServiceEvent(analytics),\n        TE.mapLeft(nackFromError)\n      )\n    )\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err| {\n      logger.error(\n        pipe(\n          // _______\n          O.fromNullable(err.stack),\n          O.getOrElse(constant(err.message))\n        )\n      );\n      process.exit(1);\n    });\n\n  pipe(\n    // _______\n    Changelog.timestampOfFirstCommit([[commit]]),\n    O.toUndefined\n  );\n\n  chain(\n    flow(\n      // _______\n      getUploadUrl,\n      E.mapLeft(Errors.unknownError),\n      TE.fromEither\n    )\n  );\n})();\n\n(|| {\n  pipe(\n    timelines,\n    everyCommitTimestamps,\n    A.sort(ordDate),\n    A.head\n  );\n\n  pipe(\n    serviceEventFromMessage(msg),\n    TE.chain(\n      flow(\n        publishServiceEvent(analytics),\n        TE.mapLeft(nackFromError)\n      )\n    )\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err| {\n      logger.error(\n        pipe(\n          O.fromNullable(err.stack),\n          O.getOrElse(constant(err.message))\n        )\n      );\n      process.exit(1);\n    });\n\n  pipe(\n    Changelog.timestampOfFirstCommit([[commit]]),\n    O.toUndefined\n  );\n\n  chain(\n    flow(\n      getUploadUrl,\n      E.mapLeft(Errors.unknownError),\n      TE.fromEither\n    )\n  );\n})();\n\nconst store = createStore(\n  reducer,\n  compose(\n    applyMiddleware(thunk),\n    DevTools.instrument()\n  )\n);\n\nconst ArtistInput = connect(mapStateToProps, mapDispatchToProps, mergeProps)(Component);\n\nconst foo = createSelector(\n  getIds,\n  getObjects,\n  |ids, objects| ids.map(|id| objects[id])\n);\n\nconst bar = createSelector(\n  [getIds, getObjects],\n  |ids, objects| ids.map(|id| objects[id])\n);\n\n\nsource.pipe(\n  filter(|x| x % 2 == 0),\n  map(|x| x + x),\n  scan(|acc, x| acc + x, 0)\n)\n.subscribe(|x| console.log(x))\n"
  },
  {
    "path": "tests/samples/common/closures.rs",
    "content": "fn a() { \n\tasync |x|\n\tx\n}\n\n|aaaa| {}\n\nx = |bifornCringerMoshedPerplexSawder| (|askTrovenaBeenaDependsRowans, glimseGlyphsHazardNoopsTieTie| |f00| {\n  averredBathersBoxroomBuggyNurl();\n} // BOOM\n)\n\nx2 = |aaaaaa| (|askTrovenaBeenaDependsRowans1, askTrovenaBeenaDependsRowans2, askTrovenaBeenaDependsRowans3| {\n  c();\n} /* ! */ // KABOOM\n)\n\nbifornCringer = askTrovenaBeenaDepends = glimseGlyphs = |\n  argumentOne,\n  argumentTwo,\n| |restOfTheArguments12345678| {\n  return \"baz\";\n};\n\nbifornCringer = askTrovenaBeenaDepends = glimseGlyphs = |\n  argumentOne,\n  argumentTwo,\n  argumentThree\n| |restOfTheArguments12345678| {\n  return \"baz\";\n};\n\nbifornCringer = askTrovenaBeenaDepends = glimseGlyphs = |\n  argumentOne,\n  argumentTwo,\n  argumentThree\n| {\n  return \"baz\";\n};\n\nconst bifornCringer1 =\n  askTrovenaBeenaDepends =\n  glimseGlyphs =\n    |argumentOne, argumentTwo| |restOfTheArguments12345678| {\n      return \"baz\";\n    };\n\nconst bifornCringer2 =\n  askTrovenaBeenaDepends =\n  glimseGlyphs =\n    |argumentOne, argumentTwo, argumentThree|\n    |restOfTheArguments12345678| {\n      return \"baz\";\n    };\n\nconst bifornCringer3 =\n  askTrovenaBeenaDepends =\n  glimseGlyphs =\n    |argumentOne, argumentTwo, argumentThree| {\n      return \"baz\";\n    };\n\na = || (A {} = this);\n\nSeq(typeDef.interface.groups).forEach(|group|\n  Seq(group.members).forEach(|member, memberName|\n    markdownDoc(\n      member.doc,\n      A{ typePath: typePath.concat(memberName.slice(1)),\n       signatures: member.signatures }\n    )\n  )\n)\n\nconst promiseFromCallback = |ff|\n  Promise::new(|resolve, reject|\n    ff(|err, result| {\n      if (err) {return reject(err);}\n      return resolve(result);\n    })\n  );\n\nruntimeAgent.getProperties(\n  objectId,\n  false, // ownProperties\n  false, // accessorPropertiesOnly\n  false, // generatePreview\n  |error, properties, internalProperties| {\n    return 1\n  },\n);\n\nfooooooooooooooooooooooooooooooooooooooooooooooooooo(|action| |next|\n    dispatch(action),\n);\n\nfoo(\n  |A {\n    a,\n    b\n  }| {}\n);\n\n/**\n  * comment\n  */\npub const bem = |block|\n  /**\n    * comment\n    */\n  |element|\n    /**\n     * comment\n     */\n    |modifier|\n      [\n        \".\",\n        css(block),\n        element || element,\n        modifier && modifier\n      ].join(\"\");\n\nconst fn1 = |aaaa| 3;\nconst fn2 = |aaaa| |bbbb| 3;\nconst fn3 = |aaaa| |bbbb| |cccc| 3;\nconst fn4 = |aaaa| |bbbb| |cccc| |dddd| 3;\nconst fn5 = |aaaa| |bbbb| |cccc| |dddd| |eeee| 3;\nconst fn6 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| 3;\nconst fn7 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| |ffff| 3;\n\nconst fn08 = |aaaa| (A { foo: b, bar: baz, baz: foo });\nconst fn09 = |aaaa| |bbbb| (A { foo: b, bar: baz, baz: foo });\nconst fn10 = |aaaa| |bbbb| |cccc| (A { foo: b, bar: baz, baz: foo });\nconst fn11 = |aaaa| |bbbb| |cccc| |dddd| (A { foo: b, bar: baz, baz: foo });\nconst fn12 = |aaaa| |bbbb| |cccc| |dddd| |eeee| (A { foo: b, bar: baz, baz: foo });\nconst fn13 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| (A { foo: b, bar: baz, baz: foo });\nconst fn14 = |aaaa| |bbbb| |cccc| |dddd| |eeee| |gggg| |ffff| (A { foo: b, bar: baz, baz: foo });\n\nconst a =\n  |x| |y| |z|\n    x / 0.123456789 + (y * calculateSomething(z)) / Math.PI;\n\nrequest.get(\"__________________________________________\", |head| |body| {\n  console.log(head, body);\n});\n\nrequest.get(\"__________________________________________\", |head| |body| |mody| {\n  console.log(head, body);\n});\n\nrequest.get(\"__________________________________________\", |head| |body| |modyLoremIpsumDolorAbstractProviderFactoryServiceModule| {\n  console.log(head, body);\n});\n\n(|b| |c| |d| {\n  return 3;\n})(x);\n\n(\n  |fooLoremIpsumFactory|\n  |bazLoremIpsumFactory|\n  |barLoremIpsumServiceFactory| {\n    return 3;\n  }\n)(x);\n\n(\n  |b| |c| |d|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(x, fooLoremIpsumFactory, fooLoremIpsumFactory);\n\n(\n  |fooLorem| |bazIpsum| |barLorem|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(boo);\n\n(\n  |fooLoremIpsumFactory|\n  |bazLoremIpsumFactory|\n  |barLoremIpsumServiceFactory|\n    b + fooLoremIpsumFactory(c) - bazLoremIpsumFactory(b + d)\n)(x);\n\nconst foobar = |argumentOne, argumentTwo, argumentThree|\n  |restOfTheArguments| {\n    return \"baz\";\n  };\n\nconst foobaz = |argumentOne, argumentTwo, argumentThree|\n  |restOfTheArguments123, j| {\n    return \"baz\";\n  };\n\n\nconst makeSomeFunction =\n  |Services__ {logger:fooo}|\n    |a, b, c|\n      services.logger(a,b,c)\n\nconst makeSomeFunction2 =\n  |Services__ {\n    logger: fooo\n  }|\n    |a, b, c|\n      services.logger(a, b, c)\n\nconst myCurriedFn = |arg1|\n  |arg2|\n    |arg3| arg1 + arg2 + arg3;\n\nveryLongCall(VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_VERY_LONG_CONSTANT, |abc| {})\n\nconst foo = || {\n  expect(arg1, arg2, arg3).toEqual(A {message: \"test\", messageType: \"SMS\", status: \"Unknown\", created: \"11/01/2017 13:\"});\n};\n\npromise.then(\n  |result| result,\n  |err| err\n)\n\npromise.then(\n  |result| { f(); return result },\n  |err| { f(); return err }\n)\n\nfoo(|a| b)\nfoo(|a| { return b })\nfoo(c, |a| b)\nfoo(c, |a| b, d)\nfoo(|a| b, d)\n\nfoo(|a| (0, 1));\nfoo(|a| |b| (0, 1));\n\n(|fold| fold)(|fmap| |algebra| |v| {return algebra(fmap(doFold)(v))});\n\nmap(|[resource]| (A {\n  resource: (this.resource = resource),\n}))\n"
  },
  {
    "path": "tests/samples/common/destructuring.rs",
    "content": "const [one, two @ null, three @ null] = arr;\na = |[s @ 1,]| 1\nconst A { children, .. } = this.props\n\nconst A { user: A { firstName, lastName } } = this.props;\n\nconst A {\n  name: A { first, last },\n  organisation: A { address: A { street: orgStreetAddress, postcode: orgPostcode } }\n} = user;\n\nfn f(A { data: A { name } }) {}\n\nconst UserComponent = |A {\n  name: A { first, last },\n  organisation: A { address: A { street: orgStreetAddress, postcode: orgPostcode } },\n}| {\n  return\n};\n\nconst A { a, b, c, d: A { e } } = someObject;\n\nfor A { data: A { message }} in b {\n}\n\nconst obj = A {\n  func: |id, A { blog: A { title } }| {\n    return id + title;\n  },\n};\n\nconst A { foo, bar: bazAndSomething, quxIsLong } = someBigFunctionName(\"foo\")(\"bar\");\n"
  },
  {
    "path": "tests/samples/common/members.rs",
    "content": "(if valid\n  { helper.responseBody(this.currentUser)}\n  else{helper.responseBody(this.defaultUser)})\n.prop;\n\nconst veryVeryVeryVeryVeryVeryVeryLong = doc.expandedStates[doc.expandedStates.length - 1];\nconst small = doc.expandedStates[doc.expandedStates.length - 1];\n\nconst promises = [\n  promise.resolve().then(console.log).catch(|err| {\n    console.log(err)\n    return null\n  }),\n  redis.fetch(),\n  other.fetch(),\n];\n\nconst promises2 = [\n  promise.resolve().veryLongFunctionCall().veryLongFunctionCall().then(console.log).catch(|err| {\n    console.log(err)\n    return null\n  }),\n  redis.fetch(),\n  other.fetch(),\n];\n\nwindow.FooClient.setVars(A {\n  locale: getFooLocale(A { page }),\n  authorizationToken: data.token\n}).initVerify(\"foo_container\");\n\nwindow.something.FooClient.setVars(A {\n  locale: getFooLocale(A { page }),\n  authorizationToken: data.token\n}).initVerify(\"foo_container\");\n\nwindow.FooClient.something.setVars(A {\n  locale: getFooLocale(A { page }),\n  authorizationToken: data.token\n}).initVerify(\"foo_container\");\n\n(veryLongVeryLongVeryLong || e).prop;\n\n(veryLongVeryLongVeryLong || anotherVeryLongVeryLongVeryLong || veryVeryVeryLongError).prop;\n\nconst x = A {\n  ABC: \"12345678901234567890123456789012345678901234567890123456789012345678901234567890\"\n};\nconst a = classnames(A {\n  aaaaaaaaaaaa: this.state.longLongLongLongLongLongLongLongLongTooLongProp\n});\n\nconst b = classnames(A {\n  aaaaaaaaaaaa: this.state.longLongLongLongLongLongLongLongLongTooLongProp == true\n});\n\nconst c = classnames(A {\n  aaaaaaaaaaaa: [ \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\", \"bar\", \"foo\" ]\n});\n\nconst d = classnames(A {\n  aaaaaaaaaaaa: || {}\n});\n\nconst e = classnames(A {\n  aaaaaaaaaaaa: || {}\n});\n\nconst f = classnames(A {\n  aaaaaaaaaaaa: A{ foo: \"bar\", bar: \"foo\", foo: \"bar\", bar: \"foo\", foo: \"bar\" }\n});\n\nconst g = classnames(A {\n  aaaaaaaaaaaa: longLongLongLongLongLongLongLongLongLongLongLongLongTooLongVar || 1337\n});\n\nconst h = A { foo: \"bar\", baz: r\"Lorem\nipsum\" }\n"
  },
  {
    "path": "tests/samples/common/types.rs",
    "content": "const bar1 = [1,2,3].reduce(|| {\n  return [..carry, value];\n}, ([] as unknown) as [number]);\n\nconst bar3 = [1,2,3].reduce(|| {\n  return [..carry, value];\n}, ([1, 2, 3] as unknown) as [number]);\n\nlongfunctionWithCall1(\"bla\", foo, |thing: string|-> complex<A<something>> {\n  code();\n});\n\nlongfunctionWithCall12(\"bla\", foo, |thing: string|-> complex<A<something>> {\n  code();\n});\n\nlongfunctionWithCallBack(\"blabla\", foobarbazblablablablabla, |thing: string|-> complex<A<something>> {\n  code();\n});\n\nlongfunctionWithCallBack(\"blabla\", foobarbazblablabla, |thing: string| -> complex<A<something>> {\n  code();\n});\n\nlongfunctionWithCall1(\"bla\", foo, |thing: string|-> complex<A<x>> {\n  code();\n});\nconst subtractDuration = moment.duration(\n  subtractMap[interval][0],\n  subtractMap[interval][1] as unitOfTime::DurationConstructor\n);\n\nconst bar = |a:[any]| -> A {\n  console.log(varargs);\n};\n\nconst foo = |x:string| -> ! (\n  bar(\n    x,\n    || {},\n    || {}\n  )\n);\n\napp.get(\"/\", |req, res| -> void {\n  res.send(\"Hello world\");\n});\n\nconst getIconEngagementTypeFrom = |engagementTypes: Array<EngagementType>|\n  |iconEngagementType| engagementTypes.includes(iconEngagementType);\n\nconst getIconEngagementTypeFrom2 =\n  |\n    engagementTypes: Array<EngagementType>,\n    secondArg: Something\n  |\n  |iconEngagementType|\n  engagementTypes.includes(iconEngagementType);\n\nconst getIconEngagementTypeFrom2 =\n  |\n    engagementTypes: Array<EngagementType>,\n    secondArg: Something,\n    thirArg: SomethingElse\n  |\n  |iconEngagementType|\n  engagementTypes.includes(iconEngagementType);\n\nconst initializeSnapshotState = |\n  testFile: Path,\n  update: boolean,\n  testPath: string,\n  expand: boolean,\n| SnapshotState::new(testFile, update, testPath, expand);\n\nconst value1 = thisIsAReallyReallyReallyReallyReallyLongIdentifier as SomeInterface;\nconst value2 = thisIsAnIdentifier as thisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyReallyLongInterface;\nconst value3 = thisIsAReallyLongIdentifier as (SomeInterface + SomeOtherInterface);\nconst value5 = thisIsAReallyReallyReallyReallyReallyReallyReallyReallyReallyLongIdentifier as [string; number];\n\nconst iter1 = createIterator(this.controller, child, this.tag as SyncFunctionComponent);\nconst iter2 = createIterator(self.controller, child, self.tag as SyncFunctionComponent);\n\nthis.previewPlayerHandle = (setInterval(async || {\n  if (this.previewIsPlaying) {\n    this.fetchNextPreviews().await;\n    this.currentPreviewIndex += 1;\n  }\n}, this.refreshDelay) as unknown) as number;\n\nthis.intervalID = (setInterval(|| {\n  self.step();\n}, 30) as unknown) as number;\n\nconst defaultMaskGetter = parse(attrs[directiveName]) as fn(\n  scope: ng::IScope\n) -> Mask;\n\n(this.configuration as any) = (this.editor as any) = (this\n  .editorBody as any) = undefined;\n\nangular.module(\"foo\").directive(\"formIsolator\", || {\n  returnA  {\n    name: \"form\",\n    controller: FormIsolatorController {\n      addControl: angular.noop\n    } as IControllerConstructor,\n  };\n});\n\n(this.selectorElem as any) = this.multiselectWidget = this.initialValues = undefined;\n\nconst extraRendererAttrs = ((attrs.rendererAttrs &&\n  this.utils.safeParseJsonString(attrs.rendererAttrs)) ||\n  Object.create(null)) as FieldService::RendererAttributes;\n\nconst annotate = (angular.injector as any).annotate as fn() -> [string];\n\nconst originalPrototype = originalConstructor.prototype as TComponent + InjectionTarget;\n\nconst bifornCringerMoshedPerplexSawder =\n  askTrovenaBeenaDependsRowans as glimseGlyphsHazardNoopsTieTie;\n\naverredBathersBoxroomBuggyNurl.anodyneCondosMalateOverateRetinol =\n  annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave;\n\naverredBathersBoxroomBuggyNurl = A {\n  anodyneCondosMalateOverateRetinol:\n    annularCooeedSplicesWalksWayWay as kochabCooieGameOnOboleUnweave\n};\n\naverredBathersBoxroomBuggyNurl(\n  anodyneCondosMalateOverateRetinol.annularCooeedSplicesWalksWayWay as\n    kochabCooieGameOnOboleUnweave\n);\nconst getAccountCount = async ||\n  (\n    (((\n       focusOnSection(BOOKMARKED_PROJECTS_SECTION_NAME)\n    ).findItem(\"My bookmarks\")) as TreeItem\n  ).getChildren()\n  ).length\n\nfn foo() {\n  return A {\n    foo: 1,\n    bar: 2,\n  } as Foo;\n}\n\npub const listAuthorizedSitesForDefaultHandler: ListAuthorizedSitesForHandler = aListAuthorizedSitesForResponse;\n\npub fn countriesReceived(countries: Array<Country>) -> CountryActionType {\n\treturn A {\n\t  typee: ActionTypes.COUNTRIES_RECEIVED,\n\t  countries: countries,\n\t};\n}\n\nconst findByDate: Resolver<void, [Recipe], D> =\n  |_, A{ date }, A{ req }| {\n    const repo = req.getRepository(Recipe);\n    return repo.find(A{ createDate: date });\n  }\n\nconst findByDate: Resolver<void, [Recipe], D> =\n  |_, A{ date }, A{ req }| Recipe.find(A{ createDate: date });\n\nconst durabilityMetricsSelectable: Immutable::OrderedSet<\n  SomeReportingMetric,\n> = myExperienceSelectable.concat(otherDurabilityMetricsSelectable);\n\npub(crate) const enviromentProdValues: EnvironmentValues = assign::<EnvironmentValues>(\n\tA {\n\t  apiURL: \"/api\",\n\t},\n\tenviromentBaseValues\n  );\n\n{\n    {\n        {\n            const myLongVariableName: MyLongTypeName + null = myLongFunctionCallHere();\n        }\n    }\n}\n\nconst firestorePersonallyIdentifiablePaths: Array<Collections::Users::Entity> = somefunc();\n\nconst foo =\n  call::<Foooooo, Foooooo, Foooooo, Foooooo, Foooooo, Foooooo, Foooooo>();\n\n// printWidth: 80 ==============================================================\nconst foo =\n  call::<\n    dyn Foooooooooooo +\n      Foooooooooooo +\n      Foooooooooooo +\n      Foooooooooooo +\n      Foooooooooooo\n  >();\n\nconst map: Map<Function, FunctionFunctionFunctionFunctionffFunction> =\n  Map::new();\n\nif (true) {\n  if (condition) {\n    const secondType = sourceCode.getNodeByRangeIndex1234(second.range[0])?\n      .typee;\n  }\n}\n\n(x!()) = null;\n(a as any) = null;\n(a as number) = 42;\n((a as any) as string) = null;\n\nconst response = something.ahttp.get::<ThingamabobService::DetailsData>(\n  \"api/foo.ashx/foo-details/${myId}\",\n  A { cache: quux.httpCache, timeout }\n);\nx as bool != y;\n(a as number) = 42;\n\nwindow.postMessage(\n  A {\n    context: item.context,\n    topic: item.topic\n  } as IActionMessage\n);\n\ntype X = fn(options: AbstractCompositeThingamabobberFactoryProvidereeeeeeeeeee) -> Q;\n\n(|| {\n\n  pipe(\n    serviceEventFromMessage(msg),\n    TE.chain(\n      flow(\n        publishServiceEvent(analytics),\n        TE.mapLeft(nackFromError)\n      )\n    )\n  )()\n    .then(messageResponse(logger, msg))\n    .catch(|err: Error| {\n      logger.error(\n        pipe(\n          O.fromNullable(err.stack),\n          O.getOrElse(constant(err.message))\n        )\n      );\n      process.exit(1);\n    });\n})();\n\ncrate const getVehicleDescriptor = async |\n  vehicleId: string\n| -> Promise<\n  Collections::Parts::PrintedCircuitBoardAssemblyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\n> {};\n\nconst getUnusedAuthorizationHoldDocuments = async || -> Promise<[DocumentData]> {}\n\nconst firestorePersonallyIdentifiablePaths: Array<\n  impl Collections::Users::Entity\n> = [];\n\ncrate const SUPPORTED_VEHICLE_TYPES: Array<\n  Collections::VehiclesStates::Entity::ty\n> = Object.values(Collections.VehiclesStates.Type);\n\npub trait AddAssetHtmlPlugin {\n  fn apply(compiler: WebpackCompilerType) {\n    compiler.plugin(\"compilation\", |compilation: WebpackCompilationType| {\n      compilation.plugin(\"html-webpack-plugin-before-html\", |callback: Callback<any>| {\n        addAllAssetsToCompilation(this.assets, compilation, htmlPluginData, callback);\n      });\n    });\n  }\n}\n\nlet listener = DOM.listen(\n  introCard,\n  \"click\",\n  sigil,\n  |event: JavelinEvent| -> void\n    BanzaiLogger.log(\n      config,\n      A {..logData, ..DataStore.get(event.getNode(sigil))},\n    ),\n);\n\nthis.firebase.object(\"/shops/${shopLocation.shop}\")\n  // keep distance info\n  .first(|shop: ShopQueryResult, index: number, source: Observable<ShopQueryResult>| -> any {\n      // add distance to result\n      const s = shop;\n      s.distance = shopLocation.distance;\n      return s;\n  });\n\nlet bar: Bar<\n  AAAAAAA,\n  BBBBBBB,\n  CCCCCCC,\n  DDDDDDD,\n  EEEEEEE,\n  FFFFFFF,\n  GGGGGGG,\n  HHHHHHH\n>;\n\nconst baz = Array::<\n  FooFooFooFooFooFooFooFooFooFooFooFooFooFooFoo,\n  BarBarBarBarBarBarBarBarBarBarBarBarBarBarBar\n>();\n\ncrate type RequestNextDealAction = BaseAction<DealsActionTypes::REQUEST_NEXT_DEAL>;\n\ncrate impl Thing for OtherThing {\n    const ffff: fn(typee: Type) -> Provider<Prop> = memoize(|ty: ObjectType| -> Provider<Opts> {});\n}\n\nconst appIDs = createSelector(\n    PubXURLParams.APP_IDS,\n   |rawAppIDs| -> Array<AppID> deserializeList(rawAppIDs),\n);"
  },
  {
    "path": "tests/samples/issues/0.rs",
    "content": "//! Expect 1 empty line below\n\n//! Expect 0 empty line below\n//! Expect 1 empty line below\n\n1;\n//! Expect 1 empty line below\n\n//! Expect 0 empty line below\n1;\n\n{\n\t#![attr] // comment after #![attr]\n}\n\nmatch () {\n\t#![attr] // comment after #![attr]\n}\n\nimpl Foo<[u8; {\n    #![cfg_attr(not(FALSE), rustc_dummy(cursed_inner))]\n    #![allow(unused)]\n    struct Inner {\n        field: [u8; {\n            #![cfg_attr(not(FALSE), rustc_dummy(another_cursed_inner))]\n            1\n        }]\n    }\n\n    0\n}]> {\n    #![cfg_eval]\n    #![print_attr]\n    #![cfg_attr(not(FALSE), rustc_dummy(evaluated_attr))]\n\n    fn bar() {\n        #[cfg(FALSE)] let a = 1;\n    }\n}\n\n#[cfg_eval]\n#[print_attr]\nstruct S1 {\n    #[cfg(FALSE)]\n    field_false: u8,\n    #[cfg(all(/*true*/))]\n    #[cfg_attr(FALSE, unknown_attr)]\n    #[cfg_attr(all(/*true*/), allow())]\n    field_true: u8,\n}\n\nfn main() {\n    // \n    // \n    let _ = #[cfg_eval] #[print_attr] #[cfg_attr(not(FALSE), rustc_dummy)]\n    (#[cfg(FALSE)] 0, #[cfg(all(/*true*/))] 1,);\n}\n\n#[empty_helper] // a\n                // b\n                // c\n#[derive(Empty)]\nstruct S {\n    #[empty_helper] // d\n    field: [u8; {\n        use empty_helper; // e\n\n        #[empty_helper] // f\n        struct U;\n\n        mod inner {\n            // g\n            #[empty_helper]\n            struct V;\n\n            gen_helper_use!();\n\n            #[derive(GenHelperUse)] // h\n            struct Owo;\n\n            use empty_helper as renamed;\n            #[renamed] // i\n            struct Wow;\n        }\n\n        0\n    }]\n}\n\nfn f() {\n  return (\n    property.isIdentifier() &&\n     FUNCTIONS[property.node.name] &&\n     (object.isIdentifier(JEST_GLOBAL) ||\n       (callee.isMemberExpression() && shouldHoistExpression(object))) &&\n    FUNCTIONS[property.node.name](expr.get(\"arguments\"))\n  );\n\n  return (\n    chalk.bold(\n      \"No tests found related to files changed since last commit.\\n\",\n    ) +\n    chalk.dim(\n      if patternInfo.watch \n        {r#\"Press \"a\" to run all tests, or run Jest with \"--watchAll\".\"#}\n        else {r#\"Run Jest without \"-o\" to run all tests.\"#},\n    )\n  );\n\n  return !filePath.includes(coverageDirectory) &&\n    !filePath.endsWith(\".${SNAPSHOT_EXTENSION}\");\n\t\n  return someVeryLongStringA && someVeryLongStringB && someVeryLongStringC && someVeryLongStringD;\n\n}\n\nfn f() {\n  if (position)\n    {return A {name: pair};}\n  else\n    {return A {name: pair.substring(0, position), value: pair.substring(position + 1)};}\n}\n\nfn f() {\n  if (position)\n    {return A {name: pair};}\n  else\n    {return A {\n      name: pair.substring(0, position),\n      value: pair.substring(position + 1)\n    };}\n}\n\nfn f() {\n  if let Some(_) = try {} {\n  }\n}\n\npub fn delete_upload_session(&self, sess: &UploadSession) -> Result<()> {\n    self.client\n        .delete(&sess.upload_url)\n        .send()?\n        .parse_empty()\n}\n\nlet contents = fs::read_to_string(config.filename)\n    .expect(\"Something went wrong reading the file\");\n\nfn very_very_very_very_very_long_fun_name(x: i32) -> Vec<i32> {\n\tvec![x]\n}\n\nfn main() {\n\tlet very_very_very_very_very_very_very_very_very_long_var_name = 13;\n\tlet all = very_very_very_very_very_long_fun_name(\n\t\tvery_very_very_very_very_very_very_very_very_long_var_name,\n\t)\n\t.iter()\n\t.map(|x| x + very_very_very_very_very_very_long_var_name);\n\tlet more = 13;\n\tlet other = vec![1, 2, 3]\n\t\t.iter()\n\t\t.map(|x| x + very_very_very_very_very_very_long_var_name);\n\n    Pin::new(&mut self.0).poll(cx).is_ready();\n}\n\nfn f() {\n    something.do_stuff(|| {\n        {\n            \"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n        }\n    });\n}\nlet kind = match rvalue {\n\tRvalue::Ref(_, borrow_kind, _)\n\t\tif borrow_kind.allows_two_phase_borrow() =>\n\t{\n\t\tRetagKind::TwoPhase\n\t}\n\tRvalue::AddressOf(..) => RetagKind::Raw,\n\t_ => RetagKind::Default,\n};\n\nuse exonum::{\n    api::{Api, ApiError},\n    blockchain::{self, BlockProof, Blockchain, Transaction, TransactionSet},\n    crypto::{Hash, PublicKey},\n    helpers::Height,\n    node::TransactionSend,\n    storage::{ListProof, MapProof},\n};\n\nlet mut arms = variants.iter().enumerate().map(|(i, &(ident, v_span, ref summary))| {\n\tlet i_expr = cx.expr_usize(v_span, i);\n\tlet pat = cx.pat_lit(v_span, i_expr);\n\n\tlet path = cx.path(v_span, vec![substr.type_ident, ident]);\n\tlet thing = rand_thing(cx, v_span, path, summary, |cx, sp| rand_call(cx, sp));\n\tcx.arm(v_span, vec!( pat ), thing)\n}).collect::<Vec<ast::Arm> >();\n\nlet input = Input {\n    foo: 42,\n};\nsome_fn_with_struct_and_closure(input, |foo| {\n    println!(\"foo: {:?}\", foo);\n});\nsome_fn_with_struct_and_closure(Input {\n    foo: 42,\n}, |foo| {\n    println!(\"foo: {:?}\", foo);\n});\nfn main() {\n    assert_eq!(code, unindent(r#\"\n        def hello():\n            print(\"Hello, world!\")\n        \n        hello()\n    \"#));\n    assert_eq(code, unindent(r#\"\n        def hello():\n            print(\"Hello, world!\")\n        \n        hello()\n    \"#));\n\tassert_eq!(s, wrap(A {\n        x: 10,\n        y: 20,\n        z: 30,\n    }));\n    assert_eq(s, wrap(A {\n        x: 10,\n        y: 20,\n        z: 30,\n    }));\n    assert_eq!(s, wrap(A { x: 10, y: 20, z: 30, }));\n    assert_eq(s, wrap(A { x: 10, y: 20, z: 30, }));\n}\n\nfn speak_raw(\n\tself,\n\tseed: u32,\n\tlanguage: Language<B, P>,\n\tspeaker: Speaker<N, M>,\n) -> Synthesize<Jitter<Sequence<Select<Intonate<Phonemize<core::iter::Map<Self::IntoIter, fn(char) -> Event<char>>,B,N,M,>,P,>,N,M,>,N,M,>,N,M,>,N,M,> {\n\tself.parse_raw()\n\t\t.phonemize(&language, &speaker)\n\t\t.intonate(&language, &speaker)\n\t\t.select(&speaker)\n\t\t.sequence(speaker.sample_rate)\n\t\t.jitter(seed, &speaker)\n\t\t.synthesize()\n}\n\nuse {\n    fidl::endpoints::RequestStream,\n    fuchsia_async as fasync,\n    fuchsia_zircon as zx,\n    std::marker::PhantomData,\n};\n\nfn f() -> Vec<u32> {\n    [1, 2, 3]\n        .iter()\n        .map(|&x| {\n            return x * 2;\n        })\n        .collect()\n}\n\nClient::new()\n    .request(\n        Request::get(&req.state().upstream)\n            .header(\n                header::ACCEPT,\n                HeaderValue::from_static(CONTENT_TYPE_GRAPH_V1),\n            )\n            .body(Body::empty())\n            .expect(\"unable to form request\"),\n    )\n    .from_err::<Error>()\n    .and_then(|res| {\n        if res.status().is_success() {\n            future::ok(res)\n        } else {\n            future::err(format_err!(\n                \"failed to fetch upstream graph: {}\",\n                res.status()\n            ))\n        }\n    })\n    .and_then(|res| res.into_body().concat2().from_err::<Error>())\n    .and_then(|body| {\n        let graph: Graph = serde_json::from_slice(&body)?;\n        Ok(HttpResponse::Ok()\n            .content_type(CONTENT_TYPE_GRAPH_V1)\n            .body(serde_json::to_string(&graph)?))\n    })\n\nfn foo() {\n    parse_simple_ok(\"() ()\", vec![\n\t\tSimpleSexpr::List { opening: \"(\".into(), closing: \")\".into(), entire: \"()\".into(), children: vec![], }, \n\t\tSimpleSexpr::List { opening: \"(\".into(), closing: \")\".into(), entire: \"()\".into(), children: vec![], }]\n\t);\n}\n\nimpl X {\n    pub const SOMETHING: usize = mem::size_of::<i64>() // field A\n        + mem::size_of::<i64>() // field B\n        + mem::size_of::<i64>() // field C\n+ mem::size_of::<i64>() // field D\n        + mem::size_of::<i64>() // field E\n        + mem::size_of::<i64>() // field F\n        + mem::size_of::<i64>() // field G\n        + mem::size_of::<i64>(); // field H\n}\n\npub type Iter<'a, D> = impl DoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)> + ExactSizeIterator + 'a;\n\npub type Iter<'a, D>: BoundDoubleEndedIterator<Item = (SomethingSomethingSomethingLongType)> + ExactSizeIterator + 'a;\n\npub type Iter<'a, D>: BoundDoubleEndedIterator<Item = (SomethingSomethingSomethingLongType<D>)> + ExactSizeIterator + 'a;\n\nlet a = Some(2).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).map(|v| v).unwrap(/* fine because we know it's a Some */);\n\nuse module::{\n  submodule_A::{Type_A1, Type_A2},\n  submodule_B::{Type_B1, Type_B2},\n};\n\nfn f1() -> Box<\n    FnMut1() -> Thing1<\n        WithType = LongItemName,\n        Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,\n    >,\n> {\n}\nfn f2() -> Box<\n    FnMu2t() -> Thing2<\n            WithType = LongItemName,\n            Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger,\n        > + fmt::Write,\n> {\n}\n\nflags! {\n    enum Permissions: c_int {\nR = 1,\nW = 2,\nX = 16,\n}\n}\n\nimpl CalibrationType {\n    #[rustfmt::skip] // In this case aligning the match branches makes for more readable code.\n    pub fn parse(value: &str) -> Option<Self> {\n        match value {\n            \"alpha-beta\" => Some(Self::AlphaBeta),\n            \"bin-shift\"  => Some(Self::BinShift),\n            \"enum\"       => Some(Self::Enum),\n            \"none\"       => Some(Self::None),\n            _            => None\n        }\n    }\n    \n    #[rustfmt::skip] // In this case aligning the match branches makes for more readable code.\n    pub fn to_str(&self) -> &'static str {\n        match self {\n            Self::AlphaBeta => \"alpha-beta\",\n            Self::BinShift  => \"bin-shift\",\n            Self::Enum      => \"enum\",\n            Self::None      => \"none\"\n        }\n    }\n}\n\npub trait PrettyPrinter<'tcx>:\n    Printer<\n        'tcx,\n        Error = fmt::Error,\n        Path = Self,\n        Region = Self,\n        Type = Self,\n        DynExistential = Self,\n        Const = Self,\n    >{\n         //\n}\n\npub trait PrettyPrinter<'tcx>:\n    Printer<\n        'tcx,\n        Error = fmt::Error,\n        Path = Self,\n        Region = Self,\n        Type = Self,\n        DynExistential = Self,\n        Const = Self,\n    > + Send {\n         //\n}\n\nArc::get_mut(&mut runtest).unwrap().get_mut().unwrap().take().unwrap()();\n\nstruct X<'a>(\n    #[X(X = \"_________________________________________________________________________\")]\n    pub  &'a u32,\n    // ^^\n);\n\nenum Foo {\n    Bar,\n    Baz = /* Block comment */ 123,\n    Quux = // Line comment\n\t124,\n}\n\n#![feature(trait_alias)]\ntrait Foo =/*comment*/std::fmt::Debug + Send;\ntrait Bar =/*comment*/Foo + Sync;\n\ntype Kilometers =/*comment*/i32;\n\nmod tests {\n    fn test_datetime() {\n        for &(year, month, day, hour, min, sec, micro, is_leap) in &[\n            (2021, 1, 20, 22, 39, 46, 186605, false), // time of writing :)\n            (2020, 2, 29, 0, 0, 0, 0, false), // leap day hehe\n            (2016, 12, 31, 23, 59, 59, 123456, false), // latest leap second\n            (2016, 12, 31, 23, 59, 59, 123456, true), // latest leap second\n            (1156, 3, 31, 11, 22, 33, 445566, false), // long ago\n            (1, 1, 1, 0, 0, 0, 0, false), // Jan 01, 1 AD - can't go further than this\n            (3000, 6, 5, 4, 3, 2, 1, false), // the future\n            (9999, 12, 31, 23, 59, 59, 999999, false), // Dec 31, 9999 AD - can't go further than this\n        ] {}\n    }\n}\n\n#[cfg(windows)]\nuse glium::glutin::platform::windows::EventLoopExtWindows;\n#[cfg(windows)]\nuse glium::glutin::{platform::windows::IconExtWindows, window::Icon};\n\nfn main() {\n    println!(\"\");\n    println!(\"\" /* \" */);\n    println!(\"\" /* \\\" */);\n}\n\nstruct Bar(());\nstruct Foo(Bar);\n\nfn main() {\n    let foo = Foo(Bar(()));\n\n    foo.0.0;\n}\n\ntokio::select! {\n\tresult = reader => {\n            match result {\n\t\tOk(v) => {\n\t\t    eprintln!(\n                    \"message: {}\",\n                    v\n                    );\n                },\n\t\tErr(_) => {\n\t\t    eprintln!(\n                        \"error: {}\",\n                        e\n                    );\n                },\n            }\n\t},\n\t_ = writer => {\n            // Comment\n            eprintln!(\n                \"completed: {}\",\n                some_other_field\n            );\n\t}\n}\n\n//! Some docs here\n#![cfg_attr(bootstrap, doc = \"xxx\")]\n\n#![cfg_attr(debug_assertions, stable(feature = \"rust1\", since = \"1.0.0\"))]\n\nfn main() {\n    let condition_a = true;\n    let condition_b = false;\n    let x = 123.456789\n        + if condition_a {\n            x + y + z + w\n        } else {\n            123.456789\n        }\n        + if condition_b {\n            x - y - z - w\n        } else {\n            123.456789\n        };\n}\n\n#[cfg(not(miri))] // Miri does not deduplicate consts\n\nfn test() {\n    self.1 .0;\n}\n\nfn main() {\n    let x = 111;\t/* First Comment line 1\n\t\t\t\t\t * First Comment line 2 */\n\n    let x = 222;   /* Second Comment line 1\n\t\t\t\t\t* Second Comment line 2 */\n}\n\nfn main() {\n    if /*w*/ 5 /*x*/ == /*y*/ 6 /*z*/ {}\n}\n\nfn printsomething() {\n    println!(\n\"line__1\nline______2\nline________3\nline___________4\"\n            );\n}\n\nconst USAGE: &'static str = \"\ntoyunda-player.\n\nUsage:\n  toyunda-player [options] <file>\n  toyunda-player -h | --help\n  toyunda-player --version\n\nOptions:\n  -h --help     Show this screen.\n  --version     Show version.\n  --invert      Invert the screen.\n\";\n\nfn main() {\n    x.f(\"\nArticle(id, title).\nVote(user, id).\nVC(id, votes) = votes:COUNT(u, Vote(u, id)).\nAwV(id, title, votes) = Article(id, title) * VC(id, votes).\nVote_n(user, id, strength=1) <- Vote(user, id).\nVS(id, score) = score:SUM(strength, Vote_n+(_, id, strength)).\nAwV_n(id, title, score) = Article(id, title) * VS(id, score).\n\").unwrap();\n}\n\nconst USAGE: &'static str = \" \n...\n\";\n\nlet program = glium::Program::from_source(&display, &include_str!(\"./shaders/vertex.glsl\"), &include_str!(\"./shaders/fragment.glsl\"), None).unwrap();\n\nlet mut g_buffer = MultiOutputFrameBuffer::with_depth_buffer(api.facade, [(\"color\", &g_albedo)].iter().cloned(), &g_depth);\n\nmacro_rules! foo {\n    ($a:ident : $b:ty) => {};\n    ($a:ident $b:ident $c:ident) => {};\n    ($( if #[cfg($meta:meta)] { $($tokens:tt)* } ) else * else { $($tokens2:tt)* }) => {};\n    (if #[cfg($i_met:meta)] { $($i_tokens:tt)* } $(else if #[cfg($e_met:meta)] { $($e_tokens:tt)* })*) => {};\n    ($expression:expr, $(|)? $( $pattern:pat_param )|+ $( if $guard: expr )? $(,)?) => {};\n    (@main ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => {};\n    (@main {} if let $pat:pat = $expr:expr; $($tt:tt)+) => {};\n    (@main {} if $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)* } let $pat:pat = $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)* } let $ident:ident: $ty:ty = $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)* } let $pat1:pat | $($pat:pat)|+ = $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)+ } if let $pat:pat = $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)* } if let $pat1:pat | $($pat:pat)|+ = $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)+ } if $expr:expr; $($tt:tt)+) => {};\n    (@main { $($other:tt)* } then { $($then:tt)* }) => {};\n    (@main ($($tt:tt)*) then { $($then:tt)* } else { $($other:tt)* }) => {};\n    (@main ($($tt:tt)*) then { $($then:tt)* }) => {};\n    (@main ($($tt:tt)*) $head:tt $($tail:tt)*) => {};\n}\n\nself.0.take_action(Log).result().map_err(|()| LoggerError);\n\nlet n: i32 = std::env::args().nth(1).map(parse).unwrap_or(Ok(100))?;\n\nfn main() {\n    return doughnutFryer\n        .start()\n        .then(|_| _frostingGlazer.start())\n        .then(|_| Future.wait([\n              _conveyorBelts.start(),\n              sprinkleSprinkler.start(),\n              sauceDripper.start()\n            ]))\n        .catchError(cannotGetConveyorBeltRunning)\n        .then(|_| tellEveryoneDonutsAreJustAboutDone())\n        .then(|_| Future.wait([\n              croissantFactory.start(),\n              _giantBakingOvens.start(),\n              butterbutterer.start()\n            ])\n                .catchError(_handleBakingFailures)\n                .timeout(scriptLoadingTimeout, _handleBakingFailures)\n                .catchError(cannotGetConveyorBeltRunning))\n        .catchError(cannotGetConveyorBeltRunning)\n        .then(|_| {\n      _logger.info(\"Let's eat!\");\n    });\n}\nself.projection_matrix = Matrix4::new(\n\t1.0/r, 0.0,   0.0,         0.0,   // NOTE: first column!\n\t0.0,   1.0/t, 0.0,         0.0,   // 2nd\n\t0.0,   0.0,   2.0/(n-f),   0.0,   // 3rd\n\t0.0,   0.0,   (f+n)/(n-f), 1.0    // 4th\n);\n\nlet explicit_conversion_preserves_semantics = \n\t|| !is_mod || (is_mod && attrs.map_or(true, |a| a.is_empty())); \n\n\nfn default_user_agent_string(agent: UserAgent) -> String {\n    match agent {\n        UserAgent::Desktop => {\n            DESKTOP_UA_STRING\n        }\n        UserAgent::Android => {\n            \"Mozilla/5.0 (Android; Mobile; rv:37.0) Servo/1.0 Firefox/37.0\"\n        }\n    }.to_owned()\n}\n\n#![allow(\n    clippy::needless_pass_by_value,\n    clippy::new_ret_no_self,\n    clippy::new_without_default_derive,\n)]\ncopysign(0.5 * P2_HI - (2.0 * s * r_ - (P2_LO - 2.0 * c) - (0.5 * P2_HI - 2.0 * f)), i);\n\nimpl Foo {\n    fn foo(&self) -> Box<FnMut(i64) -> i64> {\n        Box::new(move |aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| {\n            aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n        })\n    }\n}\n\nm.map_data(|mut rs| {\n\trs.retain(|r| {\n\t\tr.iter().enumerate().all(|(i, v)| {\n\t\t\tif let Some(ref rv) = on[i] {\n\t\t\t\trv == v\n\t\t\t} else {\n\t\t\t\ttrue\n\t\t\t}\n\t\t})\n\t});\n\trs.retain(|r| {\n\t\tr.iter().enumerate().all(|(i, v)| \n\t\t\tif let Some(ref rv) = on[i] {\n\t\t\t\trv == v\n\t\t\t} else {\n\t\t\t\ttrue\n\t\t\t}\n\t\t)\n\t});\n});\n\npub fn uumain(args: Vec<String>) -> i32 {\n    let matches = App::new(executable!())\n        .arg(            Arg::with_name(OPT_CHANGE)\n            .short(\"c\").long(\"ch\")\n)\n        .arg(\n            Arg::with_name(OPT_DEREFERENCE).help(\"aazezae affect the referent of each symbolic link this is qthe default the symbolic link itself\"));\n}\n\nimpl S {\n    fn f() {\n        self.g(\n            {\n                if b {\n                    Err(w(\n                        i(\n                            \"expected float or integer types for both operands of {}, got '{}' and '{}'\",\n                            token,\n                        )), left)\n                }\n                match d {\n                    _ => h(m,b), \n                }\n            },\n        )\n    }\n}\n\nmatch () {\n\t(AngleBracketedArg::Arg(_), None) | (AngleBracketedArg::Constraint(_), Some(_)) => {\n\t}\n}\n\nmacro_rules! map_and_then_print {\n    ($value:expr, |$pat:pat| $map:expr) => {{\n        let $pat = $value;\n        let s = $map;\n        println!(\"{}\", s);\n    }};\n}\n\nmap_and_then_print!(1, |x| x + 3);\n// Prints \"4\"\n\nmatch head.packet_type()? {\n    p\n    @\n    (PacketType::Connect\n    | PacketType::ConnAck\n    | PacketType::SubAck\n    | PacketType::UnsubAck) => return Err(Error::WrongPacket(p)),\n}\n\n#![feature(raw)]\n#![panic_runtime]\n#![feature(panic_runtime)]\n\n// `real_imp` is unused with Miri, so silence warnings.\n#![cfg_attr(miri, allow(dead_code))]\n\nfn foo() -> () where {}\n\nfor i in 0..n + 1 {}\n\nif alpha\n\t> x_m * (f1 / x1).ln()\n\t\t+ (n - (m as f64) + 0.5) * (z / w).ln()\n\t\t+ ((y - m) as f64) * (w * p / (x1 * q)).ln()\n\t\t// ________\n\t\t+ stirling(f1)\n\t\t+ stirling(z)\n\t\t- stirling(x1)\n\t\t- stirling(w)\n\t{\n\tcontinue;\n}\n\nmatch (self, other) {\n\t(&U32(ref v1), &U32(ref v2)) => v1 == v2,\n\t(&USize(ref v1), &USize(ref v2)) => v1 == v2,\n\t(&U32(ref v1), &USize(ref v2)) => {\n\t\tv1.len() == v2.len()\n\t\t&& v1.iter().zip(v2.iter()).all(|(x, y)| *x as usize == *y)\n\t}\n\t(&USize(ref v1), &U32(ref v2)) => {\n\t\tv1.len() == v2.len()\n\t\t&& v1.iter().zip(v2.iter()).all(|(x, y)| *x == *y as usize)\n\t}\n}\n\nfn main() {\n    let o_num = Some(123);\n    \n    let x = if let Some(n) =\n        // ________\n        o_num {\n            n * 2\n        } else {\n            0\n        };\n    \n    println!(\"Number: {}\", x);\n}\n\nstruct Foo {\n    // a: i32,\n    //\n    // b: i32,\n}\n\nstruct Foo {\n    a: i32,\n    //\n    // b: i32,\n}\n\nmacro_rules! m {\n\t($a:expr) => {\n\t\tif $a {\n\t\t\treturn;\n\t\t\t}\n\t};\n}\n\nlet write_status = |\n\tstatus: &mut Vec<ansi_term::ANSIString>,\n\tdiff: &Diff,\n\theading: &str,\n\tcolor: &Style,\n\tshow_hints: bool,\n\thints: &[&str]\n\t| -> Result<bool> {}\n\nmacro_rules! member_mut {\n\t($self:expr, $member:expr) => {{\n\t\tuse self::Member::*;\n\t\tlet r = &mut *$self;\n\t\tmatch $member {\n\t\t\tA => &mut r.a,\n\t\t\tB => &mut r.b,\n\t\t\t}\n\t\t}};\n}\nif let Some(ref /*mut*/ state) = foo {\n}\n\nimpl<\n\tTarget: FromEvent<A> + FromEvent<B>,\n\tA: Widget2<Ctx = C>,\n\tB: Widget2<Ctx = C>,\n\tC: for<'a> CtxFamily<'a>,\n> Widget2 for WidgetEventLifter<Target, A, B> {\n\ttype Ctx = C;\n\ttype Event = Vec<Target>;\n}\n\nasync {\n    // Do\n    // some\n    // work\n}.await;\n\nfn main() {\n    token!(dyn);\n}\n\nfn build_sorted_static_get_entry_names(\n    mut entries: Vec<(u8, &'static str)>,\n) -> (impl Fn(\n    AlphabeticalTraversal,\n    Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>,\n) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>\n          + Send\n          + Sync\n          + 'static) {\n}\n\nfn main() {\n    bbbbbbbbbbbbbbbbbb::ccccccccccccccccccccccccccccccccccccccc::dddddddddddddddddddd(\n        eeeeeeeeeeeeeeeeeeee::ffffffffffffffffffff(\n            ggggggggg(hhhhhhhhhhhhhhhh),\n            iiiiiiiii(jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj),\n        ),\n    );\n}\n\nfn f() -> Box<\n    dyn FnMut() -> Thing< WithType = LongItemName, Error = LONGLONGLONGLONGLONGONGEvenLongerErrorNameLongerLonger>,\n>{\n}\n\ntrait Foo where {}\nstruct Bar where {}\nimpl<> Foo<> for Bar<> where {}\n\nimpl Foo {\n    fn foo() {\n        self.report.add_non_formatted_ranges(visitor.skipped_range.clone());\n    }\n}\n\nfn test() {\n    let aaaaaaaaaaaaaaaa = ffffffffffffffffffffffff\n        .iter()\n        .filter_map(|_| {\n            if bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\n                == ccccccccccccccccccccccc\n                    .dddddddddddddddddddddddd()\n                    .eeeeeeeeeeeeeeeeeeeeee()\n            {\n                ();\n            }\n        })\n        .collect();\n}\n\nfn main() {\n    let visual_studio_path = {\n        let vswhere_stdout = String::from_utf8(vswhere_output.stdout)\n    .expect(\"vswhere output is not valid UTF-8\");\n        String::from(vswhere_stdout.trim())\n    };\n}\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn handles_mid_demangling() {\n        assert_eq!(\n            crate::demangle_line(\"        lea     rax, [rip + _ZN55_$LT$$RF$$u27$a$u20$T$u20$as$u20$core..fmt..Display$GT$3fmt17h510ed05e72307174E]\"),\n                \"        lea     rax, [rip + <&\\'a T as core::fmt::Display>::fmt]\");\n    }\n}\n\nfn main() {\n    let i = test::<-1>();\n    println!(\"Hello, {}!\", i);\n}\n\nfn test<const T: i8>() -> i8 {\n    {T}\n}\n\nvm.get_method_or_type_error(\n    obj.clone(),\n    \"__getitem__\",\n    || format!(\"'{}' object is not iterable\", obj.class().name)\n)?;\n\ntype ProposeTransactionsFuture:\n\tFuture<\n\t\tItem = ProposeTransactionsResponse<Self::MessageId>,\n\t\tError = Error,\n\t>;\n\ntype ProposeTransactionsFuture:\n\tFuture<\n\t\tItem = ProposeTransactionsResponse<Self::MessageId>,\n\t\tError = Error,\n\t>\n\t+ Send\n\t+ 'static;\n\nfn main() {\n\t/* Common case: The double precision result is fine. */\n\tif (ui & 0x1fffffff) != 0x10000000  /* not a halfway case */\n\t\t|| e == 0x7ff /* NaN */\n\t\t|| (result - xy == z as f64 && result - z as f64 == xy) /* exact */\n\t\t|| fegetround() != FE_TONEAREST /* not round-to-nearest */\n\t{\n\t}\n}\n\npub fn foo(config: &Config) {\n    let csv = RefCell::new(create_csv(config, \"foo\"));\n    {\n        let mut csv = csv.borrow_mut();\n        for (i1, i2, i3) in iproduct!(0..2, 0..3, 0..3) {\n            csv.write_field(format!(\"γ[{}.{}.{}]\", i1, i2, i3))\n                .unwrap();\n            csv.write_field(format!(\"d[{}.{}.{}]\", i1, i2, i3)).unwrap();\n            csv.write_field(format!(\"i[{}.{}.{}]\", i1, i2, i3)).unwrap();\n        }\n        csv.write_record(None::<&[u8]>).unwrap();\n    }\n}\n\nfn main() {\n    let a = Foo {\n        something: Some(1),\n        bar: 2,\n    };\n    if let Foo { something: Some(something), .. } = a {\n        println!(\"{}\", something);\n    }\n}\n\nfn main() {\n    let dv = (2. * m * l * dtheta * dtheta * theta.sin()\n        + 3. * m * g * theta.sin() * theta.cos()\n        + 4. * u\n        - 4. * b * v)\n        / (4. * (M + m) - 3. * m * theta.cos().powi(2));\n    let ddtheta = (-3. * m * l * dtheta * dtheta * theta.sin() * theta.cos()\n        - 6. * (M + m) * g * theta.sin()\n        - 6. * (u - b * v) * theta.cos())\n        / (4. * l * (m + M) - 3. * m * l * theta.cos().powi(2));\n    let V: Array2<_> = (((&lq + &vi).mapv(f64::exp) - &q) * (mi_minus_mi_t).mapv(f64::cos)\n        - ((&lq - &vi).mapv(f64::exp) - &q) * (mi_plus_mi_t).mapv(f64::cos))\n        * e.as_row()\n        * e.as_column()\n        * 0.5;\n    dVdm.slice_mut(s![.., .., j]).assign(\n        &(((Array2::zeros((d, d)) + u.as_column() - u.as_row()) * &U1\n            + (Array2::<f64>::zeros((d, d)) + u.as_column() + u.as_row()) * &U2)\n            * e.as_column()\n            * e.as_row()),\n    );\n\t{\n        {\n            {\n                {\n                    {\n                        let LdXi: Array2<_> = (dmahai\n                            + kdX.slice(s![.., i, d]).into_column()\n                            + kdX.slice(s![.., j, d]))\n                            * &L;\n                    }\n                }\n            }\n        }\n    }\n\tlet dnlml = Array1::from_shape_fn(ln_hyperparams.len(), |i| {\n        0.5 * (\n            self.covfunc.deriv_covariance(ln_hyperparams, train_inputs, i)\n            * &W\n        ).scalar_sum()\n    });\n\tdVdi.slice_mut(s![.., output_index, .., input_index])\n\t.assign(\n\t\t&(c * (iR\n\t\t\t.column(input_index)\n\t\t\t.into_column()\n\t\t\t.dot(&lb.view().into_row())\n\t\t\t- (&t * &tlb_view.into_column()).reversed_axes()\n\t\t\t+ tlbdi2)),\n\t);\n\t{\n        let tdX: Array1<_> = -0.5\n            * t\n            * (&iR.t()\n                * test_covariance\n                * (-2. * &inv_sq_len_scales_i - 2. * &inv_sq_len_scales_i))\n              .sum_axis(Axis(0));\n    }\n\t{\n        let dSds: Array2<_> = r2\n            * (2. * i2SpW.dot(&m_minus_z.as_column()).dot(&m_minus_z.as_row())\n                - Array2::<f64>::eye(D))\n              .dot(&i2SpW)\n            - 2. * L * &dLds;\n    }\n\tlet f = future::poll_fn(move || {\n        match tokio_threadpool::blocking(|| f.poll()).unwrap() {\n            Async::Ready(v) => v,\n            Async::NotReady => Ok(Async::NotReady),\n        }\n    });\n\ttest(\"Your number: \", match input {\n        BigEnum::One => 0,\n        BigEnum::Two => 0,\n        BigEnum::Three => 0,\n        BigEnum::Four => 0,\n        BigEnum::Five => 0,\n        BigEnum::Six => 0,\n        BigEnum::Seven => 0,\n        BigEnum::Eight => 0,\n        BigEnum::Nine => 0,\n        BigEnum::Ten => 0,\n        BigEnum::Eleven => 0,\n        BigEnum::Twelve => 0,\n\t});\n\twindow\n\t\t.task_manager()\n\t\t.dom_manipulation_task_source()\n\t\t.queue(\n\t\t\ttask!(fire_dom_content_loaded_event: move || {\n\t\t\t\tlet document = document.root();\n\t\t\t\tdocument.upcast::<EventTarget>().fire_bubbling_event(atom!(\"DOMContentLoaded\"));\n\t\t\t\tupdate_with_current_time_ms(&document.dom_content_loaded_event_end);\n\t\t\t}),\n\t\t\twindow.upcast(),\n\t\t)\n\t\t.unwrap();\n\t\n    foo(|| {\n        loop {\n            foo();\n        }\n    });\n    foo(|| {\n        while true {\n            foo();\n        }\n    });\n    foo(|| {\n        if true {\n            foo();\n        }\n    });\n\ttokio::spawn(async {\n        println!();\n    });\n\n\t// this block will be properly formatted\n\t{\n\t\tlet a = 1;\n\t\tlet b=2;\n\t\tlet c = \" very very very very very very very very very very very very very very very very very very long string in a block\";\n\t}\n\t\n\tlet v = vec![1, 2];\n\t\n\t// this block won't be formatted\n\tv.iter().for_each(|_| {\n\t\tlet a = 1;\n\t\tlet b=2;\n\t\tlet c = \" very very very very very very very very very very very very very very very very very very long string in a block\";\n\t});\n\t\n\t// this block with shorter str will be properly formatted\n\tv.iter().for_each(|_| {\n\t\tlet a = 1;\n\t\tlet b=2;\n\t\tlet c = \" less very very long string in a block\";\n\t});\n\n\tasync fn forty_two() -> i32 {\n\t\t42\n\t}\n\t\n\tfn spawn_async(_f: impl Future<Output=()>) {\n\t\tunimplemented!();\n\t}\n\t\n\tfn main() {\n\t\tspawn_async(async {\n\t\t\tprintln!(\"{}\", await!(forty_two()));\n\t\t});\n\t}\n\tif 1 {} else if eq!(b[1] == b'o' b'n' b't' b'e' b'n' b't' b'-' b'r' b'a' b'n' b'g' b'e' ) {}\n}\nstatic REPRO: &[usize] = &[\n\t#[cfg(feature = \"zero\")]\n\t0,\n];\n\nlazy_static! {\n    pub static ref BLOCKING_POOL: tokio_threadpool::ThreadPool = {\n        tokio_threadpool::Builder::new().pool_size(1).build()\n    };\n\n    static ref FOO: Foo = unsafe {\n        very_long_function_name().another_function_with_really_long_name()\n    };\n}\n\nstatic DEFAULT_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> =\n    SyncLazy::new(|| {\n        let hook = panic::take_hook();\n        panic::set_hook(Box::new(|info| {\n            // Invoke the default handler, which prints the actual panic message and optionally a backtrace\n            (*DEFAULT_HOOK)(info);\n\n            // Separate the output with an empty line\n            eprintln!();\n\n            // Print the ICE message\n            rustc_driver::report_ice(info, BUG_REPORT_URL);\n        }));\n        hook\n    });\n\nfn main() {\n\tlet factorial = |recur: &dyn Fn(u32) -> u32, arg: u32| -> u32 { if arg == 0 {1} else {arg * recur(arg-1)} };\n\tself.time_passes = config.opts.prints.is_empty()\n\t\t&& (config.opts.debugging_opts.time_passes || config.opts.debugging_opts.time);\n\tconfig.opts.maybe_sysroot = Some(config.opts.maybe_sysroot.clone().unwrap_or_else(|| {\n        std::env::current_exe().unwrap().parent().unwrap().parent().unwrap().to_owned()\n    }));\n\tBox::new(rustc_codegen_ssa::base::codegen_crate(\n\t\tLlvmCodegenBackend(()),\n\t\ttcx,\n\t\tcrate::llvm_util::target_cpu(tcx.sess).to_string(),\n\t\tmetadata,\n\t\tneed_metadata_module,\n\t));\n\tlet (codegen_results, work_products) = ongoing_codegen\n\t\t.downcast::<rustc_codegen_ssa::back::write::OngoingCodegen<GccCodegenBackend>>()\n\t\t.expect(\"Expected GccCodegenBackend's OngoingCodegen, found Box<Any>\")\n\t\t.join(sess);\n\tif let Some(old) = old {\n        self.cur = unsafe { (self.step)(old) };\n    }\n\tlet _prof_timer = tcx.prof.generic_activity_with_args(\n\t\t\"codegen_module\",\n\t\t&[cgu_name.to_string(), cgu.size_estimate().to_string()],\n\t);\n\tlet tm = match (cgcx.tm_factory)(tm_factory_config) {};\n\tlet _ = [0; {struct Foo; impl Foo {const fn get(&self) -> usize {5}}; Foo.get()}];\n\tsyntactically_correct(loop { sup( '?'); }, if cond { 0 } else { 1 });\n\tunsafe { &*self.llmod_raw }\n\tllvm::LLVMRustDisposeTargetMachine(&mut *(self.tm as *mut _));\n\tlet tm = (cgcx.tm_factory)(tm_factory_config).map_err(|e| write::llvm_err(&diag_handler, &e))?;\n\ttarget_machine_factory(sess, config::OptLevel::No, &features)(config)\n\t\t.unwrap_or_else(|err| llvm_err(sess.diagnostic(), &err).raise());\n\tlet TestOutcome { completed: ok, errors: err, .. } = forest.process_obligations(&mut C(\n\t\t|obligation| match *obligation {\n\t\t\t\"D'\" => {\n\t\t\t\td_count += 1;\n\t\t\t\tProcessResult::Error(\"operation failed\")\n\t\t\t}\n\t\t\t_ => unreachable!(),\n\t\t},\n\t\t|_| {},\n\t));\n\tlet adjusted_span = (|| {\n\t\tif let ExprKind::Block { body } = &expr.kind && let Some(tail_ex) = body.expr {\n\t\t\tlet mut expr = &this.thir[tail_ex];\n\t\t\twhile let ExprKind::Block {\n\t\t\t\tbody: Block { expr: Some(nested_expr), .. },\n\t\t\t}\n\t\t\t| ExprKind::Scope { value: nested_expr, .. } = expr.kind\n\t\t\t{\n\t\t\t\texpr = &this.thir[nested_expr];\n\t\t\t}\n\t\t\tthis.block_context.push(BlockFrame::TailExpr {\n\t\t\t\ttail_result_is_ignored: true,\n\t\t\t\tspan: expr.span,\n\t\t\t});\n\t\t\treturn Some(expr.span);\n\t\t}\n\t\tNone\n\t})();\n\tmatch (test.end, pat.end, lo, hi) {\n\t\t// pat < test\n\t\t(_, _, Greater, _) |\n\t\t(_, Excluded, Equal, _) |\n\t\t// pat > test\n\t\t(_, _, _, Less) | // <-\n\t\t(Excluded, _, _, Equal) => Some(true),\n\t\t_ => Some(false),\n\t}\n\tlet overlaps: Vec<_> = pats\n\t\t.filter_map(|pat| Some((pat.ctor().as_int_range()?, pat.span())))\n\t\t.filter(|(range, _)| self.suspicious_intersection(range))\n\t\t.map(|(range, span)| (self.intersection(&range).unwrap(), span))\n\t\t.collect();\n\tmatch bb_data.terminator().kind {\n\t\t(JustBefore(n), JustBefore(m)) if n < m => n..=(m - 1),\n\t\t(JustBefore(n), AfterMax) => n..=u128::MAX,\n\t\t_ => unreachable!(), // Ruled out by the sorting and filtering we did\n\t\t(Some(to), Some(from)) => {\n\t\t\t(from == Ordering::Greater || from == Ordering::Equal)\n\t\t\t\t&& (to == Ordering::Less\n\t\t\t\t\t|| (other_end == self_end && to == Ordering::Equal))\n\t\t}\n\t\tReturn | Resume | Abort | GeneratorDrop | Unreachable => {}\n\n\t\tGoto { target } => propagate(target, exit_state),\n\n\t\tAssert { target, cleanup: unwind, expected: _, msg: _, cond: _ }\n\t\t| Drop { target, unwind, place: _ }\n\t\t| DropAndReplace { target, unwind, value: _, place: _ }\n\t\t| FalseUnwind { real_target: target, unwind } => {\n\t\t\tif let Some(unwind) = unwind {\n\t\t\t\tif dead_unwinds.map_or(true, |dead| !dead.contains(bb)) {\n\t\t\t\t\tpropagate(unwind, exit_state);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpropagate(target, exit_state);\n\t\t}\n\t\tmir::Rvalue::Ref(_, mir::BorrowKind::Mut { .. }, place)\n\t\t| mir::Rvalue::AddressOf(_, place) => (self.0)(place),\n\t\n\t\t_ => {}\n\t\tsuggestion_kind @ \"suggestion\"\n\t\t| suggestion_kind @ \"suggestion_short\"\n\t\t| suggestion_kind @ \"suggestion_hidden\"\n\t\t| suggestion_kind @ \"suggestion_verbose\" => {\n\t\t\tlet (span, applicability) = (|| match &info.ty {\n\t\t\t\tty @ syn::Type::Path(..)\n\t\t\t\t\tif type_matches_path(ty, &[\"rustc_span\", \"Span\"]) =>\n\t\t\t\t{\n\t\t\t\t\tlet binding = &info.binding.binding;\n\t\t\t\t\tOk((\n\t\t\t\t\t\tquote!(*#binding),\n\t\t\t\t\t\tquote!(rustc_errors::Applicability::Unspecified),\n\t\t\t\t\t))\n\t\t\t\t}\n\t\t\t\t_ => throw_span_err!(\n\t\t\t\t\tinfo.span.unwrap(),\n\t\t\t\t\t\"wrong field type for suggestion\",\n\t\t\t\t\t|diag| {\n\t\t\t\t\t\tdiag.help(\"#[suggestion(...)] should be applied to fields of type Span or (Span, Applicability)\")\n\t\t\t\t\t}\n\t\t\t\t),\n\t\t\t})()?;\n\t\t\tfor arg in list.nested.iter() {\n\t\t\t\tif let syn::NestedMeta::Meta(syn::Meta::NameValue(arg_name_value)) = arg\n\t\t\t\t{\n\t\t\t\t\tif let syn::MetaNameValue { lit: syn::Lit::Str(s), .. } =\n\t\t\t\t\t\targ_name_value\n\t\t\t\t\t{\n\t\t\t\t\t\tlet name = arg_name_value\n\t\t\t\t\t\t\t.path\n\t\t\t\t\t\t\t.segments\n\t\t\t\t\t\t\t.last()\n\t\t\t\t\t\t\t.unwrap()\n\t\t\t\t\t\t\t.ident\n\t\t\t\t\t\t\t.to_string();\n\t\t\t\t\t\tlet name = name.as_str();\n\t\t\t\t\t\tlet formatted_str = self.build_format(&s.value(), arg.span());\n\t\t\t\t\t\tmatch name {\n\t\t\t\t\t\t\t\"message\" => {\n\t\t\t\t\t\t\t\tmsg = Some(formatted_str);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\"code\" => {\n\t\t\t\t\t\t\t\tcode = Some(formatted_str);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tother => throw_span_err!(\n\t\t\t\t\t\t\t\targ.span().unwrap(),\n\t\t\t\t\t\t\t\t&format!(\n\t\t\t\t\t\t\t\t\t\"`{}` is not a valid key for `#[suggestion(...)]`\",\n\t\t\t\t\t\t\t\t\tother\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tlet msg = if let Some(msg) = msg {\n\t\t\t\tquote!(#msg.as_str())\n\t\t\t} else {\n\t\t\t\tthrow_span_err!(\n\t\t\t\t\tlist.span().unwrap(),\n\t\t\t\t\t\"missing suggestion message\",\n\t\t\t\t\t|diag| {\n\t\t\t\t\t\tdiag.help(\"provide a suggestion message using #[suggestion(message = \\\"...\\\")]\")\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t};\n\t\t\tlet code = code.unwrap_or_else(|| quote! { String::new() });\n\t\t\tquote! {\n\t\t\t\t#diag.#suggestion_method(#span, #msg, #code, #applicability);\n\t\t\t}\n\t\t}\n\t\tother => throw_span_err!(\n\t\t\tlist.span().unwrap(),\n\t\t\t&format!(\"invalid annotation list `#[{}(...)]`\", other)\n\t\t),\n\t\t_ => self.failed |= !(self.cb)(expr),\n\t}\n\tListItem {\n\t\tpre_comment,\n\t\tpre_comment_style,\n\t\titem: if self.inner.peek().is_none() && self.leave_last {\n\t\t\tNone\n\t\t} else {\n\t\t\t(self.get_item_string)(&item)\n\t\t},\n\t\tpost_comment,\n\t\tnew_lines,\n\t};\n\tcomment_len(item.pre_comment.as_ref().map(|x| &(*x)[..]))\n\t\t+ comment_len(item.post_comment.as_ref().map(|x| &(*x)[..]))\n\t\t+ item.item.as_ref().map_or(0, |s| unicode_str_width(s));\n\tSome(match rel {\n        Rel::Lt => {\n            match (lx, rx) {\n                (Some(l @ ExtremeExpr { which: Maximum, .. }), _) => (l, AlwaysFalse), // max < x\n                (_, Some(r @ ExtremeExpr { which: Minimum, .. })) => (r, AlwaysFalse), // x < min\n                _ => return None,\n            }\n        },\n        Rel::Le => {\n            match (lx, rx) {\n                (Some(l @ ExtremeExpr { which: Minimum, .. }), _) => (l, AlwaysTrue), // min <= x\n                (Some(l @ ExtremeExpr { which: Maximum, .. }), _) => (l, InequalityImpossible), // max <= x\n                (_, Some(r @ ExtremeExpr { which: Minimum, .. })) => (r, InequalityImpossible), // x <= min\n                (_, Some(r @ ExtremeExpr { which: Maximum, .. })) => (r, AlwaysTrue), // x <= max\n                _ => return None,\n            }\n        },\n        Rel::Ne | Rel::Eq => return None,\n    });\n\tpat.each_binding_or_first(&mut |_, id, span, _| match cx\n\t\t.typeck_results()\n\t\t.extract_binding_mode(cx.sess(), id, span)\n\t\t.unwrap()\n\t{\n\t\tBindingMode::BindByValue(_) if !is_copy(cx, cx.typeck_results().node_type(id)) => {\n\t\t\tcapture = CaptureKind::Value;\n\t\t},\n\t\tBindingMode::BindByReference(Mutability::Mut) if capture != CaptureKind::Value => {\n\t\t\tcapture = CaptureKind::Ref(Mutability::Mut);\n\t\t},\n\t\t_ => (),\n\t});\n\tfor (parent_id, parent) in cx.tcx.hir().parent_iter(e.hir_id) {\n        if let [\n            Adjustment {\n                kind: Adjust::Deref(_) | Adjust::Borrow(AutoBorrow::Ref(..)),\n                target,\n            },\n            ref adjust @ ..,\n        ] = *cx\n            .typeck_results()\n            .adjustments()\n            .get(child_id)\n            .map_or(&[][..], |x| &**x)\n        {\n            if let rustc_ty::RawPtr(TypeAndMut { mutbl: mutability, .. }) | rustc_ty::Ref(_, _, mutability) =\n                *adjust.last().map_or(target, |a| a.target).kind()\n            {\n                return CaptureKind::Ref(mutability);\n            }\n        }\n\t}\n\twhile let Some(higher::IfOrIfLet { cond, then, r#else }) = higher::IfOrIfLet::hir(expr) {\n        if let Some(else_expr) = r#else {\n            expr = else_expr;\n        } else {\n            break;\n        }\n    }\n\tlet lorem = vec![\"ipsum\",\"dolor\",\"sit\",\"amet\",\"consectetur\",\"adipiscing\",\"elit\"];\n    let hyper = Arc::new(Client::with_connector(HttpsConnector::new(TlsClient::new())));\n\t{\n        {\n            let creds = self.client\n                .client_credentials(&self.config.auth.oauth2.id, &self.config.auth.oauth2.secret)?;\n        }\n    }\n\tgiven(\n        r#\"\n        # Getting started\n        ...\n    \"#,\n    )\n        .running(waltz);\n\tconn.query_row(\n        r#\"\n            SELECT title, date\n            FROM posts,\n            WHERE DATE(date) = $1\n        \"#,\n        &[],\n        |row| {\n            Post {\n                title: row.get(0),\n                date: row.get(1),\n            }\n        },\n    )?;\n\tThreadPool::new(Configuration::new().num_threads(1))\n\t.unwrap()\n\t.install(\n\t\t|| {\n\t\t\tscope(\n\t\t\t\t|s| {\n\t\t\t\t\tuse std::sync::mpsc::channel;\n\t\t\t\t\tlet (tx, rx) = channel();\n\t\t\t\t\tlet a = s.spawn_future(lazy(move || Ok::<usize, ()>(rx.recv().unwrap())));\n\t\t\t\t\t//                          ^^^^ FIXME: why is this needed?\n\t\t\t\t\tlet b = s.spawn_future(a.map(|v| v + 1));\n\t\t\t\t\tlet c = s.spawn_future(b.map(|v| v + 1));\n\t\t\t\t\ts.spawn(move |_| tx.send(20).unwrap());\n\t\t\t\t\tresult = Some(c.rayon_wait().unwrap());\n\t\t\t\t},\n\t\t\t);\n\t\t},\n\t);\n    bootstrap.checks.register(\n        \"PERSISTED_LOCATIONS\",\n        move || if locations2.0.inner_mut.lock().poisoned {\n            Check::new(\n                State::Error,\n                \"Persisted location storage is poisoned due to a write failure\",\n            )\n        } else {\n            Check::new(State::Healthy, \"Persisted location storage is healthy\")\n        },\n    ); \n\tself.cur_type()\n\t\t.num_template_args()\n\t\t.or_else(|| {\n\t\t\tlet n: c_int = unsafe { clang_Cursor_getNumTemplateArguments(self.x) };\n\n\t\t\tif n >= 0 {\n\t\t\t\tSome(n as u32)\n\t\t\t} else {\n\t\t\t\tdebug_assert_eq!(n, -1);\n\t\t\t\tNone\n\t\t\t}\n\t\t})\n\t\t.or_else(|| {\n\t\t\tlet canonical = self.canonical();\n\t\t\tif canonical != *self {\n\t\t\t\tcanonical.num_template_args()\n\t\t\t} else {\n\t\t\t\tNone\n\t\t\t}\n\t\t});\n\n\tif let VrMsg::ClientReply {request_num: reply_req_num, value, ..} = msg {\n\t\tlet _ = safe_assert_eq!(reply_req_num, request_num, op);\n\t\treturn Ok((request_num, op, value));\n\t}\n\tpub struct FileInput {\n\t\tinput: StringInput,\n\t\tfile_name: OsString,\n\t}\n\tmatch len {\n\t\tSome(len) => Ok(new(self.input, self.pos + len)),\n\t\tNone => Err(self),\n\t}\n\t\n}\nfn x() {\n    {\n        let type_list: Vec<_> = try_opt!(types.iter().map(|ty| ty.rewrite(context, shape)).collect());\n    }\n}\nimpl Foo {\n    fn map_pixel_to_coords(&self, point: &Vector2i, view: &View) -> Vector2f {\n        unsafe {\n            Vector2f::from_raw(ffi::sfRenderTexture_mapPixelToCoords(self.render_texture, point.raw(), view.raw()))\n        }\n    }\n}\n\nextern \"C\" {\n\tpub fn GetConsoleHistoryInfo(console_history_info: *mut ConsoleHistoryInfo) -> Boooooooooooooool;\n    pub fn variadic_fn(first_parameter: FirstParameterType,\n                       second_parameter: SecondParameterType,\n                       ...); // no trailing comma\n}\n\nfn deconstruct(foo: Bar) -> (SocketAddr, Header, Method, RequestUri, HttpVersion, AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) {\n    let if_method_break: SocketAddr = if remote_addr.is_ipv4() {\n        \"0.0.0.0:0\"\n    } else {\n        \"[::]:0\"\n    }\n    .parse()?;\n    let method_chain_middle_await_break = reader\n        .next_line()\n        .await\n        .unwrap_or_else(|_| Some(String::new()))\n        .expect(\"failed to read line\");\n}\n\nfn needs_paren(op: AssocOp, other: AssocOp, dir: Associativity) -> bool {\n\tother.precedence() < op.precedence()\n\t\t|| (other.precedence() == op.precedence()\n\t\t\t&& ((op != other && associativity(op) != dir)\n\t\t\t\t|| (op == other && associativity(op) != Associativity::Both)))\n\t\t|| is_shift(op) && is_arith(other)\n\t\t|| is_shift(other) && is_arith(op)\n}\n\npub fn peel_blocks<'a>(mut expr: &'a Expr<'a>) -> &'a Expr<'a> {\n    while let ExprKind::Block(\n        Block {\n            stmts: [],\n            expr: Some(inner),\n            rules: BlockCheckMode::DefaultBlock,\n            ..\n        },\n        _,\n    ) = expr.kind\n    {\n        expr = inner;\n    }\n    expr\n}\n\npub fn target_features(sess: &Session) -> Vec<Symbol> {\n    supported_target_features(sess)\n        .iter()\n        .filter_map(\n            |&(feature, gate)| {\n                if sess.is_nightly_build() || gate.is_none() { Some(feature) } else { None }\n            },\n        )\n        .filter(|_feature| {\n            // TODO(antoyo): implement a way to get enabled feature in libgccjit.\n            false\n        })\n        .map(|feature| Symbol::intern(feature))\n        .collect()\n}\n\n\nfn a() { Arc::new(|_| { Ok(()) })}\nfn g<'a>(&self, x: usize, y:usize) -> Box<dyn Fn(bool) -> usize + 'a> {\n\tlet f = move |t: bool| if t { x } else { y };\n\treturn Box::new(f);\n}\n\nstruct Compose<F, G>(F, G);\nimpl<T, F, G> FnOnce<(T,)> for Compose<F, G>\nwhere\n    F: FnOnce<(T,)>,\n    G: FnOnce<(F::Output,)>,\n{\n    type Output = G::Output;\n    extern \"rust-call\" fn call_once(self, (x,): (T,)) -> G::Output {\n        (self.1)((self.0)(x))\n    }\n}\n\nfn build_sorted_static_get_entry_names(\n    mut entries: Vec<(u8, &'static str)>,\n) -> (impl Fn(\n    AlphabeticalTraversal,\n    Box<dyn dirents_sink::Sink<AlphabeticalTraversal>>,\n) -> BoxFuture<'static, Result<Box<dyn dirents_sink::Sealed>, Status>>\n      + Send\n      + Sync\n      + 'static) {\n}\nfn qcxbfds() {\n    {{{\n        let explicit_arg_decls =\n            explicit_arguments.into_iter()\n            .enumerate()\n            .map(|(index, (ty, pattern))| {\n                let lvalue = Lvalue::Arg(index as u32);\n                block = this.pattern(block,\n                                     argument_extent,\n                                     hair::PatternRef::Hair(pattern),\n                                     &lvalue);\n                ArgDecl { ty: ty }\n            });\n    }}}\n}\n\n#[print_target_and_args(first_outer)]\n#[print_target_and_args(second_outer)]\nimpl Bar<{1 > 0}> for Foo<{true}> {\n    #![print_target_and_args(first_inner)]\n    #![print_target_and_args(second_inner)]\n}\n\n/// `cfg(...)`'s that are feature gated.\nconst GATED_CFGS: &[GatedCfg] = &[\n    // (name in cfg, feature, function to check if the feature is enabled)\n    (sym::target_abi, sym::cfg_target_abi, cfg_fn!(cfg_target_abi)),\n    (sym::target_thread_local, sym::cfg_target_thread_local, cfg_fn!(cfg_target_thread_local)),\n    (\n        sym::target_has_atomic_equal_alignment,\n        sym::cfg_target_has_atomic_equal_alignment,\n        cfg_fn!(cfg_target_has_atomic_equal_alignment),\n    ),\n    (sym::target_has_atomic_load_store, sym::cfg_target_has_atomic, cfg_fn!(cfg_target_has_atomic)),\n    (sym::sanitize, sym::cfg_sanitize, cfg_fn!(cfg_sanitize)),\n    (sym::version, sym::cfg_version, cfg_fn!(cfg_version)),\n];\n[\n\t{\n\t\twhile let Ok(flag) = input.try_parse(|input| {\n\t\t\tOk(\n\t\t\t\tmatch_ignore_ascii_case! { &input.expect_ident().map_err(|_| ())?,\n\t\t\t\t\t\"jis78\" =>\n\t\t\t\t\t\texclusive_value!((result, VariantEastAsian::JIS78 | VariantEastAsian::JIS83 |\n\t\t\t\t\t\t\t\t\t\t\t\tVariantEastAsian::JIS90 | VariantEastAsian::JIS04 |\n\t\t\t\t\t\t\t\t\t\t\t\tVariantEastAsian::SIMPLIFIED | VariantEastAsian::TRADITIONAL\n\t\t\t\t\t\t\t\t\t\t) => VariantEastAsian::JIS78)\n\t\t\t\t\t_ => return Err(()),\n\t\t\t\t},\n\t\t\t)\n\t\t}) {\n\t\t\tresult.insert(flag);\n\t\t}\n\t}\n]\n\n#[cfg_attr(doc_cfg, doc(cfg(feature = \"beep boop\")))]\nimpl Foo for Bar {\n\tfn stuff(data: Leet) -> Result<Self> {\n\t\tlet manual_clone = node.data == Data::Private || node.ident == \"beep\";\n\t\tif data.boop(Foo) && !(data.boop(Bar) && data.boop2(Too![=])) {\n\t\t\tdata.stuff().map(A::B)\n\t\t} else if data.boop(Ident::abc)\n\t\t\t|| data.boop(Too![::]) && data.boop3(Ident::abc)\n\t\t{\n\t\t\tdata.stuff().map(NestedMeta::Meta)\n\t\t} else {\n\t\t\tErr(data.error(\"brrr\"))\n\t\t}\n\t\ts.match_indices(prefix).any(|(i, _)| { s[i + prefix.len()..].trim_start_matches('[') })\n\t\tif args.len() >= 2 && args[1] == \"fail\" {\n\t\t\tfoo();\n\t\t} else if args.len() >= 2 && args[1] == \"double-fail\" {\n\t\t\tdouble();\n\t\t} else {\n\t\t\truntest(&args[0]);\n\t\t}\n\t}\n}\n\nimpl<T1, F1, T2, F2, T3, F3, E> Future\n    for TryJoin3<F1, F2, F3>\n    where\n        F1: Future<Output = Result<T1, E>>,\n        F2: Future<Output = Result<T2, E>>,\n        F3: Future<Output = Result<T3, E>> \n{\n    fn c() {}\n}\n\nc! {\n    impl<E: A> A<E> {\n        // \n        pub(crate) unsafe fn no_extra_indent_in_params<'a>(\n            &'a self,\n            cx: &mut Context<'_>,\n            buf: &mut ReadBuf<'_>,\n        ) -> Poll<io::Result<()>>\n        where\n            &'a E: io::Read + 'a,\n        {}\n    }\n    pub trait AsyncBufReadExt: AsyncBufRead {\n        fn read_until<'a>(&'a mut self, byte: u8, buf: &'a mut Vec<u8>) -> ReadUntil<'a, Self>\n            where Self: Unpin {\n            read_until(self, byte, buf)\n        }\n    }\n}\n\nlet BufWriter {\n    inner:\n        BufReader {\n            inner,\n            buf: rbuf,\n            pos,\n            cap,\n            seek_state: rseek_state,\n        },\n    buf: wbuf,\n    written,\n    seek_state: wseek_state,\n} = b;\n\n{\n    {\n        fn clock(){\n            match CONTEXT.try_with(|ctx| (*ctx.borrow()).as_ref().map(|ctx| ctx.as_inner().clock.clone())) {}\n            match s.match_indices(prefix).any(|(i, _)| { s[i + prefix.len()..].trim_start_matches('[') }) {}\n            match a //\n            && b {}\n        }\n    }\n}\n\npub(super) fn shutdown(self) {\n    let (task1, _) = super::unowned(async {});\n    let (task2, _) = super::unowned(async { 1 });\n    let (task3, _) = super::unowned(async { f(); 2 });\n    let vtable = self.header().vtable;\n    unsafe { (vtable.shutdown)(self.ptr) }\n}\n\nfn inlining_last_if_else_block_is_awkward() {\n    poll_fn(move |cx| {\n        if !fired {\n            return Poll::Pending;\n        }\n        \n        if gate.load(SeqCst) {\n            Poll::Ready\n        } else {\n            Poll::Pending\n        }\n    })\n}\n\npub(super) fn vtable<T: Future, S: Schedule>() -> &'static Vtable {\n    &(Vtable {\n        poll: poll::<T, S>,\n        dealloc: dealloc::<T, S>,\n        try_read_output: try_read_output::<T, S>,\n        try_set_join_waker: try_set_join_waker::<T, S>,\n        drop_join_handle_slow: drop_join_handle_slow::<T, S>,\n        drop_abort_handle: drop_abort_handle::<T, S>,\n        remote_abort: remote_abort::<T, S>,\n        shutdown: shutdown::<T, S>,\n    })\n}\n\n// comment\nconst ________________ = self.exp != S::MIN_EXP && (self.sig[0] & sig_mask) == 0;\n\nlet r = if s.starts_with(\"0x\") || s.starts_with(\"0X\") {\n\tzzzzzzzzzzzzzz\n} else {\n\t2\n};\n\npub trait Float:\n    Copy +\n        Default +\n        FromStr<Err = ParseError> +\n        PartialOrd +\n        fmt::Display +\n        Neg<Output = Self> +\n        AddAssign +\n        SubAssign +\n        MulAssign +\n        DivAssign +\n        RemAssign +\n        Add<Output = StatusAnd<Self>> +\n        Sub<Output = StatusAnd<Self>> +\n        Mul<Output = StatusAnd<Self>> +\n        Div<Output = StatusAnd<Self>> +\n        Rem<Output = StatusAnd<Self>> {\n    const BITS: usize;\n}\n\n// print-width: 80 -------------------------------------------------------------\n\nfn space_before_where</**/>(_: F) where F: X {}\n\nimpl<'a, I, T: 'a, E> Iterator for Y<'a, I, E> where I: Iterator<Item = &'a (T, E)>,{}\n\nimpl<'a, I, T: 'a, E> IteratorIterator for Y<'a, I, E> where I: Iterator<Item = &'a (T, E)>,{}\n\nimpl<'a, I, T: 'a, E> Iterator for Y<'a, I, E> where I: Iterator<Item = &'a (T, E)>,{\n    type Y;\n}\n\nprettier_always_breaks_this(b(|| ()), c);\n\nself.and_this() .map(|| 1) .unwrap_or(0);\n\npub fn noop_visit_constraint<T: MutVisitor>(\n    AssocConstraint { id, ident, gen_args, kind, span }: &mut AssocConstraint,\n    vis: &mut T,\n) {}\n\nmatch kind {\n  AssocConstraintKind::Equality { ref mut term } => {\n    1\n  }\n}\n\nimpl X {\n    pub fn ident(&self) -> Option<Ident> {\n        match self.kind {\n            AttrKind::Normal(ref item, _) => {\n                if item.path.segments.len() == 1 {\n                    Some(item.path.segments[0].ident)\n                } else {\n                    None\n                }\n            }\n            AttrKind::DocComment(..) => None,\n        }\n    }\n}\n\n#![attr] // comment to the right of attr\n\n/*\n*/\n\na!(/**/);\n\nThing(/* _______ */);\npub /* _______ */ const a = {};\n\nconst a = \"💖\"\n// ______________\n// _______ _______ _______\n\n/*\n _______\n*/ foo /*\n _______\n*/;\n\nthis.call(a, /* _______ */ b);\n\n/*\nfoo\n\ntext\n*/\n\n/*\nfn a() {\n    println!(\"b\");\n}\n// */\n\n#[a=\"a\"]\n#[b] // v\n#[cfg_attr(rustfmt, rustfmt::skip)]\npub static x: [i32; 0] = [];\n\nf!()/* comment */;\nf!{}/* comment */;\nf![]/* comment */;\n\npub enum Foo {\n    A, // `/** **/`\n    B, // `/*!`\n    C,\n}\n\nProcessSystemError(A {\n  code: acc.error.code, // _______\n  originalError: acc.error, // _______\n});\n\nfoo(A {}\n  // _______\n);\n\nfn c() {} /*\n          a\n\n          b\n          */\n\nconst f = static async |source, block, opts| {\n  for entry in source {\n    yield async move || {\n      const cid = persist(entry.content.serialize(), block, opts).await;\n      return A {\n        cid,\n        path: entry.path,\n        unixfs: UnixFS.unmarshal(entry.content.Data),\n        node: entry.content\n      }\n    }\n  }\n};\n\n\ntype Expect_Parenthesized_dyn = Pin<&mut (dyn Future<Output = T> + Send)>;\n\nlet mut Expect_Comma_after_first_match = match 0 {\n    RuntimeFlavor::CurrentThread => quote_spanned! {last_stmt_start_span=>\n        #crate_ident::runtime::Builder::new_current_thread()\n    },\n    RuntimeFlavor::Threaded => quote_spanned! {last_stmt_start_span=>\n        #crate_ident::runtime::Builder::new_multi_thread()\n    },\n};\n\nExpectNoSpreadComma { ..a//\n};\nExpectNoSpreadComma { ..a,//\n};\nExpectNoSpreadComma { a, b: b, ..c//\n};\nExpectNoSpreadComma { a, ..c,//\nb: b\n};\nExpectNoSpreadComma { .., a//\n};\nExpectNoSpreadComma { ..//\n};\n\nlet notify::event::Event {\n    kind: notify::event::EventKind::Modify(_),\n    paths,\n    ..\n} = event;\n\nlet notify::event::Event {\n    ..,\n    kind: notify::event::EventKind::Modify(_),\n    paths,\n} = event;"
  },
  {
    "path": "tests/samples/issues/14.rs",
    "content": "[10.00, 10.0, 10., 10];"
  },
  {
    "path": "tests/samples/issues/21/fn_comment.rs",
    "content": "fn eof() {}\n// comment"
  },
  {
    "path": "tests/samples/issues/21/fn_fn.rs",
    "content": "fn eof1() {}\nfn eof2() {}"
  },
  {
    "path": "tests/samples/issues/21/fn_ln.rs",
    "content": "fn eof() {}\n"
  },
  {
    "path": "tests/samples/issues/21/ln_fn_ln.rs",
    "content": "\nfn eof(){}\n"
  },
  {
    "path": "tests/samples/issues/21/mod.rs",
    "content": "mod eof {}"
  },
  {
    "path": "tests/samples/issues/22.rs",
    "content": "fn preserve_last_semicolon() {\n\tif let Some(left) = node.borrow().left.as_ref() {\n\t\tdeque.push_back(left.clone());\n\t};\n\tif let Some(right) = node.borrow().right.as_ref() {\n\t\tdeque.push_back(right.clone());\n\t};\n}\n\nfn a() {\n    if let Ok(_) = lock.try_lock() {};\n}\n\nfn b() {\n    let lock = std::sync::Mutex::new(10);\n    match lock.try_lock() {\n\t\tOk(_) => {}\n\t\tErr(_) => {}\n\t};\n    match lock.try_lock() {\n\t\tOk(_) => {}\n\t\tErr(_) => {}\n\t};\n}\n\nfn c() {\n    if let Ok(_) = lock.try_lock() {};\n\t// comment\n}\n\nfn d() {\n    if let Ok(_) = lock.try_lock() {}; // comment\n}\n\nfn e() {\n    if let Ok(_) = lock.try_lock() {}/** comment */;\n}\n\nfn f() {\n    if let Ok(_) = lock.try_lock() {\n\n\t}\n\t;\n}\n\nfn g() {\n    if let Ok(_) = lock.try_lock() {\n\t\t\n\t}\n\t// comment\n\t;\n}\n\nfn h() {\n\tif let Ok(_) = lock {};\n\tif let Ok(_) = lock {};\n}\n\nfn i() {\n\tmatch lock {};\n\tmatch lock {};\n}\n\nfn inner_attr() {\n    if let Ok(_) = lock.try_lock() {};\n\t#![attr]\n}"
  },
  {
    "path": "tests/samples/issues/25.rs",
    "content": "#[ generator(  yield(  i32  )  )]\nfn nums() {\n    yield_!(3);\n}\n\n// some extra samples to track changes\n#[\n// 0    \ngenerator\n// 1\n(\n// 2\nyield\n// 3\n(\n// 4\ni32\n// 5\n)\n// 6\n)\n// 7\n]\n\n// non-conventional syntax (does not format)\n#[  #[a] generator(  #[b] yield(  #[c] i32  ))]\n#[generator  (a(  #[generator(b(i32))]   i32  )  )  ]\n#[generator  (a(  #[generator(yield(i32))]   i32  )  )  ]\n#[generator  (yield(  #[generator(b(i32))]   i32  )  )  ]\n#[generator  (yield(  #[generator(yield(i32))]   i32  )  )  ]\nfn f() {\n    yield_!(3);\n}\n\n// macros in attr (does not format)\n#[attr(foo!(   ))]\nfn f() {}"
  },
  {
    "path": "tests/samples/issues/nth-pass.rs",
    "content": "// prettier for javascript cannot format those in one pass\n\nreturn (\n\t// _______\n\t42\n  ) * 84 + 2;\n  return (\n\t// _______\n\t42\n  ) + 84 * 2;\n\n    foo // foo\n        // comment after parent\n        .x\n        .y\n        // comment 1\n        .bar() // comment after bar()\n  // comment 2\n        .foobar\n  // comment after\n        // comment 3\n        .baz(x, y, z);\n\nlet zzzz = expr?   // comment after parent\n// comment 0\n.another??? // comment 1\n.another????  // comment 2\n.another? // comment 3\n.another?;\n\n[\n  a = b,\n  \n  c //\n];"
  },
  {
    "path": "tests/samples/macros/cfg_if.rs",
    "content": "[\n    cfg_if! { if #[cfg(def)]{ use std; 0 } },\n\tcfg_if! { if #[cfg(def)]{ use std; 0 } else { 1 } },\n    cfg_if! { if #[cfg(abc)]{ 0 } else { 1 } },\n    cfg_if! { if #[cfg(abc)]{ 0 } else if #[cfg(def)] { 1 } },\n    cfg_if! { if #[cfg(abc)]{ 0 } else if #[cfg(def)] { 1 } else { 0 } },\n\n    cfg_if! {},\n    cfg_if! { // comment\n        if #[cfg(abc)] { 0 } },\n    cfg_if! { \n        if #[cfg(abc)] { \n            /// comment\n            /// comment\n            /// comment\n            struct A{\n                //! comment\n                a: u8\n            }\n         } },\n    cfg_if! { \n        if #[cfg(abc)] { \n            struct A{\n                //! comment\n                // comment\n                /// comment\n                a: u8\n            }\n         } },\n    cfg_if! { \n        if #[cfg(abc)] { \n            struct A{\n                /// comment\n                a: u8\n            }\n         }\n    },\n    cfg_if! { \n        if #[cfg(abc)] { \n            struct A{\n                //! comment\n            }\n         }\n    },\n    cfg_if! { \n        if #[cfg(abc)] { \n            struct A{\n                /// comment\n            }\n         }\n    },\n    cfg_if! { if true{} }\n]"
  },
  {
    "path": "tests/samples/macros/if_chain.rs",
    "content": "[\n\tif_chain! {\n\t\tif let Some(a) = b;\n\t\tif let Err(a) = b;\n\t\tlet (a, b) = c;\n\t\tif 1 + 2;\n\t\tthen { d=0; }\n\t},\n\tif_chain! {\n\t\tthen { d=0; }\n\t},\n\tif_chain! {\n\t\tthen { d=0; }\n\t\telse { d!(); }\n\t},\n\tif_chain! {\n\t\tif let A::B | A::C = D;\n\t\tthen { 0 } else { 1 }\n\t},\n\tif_chain! {\n\t\tlet Ok(a) | Err(b) = c;\n\t\tthen { d!(); }\n\t\telse { d!(); }\n\t},\n\tif_chain! {\n\t\tif 1 + 1;\n\t\tlet a: u32 = 3;\n\n\t\tthen { d!(); }\n\t\telse { d!(); }\n\t}\n]"
  },
  {
    "path": "tests/samples/macros/matches.rs",
    "content": "[\n\tmatches!(1 + 1,   Some(_)                     ),\n\tmatches!(1 + 1,   Some(_) | None if 1 + 1 == 2),\n\tmatches!(1 + 1, | Some(_) | None if 1 + 1 == 2)\n]"
  },
  {
    "path": "tests/samples/styling/blockify.rs",
    "content": "[\n\t|| 0,\n\t|| match 0 {},\n\t|| if 0 {},\n\t|| loop {},\n\t|| const {},\n\t|| async {},\n\n\t|| -> T 0,\n\t|| -> T match 0 {},\n\t|| -> T if 0 {},\n\t|| -> T loop {},\n\t|| -> T const {},\n\t|| -> T async {}\n]"
  },
  {
    "path": "tests/samples/styling/canInlineBlockBody.rs",
    "content": "[\n\t{ if 0 { 0 } },\n\t{ if 0 { 0 } else { 0 } },\n\t{ while 0 { 0 } },\n\t{ unsafe { 0 } },\n\t\n\t{ 0; if 0 { 0 } },\n\t{ 0; if 0 { 0 } else { 0 } },\n\t{ 0; while 0 { 0 } },\n\t{ 0; unsafe { 0 } },\n\n\tf(async {}),\n\tf(async { 1 }),\n\tf(async { 1; }),\n\n\t{ async {} },\n\t{ async { 1 } },\n\t{ async { 1; } },\n\t\n\t{ 0; async {} },\n\t{ 0; async { 1 } },\n\t{ 0; async { 1; } },\n\n\tif (0 as u8) < 1 {} else {},\n\t{ 0; if (0 as u8) < 1 {} else {} },\n\tif (0 as u8) < 1 {} else if (0 as u8) < 1 {},\n\n\tif 0 {} else { 0; },\n\tif 0 {} else if 1 { 0; } else {},\n\tif 0 {} else if 1 {} else { 0; },\n\n\tif 0 { 0; } else {},\n\n\tif 0 { 0; } else { 2 },\n\tif 0 { 2 } else { 0; },\n\n\tmatch 0 {\n\t\t0 => 0,\n\t\t0 => { 0 }\n\t},\n\n\tf(if 0 { 1 } else { 2 }),\n\tf({0;}, if 0 { 1 } else { 2 }),\n\t0 + (if 0 { 1 } else { 2 }),\n\t{ 0 + (if 0 { 1 } else { 2 }) },\n\t({0;}) + (if 0 { 1 } else { 2 }),\n\t\n\tmatch 0 {\n\t\t0 => break 0,\n\t\t0 => (o = 0),\n\t\t0 => match 0 {},\n\t\t0 => if 0 {} else {},\n\t\t0 => if 0 {},\n\t},\n\n\t|| loop {\n\t\tmatch 0 {\n\t\t\t0 => break 0,\n\t\t\t0 => (o = 0),\n\t\t\t0 => match 0 {},\n\t\t\t0 => if 0 {} else {},\n\t\t\t0 => if 0 {},\n\t\t}\n\t}\n]\n\n"
  },
  {
    "path": "tests/samples/styling/needsParens.rs",
    "content": "let (A {} | a() | []) = ();\nif let (A {} | a() | []) = () {}\n\ntype A: B + C;\ntype A: impl B + C;\n\ntrait A = B + C;\ntrait A = impl B + C;"
  },
  {
    "path": "tests/samples/styling/needsSemi.rs",
    "content": "fn f() {\n\t#[cfg(unix)] { 0 }\n\t#[cfg(windows)] { 1 }\n}"
  },
  {
    "path": "tests/test.build.ts",
    "content": "import { exec } from \"node:child_process\";\nimport { inspect, promisify } from \"node:util\";\nimport prettier from \"prettier\";\nimport { testBuilds } from \"../ext/jinx-rust/scripts/utils/build\";\n// import * as plugin_esm from \"../index.js\";\nimport plugin from \"../src/index\";\n\n// test esm import\nawait promisify(exec)('node -e \"import(`./index.js`)\"');\n\ntestBuilds(\n\tplugin,\n\t{\n\t\tesm: await import(\"../index.js\"),\n\t\tcjs: (await import(\"../index.cjs\")).default,\n\t},\n\tfunction formatWithPlugin(file, plugin) {\n\t\ttry {\n\t\t\treturn {\n\t\t\t\text: \"rs\",\n\t\t\t\tcontent: prettier.format(file.content, {\n\t\t\t\t\tparser: \"jinx-rust\",\n\t\t\t\t\tplugins: [plugin],\n\t\t\t\t\tprintWidth: 80,\n\t\t\t\t\ttabWidth: 2,\n\t\t\t\t\tfilepath: file.cmd,\n\t\t\t\t}),\n\t\t\t};\n\t\t} catch (e) {\n\t\t\treturn {\n\t\t\t\text: \"rs\",\n\t\t\t\tcontent: inspect(e, { showHidden: true, getters: true }),\n\t\t\t};\n\t\t}\n\t},\n\t[\"tests/samples\", \"ext/jinx-rust/tests/samples\"]\n);\n"
  },
  {
    "path": "tsconfig.base.json",
    "content": "{\n\t\"compilerOptions\": {\n\t\t\"target\": \"ES2020\", // upper target changes property order\n\n\t\t// module\n\t\t\"module\": \"ESNext\",\n\t\t\"moduleResolution\": \"Node\",\n\t\t\"esModuleInterop\": true,\n\n\t\t// types\n\t\t\"lib\": [\"ESNext\"],\n\t\t\"skipLibCheck\": true,\n\t\t\"skipDefaultLibCheck\": true,\n\n\t\t// checks\n\t\t\"allowUnusedLabels\": true,\n\t\t\"exactOptionalPropertyTypes\": true,\n\t\t\"noFallthroughCasesInSwitch\": true,\n\n\t\t// strict\n\t\t\"strict\": true,\n\t\t\"noImplicitAny\": false,\n\t\t\"strictFunctionTypes\": false,\n\t\t\"strictPropertyInitialization\": false,\n\n\t\t// Project\n\t\t\"composite\": true,\n\t\t\"isolatedModules\": true\n\t},\n\t\"ts-node\": {\n\t\t\"esm\": true,\n\t\t\"swc\": true,\n\t\t\"experimentalSpecifierResolution\": \"node\"\n\t}\n}\n"
  },
  {
    "path": "tsconfig.build.json",
    "content": "{\n\t\"extends\": \"./tsconfig.base.json\",\n\t\"include\": [\"src\"],\n\t\"compilerOptions\": {\n\t\t// \"declaration\": true,\n\t\t// \"declarationDir\": \"dist\",\n\t\t// \"emitDeclarationOnly\": true,\n\n\t\t// \"outDir\": \"dist\",\n\t\t// \"rootDir\": \"src\",\n\t\t// \"rootDirs\": [\"src\", \"dist\"],\n\t\t\"composite\": false,\n\t\t\"isolatedModules\": false,\n\t\t\"preserveConstEnums\": false\n\t\t// \"removeComments\": false\n\t}\n}\n"
  },
  {
    "path": "tsconfig.json",
    "content": "{\n\t\"extends\": \"./tsconfig.base.json\",\n\t\"include\": [\"src\"],\n\t\"compilerOptions\": {\n\t\t\"types\": [\"prettier\", \"jinx-rust\"],\n\t\t\"rootDir\": \"src\"\n\t}\n}\n"
  }
]