[
  {
    "path": ".editorconfig",
    "content": "root = true\n\n[*]\ncharset = utf-8\n\n[*.{json,toml,yml,gyp}]\nindent_style = space\nindent_size = 2\n\n[*.js]\nindent_style = space\nindent_size = 2\n\n[*.scm]\nindent_style = space\nindent_size = 2\n\n[*.{c,cc,h}]\nindent_style = space\nindent_size = 4\n\n[*.rs]\nindent_style = space\nindent_size = 4\n\n[*.{py,pyi}]\nindent_style = space\nindent_size = 4\n\n[*.swift]\nindent_style = space\nindent_size = 4\n\n[*.go]\nindent_style = tab\nindent_size = 8\n\n[Makefile]\nindent_style = tab\nindent_size = 8\n\n[parser.c]\nindent_size = 2\n\n[{alloc,array,parser}.h]\nindent_size = 2\n"
  },
  {
    "path": ".envrc",
    "content": "use nix\n"
  },
  {
    "path": ".git-blame-ignore-revs",
    "content": "# Move queries to ./queries/scala sub-directory\n889eb65aea8e0f9ce1694ab9ee528df1fa5f75d1\n\n# Formatting using Prettier\n0a8ca4c836d7e9f0fd6a0668088c0d82874abc85\n"
  },
  {
    "path": ".gitattributes",
    "content": "* text=auto eol=lf\n\n# Generated source files\nsrc/*.json linguist-generated\nsrc/parser.c linguist-generated\nsrc/tree_sitter/* linguist-generated\n\n# C bindings\nbindings/c/* linguist-generated\nCMakeLists.txt linguist-generated\nMakefile linguist-generated\n\n# Rust bindings\nbindings/rust/* linguist-generated\nCargo.toml linguist-generated\nCargo.lock linguist-generated\n\n# Node.js bindings\nbindings/node/* linguist-generated\nbinding.gyp linguist-generated\npackage.json linguist-generated\npackage-lock.json linguist-generated\n\n# Python bindings\nbindings/python/** linguist-generated\nsetup.py linguist-generated\npyproject.toml linguist-generated\n\n# Go bindings\nbindings/go/* linguist-generated\ngo.mod linguist-generated\ngo.sum linguist-generated\n\n# Swift bindings\nbindings/swift/** linguist-generated\nPackage.swift linguist-generated\nPackage.resolved linguist-generated\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.yml",
    "content": "name: Bug Report\ndescription: Create an issue in tree-sitter-scala\nbody:\n  - type: input\n    id: commit\n    attributes:\n      label: Commit of tree-sitter-scala you tested this on\n      description: |\n        Make sure you're validating you're on the latest commit of\n        tree-sitter-scala. Note that depending on where you're experiencing the\n        issue there is a chance you're on an old commit.\n    validations:\n      required: true\n\n  - type: textarea\n    id: code-sample\n    attributes:\n      label: A code sample showing the error\n      description: Try to minimize the code sample as much as possible\n      placeholder: |\n        ```scala\n          val y = x match {\n            case A(_) if a => 1\n          }\n        ```\n    validations:\n      required: true\n\n  - type: textarea\n    id: error\n    attributes:\n      label: Show the error node\n      description: Show us the output and where the ERROR node is appearing\n      placeholder: |\n        Check out [Obtaining an Error Reproduction](../../CONTRIBUTING.md#obtaining-an-error-reproduction)\n        in the CONTRIBUTING docs if you're unsure how to get this.\n\n        ```\n        (compilation_unit [0, 0] - [4, 0]\n          (val_definition [0, 0] - [2, 1]\n            pattern: (identifier [0, 4] - [0, 5])\n            value: (match_expression [0, 8] - [2, 1]\n              value: (identifier [0, 8] - [0, 9])\n              body: (case_block [0, 16] - [2, 1]\n                (ERROR [1, 2] - [2, 0]\n                  (case_class_pattern [1, 7] - [1, 11]\n                    type: (type_identifier [1, 7] - [1, 8])\n                    pattern: (wildcard [1, 9] - [1, 10]))\n                  (lambda_expression [1, 15] - [2, 0]\n                    (identifier [1, 15] - [1, 16])\n                    (integer_literal [1, 20] - [1, 21])))))))\n        ```\n    validations:\n      required: true\n\n  - type: textarea\n    id: expectation\n    attributes:\n      label: What do you expect the tree to look like\n      description: Show us what you expect the tree to look like\n\n  - type: input\n    id: where\n    attributes:\n      label: Where are you experiencing this error?\n      description: Let us know where you're seeing this error (nvim-treesitter etc)\n"
  },
  {
    "path": ".github/workflows/ci.yml",
    "content": "name: Build/test\non:\n  push:\n  pull_request:\n    branches:\n      - master\n\njobs:\n  changedfiles:\n    runs-on: ubuntu-latest\n    outputs:\n      all: ${{ steps.changes.outputs.all}}\n      c: ${{ steps.changes.outputs.c }}\n      gen: ${{ steps.changes.outputs.gen }}\n    steps:\n      - name: checkout tree-sitter-scala\n        uses: actions/checkout@v6\n        with:\n          fetch-depth: 10\n\n      - name: Get changed files\n        id: changes\n        run: |\n          echo \"all=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | xargs)\" >> $GITHUB_OUTPUT\n          echo \"c=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\\.\\(c\\|h\\)$' | xargs)\" >> $GITHUB_OUTPUT\n          # Generated C code\n          echo \"gen=$(git diff --name-only --diff-filter=ACMRT ${{ github.event.pull_request.base.sha }} ${{ github.sha }} | grep '\\.\\(c\\)$' | grep -v 'src/scanner.c' | grep -v 'bindings/python/tree_sitter_scala/binding.c' | xargs)\" >> $GITHUB_OUTPUT\n\n  test:\n    runs-on: ${{ matrix.os }}\n    needs: changedfiles\n    strategy:\n      fail-fast: true\n      matrix:\n        os: [ubuntu-latest, macos-latest, windows-latest]\n    steps:\n      - name: checkout tree-sitter-scala\n        uses: actions/checkout@v6\n        with:\n          fetch-depth: 10\n\n      - name: checkout scala/scala\n        if: ${{ runner.os == 'Linux' }}\n        uses: actions/checkout@v6\n        with:\n          repository: scala/scala\n          ref: v2.13.14\n          path: scala_scala\n\n      - name: checkout scala/scala3\n        if: ${{ runner.os == 'Linux' }}\n        uses: actions/checkout@v6\n        with:\n          repository: scala/scala3\n          ref: 3.5.2\n          path: dotty\n\n      - name: checkout lichess-org/lila\n        if: ${{ runner.os == 'Linux' }}\n        uses: actions/checkout@v6\n        with:\n          repository: lichess-org/lila\n          ref: 83e61b9ef617164fe1d3a5112fcc611d0e5a7ea9\n          path: lila\n\n      - name: checkout nvim-treesitter/nvim-treesitter\n        if: ${{ runner.os == 'Linux' }}\n        uses: actions/checkout@v6\n        with:\n          repository: nvim-treesitter/nvim-treesitter\n          path: nvim_treesitter\n\n      - uses: actions/setup-node@v6\n        with:\n          node-version: 24\n\n      - name: Set up tree-sitter\n        uses: tree-sitter/setup-action/cli@v2\n        with:\n          # Change also on sync.yaml\n          tree-sitter-ref: v0.26.8\n\n      - name: Generate parser from scratch and test it\n        shell: bash\n        run: tree-sitter generate\n\n      - name: Run parser and binding tests\n        uses: tree-sitter/parser-test-action@v2\n        with:\n          generate: false\n          test-rust: true\n          test-node: false\n          test-python: true\n          test-go: true\n          test-swift: false\n\n      - name: Parse sample files\n        uses: tree-sitter/parse-action@v4\n        id: parse-files\n        with:\n          files: examples/**\n\n      - name: Check fidelity of checked-in C code\n        if: ${{ runner.os == 'Linux' && needs.changedfiles.outputs.gen }}\n        shell: bash\n        run: |\n          # `git diff --quiet` doesn't seem to work on Github Actions\n          changes=$(git diff --name-only --diff-filter=ACMRT | xargs)\n          if [ ! -z \"$changes\" ]; then\n            echo \"::error file=grammar.js::Generated $changes differs from the checked in version\"\n            git diff --exit-code\n            exit 1\n          fi\n\n      - name: Smoke test\n        if: ${{ runner.os == 'Linux' }}\n        shell: bash\n        env:\n          SCALA_SCALA_DIR: scala_scala\n          DOTTY_DIR: dotty\n          LILA_DIR: lila\n        run: script/smoke_test.sh\n\n      - name: Check that prettier exists\n        if: ${{ runner.os == 'Linux' }}\n        run: |\n          npm install\n          export PATH=./node_modules/.bin:$PATH\n          prettier --write --ignore-unknown grammar.js\n\n      - name: copy nvim-treesitter queries\n        if: ${{ runner.os == 'Linux' }}\n        shell: bash\n        run: cp ./nvim_treesitter/runtime/queries/scala/*.scm ./queries/\n\n      - name: Check if queries are out of sync with nvim-treesitter\n        if: ${{ runner.os == 'Linux' }}\n        uses: tj-actions/verify-changed-files@v19\n        id: verify-changed-files\n        with:\n          files: |\n            queries/*.scm\n\n      # TODO: uncomment when this works\n      # - name: Test quries if out of sync with nvim-treesitter\n      #   if: steps.verify-changed-files.outputs.files_changed == 'true'\n      #   run: |\n      #     echo \"::warning Queries in ${{ steps.verify-changed-files.outputs.changed_files }} in this repo are out of sync with nvim-treesitter\"\n      #     git diff queries/\n      #     npm run test\n"
  },
  {
    "path": ".github/workflows/fuzz.yml",
    "content": "name: Fuzz Parser\n\non:\n  push:\n    branches: [master]\n    paths:\n      - src/scanner.c\n  pull_request:\n    paths:\n      - src/scanner.c\n\njobs:\n  fuzz:\n    runs-on: ubuntu-latest\n    steps:\n      - name: Checkout repository\n        uses: actions/checkout@v6\n      - name: Run fuzzer\n        uses: tree-sitter/fuzz-action@v4\n"
  },
  {
    "path": ".github/workflows/publish.yml",
    "content": "name: Publish packages\n\non:\n  push:\n    tags: [\"*\"]\n\npermissions:\n  contents: write\n  id-token: write\n  attestations: write\n\njobs:\n  github:\n    uses: tree-sitter/workflows/.github/workflows/release.yml@6a7388cecfbc00765d032b2fca8f8abbe092ae8d\n    with:\n      generate: true\n  npm:\n    uses: tree-sitter/workflows/.github/workflows/package-npm.yml@6a7388cecfbc00765d032b2fca8f8abbe092ae8d\n    secrets:\n      NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}\n    with:\n      generate: true\n  crates:\n    uses: tree-sitter/workflows/.github/workflows/package-crates.yml@6a7388cecfbc00765d032b2fca8f8abbe092ae8d\n    secrets:\n      CARGO_REGISTRY_TOKEN: ${{secrets.CARGO_REGISTRY_TOKEN}}\n    with:\n      generate: true\n  pypi:\n    uses: tree-sitter/workflows/.github/workflows/package-pypi.yml@6a7388cecfbc00765d032b2fca8f8abbe092ae8d\n    secrets:\n      PYPI_API_TOKEN: ${{secrets.PYPI_API_TOKEN}}\n    with:\n      generate: true\n"
  },
  {
    "path": ".github/workflows/sync.yml",
    "content": "name: \"Check changes and sync\"\non:\n  workflow_dispatch:\n  schedule:\n    - cron: 0 5 * * *\n\njobs:\n  check-and-sync:\n    runs-on: ubuntu-latest\n    if: github.repository == 'tree-sitter/tree-sitter-scala'\n    outputs:\n      all: ${{ steps.changes.outputs.all}}\n      c: ${{ steps.changes.outputs.c }}\n    steps:\n      - name: checkout tree-sitter-scala\n        uses: actions/checkout@v6\n        with:\n          fetch-depth: 10\n\n      - name: Set up tree-sitter\n        uses: tree-sitter/setup-action/cli@v2\n        with:\n          tree-sitter-ref: v0.26.8\n\n      - name: Generate parser from scratch\n        shell: bash\n        run: tree-sitter generate\n\n      - name: Format Javascipt\n        run: |\n          npm install\n          export PATH=./node_modules/.bin:$PATH\n          prettier --write --ignore-unknown grammar.js\n\n      - name: Check for changes\n        uses: tj-actions/verify-changed-files@v19\n        id: verify-changed-files\n        with:\n          files: |\n            bindings/c/tree-sitter-scala.h\n            bindings/c/tree-sitter-scala.pc.in\n            grammar.js\n            src/grammar.json\n            src/node-types.json\n            src/parser.c\n            src/tree_sitter/alloc.h\n            src/tree_sitter/array.h\n            src/tree_sitter/parser.h\n\n      - name: Commit changes if necessary\n        if: steps.verify-changed-files.outputs.files_changed == 'true'\n        run: |\n          git config user.name \"GitHub\"\n          git config user.email \"noreply@github.com\"\n          git add .\n          LAST_COMMIT=$(git log --format=\"%H\" -n 1)\n          git commit -m \"chore: generate and sync from $LAST_COMMIT\"\n          git clean -xf\n\n      - name: Create Pull Request\n        if: steps.verify-changed-files.outputs.files_changed == 'true'\n        uses: peter-evans/create-pull-request@v8\n        with:\n          title: \"chore: generate and sync latest changes\"\n          branch: generation\n          base: ${{ github.head_ref }}\n\n      - name: No changes detected\n        if: steps.verify-changed-files.outputs.files_changed == 'false'\n        run: echo \"No changes detected\"\n"
  },
  {
    "path": ".gitignore",
    "content": "# Rust artifacts\ntarget/\n\n# Node artifacts\nbuild/\nprebuilds/\nnode_modules/\n\n# Swift artifacts\n.build/\n\n# Go artifacts\n_obj/\n\n# Python artifacts\n.venv/\ndist/\n*.egg-info\n*.whl\n\n# C artifacts\n*.a\n*.so\n*.so.*\n*.dylib\n*.dll\n*.pc\n\n# Example dirs\n/examples/*/\n\n# Grammar volatiles\n*.wasm\n*.obj\n*.o\n\n# Archives\n*.tar.gz\n*.tgz\n*.zip\n\n# Scala tooling\n.metals\n.bsp\n.scala-build\n\n# AI assistants\n.aider*\n"
  },
  {
    "path": ".prettierrc.json",
    "content": "{\n  \"arrowParens\": \"avoid\"\n}\n"
  },
  {
    "path": "CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.13)\n\nproject(tree-sitter-scala\n        VERSION \"0.26.0\"\n        DESCRIPTION \"Scala grammar for tree-sitter\"\n        HOMEPAGE_URL \"https://github.com/tree-sitter/tree-sitter-scala\"\n        LANGUAGES C)\n\noption(BUILD_SHARED_LIBS \"Build using shared libraries\" ON)\noption(TREE_SITTER_REUSE_ALLOCATOR \"Reuse the library allocator\" OFF)\n\nset(TREE_SITTER_ABI_VERSION 15 CACHE STRING \"Tree-sitter ABI version\")\nif(NOT ${TREE_SITTER_ABI_VERSION} MATCHES \"^[0-9]+$\")\n    unset(TREE_SITTER_ABI_VERSION CACHE)\n    message(FATAL_ERROR \"TREE_SITTER_ABI_VERSION must be an integer\")\nendif()\n\ninclude(GNUInstallDirs)\n\nfind_program(TREE_SITTER_CLI tree-sitter DOC \"Tree-sitter CLI\")\n\nadd_custom_command(OUTPUT \"${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json\"\n                          \"${CMAKE_CURRENT_SOURCE_DIR}/src/node-types.json\"\n                   DEPENDS \"${CMAKE_CURRENT_SOURCE_DIR}/grammar.js\"\n                   COMMAND \"${TREE_SITTER_CLI}\" generate grammar.js --no-parser\n                   WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"\n                   COMMENT \"Generating grammar.json\")\n\nadd_custom_command(OUTPUT \"${CMAKE_CURRENT_SOURCE_DIR}/src/parser.c\"\n                   BYPRODUCTS \"${CMAKE_CURRENT_SOURCE_DIR}/src/tree_sitter/parser.h\"\n                              \"${CMAKE_CURRENT_SOURCE_DIR}/src/tree_sitter/alloc.h\"\n                              \"${CMAKE_CURRENT_SOURCE_DIR}/src/tree_sitter/array.h\"\n                   DEPENDS \"${CMAKE_CURRENT_SOURCE_DIR}/src/grammar.json\"\n                   COMMAND \"${TREE_SITTER_CLI}\" generate src/grammar.json\n                            --abi=${TREE_SITTER_ABI_VERSION}\n                   WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"\n                   COMMENT \"Generating parser.c\")\n\nadd_library(tree-sitter-scala src/parser.c)\nif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/src/scanner.c)\n  target_sources(tree-sitter-scala PRIVATE src/scanner.c)\nendif()\ntarget_include_directories(tree-sitter-scala\n                           PRIVATE src\n                           INTERFACE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/bindings/c>\n                                     $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)\n\ntarget_compile_definitions(tree-sitter-scala PRIVATE\n                           $<$<BOOL:${TREE_SITTER_REUSE_ALLOCATOR}>:TREE_SITTER_REUSE_ALLOCATOR>\n                           $<$<CONFIG:Debug>:TREE_SITTER_DEBUG>)\n\nset_target_properties(tree-sitter-scala\n                      PROPERTIES\n                      C_STANDARD 11\n                      POSITION_INDEPENDENT_CODE ON\n                      SOVERSION \"${TREE_SITTER_ABI_VERSION}.${PROJECT_VERSION_MAJOR}\"\n                      DEFINE_SYMBOL \"\")\n\nconfigure_file(bindings/c/tree-sitter-scala.pc.in\n               \"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-scala.pc\" @ONLY)\n\ninstall(DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}/bindings/c/tree_sitter\"\n        DESTINATION \"${CMAKE_INSTALL_INCLUDEDIR}\"\n        FILES_MATCHING PATTERN \"*.h\")\ninstall(FILES \"${CMAKE_CURRENT_BINARY_DIR}/tree-sitter-scala.pc\"\n        DESTINATION \"${CMAKE_INSTALL_LIBDIR}/pkgconfig\")\ninstall(TARGETS tree-sitter-scala\n        LIBRARY DESTINATION \"${CMAKE_INSTALL_LIBDIR}\")\n\nfile(GLOB QUERIES queries/*.scm)\ninstall(FILES ${QUERIES}\n        DESTINATION \"${CMAKE_INSTALL_DATADIR}/tree-sitter/queries/scala\")\n\nadd_custom_target(ts-test \"${TREE_SITTER_CLI}\" test\n                  WORKING_DIRECTORY \"${CMAKE_CURRENT_SOURCE_DIR}\"\n                  COMMENT \"tree-sitter test\")\n"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# Contributing to tree-sitter-scala\n\nFirst off, thanks for being willing to contribute to making syntax highlighting\nin Scala better! This document will hopefully help you get set up, understand\nhow to work on the codebase, or link to places to help you understand\ntree-sitter.\n\n## Requirements\n\n- [tree-sitter CLI](https://github.com/tree-sitter/tree-sitter/tree/master/cli)\n- Node.js version 18.0 or greater\n- C Compiler\n\nRefer to the [tree-sitter\ndocumentation](https://tree-sitter.github.io/tree-sitter/creating-parsers/1-getting-started.html)\nfor more details and specifics.\n\nIf you use nix you can enter a nix-shell (`nix-shell .`) which will install them\nfor you.\n\n## Getting Started\n\nTo get started with contributing to the grammar you'll first need to install the\nproject's dependencies:\n\n```sh\nnpm install\n```\n\nThe general flow will often start with adding a test case to `./test/corpus`. You can\nfind details on how testing works with tree-sitter\n[here](https://tree-sitter.github.io/tree-sitter/creating-parsers/5-writing-tests.html).\n\nOnce you've added your test case you'll want to then make the required changes\nto `grammar.js`, regenerate and recompile the parser, and run the tests:\n\n```sh\ntree-sitter generate\ntree-sitter test\n```\n\nThen adjust as necessary. Note that depending on your change you may also have\nto touch the `/src/scanner.c` file if you need more advanced features like\nlook-ahead.\n\n## Pending Tests\n\nIn `./test/corpus`, there are several files named `*-pending.txt`. These contain tests labeled with `:skip`, meaning they are not currently run. Each test includes examples of valid Scala syntax that `tree-sitter-scala` is known to fail to parse. If you’d like to contribute to `tree-sitter-scala`, a good place to start is by trying to fix one of these tests.\n\n## Syntax highlighting\n\nRight now the most common use-case for syntax highlight using tree-sitter is\n[nvim-treesitter](https://github.com/nvim-treesitter/nvim-treesitter), which\nmeans much of our testing is in relation to it. You can find the syntax\nhighlighting tests in `test/highlight/*.scala`. You can read more about this\ntype of testing \n[here](https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#unit-testing). \nThese test will be run automatically with `tree-sitter test`.\n\n### tree-sitter highlight\n\nAnother way to test your syntax highlighting locally is to use the `tree-sitter\nhighlight` command. Note that you'll need to have `tree-sitter` installed\nglobally for this to work. Once you have it installed you'll want to follow the\ninstructions [here](https://tree-sitter.github.io/tree-sitter/3-syntax-highlighting.html#overview) \nto setup a local config that points towards this repo to be used as a parser. \nOnce done you can then do the following:\n\n```sh\ntree-sitter highlight some/scala/file.scala\n```\n\nAnd see the syntax highlighting spit out. This is also the format used for\ntesting, so it provides an easy way to get the output we use for testing.\n\n## Generation\n\nIn order to help not cause conflicts with multiple prs being open at the same\ntime, we don't check in the parser on each pr. Instead, just check in the\nchanges to the `grammar.js` and the CI will take care of the rest. Each night if\nchanges are detected it will automatically be generated.\n\n## Smoke testing\n\nYou'll noticed that there is a part of CI that checks parsing against the Scala\n2 and Scala 3 repositories to ensure we don't introduce unexpected regressions.\nThe script for this is in `script/smoke_test.sh`. If you're change is increasing\nthe coverage in either the library or compiler, please do update the expected\npercentages at the top of the file.\n\n## Obtaining an error reproduction\n\n_With Neovim_\n\nWhen creating an issue you'll want to ensure to include the `ERROR` node in it's\ncontext. There's a couple ways to do this. If you're using Neovim and utilizing\ntreesitter, you can see the tree with `:lua vim.treesitter.show_tree()`. You can\ncopy it directly from the open panel.\n\n_Manually_\n\nA manual way to get this would be to ensure that when you're in the repo you\nhave the latest parser with\n\n```sh\nnpm run build\n```\n\nThen you can copy your Scala code in a file and pass that file into `npm run\nparse`:\n\n```\ntree-sitter parse <path/to/your/file.scala>\n```\n\nThen the tree will be printed out for you to copy.\n\n## Release\n\n1. Update `version` in `tree-sitte.json`\n2. Update `version` in `package.json`, then run `npm install`\n3. Update `VERSION` in `CMakeLists.txt`\n4. Update `VERSION` in `Makefile`\n5. Update `version` in `Cargo.toml`, then run `cargo build`\n6. Update `version` in `pyproject.toml`\n"
  },
  {
    "path": "Cargo.toml",
    "content": "[package]\nname = \"tree-sitter-scala\"\ndescription = \"Scala grammar for tree-sitter\"\nversion = \"0.26.0\"\nauthors = [\"Max Brunsfeld <maxbrunsfeld@gmail.com>\"]\nlicense = \"MIT\"\nreadme = \"README.md\"\nkeywords = [\"incremental\", \"parsing\", \"tree-sitter\", \"scala\"]\ncategories = [\"parsing\", \"text-editors\"]\nrepository = \"https://github.com/tree-sitter/tree-sitter-scala\"\nedition = \"2021\"\nautoexamples = false\n\nbuild = \"bindings/rust/build.rs\"\ninclude = [\"LICENSE\", \"bindings/rust/*\", \"grammar.js\", \"queries/*\", \"src/*\", \"tree-sitter.json\"]\n\n[lib]\npath = \"bindings/rust/lib.rs\"\n\n[dependencies]\ntree-sitter-language = \"0.1\"\n\n[build-dependencies]\ncc = \"1.1\"\n\n[dev-dependencies]\ntree-sitter = \"0.26\"\n"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2018 Max Brunsfeld and GitHub\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.\n"
  },
  {
    "path": "Makefile",
    "content": "ifeq ($(OS),Windows_NT)\n$(error Windows is not supported)\nendif\n\nLANGUAGE_NAME := tree-sitter-scala\nHOMEPAGE_URL := https://github.com/tree-sitter/tree-sitter-scala\nVERSION := 0.26.0\n\n# repository\nSRC_DIR := src\n\nTS ?= tree-sitter\n\n# install directory layout\nPREFIX ?= /usr/local\nINCLUDEDIR ?= $(PREFIX)/include\nLIBDIR ?= $(PREFIX)/lib\nPCLIBDIR ?= $(LIBDIR)/pkgconfig\n\n# source/object files\nPARSER := $(SRC_DIR)/parser.c\nEXTRAS := $(filter-out $(PARSER),$(wildcard $(SRC_DIR)/*.c))\nOBJS := $(patsubst %.c,%.o,$(PARSER) $(EXTRAS))\n\n# flags\nARFLAGS ?= rcs\noverride CFLAGS += -I$(SRC_DIR) -std=c11 -fPIC\n\n# ABI versioning\nSONAME_MAJOR = $(shell sed -n 's/\\#define LANGUAGE_VERSION //p' $(PARSER))\nSONAME_MINOR = $(word 1,$(subst ., ,$(VERSION)))\n\n# OS-specific bits\nifeq ($(shell uname),Darwin)\n\tSOEXT = dylib\n\tSOEXTVER_MAJOR = $(SONAME_MAJOR).$(SOEXT)\n\tSOEXTVER = $(SONAME_MAJOR).$(SONAME_MINOR).$(SOEXT)\n\tLINKSHARED = -dynamiclib -Wl,-install_name,$(LIBDIR)/lib$(LANGUAGE_NAME).$(SOEXTVER),-rpath,@executable_path/../Frameworks\nelse\n\tSOEXT = so\n\tSOEXTVER_MAJOR = $(SOEXT).$(SONAME_MAJOR)\n\tSOEXTVER = $(SOEXT).$(SONAME_MAJOR).$(SONAME_MINOR)\n\tLINKSHARED = -shared -Wl,-soname,lib$(LANGUAGE_NAME).$(SOEXTVER)\nendif\nifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)\n\tPCLIBDIR := $(PREFIX)/libdata/pkgconfig\nendif\n\nall: lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT) $(LANGUAGE_NAME).pc\n\nlib$(LANGUAGE_NAME).a: $(OBJS)\n\t$(AR) $(ARFLAGS) $@ $^\n\nlib$(LANGUAGE_NAME).$(SOEXT): $(OBJS)\n\t$(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@\nifneq ($(STRIP),)\n\t$(STRIP) $@\nendif\n\n$(LANGUAGE_NAME).pc: bindings/c/$(LANGUAGE_NAME).pc.in\n\tsed -e 's|@PROJECT_VERSION@|$(VERSION)|' \\\n\t\t-e 's|@CMAKE_INSTALL_LIBDIR@|$(LIBDIR:$(PREFIX)/%=%)|' \\\n\t\t-e 's|@CMAKE_INSTALL_INCLUDEDIR@|$(INCLUDEDIR:$(PREFIX)/%=%)|' \\\n\t\t-e 's|@PROJECT_DESCRIPTION@|$(DESCRIPTION)|' \\\n\t\t-e 's|@PROJECT_HOMEPAGE_URL@|$(HOMEPAGE_URL)|' \\\n\t\t-e 's|@CMAKE_INSTALL_PREFIX@|$(PREFIX)|' $< > $@\n\n$(PARSER): $(SRC_DIR)/grammar.json\n\t$(TS) generate $^\n\ninstall: all\n\tinstall -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter '$(DESTDIR)$(PCLIBDIR)' '$(DESTDIR)$(LIBDIR)'\n\tinstall -m644 bindings/c/$(LANGUAGE_NAME).h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h\n\tinstall -m644 $(LANGUAGE_NAME).pc '$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc\n\tinstall -m644 lib$(LANGUAGE_NAME).a '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a\n\tinstall -m755 lib$(LANGUAGE_NAME).$(SOEXT) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER)\n\tln -sf lib$(LANGUAGE_NAME).$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR)\n\tln -sf lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT)\n\nuninstall:\n\t$(RM) '$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).a \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER) \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXTVER_MAJOR) \\\n\t\t'$(DESTDIR)$(LIBDIR)'/lib$(LANGUAGE_NAME).$(SOEXT) \\\n\t\t'$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/$(LANGUAGE_NAME).h \\\n\t\t'$(DESTDIR)$(PCLIBDIR)'/$(LANGUAGE_NAME).pc\n\nclean:\n\t$(RM) $(OBJS) $(LANGUAGE_NAME).pc lib$(LANGUAGE_NAME).a lib$(LANGUAGE_NAME).$(SOEXT)\n\ntest:\n\t$(TS) test\n\n.PHONY: all install uninstall clean test\n"
  },
  {
    "path": "Package.resolved",
    "content": "{\n  \"object\": {\n    \"pins\": [\n      {\n        \"package\": \"SwiftTreeSitter\",\n        \"repositoryURL\": \"https://github.com/ChimeHQ/SwiftTreeSitter\",\n        \"state\": {\n          \"branch\": null,\n          \"revision\": \"2599e95310b3159641469d8a21baf2d3d200e61f\",\n          \"version\": \"0.8.0\"\n        }\n      }\n    ]\n  },\n  \"version\": 1\n}\n"
  },
  {
    "path": "Package.swift",
    "content": "// swift-tools-version:5.3\nimport PackageDescription\n\nlet package = Package(\n    name: \"TreeSitterScala\",\n    products: [\n        .library(name: \"TreeSitterScala\", targets: [\"TreeSitterScala\"]),\n    ],\n    dependencies: [\n        .package(url: \"https://github.com/ChimeHQ/SwiftTreeSitter\", from: \"0.8.0\"),\n    ],\n    targets: [\n        .target(\n            name: \"TreeSitterScala\",\n            dependencies: [],\n            path: \".\",\n            sources: [\n                \"src/parser.c\",\n                \"src/scanner.c\",\n            ],\n            resources: [\n                .copy(\"queries\")\n            ],\n            publicHeadersPath: \"bindings/swift\",\n            cSettings: [.headerSearchPath(\"src\")]\n        ),\n        .testTarget(\n            name: \"TreeSitterScalaTests\",\n            dependencies: [\n                \"SwiftTreeSitter\",\n                \"TreeSitterScala\",\n            ],\n            path: \"bindings/swift/TreeSitterScalaTests\"\n        )\n    ],\n    cLanguageStandard: .c11\n)\n"
  },
  {
    "path": "README.md",
    "content": "# tree-sitter-scala\n\n[![CI][ci]](https://github.com/tree-sitter/tree-sitter-scala/actions/workflows/ci.yml)\n[![discord][discord]](https://discord.gg/w7nTvsVJhm)\n[![matrix][matrix]](https://matrix.to/#/#tree-sitter-chat:matrix.org)\n[![crates][crates]](https://crates.io/crates/tree-sitter-scala)\n[![npm][npm]](https://www.npmjs.com/package/tree-sitter-scala)\n\nScala grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter)\ncovering both Scala 2 and 3.\n\n## References\n\n_Scala 2_\n\n- [The Scala 2 Language Specification](https://www.scala-lang.org/files/archive/spec/2.13/)\n- [Scala 2 Syntax Summary](https://www.scala-lang.org/files/archive/spec/2.13/13-syntax-summary.html)\n\n_Scala 3_\n\n- [Scala 3 Syntax Summary](https://docs.scala-lang.org/scala3/reference/syntax.html)\n\n## Development and Contributing\n\nPlease refer to the [CONTRIBUTING.md](./CONTRIBUTING.md) for instructions on\ngetting set up.\n\n[ci]: https://img.shields.io/github/actions/workflow/status/tree-sitter/tree-sitter-scala/ci.yml?logo=github&label=CI\n[discord]: https://img.shields.io/discord/1063097320771698699?logo=discord&label=discord\n[matrix]: https://img.shields.io/matrix/tree-sitter-chat%3Amatrix.org?logo=matrix&label=matrix\n[npm]: https://img.shields.io/npm/v/tree-sitter-scala?logo=npm\n[crates]: https://img.shields.io/crates/v/tree-sitter-scala?logo=rust\n"
  },
  {
    "path": "binding.gyp",
    "content": "{\n  \"targets\": [\n    {\n      \"target_name\": \"tree_sitter_scala_binding\",\n      \"dependencies\": [\n        \"<!(node -p \\\"require('node-addon-api').targets\\\"):node_addon_api_except\",\n      ],\n      \"include_dirs\": [\n        \"src\",\n      ],\n      \"sources\": [\n        \"bindings/node/binding.cc\",\n        \"src/parser.c\",\n        \"src/scanner.c\",\n      ],\n      \"conditions\": [\n        [\"OS!='win'\", {\n          \"cflags_c\": [\n            \"-std=c11\",\n          ],\n        }, { # OS == \"win\"\n          \"cflags_c\": [\n            \"/std:c11\",\n            \"/utf-8\",\n          ],\n        }],\n      ],\n    }\n  ]\n}\n"
  },
  {
    "path": "bindings/c/tree-sitter-scala.h",
    "content": "#ifndef TREE_SITTER_SCALA_H_\n#define TREE_SITTER_SCALA_H_\n\ntypedef struct TSLanguage TSLanguage;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst TSLanguage *tree_sitter_scala(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_SCALA_H_\n"
  },
  {
    "path": "bindings/c/tree-sitter-scala.pc.in",
    "content": "prefix=@CMAKE_INSTALL_PREFIX@\nlibdir=${prefix}/@CMAKE_INSTALL_LIBDIR@\nincludedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@\n\nName: tree-sitter-scala\nDescription: @PROJECT_DESCRIPTION@\nURL: @PROJECT_HOMEPAGE_URL@\nVersion: @PROJECT_VERSION@\nLibs: -L${libdir} -ltree-sitter-scala\nCflags: -I${includedir}\n"
  },
  {
    "path": "bindings/c/tree_sitter/tree-sitter-scala.h",
    "content": "#ifndef TREE_SITTER_SCALA_H_\n#define TREE_SITTER_SCALA_H_\n\ntypedef struct TSLanguage TSLanguage;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst TSLanguage *tree_sitter_scala(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_SCALA_H_\n"
  },
  {
    "path": "bindings/go/binding.go",
    "content": "package tree_sitter_scala\n\n// #cgo CFLAGS: -std=c11 -fPIC\n// #include \"../../src/parser.c\"\n// #include \"../../src/scanner.c\"\nimport \"C\"\n\nimport \"unsafe\"\n\n// Get the tree-sitter Language for this grammar.\nfunc Language() unsafe.Pointer {\n\treturn unsafe.Pointer(C.tree_sitter_scala())\n}\n"
  },
  {
    "path": "bindings/go/binding_test.go",
    "content": "package tree_sitter_scala_test\n\nimport (\n\t\"testing\"\n\n\ttree_sitter \"github.com/tree-sitter/go-tree-sitter\"\n\ttree_sitter_scala \"github.com/tree-sitter/tree-sitter-scala/bindings/go\"\n)\n\nfunc TestCanLoadGrammar(t *testing.T) {\n\tlanguage := tree_sitter.NewLanguage(tree_sitter_scala.Language())\n\tif language == nil {\n\t\tt.Errorf(\"Error loading Scala grammar\")\n\t}\n}\n"
  },
  {
    "path": "bindings/node/binding.cc",
    "content": "#include <napi.h>\n\ntypedef struct TSLanguage TSLanguage;\n\nextern \"C\" TSLanguage *tree_sitter_scala();\n\n// \"tree-sitter\", \"language\" hashed with BLAKE2\nconst napi_type_tag LANGUAGE_TYPE_TAG = {\n    0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16\n};\n\nNapi::Object Init(Napi::Env env, Napi::Object exports) {\n    exports[\"name\"] = Napi::String::New(env, \"scala\");\n    auto language = Napi::External<TSLanguage>::New(env, tree_sitter_scala());\n    language.TypeTag(&LANGUAGE_TYPE_TAG);\n    exports[\"language\"] = language;\n    return exports;\n}\n\nNODE_API_MODULE(tree_sitter_scala_binding, Init)\n"
  },
  {
    "path": "bindings/node/binding_test.js",
    "content": "const assert = require(\"node:assert\");\nconst { test } = require(\"node:test\");\n\nconst Parser = require(\"tree-sitter\");\n\ntest(\"can load grammar\", () => {\n  const parser = new Parser();\n  assert.doesNotThrow(() => parser.setLanguage(require(\".\")));\n});\n"
  },
  {
    "path": "bindings/node/index.d.ts",
    "content": "type BaseNode = {\n  type: string;\n  named: boolean;\n};\n\ntype ChildNode = {\n  multiple: boolean;\n  required: boolean;\n  types: BaseNode[];\n};\n\ntype NodeInfo =\n  | (BaseNode & {\n      subtypes: BaseNode[];\n    })\n  | (BaseNode & {\n      fields: { [name: string]: ChildNode };\n      children: ChildNode[];\n    });\n\ntype Language = {\n  name: string;\n  language: unknown;\n  nodeTypeInfo: NodeInfo[];\n};\n\ndeclare const language: Language;\nexport = language;\n"
  },
  {
    "path": "bindings/node/index.js",
    "content": "const root = require(\"path\").join(__dirname, \"..\", \"..\");\n\nmodule.exports =\n  typeof process.versions.bun === \"string\"\n    // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time\n    ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-scala.node`)\n    : require(\"node-gyp-build\")(root);\n\ntry {\n  module.exports.nodeTypeInfo = require(\"../../src/node-types.json\");\n} catch (_) {}\n"
  },
  {
    "path": "bindings/python/tests/test_binding.py",
    "content": "from unittest import TestCase\n\nimport tree_sitter, tree_sitter_scala\n\n\nclass TestLanguage(TestCase):\n    def test_can_load_grammar(self):\n        try:\n            tree_sitter.Language(tree_sitter_scala.language())\n        except Exception:\n            self.fail(\"Error loading Scala grammar\")\n"
  },
  {
    "path": "bindings/python/tree_sitter_scala/__init__.py",
    "content": "\"\"\"Scala grammar for tree-sitter\"\"\"\n\nfrom importlib.resources import files as _files\n\nfrom ._binding import language\n\n\ndef _get_query(name, file):\n    query = _files(f\"{__package__}.queries\") / file\n    globals()[name] = query.read_text()\n    return globals()[name]\n\n\ndef __getattr__(name):\n    if name == \"HIGHLIGHTS_QUERY\":\n        return _get_query(\"HIGHLIGHTS_QUERY\", \"highlights.scm\")\n    if name == \"LOCALS_QUERY\":\n        return _get_query(\"LOCALS_QUERY\", \"locals.scm\")\n\n    raise AttributeError(f\"module {__name__!r} has no attribute {name!r}\")\n\n\n__all__ = [\n    \"language\",\n    \"HIGHLIGHTS_QUERY\",\n    \"LOCALS_QUERY\",\n]\n\n\ndef __dir__():\n    return sorted(__all__ + [\n        \"__all__\", \"__builtins__\", \"__cached__\", \"__doc__\", \"__file__\",\n        \"__loader__\", \"__name__\", \"__package__\", \"__path__\", \"__spec__\",\n    ])\n"
  },
  {
    "path": "bindings/python/tree_sitter_scala/__init__.pyi",
    "content": "from typing import Final\n\nHIGHLIGHTS_QUERY: Final[str]\nLOCALS_QUERY: Final[str]\n\ndef language() -> object: ...\n"
  },
  {
    "path": "bindings/python/tree_sitter_scala/binding.c",
    "content": "#include <Python.h>\n\ntypedef struct TSLanguage TSLanguage;\n\nTSLanguage *tree_sitter_scala(void);\n\nstatic PyObject* _binding_language(PyObject *Py_UNUSED(self), PyObject *Py_UNUSED(args)) {\n    return PyCapsule_New(tree_sitter_scala(), \"tree_sitter.Language\", NULL);\n}\n\nstatic PyMethodDef methods[] = {\n    {\"language\", _binding_language, METH_NOARGS,\n     \"Get the tree-sitter language for this grammar.\"},\n    {NULL, NULL, 0, NULL}\n};\n\nstatic struct PyModuleDef module = {\n    .m_base = PyModuleDef_HEAD_INIT,\n    .m_name = \"_binding\",\n    .m_doc = NULL,\n    .m_size = -1,\n    .m_methods = methods\n};\n\nPyMODINIT_FUNC PyInit__binding(void) {\n    return PyModule_Create(&module);\n}\n"
  },
  {
    "path": "bindings/python/tree_sitter_scala/py.typed",
    "content": ""
  },
  {
    "path": "bindings/rust/build.rs",
    "content": "fn main() {\n    let src_dir = std::path::Path::new(\"src\");\n\n    let mut c_config = cc::Build::new();\n    c_config\n        .std(\"c11\")\n        .include(src_dir)\n        .flag_if_supported(\"-Wno-unused\");\n\n    #[cfg(target_env = \"msvc\")]\n    c_config.flag(\"-utf-8\");\n\n    let parser_path = src_dir.join(\"parser.c\");\n    c_config.file(&parser_path);\n    println!(\"cargo:rerun-if-changed={}\", parser_path.to_str().unwrap());\n\n    let scanner_path = src_dir.join(\"scanner.c\");\n    c_config.file(&scanner_path);\n    println!(\"cargo:rerun-if-changed={}\", scanner_path.to_str().unwrap());\n\n    c_config.compile(\"tree-sitter-scala\");\n}\n"
  },
  {
    "path": "bindings/rust/lib.rs",
    "content": "//! This crate provides Scala language support for the [tree-sitter][] parsing library.\n//!\n//! Typically, you will use the [LANGUAGE][] constant to add this language to a\n//! tree-sitter [Parser][], and then use the parser to parse some code:\n//!\n//! ```\n//! use tree_sitter::Parser;\n//!\n//! let code = r#\"\n//! object Hello {\n//!   def main(args: Array[String]) = {\n//!     println(\"Hello, world\")\n//!   }\n//! }\n//! \"#;\n//! let mut parser = Parser::new();\n//! let language = tree_sitter_scala::LANGUAGE;\n//! parser\n//!     .set_language(&language.into())\n//!     .expect(\"Error loading Scala parser\");\n//! let tree = parser.parse(code, None).unwrap();\n//! assert!(!tree.root_node().has_error());\n//! ```\n//!\n//! [Parser]: https://docs.rs/tree-sitter/*/tree_sitter/struct.Parser.html\n//! [tree-sitter]: https://tree-sitter.github.io/\n\nuse tree_sitter_language::LanguageFn;\n\nextern \"C\" {\n    fn tree_sitter_scala() -> *const ();\n}\n\n/// The tree-sitter [`LanguageFn`][LanguageFn] for this grammar.\n///\n/// [LanguageFn]: https://docs.rs/tree-sitter-language/*/tree_sitter_language/struct.LanguageFn.html\npub const LANGUAGE: LanguageFn = unsafe { LanguageFn::from_raw(tree_sitter_scala) };\n\n/// The content of the [`node-types.json`][] file for this grammar.\n///\n/// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types\npub const NODE_TYPES: &str = include_str!(\"../../src/node-types.json\");\n\n/// The syntax highlighting query for this language.\npub const HIGHLIGHTS_QUERY: &str = include_str!(\"../../queries/highlights.scm\");\n\n/// The local-variable syntax highlighting query for this language.\npub const LOCALS_QUERY: &str = include_str!(\"../../queries/locals.scm\");\n\n#[cfg(test)]\nmod tests {\n    #[test]\n    fn test_can_load_grammar() {\n        let mut parser = tree_sitter::Parser::new();\n        parser\n            .set_language(&super::LANGUAGE.into())\n            .expect(\"Error loading Scala parser\");\n    }\n}\n"
  },
  {
    "path": "bindings/swift/TreeSitterScala/scala.h",
    "content": "#ifndef TREE_SITTER_SCALA_H_\n#define TREE_SITTER_SCALA_H_\n\ntypedef struct TSLanguage TSLanguage;\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\nconst TSLanguage *tree_sitter_scala(void);\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_SCALA_H_\n"
  },
  {
    "path": "bindings/swift/TreeSitterScalaTests/TreeSitterScalaTests.swift",
    "content": "import XCTest\nimport SwiftTreeSitter\nimport TreeSitterScala\n\nfinal class TreeSitterScalaTests: XCTestCase {\n    func testCanLoadGrammar() throws {\n        let parser = Parser()\n        let language = Language(language: tree_sitter_scala())\n        XCTAssertNoThrow(try parser.setLanguage(language),\n                         \"Error loading Scala grammar\")\n    }\n}\n"
  },
  {
    "path": "examples/Packages.scala",
    "content": "package a.b\npackage c {\n  object A\n}\npackage c {\n  package object d {\n    val hello: String = \"there\"\n  }\n}\n"
  },
  {
    "path": "examples/PathResolver.scala",
    "content": "/* NSC -- new Scala compiler\n * Copyright 2006-2013 LAMP/EPFL\n * @author  Paul Phillips\n */\n\npackage scala\npackage tools\npackage util\n\nimport java.net.URL\nimport scala.tools.reflect.WrappedProperties.AccessControl\nimport scala.tools.nsc.Settings\nimport scala.tools.nsc.util.ClassPath\nimport scala.reflect.io.{Directory, File, Path}\nimport PartialFunction.condOpt\nimport scala.tools.nsc.classpath._\n\n// Loosely based on the draft specification at:\n// https://wiki.scala-lang.org/display/SIW/Classpath\n\nobject PathResolver {\n  // Imports property/environment functions which suppress security exceptions.\n  import AccessControl._\n  import java.lang.System.{lineSeparator => EOL}\n\n  implicit class MkLines(val t: TraversableOnce[_]) extends AnyVal {\n    def mkLines: String = t.mkString(\"\", EOL, EOL)\n    def mkLines(header: String, indented: Boolean = false, embraced: Boolean = false): String = {\n      val space = \"\\u0020\"\n      val sep = if (indented) EOL + space * 2 else EOL\n      val (lbrace, rbrace) = if (embraced) (space + \"{\", EOL + \"}\") else (\"\", \"\")\n      t.mkString(header + lbrace + sep, sep, rbrace + EOL)\n    }\n  }\n  implicit class AsLines(val s: String) extends AnyVal {\n    // sm\"\"\"...\"\"\" could do this in one pass\n    def asLines = s.trim.stripMargin.lines.mkLines\n  }\n\n  /** pretty print class path */\n  def ppcp(s: String) = ClassPath.split(s) match {\n    case Nil      => \"\"\n    case Seq(x)   => x\n    case xs       => xs.mkString(EOL, EOL, \"\")\n  }\n\n  /** Values found solely by inspecting environment or property variables.\n   */\n  object Environment {\n    import scala.collection.JavaConverters._\n\n    private def searchForBootClasspath =\n      System.getProperties.asScala collectFirst { case (k, v) if k endsWith \".boot.class.path\" => v } getOrElse \"\"\n\n    /** Environment variables which java pays attention to so it\n     *  seems we do as well.\n     */\n    def sourcePathEnv       = envOrElse(\"SOURCEPATH\", \"\")\n\n    def javaBootClassPath   = propOrElse(\"sun.boot.class.path\", searchForBootClasspath)\n    def javaExtDirs         = propOrEmpty(\"java.ext.dirs\")\n    def scalaHome           = propOrEmpty(\"scala.home\")\n    def scalaExtDirs        = propOrEmpty(\"scala.ext.dirs\")\n\n    /** The java classpath and whether to use it. */\n    def javaUserClassPath   = propOrElse(\"java.class.path\", \"\")\n    def useJavaClassPath    = propOrFalse(\"scala.usejavacp\")\n\n    override def toString = s\"\"\"\n      |object Environment {\n      |  scalaHome          = $scalaHome (useJavaClassPath = $useJavaClassPath)\n      |  javaBootClassPath  = <${javaBootClassPath.length} chars>\n      |  javaExtDirs        = ${ppcp(javaExtDirs)}\n      |  javaUserClassPath  = ${ppcp(javaUserClassPath)}\n      |  scalaExtDirs       = ${ppcp(scalaExtDirs)}\n      |}\"\"\".asLines\n  }\n\n  /** Default values based on those in Environment as interpreted according\n   *  to the path resolution specification.\n   */\n  object Defaults {\n    def scalaSourcePath   = Environment.sourcePathEnv\n    def javaBootClassPath = Environment.javaBootClassPath\n    def javaUserClassPath = Environment.javaUserClassPath\n    def javaExtDirs       = Environment.javaExtDirs\n    def useJavaClassPath  = Environment.useJavaClassPath\n\n    def scalaHome         = Environment.scalaHome\n    def scalaHomeDir      = Directory(scalaHome)\n    def scalaLibDir       = Directory(scalaHomeDir / \"lib\")\n    def scalaClassesDir   = Directory(scalaHomeDir / \"classes\")\n\n    def scalaLibAsJar     = File(scalaLibDir / \"scala-library.jar\")\n    def scalaLibAsDir     = Directory(scalaClassesDir / \"library\")\n\n    def scalaLibDirFound: Option[Directory] =\n      if (scalaLibAsJar.isFile) Some(scalaLibDir)\n      else if (scalaLibAsDir.isDirectory) Some(scalaClassesDir)\n      else None\n\n    def scalaLibFound =\n      if (scalaLibAsJar.isFile) scalaLibAsJar.path\n      else if (scalaLibAsDir.isDirectory) scalaLibAsDir.path\n      else \"\"\n\n    // TODO It must be time for someone to figure out what all these things\n    // are intended to do.  This is disabled here because it was causing all\n    // the scala jars to end up on the classpath twice: one on the boot\n    // classpath as set up by the runner (or regular classpath under -nobootcp)\n    // and then again here.\n    def scalaBootClassPath  = \"\"\n    def scalaExtDirs = Environment.scalaExtDirs\n    def scalaPluginPath = (scalaHomeDir / \"misc\" / \"scala-devel\" / \"plugins\").path\n\n    override def toString = s\"\"\"\n      |object Defaults {\n      |  scalaHome            = $scalaHome\n      |  javaBootClassPath    = ${ppcp(javaBootClassPath)}\n      |  scalaLibDirFound     = $scalaLibDirFound\n      |  scalaLibFound        = $scalaLibFound\n      |  scalaBootClassPath   = ${ppcp(scalaBootClassPath)}\n      |  scalaPluginPath      = ${ppcp(scalaPluginPath)}\n      |}\"\"\".asLines\n  }\n\n  /** Locations discovered by supplemental heuristics.\n   */\n  object SupplementalLocations {\n\n    /** The platform-specific support jar.\n     *\n     *  Usually this is `tools.jar` in the jdk/lib directory of the platform distribution.\n     *\n     *  The file location is determined by probing the lib directory under JDK_HOME or JAVA_HOME,\n     *  if one of those environment variables is set, then the lib directory under java.home,\n     *  and finally the lib directory under the parent of java.home. Or, as a last resort,\n     *  search deeply under those locations (except for the parent of java.home, on the notion\n     *  that if this is not a canonical installation, then that search would have little\n     *  chance of succeeding).\n     */\n    def platformTools: Option[File] = {\n      val jarName = \"tools.jar\"\n      def jarPath(path: Path) = (path / \"lib\" / jarName).toFile\n      def jarAt(path: Path) = {\n        val f = jarPath(path)\n        if (f.isFile) Some(f) else None\n      }\n      val jdkDir = {\n        val d = Directory(jdkHome)\n        if (d.isDirectory) Some(d) else None\n      }\n      def deeply(dir: Directory) = dir.deepFiles find (_.name == jarName)\n\n      val home    = envOrSome(\"JDK_HOME\", envOrNone(\"JAVA_HOME\")) map (p => Path(p))\n      val install = Some(Path(javaHome))\n\n      (home flatMap jarAt) orElse (install flatMap jarAt) orElse (install map (_.parent) flatMap jarAt) orElse\n        (jdkDir flatMap deeply)\n    }\n    override def toString = s\"\"\"\n      |object SupplementalLocations {\n      |  platformTools        = $platformTools\n      |}\"\"\".asLines\n  }\n\n  /** With no arguments, show the interesting values in Environment and Defaults.\n   *  If there are arguments, show those in Calculated as if those options had been\n   *  given to a scala runner.\n   */\n  def main(args: Array[String]): Unit =\n    if (args.isEmpty) {\n      println(Environment)\n      println(Defaults)\n    } else {\n      val settings = new Settings()\n      val rest = settings.processArguments(args.toList, processAll = false)._2\n      val pr = new PathResolver(settings)\n      println(\"COMMAND: 'scala %s'\".format(args.mkString(\" \")))\n      println(\"RESIDUAL: 'scala %s'\\n\".format(rest.mkString(\" \")))\n\n      pr.result match {\n        case cp: AggregateClassPath =>\n          println(s\"ClassPath has ${cp.aggregates.size} entries and results in:\\n${cp.asClassPathStrings}\")\n      }\n    }\n}\n\nfinal class PathResolver(settings: Settings) {\n  private val classPathFactory = new ClassPathFactory(settings)\n\n  import PathResolver.{ AsLines, Defaults, ppcp }\n\n  private def cmdLineOrElse(name: String, alt: String) = {\n    (commandLineFor(name) match {\n      case Some(\"\") => None\n      case x        => x\n    }) getOrElse alt\n  }\n\n  private def commandLineFor(s: String): Option[String] = condOpt(s) {\n    case \"javabootclasspath\"  => settings.javabootclasspath.value\n    case \"javaextdirs\"        => settings.javaextdirs.value\n    case \"bootclasspath\"      => settings.bootclasspath.value\n    case \"extdirs\"            => settings.extdirs.value\n    case \"classpath\" | \"cp\"   => settings.classpath.value\n    case \"sourcepath\"         => settings.sourcepath.value\n  }\n\n  /** Calculated values based on any given command line options, falling back on\n   *  those in Defaults.\n   */\n  object Calculated {\n    def scalaHome           = Defaults.scalaHome\n    def useJavaClassPath    = settings.usejavacp.value || Defaults.useJavaClassPath\n    def useManifestClassPath= settings.usemanifestcp.value\n    def javaBootClassPath   = cmdLineOrElse(\"javabootclasspath\", Defaults.javaBootClassPath)\n    def javaExtDirs         = cmdLineOrElse(\"javaextdirs\", Defaults.javaExtDirs)\n    def javaUserClassPath   = if (useJavaClassPath) Defaults.javaUserClassPath else \"\"\n    def scalaBootClassPath  = cmdLineOrElse(\"bootclasspath\", Defaults.scalaBootClassPath)\n    def scalaExtDirs        = cmdLineOrElse(\"extdirs\", Defaults.scalaExtDirs)\n\n    /** Scaladoc doesn't need any bootstrapping, otherwise will create errors such as:\n     * [scaladoc] ../scala-trunk/src/reflect/scala/reflect/macros/Reifiers.scala:89: error: object api is not a member of package reflect\n     * [scaladoc] case class ReificationException(val pos: reflect.api.PositionApi, val msg: String) extends Throwable(msg)\n     * [scaladoc]                                              ^\n     * because the bootstrapping will look at the sourcepath and create package \"reflect\" in \"<root>\"\n     * and then when typing relative names, instead of picking <root>.scala.relect, typedIdentifier will pick up the\n     * <root>.reflect package created by the bootstrapping. Thus, no bootstrapping for scaladoc!\n     * TODO: we should refactor this as a separate -bootstrap option to have a clean implementation, no? */\n    def sourcePath          = if (!settings.isScaladoc) cmdLineOrElse(\"sourcepath\", Defaults.scalaSourcePath) else \"\"\n\n    def userClassPath = settings.classpath.value  // default is specified by settings and can be overridden there\n\n    import classPathFactory._\n\n    // Assemble the elements!\n    def basis = List[Traversable[ClassPath]](\n      JrtClassPath.apply(),                         // 0. The Java 9 classpath (backed by the jrt:/ virtual system, if available)\n      classesInPath(javaBootClassPath),             // 1. The Java bootstrap class path.\n      contentsOfDirsInPath(javaExtDirs),            // 2. The Java extension class path.\n      classesInExpandedPath(javaUserClassPath),     // 3. The Java application class path.\n      classesInPath(scalaBootClassPath),            // 4. The Scala boot class path.\n      contentsOfDirsInPath(scalaExtDirs),           // 5. The Scala extension class path.\n      classesInExpandedPath(userClassPath),         // 6. The Scala application class path.\n      classesInManifest(useManifestClassPath),      // 8. The Manifest class path.\n      sourcesInPath(sourcePath)                     // 7. The Scala source path.\n    )\n\n    lazy val containers = basis.flatten.distinct\n\n    override def toString = s\"\"\"\n      |object Calculated {\n      |  scalaHome            = $scalaHome\n      |  javaBootClassPath    = ${ppcp(javaBootClassPath)}\n      |  javaExtDirs          = ${ppcp(javaExtDirs)}\n      |  javaUserClassPath    = ${ppcp(javaUserClassPath)}\n      |  useJavaClassPath     = $useJavaClassPath\n      |  scalaBootClassPath   = ${ppcp(scalaBootClassPath)}\n      |  scalaExtDirs         = ${ppcp(scalaExtDirs)}\n      |  userClassPath        = ${ppcp(userClassPath)}\n      |  sourcePath           = ${ppcp(sourcePath)}\n      |}\"\"\".asLines\n  }\n\n  def containers = Calculated.containers\n\n  import PathResolver.MkLines\n\n  def result: ClassPath = {\n    val cp = computeResult()\n    if (settings.Ylogcp) {\n      Console print f\"Classpath built from ${settings.toConciseString} %n\"\n      Console print s\"Defaults: ${PathResolver.Defaults}\"\n      Console print s\"Calculated: $Calculated\"\n\n      val xs = (Calculated.basis drop 2).flatten.distinct\n      Console print (xs mkLines (s\"After java boot/extdirs classpath has ${xs.size} entries:\", indented = true))\n    }\n    cp\n  }\n\n  def resultAsURLs: Seq[URL] = result.asURLs\n\n  @deprecated(\"Use resultAsURLs instead of this one\", \"2.11.5\")\n  def asURLs: List[URL] = resultAsURLs.toList\n\n  private def computeResult(): ClassPath = AggregateClassPath(containers.toIndexedSeq)\n}\n"
  },
  {
    "path": "examples/RefChecks.scala",
    "content": "/*\n * Scala (https://www.scala-lang.org)\n *\n * Copyright EPFL and Lightbend, Inc.\n *\n * Licensed under Apache License 2.0\n * (http://www.apache.org/licenses/LICENSE-2.0).\n *\n * See the NOTICE file distributed with this work for\n * additional information regarding copyright ownership.\n */\n\npackage scala.tools.nsc\npackage typechecker\n\nimport scala.collection.mutable\nimport scala.collection.mutable.ListBuffer\nimport scala.reflect.internal.util.CodeAction\nimport scala.tools.nsc.Reporting.WarningCategory\nimport scala.tools.nsc.settings.ScalaVersion\nimport scala.tools.nsc.settings.NoScalaVersion\nimport symtab.Flags._\nimport transform.Transform\n\n/** Post-attribution checking and transformation.\n *\n *  This phase checks the following postconditions:\n *\n *  - All overrides conform to rules.\n *  - All type arguments conform to bounds.\n *  - Every use of a type variable conforms to the variance annotation of that variable.\n *  - No forward reference to a term symbol extends beyond a value definition.\n *\n *  It performs the following transformations:\n *\n *  - Local modules are replaced by variables and classes.\n *  - Calls to case factory methods are replaced by new's.\n *  - Eliminate branches in a conditional if the condition is a constant.\n *\n *  @author  Martin Odersky\n */\nabstract class RefChecks extends Transform {\n\n  val global: Global               // need to repeat here because otherwise last mixin defines global as\n                                   // SymbolTable. If we had DOT this would not be an issue\n\n  import global._\n  import definitions._\n  import typer.typed\n\n  /** the following two members override abstract members in Transform */\n  val phaseName: String = \"refchecks\"\n\n  def newTransformer(unit: CompilationUnit): RefCheckTransformer =\n    new RefCheckTransformer(unit)\n\n  val toJavaRepeatedParam  = SubstSymMap(RepeatedParamClass -> JavaRepeatedParamClass)\n  val toScalaRepeatedParam = SubstSymMap(JavaRepeatedParamClass -> RepeatedParamClass)\n\n  def accessFlagsToString(sym: Symbol) = flagsToString(\n    sym getFlag (PRIVATE | PROTECTED),\n    if (sym.hasAccessBoundary) \"\" + sym.privateWithin.name else \"\"\n  )\n\n  def overridesTypeInPrefix(tp1: Type, tp2: Type, prefix: Type): Boolean = (tp1.dealiasWiden, tp2.dealiasWiden) match {\n    case (MethodType(List(), rtp1), NullaryMethodType(rtp2)) => rtp1 <:< rtp2\n    case (NullaryMethodType(rtp1), MethodType(List(), rtp2)) => rtp1 <:< rtp2\n    case (TypeRef(_, sym, _), _) if sym.isModuleClass        => overridesTypeInPrefix(NullaryMethodType(tp1), tp2, prefix)\n    case (_, TypeRef(_, sym, _)) if sym.isModuleClass        => overridesTypeInPrefix(tp1, NullaryMethodType(tp2), prefix)\n    case _                                                   => tp1 <:< tp2\n  }\n\n  private val separatelyCompiledScalaSuperclass = perRunCaches.newAnyRefMap[Symbol, Unit]()\n  final def isSeparatelyCompiledScalaSuperclass(sym: Symbol) = if (globalPhase.refChecked){\n    separatelyCompiledScalaSuperclass.contains(sym)\n  } else {\n    // conservative approximation in case someone in pre-refchecks phase asks for `exitingFields(someClass.info)`\n    // and we haven't run the refchecks tree transform which populates `separatelyCompiledScalaSuperclass`\n    false\n  }\n\n  class RefCheckTransformer(unit: CompilationUnit) extends AstTransformer {\n    private final val indent = \"  \"\n\n    var localTyper: analyzer.Typer = typer\n    var currentApplication: Tree = EmptyTree\n    var inAnnotation: Boolean = false\n    var inPattern: Boolean = false\n    @inline final def savingInPattern[A](body: => A): A = {\n      val saved = inPattern\n      try body finally inPattern = saved\n    }\n\n    // Track symbols of the refinement's parents and the base at which we've checked them,\n    // as well as the entire refinement type seen at that base.\n    // No need to check the same symbols again in a base that's a subclass of a previously checked base\n    private val checkedCombinations = mutable.Map[List[Symbol], (Symbol, Type)]()\n    private def notYetCheckedOrAdd(rt: RefinedType, currentBase: Symbol) = {\n      val seen = checkedCombinations.get(rt.parents.map(_.typeSymbol)).exists {\n        case (prevBase, prevTp) => currentBase.isSubClass(prevBase) && rt =:= prevTp.asSeenFrom(currentBase.thisType, prevBase)\n      }\n\n      if (!seen) checkedCombinations.addOne((rt.parents.map(_.typeSymbol), (currentBase, rt)))\n\n      !seen\n    }\n\n    private def refchecksWarning(pos: Position, msg: String, cat: WarningCategory, actions: List[CodeAction] = Nil): Unit =\n      runReporting.warning(pos, msg, cat, currentOwner, actions)\n\n    // only one overloaded alternative is allowed to define default arguments\n    private def checkOverloadedRestrictions(clazz: Symbol, defaultClass: Symbol): Unit = {\n      // Using the default getters (such as methodName$default$1) as a cheap way of\n      // finding methods with default parameters. This way, we can limit the members to\n      // those with the DEFAULTPARAM flag, and infer the methods. Looking for the methods\n      // directly requires inspecting the parameter list of every one. That modification\n      // shaved 95% off the time spent in this method.\n      val defaultGetters     = defaultClass.info.findMembers(excludedFlags = PARAM, requiredFlags = DEFAULTPARAM)\n      val defaultMethodNames = defaultGetters map (sym => nme.defaultGetterToMethod(sym.name))\n\n      defaultMethodNames.toList.distinct foreach { name =>\n        val methods      = clazz.info.findMember(name, 0L, requiredFlags = METHOD, stableOnly = false).alternatives\n        def hasDefaultParam(tpe: Type): Boolean = tpe match {\n          case MethodType(params, restpe) => (params exists (_.hasDefault)) || hasDefaultParam(restpe)\n          case _                          => false\n        }\n        val haveDefaults = methods.filter(sym => mexists(sym.info.paramss)(_.hasDefault) && !nme.isProtectedAccessorName(sym.name))\n\n        if (haveDefaults.lengthCompare(1) > 0) {\n          val owners = haveDefaults map (_.owner)\n           // constructors of different classes are allowed to have defaults\n          if (haveDefaults.exists(x => !x.isConstructor) || owners.distinct.size < haveDefaults.size) {\n            reporter.error(clazz.pos,\n              \"in \"+ clazz +\n              \", multiple overloaded alternatives of \"+ haveDefaults.head +\n              \" define default arguments\" + (\n                if (owners.forall(_ == clazz)) \".\"\n                else \".\\nThe members with defaults are defined in \"+owners.map(_.fullLocationString).mkString(\"\", \" and \", \".\")\n              )\n            )\n          }\n        }\n      }\n\n      // Check for doomed attempt to overload applyDynamic\n      if (clazz isSubClass DynamicClass) {\n        for ((_, m1 :: m2 :: _) <- (clazz.info member nme.applyDynamic).alternatives groupBy (_.typeParams.length)) {\n          reporter.error(m1.pos, \"implementation restriction: applyDynamic cannot be overloaded except by methods with different numbers of type parameters, e.g. applyDynamic[T1](method: String)(arg: T1) and applyDynamic[T1, T2](method: String)(arg1: T1, arg2: T2)\")\n        }\n      }\n\n      // This has become noisy with implicit classes.\n      if (settings.isDeveloper && settings.warnPolyImplicitOverload) {\n        clazz.info.decls.foreach(sym => if (sym.isImplicit && sym.typeParams.nonEmpty) {\n          // implicit classes leave both a module symbol and a method symbol as residue\n          val alts = clazz.info.decl(sym.name).alternatives filterNot (_.isModule)\n          if (alts.size > 1)\n            alts foreach (x => refchecksWarning(x.pos, \"parameterized overloaded implicit methods are not visible as view bounds\", WarningCategory.LintPolyImplicitOverload))\n        })\n      }\n    }\n\n// Override checking ------------------------------------------------------------\n\n    /** Add bridges for vararg methods that extend Java vararg methods\n     */\n    def addVarargBridges(clazz: Symbol): List[Tree] = {\n      // This is quite expensive, so attempt to skip it completely.\n      // Insist there at least be a java-defined ancestor which\n      // defines a varargs method. TODO: Find a cheaper way to exclude.\n      if (inheritsJavaVarArgsMethod(clazz)) {\n        log(\"Found java varargs ancestor in \" + clazz.fullLocationString + \".\")\n        val self = clazz.thisType\n        val bridges = new ListBuffer[Tree]\n\n        def varargBridge(member: Symbol, bridgetpe: Type): Tree = {\n          log(s\"Generating varargs bridge for ${member.fullLocationString} of type $bridgetpe\")\n\n          val newFlags = (member.flags | VBRIDGE) & ~PRIVATE\n          val bridge   = member.cloneSymbolImpl(clazz, newFlags) setPos clazz.pos\n          bridge.setInfo(bridgetpe.cloneInfo(bridge))\n          clazz.info.decls enter bridge\n\n          val params  = bridge.paramss.head\n          val elemtp  = params.last.tpe.typeArgs.head\n          val idents  = params map Ident\n          val lastarg = gen.wildcardStar(gen.mkWrapVarargsArray(idents.last, elemtp))\n          val body    = Apply(Select(This(clazz), member), idents.init :+ lastarg)\n\n          localTyper typed DefDef(bridge, body)\n        }\n\n        // For all concrete non-private members (but: see below) that have a (Scala) repeated\n        //   parameter: compute the corresponding method type `jtpe` with a Java repeated parameter\n        //   if a method with type `jtpe` exists and that method is not a varargs bridge\n        //   then create a varargs bridge of type `jtpe` that forwards to the\n        //   member method with the Scala vararg type.\n        //\n        // @PP: Can't call nonPrivateMembers because we will miss refinement members,\n        //   which have been marked private. See scala/bug#4729.\n        for (member <- nonTrivialMembers(clazz)) {\n          log(s\"Considering $member for java varargs bridge in $clazz\")\n          if (!member.isDeferred && member.isMethod && hasRepeatedParam(member.info)) {\n            val inherited = clazz.info.nonPrivateMemberAdmitting(member.name, VBRIDGE)\n\n            // Delaying calling memberType as long as possible\n            if (inherited.exists) {\n              val jtpe = toJavaRepeatedParam(self memberType member)\n              // this is a bit tortuous: we look for non-private members or bridges\n              // if we find a bridge everything is OK. If we find another member,\n              // we need to create a bridge\n              val inherited1 = inherited filter (sym => !(sym hasFlag VBRIDGE) && (self memberType sym matches jtpe))\n              if (inherited1.exists)\n                bridges += varargBridge(member, jtpe)\n            }\n          }\n        }\n\n        if (bridges.size > 0)\n          log(s\"Adding ${bridges.size} bridges for methods extending java varargs.\")\n\n        bridges.toList\n      }\n      else Nil\n    }\n\n    /** 1. Check all members of class `clazz` for overriding conditions.\n     *  That is for overriding member M and overridden member O:\n     *\n     *    1.1. M must have the same or stronger access privileges as O.\n     *    1.2. O must not be final.\n     *    1.3. O is deferred, or M has `override` modifier.\n     *    1.4. If O is stable, then so is M.\n     *    1.6. If O is a type alias, then M is an alias of O.\n     *    1.7. If O is an abstract type then\n     *       1.7.1 either M is an abstract type, and M's bounds are sharper than O's bounds.\n     *             or M is a type alias or class which conforms to O's bounds.\n     *       1.7.2 higher-order type arguments must respect bounds on higher-order type parameters  -- @M\n     *              (explicit bounds and those implied by variance annotations) -- @see checkKindBounds\n     *    1.8. If O and M are values, then\n     *    1.8.1  M's type is a subtype of O's type, or\n     *    1.8.2  M is of type []S, O is of type ()T and S <: T, or\n     *    1.8.3  M is of type ()S, O is of type []T and S <: T, or\n     *    1.9.  If M is a macro def, O cannot be deferred unless there's a concrete method overriding O.\n     *    1.10. If M is not a macro def, O cannot be a macro def.\n     *  2. Check that only abstract classes have deferred members\n     *  3. Check that concrete classes do not have deferred definitions\n     *     that are not implemented in a subclass.\n     *  4. Check that every member with an `override` modifier\n     *     overrides some other member.\n     *  5. Check that the nested class do not shadow other nested classes from outer class's parent.\n     */\n    private def checkAllOverrides(clazz: Symbol, typesOnly: Boolean = false): Unit = {\n      val self = clazz.thisType\n\n      case class MixinOverrideError(member: Symbol, msg: String, actions: List[CodeAction], s3Migration: Boolean)\n\n      val mixinOverrideErrors = new ListBuffer[MixinOverrideError]()\n\n      def issue(pos: Position, msg: String, actions: List[CodeAction], s3Migration: Boolean) =\n        if (s3Migration) runReporting.warning(pos, msg, WarningCategory.Scala3Migration, currentOwner, actions)\n        else runReporting.error(pos, msg, actions)\n\n      def printMixinOverrideErrors(): Unit = {\n        mixinOverrideErrors.toList match {\n          case List() =>\n          case List(MixinOverrideError(_, msg, actions, s3Migration)) =>\n            issue(clazz.pos, msg, actions, s3Migration)\n          case MixinOverrideError(member, msg, actions, s3Migration) :: others =>\n            val others1 = others.map(_.member.name.decode).filter(member.name.decode != _).distinct\n            issue(\n              clazz.pos,\n              if (others1.isEmpty) msg\n              else s\"$msg;\\n other members with override errors are: ${others1.mkString(\", \")}\",\n              actions,\n              s3Migration)\n        }\n      }\n\n      def infoString(sym: Symbol) = infoString0(sym, sym.owner != clazz)\n      def infoStringWithLocation(sym: Symbol) = infoString0(sym, showLocation = true)\n\n      def infoString0(member: Symbol, showLocation: Boolean) = {\n        val location =\n          if (!showLocation) \"\"\n          else member.ownsString match {\n            case \"\"   => \"\"\n            case s    => s\" (defined in $s)\"\n          }\n        val macroStr = if (member.isTermMacro) \"macro \" else \"\"\n\n        macroStr + member.defStringSeenAs(self.memberInfo(member)) + location\n      }\n\n      /* Check that all conditions for overriding `other` by `member` of class `clazz` are met.\n       *\n       * TODO: error messages could really be improved, including how they are composed\n       */\n      def checkOverride(pair: SymbolPair): Unit = {\n        import pair.{highType, lowType, highInfo, rootType}\n\n        val member = pair.low\n        val other = pair.high\n        val memberClass = member.owner\n        val otherClass = other.owner\n\n        // debuglog(s\"Checking validity of ${member.fullLocationString} overriding ${other.fullLocationString}\")\n\n        def noErrorType = !pair.isErroneous\n        def isRootOrNone(sym: Symbol) = sym != null && sym.isRoot || sym == NoSymbol\n        val isMemberClass = memberClass == clazz\n        def isNeitherInClass = !isMemberClass && otherClass != clazz\n\n        /** Emit an error if member is owned by current class, using the member position.\n         *  Otherwise, accumulate the error, to be emitted after other messages, using the class position.\n         */\n        def emitOverrideError(fullmsg: String, actions: List[CodeAction] = Nil, s3Migration: Boolean = false): Unit =\n          if (isMemberClass) issue(member.pos, fullmsg, actions, s3Migration)\n          else mixinOverrideErrors += MixinOverrideError(member, fullmsg, actions, s3Migration)\n\n        def overriddenWithAddendum(msg: String, foundReq: Boolean = settings.isDebug): String = {\n          val isConcreteOverAbstract =\n            otherClass.isSubClass(memberClass) && other.isDeferred && !member.isDeferred\n          val addendum =\n            if (isConcreteOverAbstract)\n              sm\"\"\"|;\n                   |${indent}(note that ${infoStringWithLocation(other)} is abstract,\n                   |${indent}and is therefore overridden by concrete ${infoStringWithLocation(member)})\"\"\"\n            else if (foundReq) {\n              def info(sym: Symbol) = self.memberInfo(sym) match { case tp if sym.isGetter || sym.isValue && !sym.isMethod => tp.resultType case tp => tp }\n              analyzer.foundReqMsg(info(member), info(other))\n            }\n            else \"\"\n          val msg1 = if (!msg.isEmpty) s\"\\n$indent$msg\" else msg\n\n          s\"${infoStringWithLocation(other)}${msg1}${addendum}\"\n        }\n\n        def overrideError(msg: String): Unit =\n          if (noErrorType) emitOverrideError(msg)\n\n        def getWithIt = if (isMemberClass) \"\" else s\"with ${infoString(member)}\"\n\n        def overrideErrorWithMemberInfo(msg: String, actions: List[CodeAction] = Nil, s3Migration: Boolean = false): Unit =\n          if (noErrorType) emitOverrideError(s\"${msg}\\n${overriddenWithAddendum(getWithIt)}\", actions, s3Migration)\n\n        def overrideErrorOrNullaryWarning(msg: String, actions: List[CodeAction]): Unit = if (isMemberClass || !member.owner.isSubClass(other.owner))\n          if (currentRun.isScala3)\n            overrideErrorWithMemberInfo(msg, actions, s3Migration = true)\n          else if (isMemberClass)\n            refchecksWarning(member.pos, msg, WarningCategory.OtherNullaryOverride, actions)\n          else\n            refchecksWarning(clazz.pos, msg, WarningCategory.OtherNullaryOverride, actions)\n\n        def overrideTypeError(): Unit =\n          if (member.isModule && other.isModule)\n            overrideError(sm\"\"\"|overriding ${other.fullLocationString} with ${member.fullLocationString}:\n                               |an overriding object must conform to the overridden object's class bound${\n                                analyzer.foundReqMsg(pair.lowClassBound, pair.highClassBound)}\"\"\")\n          else {\n            val needSameType = !other.isDeferred && other.isAliasType\n            val msg = s\"${getWithIt}${if (needSameType) \" (Equivalent type required when overriding a type alias.)\" else \"\"}\"\n            overrideError(sm\"\"\"|incompatible type in overriding\n                               |${overriddenWithAddendum(msg, foundReq = !needSameType)}\"\"\")\n          }\n\n        def overrideErrorConcreteMissingOverride() =\n          if (isNeitherInClass && !otherClass.isSubClass(memberClass))\n            emitOverrideError(sm\"\"\"|$clazz inherits conflicting members:\n                                   |$indent${infoStringWithLocation(other)} and\n                                   |$indent${infoStringWithLocation(member)}\n                                   |$indent(note: this can be resolved by declaring an `override` in $clazz.)\"\"\")\n          else\n            overrideErrorWithMemberInfo(\"`override` modifier required to override concrete member:\")\n\n        def weakerAccessError(advice: String): Unit =\n          overrideError(sm\"\"\"|weaker access privileges in overriding\n                             |${overriddenWithAddendum(advice)}\"\"\")\n        def overrideAccessError(): Unit =\n          weakerAccessError {\n            accessFlagsToString(other) match {\n              case \"\"          => \"override should be public\"\n              case otherAccess => s\"override should at least be $otherAccess\"\n            }\n          }\n\n        //Console.println(infoString(member) + \" overrides \" + infoString(other) + \" in \" + clazz);//DEBUG\n\n        /* Is the intersection between given two lists of overridden symbols empty? */\n        def intersectionIsEmpty(syms1: List[Symbol], syms2: List[Symbol]) = !syms1.exists(syms2.contains)\n\n        if (memberClass == ObjectClass && otherClass == AnyClass) () // skip -- can we have a mode of symbolpairs where this pair doesn't even appear?\n        else if (typesOnly) checkOverrideTypes()\n        else {\n          // o: public | protected        | package-protected  (aka java's default access)\n          // ^-may be overridden by member with access privileges-v\n          // m: public | public/protected | public/protected/package-protected-in-same-package-as-o\n\n          if (member.isPrivate) // (1.1)\n            weakerAccessError(\"override should not be private\")\n\n          // todo: align accessibility implication checking with isAccessible in Contexts\n          @inline def protectedOK = !other.isProtected || member.isProtected\n          @inline def accessBoundaryOK = {\n            val ob = other.accessBoundary(memberClass)\n            val mb = member.accessBoundary(memberClass)\n            @inline def companionBoundaryOK = ob.isClass && mb.isModuleClass && mb.module == ob.companionSymbol\n            !isRootOrNone(ob) && (ob.hasTransOwner(mb) || companionBoundaryOK)\n          }\n          @inline def otherIsJavaProtected = other.isJavaDefined && other.isProtected\n          val isOverrideAccessOK =\n            member.isPublic ||     // member is public, definitely same or relaxed access\n            protectedOK &&         // if o is protected, so is m\n            (accessBoundaryOK ||   // m relaxes o's access boundary\n              otherIsJavaProtected // overriding a protected java member, see #3946 #12349\n            )\n          if (!isOverrideAccessOK)\n            overrideAccessError()\n          else if (other.isClass)\n            overrideErrorWithMemberInfo(\"class definitions cannot be overridden:\")\n          else if (!other.isDeferred && member.isClass)\n            overrideErrorWithMemberInfo(\"classes can only override abstract types; cannot override:\")\n          else if (other.isEffectivelyFinal) // (1.2)\n            overrideErrorWithMemberInfo(\"cannot override final member:\")\n          else {\n            // In Java, the OVERRIDE flag is implied\n            val memberOverrides = member.isAnyOverride || (member.isJavaDefined && !member.isDeferred)\n\n            // Concrete `other` requires `override` for `member`.\n            // Synthetic exclusion for (at least) default getters, fixes scala/bug#5178.\n            // We cannot assign the OVERRIDE flag to the default getter:\n            // one default getter might sometimes override, sometimes not. Example in comment on ticket.\n            if (!memberOverrides && !other.isDeferred && !member.isSynthetic)\n              overrideErrorConcreteMissingOverride()\n            else if (other.isAbstractOverride && other.isIncompleteIn(clazz) && !member.isAbstractOverride)\n              overrideErrorWithMemberInfo(\"`abstract override` modifiers required to override:\")\n            else if (memberOverrides && other.hasFlag(ACCESSOR) && !other.hasFlag(STABLE | DEFERRED))\n              // TODO: this is not covered by the spec.\n              overrideErrorWithMemberInfo(\"mutable variable cannot be overridden:\")\n            else if (memberOverrides &&\n                     !memberClass.thisType.baseClasses.exists(_.isSubClass(otherClass)) &&\n                     !member.isDeferred && !other.isDeferred &&\n                     intersectionIsEmpty(member.extendedOverriddenSymbols, other.extendedOverriddenSymbols))\n              overrideErrorWithMemberInfo(\"cannot override a concrete member without a third member that's overridden by both \" +\n                                          \"(this rule is designed to prevent accidental overrides)\")\n            else if (other.isStable && !member.isStable) // (1.4)\n              overrideErrorWithMemberInfo(\"stable, immutable value required to override:\")\n            else if (member.isValue && member.isLazy &&\n                       other.isValue && other.hasStableFlag && !other.isDeferred && !other.isLazy)\n              overrideErrorWithMemberInfo(\"concrete non-lazy value cannot be overridden:\")\n            else if (other.isValue && other.isLazy && member.isValue && !member.isLazy)\n              overrideErrorWithMemberInfo(\"value must be lazy when overriding concrete lazy value:\")\n            else if (other.isDeferred && member.isTermMacro && member.extendedOverriddenSymbols.forall(_.isDeferred)) // (1.9)\n              overrideErrorWithMemberInfo(\"macro cannot override abstract method:\")\n            else if (other.isTermMacro && !member.isTermMacro) // (1.10)\n              overrideErrorWithMemberInfo(\"macro can only be overridden by another macro:\")\n            else {\n              checkOverrideTypes()\n              // Don't bother users with deprecations caused by classes they inherit.\n              // Only warn for the pair that has one leg in `clazz`.\n              if (isMemberClass) checkOverrideDeprecated()\n              def javaDetermined(sym: Symbol) = sym.isJavaDefined || isUniversalMember(sym)\n              def exempted = javaDetermined(member) || javaDetermined(other) || member.overrides.exists(javaDetermined)\n              // warn that nilary member matched nullary other, so either it was adapted by namer or will be silently mixed in by mixin\n              def warnAdaptedNullaryOverride(): Unit = {\n                val mbr = if (isMemberClass) \"method\" else s\"${member.fullLocationString} defined\"\n                val msg = s\"$mbr without a parameter list overrides ${other.fullLocationString} defined with a single empty parameter list\"\n                val namePos = member.pos\n                val action =\n                  if (namePos.isDefined && namePos.source.sourceAt(namePos) == member.decodedName)\n                    runReporting.codeAction(\"add empty parameter list\", namePos.focusEnd, \"()\", msg)\n                  else Nil\n                overrideErrorOrNullaryWarning(msg, action)\n              }\n              def warnExtraParens(): Unit = {\n                val mbr = if (isMemberClass) \"method\" else s\"${member.fullLocationString} defined\"\n                val msg = s\"$mbr with a single empty parameter list overrides ${other.fullLocationString} defined without a parameter list\"\n                val namePos = member.pos\n                val action =\n                  if (namePos.isDefined && namePos.source.sourceAt(namePos) == member.decodedName)\n                    runReporting.codeAction(\"remove empty parameter list\", namePos.focusEnd.withEnd(namePos.end + 2), \"\", msg, expected = Some((\"()\", currentUnit)))\n                  else Nil\n                overrideErrorOrNullaryWarning(msg, action)\n              }\n              if (member.hasAttachment[NullaryOverrideAdapted.type]) {\n                if (!exempted)\n                  warnAdaptedNullaryOverride()\n              }\n              else if (member.paramLists.isEmpty) {\n                // Definitions that directly override get a parameter list and a `NullaryOverrideAdapted` attachment\n                // in Namers. Here we also warn when there's a mismatch between two mixed-in members.\n                if (!member.isStable && other.paramLists.nonEmpty && !exempted && !other.overrides.exists(javaDetermined))\n                  warnAdaptedNullaryOverride()\n              }\n              else if (other.paramLists.isEmpty) {\n                if (!exempted && !member.hasAnnotation(BeanPropertyAttr) && !member.hasAnnotation(BooleanBeanPropertyAttr))\n                  warnExtraParens()\n              }\n            }\n          }\n        }\n\n        def checkOverrideAlias(): Unit = {\n          // Important: first check the pair has the same kind, since the substitution\n          // carries high's type parameter's bounds over to low, so that\n          // type equality doesn't consider potentially different bounds on low/high's type params.\n          // In b781e25afe this went from using memberInfo to memberType (now lowType/highType), tested by neg/override.scala.\n          // TODO: was that the right fix? it seems type alias's RHS should be checked by looking at the symbol's info\n          if (pair.sameKind && lowType.substSym(member.typeParams, other.typeParams) =:= highType) ()\n          else overrideTypeError() // (1.6)\n        }\n        def checkOverrideAbstractType(): Unit = {\n          if (!(highInfo.bounds containsType lowType)) { // (1.7.1)\n            overrideTypeError(); // todo: do an explaintypes with bounds here\n            explainTypes(_.bounds containsType _, highInfo, lowType)\n          }\n          // check overriding (abstract type --> abstract type or abstract type --> concrete type member (a type alias))\n          // making an abstract type member concrete is like passing a type argument\n          typer.infer.checkKindBounds(other :: Nil, lowType :: Nil, rootType, memberClass) match { // (1.7.2)\n            case Nil        =>\n            case kindErrors =>\n              reporter.error(member.pos,\n                \"The kind of \" + member.keyString+\" \" + member.varianceString + member.nameString+\n                \" does not conform to the expected kind of \" + other.defString + other.locationString + \".\" +\n                kindErrors.toList.mkString(\"\\n\", \", \", \"\"))\n          }\n          // check a type alias's RHS corresponds to its declaration\n          // this overlaps somewhat with validateVariance\n          if (member.isAliasType) {\n            typer.infer.checkKindBounds(member :: Nil, lowType.normalize :: Nil, rootType, memberClass) match {\n              case Nil        =>\n              case kindErrors =>\n                reporter.error(member.pos,\n                  \"The kind of the right-hand side \"+lowType.normalize+\" of \" + member.keyString+\" \"+\n                  member.varianceString + member.nameString+ \" does not conform to its expected kind.\"+\n                  kindErrors.toList.mkString(\"\\n\", \", \", \"\"))\n            }\n          }\n          else if (member.isAbstractType && lowType.isVolatile && !highInfo.upperBound.isVolatile)\n            overrideErrorWithMemberInfo(\"volatile type member cannot override type member with non-volatile upper bound:\")\n        }\n        def checkOverrideTerm(): Unit = {\n          member.cookJavaRawInfo() // #11584, #11840\n          other.cookJavaRawInfo() // #2454\n          if (!overridesTypeInPrefix(lowType, highType, rootType)) { // 8\n            overrideTypeError()\n            explainTypes(lowType, highType)\n          }\n          if (member.isStable && !highType.isVolatile) {\n            if (lowType.isVolatile)\n              overrideErrorWithMemberInfo(\"member with volatile type cannot override member with non-volatile type:\")\n            else lowType.normalize.resultType match {\n              case rt: RefinedType if !(rt =:= highType) && notYetCheckedOrAdd(rt, pair.base) =>\n                // might mask some inconsistencies -- check overrides\n                val tsym = rt.typeSymbol\n                if (tsym.pos == NoPosition) tsym setPos member.pos\n                checkAllOverrides(tsym, typesOnly = true)\n              case _ =>\n            }\n          }\n        }\n        def checkOverrideTypes(): Unit = {\n          if (other.isAliasType)         checkOverrideAlias()\n          else if (other.isAbstractType) checkOverrideAbstractType()\n          else if (other.isTerm)         checkOverrideTerm()\n        }\n\n        def checkOverrideDeprecated(): Unit = {\n          if (other.hasDeprecatedOverridingAnnotation && !(member.hasDeprecatedOverridingAnnotation || member.ownerChain.exists(_.isDeprecated))) {\n            val version = other.deprecatedOverridingVersion.getOrElse(\"\")\n            val since   = if (version.isEmpty) version else s\" (since $version)\"\n            val message = other.deprecatedOverridingMessage map (msg => s\": $msg\") getOrElse \"\"\n            val report  = s\"overriding ${other.fullLocationString} is deprecated$since$message\"\n            runReporting.deprecationWarning(member.pos, other, member, report, version)\n          }\n        }\n      }\n\n      val opc = new overridingPairs.PairsCursor(clazz)\n      while (opc.hasNext) {\n        if (!opc.high.isClass)\n          checkOverride(opc.currentPair)\n\n        opc.next()\n      }\n      printMixinOverrideErrors()\n\n      // Verifying a concrete class has nothing unimplemented.\n      if (clazz.isConcreteClass && !typesOnly) {\n        val abstractErrors = ListBuffer.empty[String]\n        def abstractErrorMessage = abstractErrors.mkString(\"\\n\")\n\n        def abstractClassError(msg: String, supplement: String = \"\", mustBeMixin: Boolean = false): Unit = {\n          def prelude =\n            if (clazz.isAnonymousClass || clazz.isModuleClass) \"object creation impossible.\"\n            else if (mustBeMixin) s\"$clazz needs to be a mixin.\"\n            else s\"$clazz needs to be abstract.\"\n\n          if (abstractErrors.isEmpty) abstractErrors += prelude\n          abstractErrors += msg\n          if (!supplement.isEmpty) abstractErrors += supplement\n        }\n\n        def javaErasedOverridingSym(sym: Symbol): Symbol =\n          clazz.tpe.nonPrivateMemberAdmitting(sym.name, BRIDGE).filter(other =>\n            !other.isDeferred && other.isJavaDefined && !sym.enclClass.isSubClass(other.enclClass) && {\n              // #3622: erasure operates on uncurried types --\n              // note on passing sym in both cases: only sym.isType is relevant for uncurry.transformInfo\n              // !!! erasure.erasure(sym, uncurry.transformInfo(sym, tp)) gives erroneous or inaccessible type - check whether that's still the case!\n              def uncurryAndErase(tp: Type) = erasure.erasure(sym)(uncurry.transformInfo(sym, tp))\n              val tp1 = uncurryAndErase(clazz.thisType.memberType(sym))\n              val tp2 = uncurryAndErase(clazz.thisType.memberType(other))\n              exitingErasure(tp1 matches tp2)\n            })\n\n        def ignoreDeferred(member: Symbol) =\n          (member.isAbstractType && !member.isFBounded) || (\n            // the test requires exitingErasure so shouldn't be\n            // done if the compiler has no erasure phase available\n               member.isJavaDefined\n            && (currentRun.erasurePhase == NoPhase || javaErasedOverridingSym(member) != NoSymbol)\n          )\n\n        // 2. Check that only abstract classes have deferred members\n        def checkNoAbstractMembers(): Unit = {\n          val NoError = null.asInstanceOf[String]\n          val EmptyDiagnostic = \"\"\n          def diagnose(member: Symbol, accessors: List[Symbol], nonPrivateMembers: Scope, fastDiagnostics: Boolean): String = {\n            val underlying = analyzer.underlyingSymbol(member) // TODO: don't use this method\n\n            // Give a specific error message for abstract vars based on why it fails:\n            // It could be unimplemented, have only one accessor, or be uninitialized.\n            val isMultiple = accessors.size > 1\n\n            if (accessors.exists(_.isSetter) || (member.isGetter && !isMultiple && member.setterIn(member.owner).exists)) {\n              if (member.isSetter && isMultiple) NoError // If both getter and setter are missing, squelch the setter error.\n              else if (member.isSetter) \"an abstract var requires a setter in addition to the getter\"\n              else if (member.isGetter && !isMultiple) \"an abstract var requires a getter in addition to the setter\"\n              else \"variables need to be initialized to be defined\"\n            }\n            else if (!fastDiagnostics && underlying.isMethod) {\n              // Highlight any member that nearly matches: same name and arity,\n              // but differs in one param or param list.\n              val abstractParamLists = underlying.paramLists\n              val matchingArity      = nonPrivateMembers.reverseIterator.filter { m =>\n                !m.isDeferred &&\n                m.name == underlying.name &&\n                sameLength(m.paramLists, abstractParamLists) &&\n                sumSize(m.paramLists, 0) == sumSize(abstractParamLists, 0) &&\n                sameLength(m.tpe.typeParams, underlying.tpe.typeParams) &&\n                !(m.isJavaDefined && m.hasFlag(JAVA_DEFAULTMETHOD))\n              }.toList\n              matchingArity match {\n                // So far so good: only one candidate method\n                case concrete :: Nil =>\n                  val concreteParamLists = concrete.paramLists\n                  val aplIter = abstractParamLists.iterator.flatten\n                  val cplIter = concreteParamLists.iterator.flatten\n                  def mismatch(apl: Symbol, cpl: Symbol): Option[(Type, Type)] =\n                    if (apl.tpe.asSeenFrom(clazz.tpe, underlying.owner) =:= cpl.tpe) None else Some(apl.tpe -> cpl.tpe)\n                  def missingImplicit = abstractParamLists.zip(concreteParamLists).exists {\n                    case (abss, konkrete) => abss.headOption.exists(_.isImplicit) && !konkrete.headOption.exists(_.isImplicit)\n                  }\n                  val mismatches = mapFilter2(aplIter, cplIter)(mismatch).take(2).toList\n                  mismatches match {\n                    // Only one mismatched parameter: say something useful.\n                    case (pa, pc) :: Nil  =>\n                      val abstractSym = pa.typeSymbol\n                      val concreteSym = pc.typeSymbol\n                      def subclassMsg(c1: Symbol, c2: Symbol) =\n                        s\": ${c1.fullLocationString} is a subclass of ${c2.fullLocationString}, but method parameter types must match exactly.\"\n                      def wrongSig = {\n                        val m = concrete\n                        fullyInitializeSymbol(m)\n                        m.defStringSeenAs(clazz.tpe_*.memberType(m))\n                      }\n                      val addendum =\n                        if (abstractSym == concreteSym) {\n                          if (underlying.isJavaDefined && pa.typeArgs.isEmpty && abstractSym.typeParams.nonEmpty)\n                            s\". To implement this raw type, use ${rawToExistential(pa)}\"\n                          else if (pa.prefix =:= pc.prefix)\n                            \": their type parameters differ\"\n                          else\n                            \": their prefixes (i.e., enclosing instances) differ\"\n                        }\n                        else if (abstractSym.isSubClass(concreteSym)) subclassMsg(abstractSym, concreteSym)\n                        else if (concreteSym.isSubClass(abstractSym)) subclassMsg(concreteSym, abstractSym)\n                        else s\" in `$wrongSig`\"\n                      s\"$pa does not match $pc$addendum\"\n                    case Nil if missingImplicit => \"overriding member must declare implicit parameter list\" // other overriding gotchas\n                    case _ => EmptyDiagnostic\n                  }\n                case _ => EmptyDiagnostic\n              }\n            }\n            else EmptyDiagnostic\n          }\n          def emitErrors(missing: List[Symbol], nonPrivateMembers: Scope): Unit = {\n            val fastDiagnostics = missing.lengthCompare(100) > 0\n            // Group missing members by the name of the underlying symbol, to consolidate getters and setters.\n            val byName = missing.groupBy(_.name.getterName)\n            // There may be 1 or more missing members declared in 1 or more parents.\n            // If a single parent, the message names it. Otherwise, missing members are grouped by declaring class.\n            val byOwner = missing.groupBy(_.owner).toList\n            val announceOwner = byOwner.size > 1\n            def membersStrings(members: List[Symbol]) = {\n              members.sortBy(_.name).flatMap { m =>\n                val accessors = byName.getOrElse(m.name.getterName, Nil)\n                val diagnostic = diagnose(m, accessors, nonPrivateMembers, fastDiagnostics)\n                if (diagnostic == NoError) Nil\n                else {\n                  val s0a = infoString0(m, showLocation = false)\n                  fullyInitializeSymbol(m)\n                  val s0b = m.defString\n                  val s1 = m.defStringSeenAs(clazz.tpe_*.memberType(m))\n                  val implMsg = if (s1 != s0a) s\"implements `$s0a`\" else if (s1 != s0b) s\"implements `$s0b`\" else \"\"\n                  val spacer  = if (diagnostic.nonEmpty && implMsg.nonEmpty) \"; \" else \"\"\n                  val comment = if (diagnostic.nonEmpty || implMsg.nonEmpty) s\" // $implMsg$spacer$diagnostic\" else \"\"\n                  s\"$s1 = ???$comment\" :: Nil\n                }\n              }\n            }\n            var count = 0\n            def isMulti = count > 1\n            def helpfulListing =\n              byOwner.sortBy(_._1.name.toString).flatMap {\n                case (owner, members) =>\n                  val ms = membersStrings(members) :+ \"\"\n                  count += ms.size - 1\n                  if (announceOwner) s\"// Members declared in ${owner.fullName}\" :: ms else ms\n              }.init.map(s => s\"  $s\\n\").mkString\n            val stubs = helpfulListing\n            def singleParent = if (byOwner.size == 1 && byOwner.head._1 != clazz) s\" member${if (isMulti) \"s\" else \"\"} of ${byOwner.head._1}\" else \"\"\n            val line0 =\n              if (isMulti) s\"Missing implementations for ${count}${val p = singleParent ; if (p.isEmpty) \" members\" else p}.\"\n              else s\"Missing implementation${val p = singleParent ; if (p.isEmpty) p else s\" for$p\"}:\"\n            abstractClassError(line0, supplement = stubs)\n          }\n          def filtered[A](it: Iterator[A])(p: A => Boolean)(q: A => Boolean): (List[A], List[A]) = {\n            var ps, qs: List[A] = Nil\n            while (it.hasNext) {\n              val a = it.next()\n              if (p(a)) ps ::= a\n              else if (q(a)) qs ::= a\n            }\n            (ps, qs)\n          }\n          val nonPrivateMembers = clazz.info.nonPrivateMembersAdmitting(VBRIDGE)\n          // Avoid extra allocations with reverseIterator. Filter for abstract members of interest, and bad abstract override.\n          val (missing, abstractIncomplete): (List[Symbol], List[Symbol]) =\n            filtered(nonPrivateMembers.reverseIterator)(m => m.isDeferred & !ignoreDeferred(m))(m => m.isAbstractOverride && m.isIncompleteIn(clazz))\n          if (missing.nonEmpty) emitErrors(missing, nonPrivateMembers)\n          // Check the remainder for invalid absoverride.\n          for (member <- abstractIncomplete) {\n            val explanation = member.superSymbolIn(clazz) match {\n              case NoSymbol => \", but no concrete implementation could be found in a base class\"\n              case other    => \" and overrides incomplete superclass member\\n\" + infoString(other)\n            }\n            abstractClassError(s\"${infoString(member)} is marked `abstract` and `override`$explanation\", mustBeMixin = true)\n          }\n        } // end checkNoAbstractMembers\n\n        // 3. Check that concrete classes do not have deferred definitions\n        // that are not implemented in a subclass.\n        // Note that this is not the same as (2); In a situation like\n        //\n        // class C { def m: Int = 0}\n        // class D extends C { def m: Int }\n        //\n        // (3) is violated but not (2).\n        def checkNoAbstractDecls(bc: Symbol): Unit = {\n          for (decl <- bc.info.decls) {\n            if (decl.isDeferred && !ignoreDeferred(decl)) {\n              val impl = decl.matchingSymbol(clazz.thisType, admit = VBRIDGE)\n              if (impl == NoSymbol || decl.owner.isSubClass(impl.owner))\n                abstractClassError(s\"No implementation found in a subclass for deferred declaration\\n\" +\n                                          s\"${infoString(decl)}${analyzer.abstractVarMessage(decl)}\")\n            }\n          }\n          if (bc.superClass hasFlag ABSTRACT)\n            checkNoAbstractDecls(bc.superClass)\n        }\n\n        checkNoAbstractMembers()\n        if (abstractErrors.isEmpty)\n          checkNoAbstractDecls(clazz)\n\n        if (abstractErrors.nonEmpty)\n          reporter.error(clazz.pos, abstractErrorMessage)\n      }\n      else if (clazz.isTrait && !clazz.isSubClass(AnyValClass)) {\n        // For non-AnyVal classes, prevent abstract methods in interfaces that override\n        // final members in Object; see #4431\n        for (decl <- clazz.info.decls) {\n          // Have to use matchingSymbol, not a method involving overridden symbols,\n          // because the scala type system understands that an abstract method here does not\n          // override a concrete method in Object. The jvm, however, does not.\n          val overridden = decl.matchingSymbol(ObjectClass, ObjectTpe)\n          if (overridden.isFinal)\n            reporter.error(decl.pos, \"trait cannot redefine final method from class AnyRef\")\n        }\n      }\n\n      /* Returns whether there is a symbol declared in class `inclazz`\n       * (which must be different from `clazz`) whose name and type\n       * seen as a member of `class.thisType` matches `member`'s.\n       */\n      def hasMatchingSym(inclazz: Symbol, member: Symbol): Boolean = {\n        val isVarargs = hasRepeatedParam(member.tpe)\n        lazy val varargsType = toJavaRepeatedParam(member.tpe)\n\n        def isSignatureMatch(sym: Symbol) = !sym.isTerm || {\n          val symtpe = clazz.thisType.memberType(sym)\n          member.tpe.matches(symtpe) || (isVarargs && varargsType.matches(symtpe))\n        }\n        /* The rules for accessing members which have an access boundary are more\n         * restrictive in java than scala.  Since java has no concept of package nesting,\n         * a member with \"default\" (package-level) access can only be accessed by members\n         * in the exact same package.  Example:\n         *\n         *   package a.b;\n         *   public class JavaClass { void foo() { } }\n         *\n         * The member foo() can be accessed only from members of package a.b, and not\n         * nested packages like a.b.c.  In the analogous scala class:\n         *\n         *   package a.b\n         *   class ScalaClass { private[b] def foo() = () }\n         *\n         * The member IS accessible to classes in package a.b.c.  The javaAccessCheck logic\n         * is restricting the set of matching signatures according to the above semantics.\n         */\n        def javaAccessCheck(sym: Symbol) = (\n             !inclazz.isJavaDefined                             // not a java defined member\n          || !sym.hasAccessBoundary                             // no access boundary\n          || sym.isProtected                                    // marked protected in java, thus accessible to subclasses\n          || sym.privateWithin == member.enclosingPackageClass  // exact package match\n        )\n        def classDecl = inclazz.info.nonPrivateDecl(member.name)\n                        .orElse(inclazz.info.nonPrivateDecl(member.unexpandedName))\n        def matchingSyms = classDecl.filter(sym => isSignatureMatch(sym) && javaAccessCheck(sym))\n\n        (inclazz != clazz) && (matchingSyms != NoSymbol)\n      }\n\n      // 4. Check that every defined member with an `override` modifier overrides some other member.\n      for (member <- clazz.info.decls)\n        if (member.isAnyOverride && !clazz.thisType.baseClasses.exists(hasMatchingSym(_, member))) {\n          // for (bc <- clazz.info.baseClasses.tail) Console.println(\"\" + bc + \" has \" + bc.info.decl(member.name) + \":\" + bc.info.decl(member.name).tpe);//DEBUG\n\n          val nonMatching: List[Symbol] = clazz.info.member(member.name).alternatives.filterNot(_.owner == clazz).filterNot(_.isFinal)\n          def issueError(suffix: String) = reporter.error(member.pos, member.toString() + \" overrides nothing\" + suffix)\n          nonMatching match {\n            case Nil =>\n              issueError(\"\")\n            case ms =>\n              val superSigs = ms.map(m => m.defStringSeenAs(clazz.tpe memberType m)).mkString(\"\\n\")\n              issueError(s\".\\nNote: the super classes of ${member.owner} contain the following, non final members named ${member.name}:\\n${superSigs}\")\n          }\n          member resetFlag (OVERRIDE | ABSOVERRIDE)  // Any Override\n        }\n\n      // 5. Check that the nested class do not shadow other nested classes from outer class's parent\n      def checkNestedClassShadow(): Unit =\n        if (clazz.isNestedClass && !clazz.isModuleClass) {\n          val overridden = clazz.owner.ancestors\n            .map(a => clazz.matchingSymbol(a, clazz.owner.thisType))\n            .filter(c => c.exists && c.isClass)\n          overridden foreach { sym2 =>\n            def msg(what: String) = s\"shadowing a nested class of a parent is $what but $clazz shadows $sym2 defined in ${sym2.owner}; rename the class to something else\"\n            if (currentRun.isScala3) runReporting.warning(clazz.pos, msg(\"deprecated\"), WarningCategory.Scala3Migration, clazz)\n            else runReporting.deprecationWarning(clazz.pos, clazz, currentOwner, msg(\"deprecated\"), \"2.13.2\")\n          }\n        }\n      checkNestedClassShadow()\n    } // end checkAllOverrides\n\n  // Basetype Checking --------------------------------------------------------\n\n    /** <ol>\n     *    <li> <!-- 1 -->\n     *      Check that later type instances in the base-type sequence\n     *      are subtypes of earlier type instances of the same mixin.\n     *    </li>\n     *  </ol>\n     */\n    private def validateBaseTypes(clazz: Symbol): Unit = {\n      val seenParents = mutable.HashSet[Type]()\n      val seenTypes = Array.fill[List[Type]](clazz.info.baseTypeSeq.length)(Nil)\n      val warnCloneable = settings.warnCloneableObject && clazz.isModuleClass\n\n      /* validate all base types of a class in reverse linear order. */\n      def register(tp: Type): Unit = {\n        val baseClass = tp.typeSymbol\n        if (baseClass.isClass) {\n          if (!baseClass.isTrait && !baseClass.isJavaDefined && !currentRun.compiles(baseClass) && !separatelyCompiledScalaSuperclass.contains(baseClass))\n            separatelyCompiledScalaSuperclass.update(baseClass, ())\n          val index = clazz.info.baseTypeIndex(baseClass)\n          if (index >= 0) {\n            if (!seenTypes(index).exists(_ <:< tp))\n              seenTypes(index) = tp :: seenTypes(index).filterNot(tp <:< _)\n          }\n        }\n        if (warnCloneable && baseClass.eq(JavaCloneableClass))\n          reporter.warning(clazz.pos, s\"$clazz should not extend Cloneable.\")\n        val remaining = tp.parents.filterNot(seenParents)\n        seenParents ++= remaining\n        remaining.foreach(register)\n      }\n      register(clazz.tpe)\n      for (i <- 0 until seenTypes.length) {\n        val baseClass = clazz.info.baseTypeSeq(i).typeSymbol\n        seenTypes(i) match {\n          case Nil =>\n            devWarning(s\"base $baseClass not found in basetypes of $clazz. This might indicate incorrect caching of TypeRef#parents.\")\n          case _ :: Nil => // OK\n          case tp1 :: tp2 :: _ =>\n            reporter.error(clazz.pos,\n              sm\"\"\"|illegal inheritance;\n                   | $clazz inherits different type instances of $baseClass:\n                   |$tp1 and $tp2\"\"\")\n            explainTypes(tp1, tp2)\n            explainTypes(tp2, tp1)\n        }\n      }\n    }\n\n  // Variance Checking --------------------------------------------------------\n\n    object varianceValidator extends VarianceValidator {\n      private def tpString(tp: Type) = tp match {\n        case ClassInfoType(parents, _, clazz) => \"supertype \"+intersectionType(parents, clazz.owner)\n        case _                                => \"type \"+tp\n      }\n      override def issueVarianceError(base: Symbol, sym: Symbol, required: Variance, tpe: Type): Unit = {\n        reporter.error(base.pos,\n          s\"${sym.variance} $sym occurs in $required position in ${tpString(tpe)} of $base\")\n      }\n    }\n\n// Forward reference checking ---------------------------------------------------\n\n    class LevelInfo(val outer: LevelInfo) {\n      val scope: Scope = if (outer eq null) newScope else newNestedScope(outer.scope)\n      var maxindex: Int = Int.MinValue\n      var refpos: Position = _\n      var refsym: Symbol = _\n    }\n\n    private var currentLevel: LevelInfo = null\n    private val symIndex = perRunCaches.newMap[Symbol, Int]()\n\n    private def pushLevel(): Unit = {\n      currentLevel = new LevelInfo(currentLevel)\n    }\n\n    private def popLevel(): Unit = {\n      currentLevel = currentLevel.outer\n    }\n\n    private def enterSyms(stats: List[Tree]): Unit = {\n      var index = -1\n      for (stat <- stats) {\n        index = index + 1\n\n        stat match {\n          case _ : MemberDef if stat.symbol.isLocalToBlock =>\n            currentLevel.scope.enter(stat.symbol)\n            symIndex(stat.symbol) = index\n          case _ =>\n        }\n      }\n    }\n\n    private def enterReference(pos: Position, sym: Symbol): Unit = {\n      if (sym.isLocalToBlock) {\n        val e = currentLevel.scope.lookupEntry(sym.name)\n        if ((e ne null) && sym == e.sym) {\n          var l = currentLevel\n          while (l.scope != e.owner) l = l.outer\n          val symindex = symIndex(sym)\n          if (l.maxindex < symindex) {\n            l.refpos = pos\n            l.refsym = sym\n            l.maxindex = symindex\n          }\n        }\n      }\n    }\n\n// Comparison checking -------------------------------------------------------\n    object normalizeAll extends TypeMap {\n      def apply(tp: Type) = mapOver(tp).normalize\n    }\n\n    def checkImplicitViewOptionApply(pos: Position, fn: Tree, args: List[Tree]): Unit = if (settings.warnOptionImplicit) (fn, args) match {\n      case (tap@TypeApply(fun, targs), List(view: ApplyImplicitView)) if fun.symbol == currentRun.runDefinitions.Option_apply =>\n        refchecksWarning(pos, s\"Suspicious application of an implicit view (${view.fun}) in the argument to Option.apply.\", WarningCategory.LintOptionImplicit) // scala/bug#6567\n      case _ =>\n    }\n\n    private def isObjectOrAnyComparisonMethod(sym: Symbol) = sym match {\n      case Object_eq | Object_ne | Object_== | Object_!= | Any_== | Any_!= => true\n      case _                                                               => false\n    }\n\n    /**\n      * Check the sensibility of using the given `equals` to compare `qual` and `other`.\n      *\n      * NOTE: I'm really not convinced by the logic here. I also think this would work better after erasure.\n      */\n    private def checkSensibleEquals(pos: Position, qual: Tree, name: Name, sym: Symbol, other: Tree) = {\n      def isReferenceOp = sym == Object_eq || sym == Object_ne\n      def isNew(tree: Tree) = tree match {\n        case Function(_, _) | Apply(Select(New(_), nme.CONSTRUCTOR), _) => true\n        case _ => false\n      }\n      def underlyingClass(tp: Type): Symbol = {\n        val sym = tp.widen.typeSymbol\n        if (sym.isAbstractType) underlyingClass(sym.info.upperBound)\n        else sym\n      }\n      val actual   = underlyingClass(other.tpe)\n      val receiver = underlyingClass(qual.tpe)\n      def onTrees[T](f: List[Tree] => T) = f(List(qual, other))\n      def onSyms[T](f: List[Symbol] => T) = f(List(receiver, actual))\n\n      // @MAT normalize for consistency in error message, otherwise only part is normalized due to use of `typeSymbol`\n      def typesString = s\"${normalizeAll(qual.tpe.widen)} and ${normalizeAll(other.tpe.widen)}\"\n\n      // TODO: this should probably be used in more type comparisons in checkSensibleEquals\n      def erasedClass(tp: Type) = erasure.javaErasure(tp).typeSymbol\n\n      /* Symbols which limit the warnings we can issue since they may be value types */\n      val couldBeAnything = Set[Symbol](ObjectClass, ComparableClass, SerializableClass)\n      def isMaybeValue(sym: Symbol): Boolean = couldBeAnything(erasedClass(sym.tpe))\n\n      // Whether def equals(other: Any) has known behavior: it is the default\n      // inherited from java.lang.Object, or it is a synthetically generated\n      // case equals.  TODO - more cases are warnable if the target is a synthetic\n      // equals.\n      def isUsingWarnableEquals = {\n        val m = receiver.info.member(nme.equals_)\n        ((m == Object_equals) || (m == Any_equals) || isMethodCaseEquals(m))\n      }\n      def isMethodCaseEquals(m: Symbol) = m.isSynthetic && m.owner.isCase\n      def isCaseEquals = isMethodCaseEquals(receiver.info.member(nme.equals_))\n      // Whether this == or != is one of those defined in Any/AnyRef or an overload from elsewhere.\n      def isUsingDefaultScalaOp = sym == Object_== || sym == Object_!= || sym == Any_== || sym == Any_!=\n      def haveSubclassRelationship = (actual isSubClass receiver) || (receiver isSubClass actual)\n\n      // Whether the operands+operator represent a warnable combo (assuming anyrefs)\n      // Looking for comparisons performed with ==/!= in combination with either an\n      // equals method inherited from Object or a case class synthetic equals (for\n      // which we know the logic.)\n      def isWarnable           = isReferenceOp || (isUsingDefaultScalaOp && isUsingWarnableEquals)\n      def isEitherNullable     = (NullTpe <:< receiver.info) || (NullTpe <:< actual.info)\n      def isEitherValueClass   = actual.isDerivedValueClass || receiver.isDerivedValueClass\n      def isBoolean(s: Symbol) = unboxedValueClass(s) == BooleanClass\n      def isUnit(s: Symbol)    = unboxedValueClass(s) == UnitClass\n      def isNumeric(s: Symbol) = isNumericValueClass(unboxedValueClass(s)) || isAnyNumber(s)\n      def isScalaNumber(s: Symbol) = s isSubClass ScalaNumberClass\n      def isJavaNumber(s: Symbol)  = s isSubClass JavaNumberClass\n      // includes java.lang.Number if appropriate [scala/bug#5779]\n      def isAnyNumber(s: Symbol)     = isScalaNumber(s) || isJavaNumber(s)\n      def isMaybeAnyValue(s: Symbol) = isPrimitiveValueClass(unboxedValueClass(s)) || isMaybeValue(s)\n      // used to short-circuit unrelatedTypes check if both sides are special\n      def isSpecial(s: Symbol) = isMaybeAnyValue(s) || isAnyNumber(s)\n      val nullCount            = onSyms(_.filter(_ == NullClass).size)\n      def isNonsenseValueClassCompare = (\n           !haveSubclassRelationship\n        && isUsingDefaultScalaOp\n        && isEitherValueClass\n        && !isCaseEquals\n      )\n\n      def isEffectivelyFinalDeep(sym: Symbol): Boolean = (\n        sym.isEffectivelyFinal\n        // If a parent of an intersection is final, the resulting type must effectively be final.\n        // (Any subclass of the refinement would have to be a subclass of that final parent.)\n        // OPT: this condition is not included in the standard isEffectivelyFinal check, as it's expensive\n        || sym.isRefinementClass && sym.info.parents.exists { _.typeSymbol.isEffectivelyFinal }\n      )\n\n      // Have we already determined that the comparison is non-sensible? I mean, non-sensical?\n      var isNonSensible = false\n\n      def nonSensibleWarning(what: String, alwaysEqual: Boolean) = {\n        val msg = alwaysEqual == (name == nme.EQ || name == nme.eq)\n        refchecksWarning(pos, s\"comparing $what using `${name.decode}` will always yield $msg\", WarningCategory.Other)\n        isNonSensible = true\n      }\n      def nonSensible(pre: String, alwaysEqual: Boolean) =\n        nonSensibleWarning(s\"${pre}values of types $typesString\", alwaysEqual)\n      def nonSensiblyEq() = nonSensible(\"\", alwaysEqual = true)\n      def nonSensiblyNeq() = nonSensible(\"\", alwaysEqual = false)\n      def nonSensiblyNew() = nonSensibleWarning(\"a fresh object\", alwaysEqual = false)\n\n      def unrelatedMsg = name match {\n        case nme.EQ | nme.eq => \"never compare equal\"\n        case _               => \"always compare unequal\"\n      }\n      def unrelatedTypes() = if (!isNonSensible) {\n        val weaselWord = if (isEitherValueClass) \"\" else \" most likely\"\n        refchecksWarning(pos, s\"$typesString are unrelated: they will$weaselWord $unrelatedMsg\", WarningCategory.Other)\n      }\n\n      if (nullCount == 2) // null == null\n        nonSensiblyEq()\n      else if (nullCount == 1) {\n        if (onSyms(_ exists isPrimitiveValueClass)) // null == 5\n          nonSensiblyNeq()\n        else if (onTrees( _ exists isNew)) // null == new AnyRef\n          nonSensiblyNew()\n      }\n      else if (isBoolean(receiver)) {\n        if (!isBoolean(actual) && !isMaybeValue(actual))    // true == 5\n          nonSensiblyNeq()\n      }\n      else if (isUnit(receiver)) {\n        if (isUnit(actual)) // () == ()\n          nonSensiblyEq()\n        else if (!isUnit(actual) && !isMaybeValue(actual))  // () == \"abc\"\n          nonSensiblyNeq()\n      }\n      else if (isNumeric(receiver)) {\n        if (!isNumeric(actual))\n          if (isUnit(actual) || isBoolean(actual) || !isMaybeValue(actual))   // 5 == \"abc\"\n            nonSensiblyNeq()\n      }\n      else if (isWarnable && !isCaseEquals) {\n        if (isNew(qual)) // new X == y\n          nonSensiblyNew()\n        else if (isNew(other) && (isEffectivelyFinalDeep(receiver) || isReferenceOp))   // object X ; X == new Y\n          nonSensiblyNew()\n        else if (isEffectivelyFinalDeep(actual) && isEffectivelyFinalDeep(receiver) && !haveSubclassRelationship) {  // object X, Y; X == Y\n          if (isEitherNullable)\n            nonSensible(\"non-null \", alwaysEqual = false)\n          else\n            nonSensiblyNeq()\n        }\n      }\n\n      // warn if one but not the other is a derived value class\n      // this is especially important to enable transitioning from\n      // regular to value classes without silent failures.\n      if (isNonsenseValueClassCompare)\n        unrelatedTypes()\n      // possibleNumericCount is insufficient or this will warn on e.g. Boolean == j.l.Boolean\n      else if (isWarnable && nullCount == 0 && !(isSpecial(receiver) && isSpecial(actual))) {\n        // Warn if types are unrelated, without interesting lub. (Don't bother if we don't know anything about the values we're comparing.)\n        def warnIfLubless(): Unit = {\n          if (isMaybeValue(actual) || isMaybeValue(receiver) || haveSubclassRelationship) {} // ignore trivial or related types\n          else {\n            // better to have lubbed and lost\n            // We erase the lub because the erased type is closer to what happens at run time.\n            // Also, the lub of `S` and `String` is, weirdly, the refined type `Serializable{}` (for `class S extends Serializable`),\n            // which means we can't just take its type symbol and look it up in our isMaybeValue Set.\n            val commonRuntimeClass = erasedClass(global.lub(List(actual.tpe, receiver.tpe)))\n            if (commonRuntimeClass == ObjectClass)\n              unrelatedTypes()\n          }\n        }\n\n        // warn if actual has a case parent that is not same as receiver's;\n        // if actual is not a case, then warn if no common supertype, as below\n        if (isCaseEquals) {\n          def thisCase = receiver.info.member(nme.equals_).owner\n          actual.info.baseClasses.find(_.isCase) match {\n            case Some(p) if p != thisCase => nonSensible(\"case class \", alwaysEqual = false)\n            case None =>\n              // stronger message on (Some(1) == None)\n              //if (receiver.isCase && receiver.isEffectivelyFinal && !(receiver isSubClass actual)) nonSensiblyNeq()\n              //else\n              // if a class, it must be super to thisCase (and receiver) since not <: thisCase\n              if (!actual.isTrait && !(receiver isSubClass actual)) nonSensiblyNeq()\n              else warnIfLubless()\n            case _ =>\n          }\n        }\n        else warnIfLubless()\n      }\n    }\n\n    private def checkSensibleAnyEquals(pos: Position, qual: Tree, name: Name, sym: Symbol, other: Tree) = {\n      def underlyingClass(tp: Type): Symbol = {\n        val sym = tp.widen.typeSymbol\n        if (sym.isAbstractType) underlyingClass(sym.info.upperBound)\n        else sym\n      }\n      val receiver = underlyingClass(qual.tpe)\n      val actual   = underlyingClass(other.tpe)\n      def typesString = \"\" + normalizeAll(qual.tpe.widen) + \" and \" + normalizeAll(other.tpe.widen)\n      def nonSensiblyEquals() = {\n        refchecksWarning(pos, s\"comparing values of types $typesString using `${name.decode}` unsafely bypasses cooperative equality; use `==` instead\", WarningCategory.OtherNonCooperativeEquals)\n      }\n      def isScalaNumber(s: Symbol) = s isSubClass ScalaNumberClass\n      def isJavaNumber(s: Symbol)  = s isSubClass JavaNumberClass\n      def isAnyNumber(s: Symbol)   = isScalaNumber(s) || isJavaNumber(s)\n      def isNumeric(s: Symbol)     = isNumericValueClass(unboxedValueClass(s)) || isAnyNumber(s)\n      def isReference(s: Symbol)   = (unboxedValueClass(s) isSubClass AnyRefClass) || (s isSubClass ObjectClass)\n      def isUnit(s: Symbol)        = unboxedValueClass(s) == UnitClass\n      def isNumOrNonRef(s: Symbol) = isNumeric(s) || (!isReference(s) && !isUnit(s))\n      if (isNumeric(receiver) && isNumOrNonRef(actual)) {\n        if (receiver == actual) ()\n        else nonSensiblyEquals()\n      }\n      else if ((sym == Any_equals || sym == Object_equals) && isNumOrNonRef(actual) && !isReference(receiver)) {\n        nonSensiblyEquals()\n      }\n    }\n\n    /** Sensibility check examines flavors of equals. */\n    def checkSensible(pos: Position, fn: Tree, args: List[Tree]) = fn match {\n      case Select(qual, name @ (nme.EQ | nme.NE | nme.eq | nme.ne)) if args.length == 1 && isObjectOrAnyComparisonMethod(fn.symbol) && (!currentOwner.isSynthetic || currentOwner.isAnonymousFunction) =>\n        checkSensibleEquals(pos, qual, name, fn.symbol, args.head)\n      case Select(qual, name @ nme.equals_) if args.length == 1 && (!currentOwner.isSynthetic || currentOwner.isAnonymousFunction) =>\n        checkSensibleAnyEquals(pos, qual, name, fn.symbol, args.head)\n      case _ =>\n    }\n\n    // scala/bug#6276 warn for trivial recursion, such as `def foo = foo` or `val bar: X = bar`, which come up more frequently than you might think.\n    // TODO: Move to abide rule. Also, this does not check that the def is final or not overridden, for example\n    def checkInfiniteLoop(sym: Symbol, rhs: Tree): Unit =\n      if (!sym.isValueParameter && sym.paramss.forall(_.isEmpty)) {\n        rhs match {\n          case Ident(_) | Select(This(_), _) | Apply(Select(This(_), _), _) if rhs hasSymbolWhich (_.accessedOrSelf == sym) =>\n            refchecksWarning(rhs.pos, s\"${sym.fullLocationString} does nothing other than call itself recursively\", WarningCategory.Other)\n          case _ =>\n        }\n      }\n\n// Transformation ------------------------------------------------------------\n\n    /* Convert a reference to a case factory of type `tpe` to a new of the class it produces. */\n    def toConstructor(pos: Position, tpe: Type): Tree = {\n      val rtpe = tpe.finalResultType\n      assert(rtpe.typeSymbol hasFlag CASE, tpe)\n      val tree = localTyper.typedOperator {\n        atPos(pos) {\n          Select(New(TypeTree(rtpe)), rtpe.typeSymbol.primaryConstructor)\n        }\n      }\n      checkUndesiredProperties(rtpe.typeSymbol, tree.pos)\n      checkUndesiredProperties(rtpe.typeSymbol.primaryConstructor, tree.pos)\n      tree\n    }\n\n    override def transformStats(stats: List[Tree], exprOwner: Symbol): List[Tree] = {\n      pushLevel()\n      try {\n        enterSyms(stats)\n        var index = -1\n        stats.mapConserve(stat => {\n          index += 1;\n          transformStat(stat, index)\n        }).filter(_ ne EmptyTree)\n      }\n      finally popLevel()\n    }\n\n    private def showCurrentRef: String = {\n      val refsym = currentLevel.refsym\n      s\"$refsym defined on line ${refsym.pos.line}\"\n    }\n\n    def transformStat(tree: Tree, index: Int): Tree = tree match {\n      case t if treeInfo.isSelfConstrCall(t) =>\n        assert(index == 0, index)\n        try transform(tree)\n        finally if (currentLevel.maxindex > 0) {\n          // An implementation restriction to avoid VerifyErrors and lazy vals mishaps; see scala/bug#4717\n          reporter.error(currentLevel.refpos, s\"forward reference to $showCurrentRef not allowed from self constructor invocation\")\n        }\n      case ValDef(_, _, _, _) =>\n        val tree1 = transform(tree) // important to do before forward reference check\n        if (tree1.symbol.isLazy) tree1\n        else {\n          val sym = tree.symbol\n          if (sym.isLocalToBlock && index <= currentLevel.maxindex) {\n            reporter.error(currentLevel.refpos, s\"forward reference to $showCurrentRef extends over definition of $sym\")\n          }\n          tree1\n        }\n      case Import(_, _)                                                                       => EmptyTree\n      case DefDef(mods, _, _, _, _, _) if (mods hasFlag MACRO) || (tree.symbol hasFlag MACRO) => EmptyTree\n      case _                                                                                  => transform(tree)\n    }\n\n    /* Check whether argument types conform to bounds of type parameters */\n    private def checkBounds(tree0: Tree, pre: Type, owner: Symbol, tparams: List[Symbol], argtps: List[Type]): Unit =\n      try typer.infer.checkBounds(tree0, pre, owner, tparams, argtps, \"\")\n      catch {\n        case ex: TypeError =>\n          reporter.error(tree0.pos, ex.getMessage())\n          if (settings.explaintypes.value) {\n            val bounds = tparams map (tp => tp.info.instantiateTypeParams(tparams, argtps).bounds)\n            foreach2(argtps, bounds)((targ, bound) => explainTypes(bound.lo, targ))\n            foreach2(argtps, bounds)((targ, bound) => explainTypes(targ, bound.hi))\n          }\n      }\n    private def isIrrefutable(pat: Tree, seltpe: Type): Boolean = pat match {\n      case Apply(_, args) =>\n        val clazz = pat.tpe.typeSymbol\n        clazz == seltpe.typeSymbol &&\n        clazz.isCaseClass &&\n        (args corresponds clazz.primaryConstructor.tpe.asSeenFrom(seltpe, clazz).paramTypes)(isIrrefutable)\n      case Typed(pat, tpt) =>\n        seltpe <:< tpt.tpe\n      case Ident(tpnme.WILDCARD) =>\n        true\n      case Bind(_, pat) =>\n        isIrrefutable(pat, seltpe)\n      case _ =>\n        false\n    }\n\n    // Note: if a symbol has both @deprecated and @migration annotations and both\n    // warnings are enabled, only the first one checked here will be emitted.\n    // I assume that's a consequence of some code trying to avoid noise by suppressing\n    // warnings after the first, but I think it'd be better if we didn't have to\n    // arbitrarily choose one as more important than the other.\n    private def checkUndesiredProperties(sym: Symbol, pos: Position): Unit = {\n      // Issue a warning if symbol is deprecated, unless the point of reference is enclosed by a deprecated member,\n      // or has a deprecated companion.\n      if (sym.isDeprecated &&\n          // synthetic calls to deprecated case class constructor\n          !(sym.isConstructor && sym.owner.isCaseClass && currentOwner.isSynthetic) &&\n          !currentOwner.ownersIterator.exists(_.isDeprecated))\n        runReporting.deprecationWarning(pos, sym, currentOwner)\n\n      // Similar to deprecation: check if the symbol is marked with @migration\n      // indicating it has changed semantics between versions.\n      if (sym.hasMigrationAnnotation && settings.Xmigration.value != NoScalaVersion) {\n        val changed = try\n          settings.Xmigration.value < ScalaVersion(sym.migrationVersion.get)\n        catch {\n          case e : NumberFormatException =>\n            refchecksWarning(pos, s\"${sym.fullLocationString} has an unparsable version number: ${e.getMessage()}\", WarningCategory.Other)\n            // if we can't parse the format on the migration annotation just conservatively assume it changed\n            true\n        }\n        if (changed)\n          refchecksWarning(pos, s\"${sym.fullLocationString} has changed semantics in version ${sym.migrationVersion.get}:\\n${sym.migrationMessage.get}\", WarningCategory.OtherMigration)\n      }\n      if (sym.isExperimental && !currentOwner.ownerChain.exists(x => x.isExperimental)) {\n        val msg =\n          s\"${sym.fullLocationString} is marked @experimental and therefore its enclosing scope must be experimental.\"\n        reporter.error(pos, msg)\n      }\n      // See an explanation of compileTimeOnly in its scaladoc at scala.annotation.compileTimeOnly.\n      // async/await is expanded after erasure\n      if (sym.isCompileTimeOnly && !inAnnotation && !currentOwner.ownerChain.exists(x => x.isCompileTimeOnly)) {\n        if (!async.deferCompileTimeOnlyError(sym)) {\n          def defaultMsg =\n            sm\"\"\"Reference to ${sym.fullLocationString} should not have survived past type checking,\n                |it should have been processed and eliminated during expansion of an enclosing macro.\"\"\"\n          // The getOrElse part should never happen, it's just here as a backstop.\n          val msg = sym.compileTimeOnlyMessage getOrElse defaultMsg\n          reporter.error(pos, msg)\n        }\n      }\n    }\n\n    private def checkDelayedInitSelect(qual: Tree, sym: Symbol, pos: Position) = {\n      def isLikelyUninitialized = (\n           (sym.owner isSubClass DelayedInitClass)\n        && !qual.tpe.isInstanceOf[ThisType]\n        && sym.accessedOrSelf.isVal\n      )\n      if (settings.warnDelayedInit && isLikelyUninitialized)\n        refchecksWarning(pos, s\"Selecting ${sym} from ${sym.owner}, which extends scala.DelayedInit, is likely to yield an uninitialized value\", WarningCategory.LintDelayedinitSelect)\n    }\n\n    private def lessAccessible(otherSym: Symbol, memberSym: Symbol): Boolean = (\n         (otherSym != NoSymbol)\n      && !otherSym.isProtected\n      && !otherSym.isTypeParameterOrSkolem\n      && !otherSym.isExistentiallyBound\n      && memberSym.ownersIterator.forall(otherSym.isLessAccessibleThan(_))\n    )\n    private def lessAccessibleSymsInType(other: Type, memberSym: Symbol): List[Symbol] = {\n      val extras = other match {\n        case TypeRef(pre, _, args) =>\n          // checking the prefix here gives us spurious errors on e.g. a private[process]\n          // object which contains a type alias, which normalizes to a visible type.\n          args.filterNot(_ eq NoPrefix).flatMap(lessAccessibleSymsInType(_, memberSym))\n        case _ =>\n          Nil\n      }\n      if (lessAccessible(other.typeSymbol, memberSym)) other.typeSymbol :: extras\n      else extras\n    }\n    private def warnLessAccessible(otherSym: Symbol, memberSym: Symbol): Unit = {\n      val comparison = accessFlagsToString(memberSym) match {\n        case \"\"   => \"\"\n        case acc  => \" is \" + acc + \" but\"\n      }\n      val cannot =\n        if (memberSym.isDeferred) \"may be unable to provide a concrete implementation of\"\n        else \"may be unable to override\"\n\n      refchecksWarning(memberSym.pos,\n        s\"\"\"|${memberSym.fullLocationString}${comparison} references ${accessFlagsToString(otherSym)} ${otherSym}.\n            |Classes which cannot access ${otherSym.decodedName} ${cannot} ${memberSym.decodedName}.\"\"\".stripMargin,\n        WarningCategory.LintInaccessible\n      )\n    }\n\n    /** Warn about situations where a method signature will include a type which\n     *  has more restrictive access than the method itself.\n     */\n    private def checkAccessibilityOfReferencedTypes(tree: Tree): Unit = {\n      val member = tree.symbol\n\n      def checkAccessibilityOfType(tpe: Type): Unit = {\n        val inaccessible = lessAccessibleSymsInType(tpe, member)\n        // if the unnormalized type is accessible, that's good enough\n        if (inaccessible.isEmpty) ()\n        // or if the normalized type is, that's good too\n        else if ((tpe ne tpe.normalize) && lessAccessibleSymsInType(tpe.dealiasWiden, member).isEmpty) ()\n        // otherwise warn about the inaccessible syms in the unnormalized type\n        else inaccessible.foreach(warnLessAccessible(_, member))\n      }\n\n      // types of the value parameters\n      foreachParamss(member)(p => checkAccessibilityOfType(p.tpe))\n      // upper bounds of type parameters\n      member.typeParams.foreach(tp => checkAccessibilityOfType(tp.info.upperBound.widen))\n    }\n\n    /** Check that a deprecated val or def does not override a\n      * concrete, non-deprecated method.  If it does, then\n      * deprecation is meaningless.\n      */\n    private def checkDeprecatedOvers(tree: Tree): Unit = {\n      val symbol = tree.symbol\n      if (symbol.isDeprecated) {\n        val concrOvers =\n          symbol.allOverriddenSymbols.filter(sym =>\n            !sym.isDeprecated && !sym.isDeferred && !sym.hasDeprecatedOverridingAnnotation && !sym.enclClass.hasDeprecatedInheritanceAnnotation)\n        if(!concrOvers.isEmpty)\n          runReporting.deprecationWarning(\n            tree.pos,\n            symbol,\n            currentOwner,\n            s\"${symbol.toString} overrides concrete, non-deprecated symbol(s):    ${concrOvers.map(_.name.decode).mkString(\", \")}\", \"\")\n      }\n    }\n    private def checkRepeatedParamArg(tree: Tree): Unit = {\n      val bailure = \"such annotations are only allowed in arguments to *-parameters\"\n      val err = currentApplication match {\n        case Apply(fn, args) =>\n          val ok = (    args.nonEmpty\n                    && (args.last eq tree)\n                    && (fn.tpe.params.length == args.length)\n                    &&  isRepeatedParamType(fn.tpe.params.last.tpe)\n                   )\n          if (ok) null\n          else if (!args.exists(tree.eq)) bailure\n          else {\n            val i = args.indexWhere(tree.eq)\n            val isLast = i == args.length - 1\n            val formal = if (i >= fn.tpe.params.length - 1) fn.tpe.params.last.tpe else fn.tpe.params(i).tpe\n            val isRepeated = isRepeatedParamType(formal)\n            val lastly = if (!isLast) \";\\nsequence argument must be the last argument\" else \"\"\n            val solely = if (fn.tpe.params.length == 1) \"single\" else \"corresponding\"\n            if (isRepeated)\n              s\"it is not the only argument to be passed to the $solely repeated parameter $formal$lastly\"\n            else\n              s\"the $solely parameter has type $formal which is not a repeated parameter type$lastly\"\n          }\n        case _ => bailure\n      }\n      if (err != null)\n        reporter.error(tree.pos, s\"Sequence argument type annotation `: _*` cannot be used here:\\n$err\")\n    }\n\n    private object RefCheckTypeMap extends TypeMap {\n      object UnboundExistential extends TypeMap {\n        private[this] val bound = mutable.Set.empty[Symbol]\n\n        def toWildcardIn(tpe: Type): Type =\n          try apply(tpe) finally bound.clear()\n\n        override def apply(tpe: Type): Type = tpe match {\n          case ExistentialType(quantified, _) =>\n            bound ++= quantified\n            tpe.mapOver(this)\n          case tpe =>\n            val sym = tpe.typeSymbol\n            if (sym.isExistential && !bound(sym)) WildcardType\n            else tpe.mapOver(this)\n        }\n      }\n\n      private[this] var inPattern = false\n      private[this] var skipBounds = false\n      private[this] var tree: Tree = EmptyTree\n\n      def check(tpe: Type, tree: Tree, inPattern: Boolean = false): Type = {\n        this.inPattern = inPattern\n        this.tree = tree\n        try apply(tpe) finally {\n          this.inPattern = false\n          this.skipBounds = false\n          this.tree = EmptyTree\n        }\n      }\n\n      // check all bounds, except those that are existential type parameters\n      // or those within typed annotated with @uncheckedBounds\n      override def apply(tpe: Type): Type = tpe match {\n        case tpe: AnnotatedType if tpe.hasAnnotation(UncheckedBoundsClass) =>\n          // scala/bug#7694 Allow code synthesizers to disable checking of bounds for TypeTrees based on inferred LUBs\n          // which might not conform to the constraints.\n          val savedSkipBounds = skipBounds\n          skipBounds = true\n          try tpe.mapOver(this).filterAnnotations(_.symbol != UncheckedBoundsClass)\n          finally skipBounds = savedSkipBounds\n        case tpe: TypeRef =>\n          if (!inPattern) checkTypeRef(UnboundExistential.toWildcardIn(tpe))\n          checkUndesired(tpe.sym)\n          tpe.mapOver(this)\n        case tpe =>\n          tpe.mapOver(this)\n      }\n\n      private def checkTypeRef(tpe: Type): Unit = tpe match {\n        case TypeRef(pre, sym, args) =>\n          if (sym.isJavaDefined)\n            sym.typeParams.foreach(_.cookJavaRawInfo())\n          if (!tpe.isHigherKinded && !skipBounds)\n            checkBounds(tree, pre, sym.owner, sym.typeParams, args)\n        case _ =>\n      }\n\n      private def checkUndesired(sym: Symbol): Unit = tree match {\n        // scala/bug#7783 don't warn about inferred types\n        // FIXME: reconcile this check with one in resetAttrs\n        case tree: TypeTree if tree.original == null =>\n        case tree => checkUndesiredProperties(sym, tree.pos)\n      }\n    }\n\n    private def applyRefchecksToAnnotations(tree: Tree): Unit = {\n      def checkVarArgs(tp: Type, tree: Tree): Unit = tp match {\n        case TypeRef(_, VarargsClass, _) =>\n          tree match {\n            case tt: TypeTree if tt.original == null => // same exception as in checkTypeRef\n            case _: DefDef =>\n            case _ => reporter.error(tree.pos, s\"Only methods can be marked @varargs\")\n          }\n        case _ =>\n      }\n      def applyChecks(annots: List[AnnotationInfo]): List[AnnotationInfo] = if (annots.isEmpty) Nil else {\n        annots.foreach { ann =>\n          checkVarArgs(ann.atp, tree)\n          RefCheckTypeMap.check(ann.atp, tree)\n          if (ann.original != null && ann.original.hasExistingSymbol)\n            checkUndesiredProperties(ann.original.symbol, tree.pos)\n        }\n        val annotsBySymbol = new mutable.LinkedHashMap[Symbol, ListBuffer[AnnotationInfo]]()\n        val transformedAnnots = {\n          val saved = inAnnotation\n          inAnnotation = true\n          try annots.map(_.transformArgs(transformTrees)) finally inAnnotation = saved\n        }\n        for (transformedAnnot <- transformedAnnots) {\n          val buffer = annotsBySymbol.getOrElseUpdate(transformedAnnot.symbol, new ListBuffer)\n          buffer += transformedAnnot\n        }\n        annotsBySymbol.iterator.flatMap(x => groupRepeatableAnnotations(x._1, x._2.toList)).toList\n      }\n\n      // assumes non-empty `anns`\n      def groupRepeatableAnnotations(sym: Symbol, anns: List[AnnotationInfo]): List[AnnotationInfo] =\n        if (!sym.isJavaDefined) anns\n        else anns match {\n          case single :: Nil => anns\n          case multiple      =>\n            sym.getAnnotation(AnnotationRepeatableAttr) match {\n              case Some(repeatable) =>\n                repeatable.assocs.collectFirst {\n                  case (nme.value, LiteralAnnotArg(Constant(c: Type))) => c\n                } match {\n                  case Some(container) =>\n                    val assocs = List(\n                      nme.value -> ArrayAnnotArg(multiple.map(NestedAnnotArg(_)).toArray)\n                    )\n                    AnnotationInfo(container, args = Nil, assocs = assocs) :: Nil\n                  case None =>\n                    devWarning(s\"@Repeatable $sym had no containing class\")\n                    multiple\n                }\n              case None =>\n                reporter.error(tree.pos, s\"$sym may not appear multiple times on ${tree.symbol}\")\n                multiple\n            }\n        }\n\n      def checkIsElidable(sym: Symbol): Unit = if (sym ne null) sym.elisionLevel.foreach { level =>\n        if (!sym.isMethod || sym.isAccessor || sym.isLazy || sym.isDeferred) {\n          val rest = if (sym.isDeferred) \" The annotation affects only the annotated method, not overriding methods in subclasses.\" else \"\"\n          reporter.error(sym.pos, s\"${sym.name}: Only concrete methods can be marked @elidable.$rest\")\n        }\n      }\n      checkIsElidable(tree.symbol)\n\n      def checkMember(sym: Symbol): Unit = {\n        sym.setAnnotations(applyChecks(sym.annotations))\n\n        // validate implicitNotFoundMessage and implicitAmbiguousMessage\n        if (settings.lintImplicitNotFound) {\n          def messageWarning(name: String)(warn: String) =\n            refchecksWarning(tree.pos, s\"Invalid $name message for ${sym}${sym.locationString}:\\n$warn\", WarningCategory.LintImplicitNotFound)\n          analyzer.ImplicitNotFoundMsg.check(sym) foreach messageWarning(\"implicitNotFound\")\n          analyzer.ImplicitAmbiguousMsg.check(sym) foreach messageWarning(\"implicitAmbiguous\")\n        }\n\n        if (settings.warnSerialization && sym.isClass && sym.hasAnnotation(SerialVersionUIDAttr)) {\n          def warn(what: String) =\n            refchecksWarning(tree.pos, s\"@SerialVersionUID has no effect on $what\", WarningCategory.LintSerial)\n\n          if (sym.isTrait) warn(\"traits\")\n          else if (!sym.isSerializable) warn(\"non-serializable classes\")\n        }\n        if (!sym.isMethod && !sym.isConstructor)\n          checkNoThrows(sym.annotations)\n      }\n      def checkNoThrows(anns: List[AnnotationInfo]): Unit =\n        if (anns.exists(_.symbol == ThrowsClass))\n          reporter.error(tree.pos, s\"`@throws` only allowed for methods and constructors\")\n\n      tree match {\n        case m: MemberDef =>\n          checkMember(m.symbol)\n        case tpt@TypeTree() =>\n          if (tpt.original != null)\n            tpt.original.foreach {\n              case dc: TypeTreeWithDeferredRefCheck =>\n                applyRefchecksToAnnotations(dc.check()) // #2416\n              case _ =>\n            }\n          if (!inPattern)\n            tree.setType(tree.tpe.map {\n              case AnnotatedType(anns, ul) =>\n                checkNoThrows(anns)\n                AnnotatedType(applyChecks(anns), ul)\n              case tp => tp\n            })\n        case _ =>\n      }\n    }\n\n    private def isSimpleCaseApply(tree: Tree): Boolean = {\n      val sym = tree.symbol\n      def isClassTypeAccessible(tree: Tree): Boolean = tree match {\n        case TypeApply(fun, targs) =>\n          isClassTypeAccessible(fun)\n        case Select(module, apply) =>\n          // scala/bug#4859 `CaseClass1().InnerCaseClass2()` must not be rewritten to `new InnerCaseClass2()`;\n          //          {expr; Outer}.Inner() must not be rewritten to `new Outer.Inner()`.\n          treeInfo.isQualifierSafeToElide(module) &&\n          // scala/bug#5626 Classes in refinement types cannot be constructed with `new`.\n          !module.exists { case t @ Select(_, _) => t.symbol != null && t.symbol.isStructuralRefinementMember case _ => false }\n        case x => throw new MatchError(x)\n      }\n      sym.name == nme.apply &&\n        !sym.hasStableFlag && // ???\n        sym.isCase &&\n        isClassTypeAccessible(tree) &&\n        !tree.tpe.finalResultType.typeSymbol.primaryConstructor.isLessAccessibleThan(tree.symbol)\n    }\n\n    private def transformCaseApply(tree: Tree) = {\n      def loop(t: Tree): Unit = t match {\n        case Ident(_) =>\n          checkUndesiredProperties(t.symbol, t.pos)\n        case Select(qual, _) =>\n          checkUndesiredProperties(t.symbol, t.pos)\n          loop(qual)\n        case _ =>\n      }\n\n      tree foreach {\n        case i@Ident(_) =>\n          enterReference(i.pos, i.symbol) // scala/bug#5390 need to `enterReference` for `a` in `a.B()`\n        case _ =>\n      }\n      loop(tree)\n      toConstructor(tree.pos, tree.tpe)\n    }\n\n    private def transformApply(tree: Apply): Tree = tree match {\n      case Apply(\n        Select(qual, nme.withFilter),\n        List(Function(\n          List(ValDef(_, pname, tpt, _)),\n          Match(_, CaseDef(pat1, _, _) :: _))))\n        if ((pname startsWith nme.CHECK_IF_REFUTABLE_STRING) &&\n            isIrrefutable(pat1, tpt.tpe) && (qual.tpe <:< tree.tpe)) =>\n\n          transform(qual)\n      case Apply(fn, args) =>\n        // sensicality should be subsumed by the unreachability/exhaustivity/irrefutability\n        // analyses in the pattern matcher\n        if (!inPattern) {\n          checkImplicitViewOptionApply(tree.pos, fn, args)\n          checkSensible(tree.pos, fn, args) // TODO: this should move to preEraseApply, as reasoning about runtime semantics makes more sense in the JVM type system\n          checkNamedBooleanArgs(fn, args)\n        }\n        currentApplication = tree\n        tree\n    }\n\n    /** Check that boolean literals are passed as named args.\n     *  The rule is enforced when the type of the parameter is `Boolean`.\n     *  The rule is relaxed when the method has exactly one boolean parameter\n     *  and it is the first parameter, such as `assert(false, msg)`.\n     */\n    private def checkNamedBooleanArgs(fn: Tree, args: List[Tree]): Unit = {\n      val sym = fn.symbol\n      def applyDepth: Int = {\n        def loop(t: Tree, d: Int): Int =\n          t match {\n            case Apply(f, _) => loop(f, d+1)\n            case _ => d\n          }\n        loop(fn, 0)\n      }\n      def isAssertParadigm(params: List[Symbol]): Boolean = !sym.isConstructor && !sym.isCaseApplyOrUnapply && {\n        params match {\n          case h :: t => h.tpe == BooleanTpe && !t.exists(_.tpe == BooleanTpe)\n          case _ => false\n        }\n      }\n      if (settings.lintNamedBooleans && !sym.isJavaDefined && !args.isEmpty) {\n        val params = sym.paramLists(applyDepth)\n        if (!isAssertParadigm(params))\n          foreach2(args, params)((arg, param) => arg match {\n            case Literal(Constant(_: Boolean))\n            if arg.hasAttachment[UnnamedArg.type] && param.tpe.typeSymbol == BooleanClass && !param.deprecatedParamName.contains(nme.NO_NAME) =>\n              runReporting.warning(arg.pos, s\"Boolean literals should be passed using named argument syntax for parameter ${param.name}.\", WarningCategory.LintNamedBooleans, sym)\n            case _ =>\n          })\n      }\n    }\n\n    private def transformSelect(tree: Select): Tree = {\n      val Select(qual, name) = tree\n      val sym = tree.symbol\n\n      checkUndesiredProperties(sym, tree.pos)\n      checkDelayedInitSelect(qual, sym, tree.pos)\n\n      if (!sym.exists)\n        devWarning(\"Select node has NoSymbol! \" + tree + \" / \" + tree.tpe)\n\n      if (name == nme.synchronized_ && isBoxedValueClass(qual.tpe.typeSymbol))\n        refchecksWarning(tree.pos, s\"Suspicious `synchronized` call involving boxed primitive `${qual.tpe.typeSymbol.name}`\", WarningCategory.LintUniversalMethods)\n\n      def checkSuper(mix: Name) =\n        // term should have been eliminated by super accessors\n        assert(!(qual.symbol.isTrait && sym.isTerm && mix == tpnme.EMPTY), (qual.symbol, sym, mix))\n\n      // Rewrite eligible calls to monomorphic case companion apply methods to the equivalent constructor call.\n      //\n      // Note: for generic case classes the rewrite needs to be handled at the enclosing `TypeApply` to transform\n      // `TypeApply(Select(C, apply), targs)` to `Select(New(C[targs]), <init>)`. In case such a `TypeApply`\n      // was deemed ineligible for transformation (e.g. the case constructor was private), the refchecks transform\n      // will recurse to this point with `Select(C, apply)`, which will have a type `[T](...)C[T]`.\n      //\n      // We don't need to perform the check on the Select node, and `!isHigherKinded will guard against this\n      // redundant (and previously buggy, scala/bug#9546) consideration.\n      if (!tree.tpe.isHigherKinded && isSimpleCaseApply(tree)) {\n        transformCaseApply(tree)\n      } else {\n        qual match {\n          case Super(_, mix)  => checkSuper(mix)\n          case _              =>\n        }\n        tree\n      }\n    }\n    private def transformIf(tree: If): Tree = {\n      val If(cond, thenpart, elsepart) = tree\n      def unitIfEmpty(t: Tree): Tree =\n        if (t == EmptyTree) Literal(Constant(())).setPos(tree.pos).setType(UnitTpe) else t\n\n      cond.tpe match {\n        case FoldableConstantType(value) =>\n          val res = if (value.booleanValue) thenpart else elsepart\n          unitIfEmpty(res)\n        case _ => tree\n      }\n    }\n\n    // Warning about nullary methods returning Unit.\n    private def checkNullaryMethodReturnType(sym: Symbol) = sym.tpe match {\n      case NullaryMethodType(restpe) if restpe.typeSymbol == UnitClass =>\n        // this may be the implementation of e.g. a generic method being parameterized\n        // on Unit, in which case we had better let it slide.\n        val isOk = (\n             sym.isGetter\n          || sym.isDefaultGetter\n          || sym.allOverriddenSymbols.exists(over => !(over.tpe.resultType =:= sym.tpe.resultType))\n          || sym.isArtifact\n        )\n        if (!isOk) {\n          val msg = s\"side-effecting nullary methods are discouraged: suggest defining as `def ${sym.name.decode}()` instead\"\n          val namePos = sym.pos.focus.withEnd(sym.pos.point + sym.decodedName.length)\n          val action =\n            if (namePos.source.sourceAt(namePos) == sym.decodedName)\n              runReporting.codeAction(\"add empty parameter list\", namePos.focusEnd, \"()\", msg)\n            else Nil\n          refchecksWarning(sym.pos, msg, WarningCategory.LintNullaryUnit, action)\n        }\n      case _ => ()\n    }\n\n    // Verify classes extending AnyVal meet the requirements\n    private def checkAnyValSubclass(clazz: Symbol) =\n      if (clazz.isDerivedValueClass) {\n        if (clazz.isTrait)\n          reporter.error(clazz.pos, \"Only classes (not traits) are allowed to extend AnyVal\")\n        else if (clazz.hasAbstractFlag)\n          reporter.error(clazz.pos, \"`abstract` modifier cannot be used with value classes\")\n      }\n\n    private def checkUnexpandedMacro(t: Tree) =\n      if (!t.isDef && t.hasSymbolField && t.symbol.isTermMacro)\n        reporter.error(t.pos, \"macro has not been expanded\")\n\n    // if expression in statement position (of template or block)\n    // looks like a useful value that should not be ignored, warn and return true\n    // User specifies that an expression is boring by ascribing `e: Unit`.\n    // The subtree `e` will bear an attachment, but may be wrapped in adaptations.\n    private def checkInterestingResultInStatement(t: Tree): Boolean = {\n      def isUninterestingSymbol(sym: Symbol): Boolean =\n        sym != null && (\n          sym.isConstructor ||\n          sym.hasPackageFlag ||\n          sym.isPackageObjectOrClass ||\n          sym == BoxedUnitClass ||\n          sym == AnyClass ||\n          sym == AnyRefClass ||\n          sym == AnyValClass\n        )\n      def isUninterestingType(tpe: Type): Boolean =\n        tpe != null && (\n          isUnitType(tpe) ||\n          tpe.typeSymbol.isBottomClass ||\n          tpe =:= UnitTpe ||\n          tpe =:= BoxedUnitTpe ||\n          isTrivialTopType(tpe)\n        )\n      // java lacks this.type idiom to distinguish side-effecting method, so ignore result of invoking java method.\n      def isJavaApplication(t: Tree): Boolean = t match {\n        case Apply(f, _) => f.symbol.isJavaDefined && !isUniversalMember(f.symbol)\n        case _ => false\n      }\n      // The quirk of typechecking if is that the LUB often results in boring types.\n      // Parser adds suppressing attachment on `if (b) expr` when user has `-Wnonunit-if:false`.\n      def checkInterestingShapes(t: Tree): Boolean =\n        t match {\n          case If(_, thenpart, elsepart) => checkInterestingShapes(thenpart) || checkInterestingShapes(elsepart) // either or\n          //case Block(_, Apply(label, Nil)) if label.symbol != null && nme.isLoopHeaderLabel(label.symbol.name) => false\n          case Block(_, res) => checkInterestingShapes(res)\n          case Match(_, cases) => cases.exists(k => checkInterestingShapes(k.body))\n          case _ => checksForInterestingResult(t)\n        }\n      // tests for various flavors of blandness in expressions.\n      def checksForInterestingResult(t: Tree): Boolean = (\n           !t.isDef && !treeInfo.isPureDef(t)     // ignore defs\n        && !isUninterestingSymbol(t.symbol)       // ctors, package, Unit, Any\n        && !isUninterestingType(t.tpe)            // bottom types, Unit, Any\n        && !treeInfo.isThisTypeResult(t)          // buf += x\n        && !treeInfo.isSuperConstrCall(t)         // just a thing\n        && !treeInfo.hasExplicitUnit(t)           // suppressed by explicit expr: Unit\n        && !isJavaApplication(t)                  // Java methods are inherently side-effecting\n      )\n      // begin checkInterestingResultInStatement\n      settings.warnNonUnitStatement.value && checkInterestingShapes(t) && {\n        val where = t match {\n          case Block(_, res) => res\n          case If(_, thenpart, Literal(Constant(()))) =>\n            thenpart match {\n              case Block(_, res) => res\n              case _ => thenpart\n            }\n          case _ => t\n        }\n        def msg = s\"unused value of type ${where.tpe} (add `: Unit` to discard silently)\"\n        refchecksWarning(where.pos, msg, WarningCategory.OtherPureStatement)\n        true\n      }\n    } // end checkInterestingResultInStatement\n\n    override def transform(tree: Tree): Tree = {\n      val savedLocalTyper = localTyper\n      val savedCurrentApplication = currentApplication\n      try {\n        val sym = tree.symbol\n\n        // Apply RefChecks to annotations. Makes sure the annotations conform to\n        // type bounds (bug #935), issues deprecation warnings for symbols used\n        // inside annotations.\n        applyRefchecksToAnnotations(tree)\n        val result: Tree = tree match {\n          // NOTE: a val in a trait is now a DefDef, with the RHS being moved to an Assign in Constructors\n          case tree: ValOrDefDef =>\n            checkDeprecatedOvers(tree)\n            if (!tree.isErroneous)\n              checkInfiniteLoop(tree.symbol, tree.rhs)\n\n            if (settings.warnNullaryUnit)\n              checkNullaryMethodReturnType(sym)\n            if (settings.warnInaccessible) {\n              if (!sym.isConstructor && !sym.isEffectivelyFinalOrNotOverridden && !sym.owner.isSealed && !sym.isSynthetic)\n                checkAccessibilityOfReferencedTypes(tree)\n            }\n            tree match {\n              case dd: DefDef if sym.hasAnnotation(NativeAttr) =>\n                if (sym.owner.isTrait) {\n                  reporter.error(tree.pos, \"A trait cannot define a native method.\")\n                  tree\n                } else if (dd.rhs == EmptyTree) {\n                  // pretend it had a stub implementation\n                  sym resetFlag DEFERRED\n                  deriveDefDef(dd)(_ => typed(gen.mkThrowNewRuntimeException(\"native method stub\")))\n                } else\n                  tree\n              case _ => tree\n            }\n\n          case Template(parents, self, body) =>\n            localTyper = localTyper.atOwner(tree, currentOwner)\n            for (stat <- body)\n              if (!checkInterestingResultInStatement(stat) && treeInfo.isPureExprForWarningPurposes(stat)) {\n                val msg = \"a pure expression does nothing in statement position\"\n                val clause = if (body.lengthCompare(1) > 0) \"; multiline expressions may require enclosing parentheses\" else \"\"\n                refchecksWarning(stat.pos, s\"$msg$clause\", WarningCategory.OtherPureStatement)\n              }\n            validateBaseTypes(currentOwner)\n            checkOverloadedRestrictions(currentOwner, currentOwner)\n            // scala/bug#7870 default getters for constructors live in the companion module\n            checkOverloadedRestrictions(currentOwner, currentOwner.companionModule)\n            val bridges = addVarargBridges(currentOwner) // TODO: do this during uncurry?\n            checkAllOverrides(currentOwner)\n            checkAnyValSubclass(currentOwner)\n            if (currentOwner.isDerivedValueClass)\n              currentOwner.primaryConstructor makeNotPrivate NoSymbol // scala/bug#6601, must be done *after* pickler!\n            if (bridges.nonEmpty) deriveTemplate(tree)(_ ::: bridges) else tree\n\n          case _: TypeTreeWithDeferredRefCheck => abort(\"adapt should have turned dc: TypeTreeWithDeferredRefCheck into tpt: TypeTree, with tpt.original == dc\")\n          case tpt@TypeTree() =>\n            if(tpt.original != null) {\n              tpt.original foreach {\n                case dc: TypeTreeWithDeferredRefCheck =>\n                  transform(dc.check()) // #2416 -- only call transform to do refchecks, but discard results\n                  // tpt has the right type if the deferred checks are ok\n                case _ =>\n              }\n            }\n\n            tree.setType(RefCheckTypeMap.check(tree.tpe, tree, inPattern))\n\n          case TypeApply(fn, args) =>\n            checkBounds(tree, NoPrefix, NoSymbol, fn.tpe.typeParams, args map (_.tpe))\n            if (isSimpleCaseApply(tree))\n              transformCaseApply(tree)\n            else\n              tree\n\n          case x @ Apply(_, _)  =>\n            transformApply(x)\n\n          case x @ If(_, _, _)  =>\n            transformIf(x)\n\n          case New(tpt) =>\n            enterReference(tree.pos, tpt.tpe.typeSymbol)\n            tree\n\n          case treeInfo.WildcardStarArg(_) =>\n            checkRepeatedParamArg(tree)\n            tree\n\n          case Ident(name) =>\n            checkUndesiredProperties(sym, tree.pos)\n            if (name != nme.WILDCARD && name != tpnme.WILDCARD_STAR) {\n              assert(sym != NoSymbol, \"transformCaseApply: name = \" + name.debugString + \" tree = \" + tree + \" / \" + tree.getClass) //debug\n              enterReference(tree.pos, sym)\n            }\n            tree\n\n          case x @ Select(_, _) =>\n            transformSelect(x)\n\n          case Literal(Constant(tpe: Type)) =>\n            RefCheckTypeMap.check(tpe, tree)\n            tree\n\n          case UnApply(fun, args) =>\n            transform(fun) // just make sure we enterReference for unapply symbols, note that super.transform(tree) would not transform(fun)\n                           // transformTrees(args) // TODO: is this necessary? could there be forward references in the args??\n                           // probably not, until we allow parameterised extractors\n            tree\n\n          case blk @ Block(stats, expr) =>\n            // diagnostic info\n            val (count, result0, adapted) =\n              expr match {\n                case Block(expr :: Nil, Literal(Constant(()))) => (1, expr, true)\n                case Literal(Constant(()))                     => (0, EmptyTree, false)\n                case _                                         => (1, EmptyTree, false)\n              }\n            val isMultiline = stats.lengthCompare(1 - count) > 0\n\n            def checkPure(t: Tree, supple: Boolean): Unit =\n              if (!treeInfo.hasExplicitUnit(t) && treeInfo.isPureExprForWarningPurposes(t)) {\n                val msg = \"a pure expression does nothing in statement position\"\n                val parens = if (isMultiline) \"multiline expressions might require enclosing parentheses\" else \"\"\n                val discard = if (adapted) \"; a value can be silently discarded when Unit is expected\" else \"\"\n                val text =\n                  if (supple) s\"$parens$discard\"\n                  else if (!parens.isEmpty) s\"$msg; $parens\" else msg\n                refchecksWarning(t.pos, text, WarningCategory.OtherPureStatement)\n              }\n            // check block for unintended \"expression in statement position\"\n            stats.foreach { t => if (!checkInterestingResultInStatement(t)) checkPure(t, supple = false) }\n            if (result0.nonEmpty) checkPure(result0, supple = true)\n\n            def checkImplicitlyAdaptedBlockResult(t: Tree): Unit =\n              expr match {\n                case treeInfo.Applied(f, _, _) if f.symbol != null && f.symbol.isImplicit =>\n                  f.symbol.paramLists match {\n                    case (p :: Nil) :: _ if p.isByNameParam => refchecksWarning(t.pos, s\"Block result was adapted via implicit conversion (${f.symbol}) taking a by-name parameter\", WarningCategory.LintBynameImplicit)\n                    case _ =>\n                  }\n                case _ =>\n              }\n            if (isMultiline && settings.warnByNameImplicit) checkImplicitlyAdaptedBlockResult(expr)\n\n            tree\n          case Match(selector, cases) =>\n            // only warn if it could be put in backticks in a pattern\n            def isWarnable(sym: Symbol): Boolean =\n              sym != null && sym.exists &&\n              !sym.hasPackageFlag && sym.isStable && !isByName(sym) &&\n              !sym.hasAttachment[PatVarDefAttachment.type] // val (_, v) = with one var is shadowed in desugaring\n              //!toCheck.isSynthetic // self-type symbols are synthetic: value self (<synthetic>), do warn\n\n            class CheckSelector extends InternalTraverser {\n              var selectorSymbols: List[Symbol] = null\n              override def traverse(t: Tree): Unit = {\n                val include = t match {\n                  case _: This    => true // !t.symbol.isStable\n                  case _: SymTree => isWarnable(t.symbol)\n                  case _          => false\n                }\n                if (include) selectorSymbols ::= t.symbol\n                t.traverse(this)\n              }\n              // true if the shadowed toCheck appears in the selector expression\n              def implicatesSelector(toCheck: Symbol): Boolean = {\n                if (selectorSymbols == null) {\n                  selectorSymbols = Nil\n                  apply(selector)\n                }\n                selectorSymbols.exists(sym => sym.eq(toCheck) || sym.accessedOrSelf.eq(toCheck.accessedOrSelf) ||\n                  toCheck.isThisSym && toCheck.owner == sym) // self match { case self: S => }, selector C.this is class symbol\n              }\n            }\n            val checkSelector = new CheckSelector\n            // true to warn about shadowed when selSym is the scrutinee\n            def checkShadowed(shadowed: Symbol): Boolean = {\n              def checkShadowedSymbol(toCheck: Symbol): Boolean =\n                isWarnable(toCheck) && !checkSelector.implicatesSelector(toCheck)\n\n              if (shadowed.isOverloaded) shadowed.alternatives.exists(checkShadowedSymbol)\n              else checkShadowedSymbol(shadowed)\n            }\n            // warn if any checkable pattern var shadows, in the context of the selector,\n            // or for `tree match case Apply(fun, args) =>` check whether names in args equal names of fun.params\n            def checkPattern(p: Tree): Unit = {\n              val traverser = new InternalTraverser {\n                // names absolved of shadowing because it is a \"current\" parameter (of a case class, etc)\n                var absolved: List[Name] = Nil\n                override def traverse(t: Tree): Unit = t match {\n                  case Apply(_, args) =>\n                    treeInfo.dissectApplied(t).core.tpe match {\n                      case MethodType(ps, _) =>\n                        foreach2(ps, args) { (p, arg) =>\n                          absolved ::= p.name\n                          try traverse(arg)\n                          finally absolved = absolved.tail\n                        }\n                      case _ => t.traverse(this)\n                    }\n                  case bind @ Bind(name, _) =>\n                    def richLocation(sym: Symbol): String = sym.ownsString match {\n                      case \"\"   => val n = sym.pos.line; if (n > 0) s\"$sym at line $n\" else sym.fullLocationString\n                      case owns => s\"$sym in $owns\"\n                    }\n                    for (shade <- bind.getAndRemoveAttachment[PatShadowAttachment]) {\n                      val shadowed = shade.shadowed\n                      if (!absolved.contains(name) && !bind.symbol.hasTransOwner(shadowed.accessedOrSelf) && checkShadowed(shadowed))\n                        refchecksWarning(bind.pos, s\"Name $name is already introduced in an enclosing scope as ${richLocation(shadowed)}. Did you intend to match it using backquoted `$name`?\", WarningCategory.OtherShadowing)\n\n                    }\n                  case _ => t.traverse(this)\n                }\n              }\n              traverser(p)\n            }\n            // check the patterns for unfriendly shadowing, patvars bearing PatShadowAttachment\n            if (settings.warnPatternShadow) for (cdef <- cases) checkPattern(cdef.pat)\n            tree\n          case _ => tree\n        }\n\n        // skip refchecks in patterns....\n        val result1 = result match {\n          case CaseDef(pat, guard, body) =>\n            val pat1 = savingInPattern {\n              inPattern = true\n              transform(pat)\n            }\n            treeCopy.CaseDef(tree, pat1, transform(guard), transform(body))\n          case _ =>\n            result.transform(this)\n        }\n        result1 match {\n          case ClassDef(_, _, _, _) | TypeDef(_, _, _, _) | ModuleDef(_, _, _) =>\n            if (result1.symbol.isLocalToBlock || result1.symbol.isTopLevel)\n              varianceValidator.traverse(result1)\n          case tt @ TypeTree() if tt.original != null =>\n            varianceValidator.validateVarianceOfPolyTypesIn(tt.tpe)\n          case _ =>\n        }\n\n        checkUnexpandedMacro(result1)\n\n        result1\n      } catch {\n        case ex: TypeError =>\n          if (settings.isDebug) ex.printStackTrace()\n          reporter.error(tree.pos, ex.getMessage())\n          tree\n      } finally {\n        localTyper = savedLocalTyper\n        currentApplication = savedCurrentApplication\n      }\n    }\n  }\n}\n"
  },
  {
    "path": "examples/SyntaxAnalyzer.scala",
    "content": "/* NSC -- new Scala compiler\n * Copyright 2005-2013 LAMP/EPFL\n * @author Martin Odersky\n */\n\npackage scala.tools.nsc\npackage ast.parser\n\nimport javac._\n\n/** An nsc sub-component.\n */\nabstract class SyntaxAnalyzer extends SubComponent with Parsers with MarkupParsers with Scanners with JavaParsers with JavaScanners {\n  import global._\n\n  val phaseName = \"parser\"\n  def newPhase(prev: Phase): StdPhase = new ParserPhase(prev)\n\n  abstract class MemberDefTraverser extends Traverser {\n    def onMember(defn: MemberDef): Unit\n\n    private var depth: Int = 0\n    private def lower[T](body: => T): T = {\n      depth += 1\n      try body finally depth -= 1\n    }\n    def currentDepth = depth\n\n    /** Prune this tree and all trees beneath it. Can be overridden. */\n    def prune(md: MemberDef): Boolean = (\n         md.mods.isSynthetic\n      || md.mods.isParamAccessor\n      || nme.isConstructorName(md.name)\n      || (md.name containsName nme.ANON_CLASS_NAME)\n    )\n\n    override def traverse(t: Tree): Unit = t match {\n      case md: MemberDef if prune(md) =>\n      case md @ PackageDef(_, stats)  => traverseTrees(stats)\n      case md: ImplDef                => onMember(md) ; lower(traverseTrees(md.impl.body))\n      case md: ValOrDefDef            => onMember(md) ; lower(traverse(md.rhs))\n      case _                          => super.traverse(t)\n    }\n  }\n\n  class MemberPosReporter(unit: CompilationUnit) extends MemberDefTraverser {\n    private var outputFn: MemberDef => String = outputForScreen\n    val path = unit.source.file.path\n\n    // If a single line, outputs the line; if it spans multiple lines\n    // outputs NN,NN with start and end lines, e.g. 15,25.\n    def outputPos(md: MemberDef): String = {\n      val pos   = md.pos\n      val start = pos.focusStart.line\n      val end   = pos.focusEnd.line\n\n      if (start == end) \"\" + start else s\"$start,$end\"\n    }\n    def outputForSed(md: MemberDef): String = {\n      val pos_s = \"%-12s\" format outputPos(md) + \"p\"\n      s\"$pos_s $path    # ${md.keyword} ${md.name}\"\n    }\n    def outputForScreen(md: MemberDef): String = {\n      val pos_s = \"%-20s\" format \" \" * currentDepth + outputPos(md)\n      s\"$pos_s ${md.keyword} ${md.name}\"\n    }\n\n    def onMember(md: MemberDef) = println(outputFn(md))\n    // It recognizes \"sed\" and \"anything else\".\n    def show(style: String) {\n      if (style == \"sed\") {\n        outputFn = outputForSed\n        traverse(unit.body)\n      }\n      else {\n        outputFn = outputForScreen\n        println(path)\n        traverse(unit.body)\n      }\n      println(\"\")\n    }\n  }\n\n  private def initialUnitBody(unit: CompilationUnit): Tree = {\n    if (unit.isJava) newJavaUnitParser(unit).parse()\n    else if (currentRun.parsing.incompleteHandled) newUnitParser(unit).parse()\n    else newUnitParser(unit).smartParse()\n  }\n\n  class ParserPhase(prev: Phase) extends StdPhase(prev) {\n    override val checkable = false\n    override val keepsTypeParams = false\n\n    def apply(unit: CompilationUnit) {\n      informProgress(\"parsing \" + unit)\n      // if the body is already filled in, don't overwrite it\n      // otherwise compileLate is going to overwrite bodies of synthetic source files\n      if (unit.body == EmptyTree)\n        unit.body = initialUnitBody(unit)\n\n      if (settings.Yrangepos && !reporter.hasErrors)\n        validatePositions(unit.body)\n\n      if (settings.Ymemberpos.isSetByUser)\n        new MemberPosReporter(unit) show (style = settings.Ymemberpos.value)\n    }\n  }\n}"
  },
  {
    "path": "examples/Variance.scala",
    "content": "class Function1[-T1, +R]\n"
  },
  {
    "path": "go.mod",
    "content": "module github.com/tree-sitter/tree-sitter-scala\n\ngo 1.22\n\nrequire github.com/tree-sitter/go-tree-sitter v0.24.0\n\nrequire github.com/mattn/go-pointer v0.0.1 // indirect\n"
  },
  {
    "path": "go.sum",
    "content": "github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=\ngithub.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=\ngithub.com/mattn/go-pointer v0.0.1 h1:n+XhsuGeVO6MEAp7xyEukFINEa+Quek5psIR/ylA6o0=\ngithub.com/mattn/go-pointer v0.0.1/go.mod h1:2zXcozF6qYGgmsG+SeTZz3oAbFLdD3OWqnUbNvJZAlc=\ngithub.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=\ngithub.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=\ngithub.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=\ngithub.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=\ngithub.com/tree-sitter/go-tree-sitter v0.24.0 h1:kRZb6aBNfcI/u0Qh8XEt3zjNVnmxTisDBN+kXK0xRYQ=\ngithub.com/tree-sitter/go-tree-sitter v0.24.0/go.mod h1:x681iFVoLMEwOSIHA1chaLkXlroXEN7WY+VHGFaoDbk=\ngithub.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb h1:A8425heRM8mylnv4H58FPUiH+aYivyitre0PzxrfmWs=\ngithub.com/tree-sitter/tree-sitter-c v0.21.5-0.20240818205408-927da1f210eb/go.mod h1:dOF6gtQiF9UwNh995T5OphYmtIypkjsp3ap7r9AN/iA=\ngithub.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148 h1:AfFPZwtwGN01BW1jDdqBVqscTwetvMpydqYZz57RSlc=\ngithub.com/tree-sitter/tree-sitter-cpp v0.22.4-0.20240818224355-b1a4e2b25148/go.mod h1:Bh6U3viD57rFXRYIQ+kmiYtr+1Bx0AceypDLJJSyi9s=\ngithub.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33 h1:TwqSV3qLp3tKSqirGLRHnjFk9Tc2oy57LIl+FQ4GjI4=\ngithub.com/tree-sitter/tree-sitter-embedded-template v0.21.1-0.20240819044651-ffbf64942c33/go.mod h1:CvCKCt3v04Ufos1zZnNCelBDeCGRpPucaN8QczoUsN4=\ngithub.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012 h1:Xvxck3tE5FW7F7bTS97iNM2ADMyCMJztVqn5HYKdJGo=\ngithub.com/tree-sitter/tree-sitter-go v0.21.3-0.20240818010209-8c0f0e7a6012/go.mod h1:T40D0O1cPvUU/+AmiXVXy1cncYQT6wem4Z0g4SfAYvY=\ngithub.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0 h1:c46K6uh5Dz00zJeU9BfjXdb8I+E4RkUdfnWJpQADXFo=\ngithub.com/tree-sitter/tree-sitter-html v0.20.5-0.20240818004741-d11201a263d0/go.mod h1:hcNt/kOJHcIcuMvouE7LJcYdeFUFbVpBJ6d4wmOA+tU=\ngithub.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495 h1:jrt4qbJVEFs4H93/ITxygHc6u0TGqAkkate7TQ4wFSA=\ngithub.com/tree-sitter/tree-sitter-java v0.21.1-0.20240824015150-576d8097e495/go.mod h1:oyaR7fLnRV0hT9z6qwE9GkaeTom/hTDwK3H2idcOJFc=\ngithub.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5 h1:om4X9AVg3asL8gxNJDcz4e/Wp+VpQj1PY3uJXKr6EOg=\ngithub.com/tree-sitter/tree-sitter-javascript v0.21.5-0.20240818005344-15887341e5b5/go.mod h1:nNqgPoV/h9uYWk6kYEFdEAhNVOacpfpRW5SFmdaP4tU=\ngithub.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5 h1:pfV3G3k7NCKqKk8THBmyuh2zA33lgYHS3GVrzRR8ry4=\ngithub.com/tree-sitter/tree-sitter-json v0.21.1-0.20240818005659-bdd69eb8c8a5/go.mod h1:GbMKRjLfk0H+PI7nLi1Sx5lHf5wCpLz9al8tQYSxpEk=\ngithub.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1 h1:ZXZMDwE+IhUtGug4Brv6NjJWUU3rfkZBKpemf6RY8/g=\ngithub.com/tree-sitter/tree-sitter-php v0.22.9-0.20240819002312-a552625b56c1/go.mod h1:UKCLuYnJ312Mei+3cyTmGOHzn0YAnaPRECgJmHtzrqs=\ngithub.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb h1:EXEM82lFM7JjJb6qiKZXkpIDaCcbV2obNn82ghwj9lw=\ngithub.com/tree-sitter/tree-sitter-python v0.21.1-0.20240818005537-55a9b8a4fbfb/go.mod h1:lXCF1nGG5Dr4J3BTS0ObN4xJCCICiSu/b+Xe/VqMV7g=\ngithub.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d h1:fcYCvoXdcP1uRQYXqJHRy6Hec+uKScQdKVtMwK9JeCI=\ngithub.com/tree-sitter/tree-sitter-ruby v0.21.1-0.20240818211811-7dbc1e2d0e2d/go.mod h1:T1nShQ4v5AJtozZ8YyAS4uzUtDAJj/iv4YfwXSbUHzg=\ngithub.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447 h1:o9alBu1J/WjrcTKEthYtXmdkDc5OVXD+PqlvnEZ0Lzc=\ngithub.com/tree-sitter/tree-sitter-rust v0.21.3-0.20240818005432-2b43eafe6447/go.mod h1:1Oh95COkkTn6Ezp0vcMbvfhRP5gLeqqljR0BYnBzWvc=\ngopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=\ngopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=\n"
  },
  {
    "path": "grammar.js",
    "content": "const PREC = {\n  comment: 1,\n  using_directive: 2,\n  control: 1,\n  stable_type_id: 2,\n  type: 2,\n  while: 2,\n  assign: 3,\n  case: 3,\n  stable_id: 4,\n  unit: 4,\n  postfix: 5,\n  colon_call: 5,\n  infix: 6,\n  prefix: 7,\n  compound: 7,\n  call: 8,\n  field: 8,\n  macro: 10,\n  binding: 10,\n};\n\nmodule.exports = grammar({\n  name: \"scala\",\n\n  extras: $ => [/\\s/, $.comment, $.block_comment],\n\n  supertypes: $ => [$.expression, $._definition, $._pattern],\n\n  externals: $ => [\n    $._automatic_semicolon,\n    $._indent,\n    $._outdent,\n    $._comma_outdent,\n    $._simple_string_start,\n    $._simple_string_middle,\n    $._simple_multiline_string_start,\n    $._interpolated_string_middle,\n    $._interpolated_multiline_string_middle,\n    $._raw_string_start,\n    $._raw_string_middle,\n    $._raw_string_multiline_middle,\n    $._single_line_string_end,\n    $._multiline_string_end,\n    \"else\",\n    \"catch\",\n    \"finally\",\n    \"extends\",\n    \"derives\",\n    \"with\",\n    $.error_sentinel,\n  ],\n\n  inline: $ => [\n    $._pattern,\n    $._semicolon,\n    $._definition,\n    $._param_type,\n    $._identifier,\n    $._postfix_expression_choice,\n    $._infix_type_choice,\n    $._param_value_type,\n    $._simple_type,\n    $.literal,\n  ],\n\n  // Doc: https://tree-sitter.github.io/tree-sitter/creating-parsers, search \"precedences\"\n  // These names can be used in the prec functions to define precedence relative only to other names in the array, rather than globally.\n  precedences: $ => [\n    [\"mod\", \"soft_id\"],\n    [\"end\", \"soft_id\"],\n    [\"new\", \"structural_type\"],\n    [\"self_type\", \"lambda\"],\n    [\"annotation\", \"applied_constructor_type\"],\n    [\"constructor_application\", \"applied_constructor_type\"],\n  ],\n\n  conflicts: $ => [\n    [$.tuple_type, $.parameter_types],\n    [$.binding, $._simple_expression],\n    [$.binding, $._type_identifier],\n    [$.while_expression, $._simple_expression],\n    [$.if_expression],\n    [$.match_expression],\n    [$._given_constructor, $._type_identifier],\n    [$.instance_expression],\n    // In case of: 'extension'  _indent  '{'  'case'  operator_identifier  'if'  operator_identifier  •  '=>'  …\n    // we treat `operator_identifier` as `simple_expression`\n    [$._simple_expression, $.lambda_expression],\n    // operator_identifier  •  ':'  …\n    [$._simple_expression, $._single_lambda_param],\n    // 'class'  _class_constructor  •  _automatic_semicolon  …\n    [$._class_definition],\n    // 'class'  operator_identifier  •  _automatic_semicolon  …\n    [$._class_constructor],\n    // 'enum'  _class_constructor  '{'  'case'  operator_identifier  _full_enum_def_repeat1  •  _automatic_semicolon  …\n    [$._full_enum_def],\n    // _start_val  identifier  ','  identifier  •  ':'  …\n    [$.identifiers, $.val_declaration],\n    // 'enum'  operator_identifier  _automatic_semicolon  '('  ')'  •  ':'  …\n    [$.class_parameters],\n    // 'for'  operator_identifier  ':'  _annotated_type  •  ':'  …\n    [$._type, $.compound_type],\n    // 'for'  'given'  _annotated_type  •  '*'  …\n    [$._type, $.infix_type],\n    // _simple_expression  ':'  _annotated_type  •  'match'  …\n    [$._type, $.match_type],\n    // 'given'  '('  '['  _type_parameter  •  ','  …\n    [$._variant_type_parameter, $.type_lambda],\n    // 'given'  '('  operator_identifier  ':'  _type  •  ','  …\n    [$.name_and_type, $.parameter],\n    [$._simple_expression, $.binding, $.tuple_pattern],\n    [$._simple_expression, $.tuple_pattern],\n    [$._simple_expression, $._type_identifier],\n    // 'if'  parenthesized_expression  •  '{'  …\n    [$._if_condition, $._simple_expression],\n    [$.block, $._braced_template_body1],\n    [$._simple_expression, $._type_identifier],\n    // '['  operator_identifier  ':'  '{'  operator_identifier  •  '=>'  …\n    [$._single_lambda_param, $.self_type, $._type_identifier],\n    // '['  operator_identifier  ':'  '{'  operator_identifier  •  '?=>'  …\n    [$._single_lambda_param, $._type_identifier],\n    // '('  operator_identifier  •  ':'  …\n    [$._simple_expression, $._single_lambda_param, $.binding],\n    // 'given'  '{'  operator_identifier  •  ':'  …\n    [$._simple_expression, $._single_lambda_param, $.self_type],\n    // '['  operator_identifier  ':'  '{'  operator_identifier  •  ':'  …\n    [\n      $._simple_expression,\n      $._single_lambda_param,\n      $.self_type,\n      $._type_identifier,\n    ],\n    // 'given'  '{'  operator_identifier  ':'  _type  •  '=>'  …\n    [$._single_lambda_param, $._self_type_ascription],\n    [$.binding, $._simple_expression, $._type_identifier],\n    [$.class_parameter, $._type_identifier],\n    // '{'  _single_lambda_param  '=>'  expression  •  '}'  …\n    [$._block, $._indentable_expression],\n    [$.match_expression, $._simple_expression],\n    // _  :  Type  •  '=>'  …\n    [$.self_type, $._simple_expression],\n    // 'for'  null_literal  _asterisk  •  '*'  …\n    [$.repeat_pattern, $.operator_identifier],\n    // _simple_expression  '('  _simple_expression  _asterisk  •  ')'  …\n    [$.vararg, $.operator_identifier],\n    // _simple_expression  '('  expression  •  ','  …\n    [$._exprs_in_parens],\n    // _simple_expression  ':'  '('  wildcard  •  ','  …\n    [$._annotated_type, $.binding],\n    // '['  identifier  ':'  '{'  wildcard  •  ':'  …\n    [$.self_type, $._annotated_type, $._simple_expression],\n    // '['  identifier  ':'  '{'  '('  wildcard  •  ':'  …\n    [$.binding, $._annotated_type, $._simple_expression],\n    // '['  identifier  ':'  '{'  wildcard  •  '{'  …\n    [$._annotated_type, $._simple_expression],\n    // '['  identifier  ':'  '{'  wildcard  •  '['  …\n    [$.generic_type, $._simple_expression],\n  ],\n\n  word: $ => $._alpha_identifier,\n\n  rules: {\n    // TopStats          ::=  TopStat {semi TopStat}\n    compilation_unit: $ =>\n      seq(\n        optional($._shebang),\n        optional(trailingSep1($._semicolon, $._top_level_definition)),\n      ),\n\n    _top_level_definition: $ =>\n      choice($._definition, $._end_marker, $.expression),\n\n    _definition: $ =>\n      choice(\n        $.given_definition,\n        $.extension_definition,\n        $.class_definition,\n        $.import_declaration,\n        $.export_declaration,\n        $.object_definition,\n        $.enum_definition,\n        $.trait_definition,\n        $.val_definition,\n        $.val_declaration,\n        $.var_definition,\n        $.var_declaration,\n        $.type_definition,\n        $.function_definition,\n        $.function_declaration,\n        $.package_clause,\n        $.package_object,\n      ),\n\n    enum_definition: $ =>\n      seq(\n        repeat($.annotation),\n        optional($.modifiers),\n        \"enum\",\n        $._class_constructor,\n        field(\"extend\", optional($.extends_clause)),\n        field(\"derive\", optional($.derives_clause)),\n        field(\"body\", $.enum_body),\n      ),\n\n    _enum_block: $ =>\n      prec.left(\n        seq(\n          sep1(\n            $._semicolon,\n            choice($.enum_case_definitions, $.expression, $._definition),\n          ),\n          optional($._semicolon),\n        ),\n      ),\n\n    enum_body: $ =>\n      choice(\n        prec.left(PREC.control, seq(\":\", $._indent, $._enum_block, $._outdent)),\n        seq(\n          \"{\",\n          // TODO: self type\n          optional($._enum_block),\n          \"}\",\n        ),\n      ),\n\n    enum_case_definitions: $ =>\n      seq(\n        repeat($.annotation),\n        \"case\",\n        choice(commaSep1($.simple_enum_case), $.full_enum_case),\n      ),\n\n    simple_enum_case: $ =>\n      prec.left(\n        seq(\n          field(\"name\", $._identifier),\n          field(\"extend\", optional($.extends_clause)),\n        ),\n      ),\n\n    full_enum_case: $ => seq(field(\"name\", $._identifier), $._full_enum_def),\n\n    _full_enum_def: $ =>\n      seq(\n        field(\"type_parameters\", optional($.type_parameters)),\n        field(\"class_parameters\", repeat1($.class_parameters)),\n        field(\"extend\", optional($.extends_clause)),\n      ),\n\n    package_clause: $ =>\n      prec.right(\n        seq(\n          \"package\",\n          field(\"name\", $.package_identifier),\n          // This is slightly more permissive than the EBNF in that it allows any\n          // kind of declaration inside of the package blocks. As we're more\n          // concerned with the structure rather than the validity of the program\n          // we'll allow it.\n          field(\"body\", optional($.template_body)),\n        ),\n      ),\n\n    package_identifier: $ => prec.right(sep1(\".\", $._identifier)),\n\n    package_object: $ => seq(\"package\", \"object\", $._object_definition),\n\n    import_declaration: $ =>\n      prec.left(seq(\"import\", sep1(\",\", $._namespace_expression))),\n\n    export_declaration: $ =>\n      prec.left(seq(\"export\", sep1(\",\", $._namespace_expression))),\n\n    /*\n      ImportExpr        ::=  SimpleRef {‘.’ id} ‘.’ ImportSpec\n                          |  SimpleRef ‘as’ id\n      ImportSpec        ::=  NamedSelector\n                          |  WildCardSelector\n                          | ‘{’ ImportSelectors) ‘}’\n      NamedSelector     ::=  id [‘as’ (id | ‘_’)]\n      WildCardSelector  ::=  ‘*’ | ‘given’ [InfixType]\n    */\n    _namespace_expression: $ =>\n      prec.left(\n        choice(\n          seq(\n            field(\"path\", sep1(\".\", $._identifier)),\n            optional(\n              seq(\n                \".\",\n                choice(\n                  $.namespace_wildcard,\n                  $.namespace_selectors,\n                  // Only allowed in Scala 3\n                  // ImportExpr        ::=\n                  //    SimpleRef {‘.’ id} ‘.’ ImportSpec |  SimpleRef ‘as’ id\n                  $.as_renamed_identifier,\n                ),\n              ),\n            ),\n          ),\n          $.as_renamed_identifier,\n        ),\n      ),\n\n    namespace_wildcard: $ => prec.left(1, choice(\"*\", \"_\", \"given\")),\n\n    _namespace_given_by_type: $ => seq(\"given\", $._type),\n\n    namespace_selectors: $ =>\n      seq(\n        \"{\",\n        trailingCommaSep1(\n          choice(\n            $._namespace_given_by_type,\n            $.namespace_wildcard,\n            $._identifier,\n            $.arrow_renamed_identifier,\n            $.as_renamed_identifier,\n          ),\n        ),\n        \"}\",\n      ),\n\n    // deprecated: Remove when highlight query is updated for Neovim\n    _import_selectors: $ => alias($.namespace_selectors, $.import_selectors),\n\n    arrow_renamed_identifier: $ =>\n      seq(\n        field(\"name\", $._identifier),\n        \"=>\",\n        field(\"alias\", choice($._identifier, $.wildcard)),\n      ),\n\n    as_renamed_identifier: $ =>\n      seq(\n        field(\"name\", $._identifier),\n        \"as\",\n        field(\"alias\", choice($._identifier, $.wildcard)),\n      ),\n\n    object_definition: $ =>\n      seq(\n        repeat($.annotation),\n        optional($.modifiers),\n        optional(\"case\"),\n        \"object\",\n        $._object_definition,\n      ),\n\n    _object_definition: $ =>\n      prec.left(\n        seq(\n          field(\"name\", $._identifier),\n          field(\"extend\", optional($.extends_clause)),\n          field(\"derive\", optional($.derives_clause)),\n          field(\"body\", optional($._definition_body)),\n        ),\n      ),\n\n    class_definition: $ =>\n      seq(\n        repeat($.annotation),\n        optional($.modifiers),\n        optional(\"case\"),\n        \"class\",\n        $._class_definition,\n      ),\n\n    _class_definition: $ =>\n      seq(\n        $._class_constructor,\n        field(\"extend\", optional($.extends_clause)),\n        field(\"derive\", optional($.derives_clause)),\n        field(\"body\", optional($._definition_body)),\n      ),\n\n    _definition_body: $ =>\n      seq(optional($._automatic_semicolon), field(\"body\", $.template_body)),\n\n    /**\n     * ClassConstr       ::=  [ClsTypeParamClause] [ConstrMods] ClsParamClauses\n     * ConstrMods        ::=  {Annotation} [AccessModifier]\n     */\n    _class_constructor: $ =>\n      seq(\n        field(\"name\", $._identifier),\n        field(\"type_parameters\", optional($.type_parameters)),\n        optional(alias($._constructor_annotation, $.annotation)),\n        optional($.access_modifier),\n        field(\n          \"class_parameters\",\n          repeat(seq(optional($._automatic_semicolon), $.class_parameters)),\n        ),\n      ),\n\n    trait_definition: $ =>\n      prec.left(\n        seq(\n          repeat($.annotation),\n          optional($.modifiers),\n          \"trait\",\n          $._class_definition,\n        ),\n      ),\n\n    // The EBNF makes a distinction between function type parameters and other\n    // type parameters as you can't specify variance on function type\n    // parameters. This isn't important to the structure of the AST so we don't\n    // make that distinction.\n    type_parameters: $ =>\n      seq(\"[\", trailingCommaSep1($._variant_type_parameter), \"]\"),\n\n    _variant_type_parameter: $ =>\n      seq(\n        repeat($.annotation),\n        choice(\n          $.covariant_type_parameter,\n          $.contravariant_type_parameter,\n          $._type_parameter, // invariant type parameter\n          $.type_lambda,\n        ),\n      ),\n\n    covariant_type_parameter: $ => seq(\"+\", $._type_parameter),\n\n    contravariant_type_parameter: $ => seq(\"-\", $._type_parameter),\n\n    _type_parameter: $ =>\n      seq(\n        field(\"name\", choice($.wildcard, $._identifier)),\n        field(\"type_parameters\", optional($.type_parameters)),\n        field(\"bound\", optional($.lower_bound)),\n        field(\"bound\", optional($.upper_bound)),\n        field(\"bound\", optional(repeat($.view_bound))),\n        field(\"bound\", optional($._context_bounds)),\n      ),\n\n    upper_bound: $ => seq(\"<:\", field(\"type\", $._type)),\n\n    lower_bound: $ => seq(\">:\", field(\"type\", $._type)),\n\n    view_bound: $ => seq(\"<%\", field(\"type\", $._type)),\n\n    _context_bounds: $ =>\n      choice(\n        repeat1(seq(\":\", $.context_bound)),\n        seq(\":\", \"{\", trailingCommaSep1($.context_bound), \"}\"),\n      ),\n\n    context_bound: $ =>\n      seq(\n        field(\"type\", $._type),\n        optional(seq(\"as\", field(\"name\", $._identifier))),\n      ),\n\n    /*\n     * TemplateBody      ::=  :<<< [SelfType] TemplateStat {semi TemplateStat} >>>\n     */\n    template_body: $ =>\n      choice($._indented_template_body, $._braced_template_body),\n\n    _indented_template_body: $ =>\n      prec.left(\n        PREC.control,\n        seq(\":\", $._indent, optional($.self_type), $._block, $._outdent),\n      ),\n\n    _braced_template_body: $ =>\n      prec.left(\n        PREC.control,\n        seq(\n          \"{\",\n          optional(choice($._braced_template_body1, $._braced_template_body2)),\n          \"}\",\n        ),\n      ),\n\n    _braced_template_body1: $ => seq(optional($.self_type), $._block),\n    _braced_template_body2: $ =>\n      seq(\n        choice(\n          seq($._indent, optional($.self_type)),\n          seq(optional($.self_type), $._indent),\n        ),\n        optional($._block),\n        $._outdent,\n      ),\n\n    /*\n     * WithTemplateBody  ::=  <<< [SelfType] TemplateStat {semi TemplateStat} >>>\n     */\n    with_template_body: $ =>\n      choice(\n        prec.left(\n          PREC.control,\n          seq($._indent, optional($.self_type), $._block, $._outdent),\n        ),\n        seq(\"{\", optional($._block), \"}\"),\n      ),\n\n    _extension_template_body: $ =>\n      choice(\n        prec.left(PREC.control, seq($._indent, $._block, $._outdent)),\n        seq(\"{\", optional($._block), \"}\"),\n      ),\n\n    _end_marker: $ =>\n      prec.left(\n        \"end\",\n        seq(\n          \"end\",\n          choice(\n            \"if\",\n            \"while\",\n            \"for\",\n            \"match\",\n            \"try\",\n            \"new\",\n            \"this\",\n            \"given\",\n            \"extension\",\n            \"val\",\n            alias($._identifier, \"_end_ident\"),\n          ),\n        ),\n      ),\n\n    // Dynamic precedences added here to win over $.call_expression\n    self_type: $ =>\n      prec.dynamic(\n        1,\n        prec(\n          \"self_type\",\n          seq(\n            choice($._identifier, $.wildcard),\n            optional($._self_type_ascription),\n            \"=>\",\n          ),\n        ),\n      ),\n\n    _self_type_ascription: $ => seq(\":\", $._type),\n\n    annotation: $ =>\n      prec.right(\n        \"annotation\",\n        seq(\n          \"@\",\n          field(\"name\", $._simple_type),\n          field(\"arguments\", repeat(prec(\"annotation\", $.arguments))),\n        ),\n      ),\n\n    // Only allows 0 or 1 argument lists as these annotations\n    // usually come from Java, where multiple argument lists are not allowed\n    _constructor_annotation: $ =>\n      prec(\n        \"annotation\",\n        seq(\n          \"@\",\n          field(\"name\", $._simple_type),\n          optional(\n            alias(\n              seq(\n                // token.immediate here carries an assumption that there are no spaces between\n                // an annotation name and its argument list, otherwise this list should be\n                // classified as a class constructor list\n                token.immediate(\"(\"),\n                optional($._exprs_in_parens),\n                \")\",\n              ),\n              $.arguments,\n            ),\n          ),\n        ),\n      ),\n\n    val_definition: $ =>\n      seq(\n        $._start_val,\n        field(\"pattern\", choice($._pattern, $.identifiers)),\n        optional(seq(\":\", field(\"type\", $._type))),\n        \"=\",\n        field(\"value\", $._indentable_expression),\n      ),\n\n    val_declaration: $ =>\n      seq(\n        $._start_val,\n        commaSep1(field(\"name\", $._identifier)),\n        \":\",\n        field(\"type\", $._type),\n      ),\n\n    _start_val: $ => seq(repeat($.annotation), optional($.modifiers), \"val\"),\n\n    var_declaration: $ =>\n      seq(\n        $._start_var,\n        commaSep1(field(\"name\", $._identifier)),\n        \":\",\n        field(\"type\", $._type),\n      ),\n\n    var_definition: $ =>\n      seq(\n        $._start_var,\n        field(\"pattern\", choice($._pattern, $.identifiers)),\n        optional(seq(\":\", field(\"type\", $._type))),\n        \"=\",\n        field(\"value\", $._indentable_expression),\n      ),\n\n    _start_var: $ => seq(repeat($.annotation), optional($.modifiers), \"var\"),\n\n    type_definition: $ =>\n      prec.left(\n        seq(\n          repeat($.annotation),\n          optional($.modifiers),\n          optional($.opaque_modifier),\n          \"type\",\n          $._type_constructor,\n          optional(seq(\"=\", field(\"type\", $._type))),\n        ),\n      ),\n\n    // Created for memory-usage optimization during codegen.\n    _type_constructor: $ =>\n      prec.left(\n        seq(\n          field(\"name\", $._type_identifier),\n          field(\"type_parameters\", optional($.type_parameters)),\n          field(\"bound\", optional($.lower_bound)),\n          field(\"bound\", optional($.upper_bound)),\n          field(\"bound\", optional($._context_bounds)),\n        ),\n      ),\n\n    function_definition: $ =>\n      seq(\n        $._function_declaration,\n        choice(\n          seq(\"=\", field(\"body\", $._indentable_expression)),\n          field(\"body\", $.block),\n        ),\n      ),\n\n    function_declaration: $ => $._function_declaration,\n\n    _function_declaration: $ =>\n      prec.left(\n        seq(\n          repeat($.annotation),\n          optional($.modifiers),\n          \"def\",\n          $._function_constructor,\n          optional(seq(\":\", field(\"return_type\", $._type))),\n        ),\n      ),\n\n    // Created for memory-usage optimization during codegen.\n    _function_constructor: $ =>\n      prec.right(\n        seq(\n          field(\"name\", $._identifier),\n          field(\n            \"parameters\",\n            repeat(\n              seq(\n                optional($._automatic_semicolon),\n                choice($.parameters, $.type_parameters),\n              ),\n            ),\n          ),\n          optional($._automatic_semicolon),\n        ),\n      ),\n\n    opaque_modifier: $ => prec(\"mod\", \"opaque\"),\n\n    /**\n     *   Extension         ::=  'extension' [DefTypeParamClause] {UsingParamClause}\n     *                          '(' DefParam ')' {UsingParamClause} ExtMethods\n     */\n    extension_definition: $ =>\n      prec.left(\n        seq(\n          \"extension\",\n          field(\"type_parameters\", optional($.type_parameters)),\n          field(\"parameters\", repeat($.parameters)),\n          field(\n            \"body\",\n            choice(\n              $._extension_template_body,\n              $.function_definition,\n              $.function_declaration,\n            ),\n          ),\n        ),\n      ),\n\n    /**\n     * GivenDef          ::=  [GivenSig] (AnnotType ['=' Expr] | StructuralInstance)\n     * GivenSig          ::=  [id] [DefTypeParamClause] {UsingParamClause} ':'\n     */\n    given_definition: $ =>\n      prec.left(\n        seq(\n          repeat($.annotation),\n          optional($.modifiers),\n          \"given\",\n          optional($._given_constructor),\n          repeat($._given_sig),\n          choice(\n            field(\"return_type\", $._structural_instance),\n            seq(\n              field(\"return_type\", $._annotated_type),\n              optional(seq(\"=\", field(\"body\", $._indentable_expression))),\n            ),\n          ),\n        ),\n      ),\n\n    _given_sig: $ => seq($._given_conditional, \"=>\"),\n\n    _given_conditional: $ =>\n      choice(alias($.parameters, $.given_conditional), $.type_parameters),\n\n    _given_constructor: $ =>\n      prec.right(\n        seq(\n          field(\"name\", optional($._identifier)),\n          field(\"type_parameters\", optional($.type_parameters)),\n          field(\n            \"parameters\",\n            repeat(seq(optional($._automatic_semicolon), $.parameters)),\n          ),\n          optional($._automatic_semicolon),\n          \":\",\n        ),\n      ),\n\n    /**\n     * StructuralInstance ::=  ConstrApp {'with' ConstrApp} ['with' WithTemplateBody]\n     */\n    _structural_instance: $ =>\n      prec.left(\n        PREC.compound,\n        seq(\n          $._constructor_application,\n          choice(\":\", \"with\"),\n          field(\"body\", $.with_template_body),\n        ),\n      ),\n\n    /**\n     * ConstrApp         ::=  SimpleType1 {Annotation} {ParArgumentExprs}\n     *\n     * Note: It would look more elegant if we could make seq(choice(), optional(arguments)),\n     * but that doesn't seem to work.\n     */\n    _constructor_application: $ =>\n      prec.left(\n        \"constructor_application\",\n        choice(\n          $._annotated_type,\n          $.compound_type,\n          // In theory structural_type should just be added to simple_type,\n          // but doing so increases the state of template_body to 4000\n          $._structural_type,\n          // This adds _simple_type, but not the above intentionally.\n          seq($._simple_type, field(\"arguments\", $.arguments)),\n          seq($._annotated_type, field(\"arguments\", $.arguments)),\n          seq($.compound_type, field(\"arguments\", $.arguments)),\n        ),\n      ),\n\n    _constructor_applications: $ =>\n      prec.left(\n        choice(\n          commaSep1($._constructor_application),\n          sep1(\"with\", $._constructor_application),\n        ),\n      ),\n\n    modifiers: $ =>\n      prec.left(\n        repeat1(\n          prec.left(\n            choice(\n              \"abstract\",\n              \"final\",\n              \"sealed\",\n              \"implicit\",\n              \"lazy\",\n              \"override\",\n              $.access_modifier,\n              $.inline_modifier,\n              $.infix_modifier,\n              $.into_modifier,\n              $.open_modifier,\n              $.tracked_modifier,\n              $.transparent_modifier,\n            ),\n          ),\n        ),\n      ),\n\n    access_modifier: $ =>\n      prec.left(\n        seq(choice(\"private\", \"protected\"), optional($.access_qualifier)),\n      ),\n\n    access_qualifier: $ => seq(\"[\", $._identifier, \"]\"),\n\n    inline_modifier: $ => prec(\"mod\", \"inline\"),\n    infix_modifier: $ => prec(\"mod\", \"infix\"),\n    into_modifier: $ => prec(\"mod\", \"into\"),\n    open_modifier: $ => prec(\"mod\", \"open\"),\n    tracked_modifier: $ => prec(\"mod\", \"tracked\"),\n    transparent_modifier: $ => prec(\"mod\", \"transparent\"),\n\n    /**\n     * InheritClauses    ::=  ['extends' ConstrApps] ['derives' QualId {',' QualId}]\n     */\n    extends_clause: $ =>\n      prec.left(\n        seq(\n          \"extends\",\n          field(\"type\", $._constructor_applications),\n          repeat($.arguments),\n        ),\n      ),\n\n    derives_clause: $ =>\n      prec.left(\n        seq(\n          \"derives\",\n          commaSep1(\n            field(\"type\", choice($._type_identifier, $.stable_type_identifier)),\n          ),\n        ),\n      ),\n\n    class_parameters: $ =>\n      prec(\n        1,\n        seq(\n          optional($._automatic_semicolon),\n          \"(\",\n          choice(\n            seq(\n              \"using\",\n              choice(\n                trailingCommaSep1($.class_parameter),\n                trailingCommaSep1($._param_type),\n              ),\n            ),\n            seq(optional(\"implicit\"), trailingCommaSep($.class_parameter)),\n          ),\n          \")\",\n        ),\n      ),\n\n    /*\n     * DefParamClauses   ::=  {DefParamClause} [[nl] ‘(’ [‘implicit’] DefParams ‘)’]\n     * DefParamClause    ::=  [nl] ‘(’ DefParams ‘)’ | UsingParamClause\n     * DefParams         ::=  DefParam {‘,’ DefParam}\n     */\n    parameters: $ =>\n      choice(\n        seq(\"(\", optional(\"implicit\"), trailingCommaSep($.parameter), \")\"),\n        $._using_parameters_clause,\n      ),\n\n    /*\n     * UsingParamClause  ::=  [nl] ‘(’ ‘using’ (DefParams | FunArgTypes) ‘)’\n     * DefParams         ::=  DefParam {‘,’ DefParam}\n     * FunArgTypes       ::=  FunArgType { ‘,’ FunArgType }\n     */\n    _using_parameters_clause: $ =>\n      seq(\n        \"(\",\n        \"using\",\n        choice(\n          trailingCommaSep1($.parameter),\n          trailingCommaSep1($._param_type),\n        ),\n        \")\",\n      ),\n\n    class_parameter: $ =>\n      seq(\n        repeat($.annotation),\n        optional($.modifiers),\n        optional(choice(\"val\", \"var\")),\n        field(\"name\", $._identifier),\n        optional(seq(\":\", field(\"type\", $._param_type))),\n        optional(seq(\"=\", field(\"default_value\", $.expression))),\n      ),\n\n    /*\n     * DefParam          ::=  {Annotation} [‘inline’] Param\n     * Param             ::=  id ‘:’ ParamType [‘=’ Expr]\n     */\n    parameter: $ =>\n      prec.left(\n        PREC.control,\n        seq(\n          repeat($.annotation),\n          optional($.inline_modifier),\n          field(\"name\", $._identifier),\n          \":\",\n          field(\"type\", $._param_type),\n          optional(seq(\"=\", field(\"default_value\", $.expression))),\n        ),\n      ),\n\n    /*\n     * NameAndType       ::=  id ':' Type\n     */\n    name_and_type: $ =>\n      prec.left(\n        PREC.control,\n        seq(field(\"name\", $._identifier), \":\", field(\"type\", $._param_type)),\n      ),\n\n    _block: $ =>\n      prec.left(\n        seq(\n          sep1(\n            $._semicolon,\n            choice($.expression, $._definition, $._end_marker, \";\"),\n          ),\n          optional($._semicolon),\n        ),\n      ),\n\n    _indentable_expression: $ =>\n      prec.right(choice($.indented_block, $.indented_cases, $.expression)),\n\n    block: $ =>\n      seq(\n        \"{\",\n        optional(\n          choice(\n            $._block,\n            alias($._block_lambda_expression, $.lambda_expression),\n          ),\n        ),\n        \"}\",\n      ),\n\n    indented_block: $ =>\n      prec.left(\n        PREC.control,\n        seq(\n          $._indent,\n          $._block,\n          choice($._outdent, $._comma_outdent),\n          optional($._end_marker),\n        ),\n      ),\n\n    indented_cases: $ =>\n      prec.left(\n        seq(\n          $._indent,\n          repeat1($.case_clause),\n          choice($._outdent, $._comma_outdent),\n        ),\n      ),\n\n    // ---------------------------------------------------------------\n    // Types\n\n    _type: $ =>\n      choice(\n        $.function_type,\n        $.compound_type,\n        $.infix_type,\n        $.match_type,\n        $._annotated_type,\n        $.literal_type,\n        $._structural_type,\n        $.type_lambda,\n      ),\n\n    _annotated_type: $ => prec.right(choice($.annotated_type, $._simple_type)),\n\n    annotated_type: $ => prec.right(seq($._simple_type, repeat1($.annotation))),\n\n    _simple_type: $ =>\n      choice(\n        $.generic_type,\n        $.projected_type,\n        $.tuple_type,\n        $.named_tuple_type,\n        $.singleton_type,\n        $.stable_type_identifier,\n        $._type_identifier,\n        $.applied_constructor_type,\n        $.wildcard,\n      ),\n\n    applied_constructor_type: $ =>\n      prec(\"applied_constructor_type\", seq($._type_identifier, $.arguments)),\n\n    compound_type: $ =>\n      choice(\n        prec.left(\n          PREC.compound,\n          seq(\n            field(\"base\", $._annotated_type),\n            repeat1(seq(\"with\", field(\"extra\", $._annotated_type))),\n          ),\n        ),\n        prec.left(seq(field(\"base\", $._annotated_type), $._refinement)),\n        prec.left(\n          -1,\n          seq(\n            prec.left(\n              PREC.compound,\n              seq(\n                field(\"base\", $._annotated_type),\n                repeat1(seq(\"with\", field(\"extra\", $._annotated_type))),\n              ),\n            ),\n            $._refinement,\n          ),\n        ),\n      ),\n\n    _structural_type: $ =>\n      prec(\"structural_type\", alias($.template_body, $.structural_type)),\n\n    _refinement: $ => alias($.template_body, $.refinement),\n\n    // This does not include _simple_type since _annotated_type covers it.\n    _infix_type_choice: $ =>\n      prec.left(\n        choice(\n          $.compound_type,\n          $.infix_type,\n          $._annotated_type,\n          $.literal_type,\n        ),\n      ),\n\n    infix_type: $ =>\n      prec.left(\n        seq(\n          field(\"left\", $._infix_type_choice),\n          field(\"operator\", $._identifier),\n          field(\"right\", $._infix_type_choice),\n        ),\n      ),\n\n    tuple_type: $ => seq(\"(\", trailingCommaSep1($._type), \")\"),\n\n    named_tuple_type: $ => seq(\"(\", trailingCommaSep1($.name_and_type), \")\"),\n\n    singleton_type: $ =>\n      prec.left(\n        PREC.stable_type_id,\n        seq(choice($._identifier, $.stable_identifier), \".\", \"type\"),\n      ),\n\n    stable_type_identifier: $ =>\n      prec.left(\n        PREC.stable_type_id,\n        seq(\n          choice($._identifier, $.stable_identifier),\n          \".\",\n          $._type_identifier,\n        ),\n      ),\n\n    stable_identifier: $ =>\n      prec.left(\n        PREC.stable_id,\n        seq(choice($._identifier, $.stable_identifier), \".\", $._identifier),\n      ),\n\n    generic_type: $ =>\n      seq(\n        field(\"type\", $._simple_type),\n        field(\"type_arguments\", $.type_arguments),\n      ),\n\n    projected_type: $ =>\n      seq(\n        field(\"type\", $._simple_type),\n        \"#\",\n        field(\"selector\", $._type_identifier),\n      ),\n\n    match_type: $ =>\n      prec.left(\n        seq(\n          $._infix_type_choice,\n          \"match\",\n          choice(\n            seq($._indent, repeat1($.type_case_clause), $._outdent),\n            seq(\"{\", repeat1($.type_case_clause), \"}\"),\n          ),\n        ),\n      ),\n\n    type_case_clause: $ =>\n      prec.left(\n        PREC.control,\n        seq(\"case\", $._infix_type_choice, field(\"body\", $._arrow_then_type)),\n      ),\n\n    function_type: $ =>\n      prec.left(\n        choice(\n          seq(field(\"type_parameters\", $.type_parameters), $._arrow_then_type),\n          seq(field(\"parameter_types\", $.parameter_types), $._arrow_then_type),\n        ),\n      ),\n\n    _arrow_then_type: $ =>\n      prec.right(seq(choice(\"=>\", \"?=>\"), field(\"return_type\", $._type))),\n\n    // Deprioritize against typed_pattern._type.\n    parameter_types: $ =>\n      prec(\n        -1,\n        choice(\n          $._annotated_type,\n          // Prioritize a parenthesized param list over a single tuple_type.\n          prec.dynamic(1, seq(\"(\", trailingCommaSep($._param_type), \")\")),\n          $.compound_type,\n          $.infix_type,\n        ),\n      ),\n\n    _param_type: $ => choice($.lazy_parameter_type, $._param_value_type),\n\n    _param_value_type: $ =>\n      choice(field(\"type\", $._type), $.repeated_parameter_type),\n\n    repeated_parameter_type: $ => seq(field(\"type\", $._type), $._asterisk),\n\n    lazy_parameter_type: $ => seq(\"=>\", field(\"type\", $._param_value_type)),\n\n    _type_identifier: $ => alias($._identifier, $.type_identifier),\n\n    type_lambda: $ =>\n      seq(\n        \"[\",\n        trailingCommaSep1($._type_parameter),\n        \"]\",\n        \"=>>\",\n        field(\"return_type\", $._type),\n      ),\n\n    // ---------------------------------------------------------------\n    // Patterns\n\n    _pattern: $ =>\n      choice(\n        $._identifier,\n        $.stable_identifier,\n        $.interpolated_string_expression,\n        $.capture_pattern,\n        $.tuple_pattern,\n        $.named_tuple_pattern,\n        $.case_class_pattern,\n        $.infix_pattern,\n        $.alternative_pattern,\n        $.typed_pattern,\n        $.given_pattern,\n        $.quote_expression,\n        $.literal,\n        $.wildcard,\n        $.repeat_pattern,\n      ),\n\n    case_class_pattern: $ =>\n      seq(\n        field(\"type\", choice($._type_identifier, $.stable_type_identifier)),\n        \"(\",\n        choice(\n          field(\"pattern\", trailingCommaSep($._pattern)),\n          field(\"pattern\", trailingCommaSep($.named_pattern)),\n        ),\n        \")\",\n      ),\n\n    infix_pattern: $ =>\n      prec.left(\n        PREC.infix,\n        seq(\n          field(\"left\", $._pattern),\n          field(\"operator\", $._identifier),\n          field(\"right\", $._pattern),\n        ),\n      ),\n\n    capture_pattern: $ =>\n      prec.right(\n        PREC.field,\n        seq(\n          field(\"name\", choice($._identifier, $.wildcard)),\n          \"@\",\n          field(\"pattern\", $._pattern),\n        ),\n      ),\n\n    repeat_pattern: $ =>\n      prec.right(seq(field(\"pattern\", $._pattern), $._asterisk)),\n\n    typed_pattern: $ =>\n      prec.right(\n        -1,\n        seq(field(\"pattern\", $._pattern), \":\", field(\"type\", $._type)),\n      ),\n\n    given_pattern: $ => seq(\"given\", field(\"type\", $._type)),\n\n    // TODO: Flatten this.\n    alternative_pattern: $ => prec.left(-2, seq($._pattern, \"|\", $._pattern)),\n\n    tuple_pattern: $ => seq(\"(\", trailingCommaSep1($._pattern), \")\"),\n\n    named_pattern: $ => prec.left(-1, seq($._identifier, \"=\", $._pattern)),\n\n    named_tuple_pattern: $ => seq(\"(\", trailingCommaSep1($.named_pattern), \")\"),\n\n    // ---------------------------------------------------------------\n    // Expressions\n\n    expression: $ =>\n      choice(\n        $.if_expression,\n        $.match_expression,\n        $.try_expression,\n        $.assignment_expression,\n        $.lambda_expression,\n        $.postfix_expression,\n        $.ascription_expression,\n        $.infix_expression,\n        $.prefix_expression,\n        $.return_expression,\n        $.throw_expression,\n        $.while_expression,\n        $.do_while_expression,\n        $.for_expression,\n        $.macro_body,\n        $._simple_expression,\n      ),\n\n    /**\n     *  SimpleExpr        ::=  SimpleRef\n     *                      |  Literal\n     *                      |  '_'\n     *                      |  BlockExpr\n     *                      |  ExprSplice\n     *                      |  Quoted\n     *                      |  quoteId\n     *                      |  'new' ConstrApp {'with' ConstrApp} [TemplateBody]\n     *                      |  'new' TemplateBody\n     *                      |  '(' ExprsInParens ')'\n     *                      |  SimpleExpr '.' id\n     *                      |  SimpleExpr '.' MatchClause\n     *                      |  SimpleExpr TypeArgs\n     *                      |  SimpleExpr ArgumentExprs\n     *                      |  SimpleExpr ColonArgument\n     * TODO: ColonArgument\n     */\n    _simple_expression: $ =>\n      choice(\n        $.identifier,\n        $.operator_identifier,\n        $.literal,\n        $.interpolated_string_expression,\n        $.unit,\n        $.tuple_expression,\n        $.wildcard,\n        $.block,\n        $.splice_expression,\n        $.case_block,\n        $.quote_expression,\n        $.instance_expression,\n        $.parenthesized_expression,\n        $.field_expression,\n        $.generic_function,\n        $.call_expression,\n        alias($._dot_match_expression, $.match_expression),\n      ),\n\n    _single_lambda_param: $ =>\n      prec.right(\n        seq(optional(\"implicit\"), $._identifier, optional(seq(\":\", $._type))),\n      ),\n\n    lambda_expression: $ =>\n      prec.right(\n        \"lambda\",\n        seq(\n          optional(seq(field(\"type_parameters\", $.type_parameters), \"=>\")),\n          field(\n            \"parameters\",\n            choice($.bindings, $.wildcard, $._single_lambda_param),\n          ),\n          choice(\"=>\", \"?=>\"),\n          $._indentable_expression,\n        ),\n      ),\n\n    /* Special-case lambda expression to handle lambdas in braces (in $.block), e.g.\n     * { (...) => val a = 1; val b = 2\n     *    3\n     * }\n     *\n     * It exists as a separate rule because grammar generation becomes unacceptably slow\n     * if we include $._block right into $.lambda_expression as a viable option for the lambda body.\n     */\n    _block_lambda_expression: $ =>\n      prec.right(\n        \"lambda\",\n        seq(\n          field(\n            \"parameters\",\n            choice($.bindings, $.wildcard, $._single_lambda_param),\n          ),\n          choice(\"=>\", \"?=>\"),\n          $._block,\n        ),\n      ),\n\n    /*\n     *  ::=  [‘inline’] ‘if’ ‘(’ Expr ‘)’ {nl} Expr [[semi] ‘else’ Expr]\n     *    |  [‘inline’] ‘if’  Expr ‘then’ Expr [[semi] ‘else’ Expr]\n     */\n    if_expression: $ =>\n      seq(\n        optional($.inline_modifier),\n        \"if\",\n        field(\"condition\", $._if_condition),\n        field(\"consequence\", $._indentable_expression),\n        optional(\n          seq(\n            optional(\";\"),\n            \"else\",\n            field(\"alternative\", $._indentable_expression),\n          ),\n        ),\n      ),\n\n    // NOTE(susliko): _if_condition and its magic dynamic precedence were introduced as a fix to\n    // https://github.com/tree-sitter/tree-sitter-scala/issues/263 and\n    // https://github.com/tree-sitter/tree-sitter-scala/issues/342\n    // Neither do I understand why this works, nor have I found a better solution\n    _if_condition: $ =>\n      prec.dynamic(\n        4,\n        choice(\n          $.parenthesized_expression,\n          seq($._indentable_expression, \"then\"),\n        ),\n      ),\n\n    /*\n     *   MatchClause       ::=  'match' <<< CaseClauses >>>\n     *\n     *   Handles:\n     *     InfixExpr MatchClause\n     *     ‘inline’ InfixExpr MatchClause\n     *     SimpleExpr ‘.’ MatchClause\n     */\n    match_expression: $ =>\n      choice(\n        seq(\n          optional($.inline_modifier),\n          field(\"value\", $.expression),\n          \"match\",\n          field(\"body\", choice($.case_block, $.indented_cases)),\n        ),\n        $._dot_match_expression,\n      ),\n\n    _dot_match_expression: $ =>\n      seq(\n        field(\"value\", $._simple_expression),\n        \".\",\n        token.immediate(\"match\"),\n        field(\"body\", choice($.case_block, $.indented_cases)),\n      ),\n\n    try_expression: $ =>\n      prec.right(\n        PREC.control,\n        seq(\n          \"try\",\n          field(\"body\", $._indentable_expression),\n          optional($.catch_clause),\n          optional($.finally_clause),\n        ),\n      ),\n\n    /*\n     *   Catches           ::=  'catch' (Expr | ExprCaseClause)\n     */\n    catch_clause: $ =>\n      prec.right(\n        seq(\"catch\", choice($._indentable_expression, $._expr_case_clause)),\n      ),\n\n    _expr_case_clause: $ =>\n      prec.left(seq(\"case\", $._case_pattern, field(\"body\", $.expression))),\n\n    finally_clause: $ => prec.right(seq(\"finally\", $._indentable_expression)),\n\n    /*\n     * Binding           ::=  (id | ‘_’) [‘:’ Type]\n     */\n    binding: $ =>\n      seq(\n        choice(field(\"name\", $._identifier), $.wildcard),\n        optional(seq(\":\", field(\"type\", $._param_type))),\n      ),\n\n    bindings: $ => seq(\"(\", trailingCommaSep($.binding), \")\"),\n\n    case_block: $ =>\n      choice(prec(-1, seq(\"{\", \"}\")), seq(\"{\", repeat1($.case_clause), \"}\")),\n\n    case_clause: $ =>\n      prec.left(\n        seq(\"case\", $._case_pattern, field(\"body\", optional($._block))),\n      ),\n\n    // Dynamic precedence to win over lambda_expression in complex contexts\n    _case_pattern: $ =>\n      prec.dynamic(\n        1,\n        seq(field(\"pattern\", $._pattern), optional($.guard), \"=>\"),\n      ),\n\n    guard: $ =>\n      prec.left(\n        PREC.control,\n        seq(\"if\", field(\"condition\", $._postfix_expression_choice)),\n      ),\n\n    assignment_expression: $ =>\n      prec.right(\n        PREC.assign,\n        seq(\n          field(\"left\", choice($.prefix_expression, $._simple_expression)),\n          \"=\",\n          field(\"right\", choice($.expression, $.indented_block)),\n        ),\n      ),\n\n    generic_function: $ =>\n      prec(\n        PREC.call,\n        seq(\n          field(\"function\", $.expression),\n          field(\"type_arguments\", $.type_arguments),\n        ),\n      ),\n\n    call_expression: $ =>\n      choice(\n        prec.left(\n          PREC.call,\n          seq(\n            field(\"function\", $._simple_expression),\n            field(\"arguments\", choice($.arguments, $.case_block, $.block)),\n          ),\n        ),\n        prec.right(\n          PREC.colon_call,\n          seq(\n            field(\"function\", $._postfix_expression_choice),\n            \":\",\n            field(\"arguments\", $.colon_argument),\n          ),\n        ),\n      ),\n\n    /**\n     *   ColonArgument     ::=  colon [LambdaStart]\n     *                          (CaseClauses | Block)\n     */\n    colon_argument: $ =>\n      prec.left(\n        PREC.colon_call,\n        seq(\n          optional(\n            field(\n              \"lambda_start\",\n              seq(choice($.bindings, $._identifier, $.wildcard), \"=>\"),\n            ),\n          ),\n          choice($.indented_block, $.indented_cases),\n        ),\n      ),\n\n    field_expression: $ =>\n      prec.left(\n        PREC.field,\n        seq(\n          field(\"value\", $._simple_expression),\n          \".\",\n          field(\"field\", $._identifier),\n        ),\n      ),\n\n    /**\n     *   SimpleExpr        ::=  SimpleRef\n     *                      |  'new' ConstrApp {'with' ConstrApp} [TemplateBody]\n     *                      |  'new' TemplateBody\n     */\n    instance_expression: $ =>\n      choice(\n        // This is weakened so ascription wins for new Array: Array\n        prec.dynamic(\n          0,\n          seq(\"new\", $._constructor_application, $.template_body),\n        ),\n        prec(\"new\", seq(\"new\", $.template_body)),\n        seq(\"new\", $._constructor_application),\n      ),\n\n    /**\n     * PostfixExpr [Ascription]\n     */\n    ascription_expression: $ =>\n      prec.left(\n        seq(\n          $._postfix_expression_choice,\n          \":\",\n          choice($._param_type, $.annotation),\n        ),\n      ),\n\n    infix_expression: $ =>\n      prec.left(\n        PREC.infix,\n        seq(\n          field(\n            \"left\",\n            choice(\n              $.infix_expression,\n              $.prefix_expression,\n              $._simple_expression,\n            ),\n          ),\n          field(\"operator\", $._identifier),\n          field(\n            \"right\",\n            choice(\n              $.prefix_expression,\n              $._simple_expression,\n              seq(\":\", $.colon_argument),\n            ),\n          ),\n        ),\n      ),\n\n    /**\n     * PostfixExpr       ::=  InfixExpr [id]\n     */\n    postfix_expression: $ =>\n      prec.left(\n        PREC.postfix,\n        seq(\n          choice($.infix_expression, $.prefix_expression, $._simple_expression),\n          $._identifier,\n        ),\n      ),\n\n    _postfix_expression_choice: $ =>\n      prec.left(\n        PREC.postfix,\n        choice(\n          $.postfix_expression,\n          $.infix_expression,\n          $.prefix_expression,\n          $._simple_expression,\n        ),\n      ),\n\n    macro_body: $ =>\n      prec.left(\n        PREC.macro,\n        seq(\n          \"macro\",\n          choice($.infix_expression, $.prefix_expression, $._simple_expression),\n        ),\n      ),\n\n    /**\n     * PrefixExpr        ::=  [PrefixOperator] SimpleExpr\n     */\n    prefix_expression: $ =>\n      prec(PREC.prefix, seq(choice(\"+\", \"-\", \"!\", \"~\"), $._simple_expression)),\n\n    tuple_expression: $ =>\n      seq(\n        \"(\",\n        $.expression,\n        repeat1(seq(\",\", $.expression)),\n        optional(\",\"),\n        \")\",\n      ),\n\n    parenthesized_expression: $ => seq(\"(\", $.expression, \")\"),\n\n    type_arguments: $ => seq(\"[\", trailingCommaSep1($._type), \"]\"),\n\n    arguments: $ =>\n      seq(\n        \"(\",\n        choice(\n          $._vararg_arguments,\n          optional($._exprs_in_parens),\n          seq(\"using\", $._exprs_in_parens),\n        ),\n        \")\",\n      ),\n\n    _vararg_arguments: $ =>\n      seq(optional(seq($._exprs_in_parens, \",\")), $.vararg),\n\n    vararg: $ =>\n      choice(\n        // Scala 3: `args*`\n        seq($._simple_expression, $._asterisk),\n        // Scala 2: `args: _*`\n        seq($._simple_expression, \":\", token(seq(\"_\", token.immediate(\"*\")))),\n      ),\n\n    // ExprsInParens     ::=  ExprInParens {‘,’ ExprInParens}\n    _exprs_in_parens: $ => trailingCommaSep1($.expression),\n\n    splice_expression: $ =>\n      prec.left(\n        PREC.macro,\n        seq(\n          \"$\",\n          choice(\n            seq(\"{\", $._block, \"}\"),\n            seq(\"[\", $._type, \"]\"),\n            // TODO: This would never hit, since identifier permits $ sign\n            $.identifier,\n          ),\n        ),\n      ),\n\n    quote_expression: $ =>\n      prec.left(\n        PREC.macro,\n        seq(\n          \"'\",\n          choice(seq(\"{\", $._block, \"}\"), seq(\"[\", $._type, \"]\"), $.identifier),\n        ),\n      ),\n\n    /**\n     * id               ::=  plainid\n     *                       |  ‘`’ { charNoBackQuoteOrNewline | UnicodeEscape | charEscapeSeq\n     */\n    identifier: $ =>\n      choice($._alpha_identifier, $._backquoted_id, $._soft_identifier),\n\n    // https://docs.scala-lang.org/scala3/reference/soft-modifier.html\n    _soft_identifier: $ =>\n      prec(\n        \"soft_id\",\n        choice(\n          \"infix\",\n          \"inline\",\n          \"opaque\",\n          \"open\",\n          \"tracked\",\n          \"transparent\",\n          \"end\",\n        ),\n      ),\n\n    /**\n     * alphaid          ::=  upper idrest\n     *                       |  varid\n     * We approximate the above as:\n     * /[A-Za-z\\$_][A-Z\\$_a-z0-9]*(_[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~]+)?/,\n     *\n     * The following is more accurate, but the state count goes over the unsigned short int, and should be comparable.\n     * /([\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$][\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F0-9]*(_[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~]+)?|[\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F_][\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F0-9]*(_[\\-!#%&*+/\\\\:<=>?@\\u005e\\u007c~]+)?|[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~]+)|[\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F_][\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F0-9]*(_[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~]+)?/,\n     */\n    _alpha_identifier: $ =>\n      /[\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F\\$][\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\$\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F0-9\\$_\\p{Ll}]*(_[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]+)?/,\n\n    /**\n     * Despite what the lexical syntax suggests, the alphaid rule doesn't apply\n     * to identifiers that aren't in blocks in interpolated strings (e.g. $foo).\n     * A more accurate description is given in\n     * https://www.scala-lang.org/files/archive/spec/2.13/01-lexical-syntax.html\n     * where it states (regarding dollar sign escapes in interpolated strings) that\n     * \"\"\"\n     * The simpler form consists of a ‘$’-sign followed by an identifier starting\n     * with a letter and followed only by letters, digits, and underscore characters\n     * \"\"\"\n     * where \"letters\" does not include the $ character.\n     *\n     * This rule is similar to the _alpha_identifier rule, with the differences\n     * being that the $ character is excluded, along with the _(operator_chars)\n     * suffix and can be approximated as\n     * /[A-Za-z_][A-Z_a-z0-9]/;\n     */\n    _interpolation_identifier: $ =>\n      /[\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F][\\p{Lu}\\p{Lt}\\p{Nl}\\p{Lo}\\p{Lm}\\p{Ll}_\\u00AA\\u00BB\\u02B0-\\u02B8\\u02C0-\\u02C1\\u02E0-\\u02E4\\u037A\\u1D78\\u1D9B-\\u1DBF\\u2071\\u207F\\u2090-\\u209C\\u2C7C-\\u2C7D\\uA69C-\\uA69D\\uA770\\uA7F8-\\uA7F9\\uAB5C-\\uAB5F0-9_\\p{Ll}]*/,\n\n    _backquoted_id: $ => /`[^\\n`]+`/,\n\n    _identifier: $ => choice($.identifier, $.operator_identifier),\n\n    identifiers: $ => seq($.identifier, \",\", commaSep1($.identifier)),\n\n    wildcard: $ => \"_\",\n\n    // We have an asterisk as a separte rule to avoid premature choice of\n    // $.vararg branch over $.operator_identifier.\n    // Otherwise $.operator_identifier that is being declared as regexp\n    // looses by a lexical precedence to an explicitly defined literal \"*\".\n    _asterisk: $ => \"*\",\n\n    /**\n     * Regex patterns created to avoid matching // comments and /* comment starts.\n     * This could technically match illegal tokens such as val ?// = 1\n     */\n    operator_identifier: $ =>\n      choice(\n        $._asterisk,\n        token(\n          choice(\n            // opchar minus colon, equal, at\n            // Technically speaking, Sm (Math symbols https://www.compart.com/en/unicode/category/Sm)\n            // should be allowed as a single-character opchar, however, it includes `=`,\n            // so we should to avoid that to prevent bad parsing of `=` as infix term or type.\n            /[\\-!#%&*+\\/\\\\<>?\\u005e\\u007c~\\u00ac\\u00b1\\u00d7\\u00f7\\u2190-\\u2194\\p{So}]/,\n            seq(\n              // opchar minus slash\n              /[\\-!#%&*+\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]/,\n              // opchar*\n              repeat1(/[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]/),\n            ),\n            seq(\n              // opchar\n              /[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]/,\n              // opchar minus slash and asterisk\n              /[\\-!#%&+\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]/,\n              // opchar*\n              repeat(/[\\-!#%&*+\\/\\\\:<=>?@\\u005e\\u007c~\\p{Sm}\\p{So}]/),\n            ),\n          ),\n        ),\n      ),\n\n    _non_null_literal: $ =>\n      choice(\n        $.integer_literal,\n        $.floating_point_literal,\n        $.boolean_literal,\n        $.character_literal,\n        $.string,\n      ),\n\n    literal_type: $ => prec.left(PREC.type, $._non_null_literal),\n\n    literal: $ => choice($._non_null_literal, $.null_literal),\n\n    integer_literal: $ =>\n      token(\n        seq(\n          optional(/[-]/),\n          choice(/[\\d](_?\\d)*/, /0[xX][\\da-fA-F](_?[\\da-fA-F])*/),\n          optional(/[lL]/),\n        ),\n      ),\n\n    floating_point_literal: $ =>\n      token(\n        seq(\n          optional(/[-]/),\n          choice(\n            // digit {digit} ‘.’ digit {digit} [exponentPart] [floatType]\n            seq(/[\\d]+\\.[\\d]+/, optional(/[eE][+-]?[\\d]+/), optional(/[dfDF]/)),\n            // ‘.’ digit {digit} [exponentPart] [floatType]\n            seq(/\\.[\\d]+/, optional(/[eE][+-]?[\\d]+/), optional(/[dfDF]/)),\n            // digit {digit} exponentPart [floatType]\n            seq(/[\\d]+/, /[eE][+-]?[\\d]+/, optional(/[dfDF]/)),\n            // digit {digit} [exponentPart] floatType\n            seq(/[\\d]+/, optional(/[eE][+-]?[\\d]+/), /[dfDF]/),\n          ),\n        ),\n      ),\n\n    boolean_literal: $ => choice(\"true\", \"false\"),\n\n    character_literal: $ =>\n      token(\n        seq(\n          \"'\",\n          optional(\n            choice(\n              seq(\n                \"\\\\\",\n                choice(/[^xu]/, /[uU]+[0-9a-fA-F]{4}/, /x[0-9a-fA-F]{2}/),\n              ),\n              /[^\\\\'\\n]/,\n            ),\n          ),\n          \"'\",\n        ),\n      ),\n\n    interpolated_string_expression: $ =>\n      choice(\n        seq(\n          field(\"interpolator\", alias($._raw_string_start, $.identifier)),\n          alias($._raw_string, $.interpolated_string),\n        ),\n        seq(field(\"interpolator\", $.identifier), $.interpolated_string),\n      ),\n\n    _dollar_escape: $ =>\n      alias(token(seq(\"$\", choice(\"$\", '\"'))), $.escape_sequence),\n\n    _aliased_interpolation_identifier: $ =>\n      alias($._interpolation_identifier, $.identifier),\n\n    interpolation: $ =>\n      seq(\"$\", choice($._aliased_interpolation_identifier, $.block)),\n\n    interpolated_string: $ =>\n      choice(\n        seq(\n          token.immediate('\"'),\n          repeat(\n            seq(\n              $._interpolated_string_middle,\n              choice($._dollar_escape, $.interpolation, $.escape_sequence),\n            ),\n          ),\n          $._single_line_string_end,\n        ),\n        seq(\n          token.immediate('\"\"\"'),\n          repeat(\n            seq(\n              $._interpolated_multiline_string_middle,\n              // Multiline strings ignore escape sequences\n              choice($._dollar_escape, $.interpolation),\n            ),\n          ),\n          $._multiline_string_end,\n        ),\n      ),\n\n    // We need to handle single-line raw strings separately from interpolated strings,\n    // because raw strings are not parsed for escape sequences. For example, raw strings\n    // are often used for regular expressions, which contain backslashes that would\n    // be invalid if parsed as escape sequences. We do not special case multiline\n    // raw strings, because multiline strings do not parse escape sequences anyway.\n    // Scala handles multiline raw strings identically to other multiline interpolated,\n    // so we could parse them as interpolated strings, but I think the code is cleaner\n    // if we maintain the distinction.\n    _raw_string: $ =>\n      choice(\n        seq(\n          $._simple_string_start,\n          seq(\n            repeat(\n              seq(\n                $._raw_string_middle,\n                choice($._dollar_escape, $.interpolation),\n              ),\n            ),\n            $._single_line_string_end,\n          ),\n        ),\n        seq(\n          $._simple_multiline_string_start,\n          repeat(\n            seq(\n              $._raw_string_multiline_middle,\n              choice($._dollar_escape, $.interpolation),\n            ),\n          ),\n          $._multiline_string_end,\n        ),\n      ),\n\n    escape_sequence: _ =>\n      token.immediate(\n        seq(\n          \"\\\\\",\n          choice(\n            /[tbnrf\"'\\\\]/,\n            // The Java spec allows any number of u's and U's at the start of a unicode escape.\n            /[uU]+[0-9a-fA-F]{4}/,\n            // Octals are not allowed in Scala 3, but are allowed in Scala 2. tree-sitter\n            // does not have a mechanism for distinguishing between different versions of a\n            // language, so I think it makes sense to allow them. Maybe in the future we\n            // should move them to a `deprecated` syntax node?\n            /[0-3]?[0-7]{1,2}/,\n          ),\n        ),\n      ),\n\n    string: $ =>\n      choice(\n        seq(\n          $._simple_string_start,\n          repeat(seq($._simple_string_middle, $.escape_sequence)),\n          $._single_line_string_end,\n        ),\n        seq(\n          $._simple_multiline_string_start,\n          /// Multiline strings ignore escape sequences\n          $._multiline_string_end,\n        ),\n      ),\n\n    _semicolon: $ => choice(\";\", $._automatic_semicolon),\n\n    null_literal: $ => \"null\",\n\n    unit: $ => prec(PREC.unit, seq(\"(\", \")\")),\n\n    return_expression: $ => prec.left(seq(\"return\", optional($.expression))),\n\n    throw_expression: $ => prec.left(seq(\"throw\", $.expression)),\n\n    /*\n     *   Expr1             ::=  'while' '(' Expr ')' {nl} Expr\n     *                       |  'while' Expr 'do' Expr\n     */\n    while_expression: $ =>\n      prec(\n        PREC.while,\n        choice(\n          prec.right(\n            seq(\n              \"while\",\n              field(\"condition\", $.parenthesized_expression),\n              field(\"body\", $.expression),\n            ),\n          ),\n          prec.right(\n            seq(\n              \"while\",\n              field(\"condition\", seq($._indentable_expression, \"do\")),\n              field(\"body\", $._indentable_expression),\n            ),\n          ),\n        ),\n      ),\n\n    do_while_expression: $ =>\n      prec.right(\n        seq(\n          \"do\",\n          field(\"body\", $.expression),\n          \"while\",\n          field(\"condition\", $.parenthesized_expression),\n        ),\n      ),\n\n    /*\n     *  ForExpr           ::=  'for' '(' Enumerators0 ')' {nl} ['do' | 'yield'] Expr\n     *                      |  'for' '{' Enumerators0 '}' {nl} ['do' | 'yield'] Expr\n     *                      |  'for'     Enumerators0          ('do' | 'yield') Expr\n     */\n    for_expression: $ =>\n      choice(\n        prec.right(\n          PREC.control,\n          seq(\n            \"for\",\n            field(\n              \"enumerators\",\n              choice(\n                seq(\"(\", $.enumerators, \")\"),\n                seq(\"{\", $.enumerators, \"}\"),\n              ),\n            ),\n            choice(\n              seq(field(\"body\", $.expression)),\n              seq(\"yield\", field(\"body\", $._indentable_expression)),\n            ),\n          ),\n        ),\n        prec.right(\n          PREC.control,\n          seq(\n            \"for\",\n            field(\"enumerators\", $.enumerators),\n            choice(\n              seq(\"do\", field(\"body\", $._indentable_expression)),\n              seq(\"yield\", field(\"body\", $._indentable_expression)),\n            ),\n          ),\n        ),\n      ),\n\n    enumerators: $ =>\n      choice(\n        seq(sep1($._semicolon, $.enumerator), optional($._automatic_semicolon)),\n        seq(\n          $._indent,\n          sep1($._semicolon, $.enumerator),\n          optional($._automatic_semicolon),\n          $._outdent,\n        ),\n      ),\n\n    /**\n     *   Enumerator        ::=  Generator\n     *                       |  Guard {Guard}\n     *                       |  Pattern1 '=' Expr\n     */\n    enumerator: $ =>\n      choice(\n        seq(\n          optional(\"case\"),\n          $._pattern,\n          choice(\"<-\", \"=\"),\n          $.expression,\n          optional($.guard),\n        ),\n        repeat1($.guard),\n      ),\n\n    _shebang: $ => alias(token(seq(\"#!\", /.*/)), $.comment),\n\n    comment: $ => seq(token(\"//\"), choice($.using_directive, $._comment_text)),\n    _comment_text: $ => token(prec(PREC.comment, /.*/)),\n\n    using_directive: $ =>\n      seq(\n        token.immediate(prec(PREC.using_directive, \">\")),\n        token(\"using\"),\n        $.using_directive_key,\n        $.using_directive_value,\n      ),\n    using_directive_key: $ => token(/[^\\s]+/),\n    using_directive_value: $ => token(/.*/),\n\n    block_comment: $ =>\n      seq(token(\"/*\"), repeat(choice(token(/./), token(\"//\"))), token(\"*/\")),\n  },\n});\n\nfunction commaSep(rule) {\n  return optional(commaSep1(rule));\n}\n\nfunction commaSep1(rule) {\n  return sep1(\",\", rule);\n}\n\nfunction trailingCommaSep(rule) {\n  return optional(trailingCommaSep1(rule));\n}\n\nfunction trailingCommaSep1(rule) {\n  return trailingSep1(\",\", rule);\n}\n\nfunction trailingSep1(delimiter, rule) {\n  return seq(sep1(delimiter, rule), optional(delimiter));\n}\n\nfunction sep1(delimiter, rule) {\n  return seq(rule, repeat(seq(delimiter, rule)));\n}\n"
  },
  {
    "path": "package.json",
    "content": "{\n  \"name\": \"tree-sitter-scala\",\n  \"version\": \"0.26.0\",\n  \"description\": \"Scala grammar for tree-sitter\",\n  \"repository\": \"https://github.com/tree-sitter/tree-sitter-scala\",\n  \"license\": \"MIT\",\n  \"author\": {\n    \"name\": \"Max Brunsfeld\",\n    \"email\": \"maxbrunsfeld@gmail.com\"\n  },\n  \"main\": \"bindings/node\",\n  \"types\": \"bindings/node\",\n  \"keywords\": [\n    \"incremental\",\n    \"parsing\",\n    \"tree-sitter\",\n    \"scala\"\n  ],\n  \"files\": [\n    \"grammar.js\",\n    \"tree-sitter.json\",\n    \"binding.gyp\",\n    \"prebuilds/**\",\n    \"bindings/node/*\",\n    \"queries/*\",\n    \"src/**\",\n    \"*.wasm\"\n  ],\n  \"dependencies\": {\n    \"node-addon-api\": \"^8.2.2\",\n    \"node-gyp-build\": \"^4.8.2\"\n  },\n  \"devDependencies\": {\n    \"prebuildify\": \"^6.0.1\",\n    \"tree-sitter-cli\": \"^0.26.8\",\n    \"prettier\": \"3.3.3\"\n  },\n  \"peerDependencies\": {\n    \"tree-sitter\": \"^0.21.1\"\n  },\n  \"peerDependenciesMeta\": {\n    \"tree-sitter\": {\n      \"optional\": true\n    }\n  },\n  \"scripts\": {\n    \"install\": \"node-gyp-build\",\n    \"prestart\": \"tree-sitter build --wasm\",\n    \"start\": \"tree-sitter playground\",\n    \"test\": \"node --test bindings/node/*_test.js\",\n    \"prebuildify\": \"prebuildify --napi --strip\"\n  }\n}\n"
  },
  {
    "path": "pyproject.toml",
    "content": "[build-system]\nrequires = [\"setuptools>=42\", \"wheel\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[project]\nname = \"tree-sitter-scala\"\ndescription = \"Scala grammar for tree-sitter\"\nversion = \"0.26.0\"\nkeywords = [\"incremental\", \"parsing\", \"tree-sitter\", \"scala\"]\nclassifiers = [\n  \"Intended Audience :: Developers\",\n  \"License :: OSI Approved :: MIT License\",\n  \"Topic :: Software Development :: Compilers\",\n  \"Topic :: Text Processing :: Linguistic\",\n  \"Typing :: Typed\",\n]\nauthors = [{ name = \"Max Brunsfeld\", email = \"maxbrunsfeld@gmail.com\" }]\nrequires-python = \">=3.9\"\nlicense.text = \"MIT\"\nreadme = \"README.md\"\n\n[project.urls]\nHomepage = \"https://github.com/tree-sitter/tree-sitter-scala\"\n\n[project.optional-dependencies]\ncore = [\"tree-sitter~=0.22\"]\n\n[tool.cibuildwheel]\nbuild = \"cp39-*\"\nbuild-frontend = \"build\"\n"
  },
  {
    "path": "queries/highlights.scm",
    "content": "; CREDITS @stumash (stuart.mashaal@gmail.com)\n\n(field_expression field: (identifier) @property)\n(field_expression value: (identifier) @type\n (#match? @type \"^[A-Z]\"))\n\n(type_identifier) @type\n\n(class_definition\n  name: (identifier) @type)\n\n(enum_definition\n  name: (identifier) @type)\n\n(object_definition\n  name: (identifier) @type)\n\n(trait_definition\n  name: (identifier) @type)\n\n(full_enum_case\n  name: (identifier) @type)\n\n(simple_enum_case\n  name: (identifier) @type)\n\n;; variables\n\n(class_parameter\n  name: (identifier) @parameter)\n\n(self_type (identifier) @parameter)\n\n(interpolation (identifier) @none)\n(interpolation (block) @none)\n\n;; types\n\n(type_definition\n  name: (type_identifier) @type.definition)\n\n;; val/var definitions/declarations\n\n(val_definition\n  pattern: (identifier) @variable)\n\n(var_definition\n  pattern: (identifier) @variable)\n\n(val_declaration\n  name: (identifier) @variable)\n\n(var_declaration\n  name: (identifier) @variable)\n\n; imports/exports\n\n(import_declaration\n  path: (identifier) @namespace)\n((stable_identifier (identifier) @namespace))\n\n((import_declaration\n  path: (identifier) @type) (#match? @type \"^[A-Z]\"))\n((stable_identifier (identifier) @type) (#match? @type \"^[A-Z]\"))\n\n(export_declaration\n  path: (identifier) @namespace)\n((stable_identifier (identifier) @namespace))\n\n((export_declaration\n  path: (identifier) @type) (#match? @type \"^[A-Z]\"))\n((stable_identifier (identifier) @type) (#match? @type \"^[A-Z]\"))\n\n((namespace_selectors (identifier) @type) (#match? @type \"^[A-Z]\"))\n\n; method invocation\n\n(call_expression\n  function: (identifier) @function.call)\n\n(call_expression\n  function: (operator_identifier) @function.call)\n\n(call_expression\n  function: (field_expression\n    field: (identifier) @method.call))\n\n((call_expression\n   function: (identifier) @constructor)\n (#match? @constructor \"^[A-Z]\"))\n\n(generic_function\n  function: (identifier) @function.call)\n\n(interpolated_string_expression\n  interpolator: (identifier) @function.call)\n\n; function definitions\n\n(function_definition\n  name: (identifier) @function)\n\n(parameter\n  name: (identifier) @parameter)\n\n(binding\n  name: (identifier) @parameter)\n\n; method definition\n\n(function_declaration\n      name: (identifier) @method)\n\n(function_definition\n      name: (identifier) @method)\n\n; expressions\n\n(infix_expression operator: (identifier) @operator)\n(infix_expression operator: (operator_identifier) @operator)\n(infix_type operator: (operator_identifier) @operator)\n(infix_type operator: (operator_identifier) @operator)\n\n; literals\n\n(boolean_literal) @boolean\n(integer_literal) @number\n(floating_point_literal) @float\n\n[\n  (string)\n  (character_literal)\n  (interpolated_string_expression)\n] @string\n\n(interpolation \"$\" @punctuation.special)\n\n;; keywords\n\n(opaque_modifier) @type.qualifier\n(infix_modifier) @keyword\n(transparent_modifier) @type.qualifier\n(open_modifier) @type.qualifier\n\n[\n  \"case\"\n  \"class\"\n  \"enum\"\n  \"extends\"\n  \"derives\"\n  \"finally\"\n;; `forSome` existential types not implemented yet\n;; `macro` not implemented yet\n  \"object\"\n  \"override\"\n  \"package\"\n  \"trait\"\n  \"type\"\n  \"val\"\n  \"var\"\n  \"with\"\n  \"given\"\n  \"using\"\n  \"end\"\n  \"implicit\"\n  \"extension\"\n  \"with\"\n] @keyword\n\n[\n  \"abstract\"\n  \"final\"\n  \"lazy\"\n  \"sealed\"\n  \"private\"\n  \"protected\"\n] @type.qualifier\n\n(inline_modifier) @storageclass\n\n(null_literal) @constant.builtin\n\n(wildcard) @parameter\n\n(annotation) @attribute\n\n;; special keywords\n\n\"new\" @keyword.operator\n\n[\n  \"else\"\n  \"if\"\n  \"match\"\n  \"then\"\n] @conditional\n\n[\n \"(\"\n \")\"\n \"[\"\n \"]\"\n \"{\"\n \"}\"\n]  @punctuation.bracket\n\n[\n \".\"\n \",\"\n] @punctuation.delimiter\n\n[\n  \"do\"\n  \"for\"\n  \"while\"\n  \"yield\"\n] @repeat\n\n\"def\" @keyword.function\n\n[\n \"=>\"\n \"<-\"\n \"@\"\n] @operator\n\n[\"import\" \"export\"] @include\n\n[\n  \"try\"\n  \"catch\"\n  \"throw\"\n] @exception\n\n\"return\" @keyword.return\n\n(comment) @spell @comment\n(block_comment) @spell @comment\n\n;; `case` is a conditional keyword in case_block\n\n(case_block\n  (case_clause (\"case\") @conditional))\n(indented_cases\n  (case_clause (\"case\") @conditional))\n\n(operator_identifier) @operator\n\n((identifier) @type (#match? @type \"^[A-Z]\"))\n((identifier) @variable.builtin\n (#match? @variable.builtin \"^this$\"))\n\n(\n  (identifier) @function.builtin\n  (#match? @function.builtin \"^super$\")\n)\n\n;; Scala CLI using directives\n(using_directive_key) @parameter\n(using_directive_value) @string\n"
  },
  {
    "path": "queries/indents.scm",
    "content": "; These indent queries adhere to nvim-tree-sytter syntax.\n; See `nvim-tree-sitter-indentation-mod` vim help page.\n\n[\n  (template_body)\n  (block)\n  (parameters)\n  (arguments)\n  (match_expression)\n  (splice_expression)\n  (import_declaration)\n  (function_definition)\n  (ERROR \":\")\n  (ERROR \"=\")\n  (\"match\")\n  (\":\")\n  (\"=\")\n] @indent.begin\n\n(arguments \")\" @indent.end)\n\n\"}\" @indent.end\n\n\"end\" @indent.end\n\n[\n  \")\"\n  \"]\"\n  \"}\"\n] @indent.branch\n"
  },
  {
    "path": "queries/locals.scm",
    "content": "(template_body) @local.scope\n(lambda_expression) @local.scope\n\n\n(function_declaration\n      name: (identifier) @local.definition) @local.scope\n\n(function_definition\n      name: (identifier) @local.definition)\n\n(parameter\n  name: (identifier) @local.definition)\n\n(binding\n  name: (identifier) @local.definition)\n\n(val_definition\n  pattern: (identifier) @local.definition)\n\n(var_definition\n  pattern: (identifier) @local.definition)\n\n(val_declaration\n  name: (identifier) @local.definition)\n\n(var_declaration\n  name: (identifier) @local.definition)\n\n(identifier) @local.reference\n\n"
  },
  {
    "path": "queries/tags.scm",
    "content": "; Definitions\n\n(package_clause\n  name: (package_identifier) @name) @definition.module\n\n(trait_definition\n  name: (identifier) @name) @definition.interface\n\n(enum_definition\n  name: (identifier) @name) @definition.enum\n\n(simple_enum_case\n  name: (identifier) @name) @definition.class\n\n(full_enum_case\n  name: (identifier) @name) @definition.class\n\n(class_definition\n  name: (identifier) @name) @definition.class\n\n(object_definition\n  name: (identifier) @name) @definition.object\n\n(function_definition\n  name: (identifier) @name) @definition.function\n\n(val_definition\n  pattern: (identifier) @name) @definition.variable\n\n(given_definition\n  name: (identifier) @name) @definition.variable\n\n(var_definition\n  pattern: (identifier) @name) @definition.variable\n\n(val_declaration\n  name: (identifier) @name) @definition.variable\n\n(var_declaration\n  name: (identifier) @name) @definition.variable\n\n(type_definition\n  name: (type_identifier) @name) @definition.type\n\n(class_parameter\n  name: (identifier) @name) @definition.property\n\n; References \n\n(call_expression\n  (identifier) @name) @reference.call\n\n(instance_expression\n  (type_identifier) @name) @reference.interface\n\n(instance_expression\n  (generic_type\n    (type_identifier) @name)) @reference.interface\n\n(extends_clause\n  (type_identifier) @name) @reference.class\n\n(extends_clause\n  (generic_type\n    (type_identifier) @name)) @reference.class\n\n"
  },
  {
    "path": "script/parse-with-scalac",
    "content": "#!/bin/bash\n\n# scalac -Yshow-trees -Xprint:parser $@\nscalac -Yshow-trees -Xprint:typer $@\n"
  },
  {
    "path": "script/smoke_test.sh",
    "content": "#!/bin/bash -e\n\n# This is an integration test to generally check the quality of parsing.\n\nSCALA_SCALA_LIBRARY_EXPECTED=100\nSCALA_SCALA_COMPILER_EXPECTED=100\nDOTTY_COMPILER_EXPECTED=93\nLILA_MODULES_EXPECTED=99\nSYNTAX_COMPLEXITY_CEILING=1800\nPARSER_MAX_SIZE_MB=33\n\nif [ ! -d \"$SCALA_SCALA_DIR\" ]; then\n  echo \"\\$SCALA_SCALA_DIR must be set\"\n  exit 1\nfi\n\nif [ ! -d \"$DOTTY_DIR\" ]; then\n  echo \"\\$DOTTY_DIR must be set\"\n  exit 1\nfi\n\ncheck_parser_size () {\n  local max_size_mb=$1\n  local max_size=$(($max_size_mb * 1024 * 1024))\n  local actual_size=$(stat -c%s src/parser.c)\n  local actual_size_mb=$(echo \"scale=2; $actual_size / 1024 / 1024\" | bc)\n  if [ \"$actual_size\" -gt \"$max_size\" ]; then\n    echo -e \"::error file=src/parser.c::Parser size (${actual_size_mb}M) exceeds maximum allowed size (${max_size_mb}M)\"\n    failed=$((failed + 1))\n  else\n    echo -e \"::notice file=src/parser.c::Parser size: ${actual_size_mb}M / ${max_size_mb}M\"\n  fi\n}\n\nfailed=0\n\nrun_tree_sitter () {\n  local source_dir=$1\n  local expected=$2\n  local name=$3\n  local files=$(find \"$source_dir\" -name '*.scala' -type f | tr '\\n' ' ')\n  cmd=\"npm exec -c 'tree-sitter parse $files --quiet --stat' | sort | sed 's%$source_dir%%g'\"\n  echo\n  echo \"Parse $source_dir: $cmd\"\n  out=$( (eval \"$cmd\") || true)\n\n  if [ ! -e \"$PRODUCE_REPORTS\" ]; then\n    local report_file=\"report-$name.txt\"\n    echo \"$out\" | sed G | sed -E 's/([0-9]+) ms//' | grep -v 'success percentage' > \"report-$name.txt\"\n    echo \"Report written to $report_file\"\n  fi\n\n  actual=$(echo \"$out\" | grep 'success percentage:' | rev | cut -d' ' -f5 | rev | sed 's/;//g' | sed 's/%//g' )\n  echo \"$actual\"\n  if (( $(echo \"$actual >= $expected\" |bc -l) )); then\n    # See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-creating-an-annotation-for-an-error\n    echo -e \"::notice file=grammar.js,line=1::ok, ${source_dir}: ${actual}%, expected at least $expected%\"\n  else\n    echo -e \"::error file=grammar.js,line=1::${source_dir}: expected ${expected}, but got ${actual} instead\"\n    failed=$((failed + 1))\n  fi\n}\n\ncheck_complexity () {\n  local expected=$1\n  name=\"complexity\"\n  cmd=\"npm exec -c 'tree-sitter generate --report-states-for-rule compilation_unit' 2>&1 >/dev/null\"\n  echo\n  echo \"Checking syntax complexity: $cmd\"\n  out=$( (eval \"$cmd\") || true)\n\n  if [ ! -e \"$PRODUCE_REPORTS\" ]; then\n    local report_file=\"report-$name.txt\"\n    echo \"$out\" > \"report-$name.txt\"\n    echo \"Report written to $report_file\"\n  fi\n\n  out1=$(echo \"$out\" | grep -v \"ExperimentalWarning\" | grep -v \"experimental\" | grep -v \"node\")\n  top=$(echo \"$out1\" | head -n 1 | sed 's/ \\+/ /g')\n  top_definition=$(echo \"$top\" | cut -d' ' -f1)\n  top_definition_line=$(grep -n \"$top_definition:\" grammar.js | head -n 1 | cut -d : -f 1)\n  actual=$(echo \"$top\" | cut -d' ' -f2)\n  echo \"$top_definition $actual\"\n  if (( $(echo \"$actual < $expected\" |bc -l) )); then\n    # See https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#example-creating-an-annotation-for-an-error\n    echo -e \"::notice file=grammar.js,line=$top_definition_line::ok, complexity of the most complex definition ${top_definition}: ${actual}, lower than the allowed ceiling $expected\"\n  else\n    echo -e \"::error file=grammar.js,line=$top_definition_line::complexity of the most complex definition ${top_definition}: ${actual}, higher than the allowed ceiling $expected\"\n    failed=$((failed + 1))\n  fi\n}\n\ncheck_parser_size $PARSER_MAX_SIZE_MB\n\nrun_tree_sitter \"$SCALA_SCALA_DIR/src/library/\"  $SCALA_SCALA_LIBRARY_EXPECTED   scala2-library\nrun_tree_sitter \"$SCALA_SCALA_DIR/src/compiler/\" $SCALA_SCALA_COMPILER_EXPECTED  scala2-compiler\nrun_tree_sitter \"$DOTTY_DIR/compiler/\"           $DOTTY_COMPILER_EXPECTED        dotty-compiler\nrun_tree_sitter \"$LILA_DIR/modules/\"             $LILA_MODULES_EXPECTED          lila-modules\n\ncheck_complexity $SYNTAX_COMPLEXITY_CEILING\n\nif (( failed > 0 )); then\n  exit 1\nfi\n"
  },
  {
    "path": "setup.py",
    "content": "from os.path import isdir, join\nfrom platform import system\n\nfrom setuptools import Extension, find_packages, setup\nfrom setuptools.command.build import build\nfrom wheel.bdist_wheel import bdist_wheel\n\n\nclass Build(build):\n    def run(self):\n        if isdir(\"queries\"):\n            dest = join(self.build_lib, \"tree_sitter_scala\", \"queries\")\n            self.copy_tree(\"queries\", dest)\n        super().run()\n\n\nclass BdistWheel(bdist_wheel):\n    def get_tag(self):\n        python, abi, platform = super().get_tag()\n        if python.startswith(\"cp\"):\n            python, abi = \"cp39\", \"abi3\"\n        return python, abi, platform\n\n\nsetup(\n    packages=find_packages(\"bindings/python\"),\n    package_dir={\"\": \"bindings/python\"},\n    package_data={\n        \"tree_sitter_scala\": [\"*.pyi\", \"py.typed\"],\n        \"tree_sitter_scala.queries\": [\"*.scm\"],\n    },\n    ext_package=\"tree_sitter_scala\",\n    ext_modules=[\n        Extension(\n            name=\"_binding\",\n            sources=[\n                \"bindings/python/tree_sitter_scala/binding.c\",\n                \"src/parser.c\",\n                \"src/scanner.c\",\n            ],\n            extra_compile_args=[\n                \"-std=c11\",\n                \"-fvisibility=hidden\",\n            ] if system() != \"Windows\" else [\n                \"/std:c11\",\n                \"/utf-8\",\n            ],\n            define_macros=[\n                (\"Py_LIMITED_API\", \"0x03090000\"),\n                (\"PY_SSIZE_T_CLEAN\", None),\n                (\"TREE_SITTER_HIDE_SYMBOLS\", None),\n            ],\n            include_dirs=[\"src\"],\n            py_limited_api=True,\n        )\n    ],\n    cmdclass={\n        \"build\": Build,\n        \"bdist_wheel\": BdistWheel\n    },\n    zip_safe=False\n)\n"
  },
  {
    "path": "src/grammar.json",
    "content": "{\n  \"$schema\": \"https://tree-sitter.github.io/tree-sitter/assets/schemas/grammar.schema.json\",\n  \"name\": \"scala\",\n  \"word\": \"_alpha_identifier\",\n  \"rules\": {\n    \"compilation_unit\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_shebang\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_top_level_definition\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_semicolon\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_top_level_definition\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_semicolon\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_top_level_definition\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_end_marker\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"expression\"\n        }\n      ]\n    },\n    \"_definition\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"given_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"extension_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"class_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"import_declaration\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"export_declaration\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"object_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"enum_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"trait_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"val_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"val_declaration\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"var_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"var_declaration\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"type_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"function_definition\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"function_declaration\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"package_clause\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"package_object\"\n        }\n      ]\n    },\n    \"enum_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"enum\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_class_constructor\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"extend\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"extends_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"derive\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"derives_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"body\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"enum_body\"\n          }\n        }\n      ]\n    },\n    \"_enum_block\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"enum_case_definitions\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"expression\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_definition\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_semicolon\"\n                    },\n                    {\n                      \"type\": \"CHOICE\",\n                      \"members\": [\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"enum_case_definitions\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"expression\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_definition\"\n                        }\n                      ]\n                    }\n                  ]\n                }\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_semicolon\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"enum_body\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \":\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_indent\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_enum_block\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_outdent\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"{\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_enum_block\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"enum_case_definitions\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"case\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"simple_enum_case\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"simple_enum_case\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"full_enum_case\"\n            }\n          ]\n        }\n      ]\n    },\n    \"simple_enum_case\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"extend\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"extends_clause\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"full_enum_case\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_full_enum_def\"\n        }\n      ]\n    },\n    \"_full_enum_def\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type_parameters\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"type_parameters\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"class_parameters\",\n          \"content\": {\n            \"type\": \"REPEAT1\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"class_parameters\"\n            }\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"extend\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"extends_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"package_clause\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"package\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"package_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"template_body\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"package_identifier\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          },\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \".\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_identifier\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"package_object\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"package\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"object\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_object_definition\"\n        }\n      ]\n    },\n    \"import_declaration\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"import\"\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_namespace_expression\"\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_namespace_expression\"\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"export_declaration\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"export\"\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_namespace_expression\"\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_namespace_expression\"\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_namespace_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"path\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_identifier\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \".\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_identifier\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                }\n              },\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \".\"\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"namespace_wildcard\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"namespace_selectors\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"as_renamed_identifier\"\n                          }\n                        ]\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"BLANK\"\n                  }\n                ]\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"as_renamed_identifier\"\n          }\n        ]\n      }\n    },\n    \"namespace_wildcard\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"*\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"_\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"given\"\n          }\n        ]\n      }\n    },\n    \"_namespace_given_by_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"given\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_type\"\n        }\n      ]\n    },\n    \"namespace_selectors\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"{\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_namespace_given_by_type\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"namespace_wildcard\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_identifier\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"arrow_renamed_identifier\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"as_renamed_identifier\"\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_namespace_given_by_type\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"namespace_wildcard\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_identifier\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"arrow_renamed_identifier\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"as_renamed_identifier\"\n                          }\n                        ]\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"}\"\n        }\n      ]\n    },\n    \"_import_selectors\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"SYMBOL\",\n        \"name\": \"namespace_selectors\"\n      },\n      \"named\": true,\n      \"value\": \"import_selectors\"\n    },\n    \"arrow_renamed_identifier\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=>\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"alias\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"wildcard\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"as_renamed_identifier\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"as\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"alias\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"wildcard\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"object_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"case\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"object\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_object_definition\"\n        }\n      ]\n    },\n    \"_object_definition\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"extend\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"extends_clause\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"derive\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"derives_clause\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_definition_body\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"class_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"case\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"class\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_class_definition\"\n        }\n      ]\n    },\n    \"_class_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_class_constructor\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"extend\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"extends_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"derive\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"derives_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"body\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_definition_body\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"_definition_body\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_automatic_semicolon\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"body\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"template_body\"\n          }\n        }\n      ]\n    },\n    \"_class_constructor\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type_parameters\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"type_parameters\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"ALIAS\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_constructor_annotation\"\n              },\n              \"named\": true,\n              \"value\": \"annotation\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"access_modifier\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"class_parameters\",\n          \"content\": {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_automatic_semicolon\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"class_parameters\"\n                }\n              ]\n            }\n          }\n        }\n      ]\n    },\n    \"trait_definition\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"modifiers\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"trait\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_class_definition\"\n          }\n        ]\n      }\n    },\n    \"type_parameters\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"[\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_variant_type_parameter\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_variant_type_parameter\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        }\n      ]\n    },\n    \"_variant_type_parameter\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"covariant_type_parameter\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"contravariant_type_parameter\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_type_parameter\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"type_lambda\"\n            }\n          ]\n        }\n      ]\n    },\n    \"covariant_type_parameter\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"+\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_type_parameter\"\n        }\n      ]\n    },\n    \"contravariant_type_parameter\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"-\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_type_parameter\"\n        }\n      ]\n    },\n    \"_type_parameter\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"wildcard\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type_parameters\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"type_parameters\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"bound\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"lower_bound\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"bound\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"upper_bound\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"bound\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"view_bound\"\n                }\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"bound\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_context_bounds\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"upper_bound\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"<:\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"lower_bound\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \">:\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"view_bound\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"<%\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"_context_bounds\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT1\",\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \":\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"context_bound\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \":\"\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"{\"\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"context_bound\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"context_bound\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"context_bound\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"as\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"name\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_identifier\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"template_body\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_indented_template_body\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_braced_template_body\"\n        }\n      ]\n    },\n    \"_indented_template_body\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indent\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"self_type\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_block\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_outdent\"\n          }\n        ]\n      }\n    },\n    \"_braced_template_body\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"{\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_braced_template_body1\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_braced_template_body2\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"}\"\n          }\n        ]\n      }\n    },\n    \"_braced_template_body1\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"self_type\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_block\"\n        }\n      ]\n    },\n    \"_braced_template_body2\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_indent\"\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"self_type\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"self_type\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_indent\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_block\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_outdent\"\n        }\n      ]\n    },\n    \"with_template_body\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_indent\"\n              },\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"self_type\"\n                  },\n                  {\n                    \"type\": \"BLANK\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_block\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_outdent\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"{\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_block\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_extension_template_body\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_indent\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_block\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_outdent\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"{\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_block\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_end_marker\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": \"end\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"end\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"if\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"while\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"for\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"match\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"try\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"new\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"this\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"given\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"extension\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"val\"\n              },\n              {\n                \"type\": \"ALIAS\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_identifier\"\n                },\n                \"named\": false,\n                \"value\": \"_end_ident\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"self_type\": {\n      \"type\": \"PREC_DYNAMIC\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"PREC\",\n        \"value\": \"self_type\",\n        \"content\": {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_identifier\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"wildcard\"\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_self_type_ascription\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"=>\"\n            }\n          ]\n        }\n      }\n    },\n    \"_self_type_ascription\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_type\"\n        }\n      ]\n    },\n    \"annotation\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": \"annotation\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"@\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_type\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"arguments\",\n            \"content\": {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"PREC\",\n                \"value\": \"annotation\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"arguments\"\n                }\n              }\n            }\n          }\n        ]\n      }\n    },\n    \"_constructor_annotation\": {\n      \"type\": \"PREC\",\n      \"value\": \"annotation\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"@\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_type\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"ALIAS\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"IMMEDIATE_TOKEN\",\n                      \"content\": {\n                        \"type\": \"STRING\",\n                        \"value\": \"(\"\n                      }\n                    },\n                    {\n                      \"type\": \"CHOICE\",\n                      \"members\": [\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_exprs_in_parens\"\n                        },\n                        {\n                          \"type\": \"BLANK\"\n                        }\n                      ]\n                    },\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \")\"\n                    }\n                  ]\n                },\n                \"named\": true,\n                \"value\": \"arguments\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"val_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_start_val\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"pattern\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_pattern\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"identifiers\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \":\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"type\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_type\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"value\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indentable_expression\"\n          }\n        }\n      ]\n    },\n    \"val_declaration\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_start_val\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"name\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              }\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \",\"\n                  },\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"name\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_identifier\"\n                    }\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"_start_val\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"val\"\n        }\n      ]\n    },\n    \"var_declaration\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_start_var\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"name\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              }\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \",\"\n                  },\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"name\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_identifier\"\n                    }\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \":\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"var_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_start_var\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"pattern\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_pattern\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"identifiers\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \":\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"type\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_type\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"value\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indentable_expression\"\n          }\n        }\n      ]\n    },\n    \"_start_var\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"var\"\n        }\n      ]\n    },\n    \"type_definition\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"modifiers\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"opaque_modifier\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type_constructor\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"=\"\n                  },\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"type\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_type\"\n                    }\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_type_constructor\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_type_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type_parameters\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"type_parameters\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"bound\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"lower_bound\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"bound\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"upper_bound\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"bound\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_context_bounds\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"function_definition\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_function_declaration\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"=\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"body\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_indentable_expression\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"body\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"block\"\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"function_declaration\": {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_function_declaration\"\n    },\n    \"_function_declaration\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"modifiers\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"def\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_function_constructor\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \":\"\n                  },\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"return_type\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_type\"\n                    }\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_function_constructor\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"parameters\",\n            \"content\": {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_automatic_semicolon\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"parameters\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"type_parameters\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_automatic_semicolon\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"opaque_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"opaque\"\n      }\n    },\n    \"extension_definition\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"extension\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type_parameters\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"type_parameters\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"parameters\",\n            \"content\": {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"parameters\"\n              }\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_extension_template_body\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"function_definition\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"function_declaration\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"given_definition\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"modifiers\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"given\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_given_constructor\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_given_sig\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"return_type\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_structural_instance\"\n                }\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"return_type\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_annotated_type\"\n                    }\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \"=\"\n                          },\n                          {\n                            \"type\": \"FIELD\",\n                            \"name\": \"body\",\n                            \"content\": {\n                              \"type\": \"SYMBOL\",\n                              \"name\": \"_indentable_expression\"\n                            }\n                          }\n                        ]\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_given_sig\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_given_conditional\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=>\"\n        }\n      ]\n    },\n    \"_given_conditional\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"ALIAS\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"parameters\"\n          },\n          \"named\": true,\n          \"value\": \"given_conditional\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"type_parameters\"\n        }\n      ]\n    },\n    \"_given_constructor\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_identifier\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type_parameters\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"type_parameters\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"parameters\",\n            \"content\": {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_automatic_semicolon\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"parameters\"\n                  }\n                ]\n              }\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_automatic_semicolon\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          }\n        ]\n      }\n    },\n    \"_structural_instance\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 7,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_constructor_application\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \":\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"with\"\n              }\n            ]\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"with_template_body\"\n            }\n          }\n        ]\n      }\n    },\n    \"_constructor_application\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": \"constructor_application\",\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_annotated_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"compound_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_structural_type\"\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_simple_type\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"arguments\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"arguments\"\n                }\n              }\n            ]\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_annotated_type\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"arguments\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"arguments\"\n                }\n              }\n            ]\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"compound_type\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"arguments\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"arguments\"\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_constructor_applications\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_constructor_application\"\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_constructor_application\"\n                    }\n                  ]\n                }\n              }\n            ]\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_constructor_application\"\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \"with\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_constructor_application\"\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"modifiers\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"REPEAT1\",\n        \"content\": {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 0,\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"abstract\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"final\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"sealed\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"implicit\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"lazy\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"override\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"access_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"inline_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"infix_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"into_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"open_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"tracked_modifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"transparent_modifier\"\n              }\n            ]\n          }\n        }\n      }\n    },\n    \"access_modifier\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"private\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"protected\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"access_qualifier\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"access_qualifier\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"[\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_identifier\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        }\n      ]\n    },\n    \"inline_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"inline\"\n      }\n    },\n    \"infix_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"infix\"\n      }\n    },\n    \"into_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"into\"\n      }\n    },\n    \"open_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"open\"\n      }\n    },\n    \"tracked_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"tracked\"\n      }\n    },\n    \"transparent_modifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"mod\",\n      \"content\": {\n        \"type\": \"STRING\",\n        \"value\": \"transparent\"\n      }\n    },\n    \"extends_clause\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"extends\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_constructor_applications\"\n            }\n          },\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"arguments\"\n            }\n          }\n        ]\n      }\n    },\n    \"derives_clause\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"derives\"\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"type\",\n                \"content\": {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_type_identifier\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"stable_type_identifier\"\n                    }\n                  ]\n                }\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"FIELD\",\n                      \"name\": \"type\",\n                      \"content\": {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_type_identifier\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"stable_type_identifier\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"class_parameters\": {\n      \"type\": \"PREC\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_automatic_semicolon\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"(\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"using\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SEQ\",\n                            \"members\": [\n                              {\n                                \"type\": \"SYMBOL\",\n                                \"name\": \"class_parameter\"\n                              },\n                              {\n                                \"type\": \"REPEAT\",\n                                \"content\": {\n                                  \"type\": \"SEQ\",\n                                  \"members\": [\n                                    {\n                                      \"type\": \"STRING\",\n                                      \"value\": \",\"\n                                    },\n                                    {\n                                      \"type\": \"SYMBOL\",\n                                      \"name\": \"class_parameter\"\n                                    }\n                                  ]\n                                }\n                              }\n                            ]\n                          },\n                          {\n                            \"type\": \"CHOICE\",\n                            \"members\": [\n                              {\n                                \"type\": \"STRING\",\n                                \"value\": \",\"\n                              },\n                              {\n                                \"type\": \"BLANK\"\n                              }\n                            ]\n                          }\n                        ]\n                      },\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SEQ\",\n                            \"members\": [\n                              {\n                                \"type\": \"SYMBOL\",\n                                \"name\": \"_param_type\"\n                              },\n                              {\n                                \"type\": \"REPEAT\",\n                                \"content\": {\n                                  \"type\": \"SEQ\",\n                                  \"members\": [\n                                    {\n                                      \"type\": \"STRING\",\n                                      \"value\": \",\"\n                                    },\n                                    {\n                                      \"type\": \"SYMBOL\",\n                                      \"name\": \"_param_type\"\n                                    }\n                                  ]\n                                }\n                              }\n                            ]\n                          },\n                          {\n                            \"type\": \"CHOICE\",\n                            \"members\": [\n                              {\n                                \"type\": \"STRING\",\n                                \"value\": \",\"\n                              },\n                              {\n                                \"type\": \"BLANK\"\n                              }\n                            ]\n                          }\n                        ]\n                      }\n                    ]\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"implicit\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SEQ\",\n                            \"members\": [\n                              {\n                                \"type\": \"SYMBOL\",\n                                \"name\": \"class_parameter\"\n                              },\n                              {\n                                \"type\": \"REPEAT\",\n                                \"content\": {\n                                  \"type\": \"SEQ\",\n                                  \"members\": [\n                                    {\n                                      \"type\": \"STRING\",\n                                      \"value\": \",\"\n                                    },\n                                    {\n                                      \"type\": \"SYMBOL\",\n                                      \"name\": \"class_parameter\"\n                                    }\n                                  ]\n                                }\n                              }\n                            ]\n                          },\n                          {\n                            \"type\": \"CHOICE\",\n                            \"members\": [\n                              {\n                                \"type\": \"STRING\",\n                                \"value\": \",\"\n                              },\n                              {\n                                \"type\": \"BLANK\"\n                              }\n                            ]\n                          }\n                        ]\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \")\"\n          }\n        ]\n      }\n    },\n    \"parameters\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"(\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"implicit\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SEQ\",\n                      \"members\": [\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"parameter\"\n                        },\n                        {\n                          \"type\": \"REPEAT\",\n                          \"content\": {\n                            \"type\": \"SEQ\",\n                            \"members\": [\n                              {\n                                \"type\": \"STRING\",\n                                \"value\": \",\"\n                              },\n                              {\n                                \"type\": \"SYMBOL\",\n                                \"name\": \"parameter\"\n                              }\n                            ]\n                          }\n                        }\n                      ]\n                    },\n                    {\n                      \"type\": \"CHOICE\",\n                      \"members\": [\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \",\"\n                        },\n                        {\n                          \"type\": \"BLANK\"\n                        }\n                      ]\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \")\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_using_parameters_clause\"\n        }\n      ]\n    },\n    \"_using_parameters_clause\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"using\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"parameter\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"parameter\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_param_type\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_param_type\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"class_parameter\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotation\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"modifiers\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"val\"\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"var\"\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"name\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \":\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"type\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_param_type\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"=\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"default_value\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"expression\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"parameter\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"REPEAT\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"inline_modifier\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_param_type\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"=\"\n                  },\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"default_value\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"expression\"\n                    }\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"name_and_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_param_type\"\n            }\n          }\n        ]\n      }\n    },\n    \"_block\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"expression\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_definition\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_end_marker\"\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \";\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"REPEAT\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"_semicolon\"\n                    },\n                    {\n                      \"type\": \"CHOICE\",\n                      \"members\": [\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"expression\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_definition\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_end_marker\"\n                        },\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \";\"\n                        }\n                      ]\n                    }\n                  ]\n                }\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_semicolon\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_indentable_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"indented_block\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"indented_cases\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"expression\"\n          }\n        ]\n      }\n    },\n    \"block\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"{\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_block\"\n                },\n                {\n                  \"type\": \"ALIAS\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_block_lambda_expression\"\n                  },\n                  \"named\": true,\n                  \"value\": \"lambda_expression\"\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"}\"\n        }\n      ]\n    },\n    \"indented_block\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indent\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_block\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_outdent\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_comma_outdent\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_end_marker\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"indented_cases\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indent\"\n          },\n          {\n            \"type\": \"REPEAT1\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"case_clause\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_outdent\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_comma_outdent\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_type\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"function_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"compound_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"infix_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"match_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_annotated_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"literal_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_structural_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"type_lambda\"\n        }\n      ]\n    },\n    \"_annotated_type\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"annotated_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_type\"\n          }\n        ]\n      }\n    },\n    \"annotated_type\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_type\"\n          },\n          {\n            \"type\": \"REPEAT1\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"annotation\"\n            }\n          }\n        ]\n      }\n    },\n    \"_simple_type\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"generic_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"projected_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"tuple_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"named_tuple_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"singleton_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"stable_type_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_type_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"applied_constructor_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"wildcard\"\n        }\n      ]\n    },\n    \"applied_constructor_type\": {\n      \"type\": \"PREC\",\n      \"value\": \"applied_constructor_type\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type_identifier\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"arguments\"\n          }\n        ]\n      }\n    },\n    \"compound_type\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 7,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"base\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_annotated_type\"\n                }\n              },\n              {\n                \"type\": \"REPEAT1\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \"with\"\n                    },\n                    {\n                      \"type\": \"FIELD\",\n                      \"name\": \"extra\",\n                      \"content\": {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_annotated_type\"\n                      }\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 0,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"base\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_annotated_type\"\n                }\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_refinement\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": -1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"PREC_LEFT\",\n                \"value\": 7,\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"FIELD\",\n                      \"name\": \"base\",\n                      \"content\": {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_annotated_type\"\n                      }\n                    },\n                    {\n                      \"type\": \"REPEAT1\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \"with\"\n                          },\n                          {\n                            \"type\": \"FIELD\",\n                            \"name\": \"extra\",\n                            \"content\": {\n                              \"type\": \"SYMBOL\",\n                              \"name\": \"_annotated_type\"\n                            }\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                }\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_refinement\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"_structural_type\": {\n      \"type\": \"PREC\",\n      \"value\": \"structural_type\",\n      \"content\": {\n        \"type\": \"ALIAS\",\n        \"content\": {\n          \"type\": \"SYMBOL\",\n          \"name\": \"template_body\"\n        },\n        \"named\": true,\n        \"value\": \"structural_type\"\n      }\n    },\n    \"_refinement\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"SYMBOL\",\n        \"name\": \"template_body\"\n      },\n      \"named\": true,\n      \"value\": \"refinement\"\n    },\n    \"_infix_type_choice\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"compound_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"infix_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_annotated_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"literal_type\"\n          }\n        ]\n      }\n    },\n    \"infix_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"left\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_infix_type_choice\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"operator\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"right\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_infix_type_choice\"\n            }\n          }\n        ]\n      }\n    },\n    \"tuple_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_type\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_type\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"named_tuple_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"name_and_type\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"name_and_type\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"singleton_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 2,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"stable_identifier\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \".\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"type\"\n          }\n        ]\n      }\n    },\n    \"stable_type_identifier\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 2,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"stable_identifier\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \".\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type_identifier\"\n          }\n        ]\n      }\n    },\n    \"stable_identifier\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 4,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"stable_identifier\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \".\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        ]\n      }\n    },\n    \"generic_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_type\"\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type_arguments\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"type_arguments\"\n          }\n        }\n      ]\n    },\n    \"projected_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_type\"\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"#\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"selector\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type_identifier\"\n          }\n        }\n      ]\n    },\n    \"match_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_infix_type_choice\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"match\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_indent\"\n                  },\n                  {\n                    \"type\": \"REPEAT1\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"type_case_clause\"\n                    }\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_outdent\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"{\"\n                  },\n                  {\n                    \"type\": \"REPEAT1\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"type_case_clause\"\n                    }\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"}\"\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"type_case_clause\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"case\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_infix_type_choice\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_arrow_then_type\"\n            }\n          }\n        ]\n      }\n    },\n    \"function_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"type_parameters\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"type_parameters\"\n                }\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_arrow_then_type\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"parameter_types\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"parameter_types\"\n                }\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_arrow_then_type\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_arrow_then_type\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"=>\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"?=>\"\n              }\n            ]\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"return_type\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_type\"\n            }\n          }\n        ]\n      }\n    },\n    \"parameter_types\": {\n      \"type\": \"PREC\",\n      \"value\": -1,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_annotated_type\"\n          },\n          {\n            \"type\": \"PREC_DYNAMIC\",\n            \"value\": 1,\n            \"content\": {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"(\"\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SEQ\",\n                      \"members\": [\n                        {\n                          \"type\": \"SEQ\",\n                          \"members\": [\n                            {\n                              \"type\": \"SYMBOL\",\n                              \"name\": \"_param_type\"\n                            },\n                            {\n                              \"type\": \"REPEAT\",\n                              \"content\": {\n                                \"type\": \"SEQ\",\n                                \"members\": [\n                                  {\n                                    \"type\": \"STRING\",\n                                    \"value\": \",\"\n                                  },\n                                  {\n                                    \"type\": \"SYMBOL\",\n                                    \"name\": \"_param_type\"\n                                  }\n                                ]\n                              }\n                            }\n                          ]\n                        },\n                        {\n                          \"type\": \"CHOICE\",\n                          \"members\": [\n                            {\n                              \"type\": \"STRING\",\n                              \"value\": \",\"\n                            },\n                            {\n                              \"type\": \"BLANK\"\n                            }\n                          ]\n                        }\n                      ]\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \")\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"compound_type\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"infix_type\"\n          }\n        ]\n      }\n    },\n    \"_param_type\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"lazy_parameter_type\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_param_value_type\"\n        }\n      ]\n    },\n    \"_param_value_type\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"repeated_parameter_type\"\n        }\n      ]\n    },\n    \"repeated_parameter_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_asterisk\"\n        }\n      ]\n    },\n    \"lazy_parameter_type\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=>\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_param_value_type\"\n          }\n        }\n      ]\n    },\n    \"_type_identifier\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"SYMBOL\",\n        \"name\": \"_identifier\"\n      },\n      \"named\": true,\n      \"value\": \"type_identifier\"\n    },\n    \"type_lambda\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"[\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_type_parameter\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_type_parameter\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"=>>\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"return_type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"_pattern\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"stable_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"interpolated_string_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"capture_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"tuple_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"named_tuple_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"case_class_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"infix_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"alternative_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"typed_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"given_pattern\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"quote_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"wildcard\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"repeat_pattern\"\n        }\n      ]\n    },\n    \"case_class_pattern\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_type_identifier\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"stable_type_identifier\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"pattern\",\n              \"content\": {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_pattern\"\n                          },\n                          {\n                            \"type\": \"REPEAT\",\n                            \"content\": {\n                              \"type\": \"SEQ\",\n                              \"members\": [\n                                {\n                                  \"type\": \"STRING\",\n                                  \"value\": \",\"\n                                },\n                                {\n                                  \"type\": \"SYMBOL\",\n                                  \"name\": \"_pattern\"\n                                }\n                              ]\n                            }\n                          }\n                        ]\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"BLANK\"\n                          }\n                        ]\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"BLANK\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"pattern\",\n              \"content\": {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"named_pattern\"\n                          },\n                          {\n                            \"type\": \"REPEAT\",\n                            \"content\": {\n                              \"type\": \"SEQ\",\n                              \"members\": [\n                                {\n                                  \"type\": \"STRING\",\n                                  \"value\": \",\"\n                                },\n                                {\n                                  \"type\": \"SYMBOL\",\n                                  \"name\": \"named_pattern\"\n                                }\n                              ]\n                            }\n                          }\n                        ]\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"BLANK\"\n                          }\n                        ]\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"BLANK\"\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"infix_pattern\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 6,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"left\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"operator\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"right\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          }\n        ]\n      }\n    },\n    \"capture_pattern\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 8,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"name\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_identifier\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"wildcard\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"@\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"pattern\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          }\n        ]\n      }\n    },\n    \"repeat_pattern\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"pattern\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_asterisk\"\n          }\n        ]\n      }\n    },\n    \"typed_pattern\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": -1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"pattern\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_type\"\n            }\n          }\n        ]\n      }\n    },\n    \"given_pattern\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"given\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"type\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_type\"\n          }\n        }\n      ]\n    },\n    \"alternative_pattern\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": -2,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_pattern\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"|\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_pattern\"\n          }\n        ]\n      }\n    },\n    \"tuple_pattern\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_pattern\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_pattern\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"named_pattern\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": -1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"=\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_pattern\"\n          }\n        ]\n      }\n    },\n    \"named_tuple_pattern\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"named_pattern\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"named_pattern\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"if_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"match_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"try_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"assignment_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"lambda_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"postfix_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"ascription_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"infix_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"prefix_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"return_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"throw_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"while_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"do_while_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"for_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"macro_body\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_simple_expression\"\n        }\n      ]\n    },\n    \"_simple_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"operator_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"interpolated_string_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"unit\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"tuple_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"wildcard\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"block\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"splice_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"case_block\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"quote_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"instance_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"parenthesized_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"field_expression\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"generic_function\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"call_expression\"\n        },\n        {\n          \"type\": \"ALIAS\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_dot_match_expression\"\n          },\n          \"named\": true,\n          \"value\": \"match_expression\"\n        }\n      ]\n    },\n    \"_single_lambda_param\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"implicit\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \":\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_type\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"lambda_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": \"lambda\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"FIELD\",\n                    \"name\": \"type_parameters\",\n                    \"content\": {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"type_parameters\"\n                    }\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"=>\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"parameters\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"bindings\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"wildcard\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_single_lambda_param\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"=>\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"?=>\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indentable_expression\"\n          }\n        ]\n      }\n    },\n    \"_block_lambda_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": \"lambda\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"parameters\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"bindings\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"wildcard\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_single_lambda_param\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"=>\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"?=>\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_block\"\n          }\n        ]\n      }\n    },\n    \"if_expression\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"inline_modifier\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"if\"\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"condition\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_if_condition\"\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"consequence\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indentable_expression\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \";\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"else\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"alternative\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_indentable_expression\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_if_condition\": {\n      \"type\": \"PREC_DYNAMIC\",\n      \"value\": 4,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"parenthesized_expression\"\n          },\n          {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_indentable_expression\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"then\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"match_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"inline_modifier\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"value\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"expression\"\n              }\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"match\"\n            },\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"body\",\n              \"content\": {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"case_block\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"indented_cases\"\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_dot_match_expression\"\n        }\n      ]\n    },\n    \"_dot_match_expression\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"value\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_expression\"\n          }\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \".\"\n        },\n        {\n          \"type\": \"IMMEDIATE_TOKEN\",\n          \"content\": {\n            \"type\": \"STRING\",\n            \"value\": \"match\"\n          }\n        },\n        {\n          \"type\": \"FIELD\",\n          \"name\": \"body\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"case_block\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"indented_cases\"\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"try_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"try\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_indentable_expression\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"catch_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"finally_clause\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"catch_clause\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"catch\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_indentable_expression\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_expr_case_clause\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"_expr_case_clause\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"case\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_case_pattern\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"expression\"\n            }\n          }\n        ]\n      }\n    },\n    \"finally_clause\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"finally\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_indentable_expression\"\n          }\n        ]\n      }\n    },\n    \"binding\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"name\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_identifier\"\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"wildcard\"\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \":\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"type\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_param_type\"\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"bindings\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"binding\"\n                    },\n                    {\n                      \"type\": \"REPEAT\",\n                      \"content\": {\n                        \"type\": \"SEQ\",\n                        \"members\": [\n                          {\n                            \"type\": \"STRING\",\n                            \"value\": \",\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"binding\"\n                          }\n                        ]\n                      }\n                    }\n                  ]\n                },\n                {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \",\"\n                    },\n                    {\n                      \"type\": \"BLANK\"\n                    }\n                  ]\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"case_block\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC\",\n          \"value\": -1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"{\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"}\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"{\"\n            },\n            {\n              \"type\": \"REPEAT1\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"case_clause\"\n              }\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \"}\"\n            }\n          ]\n        }\n      ]\n    },\n    \"case_clause\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"case\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_case_pattern\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_block\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"_case_pattern\": {\n      \"type\": \"PREC_DYNAMIC\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"pattern\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            }\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"guard\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"=>\"\n          }\n        ]\n      }\n    },\n    \"guard\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 1,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"if\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"condition\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_postfix_expression_choice\"\n            }\n          }\n        ]\n      }\n    },\n    \"assignment_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 3,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"left\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"prefix_expression\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_simple_expression\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"=\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"right\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"expression\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"indented_block\"\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"generic_function\": {\n      \"type\": \"PREC\",\n      \"value\": 8,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"function\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"expression\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"type_arguments\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"type_arguments\"\n            }\n          }\n        ]\n      }\n    },\n    \"call_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_LEFT\",\n          \"value\": 8,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"function\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_simple_expression\"\n                }\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"arguments\",\n                \"content\": {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"arguments\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"case_block\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"block\"\n                    }\n                  ]\n                }\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"PREC_RIGHT\",\n          \"value\": 5,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"function\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_postfix_expression_choice\"\n                }\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \":\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"arguments\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"colon_argument\"\n                }\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"colon_argument\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 5,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"lambda_start\",\n                \"content\": {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"CHOICE\",\n                      \"members\": [\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"bindings\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_identifier\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"wildcard\"\n                        }\n                      ]\n                    },\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \"=>\"\n                    }\n                  ]\n                }\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"indented_block\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"indented_cases\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"field_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 8,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"value\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_expression\"\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \".\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"field\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          }\n        ]\n      }\n    },\n    \"instance_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_DYNAMIC\",\n          \"value\": 0,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"new\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_constructor_application\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"template_body\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"PREC\",\n          \"value\": \"new\",\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"new\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"template_body\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"new\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_constructor_application\"\n            }\n          ]\n        }\n      ]\n    },\n    \"ascription_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_postfix_expression_choice\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \":\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_param_type\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"annotation\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"infix_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 6,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"left\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"infix_expression\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"prefix_expression\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_simple_expression\"\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"operator\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_identifier\"\n            }\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"right\",\n            \"content\": {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"prefix_expression\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_simple_expression\"\n                },\n                {\n                  \"type\": \"SEQ\",\n                  \"members\": [\n                    {\n                      \"type\": \"STRING\",\n                      \"value\": \":\"\n                    },\n                    {\n                      \"type\": \"SYMBOL\",\n                      \"name\": \"colon_argument\"\n                    }\n                  ]\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"postfix_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 5,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"infix_expression\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"prefix_expression\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_simple_expression\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_identifier\"\n          }\n        ]\n      }\n    },\n    \"_postfix_expression_choice\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 5,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"postfix_expression\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"infix_expression\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"prefix_expression\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_expression\"\n          }\n        ]\n      }\n    },\n    \"macro_body\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 10,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"macro\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"infix_expression\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"prefix_expression\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_simple_expression\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"prefix_expression\": {\n      \"type\": \"PREC\",\n      \"value\": 7,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"+\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"-\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"!\"\n              },\n              {\n                \"type\": \"STRING\",\n                \"value\": \"~\"\n              }\n            ]\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"_simple_expression\"\n          }\n        ]\n      }\n    },\n    \"tuple_expression\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"expression\"\n        },\n        {\n          \"type\": \"REPEAT1\",\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \",\"\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"expression\"\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \",\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"parenthesized_expression\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"expression\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"type_arguments\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"[\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_type\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \",\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_type\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"]\"\n        }\n      ]\n    },\n    \"arguments\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"(\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_vararg_arguments\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_exprs_in_parens\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"using\"\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_exprs_in_parens\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \")\"\n        }\n      ]\n    },\n    \"_vararg_arguments\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_exprs_in_parens\"\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \",\"\n                }\n              ]\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"vararg\"\n        }\n      ]\n    },\n    \"vararg\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_expression\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_asterisk\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_expression\"\n            },\n            {\n              \"type\": \"STRING\",\n              \"value\": \":\"\n            },\n            {\n              \"type\": \"TOKEN\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"_\"\n                  },\n                  {\n                    \"type\": \"IMMEDIATE_TOKEN\",\n                    \"content\": {\n                      \"type\": \"STRING\",\n                      \"value\": \"*\"\n                    }\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"_exprs_in_parens\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"expression\"\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \",\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"expression\"\n                  }\n                ]\n              }\n            }\n          ]\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \",\"\n            },\n            {\n              \"type\": \"BLANK\"\n            }\n          ]\n        }\n      ]\n    },\n    \"splice_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 10,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"$\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"{\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_block\"\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"}\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"[\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_type\"\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"]\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"identifier\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"quote_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 10,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"'\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"{\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_block\"\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"}\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"[\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_type\"\n                  },\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \"]\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"identifier\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"identifier\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_alpha_identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_backquoted_id\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_soft_identifier\"\n        }\n      ]\n    },\n    \"_soft_identifier\": {\n      \"type\": \"PREC\",\n      \"value\": \"soft_id\",\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"infix\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"inline\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"opaque\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"open\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"tracked\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"transparent\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"end\"\n          }\n        ]\n      }\n    },\n    \"_alpha_identifier\": {\n      \"type\": \"PATTERN\",\n      \"value\": \"[\\\\p{Lu}\\\\p{Lt}\\\\p{Nl}\\\\p{Lo}\\\\p{Lm}\\\\$\\\\p{Ll}_\\\\u00AA\\\\u00BB\\\\u02B0-\\\\u02B8\\\\u02C0-\\\\u02C1\\\\u02E0-\\\\u02E4\\\\u037A\\\\u1D78\\\\u1D9B-\\\\u1DBF\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2C7C-\\\\u2C7D\\\\uA69C-\\\\uA69D\\\\uA770\\\\uA7F8-\\\\uA7F9\\\\uAB5C-\\\\uAB5F\\\\$][\\\\p{Lu}\\\\p{Lt}\\\\p{Nl}\\\\p{Lo}\\\\p{Lm}\\\\$\\\\p{Ll}_\\\\u00AA\\\\u00BB\\\\u02B0-\\\\u02B8\\\\u02C0-\\\\u02C1\\\\u02E0-\\\\u02E4\\\\u037A\\\\u1D78\\\\u1D9B-\\\\u1DBF\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2C7C-\\\\u2C7D\\\\uA69C-\\\\uA69D\\\\uA770\\\\uA7F8-\\\\uA7F9\\\\uAB5C-\\\\uAB5F0-9\\\\$_\\\\p{Ll}]*(_[\\\\-!#%&*+\\\\/\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]+)?\"\n    },\n    \"_interpolation_identifier\": {\n      \"type\": \"PATTERN\",\n      \"value\": \"[\\\\p{Lu}\\\\p{Lt}\\\\p{Nl}\\\\p{Lo}\\\\p{Lm}\\\\p{Ll}_\\\\u00AA\\\\u00BB\\\\u02B0-\\\\u02B8\\\\u02C0-\\\\u02C1\\\\u02E0-\\\\u02E4\\\\u037A\\\\u1D78\\\\u1D9B-\\\\u1DBF\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2C7C-\\\\u2C7D\\\\uA69C-\\\\uA69D\\\\uA770\\\\uA7F8-\\\\uA7F9\\\\uAB5C-\\\\uAB5F][\\\\p{Lu}\\\\p{Lt}\\\\p{Nl}\\\\p{Lo}\\\\p{Lm}\\\\p{Ll}_\\\\u00AA\\\\u00BB\\\\u02B0-\\\\u02B8\\\\u02C0-\\\\u02C1\\\\u02E0-\\\\u02E4\\\\u037A\\\\u1D78\\\\u1D9B-\\\\u1DBF\\\\u2071\\\\u207F\\\\u2090-\\\\u209C\\\\u2C7C-\\\\u2C7D\\\\uA69C-\\\\uA69D\\\\uA770\\\\uA7F8-\\\\uA7F9\\\\uAB5C-\\\\uAB5F0-9_\\\\p{Ll}]*\"\n    },\n    \"_backquoted_id\": {\n      \"type\": \"PATTERN\",\n      \"value\": \"`[^\\\\n`]+`\"\n    },\n    \"_identifier\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"identifier\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"operator_identifier\"\n        }\n      ]\n    },\n    \"identifiers\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"identifier\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \",\"\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"identifier\"\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"STRING\",\n                    \"value\": \",\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"identifier\"\n                  }\n                ]\n              }\n            }\n          ]\n        }\n      ]\n    },\n    \"wildcard\": {\n      \"type\": \"STRING\",\n      \"value\": \"_\"\n    },\n    \"_asterisk\": {\n      \"type\": \"STRING\",\n      \"value\": \"*\"\n    },\n    \"operator_identifier\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_asterisk\"\n        },\n        {\n          \"type\": \"TOKEN\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[\\\\-!#%&*+\\\\/\\\\\\\\<>?\\\\u005e\\\\u007c~\\\\u00ac\\\\u00b1\\\\u00d7\\\\u00f7\\\\u2190-\\\\u2194\\\\p{So}]\"\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\-!#%&*+\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]\"\n                  },\n                  {\n                    \"type\": \"REPEAT1\",\n                    \"content\": {\n                      \"type\": \"PATTERN\",\n                      \"value\": \"[\\\\-!#%&*+\\\\/\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]\"\n                    }\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\-!#%&*+\\\\/\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]\"\n                  },\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\-!#%&+\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]\"\n                  },\n                  {\n                    \"type\": \"REPEAT\",\n                    \"content\": {\n                      \"type\": \"PATTERN\",\n                      \"value\": \"[\\\\-!#%&*+\\\\/\\\\\\\\:<=>?@\\\\u005e\\\\u007c~\\\\p{Sm}\\\\p{So}]\"\n                    }\n                  }\n                ]\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"_non_null_literal\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"integer_literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"floating_point_literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"boolean_literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"character_literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"string\"\n        }\n      ]\n    },\n    \"literal_type\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 2,\n      \"content\": {\n        \"type\": \"SYMBOL\",\n        \"name\": \"_non_null_literal\"\n      }\n    },\n    \"literal\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_non_null_literal\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"null_literal\"\n        }\n      ]\n    },\n    \"integer_literal\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[-]\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[\\\\d](_?\\\\d)*\"\n              },\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"0[xX][\\\\da-fA-F](_?[\\\\da-fA-F])*\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[lL]\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"floating_point_literal\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[-]\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\d]+\\\\.[\\\\d]+\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[eE][+-]?[\\\\d]+\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[dfDF]\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"\\\\.[\\\\d]+\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[eE][+-]?[\\\\d]+\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[dfDF]\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\d]+\"\n                  },\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[eE][+-]?[\\\\d]+\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[dfDF]\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  }\n                ]\n              },\n              {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[\\\\d]+\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"PATTERN\",\n                        \"value\": \"[eE][+-]?[\\\\d]+\"\n                      },\n                      {\n                        \"type\": \"BLANK\"\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[dfDF]\"\n                  }\n                ]\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"boolean_literal\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"true\"\n        },\n        {\n          \"type\": \"STRING\",\n          \"value\": \"false\"\n        }\n      ]\n    },\n    \"character_literal\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"'\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"\\\\\"\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"PATTERN\",\n                            \"value\": \"[^xu]\"\n                          },\n                          {\n                            \"type\": \"PATTERN\",\n                            \"value\": \"[uU]+[0-9a-fA-F]{4}\"\n                          },\n                          {\n                            \"type\": \"PATTERN\",\n                            \"value\": \"x[0-9a-fA-F]{2}\"\n                          }\n                        ]\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"PATTERN\",\n                    \"value\": \"[^\\\\\\\\'\\\\n]\"\n                  }\n                ]\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"'\"\n          }\n        ]\n      }\n    },\n    \"interpolated_string_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"interpolator\",\n              \"content\": {\n                \"type\": \"ALIAS\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_raw_string_start\"\n                },\n                \"named\": true,\n                \"value\": \"identifier\"\n              }\n            },\n            {\n              \"type\": \"ALIAS\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"_raw_string\"\n              },\n              \"named\": true,\n              \"value\": \"interpolated_string\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"FIELD\",\n              \"name\": \"interpolator\",\n              \"content\": {\n                \"type\": \"SYMBOL\",\n                \"name\": \"identifier\"\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"interpolated_string\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_dollar_escape\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"TOKEN\",\n        \"content\": {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"$\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"$\"\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"\\\"\"\n                }\n              ]\n            }\n          ]\n        }\n      },\n      \"named\": true,\n      \"value\": \"escape_sequence\"\n    },\n    \"_aliased_interpolation_identifier\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"SYMBOL\",\n        \"name\": \"_interpolation_identifier\"\n      },\n      \"named\": true,\n      \"value\": \"identifier\"\n    },\n    \"interpolation\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \"$\"\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_aliased_interpolation_identifier\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"block\"\n            }\n          ]\n        }\n      ]\n    },\n    \"interpolated_string\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"IMMEDIATE_TOKEN\",\n              \"content\": {\n                \"type\": \"STRING\",\n                \"value\": \"\\\"\"\n              }\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_interpolated_string_middle\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_dollar_escape\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"interpolation\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"escape_sequence\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_single_line_string_end\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"IMMEDIATE_TOKEN\",\n              \"content\": {\n                \"type\": \"STRING\",\n                \"value\": \"\\\"\\\"\\\"\"\n              }\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_interpolated_multiline_string_middle\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_dollar_escape\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"interpolation\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_multiline_string_end\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_raw_string\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_string_start\"\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_raw_string_middle\"\n                      },\n                      {\n                        \"type\": \"CHOICE\",\n                        \"members\": [\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"_dollar_escape\"\n                          },\n                          {\n                            \"type\": \"SYMBOL\",\n                            \"name\": \"interpolation\"\n                          }\n                        ]\n                      }\n                    ]\n                  }\n                },\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_single_line_string_end\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_multiline_string_start\"\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_raw_string_multiline_middle\"\n                  },\n                  {\n                    \"type\": \"CHOICE\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_dollar_escape\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"interpolation\"\n                      }\n                    ]\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_multiline_string_end\"\n            }\n          ]\n        }\n      ]\n    },\n    \"escape_sequence\": {\n      \"type\": \"IMMEDIATE_TOKEN\",\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"\\\\\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[tbnrf\\\"'\\\\\\\\]\"\n              },\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[uU]+[0-9a-fA-F]{4}\"\n              },\n              {\n                \"type\": \"PATTERN\",\n                \"value\": \"[0-3]?[0-7]{1,2}\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"string\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_string_start\"\n            },\n            {\n              \"type\": \"REPEAT\",\n              \"content\": {\n                \"type\": \"SEQ\",\n                \"members\": [\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_simple_string_middle\"\n                  },\n                  {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"escape_sequence\"\n                  }\n                ]\n              }\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_single_line_string_end\"\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_simple_multiline_string_start\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_multiline_string_end\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_semicolon\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"STRING\",\n          \"value\": \";\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"_automatic_semicolon\"\n        }\n      ]\n    },\n    \"null_literal\": {\n      \"type\": \"STRING\",\n      \"value\": \"null\"\n    },\n    \"unit\": {\n      \"type\": \"PREC\",\n      \"value\": 4,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"(\"\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \")\"\n          }\n        ]\n      }\n    },\n    \"return_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"return\"\n          },\n          {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"SYMBOL\",\n                \"name\": \"expression\"\n              },\n              {\n                \"type\": \"BLANK\"\n              }\n            ]\n          }\n        ]\n      }\n    },\n    \"throw_expression\": {\n      \"type\": \"PREC_LEFT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"throw\"\n          },\n          {\n            \"type\": \"SYMBOL\",\n            \"name\": \"expression\"\n          }\n        ]\n      }\n    },\n    \"while_expression\": {\n      \"type\": \"PREC\",\n      \"value\": 2,\n      \"content\": {\n        \"type\": \"CHOICE\",\n        \"members\": [\n          {\n            \"type\": \"PREC_RIGHT\",\n            \"value\": 0,\n            \"content\": {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"while\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"condition\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"parenthesized_expression\"\n                  }\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"body\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"expression\"\n                  }\n                }\n              ]\n            }\n          },\n          {\n            \"type\": \"PREC_RIGHT\",\n            \"value\": 0,\n            \"content\": {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"while\"\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"condition\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_indentable_expression\"\n                      },\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"do\"\n                      }\n                    ]\n                  }\n                },\n                {\n                  \"type\": \"FIELD\",\n                  \"name\": \"body\",\n                  \"content\": {\n                    \"type\": \"SYMBOL\",\n                    \"name\": \"_indentable_expression\"\n                  }\n                }\n              ]\n            }\n          }\n        ]\n      }\n    },\n    \"do_while_expression\": {\n      \"type\": \"PREC_RIGHT\",\n      \"value\": 0,\n      \"content\": {\n        \"type\": \"SEQ\",\n        \"members\": [\n          {\n            \"type\": \"STRING\",\n            \"value\": \"do\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"body\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"expression\"\n            }\n          },\n          {\n            \"type\": \"STRING\",\n            \"value\": \"while\"\n          },\n          {\n            \"type\": \"FIELD\",\n            \"name\": \"condition\",\n            \"content\": {\n              \"type\": \"SYMBOL\",\n              \"name\": \"parenthesized_expression\"\n            }\n          }\n        ]\n      }\n    },\n    \"for_expression\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"PREC_RIGHT\",\n          \"value\": 1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"for\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"enumerators\",\n                \"content\": {\n                  \"type\": \"CHOICE\",\n                  \"members\": [\n                    {\n                      \"type\": \"SEQ\",\n                      \"members\": [\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \"(\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"enumerators\"\n                        },\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \")\"\n                        }\n                      ]\n                    },\n                    {\n                      \"type\": \"SEQ\",\n                      \"members\": [\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \"{\"\n                        },\n                        {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"enumerators\"\n                        },\n                        {\n                          \"type\": \"STRING\",\n                          \"value\": \"}\"\n                        }\n                      ]\n                    }\n                  ]\n                }\n              },\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"FIELD\",\n                        \"name\": \"body\",\n                        \"content\": {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"expression\"\n                        }\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"yield\"\n                      },\n                      {\n                        \"type\": \"FIELD\",\n                        \"name\": \"body\",\n                        \"content\": {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_indentable_expression\"\n                        }\n                      }\n                    ]\n                  }\n                ]\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"PREC_RIGHT\",\n          \"value\": 1,\n          \"content\": {\n            \"type\": \"SEQ\",\n            \"members\": [\n              {\n                \"type\": \"STRING\",\n                \"value\": \"for\"\n              },\n              {\n                \"type\": \"FIELD\",\n                \"name\": \"enumerators\",\n                \"content\": {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"enumerators\"\n                }\n              },\n              {\n                \"type\": \"CHOICE\",\n                \"members\": [\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"do\"\n                      },\n                      {\n                        \"type\": \"FIELD\",\n                        \"name\": \"body\",\n                        \"content\": {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_indentable_expression\"\n                        }\n                      }\n                    ]\n                  },\n                  {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"STRING\",\n                        \"value\": \"yield\"\n                      },\n                      {\n                        \"type\": \"FIELD\",\n                        \"name\": \"body\",\n                        \"content\": {\n                          \"type\": \"SYMBOL\",\n                          \"name\": \"_indentable_expression\"\n                        }\n                      }\n                    ]\n                  }\n                ]\n              }\n            ]\n          }\n        }\n      ]\n    },\n    \"enumerators\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"enumerator\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_semicolon\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"enumerator\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_automatic_semicolon\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_indent\"\n            },\n            {\n              \"type\": \"SEQ\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"enumerator\"\n                },\n                {\n                  \"type\": \"REPEAT\",\n                  \"content\": {\n                    \"type\": \"SEQ\",\n                    \"members\": [\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"_semicolon\"\n                      },\n                      {\n                        \"type\": \"SYMBOL\",\n                        \"name\": \"enumerator\"\n                      }\n                    ]\n                  }\n                }\n              ]\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"_automatic_semicolon\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_outdent\"\n            }\n          ]\n        }\n      ]\n    },\n    \"enumerator\": {\n      \"type\": \"CHOICE\",\n      \"members\": [\n        {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"case\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_pattern\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"<-\"\n                },\n                {\n                  \"type\": \"STRING\",\n                  \"value\": \"=\"\n                }\n              ]\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"expression\"\n            },\n            {\n              \"type\": \"CHOICE\",\n              \"members\": [\n                {\n                  \"type\": \"SYMBOL\",\n                  \"name\": \"guard\"\n                },\n                {\n                  \"type\": \"BLANK\"\n                }\n              ]\n            }\n          ]\n        },\n        {\n          \"type\": \"REPEAT1\",\n          \"content\": {\n            \"type\": \"SYMBOL\",\n            \"name\": \"guard\"\n          }\n        }\n      ]\n    },\n    \"_shebang\": {\n      \"type\": \"ALIAS\",\n      \"content\": {\n        \"type\": \"TOKEN\",\n        \"content\": {\n          \"type\": \"SEQ\",\n          \"members\": [\n            {\n              \"type\": \"STRING\",\n              \"value\": \"#!\"\n            },\n            {\n              \"type\": \"PATTERN\",\n              \"value\": \".*\"\n            }\n          ]\n        }\n      },\n      \"named\": true,\n      \"value\": \"comment\"\n    },\n    \"comment\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"TOKEN\",\n          \"content\": {\n            \"type\": \"STRING\",\n            \"value\": \"//\"\n          }\n        },\n        {\n          \"type\": \"CHOICE\",\n          \"members\": [\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"using_directive\"\n            },\n            {\n              \"type\": \"SYMBOL\",\n              \"name\": \"_comment_text\"\n            }\n          ]\n        }\n      ]\n    },\n    \"_comment_text\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"PREC\",\n        \"value\": 1,\n        \"content\": {\n          \"type\": \"PATTERN\",\n          \"value\": \".*\"\n        }\n      }\n    },\n    \"using_directive\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"IMMEDIATE_TOKEN\",\n          \"content\": {\n            \"type\": \"PREC\",\n            \"value\": 2,\n            \"content\": {\n              \"type\": \"STRING\",\n              \"value\": \">\"\n            }\n          }\n        },\n        {\n          \"type\": \"TOKEN\",\n          \"content\": {\n            \"type\": \"STRING\",\n            \"value\": \"using\"\n          }\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"using_directive_key\"\n        },\n        {\n          \"type\": \"SYMBOL\",\n          \"name\": \"using_directive_value\"\n        }\n      ]\n    },\n    \"using_directive_key\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"PATTERN\",\n        \"value\": \"[^\\\\s]+\"\n      }\n    },\n    \"using_directive_value\": {\n      \"type\": \"TOKEN\",\n      \"content\": {\n        \"type\": \"PATTERN\",\n        \"value\": \".*\"\n      }\n    },\n    \"block_comment\": {\n      \"type\": \"SEQ\",\n      \"members\": [\n        {\n          \"type\": \"TOKEN\",\n          \"content\": {\n            \"type\": \"STRING\",\n            \"value\": \"/*\"\n          }\n        },\n        {\n          \"type\": \"REPEAT\",\n          \"content\": {\n            \"type\": \"CHOICE\",\n            \"members\": [\n              {\n                \"type\": \"TOKEN\",\n                \"content\": {\n                  \"type\": \"PATTERN\",\n                  \"value\": \".\"\n                }\n              },\n              {\n                \"type\": \"TOKEN\",\n                \"content\": {\n                  \"type\": \"STRING\",\n                  \"value\": \"//\"\n                }\n              }\n            ]\n          }\n        },\n        {\n          \"type\": \"TOKEN\",\n          \"content\": {\n            \"type\": \"STRING\",\n            \"value\": \"*/\"\n          }\n        }\n      ]\n    }\n  },\n  \"extras\": [\n    {\n      \"type\": \"PATTERN\",\n      \"value\": \"\\\\s\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"comment\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"block_comment\"\n    }\n  ],\n  \"conflicts\": [\n    [\n      \"tuple_type\",\n      \"parameter_types\"\n    ],\n    [\n      \"binding\",\n      \"_simple_expression\"\n    ],\n    [\n      \"binding\",\n      \"_type_identifier\"\n    ],\n    [\n      \"while_expression\",\n      \"_simple_expression\"\n    ],\n    [\n      \"if_expression\"\n    ],\n    [\n      \"match_expression\"\n    ],\n    [\n      \"_given_constructor\",\n      \"_type_identifier\"\n    ],\n    [\n      \"instance_expression\"\n    ],\n    [\n      \"_simple_expression\",\n      \"lambda_expression\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_single_lambda_param\"\n    ],\n    [\n      \"_class_definition\"\n    ],\n    [\n      \"_class_constructor\"\n    ],\n    [\n      \"_full_enum_def\"\n    ],\n    [\n      \"identifiers\",\n      \"val_declaration\"\n    ],\n    [\n      \"class_parameters\"\n    ],\n    [\n      \"_type\",\n      \"compound_type\"\n    ],\n    [\n      \"_type\",\n      \"infix_type\"\n    ],\n    [\n      \"_type\",\n      \"match_type\"\n    ],\n    [\n      \"_variant_type_parameter\",\n      \"type_lambda\"\n    ],\n    [\n      \"name_and_type\",\n      \"parameter\"\n    ],\n    [\n      \"_simple_expression\",\n      \"binding\",\n      \"tuple_pattern\"\n    ],\n    [\n      \"_simple_expression\",\n      \"tuple_pattern\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_if_condition\",\n      \"_simple_expression\"\n    ],\n    [\n      \"block\",\n      \"_braced_template_body1\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_single_lambda_param\",\n      \"self_type\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_single_lambda_param\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_single_lambda_param\",\n      \"binding\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_single_lambda_param\",\n      \"self_type\"\n    ],\n    [\n      \"_simple_expression\",\n      \"_single_lambda_param\",\n      \"self_type\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_single_lambda_param\",\n      \"_self_type_ascription\"\n    ],\n    [\n      \"binding\",\n      \"_simple_expression\",\n      \"_type_identifier\"\n    ],\n    [\n      \"class_parameter\",\n      \"_type_identifier\"\n    ],\n    [\n      \"_block\",\n      \"_indentable_expression\"\n    ],\n    [\n      \"match_expression\",\n      \"_simple_expression\"\n    ],\n    [\n      \"self_type\",\n      \"_simple_expression\"\n    ],\n    [\n      \"repeat_pattern\",\n      \"operator_identifier\"\n    ],\n    [\n      \"vararg\",\n      \"operator_identifier\"\n    ],\n    [\n      \"_exprs_in_parens\"\n    ],\n    [\n      \"_annotated_type\",\n      \"binding\"\n    ],\n    [\n      \"self_type\",\n      \"_annotated_type\",\n      \"_simple_expression\"\n    ],\n    [\n      \"binding\",\n      \"_annotated_type\",\n      \"_simple_expression\"\n    ],\n    [\n      \"_annotated_type\",\n      \"_simple_expression\"\n    ],\n    [\n      \"generic_type\",\n      \"_simple_expression\"\n    ]\n  ],\n  \"precedences\": [\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"mod\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"soft_id\"\n      }\n    ],\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"end\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"soft_id\"\n      }\n    ],\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"new\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"structural_type\"\n      }\n    ],\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"self_type\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"lambda\"\n      }\n    ],\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"annotation\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"applied_constructor_type\"\n      }\n    ],\n    [\n      {\n        \"type\": \"STRING\",\n        \"value\": \"constructor_application\"\n      },\n      {\n        \"type\": \"STRING\",\n        \"value\": \"applied_constructor_type\"\n      }\n    ]\n  ],\n  \"externals\": [\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_automatic_semicolon\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_indent\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_outdent\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_comma_outdent\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_simple_string_start\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_simple_string_middle\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_simple_multiline_string_start\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_interpolated_string_middle\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_interpolated_multiline_string_middle\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_raw_string_start\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_raw_string_middle\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_raw_string_multiline_middle\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_single_line_string_end\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"_multiline_string_end\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"else\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"catch\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"finally\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"extends\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"derives\"\n    },\n    {\n      \"type\": \"STRING\",\n      \"value\": \"with\"\n    },\n    {\n      \"type\": \"SYMBOL\",\n      \"name\": \"error_sentinel\"\n    }\n  ],\n  \"inline\": [\n    \"_pattern\",\n    \"_semicolon\",\n    \"_definition\",\n    \"_param_type\",\n    \"_identifier\",\n    \"_postfix_expression_choice\",\n    \"_infix_type_choice\",\n    \"_param_value_type\",\n    \"_simple_type\",\n    \"literal\"\n  ],\n  \"supertypes\": [\n    \"expression\",\n    \"_definition\",\n    \"_pattern\"\n  ],\n  \"reserved\": {}\n}"
  },
  {
    "path": "src/node-types.json",
    "content": "[\n  {\n    \"type\": \"_definition\",\n    \"named\": true,\n    \"subtypes\": [\n      {\n        \"type\": \"class_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"enum_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"export_declaration\",\n        \"named\": true\n      },\n      {\n        \"type\": \"extension_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"function_declaration\",\n        \"named\": true\n      },\n      {\n        \"type\": \"function_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"given_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"import_declaration\",\n        \"named\": true\n      },\n      {\n        \"type\": \"object_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"package_clause\",\n        \"named\": true\n      },\n      {\n        \"type\": \"package_object\",\n        \"named\": true\n      },\n      {\n        \"type\": \"trait_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"type_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"val_declaration\",\n        \"named\": true\n      },\n      {\n        \"type\": \"val_definition\",\n        \"named\": true\n      },\n      {\n        \"type\": \"var_declaration\",\n        \"named\": true\n      },\n      {\n        \"type\": \"var_definition\",\n        \"named\": true\n      }\n    ]\n  },\n  {\n    \"type\": \"_pattern\",\n    \"named\": true,\n    \"subtypes\": [\n      {\n        \"type\": \"alternative_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"boolean_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"capture_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"case_class_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"character_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"floating_point_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"given_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"identifier\",\n        \"named\": true\n      },\n      {\n        \"type\": \"infix_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"integer_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"interpolated_string_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"named_tuple_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"null_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"operator_identifier\",\n        \"named\": true\n      },\n      {\n        \"type\": \"quote_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"repeat_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"stable_identifier\",\n        \"named\": true\n      },\n      {\n        \"type\": \"string\",\n        \"named\": true\n      },\n      {\n        \"type\": \"tuple_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"typed_pattern\",\n        \"named\": true\n      },\n      {\n        \"type\": \"wildcard\",\n        \"named\": true\n      }\n    ]\n  },\n  {\n    \"type\": \"expression\",\n    \"named\": true,\n    \"subtypes\": [\n      {\n        \"type\": \"ascription_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"assignment_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"block\",\n        \"named\": true\n      },\n      {\n        \"type\": \"boolean_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"call_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"case_block\",\n        \"named\": true\n      },\n      {\n        \"type\": \"character_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"do_while_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"field_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"floating_point_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"for_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"generic_function\",\n        \"named\": true\n      },\n      {\n        \"type\": \"identifier\",\n        \"named\": true\n      },\n      {\n        \"type\": \"if_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"infix_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"instance_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"integer_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"interpolated_string_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"lambda_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"macro_body\",\n        \"named\": true\n      },\n      {\n        \"type\": \"match_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"null_literal\",\n        \"named\": true\n      },\n      {\n        \"type\": \"operator_identifier\",\n        \"named\": true\n      },\n      {\n        \"type\": \"parenthesized_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"postfix_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"prefix_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"quote_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"return_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"splice_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"string\",\n        \"named\": true\n      },\n      {\n        \"type\": \"throw_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"try_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"tuple_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"unit\",\n        \"named\": true\n      },\n      {\n        \"type\": \"while_expression\",\n        \"named\": true\n      },\n      {\n        \"type\": \"wildcard\",\n        \"named\": true\n      }\n    ]\n  },\n  {\n    \"type\": \"access_modifier\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"access_qualifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"access_qualifier\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"alternative_pattern\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"_pattern\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"annotated_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"annotation\",\n    \"named\": true,\n    \"fields\": {\n      \"arguments\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"arguments\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"applied_constructor_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"arguments\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"arguments\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"vararg\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"arrow_renamed_identifier\",\n    \"named\": true,\n    \"fields\": {\n      \"alias\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"as_renamed_identifier\",\n    \"named\": true,\n    \"fields\": {\n      \"alias\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"ascription_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"call_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"case_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"field_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_function\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"instance_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolated_string_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"lazy_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"null_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parenthesized_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"postfix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"prefix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"quote_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"repeated_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"splice_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"unit\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"assignment_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"left\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"prefix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"right\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"binding\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lazy_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"repeated_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"bindings\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"binding\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"block\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"block_comment\",\n    \"named\": true,\n    \"extra\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"boolean_literal\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"call_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"arguments\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          },\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"colon_argument\",\n            \"named\": true\n          }\n        ]\n      },\n      \"function\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"postfix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"prefix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"capture_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"case_block\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"case_clause\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"case_class_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"pattern\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_pattern\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"case_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \";\",\n            \"named\": false\n          },\n          {\n            \"type\": \"_definition\",\n            \"named\": true\n          },\n          {\n            \"type\": \"_end_ident\",\n            \"named\": false\n          },\n          {\n            \"type\": \"end\",\n            \"named\": false\n          },\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"extension\",\n            \"named\": false\n          },\n          {\n            \"type\": \"for\",\n            \"named\": false\n          },\n          {\n            \"type\": \"given\",\n            \"named\": false\n          },\n          {\n            \"type\": \"if\",\n            \"named\": false\n          },\n          {\n            \"type\": \"match\",\n            \"named\": false\n          },\n          {\n            \"type\": \"new\",\n            \"named\": false\n          },\n          {\n            \"type\": \"this\",\n            \"named\": false\n          },\n          {\n            \"type\": \"try\",\n            \"named\": false\n          },\n          {\n            \"type\": \"val\",\n            \"named\": false\n          },\n          {\n            \"type\": \"while\",\n            \"named\": false\n          }\n        ]\n      },\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"guard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"catch_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      },\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"guard\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_cases\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"class_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"class_parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"class_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"derive\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"derives_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"access_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"class_parameter\",\n    \"named\": true,\n    \"fields\": {\n      \"default_value\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lazy_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"repeated_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"class_parameters\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"class_parameter\",\n          \"named\": true\n        },\n        {\n          \"type\": \"lazy_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"repeated_parameter_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"colon_argument\",\n    \"named\": true,\n    \"fields\": {\n      \"lambda_start\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"=>\",\n            \"named\": false\n          },\n          {\n            \"type\": \"bindings\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"indented_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_cases\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"comment\",\n    \"named\": true,\n    \"extra\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"using_directive\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"compilation_unit\",\n    \"named\": true,\n    \"root\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"comment\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"compound_type\",\n    \"named\": true,\n    \"fields\": {\n      \"base\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extra\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"refinement\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"context_bound\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"contravariant_type_parameter\",\n    \"named\": true,\n    \"fields\": {\n      \"bound\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"context_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lower_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"upper_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"view_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"covariant_type_parameter\",\n    \"named\": true,\n    \"fields\": {\n      \"bound\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"context_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lower_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"upper_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"view_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"derives_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"do_while_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      },\n      \"condition\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"enum_body\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"enum_case_definitions\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"enum_case_definitions\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"full_enum_case\",\n          \"named\": true\n        },\n        {\n          \"type\": \"simple_enum_case\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"enum_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"enum_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"class_parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"class_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"derive\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"derives_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"access_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"enumerator\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"_pattern\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"guard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"enumerators\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"enumerator\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"export_declaration\",\n    \"named\": true,\n    \"fields\": {\n      \"path\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \".\",\n            \"named\": false\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"as_renamed_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"namespace_selectors\",\n          \"named\": true\n        },\n        {\n          \"type\": \"namespace_wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"extends_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"arguments\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          },\n          {\n            \"type\": \"with\",\n            \"named\": false\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"arguments\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"extension_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \";\",\n            \"named\": false\n          },\n          {\n            \"type\": \"_definition\",\n            \"named\": true\n          },\n          {\n            \"type\": \"_end_ident\",\n            \"named\": false\n          },\n          {\n            \"type\": \"end\",\n            \"named\": false\n          },\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"extension\",\n            \"named\": false\n          },\n          {\n            \"type\": \"for\",\n            \"named\": false\n          },\n          {\n            \"type\": \"given\",\n            \"named\": false\n          },\n          {\n            \"type\": \"if\",\n            \"named\": false\n          },\n          {\n            \"type\": \"match\",\n            \"named\": false\n          },\n          {\n            \"type\": \"new\",\n            \"named\": false\n          },\n          {\n            \"type\": \"this\",\n            \"named\": false\n          },\n          {\n            \"type\": \"try\",\n            \"named\": false\n          },\n          {\n            \"type\": \"val\",\n            \"named\": false\n          },\n          {\n            \"type\": \"while\",\n            \"named\": false\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"field_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"field\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"value\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"finally_clause\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_cases\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"for_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      },\n      \"enumerators\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"(\",\n            \"named\": false\n          },\n          {\n            \"type\": \")\",\n            \"named\": false\n          },\n          {\n            \"type\": \"enumerators\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"full_enum_case\",\n    \"named\": true,\n    \"fields\": {\n      \"class_parameters\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"class_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"function_declaration\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"parameters\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"function_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"parameters\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"function_type\",\n    \"named\": true,\n    \"fields\": {\n      \"parameter_types\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"parameter_types\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"generic_function\",\n    \"named\": true,\n    \"fields\": {\n      \"function\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_arguments\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"type_arguments\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"generic_type\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_arguments\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"type_arguments\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"given_conditional\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"lazy_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parameter\",\n          \"named\": true\n        },\n        {\n          \"type\": \"repeated_parameter_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"given_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"arguments\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          }\n        ]\n      },\n      \"body\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          },\n          {\n            \"type\": \"with_template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          },\n          {\n            \"type\": \"with\",\n            \"named\": false\n          },\n          {\n            \"type\": \"with_template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"given_conditional\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_parameters\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"given_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"guard\",\n    \"named\": true,\n    \"fields\": {\n      \"condition\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"postfix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"prefix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"identifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"identifiers\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"if_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"alternative\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      },\n      \"condition\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          },\n          {\n            \"type\": \"then\",\n            \"named\": false\n          }\n        ]\n      },\n      \"consequence\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"inline_modifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"import_declaration\",\n    \"named\": true,\n    \"fields\": {\n      \"path\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \".\",\n            \"named\": false\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"as_renamed_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"namespace_selectors\",\n          \"named\": true\n        },\n        {\n          \"type\": \"namespace_wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"indented_block\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"indented_cases\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"case_clause\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"infix_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"left\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"prefix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"operator\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"right\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"boolean_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"call_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"character_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"colon_argument\",\n            \"named\": true\n          },\n          {\n            \"type\": \"field_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"floating_point_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_function\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"instance_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"integer_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"interpolated_string_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"null_literal\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"parenthesized_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"prefix_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"quote_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"splice_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"string\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"unit\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"infix_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"infix_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"left\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      },\n      \"operator\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"right\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"infix_type\",\n    \"named\": true,\n    \"fields\": {\n      \"left\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"operator\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"right\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"inline_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"instance_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"arguments\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"arguments\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"template_body\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"interpolated_string\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"escape_sequence\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolation\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"interpolated_string_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"interpolator\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"interpolated_string\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"interpolation\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"into_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"lambda_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"parameters\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"bindings\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"implicit\",\n            \"named\": false\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"indented_cases\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"lazy_parameter_type\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"repeated_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"literal_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"lower_bound\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"macro_body\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"call_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"case_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"field_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_function\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"instance_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolated_string_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"null_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parenthesized_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"prefix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"quote_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"splice_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"unit\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"match_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"case_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      },\n      \"value\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"inline_modifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"match_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_case_clause\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"modifiers\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"access_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"inline_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"into_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"open_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tracked_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"transparent_modifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"name_and_type\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lazy_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"repeated_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"named_pattern\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"_pattern\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"named_tuple_pattern\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"named_pattern\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"named_tuple_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"name_and_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"namespace_selectors\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"arrow_renamed_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"as_renamed_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"namespace_wildcard\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"namespace_wildcard\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"object_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"derive\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"derives_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"opaque_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"open_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"operator_identifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"package_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"package_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"package_identifier\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"package_object\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"derive\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"derives_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"parameter\",\n    \"named\": true,\n    \"fields\": {\n      \"default_value\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lazy_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"repeated_parameter_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"inline_modifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"parameter_types\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"lazy_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"repeated_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"parameters\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"lazy_parameter_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parameter\",\n          \"named\": true\n        },\n        {\n          \"type\": \"repeated_parameter_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"parenthesized_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"postfix_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"call_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"case_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"field_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_function\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"instance_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolated_string_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"null_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parenthesized_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"prefix_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"quote_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"splice_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"unit\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"prefix_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"call_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"case_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"field_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_function\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"instance_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolated_string_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"null_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parenthesized_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"quote_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"splice_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"unit\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"projected_type\",\n    \"named\": true,\n    \"fields\": {\n      \"selector\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"quote_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"refinement\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"self_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"repeat_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"repeated_parameter_type\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"return_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"self_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"simple_enum_case\",\n    \"named\": true,\n    \"fields\": {\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"singleton_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"splice_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"stable_identifier\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"stable_type_identifier\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"string\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"escape_sequence\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"structural_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"self_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"template_body\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"self_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"throw_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"tracked_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"trait_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"template_body\",\n            \"named\": true\n          }\n        ]\n      },\n      \"class_parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"class_parameters\",\n            \"named\": true\n          }\n        ]\n      },\n      \"derive\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"derives_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"extend\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"extends_clause\",\n            \"named\": true\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"access_modifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"transparent_modifier\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"try_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"catch_clause\",\n          \"named\": true\n        },\n        {\n          \"type\": \"finally_clause\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"tuple_expression\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"tuple_pattern\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"_pattern\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"tuple_type\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"type_arguments\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"function_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"structural_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"type_case_clause\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"=>\",\n            \"named\": false\n          },\n          {\n            \"type\": \"?=>\",\n            \"named\": false\n          },\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"annotated_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"applied_constructor_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"compound_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"infix_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"literal_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"named_tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"projected_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"singleton_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"stable_type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_type\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"type_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"bound\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"context_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lower_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"upper_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        },\n        {\n          \"type\": \"opaque_modifier\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"type_lambda\",\n    \"named\": true,\n    \"fields\": {\n      \"bound\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"context_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lower_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"upper_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"view_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"return_type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"type_parameters\",\n    \"named\": true,\n    \"fields\": {\n      \"bound\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \",\",\n            \"named\": false\n          },\n          {\n            \"type\": \":\",\n            \"named\": false\n          },\n          {\n            \"type\": \"context_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"lower_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"upper_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"view_bound\",\n            \"named\": true\n          },\n          {\n            \"type\": \"{\",\n            \"named\": false\n          },\n          {\n            \"type\": \"}\",\n            \"named\": false\n          }\n        ]\n      },\n      \"name\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type_parameters\": {\n        \"multiple\": true,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"type_parameters\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"contravariant_type_parameter\",\n          \"named\": true\n        },\n        {\n          \"type\": \"covariant_type_parameter\",\n          \"named\": true\n        },\n        {\n          \"type\": \"type_lambda\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"typed_pattern\",\n    \"named\": true,\n    \"fields\": {\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"unit\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"upper_bound\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"using_directive\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"using_directive_key\",\n          \"named\": true\n        },\n        {\n          \"type\": \"using_directive_value\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"val_declaration\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"val_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifiers\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"value\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"var_declaration\",\n    \"named\": true,\n    \"fields\": {\n      \"name\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"operator_identifier\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"var_definition\",\n    \"named\": true,\n    \"fields\": {\n      \"pattern\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"_pattern\",\n            \"named\": true\n          },\n          {\n            \"type\": \"identifiers\",\n            \"named\": true\n          }\n        ]\n      },\n      \"type\": {\n        \"multiple\": false,\n        \"required\": false,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      },\n      \"value\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      }\n    },\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"annotation\",\n          \"named\": true\n        },\n        {\n          \"type\": \"modifiers\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"vararg\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": false,\n      \"required\": true,\n      \"types\": [\n        {\n          \"type\": \"block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"boolean_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"call_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"case_block\",\n          \"named\": true\n        },\n        {\n          \"type\": \"character_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"field_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"floating_point_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"generic_function\",\n          \"named\": true\n        },\n        {\n          \"type\": \"identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"instance_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"integer_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"interpolated_string_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"match_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"null_literal\",\n          \"named\": true\n        },\n        {\n          \"type\": \"operator_identifier\",\n          \"named\": true\n        },\n        {\n          \"type\": \"parenthesized_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"quote_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"splice_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"string\",\n          \"named\": true\n        },\n        {\n          \"type\": \"tuple_expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"unit\",\n          \"named\": true\n        },\n        {\n          \"type\": \"wildcard\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"view_bound\",\n    \"named\": true,\n    \"fields\": {\n      \"type\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"annotated_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"applied_constructor_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"compound_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"function_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"generic_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"infix_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"literal_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"match_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"named_tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"projected_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"singleton_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"stable_type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"structural_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"tuple_type\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_identifier\",\n            \"named\": true\n          },\n          {\n            \"type\": \"type_lambda\",\n            \"named\": true\n          },\n          {\n            \"type\": \"wildcard\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"while_expression\",\n    \"named\": true,\n    \"fields\": {\n      \"body\": {\n        \"multiple\": false,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      },\n      \"condition\": {\n        \"multiple\": true,\n        \"required\": true,\n        \"types\": [\n          {\n            \"type\": \"do\",\n            \"named\": false\n          },\n          {\n            \"type\": \"expression\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_block\",\n            \"named\": true\n          },\n          {\n            \"type\": \"indented_cases\",\n            \"named\": true\n          }\n        ]\n      }\n    }\n  },\n  {\n    \"type\": \"wildcard\",\n    \"named\": true,\n    \"fields\": {}\n  },\n  {\n    \"type\": \"with_template_body\",\n    \"named\": true,\n    \"fields\": {},\n    \"children\": {\n      \"multiple\": true,\n      \"required\": false,\n      \"types\": [\n        {\n          \"type\": \"_definition\",\n          \"named\": true\n        },\n        {\n          \"type\": \"expression\",\n          \"named\": true\n        },\n        {\n          \"type\": \"self_type\",\n          \"named\": true\n        }\n      ]\n    }\n  },\n  {\n    \"type\": \"!\",\n    \"named\": false\n  },\n  {\n    \"type\": \"\\\"\",\n    \"named\": false\n  },\n  {\n    \"type\": \"\\\"\\\"\\\"\",\n    \"named\": false\n  },\n  {\n    \"type\": \"#\",\n    \"named\": false\n  },\n  {\n    \"type\": \"$\",\n    \"named\": false\n  },\n  {\n    \"type\": \"'\",\n    \"named\": false\n  },\n  {\n    \"type\": \"(\",\n    \"named\": false\n  },\n  {\n    \"type\": \")\",\n    \"named\": false\n  },\n  {\n    \"type\": \"*\",\n    \"named\": false\n  },\n  {\n    \"type\": \"*/\",\n    \"named\": false\n  },\n  {\n    \"type\": \"+\",\n    \"named\": false\n  },\n  {\n    \"type\": \",\",\n    \"named\": false\n  },\n  {\n    \"type\": \"-\",\n    \"named\": false\n  },\n  {\n    \"type\": \".\",\n    \"named\": false\n  },\n  {\n    \"type\": \"/*\",\n    \"named\": false\n  },\n  {\n    \"type\": \"//\",\n    \"named\": false\n  },\n  {\n    \"type\": \":\",\n    \"named\": false\n  },\n  {\n    \"type\": \";\",\n    \"named\": false\n  },\n  {\n    \"type\": \"<%\",\n    \"named\": false\n  },\n  {\n    \"type\": \"<-\",\n    \"named\": false\n  },\n  {\n    \"type\": \"<:\",\n    \"named\": false\n  },\n  {\n    \"type\": \"=\",\n    \"named\": false\n  },\n  {\n    \"type\": \"=>\",\n    \"named\": false\n  },\n  {\n    \"type\": \"=>>\",\n    \"named\": false\n  },\n  {\n    \"type\": \">\",\n    \"named\": false\n  },\n  {\n    \"type\": \">:\",\n    \"named\": false\n  },\n  {\n    \"type\": \"?=>\",\n    \"named\": false\n  },\n  {\n    \"type\": \"@\",\n    \"named\": false\n  },\n  {\n    \"type\": \"[\",\n    \"named\": false\n  },\n  {\n    \"type\": \"]\",\n    \"named\": false\n  },\n  {\n    \"type\": \"_\",\n    \"named\": false\n  },\n  {\n    \"type\": \"abstract\",\n    \"named\": false\n  },\n  {\n    \"type\": \"as\",\n    \"named\": false\n  },\n  {\n    \"type\": \"case\",\n    \"named\": false\n  },\n  {\n    \"type\": \"catch\",\n    \"named\": false\n  },\n  {\n    \"type\": \"character_literal\",\n    \"named\": true\n  },\n  {\n    \"type\": \"class\",\n    \"named\": false\n  },\n  {\n    \"type\": \"def\",\n    \"named\": false\n  },\n  {\n    \"type\": \"derives\",\n    \"named\": false\n  },\n  {\n    \"type\": \"do\",\n    \"named\": false\n  },\n  {\n    \"type\": \"else\",\n    \"named\": false\n  },\n  {\n    \"type\": \"end\",\n    \"named\": false\n  },\n  {\n    \"type\": \"enum\",\n    \"named\": false\n  },\n  {\n    \"type\": \"escape_sequence\",\n    \"named\": true\n  },\n  {\n    \"type\": \"export\",\n    \"named\": false\n  },\n  {\n    \"type\": \"extends\",\n    \"named\": false\n  },\n  {\n    \"type\": \"extension\",\n    \"named\": false\n  },\n  {\n    \"type\": \"false\",\n    \"named\": false\n  },\n  {\n    \"type\": \"final\",\n    \"named\": false\n  },\n  {\n    \"type\": \"finally\",\n    \"named\": false\n  },\n  {\n    \"type\": \"floating_point_literal\",\n    \"named\": true\n  },\n  {\n    \"type\": \"for\",\n    \"named\": false\n  },\n  {\n    \"type\": \"given\",\n    \"named\": false\n  },\n  {\n    \"type\": \"if\",\n    \"named\": false\n  },\n  {\n    \"type\": \"implicit\",\n    \"named\": false\n  },\n  {\n    \"type\": \"import\",\n    \"named\": false\n  },\n  {\n    \"type\": \"infix\",\n    \"named\": false\n  },\n  {\n    \"type\": \"inline\",\n    \"named\": false\n  },\n  {\n    \"type\": \"integer_literal\",\n    \"named\": true\n  },\n  {\n    \"type\": \"into\",\n    \"named\": false\n  },\n  {\n    \"type\": \"lazy\",\n    \"named\": false\n  },\n  {\n    \"type\": \"macro\",\n    \"named\": false\n  },\n  {\n    \"type\": \"match\",\n    \"named\": false\n  },\n  {\n    \"type\": \"new\",\n    \"named\": false\n  },\n  {\n    \"type\": \"null_literal\",\n    \"named\": true\n  },\n  {\n    \"type\": \"object\",\n    \"named\": false\n  },\n  {\n    \"type\": \"opaque\",\n    \"named\": false\n  },\n  {\n    \"type\": \"open\",\n    \"named\": false\n  },\n  {\n    \"type\": \"override\",\n    \"named\": false\n  },\n  {\n    \"type\": \"package\",\n    \"named\": false\n  },\n  {\n    \"type\": \"private\",\n    \"named\": false\n  },\n  {\n    \"type\": \"protected\",\n    \"named\": false\n  },\n  {\n    \"type\": \"return\",\n    \"named\": false\n  },\n  {\n    \"type\": \"sealed\",\n    \"named\": false\n  },\n  {\n    \"type\": \"then\",\n    \"named\": false\n  },\n  {\n    \"type\": \"this\",\n    \"named\": false\n  },\n  {\n    \"type\": \"throw\",\n    \"named\": false\n  },\n  {\n    \"type\": \"tracked\",\n    \"named\": false\n  },\n  {\n    \"type\": \"trait\",\n    \"named\": false\n  },\n  {\n    \"type\": \"transparent\",\n    \"named\": false\n  },\n  {\n    \"type\": \"true\",\n    \"named\": false\n  },\n  {\n    \"type\": \"try\",\n    \"named\": false\n  },\n  {\n    \"type\": \"type\",\n    \"named\": false\n  },\n  {\n    \"type\": \"using\",\n    \"named\": false\n  },\n  {\n    \"type\": \"using_directive_key\",\n    \"named\": true\n  },\n  {\n    \"type\": \"using_directive_value\",\n    \"named\": true\n  },\n  {\n    \"type\": \"val\",\n    \"named\": false\n  },\n  {\n    \"type\": \"var\",\n    \"named\": false\n  },\n  {\n    \"type\": \"while\",\n    \"named\": false\n  },\n  {\n    \"type\": \"with\",\n    \"named\": false\n  },\n  {\n    \"type\": \"yield\",\n    \"named\": false\n  },\n  {\n    \"type\": \"{\",\n    \"named\": false\n  },\n  {\n    \"type\": \"|\",\n    \"named\": false\n  },\n  {\n    \"type\": \"}\",\n    \"named\": false\n  },\n  {\n    \"type\": \"~\",\n    \"named\": false\n  }\n]"
  },
  {
    "path": "src/scanner.c",
    "content": "#include \"tree_sitter/alloc.h\"\n#include \"tree_sitter/array.h\"\n#include \"tree_sitter/parser.h\"\n\n#include <wctype.h>\n\n// #define DEBUG\n\n#ifdef DEBUG\n#define LOG(...) fprintf(stderr, __VA_ARGS__)\n#else\n#define LOG(...)\n#endif\n\nenum TokenType {\n  AUTOMATIC_SEMICOLON,\n  INDENT,\n  OUTDENT,\n  COMMA_OUTDENT,\n  SIMPLE_STRING_START,\n  SIMPLE_STRING_MIDDLE,\n  SIMPLE_MULTILINE_STRING_START,\n  INTERPOLATED_STRING_MIDDLE,\n  INTERPOLATED_MULTILINE_STRING_MIDDLE,\n  RAW_STRING_START,\n  RAW_STRING_MIDDLE,\n  RAW_STRING_MULTILINE_MIDDLE,\n  SINGLE_LINE_STRING_END,\n  MULTILINE_STRING_END,\n  ELSE,\n  CATCH,\n  FINALLY,\n  EXTENDS,\n  DERIVES,\n  WITH,\n  ERROR_SENTINEL\n};\n\nconst char* token_name[] = {\n  \"AUTOMATIC_SEMICOLON\",\n  \"INDENT\",\n  \"OUTDENT\",\n  \"COMMA_OUTDENT\",\n  \"SIMPLE_STRING_START\",\n  \"SIMPLE_STRING_MIDDLE\",\n  \"SIMPLE_MULTILINE_STRING_START\",\n  \"INTERPOLATED_STRING_MIDDLE\",\n  \"INTERPOLATED_MULTILINE_STRING_MIDDLE\",\n  \"RAW_STRING_MIDDLE\",\n  \"RAW_STRING_MULTILINE_MIDDLE\",\n  \"SINGLE_LINE_STRING_END\",\n  \"MULTILINE_STRING_END\",\n  \"ELSE\",\n  \"CATCH\",\n  \"FINALLY\",\n  \"EXTENDS\",\n  \"DERIVES\",\n  \"WITH\",\n  \"ERROR_SENTINEL\"\n};\n\ntypedef struct {\n  Array(int16_t) indents;\n  int16_t last_indentation_size;\n  int16_t last_newline_count;\n  int16_t last_column;\n} Scanner;\n\nvoid *tree_sitter_scala_external_scanner_create() {\n  Scanner *scanner = ts_calloc(1, sizeof(Scanner));\n  array_init(&scanner->indents);\n  scanner->last_indentation_size = -1;\n  scanner->last_column = -1;\n  return scanner;\n}\n\nvoid tree_sitter_scala_external_scanner_destroy(void *payload) {\n  Scanner *scanner = payload;\n  array_delete(&scanner->indents);\n  ts_free(scanner);\n}\n\nunsigned tree_sitter_scala_external_scanner_serialize(void *payload, char *buffer) {\n  Scanner *scanner = (Scanner*)payload;\n\n  if ((scanner->indents.size + 3) * sizeof(int16_t) > TREE_SITTER_SERIALIZATION_BUFFER_SIZE) {\n    return 0;\n  }\n\n  size_t size = 0;\n  memcpy(buffer + size, &scanner->last_indentation_size, sizeof(int16_t));\n  size += sizeof(int16_t);\n  memcpy(buffer + size, &scanner->last_newline_count, sizeof(int16_t));\n  size += sizeof(int16_t);\n  memcpy(buffer + size, &scanner->last_column, sizeof(int16_t));\n  size += sizeof(int16_t);\n\n  for (unsigned i = 0; i < scanner->indents.size; i++) {\n    memcpy(buffer + size, &scanner->indents.contents[i], sizeof(int16_t));\n    size += sizeof(int16_t);\n  }\n\n  return size;\n}\n\nvoid tree_sitter_scala_external_scanner_deserialize(void *payload, const char *buffer,\n                                                    unsigned length) {\n  Scanner *scanner = (Scanner*)payload;\n  array_clear(&scanner->indents);\n  scanner->last_indentation_size = -1;\n  scanner->last_column = -1;\n  scanner->last_newline_count = 0;\n\n  if (length == 0) {\n    return;\n  }\n\n  size_t size = 0;\n\n  scanner->last_indentation_size = *(int16_t *)&buffer[size];\n  size += sizeof(int16_t);\n  scanner->last_newline_count = *(int16_t *)&buffer[size];\n  size += sizeof(int16_t);\n  scanner->last_column = *(int16_t *)&buffer[size];\n  size += sizeof(int16_t);\n\n  while (size < length) {\n    array_push(&scanner->indents, *(int16_t *)&buffer[size]);\n    size += sizeof(int16_t);\n  }\n\n  assert(size == length);\n}\n\nstatic inline void advance(TSLexer *lexer) { lexer->advance(lexer, false); }\n\nstatic inline void skip(TSLexer *lexer) { lexer->advance(lexer, true); }\n\n// Used to detect leading infix operators on continuation lines.\n// See: https://www.scala-lang.org/api/3.x/docs/changed-features/operators.html\nstatic bool is_op_char(int32_t c) {\n  switch (c) {\n    case '!': case '#': case '%': case '&':\n    case '*': case '+': case '-': case '<': \n    case '=': case '>': case '?': case '@':\n    case '\\\\': case '^': case '|': case '~': \n    case ':':\n      return true;\n    default:\n      return false;\n  }\n}\n\n// We enumerate 3 types of strings that we need to handle differently:\n// 1. Simple strings, `\"...\"` or `\"\"\"...\"\"\"`\n// 2. Interpolated strings, `s\"...\"` or `f\"...\"` or `foo\"...\"` or foo\"\"\"...\"\"\".\n// 3. Raw strings, `raw\"...\"`\ntypedef enum {\n  STRING_MODE_SIMPLE,\n  STRING_MODE_INTERPOLATED,\n  STRING_MODE_RAW\n} StringMode;\n\nstatic bool scan_string_content(TSLexer *lexer, bool is_multiline, StringMode string_mode) {\n  LOG(\"scan_string_content(%d, %d, %c)\\n\", is_multiline, string_mode, lexer->lookahead);\n  unsigned closing_quote_count = 0;\n  for (;;) {\n    if (lexer->lookahead == '\"') {\n      advance(lexer);\n      closing_quote_count++;\n      if (!is_multiline) {\n        lexer->result_symbol = SINGLE_LINE_STRING_END;\n        lexer->mark_end(lexer);\n        return true;\n      }\n      if (closing_quote_count >= 3 && lexer->lookahead != '\"') {\n        lexer->result_symbol = MULTILINE_STRING_END;\n        lexer->mark_end(lexer);\n        return true;\n      }\n    } else if (lexer->lookahead == '$' && string_mode != STRING_MODE_SIMPLE) {\n      switch (string_mode) {\n        case STRING_MODE_INTERPOLATED:\n          lexer->result_symbol = is_multiline ? INTERPOLATED_MULTILINE_STRING_MIDDLE : INTERPOLATED_STRING_MIDDLE;\n          break;\n        case STRING_MODE_RAW:\n          lexer->result_symbol = is_multiline ? RAW_STRING_MULTILINE_MIDDLE : RAW_STRING_MIDDLE;\n          break;\n        default:\n          assert(false);          \n      }\n      lexer->mark_end(lexer);\n      return true;\n    } else {\n      closing_quote_count = 0;\n      if (lexer->lookahead == '\\\\') {\n        // Multiline strings ignore escape sequences\n        if (is_multiline || string_mode == STRING_MODE_RAW) {\n          // FIXME: In raw string mode, we have to jump over escaped quotes.\n          advance(lexer);\n          // In single-line raw strings, `\\\"` is not translated to `\"`, but it also does\n          // not close the string. Likewise, `\\\\` is not translated to `\\`, but it does\n          // stop the second `\\` from stopping a double-quote from closing the string.\n          if (!is_multiline && string_mode == STRING_MODE_RAW && \n            (lexer->lookahead == '\"' || lexer->lookahead == '\\\\')) {\n            advance(lexer);\n          }\n        } else {\n          lexer->result_symbol = string_mode == STRING_MODE_SIMPLE ? SIMPLE_STRING_MIDDLE : INTERPOLATED_STRING_MIDDLE;\n          lexer->mark_end(lexer);\n          return true;\n        }\n      // During error recovery and dynamic precedence resolution, the external \n      // scanner will be invoked with all valid_symbols set to true, which means\n      // we will be asked to scan a string token when we are not actually in a \n      // string context. Here we detect these cases and return false.\n      } else if (lexer->lookahead == '\\n' && !is_multiline) {\n        return false;\n      } else if (lexer->eof(lexer)) {\n        return false;\n      } else {\n        advance(lexer);\n      }\n    }\n  }\n}\n\nstatic bool detect_comment_start(TSLexer *lexer) {\n  lexer->mark_end(lexer);\n  // Comments should not affect indentation\n  if (lexer->lookahead == '/') {\n    advance(lexer);\n    if (lexer->lookahead == '/' || lexer -> lookahead == '*') {\n      return true;\n    }\n  }\n  return false;\n}\n\nstatic bool scan_word(TSLexer *lexer, const char* const word) {\n  for (uint8_t i = 0; word[i] != '\\0'; i++) {\n    if (lexer->lookahead != word[i]) {\n      return false;\n    }\n    advance(lexer);\n  }\n  return !iswalnum(lexer->lookahead);\n}\n\n// Returns true if the lookahead starts a leading infix operator — a symbolic\n// operator or back-ticked identifier followed by whitespace and then a\n// non-whitespace operand on the same line. Such a line is a continuation of\n// the previous expression, so neither AUTOMATIC_SEMICOLON nor OUTDENT should\n// fire ahead of it. Advances the lexer; the caller must not rely on position.\nstatic bool is_leading_infix_continuation(TSLexer *lexer) {\n  if (is_op_char(lexer->lookahead)) {\n    advance(lexer);\n    while (is_op_char(lexer->lookahead)) {\n      advance(lexer);\n    }\n    bool found_space = false;\n    while (lexer->lookahead == ' ' || lexer->lookahead == '\\t') {\n      advance(lexer);\n      found_space = true;\n    }\n    return found_space && !iswspace(lexer->lookahead) && !lexer->eof(lexer);\n  }\n  if (lexer->lookahead == '`') {\n    advance(lexer);\n    while (lexer->lookahead != '`' && !lexer->eof(lexer)) {\n      advance(lexer);\n    }\n    if (lexer->lookahead != '`') {\n      return false;\n    }\n    advance(lexer);\n    bool found_space = false;\n    while (lexer->lookahead == ' ' || lexer->lookahead == '\\t') {\n      advance(lexer);\n      found_space = true;\n    }\n    return found_space && !iswspace(lexer->lookahead) && !lexer->eof(lexer);\n  }\n  return false;\n}\n\nstatic inline void debug_indents(Scanner *scanner) {\n  LOG(\"    indents(%d): \", scanner->indents.size);\n  for (unsigned i = 0; i < scanner->indents.size; i++) {\n    LOG(\"%d \", scanner->indents.contents[i]);\n  }\n  LOG(\"\\n\");\n}\n\nbool tree_sitter_scala_external_scanner_scan(void *payload, TSLexer *lexer,\n                                             const bool *valid_symbols) {\n  #ifdef DEBUG\n  {\n    if (valid_symbols[ERROR_SENTINEL]) {\n      LOG(\"entering tree_sitter_scala_external_scanner_scan. ERROR_SENTINEL is valid\\n\");\n    } else {\n      char debug_str[1024] = \"entering tree_sitter_scala_external_scanner_scan valid symbols: \";\n      for (unsigned i = 0; i < ERROR_SENTINEL; i++) {\n        if (valid_symbols[i]) {\n          strcat(debug_str, token_name[i]);\n          strcat(debug_str, \", \");\n        }\n      }\n      strcat(debug_str, \"\\n\");\n      LOG(\"%s\", debug_str);\n    }\n  }\n  #endif\n\n  Scanner *scanner = (Scanner *)payload;\n  int16_t prev = scanner->indents.size > 0 ? *array_back(&scanner->indents) : -1;\n  int16_t newline_count = 0;\n  int16_t indentation_size = 0;\n\n  while (iswspace(lexer->lookahead)) {\n    if (lexer->lookahead == '\\n') {\n      newline_count++;\n      indentation_size = 0;\n    }\n    else {\n      indentation_size++;\n    }\n    skip(lexer);\n  }\n\n  // Separate from OUTDENT because the scanner cannot distinguish a comma that\n  // terminates an indented block (e.g. `map: x => f(x),`) from one that is\n  // internal to it (e.g. `case EnumCase1, EnumCase2`). By using a distinct\n  // token, tree-sitter only makes it valid in grammar contexts where comma\n  // termination is expected (colon_argument, _indentable_expression).\n  if (valid_symbols[COMMA_OUTDENT] && lexer->lookahead == ',' && prev != -1) {\n    if (scanner->indents.size > 0) {\n      array_pop(&scanner->indents);\n    }\n    lexer->mark_end(lexer);\n    lexer->result_symbol = COMMA_OUTDENT;\n    return true;\n  }\n\n  // Before advancing the lexer, check if we can double outdent\n  if (\n      valid_symbols[OUTDENT] &&\n      (\n        lexer->lookahead == 0 ||\n        (\n          prev != -1 &&\n          (\n            lexer->lookahead == ')' ||\n            lexer->lookahead == ']' ||\n            lexer->lookahead == '}'\n          )\n        ) ||\n        (\n          scanner->last_indentation_size != -1 &&\n          prev != -1 &&\n          scanner->last_indentation_size < prev\n        )\n      )\n  ) {\n    if (scanner->indents.size > 0) {\n        array_pop(&scanner->indents);\n    }\n    LOG(\"    pop\\n\");\n    LOG(\"    OUTDENT\\n\");\n    lexer->result_symbol = OUTDENT;\n    return true;\n  }\n  scanner->last_indentation_size = -1;\n\n  if (\n      valid_symbols[INDENT] &&\n      newline_count > 0 &&\n      (\n        scanner->indents.size == 0 ||\n        indentation_size > *array_back(&scanner->indents)\n      )\n  ) {\n    if (detect_comment_start(lexer)) {\n      return false;\n    }\n    array_push(&scanner->indents, indentation_size);\n    lexer->result_symbol = INDENT;\n    LOG(\"    INDENT\\n\");\n    return true;\n  }\n\n  // This saves the indentation_size and newline_count so it can be used\n  // in subsequent calls for multiple outdent or auto-semicolon.\n  if (valid_symbols[OUTDENT] &&\n      (lexer->lookahead == 0 ||\n      (\n        newline_count > 0 &&\n        prev != -1 &&\n        indentation_size < prev\n      )\n      )\n  ) {\n    lexer->mark_end(lexer);\n    if (detect_comment_start(lexer)) {\n      return false;\n    }\n    scanner->last_indentation_size = indentation_size;\n    scanner->last_newline_count = newline_count;\n    if (lexer->eof(lexer)) {\n      scanner->last_column = -1;\n    } else {\n      scanner->last_column = (int16_t)lexer->get_column(lexer);\n    }\n    // Don't close the indented block when the next line starts with a leading\n    // infix operator: that operator continues the previous expression.\n    if (lexer->lookahead != 0 && is_leading_infix_continuation(lexer)) {\n      return false;\n    }\n    if (scanner->indents.size > 0) {\n      array_pop(&scanner->indents);\n    }\n    LOG(\"    pop\\n\");\n    LOG(\"    OUTDENT\\n\");\n    lexer->result_symbol = OUTDENT;\n    return true;\n  }\n\n  // Recover newline_count from the outdent reset\n  bool is_eof = lexer->eof(lexer);\n  if (\n      (\n        scanner->last_newline_count > 0 &&\n        (is_eof && scanner->last_column == -1)\n      ) ||\n      (!is_eof && lexer->get_column(lexer) == (uint32_t)scanner->last_column)\n  ) {\n    newline_count += scanner->last_newline_count;\n  }\n  scanner->last_newline_count = 0;\n\n  if (valid_symbols[AUTOMATIC_SEMICOLON] && newline_count > 0) {\n    // AUTOMATIC_SEMICOLON should not be issued in the middle of expressions\n    // Thus, we exit this branch when encountering comments, else/catch clauses, etc.\n\n    lexer->mark_end(lexer);\n    lexer->result_symbol = AUTOMATIC_SEMICOLON;\n\n    // Probably, a multi-line field expression, e.g.\n    // a\n    //  .b\n    //  .c\n    if (lexer->lookahead == '.') {\n      return false;\n    }\n\n    // Single-line and multi-line comments\n    if (lexer->lookahead == '/') {\n      advance(lexer);\n      if (lexer->lookahead == '/') {\n        return false;\n      }\n      if (lexer->lookahead == '*') {\n        advance(lexer);\n        while (!lexer->eof(lexer)) {\n          if (lexer->lookahead == '*') {\n            advance(lexer);\n            if (lexer->lookahead == '/') {\n              advance(lexer);\n              break;\n            }\n          } else {\n            advance(lexer);\n          }\n        }\n        while (iswspace(lexer->lookahead)) {\n          if (lexer->lookahead == '\\n' || lexer->lookahead == '\\r') {\n            return false;\n          }\n          skip(lexer);\n        }\n        // If some code is present at the same line after comment end,\n        // we should still produce AUTOMATIC_SEMICOLON, e.g. in\n        // val a = 1\n        // /* comment */ val b = 2\n        return true;\n      }\n    }\n\n    if (valid_symbols[ELSE]) {\n      return !scan_word(lexer, \"else\");\n    }\n\n    if (valid_symbols[CATCH]) {\n      if (scan_word(lexer, \"catch\")) {\n        return false;\n      }\n    }\n\n    if (valid_symbols[FINALLY]) {\n      if  (scan_word(lexer, \"finally\")) {\n        return false;\n      }\n    }\n\n    if (valid_symbols[EXTENDS]) {\n      if (scan_word(lexer, \"extends\")) {\n        return false;\n      }\n    }\n\n    if (valid_symbols[WITH]) {\n      if (scan_word(lexer, \"with\")) {\n        return false;\n      }\n    }\n\n    if (valid_symbols[DERIVES]) {\n      if (scan_word(lexer, \"derives\")) {\n        return false;\n      }\n    }\n\n    if (newline_count > 1) {\n      return true;\n    }\n\n    // Don't insert automatic semicolon before leading infix operators:\n    // - symbolic, e.g. || or &&\n    // - back-ticked, e.g. `in`\n    // Only suppress if the operator is followed by horizontal whitespace\n    // and then non-newline content on the same line, meaning it has an operand.\n    if (is_leading_infix_continuation(lexer)) {\n      return false;\n    }\n\n    return true;\n  }\n\n  while (iswspace(lexer->lookahead)) {\n    if (lexer->lookahead == '\\n') {\n      newline_count++;\n    }\n    skip(lexer);\n  }\n\n  if (valid_symbols[SIMPLE_STRING_START] && lexer->lookahead == '\"') {\n    advance(lexer);\n    lexer->mark_end(lexer);\n\n    if (lexer->lookahead == '\"') {\n      advance(lexer);\n      if (lexer->lookahead == '\"') {\n        advance(lexer);\n        lexer->result_symbol = SIMPLE_MULTILINE_STRING_START;\n        lexer->mark_end(lexer);\n        return true;\n      }\n    }\n\n    lexer->result_symbol = SIMPLE_STRING_START;\n    return true;\n  }\n\n  // We need two tokens of lookahead to determine if we are parsing a raw string,\n  // the `raw` and the `\"`, which is why we need to do it in the external scanner.\n  if (valid_symbols[RAW_STRING_START] && lexer->lookahead == 'r') {\n    advance(lexer);\n    if (lexer->lookahead == 'a') {\n      advance(lexer);\n      if (lexer->lookahead == 'w') {\n        advance(lexer);\n        if (lexer->lookahead == '\"') {\n          lexer->mark_end(lexer);\n          lexer->result_symbol = RAW_STRING_START;\n          return true;\n        }\n      }\n    }\n  }\n\n  if (valid_symbols[SIMPLE_STRING_MIDDLE]) {\n    return scan_string_content(lexer, false, STRING_MODE_SIMPLE);\n  }\n\n  if (valid_symbols[INTERPOLATED_STRING_MIDDLE]) {\n    return scan_string_content(lexer, false, STRING_MODE_INTERPOLATED);\n  }\n\n  if (valid_symbols[RAW_STRING_MIDDLE]) {\n    return scan_string_content(lexer, false, STRING_MODE_RAW);\n  }\n\n  if (valid_symbols[RAW_STRING_MULTILINE_MIDDLE]) {\n    return scan_string_content(lexer, true, STRING_MODE_RAW);\n  }  \n\n  if (valid_symbols[INTERPOLATED_MULTILINE_STRING_MIDDLE]) {\n    return scan_string_content(lexer, true, STRING_MODE_INTERPOLATED);\n  }\n\n  // We still need to handle the simple multiline string case, but there is\n  // no `MULTILINE_STRING_MIDDLE` token, and `MULTILINE_STRING_END` is used\n  // by all three of simple raw, and interpolated multiline strings. So this \n  // check needs to come after the `INTERPOLATED_MULTILINE_STRING_MIDDLE` and\n  // `RAW_STRING_MULTILINE_MIDDLE` check, so that we can be sure we are in a \n  // simple multiline string context.\n  if (valid_symbols[MULTILINE_STRING_END]) {\n    return scan_string_content(lexer, true, STRING_MODE_SIMPLE);\n  }\n\n  return false;\n}\n\n//\n"
  },
  {
    "path": "src/tree_sitter/alloc.h",
    "content": "#ifndef TREE_SITTER_ALLOC_H_\n#define TREE_SITTER_ALLOC_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdbool.h>\n#include <stdio.h>\n#include <stdlib.h>\n\n// Allow clients to override allocation functions\n#ifdef TREE_SITTER_REUSE_ALLOCATOR\n\nextern void *(*ts_current_malloc)(size_t size);\nextern void *(*ts_current_calloc)(size_t count, size_t size);\nextern void *(*ts_current_realloc)(void *ptr, size_t size);\nextern void (*ts_current_free)(void *ptr);\n\n#ifndef ts_malloc\n#define ts_malloc  ts_current_malloc\n#endif\n#ifndef ts_calloc\n#define ts_calloc  ts_current_calloc\n#endif\n#ifndef ts_realloc\n#define ts_realloc ts_current_realloc\n#endif\n#ifndef ts_free\n#define ts_free    ts_current_free\n#endif\n\n#else\n\n#ifndef ts_malloc\n#define ts_malloc  malloc\n#endif\n#ifndef ts_calloc\n#define ts_calloc  calloc\n#endif\n#ifndef ts_realloc\n#define ts_realloc realloc\n#endif\n#ifndef ts_free\n#define ts_free    free\n#endif\n\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif // TREE_SITTER_ALLOC_H_\n"
  },
  {
    "path": "src/tree_sitter/array.h",
    "content": "#ifndef TREE_SITTER_ARRAY_H_\n#define TREE_SITTER_ARRAY_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include \"./alloc.h\"\n\n#include <assert.h>\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n#include <string.h>\n\n#ifdef _MSC_VER\n#pragma warning(push)\n#pragma warning(disable : 4101)\n#elif defined(__GNUC__) || defined(__clang__)\n#pragma GCC diagnostic push\n#pragma GCC diagnostic ignored \"-Wunused-variable\"\n#endif\n\n#define Array(T)       \\\n  struct {             \\\n    T *contents;       \\\n    uint32_t size;     \\\n    uint32_t capacity; \\\n  }\n\n/// Initialize an array.\n#define array_init(self) \\\n  ((self)->size = 0, (self)->capacity = 0, (self)->contents = NULL)\n\n/// Create an empty array.\n#define array_new() \\\n  { NULL, 0, 0 }\n\n/// Get a pointer to the element at a given `index` in the array.\n#define array_get(self, _index) \\\n  (assert((uint32_t)(_index) < (self)->size), &(self)->contents[_index])\n\n/// Get a pointer to the first element in the array.\n#define array_front(self) array_get(self, 0)\n\n/// Get a pointer to the last element in the array.\n#define array_back(self) array_get(self, (self)->size - 1)\n\n/// Clear the array, setting its size to zero. Note that this does not free any\n/// memory allocated for the array's contents.\n#define array_clear(self) ((self)->size = 0)\n\n/// Reserve `new_capacity` elements of space in the array. If `new_capacity` is\n/// less than the array's current capacity, this function has no effect.\n#define array_reserve(self, new_capacity)        \\\n  ((self)->contents = _array__reserve(           \\\n    (void *)(self)->contents, &(self)->capacity, \\\n    array_elem_size(self), new_capacity)         \\\n  )\n\n/// Free any memory allocated for this array. Note that this does not free any\n/// memory allocated for the array's contents.\n#define array_delete(self)                           \\\n  do {                                               \\\n    if ((self)->contents) ts_free((self)->contents); \\\n    (self)->contents = NULL;                         \\\n    (self)->size = 0;                                \\\n    (self)->capacity = 0;                            \\\n  } while (0)\n\n/// Push a new `element` onto the end of the array.\n#define array_push(self, element)                                 \\\n  do {                                                            \\\n    (self)->contents = _array__grow(                              \\\n      (void *)(self)->contents, (self)->size, &(self)->capacity,  \\\n      1, array_elem_size(self)                                    \\\n    );                                                            \\\n   (self)->contents[(self)->size++] = (element);                  \\\n  } while(0)\n\n/// Increase the array's size by `count` elements.\n/// New elements are zero-initialized.\n#define array_grow_by(self, count)                                               \\\n  do {                                                                           \\\n    if ((count) == 0) break;                                                     \\\n    (self)->contents = _array__grow(                                             \\\n      (self)->contents, (self)->size, &(self)->capacity,                         \\\n      count, array_elem_size(self)                                               \\\n    );                                                                           \\\n    memset((self)->contents + (self)->size, 0, (count) * array_elem_size(self)); \\\n    (self)->size += (count);                                                     \\\n  } while (0)\n\n/// Append all elements from one array to the end of another.\n#define array_push_all(self, other) \\\n  array_extend((self), (other)->size, (other)->contents)\n\n/// Append `count` elements to the end of the array, reading their values from the\n/// `contents` pointer.\n#define array_extend(self, count, other_contents)                 \\\n  (self)->contents = _array__splice(                              \\\n    (void*)(self)->contents, &(self)->size, &(self)->capacity,    \\\n    array_elem_size(self), (self)->size, 0, count, other_contents \\\n  )\n\n/// Remove `old_count` elements from the array starting at the given `index`. At\n/// the same index, insert `new_count` new elements, reading their values from the\n/// `new_contents` pointer.\n#define array_splice(self, _index, old_count, new_count, new_contents) \\\n  (self)->contents = _array__splice(                                   \\\n    (void *)(self)->contents, &(self)->size, &(self)->capacity,        \\\n    array_elem_size(self), _index, old_count, new_count, new_contents  \\\n  )\n\n/// Insert one `element` into the array at the given `index`.\n#define array_insert(self, _index, element)                     \\\n  (self)->contents = _array__splice(                            \\\n    (void *)(self)->contents, &(self)->size, &(self)->capacity, \\\n    array_elem_size(self), _index, 0, 1, &(element)             \\\n  )\n\n/// Remove one element from the array at the given `index`.\n#define array_erase(self, _index) \\\n  _array__erase((void *)(self)->contents, &(self)->size, array_elem_size(self), _index)\n\n/// Pop the last element off the array, returning the element by value.\n#define array_pop(self) ((self)->contents[--(self)->size])\n\n/// Assign the contents of one array to another, reallocating if necessary.\n#define array_assign(self, other)                                   \\\n  (self)->contents = _array__assign(                                \\\n    (void *)(self)->contents, &(self)->size, &(self)->capacity,     \\\n    (const void *)(other)->contents, (other)->size, array_elem_size(self) \\\n  )\n\n/// Swap one array with another\n#define array_swap(self, other)                                     \\\n  do {                                                              \\\n    void *_array_swap_tmp = (void *)(self)->contents;               \\\n    (self)->contents = (other)->contents;                           \\\n    (other)->contents = _array_swap_tmp;                            \\\n    _array__swap(&(self)->size, &(self)->capacity,                  \\\n                 &(other)->size, &(other)->capacity);               \\\n  } while (0)\n\n/// Get the size of the array contents\n#define array_elem_size(self) (sizeof *(self)->contents)\n\n/// Search a sorted array for a given `needle` value, using the given `compare`\n/// callback to determine the order.\n///\n/// If an existing element is found to be equal to `needle`, then the `index`\n/// out-parameter is set to the existing value's index, and the `exists`\n/// out-parameter is set to true. Otherwise, `index` is set to an index where\n/// `needle` should be inserted in order to preserve the sorting, and `exists`\n/// is set to false.\n#define array_search_sorted_with(self, compare, needle, _index, _exists) \\\n  _array__search_sorted(self, 0, compare, , needle, _index, _exists)\n\n/// Search a sorted array for a given `needle` value, using integer comparisons\n/// of a given struct field (specified with a leading dot) to determine the order.\n///\n/// See also `array_search_sorted_with`.\n#define array_search_sorted_by(self, field, needle, _index, _exists) \\\n  _array__search_sorted(self, 0, _compare_int, field, needle, _index, _exists)\n\n/// Insert a given `value` into a sorted array, using the given `compare`\n/// callback to determine the order.\n#define array_insert_sorted_with(self, compare, value) \\\n  do { \\\n    unsigned _index, _exists; \\\n    array_search_sorted_with(self, compare, &(value), &_index, &_exists); \\\n    if (!_exists) array_insert(self, _index, value); \\\n  } while (0)\n\n/// Insert a given `value` into a sorted array, using integer comparisons of\n/// a given struct field (specified with a leading dot) to determine the order.\n///\n/// See also `array_search_sorted_by`.\n#define array_insert_sorted_by(self, field, value) \\\n  do { \\\n    unsigned _index, _exists; \\\n    array_search_sorted_by(self, field, (value) field, &_index, &_exists); \\\n    if (!_exists) array_insert(self, _index, value); \\\n  } while (0)\n\n// Private\n\n// Pointers to individual `Array` fields (rather than the entire `Array` itself)\n// are passed to the various `_array__*` functions below to address strict aliasing\n// violations that arises when the _entire_ `Array` struct is passed as `Array(void)*`.\n//\n// The `Array` type itself was not altered as a solution in order to avoid breakage\n// with existing consumers (in particular, parsers with external scanners).\n\n/// This is not what you're looking for, see `array_erase`.\nstatic inline void _array__erase(void* self_contents, uint32_t *size,\n                                size_t element_size, uint32_t index) {\n  assert(index < *size);\n  char *contents = (char *)self_contents;\n  memmove(contents + index * element_size, contents + (index + 1) * element_size,\n          (*size - index - 1) * element_size);\n  (*size)--;\n}\n\n/// This is not what you're looking for, see `array_reserve`.\nstatic inline void *_array__reserve(void *contents, uint32_t *capacity,\n                                  size_t element_size, uint32_t new_capacity) {\n  void *new_contents = contents;\n  if (new_capacity > *capacity) {\n    if (contents) {\n      new_contents = ts_realloc(contents, new_capacity * element_size);\n    } else {\n      new_contents = ts_malloc(new_capacity * element_size);\n    }\n    *capacity = new_capacity;\n  }\n  return new_contents;\n}\n\n/// This is not what you're looking for, see `array_assign`.\nstatic inline void *_array__assign(void* self_contents, uint32_t *self_size, uint32_t *self_capacity,\n                                 const void *other_contents, uint32_t other_size, size_t element_size) {\n  void *new_contents = _array__reserve(self_contents, self_capacity, element_size, other_size);\n  *self_size = other_size;\n  memcpy(new_contents, other_contents, *self_size * element_size);\n  return new_contents;\n}\n\n/// This is not what you're looking for, see `array_swap`.\nstatic inline void _array__swap(uint32_t *self_size, uint32_t *self_capacity,\n                               uint32_t *other_size, uint32_t *other_capacity) {\n  uint32_t tmp_size = *self_size;\n  uint32_t tmp_capacity = *self_capacity;\n  *self_size = *other_size;\n  *self_capacity = *other_capacity;\n  *other_size = tmp_size;\n  *other_capacity = tmp_capacity;\n}\n\n/// This is not what you're looking for, see `array_push` or `array_grow_by`.\nstatic inline void *_array__grow(void *contents, uint32_t size, uint32_t *capacity,\n                               uint32_t count, size_t element_size) {\n  void *new_contents = contents;\n  uint32_t new_size = size + count;\n  if (new_size > *capacity) {\n    uint32_t new_capacity = *capacity * 2;\n    if (new_capacity < 8) new_capacity = 8;\n    if (new_capacity < new_size) new_capacity = new_size;\n    new_contents = _array__reserve(contents, capacity, element_size, new_capacity);\n  }\n  return new_contents;\n}\n\n/// This is not what you're looking for, see `array_splice`.\nstatic inline void *_array__splice(void *self_contents, uint32_t *size, uint32_t *capacity,\n                                 size_t element_size,\n                                 uint32_t index, uint32_t old_count,\n                                 uint32_t new_count, const void *elements) {\n  uint32_t new_size = *size + new_count - old_count;\n  uint32_t old_end = index + old_count;\n  uint32_t new_end = index + new_count;\n  assert(old_end <= *size);\n\n  void *new_contents = _array__reserve(self_contents, capacity, element_size, new_size);\n\n  char *contents = (char *)new_contents;\n  if (*size > old_end) {\n    memmove(\n      contents + new_end * element_size,\n      contents + old_end * element_size,\n      (*size - old_end) * element_size\n    );\n  }\n  if (new_count > 0) {\n    if (elements) {\n      memcpy(\n        (contents + index * element_size),\n        elements,\n        new_count * element_size\n      );\n    } else {\n      memset(\n        (contents + index * element_size),\n        0,\n        new_count * element_size\n      );\n    }\n  }\n  *size += new_count - old_count;\n\n  return new_contents;\n}\n\n/// A binary search routine, based on Rust's `std::slice::binary_search_by`.\n/// This is not what you're looking for, see `array_search_sorted_with` or `array_search_sorted_by`.\n#define _array__search_sorted(self, start, compare, suffix, needle, _index, _exists) \\\n  do { \\\n    *(_index) = start; \\\n    *(_exists) = false; \\\n    uint32_t size = (self)->size - *(_index); \\\n    if (size == 0) break; \\\n    int comparison; \\\n    while (size > 1) { \\\n      uint32_t half_size = size / 2; \\\n      uint32_t mid_index = *(_index) + half_size; \\\n      comparison = compare(&((self)->contents[mid_index] suffix), (needle)); \\\n      if (comparison <= 0) *(_index) = mid_index; \\\n      size -= half_size; \\\n    } \\\n    comparison = compare(&((self)->contents[*(_index)] suffix), (needle)); \\\n    if (comparison == 0) *(_exists) = true; \\\n    else if (comparison < 0) *(_index) += 1; \\\n  } while (0)\n\n/// Helper macro for the `_sorted_by` routines below. This takes the left (existing)\n/// parameter by reference in order to work with the generic sorting function above.\n#define _compare_int(a, b) ((int)*(a) - (int)(b))\n\n#ifdef _MSC_VER\n#pragma warning(pop)\n#elif defined(__GNUC__) || defined(__clang__)\n#pragma GCC diagnostic pop\n#endif\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // TREE_SITTER_ARRAY_H_\n"
  },
  {
    "path": "src/tree_sitter/parser.h",
    "content": "#ifndef TREE_SITTER_PARSER_H_\n#define TREE_SITTER_PARSER_H_\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#include <stdbool.h>\n#include <stdint.h>\n#include <stdlib.h>\n\n#define ts_builtin_sym_error ((TSSymbol)-1)\n#define ts_builtin_sym_end 0\n#define TREE_SITTER_SERIALIZATION_BUFFER_SIZE 1024\n\n#ifndef TREE_SITTER_API_H_\ntypedef uint16_t TSStateId;\ntypedef uint16_t TSSymbol;\ntypedef uint16_t TSFieldId;\ntypedef struct TSLanguage TSLanguage;\ntypedef struct TSLanguageMetadata {\n  uint8_t major_version;\n  uint8_t minor_version;\n  uint8_t patch_version;\n} TSLanguageMetadata;\n#endif\n\ntypedef struct {\n  TSFieldId field_id;\n  uint8_t child_index;\n  bool inherited;\n} TSFieldMapEntry;\n\n// Used to index the field and supertype maps.\ntypedef struct {\n  uint16_t index;\n  uint16_t length;\n} TSMapSlice;\n\ntypedef struct {\n  bool visible;\n  bool named;\n  bool supertype;\n} TSSymbolMetadata;\n\ntypedef struct TSLexer TSLexer;\n\nstruct TSLexer {\n  int32_t lookahead;\n  TSSymbol result_symbol;\n  void (*advance)(TSLexer *, bool);\n  void (*mark_end)(TSLexer *);\n  uint32_t (*get_column)(TSLexer *);\n  bool (*is_at_included_range_start)(const TSLexer *);\n  bool (*eof)(const TSLexer *);\n  void (*log)(const TSLexer *, const char *, ...);\n};\n\ntypedef enum {\n  TSParseActionTypeShift,\n  TSParseActionTypeReduce,\n  TSParseActionTypeAccept,\n  TSParseActionTypeRecover,\n} TSParseActionType;\n\ntypedef union {\n  struct {\n    uint8_t type;\n    TSStateId state;\n    bool extra;\n    bool repetition;\n  } shift;\n  struct {\n    uint8_t type;\n    uint8_t child_count;\n    TSSymbol symbol;\n    int16_t dynamic_precedence;\n    uint16_t production_id;\n  } reduce;\n  uint8_t type;\n} TSParseAction;\n\ntypedef struct {\n  uint16_t lex_state;\n  uint16_t external_lex_state;\n} TSLexMode;\n\ntypedef struct {\n  uint16_t lex_state;\n  uint16_t external_lex_state;\n  uint16_t reserved_word_set_id;\n} TSLexerMode;\n\ntypedef union {\n  TSParseAction action;\n  struct {\n    uint8_t count;\n    bool reusable;\n  } entry;\n} TSParseActionEntry;\n\ntypedef struct {\n  int32_t start;\n  int32_t end;\n} TSCharacterRange;\n\nstruct TSLanguage {\n  uint32_t abi_version;\n  uint32_t symbol_count;\n  uint32_t alias_count;\n  uint32_t token_count;\n  uint32_t external_token_count;\n  uint32_t state_count;\n  uint32_t large_state_count;\n  uint32_t production_id_count;\n  uint32_t field_count;\n  uint16_t max_alias_sequence_length;\n  const uint16_t *parse_table;\n  const uint16_t *small_parse_table;\n  const uint32_t *small_parse_table_map;\n  const TSParseActionEntry *parse_actions;\n  const char * const *symbol_names;\n  const char * const *field_names;\n  const TSMapSlice *field_map_slices;\n  const TSFieldMapEntry *field_map_entries;\n  const TSSymbolMetadata *symbol_metadata;\n  const TSSymbol *public_symbol_map;\n  const uint16_t *alias_map;\n  const TSSymbol *alias_sequences;\n  const TSLexerMode *lex_modes;\n  bool (*lex_fn)(TSLexer *, TSStateId);\n  bool (*keyword_lex_fn)(TSLexer *, TSStateId);\n  TSSymbol keyword_capture_token;\n  struct {\n    const bool *states;\n    const TSSymbol *symbol_map;\n    void *(*create)(void);\n    void (*destroy)(void *);\n    bool (*scan)(void *, TSLexer *, const bool *symbol_whitelist);\n    unsigned (*serialize)(void *, char *);\n    void (*deserialize)(void *, const char *, unsigned);\n  } external_scanner;\n  const TSStateId *primary_state_ids;\n  const char *name;\n  const TSSymbol *reserved_words;\n  uint16_t max_reserved_word_set_size;\n  uint32_t supertype_count;\n  const TSSymbol *supertype_symbols;\n  const TSMapSlice *supertype_map_slices;\n  const TSSymbol *supertype_map_entries;\n  TSLanguageMetadata metadata;\n};\n\nstatic inline bool set_contains(const TSCharacterRange *ranges, uint32_t len, int32_t lookahead) {\n  uint32_t index = 0;\n  uint32_t size = len - index;\n  while (size > 1) {\n    uint32_t half_size = size / 2;\n    uint32_t mid_index = index + half_size;\n    const TSCharacterRange *range = &ranges[mid_index];\n    if (lookahead >= range->start && lookahead <= range->end) {\n      return true;\n    } else if (lookahead > range->end) {\n      index = mid_index;\n    }\n    size -= half_size;\n  }\n  const TSCharacterRange *range = &ranges[index];\n  return (lookahead >= range->start && lookahead <= range->end);\n}\n\n/*\n *  Lexer Macros\n */\n\n#ifdef _MSC_VER\n#define UNUSED __pragma(warning(suppress : 4101))\n#else\n#define UNUSED __attribute__((unused))\n#endif\n\n#define START_LEXER()           \\\n  bool result = false;          \\\n  bool skip = false;            \\\n  UNUSED                        \\\n  bool eof = false;             \\\n  int32_t lookahead;            \\\n  goto start;                   \\\n  next_state:                   \\\n  lexer->advance(lexer, skip);  \\\n  start:                        \\\n  skip = false;                 \\\n  lookahead = lexer->lookahead;\n\n#define ADVANCE(state_value) \\\n  {                          \\\n    state = state_value;     \\\n    goto next_state;         \\\n  }\n\n#define ADVANCE_MAP(...)                                              \\\n  {                                                                   \\\n    static const uint16_t map[] = { __VA_ARGS__ };                    \\\n    for (uint32_t i = 0; i < sizeof(map) / sizeof(map[0]); i += 2) {  \\\n      if (map[i] == lookahead) {                                      \\\n        state = map[i + 1];                                           \\\n        goto next_state;                                              \\\n      }                                                               \\\n    }                                                                 \\\n  }\n\n#define SKIP(state_value) \\\n  {                       \\\n    skip = true;          \\\n    state = state_value;  \\\n    goto next_state;      \\\n  }\n\n#define ACCEPT_TOKEN(symbol_value)     \\\n  result = true;                       \\\n  lexer->result_symbol = symbol_value; \\\n  lexer->mark_end(lexer);\n\n#define END_STATE() return result;\n\n/*\n *  Parse Table Macros\n */\n\n#define SMALL_STATE(id) ((id) - LARGE_STATE_COUNT)\n\n#define STATE(id) id\n\n#define ACTIONS(id) id\n\n#define SHIFT(state_value)            \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .state = (state_value)          \\\n    }                                 \\\n  }}\n\n#define SHIFT_REPEAT(state_value)     \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .state = (state_value),         \\\n      .repetition = true              \\\n    }                                 \\\n  }}\n\n#define SHIFT_EXTRA()                 \\\n  {{                                  \\\n    .shift = {                        \\\n      .type = TSParseActionTypeShift, \\\n      .extra = true                   \\\n    }                                 \\\n  }}\n\n#define REDUCE(symbol_name, children, precedence, prod_id) \\\n  {{                                                       \\\n    .reduce = {                                            \\\n      .type = TSParseActionTypeReduce,                     \\\n      .symbol = symbol_name,                               \\\n      .child_count = children,                             \\\n      .dynamic_precedence = precedence,                    \\\n      .production_id = prod_id                             \\\n    },                                                     \\\n  }}\n\n#define RECOVER()                    \\\n  {{                                 \\\n    .type = TSParseActionTypeRecover \\\n  }}\n\n#define ACCEPT_INPUT()              \\\n  {{                                \\\n    .type = TSParseActionTypeAccept \\\n  }}\n\n#ifdef __cplusplus\n}\n#endif\n\n#endif  // TREE_SITTER_PARSER_H_\n"
  },
  {
    "path": "test/corpus/annotations.txt",
    "content": "================================\nClasses\n================================\n\n@deprecated(\"Use D\", \"1.0\") class C {}\n\n---\n\n(compilation_unit\n  (class_definition\n    (annotation (type_identifier) (arguments (string) (string)))\n    (identifier)\n    (template_body)))\n\n================================\nDeclarations and definitions\n================================\n\nclass A(x: String) {\n  @transient @volatile var y: Int\n  @transient @volatile val z = x\n\n  @throws(Error)\n  @deprecated(message = \"Don't use this\", since = \"1.0\")\n  def foo() {}\n}\n\n---\n\n(compilation_unit\n  (class_definition (identifier)\n    (class_parameters (class_parameter (identifier) (type_identifier)))\n    (template_body\n      (var_declaration\n        (annotation (type_identifier))\n        (annotation (type_identifier))\n        (identifier) (type_identifier))\n      (val_definition\n        (annotation (type_identifier))\n        (annotation (type_identifier))\n        (identifier) (identifier))\n      (function_definition\n        (annotation (type_identifier) (arguments (identifier)))\n        (annotation (type_identifier)\n          (arguments\n            (assignment_expression (identifier) (string))\n            (assignment_expression (identifier) (string))))\n        (identifier) (parameters) (block)))))\n\n================================\nParameters\n================================\n\nclass A(@one x: String) {\n  def foo(@another x: Int) {}\n}\n\n---\n\n(compilation_unit\n  (class_definition (identifier)\n    (class_parameters\n      (class_parameter\n        (annotation (type_identifier)) (identifier) (type_identifier)))\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters (parameter\n                      (annotation (type_identifier))\n                      (identifier) (type_identifier)))\n        (block)))))\n\n================================\nTypes\n================================\n\ntrait Function0[@specialized(Unit, Int, Double) T] {\n  def apply: T\n}\n\n---\n\n(compilation_unit\n  (trait_definition (identifier)\n    (type_parameters\n      (annotation (type_identifier) (arguments (identifier) (identifier) (identifier))) (identifier))\n    (template_body (function_declaration (identifier) (type_identifier)))))\n"
  },
  {
    "path": "test/corpus/comments.txt",
    "content": "================================================================================\nSingle line comments\n================================================================================\n\n// comment 1\n// comment 2\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (comment)\n  (comment))\n\n================================================================================\nBlock comments\n================================================================================\n/**/\n/** comment 1\n * /* comment 2\n *  /* / * * /comment 3 */\n // comment 4\n * @param\n *  */\n*/\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (block_comment)\n  (block_comment\n    (block_comment\n      (block_comment))))\n\n================================================================================\nSingle line comments with block comment\n================================================================================\n\n// /*\n//  * This is awesome comment\n// */\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (comment)\n  (comment)\n  (comment))\n\n================================================================================\nBlock comment with single-line comment inside\n================================================================================\n\n/* // */\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (block_comment))\n\n================================================================================\nUsing directives\n================================================================================\n\n//> using jvm graalvm:21\n//> using scala 3.3.0\n//> using dep foo:bar:1,2,3,url=https://github.com\n//> using exclude \"examples/*\" \"*/resources/*\"\n// > just a comment\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (comment\n    (using_directive\n      (using_directive_key)\n      (using_directive_value)))\n  (comment\n    (using_directive\n      (using_directive_key)\n      (using_directive_value)))\n  (comment\n    (using_directive\n      (using_directive_key)\n      (using_directive_value)))\n  (comment\n    (using_directive\n      (using_directive_key)\n      (using_directive_value)))\n  (comment))\n\n================================================================================\nShebang\n================================================================================\n\n#!/usr/bin/env -S scala-cli shebang -S 3\n\n\"shebang\"\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (comment)\n  (string))\n"
  },
  {
    "path": "test/corpus/definitions-pending.txt",
    "content": "================================================================================\nFunction without parens\n:skip\n================================================================================\n\n// https://github.com/scala/scala3/blob/main/tests/pos/multiLineOps.scala#L15\nsend_! \"!\"\n\n--------------------------------------------------------------------------------\n"
  },
  {
    "path": "test/corpus/definitions.txt",
    "content": "================================================================================\nIdentifiers\n================================================================================\n\n  def m = ???\n  def unary_! = true\n  def a_-> = ???\n  def __symtem = ???\n  def empty_? = ???\n  def ひらがな = ???\n  def a_^ = ???\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (operator_identifier))\n  (function_definition\n    (identifier)\n    (boolean_literal))\n  (function_definition\n    (identifier)\n    (operator_identifier))\n  (function_definition\n    (identifier)\n    (operator_identifier))\n  (function_definition\n    (identifier)\n    (operator_identifier))\n  (function_definition\n    (identifier)\n    (operator_identifier))\n  (function_definition\n    (identifier)\n    (operator_identifier)))\n\n================================================================================\n$ in identifier names\n================================================================================\n\nclass $A$B$ {\n  val b$, c$ : Int\n  val d$ : String\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (val_declaration\n        (identifier)\n        (identifier)\n        (type_identifier))\n      (val_declaration\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nOperator identifiers\n================================================================================\n\ntype ::[+Ab] = scala.collection.immutable.::[Ab]\nval :: = scala.collection.immutable.::\n\nval +: = scala.collection.+:\nval :+ = scala.collection.:+\n\ndef → = ???\n\nval test = id.##\n\nval x = y\n/////////\n// avoid matching slashes as operator\n/////////\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (type_parameters\n      (covariant_type_parameter\n        (identifier)))\n    (generic_type\n      (stable_type_identifier\n        (stable_identifier\n          (stable_identifier\n            (identifier)\n            (identifier))\n          (identifier))\n        (type_identifier))\n      (type_arguments\n        (type_identifier))))\n  (val_definition\n    (operator_identifier)\n    (field_expression\n      (field_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (identifier))\n      (operator_identifier)))\n  (val_definition\n    (operator_identifier)\n    (field_expression\n      (field_expression\n        (identifier)\n        (identifier))\n      (operator_identifier)))\n  (val_definition\n    (operator_identifier)\n    (field_expression\n      (field_expression\n        (identifier)\n        (identifier))\n      (operator_identifier)))\n  (function_definition\n    (operator_identifier)\n    (operator_identifier))\n  (val_definition\n    (identifier)\n    (field_expression\n      (identifier)\n      (operator_identifier)))\n  (val_definition\n    (identifier)\n    (identifier))\n  (comment)\n  (comment)\n  (comment))\n\n================================================================================\nPackage\n================================================================================\n\npackage a.b\npackage c {\n  object A\n}\npackage d {\n  package e {\n    object B\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (package_clause\n    (package_identifier\n      (identifier)\n      (identifier)))\n  (package_clause\n    (package_identifier\n      (identifier))\n    (template_body\n      (object_definition\n        (identifier))))\n  (package_clause\n    (package_identifier\n      (identifier))\n    (template_body\n      (package_clause\n        (package_identifier\n          (identifier))\n        (template_body\n          (object_definition\n            (identifier)))))))\n\n================================================================================\nPackage with comma\n================================================================================\n\npackage a.b;\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (package_clause\n    (package_identifier\n      (identifier)\n      (identifier))))\n\n================================================================================\nPackage (Scala 3 syntax)\n================================================================================\n\npackage a.b\npackage c:\n  object A\n\npackage d:\n  object A\nend d\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (package_clause\n    (package_identifier\n      (identifier)\n      (identifier)))\n  (package_clause\n    (package_identifier\n      (identifier))\n    (template_body\n      (object_definition\n        (identifier))))\n  (package_clause\n    (package_identifier\n      (identifier))\n    (template_body\n      (object_definition\n        (identifier)))))\n\n================================================================================\nPackage object\n================================================================================\n\npackage object d extends A {\n  val hello: String = \"there\"\n}\n\npackage object p1 {\n  package object p2 {\n    val a = 1\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (package_object\n    (identifier)\n    (extends_clause\n      (type_identifier))\n    (template_body\n      (val_definition\n        (identifier)\n        (type_identifier)\n        (string))))\n  (package_object\n    (identifier)\n    (template_body\n      (package_object\n        (identifier)\n        (template_body\n          (val_definition\n            (identifier)\n            (integer_literal)))))))\n\n================================================================================\nImports\n================================================================================\n\nimport PartialFunction.condOpt\nimport a.b, c.e\nimport reflect.io.{Directory, File, Path}\nimport a.{\n  b,\n}\nimport Opts.+\nimport a.{ :: }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (identifier)\n    (identifier))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (identifier)\n      (identifier)\n      (identifier)))\n  (import_declaration\n    (identifier)\n    (namespace_selectors\n      (identifier)))\n  (import_declaration\n    (identifier)\n    (operator_identifier))\n  (import_declaration\n    (identifier)\n    (namespace_selectors\n      (operator_identifier))))\n\n================================================================================\nImports: Wildcard\n================================================================================\n\nimport tools.nsc.classpath._\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (identifier)\n    (namespace_wildcard)))\n\n================================================================================\nImports: Wildcard (Scala 3 syntax)\n================================================================================\n\nimport tools.nsc.classpath.*\nimport a.b.*, b.c, c.*\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (identifier)\n    (namespace_wildcard))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (namespace_wildcard)\n    (identifier)\n    (identifier)\n    (identifier)\n    (namespace_wildcard)))\n\n================================================================================\nImports: Wildcard and wildcard givens (Scala 3 syntax)\n================================================================================\n\nimport tools.nsc.classpath.{*, given}\nimport tools.given\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (namespace_wildcard)\n      (namespace_wildcard)))\n  (import_declaration\n    (identifier)\n    (namespace_wildcard)))\n\n================================================================================\nImports: Givens by type (Scala 3 syntax)\n================================================================================\n\nimport tools.nsc.classpath.{given Test, given Test2, Test3}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (type_identifier)\n      (type_identifier)\n      (identifier))))\n\n================================================================================\nImports: Rename (Scala 3 Syntax)\n================================================================================\n\nimport lang.System.{lineSeparator as EOL}\nimport lang.System.lineSeparator as EOL\nimport lang.System.lineSeparator as _\nimport lineSeparator as ls\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (as_renamed_identifier\n        (identifier)\n        (identifier))))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (as_renamed_identifier\n      (identifier)\n      (identifier)))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (as_renamed_identifier\n      (identifier)\n      (wildcard)))\n  (import_declaration\n    (as_renamed_identifier\n      (identifier)\n      (identifier))))\n\n================================================================================\nImports: Rename\n================================================================================\n\nimport lang.System.{lineSeparator => EOL}\nimport lang.System.{lineSeparator => _}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (import_declaration\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (arrow_renamed_identifier\n        (identifier)\n        (identifier))))\n  (import_declaration\n    (identifier)\n    (identifier)\n    (namespace_selectors\n      (arrow_renamed_identifier\n        (identifier)\n        (wildcard)))))\n\n================================================================================\nObject definitions\n================================================================================\n\n// o1\nobject O1 {\n}\n\ncase object O2 {\n}\n\nobject O3 extends A {\n}\n\nobject O4 extends {\n  val a: A = b\n}\n\nobject O5 {\n  ;;\n  ;\n  ;\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (comment)\n  (object_definition\n    (identifier)\n    (template_body))\n  (object_definition\n    (identifier)\n    (template_body))\n  (object_definition\n    (identifier)\n    (extends_clause\n      (type_identifier))\n    (template_body))\n  (object_definition\n    (identifier)\n    (extends_clause\n      (structural_type\n        (val_definition\n          (identifier)\n          (type_identifier)\n          (identifier)))))\n  (object_definition\n    (identifier)\n    (template_body)))\n\n================================================================================\nObject definitions\n================================================================================\ncase object A extends B derives C, D {}\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (extends_clause\n      (type_identifier))\n    (derives_clause\n      (type_identifier)\n      (type_identifier))\n    (template_body)))\n\n================================================================================\nClass definitions\n================================================================================\n\nclass C[\n  T,\n  U,\n](a: => A, b: B, c: C*) {\n}\n\nclass A\n()\n()\n{}\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (identifier))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (lazy_parameter_type\n          (type_identifier)))\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (repeated_parameter_type\n          (type_identifier))))\n    (template_body))\n  (class_definition\n    (identifier)\n    (class_parameters)\n    (class_parameters)\n    (template_body)))\n\n================================================================================\nClass definitions (Scala 3)\n================================================================================\nfinal case class C() \n  extends A \n  derives B, C.D\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (modifiers)\n    (identifier)\n    (class_parameters)\n    (extends_clause\n      (type_identifier))\n    (derives_clause\n      (type_identifier)\n      (stable_type_identifier\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nSubclass definitions\n================================================================================\n\nclass A extends B.C[D, E] {\n}\n\nclass A(b: B) extends C(b || ok) {\n}\n\nobject C {\n    class A\n        extends B[T]\n        with C[T]\n}\n\nclass D(c: String) extends E(c) with F\n\nclass MyClass extends Potato() with Tomato\n\nclass A extends B(c)(d)(e)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (extends_clause\n      (generic_type\n        (stable_type_identifier\n          (identifier)\n          (type_identifier))\n        (type_arguments\n          (type_identifier)\n          (type_identifier))))\n    (template_body))\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (extends_clause\n      (type_identifier)\n      (arguments\n        (infix_expression\n          (identifier)\n          (operator_identifier)\n          (identifier))))\n    (template_body))\n  (object_definition\n    (identifier)\n    (template_body\n      (class_definition\n        (identifier)\n        (extends_clause\n          (generic_type\n            (type_identifier)\n            (type_arguments\n              (type_identifier)))\n          (generic_type\n            (type_identifier)\n            (type_arguments\n              (type_identifier)))))))\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (extends_clause\n      (type_identifier)\n      (arguments\n        (identifier))\n      (type_identifier)))\n  (class_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)\n      (arguments)\n      (type_identifier)))\n  (class_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)\n      (arguments\n        (identifier))\n      (arguments\n        (identifier))\n      (arguments\n        (identifier)))))\n\n================================================================================\nSubclass definitions (Scala 3 syntax)\n================================================================================\n\nclass A extends B, C:\n 1\nend A\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)\n      (type_identifier))\n    (template_body\n      (integer_literal))))\n\n================================================================================\nClass definitions with parameters\n================================================================================\n\nclass Point(\n  val x: Int,\n  val y: Int,\n)(implicit coord: Coord)\n\nclass A @Inject()(x: Int, y: Int)\n\nclass A @ann() (x: Int, y: Int)\n\nclass A @ann ()(x: Int, y: Int)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (annotation\n      (type_identifier)\n      (arguments)\n      (arguments))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (annotation\n      (type_identifier)\n      (arguments)\n      (arguments))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (annotation\n      (type_identifier))\n    (class_parameters)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nClass definitions with parameters (Scala 3 syntax)\n================================================================================\n\nclass Point(val x: Int, val y: Int)(using coord: Coord)\n\nclass A @ann (x: Int, y: Int)\n\nclass A @ann(1) (x: Int, y: Int)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (annotation\n      (type_identifier))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (annotation\n      (type_identifier)\n      (arguments)\n      (arguments\n        (integer_literal))\n      (arguments))\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nModifiers\n================================================================================\n\nimplicit final sealed class Point {\n  private override def getX() = 1\n}\n\nprivate[a] class D[T] private (x: T) {\n  private[a] def b: Byte\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (modifiers)\n    (identifier)\n    (template_body\n      (function_definition\n        (modifiers\n          (access_modifier))\n        (identifier)\n        (parameters)\n        (integer_literal))))\n  (class_definition\n    (modifiers\n      (access_modifier\n        (access_qualifier\n          (identifier))))\n    (identifier)\n    (type_parameters\n      (identifier))\n    (access_modifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (template_body\n      (function_declaration\n        (modifiers\n          (access_modifier\n            (access_qualifier\n              (identifier))))\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nTrait definitions\n================================================================================\n\ntrait A extends B\n\ntrait A extends B with C derives D\n\ntrait T[U] {\n}\n\ntrait T[U] extends V.W[U] {\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (trait_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)))\n  (trait_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)\n      (type_identifier))\n    (derives_clause\n      (type_identifier)))\n  (trait_definition\n    (identifier)\n    (type_parameters\n      (identifier))\n    (template_body))\n  (trait_definition\n    (identifier)\n    (type_parameters\n      (identifier))\n    (extends_clause\n      (generic_type\n        (stable_type_identifier\n          (identifier)\n          (type_identifier))\n        (type_arguments\n          (type_identifier))))\n    (template_body)))\n\n================================================================================\nValue declarations\n================================================================================\n\nclass A {\n  val b, c : Int\n  val d : String\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (val_declaration\n        (identifier)\n        (identifier)\n        (type_identifier))\n      (val_declaration\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nValue declarations (Scala 3 syntax)\n================================================================================\n\nclass A:\n // Comments that should not\n  // influence indentation\n  val b, c : Int\n  val d : String\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (comment)\n      (comment)\n      (val_declaration\n        (identifier)\n        (identifier)\n        (type_identifier))\n      (val_declaration\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nValue definitions\n================================================================================\n\nclass A {\n  val b = 1\n  val c : String = \"d\"\n  val a, b, c: T3 = triple\n  var a, b, c = triple\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (val_definition\n        (identifier)\n        (integer_literal))\n      (val_definition\n        (identifier)\n        (type_identifier)\n        (string))\n      (val_definition\n        (identifiers\n          (identifier)\n          (identifier)\n          (identifier))\n        (type_identifier)\n        (identifier))\n      (var_definition\n        (identifiers\n          (identifier)\n          (identifier)\n          (identifier))\n        (identifier)))))\n\n================================================================================\nVariable declarations\n================================================================================\n\nclass A {\n  var b, c : Int\n  var d : String\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (var_declaration\n        (identifier)\n        (identifier)\n        (type_identifier))\n      (var_declaration\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\nVariable definitions\n================================================================================\n\nclass A {\n  var b : Int = 1\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (var_definition\n        (identifier)\n        (type_identifier)\n        (integer_literal)))))\n\n================================================================================\nVariable definitions (Scala 3 syntax)\n================================================================================\n\nclass A:\n  var b: Int = 1\n  var c: Int =\n    val d = 2\n    d\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (var_definition\n        (identifier)\n        (type_identifier)\n        (integer_literal))\n      (var_definition\n        (identifier)\n        (type_identifier)\n        (indented_block\n          (val_definition\n            (identifier)\n            (integer_literal))\n          (identifier))))))\n\n================================================================================\nType definitions\n================================================================================\n\nclass A {\n  type B = C\n  type D[E] = F\n  type Abs\n  type Beta[B]\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (type_identifier))\n      (type_definition\n        (type_identifier)\n        (type_parameters\n          (identifier))\n        (type_identifier))\n      (type_definition\n        (type_identifier))\n      (type_definition\n        (type_identifier)\n        (type_parameters\n          (identifier))))))\n\n================================================================================\nType definitions (Scala 3 syntax)\n================================================================================\n\nclass A:\n  type Element: Order\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (context_bound\n          (type_identifier))))))\n\n================================================================================\nFunction declarations\n================================================================================\n\nclass A {\n  def b(c: D) : E\n  def <*[B](that: IO[B]): IO[A]\n  def c\n    (a: A): B\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_declaration\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier))\n      (function_declaration\n        (operator_identifier)\n        (type_parameters\n          (identifier))\n        (parameters\n          (parameter\n            (identifier)\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier))))\n      (function_declaration\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier)))))\n\n================================================================================\nFunction definitions\n================================================================================\n\nclass A {\n  def b(\n    c: D,\n    e: F,\n  ) = 1\n\n  def l: Int =\n    1\n\n  def m = ()\n\n  def n(using a: A)\n    (using B <:< B, C =:= C) = ()\n\n  def o()\n    : Int = 42\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier))\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (integer_literal))\n      (function_definition\n        (identifier)\n        (type_identifier)\n        (indented_block\n          (integer_literal)))\n      (function_definition\n        (identifier)\n        (unit))\n      (function_definition\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (parameters\n          (infix_type\n            (type_identifier)\n            (operator_identifier)\n            (type_identifier))\n          (infix_type\n            (type_identifier)\n            (operator_identifier)\n            (type_identifier)))\n        (unit))\n      (function_definition\n        (identifier)\n        (parameters)\n        (type_identifier)\n        (integer_literal)))))\n\n================================================================================\nFunction definitions (Scala 3 syntax)\n================================================================================\n\nclass A:\n  def foo(c: C): Int =\n    val x = 1\n    val y = 2\n    x + y\n\n  // SIP-47 - Clause Interleaving\n  def getOrElse(k: Key)[V >: k.Value](default: V): V\n\n  def aaa[A](using a: A)(b: List[A])[C <: a.type, D](cd: (C, D))[E]: Unit\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier)\n        (indented_block\n          (val_definition\n            (identifier)\n            (integer_literal))\n          (val_definition\n            (identifier)\n            (integer_literal))\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier))\n          (comment)))\n      (function_declaration\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_parameters\n          (identifier)\n          (lower_bound\n            (stable_type_identifier\n              (identifier)\n              (type_identifier))))\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier))\n      (function_declaration\n        (identifier)\n        (type_parameters\n          (identifier))\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (parameters\n          (parameter\n            (identifier)\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (type_parameters\n          (identifier)\n          (upper_bound\n            (singleton_type\n              (identifier)))\n          (identifier))\n        (parameters\n          (parameter\n            (identifier)\n            (tuple_type\n              (type_identifier)\n              (type_identifier))))\n        (type_parameters\n          (identifier))\n        (type_identifier)))))\n\n================================================================================\nExtension methods (Scala 3 syntax)\n================================================================================\n\nobject A:\n  extension (c: C)\n    def foo: Int = 1\n  \n  extension [A1](d: D) def foo = \"foo\"\n\ntrait B:\n  extension (x: Int) def bar: String\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (extension_definition\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (function_definition\n          (identifier)\n          (type_identifier)\n          (integer_literal)))\n      (extension_definition\n        (type_parameters\n          (identifier))\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (function_definition\n          (identifier)\n          (string)))))\n  (trait_definition\n    (identifier)\n    (template_body\n      (extension_definition\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (function_declaration\n          (identifier)\n          (type_identifier))))))\n\n================================================================================\nGiven instance definitions (Scala 3 syntax)\n================================================================================\n\nobject A:\n  given a: A = x\n\n  given intFoo: CanFoo[Int] with\n    def foo(x: Int): Int = 0\n\n  given intFoo: CanFoo[Int]:\n    def foo(x: Int): Int = 0\n\n  given CanFoo[Int] with\n    def foo(x: Int): Int = 0\n\n  private given listFoo[A1](using ev: CanFoo[A1]): CanFoo[List[A1]] with\n    def foo(xs: List[A1]): Int = 0\n\n  given foo(using ev: Foo)\n    : Foo = ev\n\n  given Context = ctx\n\n  given Context[T] = ctx\n\n  given Foo[Int] =\n    case n => \"123\"\n\n  given (using a: Int): Int = a\n\n  given [A: Foo]: Foo[List[A]] with\n    def x = ()\n\n  given [A](using Foo[A]): Foo[List[A]] with\n    def x = ()\n\n  trait B:\n    given c: Context[T]\n\n  given (config: Config) => Factory = ConcreteFactory()\n\n  given lila.db.NoDbHandler[GoodPercent] with {}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (given_definition\n        (identifier)\n        (type_identifier)\n        (identifier))\n      (given_definition\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (parameters\n              (parameter\n                (identifier)\n                (type_identifier)))\n            (type_identifier)\n            (integer_literal))))\n      (given_definition\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (parameters\n              (parameter\n                (identifier)\n                (type_identifier)))\n            (type_identifier)\n            (integer_literal))))\n      (given_definition\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (parameters\n              (parameter\n                (identifier)\n                (type_identifier)))\n            (type_identifier)\n            (integer_literal))))\n      (given_definition\n        (modifiers\n          (access_modifier))\n        (identifier)\n        (type_parameters\n          (identifier))\n        (parameters\n          (parameter\n            (identifier)\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (parameters\n              (parameter\n                (identifier)\n                (generic_type\n                  (type_identifier)\n                  (type_arguments\n                    (type_identifier)))))\n            (type_identifier)\n            (integer_literal))))\n      (given_definition\n        (identifier)\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier)\n        (identifier))\n      (given_definition\n        (type_identifier)\n        (identifier))\n      (given_definition\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (identifier))\n      (given_definition\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (indented_cases\n          (case_clause\n            (identifier)\n            (string))))\n      (given_definition\n        (parameters\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier)\n        (identifier))\n      (given_definition\n        (type_parameters\n          (identifier)\n          (context_bound\n            (type_identifier)))\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (unit))))\n      (given_definition\n        (type_parameters\n          (identifier))\n        (parameters\n          (generic_type\n            (type_identifier)\n            (type_arguments\n              (type_identifier))))\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))))\n        (with_template_body\n          (function_definition\n            (identifier)\n            (unit))))\n      (trait_definition\n        (identifier)\n        (template_body\n          (given_definition\n            (identifier)\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier))))))\n      (given_definition\n        (given_conditional\n          (parameter\n            (identifier)\n            (type_identifier)))\n        (type_identifier)\n        (call_expression\n          (identifier)\n          (arguments)))\n      (given_definition\n        (generic_type\n          (stable_type_identifier\n            (stable_identifier\n              (identifier)\n              (identifier))\n            (type_identifier))\n          (type_arguments\n            (type_identifier)))\n        (with_template_body)))))\n\n================================================================================\nGiven with type parameters (Scala 3.4+ syntax)\n================================================================================\n\nobject A:\n  given [T: Foo as bar] => Serde[T] = x\n\n  given [T <: M] => (config: K) => Serde[T] = x\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    name: (identifier)\n    body: (template_body\n      (given_definition\n        (type_parameters\n          name: (identifier)\n          bound: (context_bound\n            type: (type_identifier)\n            name: (identifier)))\n        return_type: (generic_type\n          type: (type_identifier)\n          type_arguments: (type_arguments\n            (type_identifier)))\n        body: (identifier))\n      (given_definition\n        (type_parameters\n          name: (identifier)\n          bound: (upper_bound\n            type: (type_identifier)))\n        (given_conditional\n          (parameter\n            name: (identifier)\n            type: (type_identifier)))\n        return_type: (generic_type\n          type: (type_identifier)\n          type_arguments: (type_arguments\n            (type_identifier)))\n        body: (identifier)))))\n\n================================================================================\nClass with using type-only parameters (Scala 3 syntax)\n================================================================================\n\nclass Foo(x: Int)(using A, B, Runtime[Any]) extends Bar\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    name: (identifier)\n    class_parameters: (class_parameters\n      (class_parameter\n        name: (identifier)\n        type: (type_identifier)))\n    class_parameters: (class_parameters\n      type: (type_identifier)\n      type: (type_identifier)\n      type: (generic_type\n        type: (type_identifier)\n        type_arguments: (type_arguments\n          (type_identifier))))\n    extend: (extends_clause\n      type: (type_identifier))))\n\n================================================================================\nTop-level Definitions (Scala 3 syntax)\n================================================================================\n\nclass A:\n  def a() =\n    ()\n\ndef a() = 1\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (indented_block\n          (unit)))))\n  (function_definition\n    (identifier)\n    (parameters)\n    (integer_literal)))\n\n================================================================================\nInitialization expressions\n================================================================================\n\nclass A(val x: Int, val y: Int) {\n  assert(x != 0)\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier))\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (template_body\n      (call_expression\n        (identifier)\n        (arguments\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (integer_literal)))))))\n\n================================================================================\nOptional parameters\n================================================================================\n\ndef mkLines(header: String, indented: Boolean = false, repeated: Long = 0L): String = {}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier))\n      (parameter\n        (identifier)\n        (type_identifier)\n        (boolean_literal))\n      (parameter\n        (identifier)\n        (type_identifier)\n        (integer_literal)))\n    (type_identifier)\n    (block)))\n\n================================================================================\nEnums (Scala 3)\n================================================================================\n\n@A\nprivate enum Hello[Y] extends java.Enumeration derives Codec, Eq {\n  @A(\"\") @B case World, You\n  @A case Test[A](bla: Int, yo: String) extends Hello[A]\n  case T extends Hello[String](25)\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (enum_definition\n    (annotation\n      (type_identifier))\n    (modifiers\n      (access_modifier))\n    (identifier)\n    (type_parameters\n      (identifier))\n    (extends_clause\n      (stable_type_identifier\n        (identifier)\n        (type_identifier)))\n    (derives_clause\n      (type_identifier)\n      (type_identifier))\n    (enum_body\n      (enum_case_definitions\n        (annotation\n          (type_identifier)\n          (arguments\n            (string)))\n        (annotation\n          (type_identifier))\n        (simple_enum_case\n          (identifier))\n        (simple_enum_case\n          (identifier)))\n      (enum_case_definitions\n        (annotation\n          (type_identifier))\n        (full_enum_case\n          (identifier)\n          (type_parameters\n            (identifier))\n          (class_parameters\n            (class_parameter\n              (identifier)\n              (type_identifier))\n            (class_parameter\n              (identifier)\n              (type_identifier)))\n          (extends_clause\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier))))))\n      (enum_case_definitions\n        (simple_enum_case\n          (identifier)\n          (extends_clause\n            (generic_type\n              (type_identifier)\n              (type_arguments\n                (type_identifier)))\n            (arguments\n              (integer_literal))))))))\n\n================================================================================\nSelf types\n================================================================================\n\ntrait A {\n  self => \n  def f: Int\n}\n\ntrait A { self =>\n  def f: Int\n}\n\nclass B {\n  self: Something[A] =>\n\n  case class Hello(a: Int)\n}\n\ntrait C {\n  _: Analyzer with StdAttachments =>\n  def a = 1\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (trait_definition\n    (identifier)\n    (template_body\n      (self_type\n        (identifier))\n      (function_declaration\n        (identifier)\n        (type_identifier))))\n  (trait_definition\n    (identifier)\n    (template_body\n      (self_type\n        (identifier))\n      (function_declaration\n        (identifier)\n        (type_identifier))))\n  (class_definition\n    (identifier)\n    (template_body\n      (self_type\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier))))\n      (class_definition\n        (identifier)\n        (class_parameters\n          (class_parameter\n            (identifier)\n            (type_identifier))))))\n  (trait_definition\n    (identifier)\n    (template_body\n      (self_type\n        (wildcard)\n        (compound_type\n          (type_identifier)\n          (type_identifier)))\n      (function_definition\n        (identifier)\n        (integer_literal)))))\n\n================================================================================\nInline methods and parameters (Scala 3)\n================================================================================\n\ninline def mkLines(inline header: String, indented: Boolean = false): String = {}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (modifiers\n      (inline_modifier))\n    (identifier)\n    (parameters\n      (parameter\n        (inline_modifier)\n        (identifier)\n        (type_identifier))\n      (parameter\n        (identifier)\n        (type_identifier)\n        (boolean_literal)))\n    (type_identifier)\n    (block)))\n\n================================================================================\nInline val (Scala 3)\n================================================================================\n\ninline def test() =\n  inline val x = true\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (modifiers\n      (inline_modifier))\n    (identifier)\n    (parameters)\n    (indented_block\n      (val_definition\n        (modifiers\n          (inline_modifier))\n        (identifier)\n        (boolean_literal)))))\n\n================================================================================\nInline given (Scala 3)\n================================================================================\n\ninline given Test = \n  new Test\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (given_definition\n    (modifiers\n      (inline_modifier))\n    (type_identifier)\n    (indented_block\n      (instance_expression\n        (type_identifier)))))\n\n================================================================================\nInfix methods (Scala 3)\n================================================================================\n\nobject Test:\n  inline infix private def hello = 25\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (modifiers\n          (inline_modifier)\n          (infix_modifier)\n          (access_modifier))\n        (identifier)\n        (integer_literal)))))\n\n================================================================================\nOpen classes (Scala 3)\n================================================================================\n\nopen class Test(a: Int):\n  def test = 25\nend Test\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (modifiers\n      (open_modifier))\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (type_identifier)))\n    (template_body\n      (function_definition\n        (identifier)\n        (integer_literal)))))\n\n================================================================================\nTraits (Scala 3)\n================================================================================\n\ntransparent trait Kind:\n  this: A =>\n  def test = 1\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (trait_definition\n    (modifiers\n      (transparent_modifier))\n    (identifier)\n    (template_body\n      (self_type\n        (identifier)\n        (type_identifier))\n      (function_definition\n        (identifier)\n        (integer_literal)))))\n\n================================================================================\nExports (Scala 3)\n================================================================================\n\nexport scanUnit.scan\nexport printUnit.{status as _, *}\nexport printUnit.Test as Hello\nexport printUnit.Test as _\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (export_declaration\n    (identifier)\n    (identifier))\n  (export_declaration\n    (identifier)\n    (namespace_selectors\n      (as_renamed_identifier\n        (identifier)\n        (wildcard))\n      (namespace_wildcard)))\n  (export_declaration\n    (identifier)\n    (as_renamed_identifier\n      (identifier)\n      (identifier)))\n  (export_declaration\n    (identifier)\n    (as_renamed_identifier\n      (identifier)\n      (wildcard))))\n\n================================================================================\n'into' soft modifier (Scala 3)\n================================================================================\n\ninto trait Modifier:\n  val into: Int\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (trait_definition\n    (modifiers\n      (into_modifier))\n    (identifier)\n    (template_body\n      (val_declaration\n        (identifier)\n        (type_identifier)))))\n\n================================================================================\n'tracked' soft modifier (Scala 3)\n================================================================================\n\nclass F(tracked val x: C):\n  tracked val tracked: Int\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (modifiers\n          (tracked_modifier))\n        (identifier)\n        (type_identifier)))\n    (template_body\n      (val_declaration\n        (modifiers\n          (tracked_modifier))\n        (identifier)\n        (type_identifier)))))\n"
  },
  {
    "path": "test/corpus/expressions.txt",
    "content": "================================================================================\nCall expressions\n================================================================================\n\nclass C {\n  def main() {\n    a()\n    a(\n      123,\n      234,\n    )\n    ::(123)\n    a(b, c)\n    a.map(x => x + 1)\n    a { 123 }\n    a { b }\n    a.map{ x => x + 1 }\n    /* comment */ a.exists { case ((i, _)) => i }\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (call_expression\n            (identifier)\n            (arguments))\n          (call_expression\n            (identifier)\n            (arguments\n              (integer_literal)\n              (integer_literal)))\n          (call_expression\n            (operator_identifier)\n            (arguments\n              (integer_literal)))\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier)\n              (identifier)))\n          (call_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (arguments\n              (lambda_expression\n                (identifier)\n                (infix_expression\n                  (identifier)\n                  (operator_identifier)\n                  (integer_literal)))))\n          (call_expression\n            (identifier)\n            (block\n              (integer_literal)))\n          (call_expression\n            (identifier)\n            (block\n              (identifier)))\n          (call_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (block\n              (lambda_expression\n                (identifier)\n                (infix_expression\n                  (identifier)\n                  (operator_identifier)\n                  (integer_literal)))))\n          (block_comment)\n          (call_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (case_block\n              (case_clause\n                (tuple_pattern\n                  (tuple_pattern\n                    (identifier)\n                    (wildcard)))\n                (identifier)))))))))\n\n================================================================================\nCall expressions (Scala 3 syntax)\n================================================================================\n\nclass C {\n  a(b, c)(using A.B)\n\n  foo(new A:\n    def a = new B:\n      def b = 1)\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (call_expression\n        (call_expression\n          (identifier)\n          (arguments\n            (identifier)\n            (identifier)))\n        (arguments\n          (field_expression\n            (identifier)\n            (identifier))))\n      (call_expression\n        (identifier)\n        (arguments\n          (instance_expression\n            (type_identifier)\n            (template_body\n              (function_definition\n                (identifier)\n                (instance_expression\n                  (type_identifier)\n                  (template_body\n                    (function_definition\n                      (identifier)\n                      (integer_literal))))))))))))\n\n================================================================================\nSIP-44 Fewer braces (Scala 3 syntax)\n================================================================================\n\nclass C:\n  xs.map: x =>\n    x + 1\n\n  xs.map:\n    x =>\n      x + 1\n\n\n  xs.map: (_: Int, a) =>\n    a\n\n  xs:\n    println(\"\")\n\n  xs `++`:\n    val x = 1\n    List(x)\n\n  xs.map:\n    case x => x\n\n  // This is ascription\n  xs: Int\n  // This is call_expression\n  xs:\n    Int\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (colon_argument\n          (identifier)\n          (indented_block\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (integer_literal)))))\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (colon_argument\n          (indented_block\n            (lambda_expression\n              (identifier)\n              (indented_block\n                (infix_expression\n                  (identifier)\n                  (operator_identifier)\n                  (integer_literal)))))))\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (colon_argument\n          (bindings\n            (binding\n              (wildcard)\n              (type_identifier))\n            (binding\n              (identifier)))\n          (indented_block\n            (identifier))))\n      (call_expression\n        (identifier)\n        (colon_argument\n          (indented_block\n            (call_expression\n              (identifier)\n              (arguments\n                (string))))))\n      (infix_expression\n        (identifier)\n        (identifier)\n        (colon_argument\n          (indented_block\n            (val_definition\n              (identifier)\n              (integer_literal))\n            (call_expression\n              (identifier)\n              (arguments\n                (identifier))))))\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (colon_argument\n          (indented_cases\n            (case_clause\n              (identifier)\n              (identifier))\n            (comment))))\n      (ascription_expression\n        (identifier)\n        (type_identifier))\n      (comment)\n      (call_expression\n        (identifier)\n        (colon_argument\n          (indented_block\n            (identifier)))))))\n\n================================================================================\nTrailing comma after for comprehension in lambda parameter of a function\n================================================================================\n\nfoo(o =>\n    for {\n      a <- o\n    } yield a,\n  )\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (call_expression\n    function: (identifier)\n    arguments: (arguments\n      (lambda_expression\n        parameters: (identifier)\n        (indented_block\n          (for_expression\n            enumerators: (enumerators\n              (enumerator\n                (identifier)\n                (identifier)))\n            body: (identifier)))))))\n\n================================================================================\nLeading infix operator at lower indent continues the expression across dedent\n================================================================================\n\nxs.filter(x =>\n     a\n  && b\n)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (call_expression\n    function: (field_expression\n      value: (identifier)\n      field: (identifier))\n    arguments: (arguments\n      (lambda_expression\n        parameters: (identifier)\n        (indented_block\n          (infix_expression\n            left: (identifier)\n            operator: (operator_identifier)\n            right: (identifier)))))))\n\n================================================================================\nColon argument followed by comma\n================================================================================\n\nboxTop(\n    back.map: url =>\n      a(b),\n    title,\n    x match\n      case a => a,\n)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (call_expression\n    (identifier)\n    (arguments\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (colon_argument\n          (identifier)\n          (indented_block\n            (call_expression\n              (identifier)\n              (arguments\n                (identifier))))))\n      (identifier)\n      (match_expression\n        (identifier)\n        (indented_cases\n          (case_clause\n            (identifier)\n            (identifier)))))))\n\n================================================================================\nGeneric functions\n================================================================================\n\nclass C {\n  def main() {\n    a[\n      A1,\n      A2,\n    ]()\n    List[Traversable[ClassPath]]()\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (call_expression\n            (generic_function\n              (identifier)\n              (type_arguments\n                (type_identifier)\n                (type_identifier)))\n            (arguments))\n          (call_expression\n            (generic_function\n              (identifier)\n              (type_arguments\n                (generic_type\n                  (type_identifier)\n                  (type_arguments\n                    (type_identifier)))))\n            (arguments)))))))\n\n================================================================================\nAssignments\n================================================================================\n\na = b\na(1) = c\nviews =\n  val key = 1\n  key + 1\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (assignment_expression\n    (identifier)\n    (identifier))\n  (assignment_expression\n    (call_expression\n      (identifier)\n      (arguments\n        (integer_literal)))\n    (identifier))\n  (assignment_expression\n    (identifier)\n    (indented_block\n      (val_definition\n        (identifier)\n        (integer_literal))\n      (infix_expression\n        (identifier)\n        (operator_identifier)\n        (integer_literal)))))\n\n================================================================================\nIf expressions\n================================================================================\n\nclass C {\n  def main() {\n    if (a) b()\n    if (c) {\n      d()\n      e()\n    } else if (f) {\n      g()\n    } else {\n      h()\n    }\n  }\n}\n\ndef other() {\n  if (a) {\n    b\n  };\n  else c()\n}\n\ndef another() {\n  if (a) b match {\n    case _ => c\n  } else d\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (if_expression\n            (parenthesized_expression\n              (identifier))\n            (call_expression\n              (identifier)\n              (arguments)))\n          (if_expression\n            (parenthesized_expression\n              (identifier))\n            (block\n              (call_expression\n                (identifier)\n                (arguments))\n              (call_expression\n                (identifier)\n                (arguments)))\n            (if_expression\n              (parenthesized_expression\n                (identifier))\n              (block\n                (call_expression\n                  (identifier)\n                  (arguments)))\n              (block\n                (call_expression\n                  (identifier)\n                  (arguments)))))))))\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (if_expression\n        (parenthesized_expression\n          (identifier))\n        (block\n          (identifier))\n        (call_expression\n          (identifier)\n          (arguments)))))\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (if_expression\n        (parenthesized_expression\n          (identifier))\n        (match_expression\n          (identifier)\n          (case_block\n            (case_clause\n              (wildcard)\n              (identifier))))\n        (identifier)))))\n\n================================================================================\nIf expressions (Scala 3 syntax)\n================================================================================\n\nclass C:\n  def main() =\n    if a then b()\n    end if\n\n    if\n      val c = false\n      c\n    then\n      d()\n      1\n    else if f then\n      g()\n    else\n      h()\n\n    if true then\n      ()\n\n    // comment\n    else\n      ()\n\n    if (a) || b(c) then return true\n\n    if (a) && b.c then\n      ()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (indented_block\n          (if_expression\n            (identifier)\n            (call_expression\n              (identifier)\n              (arguments)))\n          (if_expression\n            (indented_block\n              (val_definition\n                (identifier)\n                (boolean_literal))\n              (identifier))\n            (indented_block\n              (call_expression\n                (identifier)\n                (arguments))\n              (integer_literal))\n            (if_expression\n              (identifier)\n              (indented_block\n                (call_expression\n                  (identifier)\n                  (arguments)))\n              (indented_block\n                (call_expression\n                  (identifier)\n                  (arguments)))))\n          (if_expression\n            (boolean_literal)\n            (indented_block\n              (unit)\n              (comment))\n            (indented_block\n              (unit)))\n          (if_expression\n            (infix_expression\n              (parenthesized_expression\n                (identifier))\n              (operator_identifier)\n              (call_expression\n                (identifier)\n                (arguments\n                  (identifier))))\n            (return_expression\n              (boolean_literal)))\n          (if_expression\n            (infix_expression\n              (parenthesized_expression\n                (identifier))\n              (operator_identifier)\n              (field_expression\n                (identifier)\n                (identifier)))\n            (indented_block\n              (unit))))))))\n\n================================================================================\nTry expressions\n================================================================================\n\ndef main() {\n  try a() finally depth -= 1\n  try {\n    doThing()\n  } catch {\n    case e: SomeException => prinlnt(e.message)\n    case NonFatal(ex) => throw new SomeException(ex)\n  } finally {\n    tryAnotherThing()\n  }\n  try b()\n  catch { case e => println(e) }\n  finally doFinalThing()\n  try a()\n  finally b()\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (try_expression\n        (call_expression\n          (identifier)\n          (arguments))\n        (finally_clause\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (integer_literal))))\n      (try_expression\n        (block\n          (call_expression\n            (identifier)\n            (arguments)))\n        (catch_clause\n          (case_block\n            (case_clause\n              (typed_pattern\n                (identifier)\n                (type_identifier))\n              (call_expression\n                (identifier)\n                (arguments\n                  (field_expression\n                    (identifier)\n                    (identifier)))))\n            (case_clause\n              (case_class_pattern\n                (type_identifier)\n                (identifier))\n              (throw_expression\n                (instance_expression\n                  (type_identifier)\n                  (arguments\n                    (identifier)))))))\n        (finally_clause\n          (block\n            (call_expression\n              (identifier)\n              (arguments)))))\n      (try_expression\n        (call_expression\n          (identifier)\n          (arguments))\n        (catch_clause\n          (case_block\n            (case_clause\n              (identifier)\n              (call_expression\n                (identifier)\n                (arguments\n                  (identifier))))))\n        (finally_clause\n          (call_expression\n            (identifier)\n            (arguments))))\n      (try_expression\n        (call_expression\n          (identifier)\n          (arguments))\n        (finally_clause\n          (call_expression\n            (identifier)\n            (arguments)))))))\n\n================================================================================\nTry expressions (Scala 3 syntax)\n================================================================================\n\ndef main(): Unit =\n  try a() finally depth -= 1\n\n  try\n    a()\n    b()\n  catch\n    case e: SomeException => prinlnt(e.message)\n    case NonFatal(ex)     => throw new SomeException(ex)\n  finally\n    tryAnotherThing()\n    tryAnotherThing2()\n  try a catch case b: C => e finally f\n  try a catch case b: C =>\n    e\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (type_identifier)\n    (indented_block\n      (try_expression\n        (call_expression\n          (identifier)\n          (arguments))\n        (finally_clause\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (integer_literal))))\n      (try_expression\n        (indented_block\n          (call_expression\n            (identifier)\n            (arguments))\n          (call_expression\n            (identifier)\n            (arguments)))\n        (catch_clause\n          (indented_cases\n            (case_clause\n              (typed_pattern\n                (identifier)\n                (type_identifier))\n              (call_expression\n                (identifier)\n                (arguments\n                  (field_expression\n                    (identifier)\n                    (identifier)))))\n            (case_clause\n              (case_class_pattern\n                (type_identifier)\n                (identifier))\n              (throw_expression\n                (instance_expression\n                  (type_identifier)\n                  (arguments\n                    (identifier)))))))\n        (finally_clause\n          (indented_block\n            (call_expression\n              (identifier)\n              (arguments))\n            (call_expression\n              (identifier)\n              (arguments)))))\n      (try_expression\n        (identifier)\n        (catch_clause\n          (typed_pattern\n            (identifier)\n            (type_identifier))\n          (identifier))\n        (finally_clause\n          (identifier)))\n      (try_expression\n        (identifier)\n        (catch_clause\n          (typed_pattern\n            (identifier)\n            (type_identifier))\n          (identifier))))))\n\n================================================================================\nMatch expressions\n================================================================================\n\ndef matchTest(x: Int): String = x match {\n  case 0 =>\n  case 1 => \"one\"; \"uno\"\n  case 2 => \"two\"\n  case 3 => {\n    \"3\"\n  }\n  case 4 => \n    ;\n  case A if a == 1 =>\n  case A if a == 2 => 2\n  case ((i, _)) => i\n  case s\"$l1 -- $l2\" => \n    l1 + l2\n  case _ =>\n    val x = \"many\"\n    \"more\"\n  case a if b => c\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (integer_literal))\n        (case_clause\n          (integer_literal)\n          (string)\n          (string))\n        (case_clause\n          (integer_literal)\n          (string))\n        (case_clause\n          (integer_literal)\n          (block\n            (string)))\n        (case_clause\n          (integer_literal))\n        (case_clause\n          (identifier)\n          (guard\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (integer_literal))))\n        (case_clause\n          (identifier)\n          (guard\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (integer_literal)))\n          (integer_literal))\n        (case_clause\n          (tuple_pattern\n            (tuple_pattern\n              (identifier)\n              (wildcard)))\n          (identifier))\n        (case_clause\n          (interpolated_string_expression\n            (identifier)\n            (interpolated_string\n              (interpolation\n                (identifier))\n              (interpolation\n                (identifier))))\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier)))\n        (case_clause\n          (wildcard)\n          (val_definition\n            (identifier)\n            (string))\n          (string))\n        (case_clause\n          (identifier)\n          (guard\n            (identifier))\n          (identifier))))))\n\n================================================================================\nMatch expressions (Scala 3 syntax)\n================================================================================\n\ndef matchTest(x: Int): String =\n  x match\n    case 0 =>\n    case 1 => \"one\"; \"uno\"\n    case 2 => \"two\"\n    case x if x == 3 =>\n      val x = \"3\"\n      x\n    case ((i, _)) => i\n    case _ =>\n      val x = \"many\"\n      \"more\"\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (indented_block\n      (match_expression\n        (identifier)\n        (indented_cases\n          (case_clause\n            (integer_literal))\n          (case_clause\n            (integer_literal)\n            (string)\n            (string))\n          (case_clause\n            (integer_literal)\n            (string))\n          (case_clause\n            (identifier)\n            (guard\n              (infix_expression\n                (identifier)\n                (operator_identifier)\n                (integer_literal)))\n            (val_definition\n              (identifier)\n              (string))\n            (identifier))\n          (case_clause\n            (tuple_pattern\n              (tuple_pattern\n                (identifier)\n                (wildcard)))\n            (identifier))\n          (case_clause\n            (wildcard)\n            (val_definition\n              (identifier)\n              (string))\n            (string)))))))\n\n================================================================================\nDot-syntax for match expressions (Scala 3 syntax)\n================================================================================\n\ndef matchTest(x: Int): String =\n  x\n   .find()\n   .match\n     case 0 =>\n     case 1 => \n   .run()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (indented_block\n      (call_expression\n        (field_expression\n          (match_expression\n            (call_expression\n              (field_expression\n                (identifier)\n                (identifier))\n              (arguments))\n            (indented_cases\n              (case_clause\n                (integer_literal))\n              (case_clause\n                (integer_literal))))\n          (identifier))\n        (arguments)))))\n\n================================================================================\nField expressions\n================================================================================\n\nclass C {\n  def main() {\n    a.b = c\n    a.b.d\n    a\n      .b\n      // comment1\n      /* \n         comment2 \n      */\n      .c\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (assignment_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (identifier))\n          (field_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (identifier))\n          (field_expression\n            (field_expression\n              (identifier)\n              (identifier))\n            (comment)\n            (block_comment)\n            (identifier)))))))\n\n================================================================================\nInstance expressions\n================================================================================\n\nclass C {\n  def main() {\n    val a = new B\n    val c = new D(e, f)\n    val e = new E:\n      def app = 1\n    val f = new:\n      def app = 1\n    val g = new G {}\n    val i = new {\n      \"ok\"\n    }\n    new Array: Array\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (val_definition\n            (identifier)\n            (instance_expression\n              (type_identifier)))\n          (val_definition\n            (identifier)\n            (instance_expression\n              (type_identifier)\n              (arguments\n                (identifier)\n                (identifier))))\n          (val_definition\n            (identifier)\n            (instance_expression\n              (type_identifier)\n              (template_body\n                (function_definition\n                  (identifier)\n                  (integer_literal)))))\n          (val_definition\n            (identifier)\n            (instance_expression\n              (template_body\n                (function_definition\n                  (identifier)\n                  (integer_literal)))))\n          (val_definition\n            (identifier)\n            (instance_expression\n              (type_identifier)\n              (template_body)))\n          (val_definition\n            (identifier)\n            (instance_expression\n              (template_body\n                (string))))\n          (ascription_expression\n            (instance_expression\n              (type_identifier))\n            (type_identifier)))))))\n\n================================================================================\nInfix expressions\n================================================================================\n\nclass C {\n  def main() {\n    a = b max c\n    d + e + f\n    a ** b\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (assignment_expression\n            (identifier)\n            (infix_expression\n              (identifier)\n              (identifier)\n              (identifier)))\n          (infix_expression\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (identifier))\n            (operator_identifier)\n            (identifier))\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier)))))))\n\n================================================================================\nMulti-line infix expressions with leading infix operators\n================================================================================\n\ndef foo =\n  a\n  || b\n  && c\n  `in` d\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (indented_block\n      (infix_expression\n        (infix_expression\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier))\n          (operator_identifier)\n          (identifier))\n        (identifier)\n        (identifier)))))\n\n================================================================================\nPrefix expressions\n================================================================================\n\nclass C {\n  def main() {\n    !a\n    +a + b\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (parameters)\n        (block\n          (prefix_expression\n            (identifier))\n          (infix_expression\n            (prefix_expression\n              (identifier))\n            (operator_identifier)\n            (identifier)))))))\n\n================================================================================\n??? as standalone statement\n================================================================================\n\nfinal def a =\n  println(1)\n  ???\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (modifiers)\n    name: (identifier)\n    body: (indented_block\n      (call_expression\n        function: (identifier)\n        arguments: (arguments\n          (integer_literal)))\n      (operator_identifier))))\n\n================================================================================\nPostfix expressions\n================================================================================\n\nobject O {\n  val v = \"value\" toUpperCase\n  val c = 1 + 2 toString\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (val_definition\n        (identifier)\n        (postfix_expression\n          (string)\n          (identifier)))\n      (val_definition\n        (identifier)\n        (postfix_expression\n          (infix_expression\n            (integer_literal)\n            (operator_identifier)\n            (integer_literal))\n          (identifier))))))\n\n================================================================================\nAscription Expression\n================================================================================\n\nobject O {\n  val l = a: List\n  val x = 2: Byte\n  Nil: List[String]\n  x: @unchecked\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (val_definition\n        (identifier)\n        (ascription_expression\n          (identifier)\n          (type_identifier)))\n      (val_definition\n        (identifier)\n        (ascription_expression\n          (integer_literal)\n          (type_identifier)))\n      (ascription_expression\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier))))\n      (ascription_expression\n        (identifier)\n        (annotation\n          (type_identifier))))))\n\n================================================================================\nLambda Expression\n================================================================================\n\nobject O {\n  val l = a => a + 1\n  val b = (x: Int, y: Int) => { x * y }\n  val f = _ => 2\n  foo { i => \n    val x = 2 + i \n    x\n  }\n  { x => \n    val y = 2 * x\n    y * y\n  }\n  { b =>\n   if (c) d.e }\n  { a => implicit b => b }\n  { (_, a) => a }\n  { x: Int => x + 1 }\n  { () => val x = 1; 2 }\n  { () => val tp = qual.tpe; val sym = tp.typeSymbolDirect\n    1\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (val_definition\n        (identifier)\n        (lambda_expression\n          (identifier)\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (integer_literal))))\n      (val_definition\n        (identifier)\n        (lambda_expression\n          (bindings\n            (binding\n              (identifier)\n              (type_identifier))\n            (binding\n              (identifier)\n              (type_identifier)))\n          (block\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (identifier)))))\n      (val_definition\n        (identifier)\n        (lambda_expression\n          (wildcard)\n          (integer_literal)))\n      (call_expression\n        (identifier)\n        (block\n          (lambda_expression\n            (identifier)\n            (indented_block\n              (val_definition\n                (identifier)\n                (infix_expression\n                  (integer_literal)\n                  (operator_identifier)\n                  (identifier)))\n              (identifier)))))\n      (block\n        (lambda_expression\n          (identifier)\n          (indented_block\n            (val_definition\n              (identifier)\n              (infix_expression\n                (integer_literal)\n                (operator_identifier)\n                (identifier)))\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (identifier)))))\n      (block\n        (lambda_expression\n          (identifier)\n          (indented_block\n            (if_expression\n              (parenthesized_expression\n                (identifier))\n              (field_expression\n                (identifier)\n                (identifier))))))\n      (block\n        (lambda_expression\n          (identifier)\n          (lambda_expression\n            (identifier)\n            (identifier))))\n      (block\n        (lambda_expression\n          (bindings\n            (binding\n              (wildcard))\n            (binding\n              (identifier)))\n          (identifier)))\n      (block\n        (lambda_expression\n          (identifier)\n          (type_identifier)\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (integer_literal))))\n      (block\n        (lambda_expression\n          (bindings)\n          (val_definition\n            (identifier)\n            (integer_literal))\n          (integer_literal)))\n      (block\n        (lambda_expression\n          (bindings)\n          (val_definition\n            (identifier)\n            (field_expression\n              (identifier)\n              (identifier)))\n          (val_definition\n            (identifier)\n            (field_expression\n              (identifier)\n              (identifier)))\n          (integer_literal))))))\n\n================================================================================\nLambda Expression (Scala 3 syntax)\n================================================================================\n\nobject O:\n  val f = (a: Int) ?=> (b: Int) => b\n\n  val less: Comparer = [X: Ord] => (x: X, y: X) => ???\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (val_definition\n        (identifier)\n        (lambda_expression\n          (bindings\n            (binding\n              (identifier)\n              (type_identifier)))\n          (lambda_expression\n            (bindings\n              (binding\n                (identifier)\n                (type_identifier)))\n            (identifier))))\n      (val_definition\n        (identifier)\n        (type_identifier)\n        (lambda_expression\n          (type_parameters\n            (identifier)\n            (context_bound\n              (type_identifier)))\n          (bindings\n            (binding\n              (identifier)\n              (type_identifier))\n            (binding\n              (identifier)\n              (type_identifier)))\n          (operator_identifier))))))\n\n================================================================================\nUnit expressions\n================================================================================\n\nval x = ()\ndef f(): Unit = { (   \n); }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (unit))\n  (function_definition\n    (identifier)\n    (parameters)\n    (type_identifier)\n    (block\n      (unit))))\n\n================================================================================\nReturn expressions\n================================================================================\n\ndef f: Unit = return\ndef g(a: A): B = { f(); return null.asInstanceOf[B] }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (type_identifier)\n    (return_expression))\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (block\n      (call_expression\n        (identifier)\n        (arguments))\n      (return_expression\n        (generic_function\n          (field_expression\n            (null_literal)\n            (identifier))\n          (type_arguments\n            (type_identifier)))))))\n\n================================================================================\nWhile loops\n================================================================================\n\ndef f = {\n  while (a) g()\n  while (b < c) {\n    d\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (block\n      (while_expression\n        (parenthesized_expression\n          (identifier))\n        (call_expression\n          (identifier)\n          (arguments)))\n      (while_expression\n        (parenthesized_expression\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier)))\n        (block\n          (identifier))))))\n\n================================================================================\nWhile loops (Scala 3 syntax)\n================================================================================\n\ndef f: Unit =\n  while a do g()\n\n  while\n    val x = 1\n    b < x\n  do\n    ()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (type_identifier)\n    (indented_block\n      (while_expression\n        (identifier)\n        (call_expression\n          (identifier)\n          (arguments)))\n      (while_expression\n        (indented_block\n          (val_definition\n            (identifier)\n            (integer_literal))\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier)))\n        (indented_block\n          (unit))))))\n\n================================================================================\nDo-while loops\n================================================================================\n\ndef f() = {\n  do g(a, b) while(c && d)\n  do {\n    g(a, b)\n    h(a, b)\n  } while (c < d)\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (do_while_expression\n        (call_expression\n          (identifier)\n          (arguments\n            (identifier)\n            (identifier)))\n        (parenthesized_expression\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier))))\n      (do_while_expression\n        (block\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier)\n              (identifier)))\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier)\n              (identifier))))\n        (parenthesized_expression\n          (infix_expression\n            (identifier)\n            (operator_identifier)\n            (identifier)))))))\n\n================================================================================\nFor comprehensions\n================================================================================\n\ndef f() = {\n  for (n <- nums) yield n + 1\n  for (x <- xs; y <- ys) g(x, y)\n  for {\n    x <- xs\n    a = b + c\n    y <- g() if d\n    (t, u) = y\n  } yield {\n    h(x, y)\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (identifier)))\n        (infix_expression\n          (identifier)\n          (operator_identifier)\n          (integer_literal)))\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (identifier))\n          (enumerator\n            (identifier)\n            (identifier)))\n        (call_expression\n          (identifier)\n          (arguments\n            (identifier)\n            (identifier))))\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (identifier))\n          (enumerator\n            (identifier)\n            (infix_expression\n              (identifier)\n              (operator_identifier)\n              (identifier)))\n          (enumerator\n            (identifier)\n            (call_expression\n              (identifier)\n              (arguments))\n            (guard\n              (identifier)))\n          (enumerator\n            (tuple_pattern\n              (identifier)\n              (identifier))\n            (identifier)))\n        (block\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier)\n              (identifier))))))))\n\n================================================================================\nFor comprehensions (Scala 3 syntax)\n================================================================================\n\ndef f(): Unit =\n  for n <- nums yield n + 1\n\n  for\n    a = 1\n    x <- xs\n    y <- ys\n  yield\n    g(x, y)\n\n  for\n    annot <- annotations\n    if shouldEmitAnnotation(annot)\n  do\n    ()\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (type_identifier)\n    (indented_block\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (identifier)))\n        (infix_expression\n          (identifier)\n          (operator_identifier)\n          (integer_literal)))\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (integer_literal))\n          (enumerator\n            (identifier)\n            (identifier))\n          (enumerator\n            (identifier)\n            (identifier)))\n        (indented_block\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier)\n              (identifier)))))\n      (for_expression\n        (enumerators\n          (enumerator\n            (identifier)\n            (identifier))\n          (enumerator\n            (guard\n              (call_expression\n                (identifier)\n                (arguments\n                  (identifier))))))\n        (indented_block\n          (unit))))))\n\n================================================================================\nChained expressions\n================================================================================\n\ndef main() {\n  val myList = List(1, 2, 3)\n\n  myList.map(_ * 2)\n\n  myList\n    .map(_ * 2)\n\n  myList\n    .length\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters)\n    (block\n      (val_definition\n        (identifier)\n        (call_expression\n          (identifier)\n          (arguments\n            (integer_literal)\n            (integer_literal)\n            (integer_literal))))\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (arguments\n          (infix_expression\n            (wildcard)\n            (operator_identifier)\n            (integer_literal))))\n      (call_expression\n        (field_expression\n          (identifier)\n          (identifier))\n        (arguments\n          (infix_expression\n            (wildcard)\n            (operator_identifier)\n            (integer_literal))))\n      (field_expression\n        (identifier)\n        (identifier)))))\n\n================================================================================\nMacros (Scala 2 syntax)\n================================================================================\n\nclass Foo {\n  def a: A =\n    macro B.b\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (type_identifier)\n        (indented_block\n          (macro_body\n            (field_expression\n              (identifier)\n              (identifier))))))))\n\n================================================================================\nMacros (Scala 3 syntax)\n================================================================================\n\nclass A:\n  inline def inspect(inline a: Any): Any =\n    ${ inspectCode('a) }\n\n  def foo =\n    '{ $b }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (modifiers\n          (inline_modifier))\n        (identifier)\n        (parameters\n          (parameter\n            (inline_modifier)\n            (identifier)\n            (type_identifier)))\n        (type_identifier)\n        (indented_block\n          (splice_expression\n            (call_expression\n              (identifier)\n              (arguments\n                (quote_expression\n                  (identifier)))))))\n      (function_definition\n        (identifier)\n        (indented_block\n          (quote_expression\n            (identifier)))))))\n\n================================================================================\nInline matches (Scala 3)\n================================================================================\n\ndef hello = \n  inline c match {\n    case 1 => \n  }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (indented_block\n      (match_expression\n        (inline_modifier)\n        (identifier)\n        (case_block\n          (case_clause\n            (integer_literal)))))))\n\n================================================================================\nInline if (Scala 3)\n================================================================================\n\ndef hello =\n  inline if (x) {} else {}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (indented_block\n      (if_expression\n        (inline_modifier)\n        (parenthesized_expression\n          (identifier))\n        (block)\n        (block)))))\n\n================================================================================\nNested inline if and match (Scala 3)\n================================================================================\n\ndef hello =\n  inline if (x) {\n    inline x match {\n\n    }\n  }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (indented_block\n      (if_expression\n        (inline_modifier)\n        (parenthesized_expression\n          (identifier))\n        (block\n          (match_expression\n            (inline_modifier)\n            (identifier)\n            (case_block)))))))\n\n================================================================================\nTop-level expressions\n================================================================================\n\nvar greeting = \"Good bye\"\ngreeting = \"Hello\"\nval message = greeting + \" from Scala script!\"\n\nif true then\n  println(message)\n\naddSbtPlugin(\"foo\" % \"bar\" % \"0.1\")\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (var_definition\n    (identifier)\n    (string))\n  (assignment_expression\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (infix_expression\n      (identifier)\n      (operator_identifier)\n      (string)))\n  (if_expression\n    (boolean_literal)\n    (indented_block\n      (call_expression\n        (identifier)\n        (arguments\n          (identifier)))))\n  (call_expression\n    (identifier)\n    (arguments\n      (infix_expression\n        (infix_expression\n          (string)\n          (operator_identifier)\n          (string))\n        (operator_identifier)\n        (string)))))\n\n================================================================================\nSoft keywords used as identifiers (Scala 3)\n================================================================================\ninfix()\nopaque()\nopen()\ntransparent()\nas()\nderives()\nend()\nthrows()\nusing()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments))\n  (call_expression\n    (identifier)\n    (arguments)))\n\n================================================================================\nCompound expression with instance declaration, pattern matching with guards and if statement\n================================================================================\n\nnew Foo {\n  tree match {\n    case Foo if foos contains foo =>\n      if (foo) bar\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (instance_expression\n    (type_identifier)\n    (template_body\n      (match_expression\n        (identifier)\n        (case_block\n          (case_clause\n            (identifier)\n            (guard\n              (infix_expression\n                (identifier)\n                (identifier)\n                (identifier)))\n            (if_expression\n              (parenthesized_expression\n                (identifier))\n              (identifier))))))))\n\n================================================================================\nVararg expressions\n================================================================================\n\nfoo(args*)\nbar(xs: _*)\nfoo(a, args*)\nbar(a, xs: _*)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (call_expression\n    function: (identifier)\n    arguments: (arguments\n      (vararg\n        (identifier))))\n  (call_expression\n    function: (identifier)\n    arguments: (arguments\n      (vararg\n        (identifier))))\n  (call_expression\n    function: (identifier)\n    arguments: (arguments\n      (identifier)\n      (vararg\n        (identifier))))\n  (call_expression\n    function: (identifier)\n    arguments: (arguments\n      (identifier)\n      (vararg\n        (identifier)))))\n"
  },
  {
    "path": "test/corpus/literals.txt",
    "content": "================================================================================\nSimple strings\n================================================================================\n\nval emptyString = \"\"\n\nval oneLineString = \"I'm just on one line\"\n\nval stringWithCommentLikeContent1 = \"// not a comment\"\n\nval stringWithCommentLikeContent2 = \"/* not a comment */\"\n\nval stringWithEscapeSequence = \"first line\\nsecond line\"\n\nval multiLineString = \"\"\"\n  a\n  $thisIsntInterpolated\n  ${thisEither}\n  no escape codes in multiline strings \\uD83D\\uDE00 \\n\n\"\"\"\n\nval emptyMultilineStringf = \"\"\"\"\"\"\n\nval stringOfOneDoubleQuote = \"\"\"\"\"\"\"\n\nval multiLineString3 = \"\"\"\\{@inheritDoc\\p{Zs}*\\}\"\"\"\n\nval blackslashDoesNotEscapeClosingQuote = \"\"\"\\\"\"\"\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string\n      (escape_sequence)))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string))\n  (val_definition\n    (identifier)\n    (string)))\n\n================================================================================\nEscape sequences in strings\n================================================================================\n\nval singleEscapeCode = \"\\n\"\n\nval singleCharacterEscapes = \"\\n\\r\\t\\b\\f\\'\\\"\\\\\"\n\nval unicodeEscape = \"\\uD83D\\UDE00\"\n\nval repeatedUs = \"\\uuuuD83D\\UUDE00\"\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (string\n      (escape_sequence)))\n  (val_definition\n    (identifier)\n    (string\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)\n      (escape_sequence)))\n  (val_definition\n    (identifier)\n    (string\n      (escape_sequence)\n      (escape_sequence)))\n  (val_definition\n    (identifier)\n    (string\n      (escape_sequence)\n      (escape_sequence))))\n\n================================================================================\nInterpolated strings\n================================================================================\n\nval empty = s\"\"\n\nval emptyMultiline = s\"\"\"\"\"\"\n\nval string1 = s\"a $b ${c}\"\n\nval string2 = f\"hi $name%s\"\n\nval string3 = raw\"Not a really a new line \\n${ha}.\"\n\nval string4 = s\"\"\"\nworks even in multiline strings, ${name}\n\"\"\"\n\nval string5 = s\"$works${without}$spaces\"\n\nval string6 = s\"$a$b\"\n\nval string7 = s\"$$ $a\"\n\nval string8 = s\"$\"$a\"\n\nval string9 = s\"$\"$a\\uD83D\\UDE00\\n\"\n\nval multiline = raw\"\"\"\n  $$\n  ${interp}\n  \\n\n  \\x\n  \\\"\n\\\"\"\"\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (identifier))\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (identifier)))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (identifier))\n        (interpolation\n          (block\n            (identifier)))\n        (interpolation\n          (identifier)))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (identifier))\n        (interpolation\n          (identifier)))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (identifier)))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (identifier)))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (identifier))\n        (escape_sequence)\n        (escape_sequence)\n        (escape_sequence))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (block\n            (identifier)))))))\n\n================================================================================\nRaw strings\n================================================================================\n\nval emptyRaw = raw\"\"\n\nval emptyMultilineRaw = raw\"\"\"\"\"\"\n\nval invalidEscapeCodesAllowedAndValidEscapesIgnored = raw\"\\n\\t\\x\\w\\g\\k\"\n\nval ErasedFunctionN = raw\"ErasedFunction(\\d+)\".r\n\nval escapedAndInterpolated = raw\"Not a really a new line \\n${ha}.\"\n\nval blackslashQuoteDoesNotCloseString = raw\"\\\"\"\n\nval doubleSlashQuoteDoesCloseString = raw\"\\\\\"\n\nval dollarEscapeInSingleLine = raw\"$$\"\n\nval slashDoesNotEscapeDollarSign = raw\"\\$$\"\n\nval multiline = raw\"\"\"\n  $$\n  ${interp}\n  \\n\n  \\x\n  \\\"\n\\\"\"\"\n\nval ensureIdentifierNamedRawStillWorks = someFunction(raw)\n\nval raw = raw(raw)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (field_expression\n      (interpolated_string_expression\n        (identifier)\n        (interpolated_string))\n      (identifier)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string)))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (call_expression\n      (identifier)\n      (arguments\n        (identifier))))\n  (val_definition\n    (identifier)\n    (call_expression\n      (identifier)\n      (arguments\n        (identifier)))))\n\n================================================================================\nRaw and interpolated strings have equivalent parse trees\n================================================================================\n\nval raw = raw\"Foo $$ ${bar}\"\n\nval raw = s\"Foo $$ ${bar}\"\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (block\n            (identifier))))))\n  (val_definition\n    (identifier)\n    (interpolated_string_expression\n      (identifier)\n      (interpolated_string\n        (escape_sequence)\n        (interpolation\n          (block\n            (identifier)))))))\n\n\n================================================================================\nInteger literals\n================================================================================\n\nval i1 = 0\nval i2 = 1234\nval i3 = -0xF2\nval i4 = 0XA0\nval l1 = -0l\nval l2 = 1234L\nval l3 = 0xF23l\nval l4 = 0XA03L\nval l5 = 150_000_000\nval l6 = 0xFF_FF_FF\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal))\n  (val_definition\n    (identifier)\n    (integer_literal)))\n\n================================================================================\nFloating point literals\n================================================================================\n\nval f1 = 3.14\nval f2 = -3f\nval f2 = 3E-1\nval d1 = .314D\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (floating_point_literal))\n  (val_definition\n    (identifier)\n    (floating_point_literal))\n  (val_definition\n    (identifier)\n    (floating_point_literal))\n  (val_definition\n    (identifier)\n    (floating_point_literal)))\n\n================================================================================\nBoolean literals\n================================================================================\n\nval myBool = true\n\ndef foo(a: Boolean = false) = a && true\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (boolean_literal))\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)\n        (boolean_literal)))\n    (infix_expression\n      (identifier)\n      (operator_identifier)\n      (boolean_literal))))\n\n================================================================================\nCharacter literals\n================================================================================\n\nval myChar = 'c'\n\nval otherChar = '\\u0041'\n\nval otherChar2 = '\\uu0041'\n\nval anotherChar = '\\n'\n\ndef foo(a: Char = 'c') = a + 'd'\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (character_literal))\n  (val_definition\n    (identifier)\n    (character_literal))\n  (val_definition\n    (identifier)\n    (character_literal))\n  (val_definition\n    (identifier)\n    (character_literal))\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)\n        (character_literal)))\n    (infix_expression\n      (identifier)\n      (operator_identifier)\n      (character_literal))))\n\n================================================================================\nNull\n================================================================================\n\nlazy val nullObject: String = null\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (modifiers)\n    (identifier)\n    (type_identifier)\n    (null_literal)))\n\n================================================================================\nTuple literals\n================================================================================\n\nval x = (\n  1,\n  2,\n  3,\n)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (tuple_expression\n      (integer_literal)\n      (integer_literal)\n      (integer_literal))))\n"
  },
  {
    "path": "test/corpus/patterns-pending.txt",
    "content": ""
  },
  {
    "path": "test/corpus/patterns.txt",
    "content": "================================================================================\nAlternative patterns\n================================================================================\n\nval x = y match {\n  case 1 | a => b\n  case \"c\" | \"d\" | \"e\" => f\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (alternative_pattern\n            (integer_literal)\n            (identifier))\n          (identifier))\n        (case_clause\n          (alternative_pattern\n            (alternative_pattern\n              (string)\n              (string))\n            (string))\n          (identifier))))))\n\n================================================================================\nTyped patterns\n================================================================================\n\nval x = y match {\n  case 1 : Int => 2\n  case a : B with C => d\n  case _: B | _: C => 3\n  case Object.Constant => 3\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (typed_pattern\n            (integer_literal)\n            (type_identifier))\n          (integer_literal))\n        (case_clause\n          (typed_pattern\n            (identifier)\n            (compound_type\n              (type_identifier)\n              (type_identifier)))\n          (identifier))\n        (case_clause\n          (alternative_pattern\n            (typed_pattern\n              (wildcard)\n              (type_identifier))\n            (typed_pattern\n              (wildcard)\n              (type_identifier)))\n          (integer_literal))\n        (case_clause\n          (stable_identifier\n            (identifier)\n            (identifier))\n          (integer_literal))))))\n\n================================================================================\nTuple patterns\n================================================================================\n\nval (a, b) = if (c) (d, e) else (f, g)\n\nval x = y match {\n  case (A, B) => X\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (tuple_pattern\n      (identifier)\n      (identifier))\n    (if_expression\n      (parenthesized_expression\n        (identifier))\n      (tuple_expression\n        (identifier)\n        (identifier))\n      (tuple_expression\n        (identifier)\n        (identifier))))\n  (val_definition\n    (identifier)\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (tuple_pattern\n            (identifier)\n            (identifier))\n          (identifier))))))\n\n================================================================================\nName tuple patterns (Scala 3 syntax)\n================================================================================\n\nval x = y match\n  case (a = A, b = B) => ???\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (match_expression\n      (identifier)\n      (indented_cases\n        (case_clause\n          (named_tuple_pattern\n            (named_pattern\n              (identifier)\n              (identifier))\n            (named_pattern\n              (identifier)\n              (identifier)))\n          (operator_identifier))))))\n\n================================================================================\nCase class patterns\n================================================================================\n\ndef showNotification(notification: Notification): String = {\n  notification match {\n    case Email(email, title, _) =>\n      s\"You got an email from $email with title: $title\"\n    case SMS(number, message) =>\n      s\"You got an SMS from $number! Message: $message\"\n    case VoiceRecording(name, link) =>\n      s\"you received a Voice Recording from $name! Click the link to hear it: $link\"\n  }\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (block\n      (match_expression\n        (identifier)\n        (case_block\n          (case_clause\n            (case_class_pattern\n              (type_identifier)\n              (identifier)\n              (identifier)\n              (wildcard))\n            (interpolated_string_expression\n              (identifier)\n              (interpolated_string\n                (interpolation\n                  (identifier))\n                (interpolation\n                  (identifier)))))\n          (case_clause\n            (case_class_pattern\n              (type_identifier)\n              (identifier)\n              (identifier))\n            (interpolated_string_expression\n              (identifier)\n              (interpolated_string\n                (interpolation\n                  (identifier))\n                (interpolation\n                  (identifier)))))\n          (case_clause\n            (case_class_pattern\n              (type_identifier)\n              (identifier)\n              (identifier))\n            (interpolated_string_expression\n              (identifier)\n              (interpolated_string\n                (interpolation\n                  (identifier))\n                (interpolation\n                  (identifier))))))))))\n\n================================================================================\nCase class patterns (Scala 3 syntax)\n================================================================================\n\nclass A:\n  c match\n    case c @ City(name = \"Hoboken\") => c.population\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (match_expression\n        (identifier)\n        (indented_cases\n          (case_clause\n            (capture_pattern\n              (identifier)\n              (case_class_pattern\n                (type_identifier)\n                (named_pattern\n                  (identifier)\n                  (string))))\n            (field_expression\n              (identifier)\n              (identifier))))))))\n\n================================================================================\nInfix patterns\n================================================================================\n\ndef first(x: Seq[Int]) = x match {\n  case e :+ _ => Some(e)\n  case _ => None\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))))\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (infix_pattern\n            (identifier)\n            (operator_identifier)\n            (wildcard))\n          (call_expression\n            (identifier)\n            (arguments\n              (identifier))))\n        (case_clause\n          (wildcard)\n          (identifier))))))\n\n================================================================================\nCapture patterns\n================================================================================\n\nval x = y match {\n  case a @ B(1) => a\n  case b @ C(d @ (e @ X, _: Y)) => e\n  case req @ (POST | GET) -> Root / \"test\" => 5\n  case Array(a: Type, _@_*) => y\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (val_definition\n    (identifier)\n    (match_expression\n      (identifier)\n      (case_block\n        (case_clause\n          (capture_pattern\n            (identifier)\n            (case_class_pattern\n              (type_identifier)\n              (integer_literal)))\n          (identifier))\n        (case_clause\n          (capture_pattern\n            (identifier)\n            (case_class_pattern\n              (type_identifier)\n              (capture_pattern\n                (identifier)\n                (tuple_pattern\n                  (capture_pattern\n                    (identifier)\n                    (identifier))\n                  (typed_pattern\n                    (wildcard)\n                    (type_identifier))))))\n          (identifier))\n        (case_clause\n          (infix_pattern\n            (infix_pattern\n              (capture_pattern\n                (identifier)\n                (tuple_pattern\n                  (alternative_pattern\n                    (identifier)\n                    (identifier))))\n              (operator_identifier)\n              (identifier))\n            (operator_identifier)\n            (string))\n          (integer_literal))\n        (case_clause\n          (case_class_pattern\n            (type_identifier)\n            (typed_pattern\n              (identifier)\n              (type_identifier))\n            (repeat_pattern\n              (capture_pattern\n                (wildcard)\n                (wildcard))))\n          (identifier))))))\n\n================================================================================\nQuoted patterns (Scala 3 syntax)\n================================================================================\n\ndef foo =\n  x match\n    case '{ $boolExpr } => Some(true)\n    case _              => None\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (indented_block\n      (match_expression\n        (identifier)\n        (indented_cases\n          (case_clause\n            (quote_expression\n              (identifier))\n            (call_expression\n              (identifier)\n              (arguments\n                (boolean_literal))))\n          (case_clause\n            (wildcard)\n            (identifier)))))))\n\n================================================================================\nGiven pattern (Scala 3 syntax)\n================================================================================\n\nfor  \n  given Int <- Some(1)\nyield ()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (for_expression\n    (enumerators\n      (enumerator\n        (given_pattern\n          (type_identifier))\n        (call_expression\n          (identifier)\n          (arguments\n            (integer_literal)))))\n    (unit)))\n"
  },
  {
    "path": "test/corpus/types-pending.txt",
    "content": "\n================================================================================\nSubclass with multiline params and unnamed after named param\n:skip\n================================================================================\n\n// https://github.com/tree-sitter/tree-sitter-scala/issues/465\n// https://github.com/scala/scala3/blob/main/tests/run/i14164.scala#L5-L9\nclass Child extends Base(\n  param =\n    for x <- Seq(\"a\") yield x\n    \"param\"\n)\n\n--------------------------------------------------------------------------------\n\n================================================================================\ncase class nested in an object definition\n:skip\n================================================================================\n\n// https://github.com/tree-sitter/tree-sitter-scala/issues/329\nobject Merge:\n\n  case class Location(runIndex: Int, locationInRun: String):\n  end Location\n\nend Merge\n\n--------------------------------------------------------------------------------\n\n\n"
  },
  {
    "path": "test/corpus/types.txt",
    "content": "================================================================================\nStable type identifiers\n================================================================================\n\nobject Main {\n  type A = B.C\n  type D = E.F.G\n  type H = __root__.scala.Int\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (stable_type_identifier\n          (identifier)\n          (type_identifier)))\n      (type_definition\n        (type_identifier)\n        (stable_type_identifier\n          (stable_identifier\n            (identifier)\n            (identifier))\n          (type_identifier)))\n      (type_definition\n        (type_identifier)\n        (stable_type_identifier\n          (stable_identifier\n            (identifier)\n            (identifier))\n          (type_identifier))))))\n\n================================================================================\nGeneric types\n================================================================================\n\nobject Main {\n  type A = B[\n    C,\n    D,\n  ]\n  type E = F.G[H]\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)\n            (type_identifier))))\n      (type_definition\n        (type_identifier)\n        (generic_type\n          (stable_type_identifier\n            (identifier)\n            (type_identifier))\n          (type_arguments\n            (type_identifier)))))))\n\n================================================================================\nTuple types\n================================================================================\n\nobject Main {\n  type A = (B, C)\n  type A = (\n    B,\n    C,\n  )\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (tuple_type\n          (type_identifier)\n          (type_identifier)))\n      (type_definition\n        (type_identifier)\n        (tuple_type\n          (type_identifier)\n          (type_identifier))))))\n\n================================================================================\nNamed tuple types (Scala 3 syntax)\n================================================================================\n\nobject O:\n  type A = (name: String, age: Int)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (named_tuple_type\n          (name_and_type\n            (identifier)\n            (type_identifier))\n          (name_and_type\n            (identifier)\n            (type_identifier)))))))\n\n================================================================================\nFunction types\n================================================================================\n\nobject Main {\n  type A = (B, C) => D\n\n  type A = (B, C) => (D, E)\n\n  type A = B => (D, E)\n}\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (object_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (function_type\n          (parameter_types\n            (type_identifier)\n            (type_identifier))\n          (type_identifier)))\n      (type_definition\n        (type_identifier)\n        (function_type\n          (parameter_types\n            (type_identifier)\n            (type_identifier))\n          (tuple_type\n            (type_identifier)\n            (type_identifier))))\n      (type_definition\n        (type_identifier)\n        (function_type\n          (parameter_types\n            (type_identifier))\n          (tuple_type\n            (type_identifier)\n            (type_identifier)))))))\n\n================================================================================\nPolymorphic function types (Scala 3 syntax)\n================================================================================\n\nclass A:\n  type Comparer = [X: Ord] => (X, X) => Boolean\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (type_definition\n        (type_identifier)\n        (function_type\n          (type_parameters\n            (identifier)\n            (context_bound\n              (type_identifier)))\n          (function_type\n            (parameter_types\n              (type_identifier)\n              (type_identifier))\n            (type_identifier)))))))\n\n================================================================================\nContext function types (Scala 3 syntax)\n================================================================================\n\ntype Executable[A] = ExecutionContext ?=> A\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (type_parameters\n      (identifier))\n    (function_type\n      (parameter_types\n        (type_identifier))\n      (type_identifier))))\n\n================================================================================\nMatch types (Scala 3 syntax)\n================================================================================\n\ntype Elem[A] = A match\n  case String   => Char\n  case Array[a] => a\n  case t *: rest => t\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (type_parameters\n      (identifier))\n    (match_type\n      (type_identifier)\n      (type_case_clause\n        (type_identifier)\n        (type_identifier))\n      (type_case_clause\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (type_identifier))\n      (type_case_clause\n        (infix_type\n          (type_identifier)\n          (operator_identifier)\n          (type_identifier))\n        (type_identifier)))))\n\n================================================================================\nMatch types with braced syntax (Scala 3 syntax)\n================================================================================\n\ntype Elem[A] = A match {\n  case String => Char\n  case Array[a] => a\n  case t *: rest => t\n}\n\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (type_parameters\n      (identifier))\n    (match_type\n      (type_identifier)\n      (type_case_clause\n        (type_identifier)\n        (type_identifier))\n      (type_case_clause\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))\n        (type_identifier))\n      (type_case_clause\n        (infix_type\n          (type_identifier)\n          (operator_identifier)\n          (type_identifier))\n        (type_identifier)))))\n\n================================================================================\nCompound types\n================================================================================\n\ndef cloneAndReset(obj: Cloneable with Resetable): Cloneable = {\n}\n\nclass F extends Cloneable with Resetable with Serializable {}\n\ntype G = H[A1] {\n  def foo[A2 <: Stepper[_]]: A2\n}\n\ntype I = F1[A1:\n  def foo: A2]\n\ndef a: F { val x: Int } = ???\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (parameters\n      (parameter\n        (identifier)\n        (compound_type\n          (type_identifier)\n          (type_identifier))))\n    (type_identifier)\n    (block))\n  (class_definition\n    (identifier)\n    (extends_clause\n      (type_identifier)\n      (type_identifier)\n      (type_identifier))\n    (template_body))\n  (type_definition\n    (type_identifier)\n    (compound_type\n      (generic_type\n        (type_identifier)\n        (type_arguments\n          (type_identifier)))\n      (refinement\n        (function_declaration\n          (identifier)\n          (type_parameters\n            (identifier)\n            (upper_bound\n              (generic_type\n                (type_identifier)\n                (type_arguments\n                  (wildcard)))))\n          (type_identifier)))))\n  (type_definition\n    (type_identifier)\n    (generic_type\n      (type_identifier)\n      (type_arguments\n        (compound_type\n          (type_identifier)\n          (refinement\n            (function_declaration\n              (identifier)\n              (type_identifier)))))))\n  (function_definition\n    (identifier)\n    (compound_type\n      (type_identifier)\n      (refinement\n        (val_declaration\n          (identifier)\n          (type_identifier))))\n    (operator_identifier)))\n\n================================================================================\nInfix types\n================================================================================\n\ntype A = B Foo C\n\ntype A = B ! C or D\n\ntype A = (B, C) ~ D\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (type_identifier)\n      (identifier)\n      (type_identifier)))\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (infix_type\n        (type_identifier)\n        (operator_identifier)\n        (type_identifier))\n      (identifier)\n      (type_identifier)))\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (tuple_type\n        (type_identifier)\n        (type_identifier))\n      (operator_identifier)\n      (type_identifier))))\n\n================================================================================\nVariant Types\n================================================================================\n\nclass Function1[-T1, +R]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (contravariant_type_parameter\n        (identifier))\n      (covariant_type_parameter\n        (identifier)))))\n\n================================================================================\nUpper bound\n================================================================================\n\nclass A[B <: C]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (upper_bound\n        (type_identifier)))))\n\n================================================================================\nLower bound\n================================================================================\n\nclass A[B >: C]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (lower_bound\n        (type_identifier)))))\n\n================================================================================\nLower and upper bounds\n================================================================================\n\nclass A[B >: C <: D]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (lower_bound\n        (type_identifier))\n      (upper_bound\n        (type_identifier)))))\n\n================================================================================\nView bound\n================================================================================\n\n\nclass A[B <% C <% D]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (view_bound\n        (type_identifier))\n      (view_bound\n        (type_identifier)))))\n\n================================================================================\nContext bound\n================================================================================\n\nclass A[B : C : D]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (context_bound\n        (type_identifier))\n      (context_bound\n        (type_identifier)))))\n\n================================================================================\nContext bound (Scala 3 syntax)\n================================================================================\n\ndef reduce[A : Monoid as m](xs: List[A]): A = ()\n\ndef showMax[X : {Ordering, Show}](x: X, y: X): String = ()\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (function_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (context_bound\n        (type_identifier)\n        (identifier)))\n    (parameters\n      (parameter\n        (identifier)\n        (generic_type\n          (type_identifier)\n          (type_arguments\n            (type_identifier)))))\n    (type_identifier)\n    (unit))\n  (function_definition\n    (identifier)\n    (type_parameters\n      (identifier)\n      (context_bound\n        (type_identifier))\n      (context_bound\n        (type_identifier)))\n    (parameters\n      (parameter\n        (identifier)\n        (type_identifier))\n      (parameter\n        (identifier)\n        (type_identifier)))\n    (type_identifier)\n    (unit)))\n\n================================================================================\nProjections\n================================================================================\n\ntype A = B[C]#D\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (projected_type\n      (generic_type\n        (type_identifier)\n        (type_arguments\n          (type_identifier)))\n      (type_identifier))))\n\n================================================================================\nComplex types\n================================================================================\n\ntype A = B with B1 with B2 ! C with C1\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (compound_type\n        (type_identifier)\n        (type_identifier)\n        (type_identifier))\n      (operator_identifier)\n      (compound_type\n        (type_identifier)\n        (type_identifier)))))\n\n================================================================================\nLiteral type aliases (Scala 2.13+)\n================================================================================\n\ntype A = \"hello\"\ntype B = 25\ntype C = false\ntype D = 0.5f\n\nclass Test(d: \"hello\", b: 25)\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (literal_type\n      (string)))\n  (type_definition\n    (type_identifier)\n    (literal_type\n      (integer_literal)))\n  (type_definition\n    (type_identifier)\n    (literal_type\n      (boolean_literal)))\n  (type_definition\n    (type_identifier)\n    (literal_type\n      (floating_point_literal)))\n  (class_definition\n    (identifier)\n    (class_parameters\n      (class_parameter\n        (identifier)\n        (literal_type\n          (string)))\n      (class_parameter\n        (identifier)\n        (literal_type\n          (integer_literal))))))\n\n================================================================================\nSingleton Types\n================================================================================\n\nclass A:\n  def foobar: this.type = this\n  type X = A.B.type\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (class_definition\n    (identifier)\n    (template_body\n      (function_definition\n        (identifier)\n        (singleton_type\n          (identifier))\n        (identifier))\n      (type_definition\n        (type_identifier)\n        (singleton_type\n          (stable_identifier\n            (identifier)\n            (identifier)))))))\n\n================================================================================\nOpaque type aliases (Scala 3)\n================================================================================\n\nopaque type A = Int\nprivate opaque type B = String\nopaque type B >: Test <: Help = String\n\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (opaque_modifier)\n    (type_identifier)\n    (type_identifier))\n  (type_definition\n    (modifiers\n      (access_modifier))\n    (opaque_modifier)\n    (type_identifier)\n    (type_identifier))\n  (type_definition\n    (opaque_modifier)\n    (type_identifier)\n    (lower_bound\n      (type_identifier))\n    (upper_bound\n      (type_identifier))\n    (type_identifier)))\n\n================================================================================\nStructural type\n================================================================================\n\ntype A = { def fly(): Unit }\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (structural_type\n      (function_declaration\n        (identifier)\n        (parameters)\n        (type_identifier)))))\n\n================================================================================\nAnonymous structural type with projection\n================================================================================\n\ntype A = B[({ type f[x] = M[S, x] })#f]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (generic_type\n      (type_identifier)\n      (type_arguments\n        (projected_type\n          (tuple_type\n            (structural_type\n              (type_definition\n                (type_identifier)\n                (type_parameters\n                  (identifier))\n                (generic_type\n                  (type_identifier)\n                  (type_arguments\n                    (type_identifier)\n                    (type_identifier))))))\n          (type_identifier))))))\n\n================================================================================\nType Lambdas (Scala 3)\n================================================================================\n\ntype A = [B <: C] =>> D\ntype Z = [X, Y] =>> Map[Y, X]\nclass A[\n  [B <: C] =>> D\n]\n\n--------------------------------------------------------------------------------\n\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (type_lambda\n      (identifier)\n      (upper_bound\n        (type_identifier))\n      (type_identifier)))\n  (type_definition\n    (type_identifier)\n    (type_lambda\n      (identifier)\n      (identifier)\n      (generic_type\n        (type_identifier)\n        (type_arguments\n          (type_identifier)\n          (type_identifier)))))\n  (class_definition\n    (identifier)\n    (type_parameters\n      (type_lambda\n        (identifier)\n        (upper_bound\n          (type_identifier))\n        (type_identifier)))))\n\n================================================================================\nUnion and Intersection Types (Scala 3)\n================================================================================\n\ntype A = Foo | Bar & Buz\ntype B = \"foo\" | \"bar\" & \"buz\"\n\n--------------------------------------------------------------------------------\n(compilation_unit\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (infix_type\n        (type_identifier)\n        (operator_identifier)\n        (type_identifier))\n      (operator_identifier)\n      (type_identifier)))\n  (type_definition\n    (type_identifier)\n    (infix_type\n      (infix_type\n        (literal_type\n          (string))\n        (operator_identifier)\n        (literal_type\n          (string)))\n      (operator_identifier)\n      (literal_type\n        (string)))))\n\n================================================================================\nApplied Constructor Types (Scala 3)\n================================================================================\n\nval c: C(42)\n\n--------------------------------------------------------------------------------\n(compilation_unit\n  (val_declaration\n    (identifier)\n    (applied_constructor_type\n      (type_identifier)\n      (arguments\n        (integer_literal)))))\n"
  },
  {
    "path": "test/highlight/basics.scala",
    "content": "import java.time.Instant\n//^include\n//     ^namespace\n//               ^type\nobject Hello {\n// ^ keyword \n//       ^ type\n  val x = if (true) (25 * 1.0) else \"hello\"  \n// ^keyword\n//    ^variable\n//         ^conditional\n//             ^boolean\n//                   ^number\n//                        ^float    \n//                                    ^string\n//                              ^conditional \n\n  val y = new lower_case_intentionally\n//        ^keyword.operator\n//            ^type\n\n  var mutation = \"mutant\"\n//  ^keyword\n//    ^variable\n\n  trait Test {\n// ^ keyword \n//       ^ type\n    def meth(i: Int)(implicit x: Boolean) = ???\n//    ^keyword.function  \n//                       ^keyword    \n//                                  ^type    \n//        ^method\n//                            ^parameter \n  \n    val anonFun: Int => Int = (a: Int) => a\n  //      ^variable\n  //             ^type\n  //                 ^operator\n  //                    ^type\n  //                           ^parameter\n  }\n\n  protected abstract class Bla(test: String)\n//    ^type.qualifier\n//                    ^keyword\n//            ^type.qualifier \n//                              ^parameter\n//                                     ^type\n\n  type Hello = \"25\"\n  // ^keyword\n  //    ^type.definition \n  //            ^string\n\n  class A {\n// ^ keyword\n//      ^ type\n    self: X =>\n//  ^parameter\n//        ^type\n  }\n\n  type A = { def fly(): Unit }\n//            ^keyword.function\n//                ^method\n//                       ^type\n\n  type A = B[({ type f[x] = M[S, x] })#f]\n//               ^keyword\n//                   ^type.definition\n\n  val hello = c\"some $mutation ${1}\"\n//            ^function.call\n//                   ^punctuation.special\n//                     ^variable\n//                               ^number\n  def meth = ???\n//     ^method\n  val hello2 = c\"some $meth\"\n//                      ^method\n  val hello3 = s\"$$$meth$hello2%\"\n//               ^string\n//                 ^punctuation.special\n//                  ^method\n//                      ^punctuation.special\n//                       ^variable\n//                             ^string\n  val hello4 = s\"$\"$hello3\"\n//               ^string\n//                 ^punctuation.special\n//                  ^variable\n}\n\n"
  },
  {
    "path": "test/highlight/comments.scala",
    "content": "//> using scala 3.1.0\n//  ^keyword\n//        ^parameter\n//              ^string\n\n/*\n * Beep boop\n */\n// <- comment\n\n// Single line comment\n// <- comment\n"
  },
  {
    "path": "test/highlight/scala3.scala",
    "content": "// Optional braces syntax\nclass C:\n// ^keyword\n//    ^type\n\n  def test(aaaa: A): Int =\n  //^keyword.function\n  //  ^method\n    // no curly braces, but this is still in test method\n    val bbb = 1\n    //^keyword\n    //  ^variable\n    val ccc = 2\n    //^keyword\n    //  ^variable\n    1\n\nobject O1:\n//^keyword\n//     ^type\n\n  def test: Unit = ()\n  //^keyword.function\n  //  ^method\n\nobject O2:\n  type Elem[A] = A match\n  //^keyword\n  //   ^type.definition\n    case String   => Char\n    //^keyword\n    //   ^type       ^type\n    case Array[a] => a\n    //   ^type       ^type\n\n// SIP-44\nclass C:\n// ^keyword\n  //  ^type\n  fooooo.map: x =>\n  //     ^method.call\n    x + 1\n\n  xs.map:\n    param1 =>\n      param1 + 1\n\n  foooo:\n  // ^function.call\n    println(\"\")\n\n  foooo `++`:\n  //    ^operator\n    val x = 1\n    List(x)\n\n  // This is an ascription\n  val y = x: Int\n  //         ^type\n\n  // This is SIP-44\n  val y = x:\n    Int\n    //^type\n\n// Ascription expression\nclass C:\n  foooo: Int\n  //     ^type\n\nenum Simple:\n//^keyword\n//   ^type\n  case A, B, C\n//     ^type\nenum Test(a: Int) derives Codec:\n// ^keyword   \n//    ^type\n//            ^type\n//                   ^keyword\n//                          ^type\n//    ^type\n//        ^parameter\n  case Test(b: String)\n  // ^keyword     \n  //               ^type\n  //      ^type\n  //        ^parameter\n  case Hello, Bla\n  //      ^type\n  //          ^type\n  case Bla extends Test(256)\n  //          ^keyword\n\nopaque type Blow <: Int = 25\n// ^type.qualifier\n//      ^keyword     \n//                   ^type     \n//            ^type.definition\n\ninline given Test = new Test {\n// ^ storageclass\n  inline def hello(inline x: Boolean) = \n// ^ storageclass\n//                   ^ storageclass\n    inline if x then \"hi\" else \"bye\" \n    // ^storageclass\n    //            ^conditional\n    inline x match \n    // ^storageclass\n      case true => 25 \n      case false => 26 \n}\n\nobject A:\n// ^ keyword\n//     ^type\n\n  ::(123)\n//^operator\n//   ^number\n\nobject bla:\n  open class Hello(A: Int)\n// ^ type.qualifier\n  transparent trait Hello\n//   ^ type.qualifier\n  infix def hello = 25\n//  ^ keyword\n\nextension (s: String)\n//  ^keyword\n  def test = 25\n  def test2 = 25\n\nval extension = \"hello\"\n//     ^variable - to test \"soft\" keywords\n\ngiven Test with\n// ^keyword\n//     ^type\n//          ^keyword\n   def test = 1\n//  ^keyword.function\n   val a = \"hello\"\n\n\nclass Copier:\n  private val printUnit = new Printer { type PrinterType = InkJet }\n  private val scanUnit = new Scanner\n\n  export scanUnit.scan\n  // ^ include\n  //        ^variable\n  export printUnit.{status as _, *}\n  // ^ include\n  //        ^variable\n\n  def status: List[String] = printUnit.status ++ scanUnit.status\n"
  },
  {
    "path": "test/tags/basics.scala",
    "content": "package com.example\n//      ^definition.module\n\nenum Color:\n//   ^definition.enum\n  case Red\n  //   ^definition.class\n  case Green\n  //   ^definition.class\n  case Yellow\n  //   ^definition.class\n\ntrait Fruit:\n//    ^definition.interface\n  val color: Color\n//    ^definition.variable\n\nobject Fruit:\n//     ^definition.object\n  case object Banana extends Fruit {\n  //          ^definition.object\n  //                         ^reference.class\n    val color = Color.Yellow\n    //  ^definition.variable\n  }\n  case class Apple(c: Color.Red | Color.Green) extends Fruit {\n  //         ^definition.class\n  //               ^definition.property\n  //                                                   ^reference.class\n    val color = c\n  //    ^definition.variable\n  }\n\n  given show: Show[Fruit] = new Show[Fruit] {  }\n  //    ^definition.variable\n  //                            ^reference.interface\n\n  def color(fruit: Fruit): String = ???\n  //  ^definition.function\n\n  var flag: Boolean = true\n  //  ^definition.variable\n\n\n"
  },
  {
    "path": "tree-sitter.json",
    "content": "{\n  \"grammars\": [\n    {\n      \"name\": \"scala\",\n      \"camelcase\": \"Scala\",\n      \"scope\": \"source.scala\",\n      \"path\": \".\",\n      \"file-types\": [\n        \"scala\",\n        \"sbt\"\n      ],\n      \"highlights\": \"queries/highlights.scm\",\n      \"locals\": \"queries/locals.scm\",\n      \"tags\": \"queries/tags.scm\"\n    }\n  ],\n  \"metadata\": {\n    \"version\": \"0.26.0\",\n    \"license\": \"MIT\",\n    \"description\": \"Scala grammar for tree-sitter\",\n    \"authors\": [\n      {\n        \"name\": \"Max Brunsfeld\",\n        \"email\": \"maxbrunsfeld@gmail.com\"\n      }\n    ],\n    \"links\": {\n      \"repository\": \"https://github.com/tree-sitter/tree-sitter-scala\"\n    }\n  },\n  \"bindings\": {\n    \"c\": true,\n    \"go\": true,\n    \"node\": true,\n    \"python\": true,\n    \"rust\": true,\n    \"swift\": true\n  }\n}\n"
  }
]