[
  {
    "path": ".editorconfig",
    "content": "# Top-most editorconfig file\n\nroot = true\n\n[*]\nend_of_line = lf\ntab_width   = 2\nindent_size = 2\nindent_style = space\n\n[Makefile]\ntab_width   = 8\nindent_size = 8\nindent_style = tab\n\n"
  },
  {
    "path": ".gitattributes",
    "content": ".revision-hash export-subst\n"
  },
  {
    "path": ".github/workflows/test.yml",
    "content": "---\nname: Tests\non:\n  push:\n    paths-ignore:\n      - '**.md'\n      - '**.png'\n  pull_request:\n    paths-ignore:\n      - '**.md'\n      - '**.png'\n  schedule:\n    - cron: '29 7 * * 1'\n\njobs:\n  test:\n    runs-on: ubuntu-latest\n    strategy:\n      fail-fast: false\n      matrix:\n        version:\n          - master\n          - 5.9\n          - 5.8.1\n          - 5.8\n          - 5.7.1\n          - 5.7\n          - 5.6.2\n          - 5.6.1\n          - 5.6\n          - 5.5.1\n          - 5.5\n          - 5.4.2\n          - 5.4.1\n          - 5.4\n          - 5.3.1\n          - 5.3\n          - 5.2\n          - 5.1.1\n          - 5.1\n          - 5.0.8\n          - 5.0.7\n          - 5.0.6\n          - 5.0.5\n          - 5.0.4\n          - 5.0.3\n          - 5.0.2\n          - 5.0.1\n          - 5.0.0\n          - 4.3.17\n          - 4.3.16\n          - 4.3.15\n          - 4.3.14\n          - 4.3.13\n          - 4.3.12\n          - 4.3.11\n    container:\n      image: ghcr.io/zsh-users/zsh:${{ matrix.version }}\n    steps:\n      - uses: actions/checkout@v4\n      - run: install_packages bsdmainutils make procps\n      - run: make test\n\n  notify:\n    runs-on: ubuntu-latest\n    needs: test\n    if: failure() && (github.repository_owner == 'zsh-users')\n    steps:\n      -\n        name: Notify IRC\n        uses: Gottox/irc-message-action@v2\n        with:\n          channel: '#zsh-syntax-highlighting'\n          nickname: zsyh-gh-bot\n          message: '${{ github.ref }} failed tests: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'\n"
  },
  {
    "path": ".gitignore",
    "content": "*.zwc*\n.pc/\ndocs/all.md\n"
  },
  {
    "path": ".revision-hash",
    "content": "$Format:%H$\n"
  },
  {
    "path": ".version",
    "content": "0.8.1-dev\n"
  },
  {
    "path": "COPYING.md",
    "content": "Copyright (c) 2010-2020 zsh-syntax-highlighting contributors\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted\nprovided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this list of conditions\n   and the following disclaimer.\n * Redistributions in binary form must reproduce the above copyright notice, this list of\n   conditions and the following disclaimer in the documentation and/or other materials provided\n   with the distribution.\n * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n   may be used to endorse or promote products derived from this software without specific prior\n   written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n"
  },
  {
    "path": "HACKING.md",
    "content": "Hacking on zsh-syntax-highlighting itself\n=========================================\n\nThis document includes information for people working on z-sy-h itself: on the\ncore driver (`zsh-syntax-highlighting.zsh`), on the highlighters in the\ndistribution, and on the test suite.  It does not target third-party\nhighlighter authors (although they may find it an interesting read).\n\nThe `main` highlighter\n----------------------\n\nThe following function `pz` is useful when working on the `main` highlighting:\n\n```zsh\npq() {\n  (( $#argv )) || return 0\n  print -r -l -- ${(qqqq)argv}\n}\npz() {\n  local arg\n  for arg; do\n    pq ${(z)arg}\n  done\n}\n```\n\nIt prints, for each argument, its token breakdown, similar to how the main\nloop of the `main` highlighter sees it.\n\nTesting the `brackets` highlighter\n----------------------------------\n\nSince the test harness empties `ZSH_HIGHLIGHT_STYLES` and the `brackets`\nhighlighter interrogates `ZSH_HIGHLIGHT_STYLES` to determine how to highlight,\ntests must set the `bracket-level-#` keys themselves.  For example:\n\n```zsh\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\n\nBUFFER='echo ({x})'\n\nexpected_region_highlight=(\n  \"6  6  bracket-level-1\" # (\n  \"7  7  bracket-level-2\" # {\n  \"9  9  bracket-level-2\" # }\n  \"10 10 bracket-level-1\" # )\n)\n```\n\nTesting the `pattern` and `regexp` highlighters\n-----------------------------------------------\n\nBecause the `pattern` and `regexp` highlighters modifies `region_highlight`\ndirectly instead of using `_zsh_highlight_add_highlight`, the test harness\ncannot get the `ZSH_HIGHLIGHT_STYLES` keys.  Therefore, when writing tests, use\nthe style itself as third word (cf. the\n[documentation for `expected_region_highlight`](docs/highlighters.md)).  For example:\n\n```zsh\nZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')\n\nBUFFER='rm -rf /'\n\nexpected_region_highlight=(\n  \"1 8 fg=white,bold,bg=red\" # rm -rf /\n)\n```\n\nMemos and commas\n----------------\n\nWe append to `region_highlight` as follows:\n\n\n```zsh\nregion_highlight+=(\"$start $end $spec, memo=zsh-syntax-highlighting\")\n```\n\nThat comma is required to cause zsh 5.8 and older to ignore the memo without\nignoring the `$spec`.  It's a hack, but given that no further 5.8.x patch\nreleases are planned, it's been deemed acceptable.  See issue #418 and the\ncross-referenced issues.\n\n\nMiscellany\n----------\n\nIf you work on the driver (`zsh-syntax-highlighting.zsh`), you may find the following zstyle useful:\n\n```zsh\nzstyle ':completion:*:*:*:*:globbed-files' ignored-patterns {'*/',}zsh-syntax-highlighting.plugin.zsh\n```\n\nIRC channel\n-----------\n\nWe're on #zsh-syntax-highlighting on Libera.Chat.\n\n"
  },
  {
    "path": "INSTALL.md",
    "content": "How to install\n--------------\n\n### Using packages\n\nFirst, install the package:\n\n* Arch Linux: [community/zsh-syntax-highlighting][arch-package] / [AUR/zsh-syntax-highlighting-git][AUR-package]\n* Debian: `zsh-syntax-highlighting` package [in `stretch`][debian-package] (or in [OBS repository][obs-repository])\n* Fedora: [zsh-syntax-highlighting package][fedora-package-alt] in Fedora 24+ (or in [OBS repository][obs-repository])\n* FreeBSD: `pkg install zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][freebsd-port])\n* Gentoo: [app-shells/zsh-syntax-highlighting][gentoo-repository]\n* Mac OS X / Homebrew: `brew install zsh-syntax-highlighting` ([formula][brew-package])\n* NetBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][netbsd-port])\n* OpenBSD: `pkg_add zsh-syntax-highlighting` (port name: [`shells/zsh-syntax-highlighting`][openbsd-port])\n* openSUSE / SLE: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]\n* RHEL / CentOS / Scientific Linux: `zsh-syntax-highlighting` package in [OBS repository][obs-repository]\n* Ubuntu: `zsh-syntax-highlighting` package [in Xenial][ubuntu-package] (or in [OBS repository][obs-repository])\n* Void Linux: `zsh-syntax-highlighting package` [in XBPS][void-package]\n\n[arch-package]: https://www.archlinux.org/packages/zsh-syntax-highlighting\n[AUR-package]: https://aur.archlinux.org/packages/zsh-syntax-highlighting-git\n[brew-package]: https://github.com/Homebrew/homebrew-core/blob/master/Formula/z/zsh-syntax-highlighting.rb\n[debian-package]: https://packages.debian.org/zsh-syntax-highlighting\n[fedora-package]: https://apps.fedoraproject.org/packages/zsh-syntax-highlighting\n[fedora-package-alt]: https://bodhi.fedoraproject.org/updates/?packages=zsh-syntax-highlighting\n[freebsd-port]: https://www.freshports.org/textproc/zsh-syntax-highlighting/\n[gentoo-repository]: https://packages.gentoo.org/packages/app-shells/zsh-syntax-highlighting\n[netbsd-port]: http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/shells/zsh-syntax-highlighting/\n[obs-repository]: https://software.opensuse.org/download.html?project=shells%3Azsh-users%3Azsh-syntax-highlighting&package=zsh-syntax-highlighting\n[openbsd-port]: https://cvsweb.openbsd.org/ports/shells/zsh-syntax-highlighting/\n[ubuntu-package]: https://launchpad.net/ubuntu/+source/zsh-syntax-highlighting\n[void-package]: https://github.com/void-linux/void-packages/tree/master/srcpkgs/zsh-syntax-highlighting\n\nSee also [repology's cross-distro index](https://repology.org/metapackage/zsh-syntax-highlighting/versions)\n\nSecond, enable zsh-syntax-highlighting by sourcing the script. Running this command on the terminal will add the source line to the end of your .zshrc:\n\n* On most Linux distributions (except perhaps NixOS):\n\n    ```zsh\n    echo \"source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" >> ${ZDOTDIR:-$HOME}/.zshrc\n    ```\n\n* NetBSD and OpenBSD:\n\n    ```zsh\n    echo \"source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" >> ${ZDOTDIR:-$HOME}/.zshrc\n    ```\n\n* Mac OS X / Homebrew:\n\n    ```zsh\n    echo \"source $(brew --prefix)/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" >> ${ZDOTDIR:-$HOME}/.zshrc\n    ```\n\nThen restart zsh (such as by opening a new instance of your terminal emulator).\n\n Alternatively, add the `source` command manually **at the end** of your `.zshrc`:\n\n* On most Linux distributions (except perhaps NixOS):\n`source /usr/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`\n* NetBSD and OpenBSD:\n`source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh`\n\nThen restart zsh.\n\n### In your ~/.zshrc\n\nSimply clone this repository and source the script:\n\n```zsh\ngit clone https://github.com/zsh-users/zsh-syntax-highlighting.git\necho \"source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\" >> ${ZDOTDIR:-$HOME}/.zshrc\n```\n\n  Then, enable syntax highlighting in the current interactive shell:\n\n```zsh\nsource ./zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\n```\n\n  If `git` is not installed, download and extract a snapshot of the latest\n  development tree from:\n\n```\nhttps://github.com/zsh-users/zsh-syntax-highlighting/archive/master.tar.gz\n```\n\n  Note the `source` command must be **at the end** of `~/.zshrc`.\n\n\n### With a plugin manager\n\nNote that `zsh-syntax-highlighting` must be the last plugin sourced.\n\nThe zsh-syntax-highlighting authors recommend manual installation over the use\nof a framework or plugin manager.\n\nThis list is incomplete as there are too many\n[frameworks / plugin managers][framework-list] to list them all here.\n\n[framework-list]: https://github.com/unixorn/awesome-zsh-plugins#frameworks\n\n#### [Antigen](https://github.com/zsh-users/antigen)\n\nAdd `antigen bundle zsh-users/zsh-syntax-highlighting` as the last bundle in\nyour `.zshrc`.\n\n#### [Fig](https://fig.io)\n\nClick the `Install Plugin` button on the [Fig plugin page][fig-plugin].\n\n[fig-plugin]: https://fig.io/plugins/other/zsh-syntax-highlighting\n\n#### [Oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh)\n\n1. Clone this repository in oh-my-zsh's plugins directory:\n\n    ```zsh\n    git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting\n    ```\n\n2. Activate the plugin in `~/.zshrc`:\n\n    ```zsh\n    plugins=( [plugins...] zsh-syntax-highlighting)\n    ```\n\n3. Restart zsh (such as by opening a new instance of your terminal emulator).\n\n#### [Prezto](https://github.com/sorin-ionescu/prezto)\n\nZsh-syntax-highlighting is included with Prezto. See the\n[Prezto documentation][prezto-docs] to enable and configure highlighters.\n\n[prezto-docs]: https://github.com/sorin-ionescu/prezto/tree/master/modules/syntax-highlighting\n\n#### [zgen](https://github.com/tarjoilija/zgen)\n\nAdd `zgen load zsh-users/zsh-syntax-highlighting` to the end of your `.zshrc`.\n\n#### [zinit](https://github.com/zdharma-continuum/zinit)\n\nAdd `zinit light zsh-users/zsh-syntax-highlighting` to the end of your\n`.zshrc`.\n\n#### [zplug](https://github.com/zplug/zplug)\n\nAdd `zplug \"zsh-users/zsh-syntax-highlighting\", defer:2` to your `.zshrc`.\n\n\n### System-wide installation\n\nAny of the above methods is suitable for a single-user installation,\nwhich requires no special privileges.  If, however, you desire to install\nzsh-syntax-highlighting system-wide, you may do so by running\n\n```zsh\nmake install\n```\n\nand directing your users to add\n\n```zsh\nsource /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh\n```\n\nto their `.zshrc`s.\n"
  },
  {
    "path": "Makefile",
    "content": "NAME=zsh-syntax-highlighting\n\nINSTALL?=install -c\nPREFIX?=/usr/local\nSHARE_DIR?=$(DESTDIR)$(PREFIX)/share/$(NAME)\nDOC_DIR?=$(DESTDIR)$(PREFIX)/share/doc/$(NAME)\nZSH?=zsh # zsh binary to run tests with\n\nall:\n\tcd docs && \\\n\tcp highlighters.md all.md && \\\n\tprintf '\\n\\nIndividual highlighters documentation\\n=====================================' >> all.md && \\\n\tfor doc in highlighters/*.md; do printf '\\n\\n'; cat \"$$doc\"; done >> all.md\n\ninstall: all\n\t$(INSTALL) -d $(SHARE_DIR)\n\t$(INSTALL) -d $(DOC_DIR)\n\tcp .version zsh-syntax-highlighting.zsh $(SHARE_DIR)\n\tcp COPYING.md README.md changelog.md $(DOC_DIR)\n\tsed -e '1s/ .*//' -e '/^\\[build-status-[a-z]*\\]: /d' < README.md > $(DOC_DIR)/README.md\n\tif [ x\"true\" = x\"`git rev-parse --is-inside-work-tree 2>/dev/null`\" ]; then \\\n\t\tgit rev-parse HEAD; \\\n\telse \\\n\t\tcat .revision-hash; \\\n\tfi > $(SHARE_DIR)/.revision-hash\n\t:\n# The [ -e ] check below is to because sh evaluates this with (the moral\n# equivalent of) NONOMATCH in effect, and highlighters/*.zsh has no matches.\n\tfor dirname in highlighters highlighters/*/ ; do \\\n\t\t$(INSTALL) -d $(SHARE_DIR)/\"$$dirname\"; \\\n\t\tfor fname in \"$$dirname\"/*.zsh ; do [ -e \"$$fname\" ] && cp \"$$fname\" $(SHARE_DIR)\"/$$dirname\"; done; \\\n\tdone\n\tcp -R docs/* $(DOC_DIR)\n\nclean:\n\trm -f docs/all.md\n\ntest:\n\t@$(ZSH) -fc 'echo ZSH_PATCHLEVEL=$$ZSH_PATCHLEVEL'\n\t@result=0; \\\n\tfor test in highlighters/*; do \\\n\t\tif [ -d $$test/test-data ]; then \\\n\t\t\techo \"Running test $${test##*/}\"; \\\n\t\t\tenv -i QUIET=$$QUIET $${TERM:+\"TERM=$$TERM\"} $(ZSH) -f tests/test-highlighting.zsh \"$${test##*/}\"; \\\n\t\t\t: $$(( result |= $$? )); \\\n\t\tfi \\\n\tdone; \\\n\texit $$result\n\nquiet-test:\n\t$(MAKE) test QUIET=y\n\nperf:\n\t@result=0; \\\n\tfor test in highlighters/*; do \\\n\t\tif [ -d $$test/test-data ]; then \\\n\t\t\techo \"Running test $${test##*/}\"; \\\n\t\t\t$(ZSH) -f tests/test-perfs.zsh \"$${test##*/}\"; \\\n\t\t\t: $$(( result |= $$? )); \\\n\t\tfi \\\n\tdone; \\\n\texit $$result\n\n.PHONY: all install clean test perf\n"
  },
  {
    "path": "README.md",
    "content": "zsh-syntax-highlighting [![Build Status][build-status-image]][build-status]\n=======================\n\n**[Fish shell][fish]-like syntax highlighting for [Zsh][zsh].**\n\n*Requirements: zsh 4.3.11+.*\n\n[fish]: https://fishshell.com/\n[zsh]: https://www.zsh.org/\n\nThis package provides syntax highlighting for the shell zsh.  It enables\nhighlighting of commands whilst they are typed at a zsh prompt into an\ninteractive terminal.  This helps in reviewing commands before running\nthem, particularly in catching syntax errors.\n\nSome examples:\n\nBefore: [![Screenshot #1.1](images/before1-smaller.png)](images/before1.png)\n<br/>\nAfter:&nbsp; [![Screenshot #1.2](images/after1-smaller.png)](images/after1.png)\n\nBefore: [![Screenshot #2.1](images/before2-smaller.png)](images/before2.png)\n<br/>\nAfter:&nbsp; [![Screenshot #2.2](images/after2-smaller.png)](images/after2.png)\n\nBefore: [![Screenshot #3.1](images/before3-smaller.png)](images/before3.png)\n<br/>\nAfter:&nbsp; [![Screenshot #3.2](images/after3-smaller.png)](images/after3.png)\n\nBefore: [![Screenshot #4.1](images/before4-smaller.png)](images/before4-smaller.png)\n<br/>\nAfter:&nbsp; [![Screenshot #4.2](images/after4-smaller.png)](images/after4-smaller.png)\n\n\n\nHow to install\n--------------\n\nSee [INSTALL.md](INSTALL.md).\n\n\nFAQ\n---\n\n### Why must `zsh-syntax-highlighting.zsh` be sourced at the end of the `.zshrc` file?\n\nzsh-syntax-highlighting works by hooking into the Zsh Line Editor (ZLE) and\ncomputing syntax highlighting for the command-line buffer as it stands at the\ntime z-sy-h's hook is invoked.\n\nIn zsh 5.2 and older,\n`zsh-syntax-highlighting.zsh` hooks into ZLE by wrapping ZLE widgets.  It must\nbe sourced after all custom widgets have been created (i.e., after all `zle -N`\ncalls and after running `compinit`) in order to be able to wrap all of them.\nWidgets created after z-sy-h is sourced will work, but will not update the\nsyntax highlighting.\n\nIn zsh newer than 5.8 (not including 5.8 itself),\nzsh-syntax-highlighting uses the `add-zle-hook-widget` facility to install\na `zle-line-pre-redraw` hook.  Hooks are run in order of registration,\ntherefore, z-sy-h must be sourced (and register its hook) after anything else\nthat adds hooks that modify the command-line buffer.\n\n### Does syntax highlighting work during incremental history search?\n\nHighlighting the command line during an incremental history search (by default bound to\nto <kbd>Ctrl+R</kbd> in zsh's emacs keymap) requires zsh 5.4 or newer.\n\nUnder zsh versions older than 5.4, the zsh-default [underlining][zshzle-Character-Highlighting]\nof the matched portion of the buffer remains available, but zsh-syntax-highlighting's\nadditional highlighting is unavailable.  (Those versions of zsh do not provide\nenough information to allow computing the highlighting correctly.)\n\nSee issues [#288][i288] and [#415][i415] for details.\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n[i288]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/288\n[i415]: https://github.com/zsh-users/zsh-syntax-highlighting/pull/415\n\n### How are new releases announced?\n\nThere is currently no \"push\" announcements channel.  However, the following\nalternatives exist:\n\n- GitHub's RSS feed of releases: https://github.com/zsh-users/zsh-syntax-highlighting/releases.atom\n- An anitya entry: https://release-monitoring.org/project/7552/\n\n\nHow to tweak\n------------\n\nSyntax highlighting is done by pluggable highlighter scripts.  See the\n[documentation on highlighters](docs/highlighters.md) for details and\nconfiguration settings.\n\n[build-status]: https://github.com/zsh-users/zsh-syntax-highlighting/actions\n[build-status-image]: https://github.com/zsh-users/zsh-syntax-highlighting/workflows/Tests/badge.svg\n"
  },
  {
    "path": "changelog.md",
    "content": "# Changes in HEAD\n\n\n- Highlight `&>` `>&|` `>&!` `&>|` and `&>!` as redirection.\n  [#942]\n\n\n# Changes in 0.8.0\n\nThis is a stable bugfix and feature release.  Major new features and changes include:\n\n\n## Changes fixed as part of the switch to zle-line-pre-redraw\n\nThe changes in this section were fixed by switching to a `zle-line-pre-redraw`-based\nimplementation.\n\nNote: The new implementation will only be used on future zsh releases,\nnumbered 5.8.1.1 and newer, due to interoperability issues with other plugins\n(issues #418 and #579).  The underlying zsh feature has been available since\nzsh 5.3.\n\nWhilst under development, the new implementation was known as the\n\"feature/redrawhook\" topic branch.\n\n- Fixed: Highlighting not triggered after popping a buffer from the buffer stack\n  (using the `push-line` widget, default binding: `M-q`)\n  [#40]\n\n- Fixed: Invoking completion when there were no matches removed highlighting\n  [#90, #470]\n\n- Fixed: Two successive deletes followed by a yank only yanked the latest\n  delete, rather than both of them\n  [#150, #151, #160; cf. #183]\n\n- Presumed fixed: Completing `$(xsel)` results in an error message from `xsel`,\n  with pre-2017 versions of `xsel`.  (For 2017 vintage and newer, see the issue\n  for details.)\n  [#154]\n\n- Fixed: When the standard `bracketed-paste-magic` widget is in use, pastes were slow\n  [#295]\n\n- Fixed: No way to prevent a widget from being wrapped\n  [#324]\n\n- Fixed: No highlighting while cycling menu completion\n  [#375]\n\n- Fixed: Does not coexist with the `IGNORE_EOF` option\n  [#377]\n\n- Fixed: The `undefined-key` widget was wrapped\n  [#421]\n\n- Fixed: Does not coexist with the standard `surround` family of widgets\n  [#520]\n\n- Fixed: First completed filename doesn't get `path` highlighting\n  [#632]\n\n\n## Other changes\n\n- Add issue #712 to the previous release's changelog (hereinafter).\n\n- Fix highlighting when using an alias twice inside another alias\n  [#769, #775]\n\n- Remove lint warning for `env` followed by a pipe\n  [#797]\n\n- Recognize `proxychains` as a precommand\n  [#814, #914]\n\n- Honor shwordsplit when expanding parameters\n  [#687, #818]\n\n- Skip highlighting when keys are still pending in more cases\n  [#835]\n\n- Recognize `grc` as a precommand\n\n- Recognize `torsocks` and `torift` as precommands\n  [#898]\n\n- Recognize `cpulimit` as a precommand\n  [#897]\n\n- Recognize `ktrace` as a precommand\n\n\n# Changes in 0.8.0-alpha1-pre-redrawhook\n\n## Notice about an improbable-but-not-impossible forward incompatibility\n\nEveryone can probably skip this section.\n\nThe `master` branch of zsh-syntax-highlighting uses a zsh feature that has not\nyet appeared in a zsh release: the `memo=` feature, added to zsh in commit\nzsh-5.8-172-gdd6e702ee (after zsh 5.8, before zsh 5.9).  In the unlikely event\nthat this zsh feature should change in an incompatible way before the next\nstable zsh release, set `zsh_highlight__memo_feature=0` in your .zshrc files to\ndisable use of the new feature.\n\nz-sy-h dogfoods the new, unreleased zsh feature because that feature was\nadded to zsh at z-sy-h's initiative.  The new feature is used in the fix\nto issue #418.\n\n\n## Incompatible changes:\n\n- An unsuccessful completion (a <kbd>⮀ Tab</kbd> press that doesn't change the\n  command line) no longer causes highlighting to be lost.  Visual feedback can\n  alternatively be achieved by setting the `format` zstyle under the `warnings`\n  tag, for example,\n\n        zstyle ':completion:*:warnings' format '%F{red}No matches%f'\n\n    Refer to the [description of the `format` style in `zshcompsys(1)`]\n    [zshcompsys-Standard-Styles-format].\n\n    (#90, part of #245 (feature/redrawhook))\n\n[zshcompsys-Standard-Styles]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#Standard-Styles\n[zshcompsys-Standard-Styles-format]: https://zsh.sourceforge.io/Doc/Release/Completion-System.html#index-format_002c-completion-style\n  \n\n\n## Other changes:\n\n- Document `$ZSH_HIGHLIGHT_MAXLENGTH`.\n  [#698]\n\n- Optimize highlighting unquoted words (words that are not in single quotes, double quotes, backticks, or dollar-single-quotes)\n  [#730]\n\n- Redirection operators (e.g., `<` and `>`) are now highlighted by default\n  [#646]\n\n- Propertly terminate `noglob` scope in try/always blocks\n  [#577]\n\n- Don't error out when `KSH_ARRAYS` is set in the calling scope\n  [#622, #689]\n\n- Literal semicolons in array assignments (`foo=( bar ; baz )`) are now\n  highlighted as errors.\n  [3ca93f864fb6]\n\n- Command separators in array assignments (`foo=( bar | baz )`) are now\n  highlighted as errors.\n  [#651, 81267ca3130c]\n\n- Support parameter elision in command position (e.g., `$foo ls` where `$foo` is unset or empty)\n  [#667]\n\n- Don't consider the filename in `sudo -e /path/to/file` to be a command position\n  [#678]\n\n- Don't look up absolute directory names in $cdpath\n  [2cc2583f8f12, part of #669]\n\n- Fix `exec 2>&1;` being highlighted as an error.\n  [#676]\n\n- Fix `: $(<*)` being highlighted as globbing.\n  [#582]\n\n- Fix `cat < *` being highlighting as globbing when the `MULTIOS` option is unset.\n  [#583]\n\n- Fix `echo >&2` highlighting the `2` as a filename if a file by that name happened to exist\n  [#694, part of #645]\n\n- Fix `echo >&-` highlighting the `-` as a filename if a file by that name happened to exist\n  [part of #645]\n\n- Fix `echo >&p` highlighting the `p` as a filename if a file by that name happened to exist\n  [part of #645]\n\n- Fix wrong highlighting of unquoted parameter expansions under zsh 5.2 and older\n  [e165f18c758e]\n\n- Highlight global aliases\n  [#700]\n\n- Highlight `: =nosuchcommand' as an error (when the `EQUALS` option hasn't been unset).\n  [#430]\n\n- Highlight reserved word after assignments as errors (e.g., `foo=bar (ls;)`)\n  [#461]\n\n- Correctly highlight `[[ foo && bar || baz ]]`.\n\n- Highlight non-executable files in command position correctly (e.g., `% /etc/passwd`)\n  [#202, #669]\n\n- Highlight directories in command position correctly, including `AUTO_CD` support\n  [#669]\n\n- Recognize `env` as a precommand (e.g., `env FOO=bar ls`)\n\n- Recognize `ionice` as a precommand\n\n- Recognize `strace` as a precommand\n\n- Fix an error message on stderr before every prompt when the `WARN_NESTED_VAR` zsh option is set:\n  `_zsh_highlight_main__precmd_hook:1: array parameter _zsh_highlight_main__command_type_cache set in enclosing scope in function _zsh_highlight_main__precmd_hook`\n  [#727, #731, #732, #733]\n\n- Fix highlighting of alias whose definitions use a simple command terminator\n  (such as `;`, `|`, `&&`) before a newline\n  [#677; had regressed in 0.7.0]\n\n- Highlight arithmetic expansions (e.g., `$(( 42 ))`)\n  [#607 #649 #704]\n\n- Highlight the parentheses of array assignments as reserved words (`foo=( bar )`).\n  The `assign` style remains supported and has precedence.\n  [#585]\n\n- Fix interoperability issue with other plugins that use highlighting.  The fix\n  requires zsh 5.8.0.3 or newer.  (zsh 5.8.0.2-dev from the `master` branch,\n  revision zsh-5.8-172-gdd6e702ee or newer is also fine.)\n  [#418, https://github.com/okapia/zsh-viexchange/issues/1]\n\n- Improve performance of the `brackets` highlighter.\n\n- Fix highlighting of pre-command redirections (e.g., the `$fn` in `<$fn cat`)\n  [#712]\n\n\n# Changes in version 0.7.1\n\n- Remove out-of-date information from the 0.7.0 changelog.\n\n\n# Changes in version 0.7.0\n\nThis is a stable bugfix and feature release.  Major new features and changes include:\n\n- Add `ZSH_HIGHLIGHT_DIRS_BLACKLIST` to disable \"path\" and \"path prefix\"\n  highlighting for specific directories\n  [#379]\n\n- Add the \"regexp\" highlighter, modelled after the pattern highlighter\n  [4e6f60063f1c]\n\n- When a word uses globbing, only the globbing metacharacters will be highlighted as globbing:\n  in `: foo*bar`, only the `*` will be blue.\n  [e48af357532c]\n\n- Highlight pasted quotes (e.g., `: foo\"bar\"`)\n  [dc1b2f6fa4bb]\n\n- Highlight command substitutions (`` : `ls` ``, `: $(ls)`)\n  [c0e64fe13178 and parents, e86f75a840e7, et al]\n\n- Highlight process substitutions (`: >(nl)`, `: <(pwd)`, `: =(git diff)`)\n  [c0e64fe13178 and parents, e86f75a840e7, et al]\n\n- Highlight command substitutions inside double quotes (``: \"`foo`\"``)\n  [f16e858f0c83]\n\n- Highlight many precommands (e.g., `nice`, `stdbuf`, `eatmydata`;\n  see `$precommand_options` in the source)\n\n- Highlight numeric globs (e.g., `echo /lib<->`)\n\n- Assorted improvements to aliases highlighting\n  (e.g.,\n   `alias sudo_u='sudo -u'; sudo_u jrandom ls`,\n   `alias x=y y=z z=nosuchcommand; x`,\n   `alias ls='ls -l'; \\ls`)\n  [f3410c5862fc, 57386f30aec8, #544, and many others]\n\n- Highlight some more syntax errors\n  [dea05e44e671, 298ef6a2fa30]\n\n- New styles: named file descriptors, `RC_QUOTES`, and unclosed quotes (e.g., `echo \"foo<CURSOR>`)\n  [38c794a978cd, 25ae1c01216c, 967335dfc5fd]\n\n- The 'brackets' highlighting no longer treats quotes specially.\n  [ecdda36ef56f]\n\n\nSelected bugfixes include:\n\n- Highlight `sudo` correctly when it's not installed\n  [26a82113b08b]\n\n- Handle some non-default options being set in zshrc\n  [b07ada1255b7, a2a899b41b8, 972ad197c13d, b3f66fc8748f]\n\n- Fix off-by-one highlighting in vi \"visual\" mode (vicmd keymap)\n  [be3882aeb054]\n\n- The 'yank-pop' widget is not wrapped\n  [#183]\n\n\nKnown issues include:\n\n- A multiline alias that uses a simple command terminator (such as `;`, `|`, `&&`)\n  before a newline will incorrectly be highlighted as an error.  See issue #677\n  for examples and workarounds.\n  [#677]\n  [UPDATE: Fixed in 0.8.0]\n\n\n# Changes in version 0.6.0\n\nThis is a stable release, featuring bugfixes and minor improvements.\n\n\n## Performance improvements:\n\n(none)\n\n\n## Added highlighting of:\n\n- The `isearch` and `suffix` [`$zle_highlight` settings][zshzle-Character-Highlighting].\n  (79e4d3d12405, 15db71abd0cc, b56ee542d619; requires zsh 5.3 for `$ISEARCHMATCH_ACTIVE` / `$SUFFIX_ACTIVE` support)\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n\n- Possible history expansions in double-quoted strings.\n  (76ea9e1df316)\n\n- Mismatched `if`/`then`/`elif`/`else`/`fi`.\n  (73cb83270262)\n\n\n## Fixed highlighting of:\n\n- A comment line followed by a non-comment line.\n  (#385, 9396ad5c5f9c)\n\n- An unquoted `$*` (expands to the positional parameters).\n  (237f89ad629f)\n\n- history-incremental-pattern-search-backward under zsh 5.3.1.\n  (#407, #415, 462779629a0c)\n\n\n## API changes (for highlighter authors):\n\n(none)\n\n\n## Developer-visible changes:\n\n- tests: Set the `ALIAS_FUNC_DEF` option for zsh 5.4 compatibility.\n  (9523d6d49cb3)\n\n\n## Other changes:\n\n- docs: Added before/after screenshots.\n  (cd9ec14a65ec..b7e277106b49)\n\n- docs: Link Fedora package.\n  (3d74aa47e4a7, 5feed23962df)\n\n- docs: Link FreeBSD port.\n  (626c034c68d7)\n\n- docs: Link OpenSUSE Build Service packages\n  (#419, dea1fedc7358)\n\n- Prevent user-defined aliases from taking effect in z-sy-h's own code.\n  (#390, 2dce602727d7, 8d5afe47f774; and #392, #395, b8fa1b9dc954)\n\n- docs: Update zplug installation instructions.\n  (#399, 4f49c4a35f17)\n\n- Improve \"unhandled ZLE widget 'foo'\" error message.\n  (#409, be083d7f3710)\n\n- Fix printing of \"failed loading highlighters\" error message.\n  (#426, ad522a091429)\n\n\n# Changes in version 0.5.0\n\n\n## Performance improvements:\n\nWe thank Sebastian Gniazdowski and \"m0viefreak\" for significant contributions\nin this area.\n\n- Optimize string operations in the `main` (default) highlighter.\n  (#372/3cb58fd7d7b9, 02229ebd6328, ef4bfe5bcc14, #372/c6b6513ac0d6, #374/15461e7d21c3)\n\n- Command word highlighting:  Use the `zsh/parameter` module to avoid forks.\n  Memoize (cache) the results.\n  (#298, 3ce01076b521, 2f18ba64e397, 12b879caf7a6; #320, 3b67e656bff5)\n\n- Avoid forks in the driver and in the `root` highlighter.\n  (b9112aec798a, 38c8fbea2dd2)\n\n\n## Added highlighting of:\n\n- `pkexec` (a precommand).\n  (#248, 4f3910cbbaa5)\n\n- Aliases that cannot be defined normally nor invoked normally (highlighted as an error).\n  (#263 (in part), 28932316cca6)\n\n- Path separators (`/`) — the default behaviour remains to highlight path separators\n  and path components the same way.\n  (#136, #260, 6cd39e7c70d3, 9a934d291e7c, f3d3aaa00cc4)\n\n- Assignments to individual positional arguments (`42=foo` to assign to `$42`).\n  (f4036a09cee3)\n\n- Linewise region (the `visual-line-mode` widget, bound to `V` in zsh's `vi` keymap).\n  (#267, a7a7f8b42280, ee07588cfd9b)\n\n- Command-lines recalled by `isearch` mode; requires zsh≥5.3.\n  (#261 (in part); #257; 4ad311ec0a68)\n\n- Command-lines whilst the `IGNORE_BRACES` or `IGNORE_CLOSE_BRACES` option is in effect.\n  (a8a6384356af, 02807f1826a5)\n\n- Mismatched parentheses and braces (in the `main` highlighter).\n  (51b9d79c3bb6, 2fabf7ca64b7, a4196eda5e6f, and others)\n\n- Mismatched `do`/`done` keywords.\n  (b2733a64da93)\n\n- Mismatched `foreach`/`end` keywords.\n  (#96, 2bb8f0703d8f)\n\n- In Bourne-style function definitions, when the `MULTI_FUNC_DEF` option is set\n  (which is the default), highlight the first word in the function body as\n  a command word: `f() { g \"$@\" }`.\n  (6f91850a01e1)\n\n- `always` blocks.\n  (#335, e5782e4ddfb6)\n\n- Command substitutions inside double quotes, `\"$(echo foo)\"`.\n  (#139 (in part), c3913e0d8ead)\n\n- Non-alphabetic parameters inside double quotes (`\"$$\"`, `\"$#\"`, `\"$*\"`, `\"$@\"`, `\"$?\"`, `\"$-\"`).\n  (4afe670f7a1b, 44ef6e38e5a7)\n\n- Command words from future versions of zsh (forward compatibly).\n  This also adds an `arg0` style that all other command word styles fall back to.\n  (b4537a972eed, bccc3dc26943)\n\n- Escaped history expansions inside double quotes: `: \"\\!\"`\n  (28d7056a7a06, et seq)\n\n\n## Fixed highlighting of:\n\n- Command separator tokens in syntactically-invalid positions.\n  (09c4114eb980)\n\n- Redirections with a file descriptor number at command word.\n  (#238 (in part), 73ee7c1f6c4a)\n\n- The `select` prompt, `$PS3`.\n  (#268, 451665cb2a8b)\n\n- Values of variables in `vared`.\n  (e500ca246286)\n\n- `!` as an argument (neither a history expansion nor a reserved word).\n  (4c23a2fd1b90)\n\n- \"division by zero\" error under the `brackets` highlighter when `$ZSH_HIGHLIGHT_STYLES` is empty.\n  (f73f3d53d3a6)\n\n- Process substitutions, `<(pwd)` and `>(wc -l)`.\n  (#302, 6889ff6bd2ad, bfabffbf975c, fc9c892a3f15)\n\n- The non-`SHORT_LOOPS` form of `repeat` loops: `repeat 42; do true; done`.\n  (#290, 4832f18c50a5, ef68f50c048f, 6362c757b6f7)\n\n- Broken symlinks (are now highlighted as files).\n  (#342, 95f7206a9373, 53083da8215e)\n\n- Lines accepted from `isearch` mode.\n  (#284; #257, #259, #288; 5bae6219008b, a8fe22d42251)\n\n- Work around upstream bug that triggered when the command word was a relative\n  path, that when interpreted relative to a $PATH directory denoted a command;\n  the effect of that upstream bug was that the relative path was cached as\n  a \"valid external command name\".\n  (#354, #355, 51614ca2c994, fdaeec45146b, 7d38d07255e4;\n  upstream fix slated to be released in 5.3 (workers/39104))\n\n- After accepting a line with the cursor on a bracket, the matching bracket\n  of the bracket under the cursor no longer remains highlighted (with the\n  `brackets` highlighter).\n  (4c4baede519a)\n\n- The first word on a new line within an array assignment or initialization is no\n  longer considered a command position.\n  (8bf423d16d46)\n\n- Subshells that end at command position, `(A=42)`, `(true;)`.\n  (#231, 7fb6f9979121; #344, 4fc35362ee5a)\n\n- Command word after array assignment, `a=(lorem ipsum) pwd`.\n  (#330, 7fb6f9979121)\n\n\n## API changes (for highlighter authors):\n\n- New interface `_zsh_highlight_add_highlight`.\n  (341a3ae1f015, c346f6eb6fb6)\n\n- tests: Specify the style key, not its value, in test expectations.\n  (a830613467af, fd061b5730bf, eaa4335c3441, among others)\n\n- Module author documentation improvements.\n  (#306 (in part), 217669270418, 0ff354b44b6e, 80148f6c8402, 364f206a547f, and others)\n\n- The driver no longer defines a `_zsh_highlight_${highlighter}_highlighter_cache`\n  variable, which is in the highlighters' namespace.\n  (3e59ab41b6b8, 80148f6c8402, f91a7b885e7d)\n\n- Rename highlighter entry points.  The old names remain supported for\n  backwards compatibility.\n  (a3d5dfcbdae9, c793e0dceab1)\n\n- tests: Add the \"NONE\" expectation.\n  (4da9889d1545, 13018f3dd735, d37c55c788cd)\n\n- tests: consider a test that writes to stderr to have failed.\n  (#291, 1082067f9315)\n\n\n## Developer-visible changes:\n\n- Add `make quiet-test`.\n  (9b64ad750f35)\n\n- test harness: Better quote replaceables in error messages.\n  (30d8f92df225)\n\n- test harness: Fix exit code for XPASS.\n  (bb8d325c0cbd)\n\n- Create [HACKING.md](HACKING.md).\n  (cef49752fd0e)\n\n- tests: Emit a description for PASS test points.\n  (6aa57d60aa64, f0bae44b76dd)\n\n- tests: Create a script that generates a test file.\n  (8013dc3b8db6, et seq; `tests/generate.zsh`)\n\n\n## Other changes:\n\n- Under zsh≤5.2, widgets whose names start with a `_` are no longer excluded\n  from highlighting.\n  (ed33d2cb1388; reverts part of 186d80054a40 which was for #65)\n\n- Under zsh≤5.2, widgets implemented by a function named after the widget are\n  no longer excluded from highlighting.\n  (487b122c480d; reverts part of 776453cb5b69)\n\n- Under zsh≤5.2, shell-unsafe widget names can now be wrapped.\n  (#278, 6a634fac9fb9, et seq)\n\n- Correct some test expectations.\n  (78290e043bc5)\n\n- `zsh-syntax-highlighting.plugin.zsh`: Convert from symlink to plain file\n  for msys2 compatibility.\n  (#292, d4f8edc9f3ad)\n\n- Document installation under some plugin managers.\n  (e635f766bef9, 9cab566f539b)\n\n- Don't leak the `PATH_DIRS` option.\n  (7b82b88a7166)\n\n- Don't require the `FUNCTION_ARGZERO` option to be set.\n  (#338, 750aebc553f2)\n\n- Under zsh≤5.2, support binding incomplete/nonexistent widgets.\n  (9e569bb0fe04, part of #288)\n\n- Make the driver reentrant, fixing possibility of infinite recursion\n  under zsh≤5.2 under interaction with theoretical third-party code.\n  (#305, d711563fe1bf, 295d62ec888d, f3242cbd6aba)\n\n- Fix warnings when `WARN_CREATE_GLOBAL` is set prior to sourcing zsh-syntax-highlighting.\n  (z-sy-h already sets `WARN_CREATE_GLOBAL` internally.)\n  (da60234fb236)\n\n- Warn only once, rather than once per keypress, when a highlighter is unavailable.\n  (0a9b347483ae)\n\n\n# Changes in version 0.4.1\n\n## Fixes:\n\n- Arguments to widgets were not properly dash-escaped.  Only matters for widgets\n  that take arguments (i.e., that are invoked as `zle ${widget} -- ${args}`).\n  (282c7134e8ac, reverts c808d2187a73)\n\n\n# Changes in version 0.4.0\n\n\n## Added highlighting of:\n\n- incomplete sudo commands\n  (a3047a912100, 2f05620b19ae)\n\n    ```zsh\n    sudo;\n    sudo -u;\n    ```\n\n- command words following reserved words\n  (#207, #222, b397b12ac139 et seq, 6fbd2aa9579b et seq, 8b4adbd991b0)\n\n    ```zsh\n    if ls; then ls; else ls; fi\n    repeat 10 do ls; done\n    ```\n\n    (The `ls` are now highlighted as a command.)\n\n- comments (when `INTERACTIVE_COMMENTS` is set)\n  (#163, #167, 693de99a9030)\n\n    ```zsh\n    echo Hello # comment\n    ```\n\n- closing brackets of arithmetic expansion, subshells, and blocks\n  (#226, a59f442d2d34, et seq)\n\n    ```zsh\n    (( foo ))\n    ( foo )\n    { foo }\n    ```\n\n- command names enabled by the `PATH_DIRS` option\n  (#228, 96ee5116b182)\n\n    ```zsh\n    # When ~/bin/foo/bar exists, is executable, ~/bin is in $PATH,\n    # and 'setopt PATH_DIRS' is in effect\n    foo/bar\n    ```\n\n- parameter expansions with braces inside double quotes\n  (#186, 6e3720f39d84)\n\n    ```zsh\n    echo \"${foo}\"\n    ```\n\n- parameter expansions in command word\n  (#101, 4fcfb15913a2)\n\n    ```zsh\n    x=/bin/ls\n    $x -l\n    ```\n\n- the command separators '\\|&', '&!', '&\\|'\n\n    ```zsh\n    view file.pdf &!  ls\n    ```\n\n\n## Fixed highlighting of:\n\n- precommand modifiers at non-command-word position\n  (#209, 2c9f8c8c95fa)\n\n    ```zsh\n    ls command foo\n    ```\n\n- sudo commands with infix redirections\n  (#221, be006aded590, 86e924970911)\n\n    ```zsh\n    sudo -u >/tmp/foo.out user ls\n    ```\n\n- subshells; anonymous functions\n  (#166, #194, 0d1bfbcbfa67, 9e178f9f3948)\n\n    ```zsh\n    (true)\n    () { true }\n    ```\n\n- parameter assignment statements with no command\n  (#205, 01d7eeb3c713)\n\n    ```zsh\n    A=1;\n    ```\n\n    (The semicolon used to be highlighted as a mistake)\n\n- cursor highlighter: Remove the cursor highlighting when accepting a line.\n  (#109, 4f0c293fdef0)\n\n\n## Removed features:\n\n- Removed highlighting of approximate paths (`path_approx`).\n  (#187, 98aee7f8b9a3)\n\n\n## Other changes:\n\n- main highlighter refactored to use states rather than booleans.\n  (2080a441ac49, et seq)\n\n- Fix initialization when sourcing `zsh-syntax-highlighting.zsh` via a symlink\n  (083c47b00707)\n\n- docs: Add screenshot.\n  (57624bb9f64b)\n\n- widgets wrapping: Don't add '--' when invoking widgets.\n  (c808d2187a73) [_reverted in 0.4.1_]\n\n- Refresh highlighting upon `accept-*` widgets (`accept-line` et al).\n  (59fbdda64c21)\n\n- Stop leaking match/mbegin/mend to global scope (thanks to upstream\n  `WARN_CREATE_GLOBAL` improvements).\n  (d3deffbf46a4)\n\n- 'make install': Permit setting `$(SHARE_DIR)` from the environment.\n  (e1078a8b4cf1)\n\n- driver: Tolerate KSH_ARRAYS being set in the calling context.\n  (#162, 8f19af6b319d)\n\n- 'make install': Install documentation fully and properly.\n  (#219, b1619c001390, et seq)\n\n- docs: Improve 'main' highlighter's documentation.\n  (00de155063f5, 7d4252f5f596)\n\n- docs: Moved to a new docs/ tree; assorted minor updates\n  (c575f8f37567, 5b34c23cfad5, et seq)\n\n- docs: Split README.md into INSTALL.md\n  (0b3183f6cb9a)\n\n- driver: Report `$ZSH_HIGHLIGHT_REVISION` when running from git\n  (84734ba95026)\n\n\n## Developer-visible changes:\n\n- Test harness converted to [TAP](https://testanything.org/tap-specification.html) format\n  (d99aa58aaaef, et seq)\n\n- Run each test in a separate subprocess, isolating them from each other\n  (d99aa58aaaef, et seq)\n\n- Fix test failure with nonexisting $HOME\n  (#216, b2ac98b98150)\n\n- Test output is now colorized.\n  (4d3da30f8b72, 6fe07c096109)\n\n- Document `make install`\n  (a18a7427fd2c)\n\n- tests: Allow specifying the zsh binary to use.\n  (557bb7e0c6a0)\n\n- tests: Add 'make perf' target\n  (4513eaea71d7)\n\n- tests: Run each test in a sandbox directory\n  (c01533920245)\n\n\n# Changes in version 0.3.0\n\n\n## Added highlighting of:\n\n- suffix aliases (requires zsh 5.1.1 or newer):\n\n    ```zsh\n    alias -s png=display\n    foo.png\n    ```\n\n- prefix redirections:\n\n    ```zsh\n    <foo.txt cat\n    ```\n\n- redirection operators:\n\n    ```zsh\n    echo > foo.txt\n    ```\n\n- arithmetic evaluations:\n\n    ```zsh\n    (( 42 ))\n    ```\n\n- $'' strings, including \\x/\\octal/\\u/\\U escapes\n\n    ```zsh\n    : $'foo\\u0040bar'\n    ```\n\n- multiline strings:\n\n    ```zsh\n    % echo \"line 1\n    line 2\"\n    ```\n\n- string literals that haven't been finished:\n\n    ```zsh\n    % echo \"Hello, world\n    ```\n- command words that involve tilde expansion:\n\n    ```zsh\n    % ~/bin/foo\n    ```\n\n## Fixed highlighting of:\n\n- quoted command words:\n\n    ```zsh\n    % \\ls\n    ```\n\n- backslash escapes in \"\" strings:\n\n    ```zsh\n    % echo \"\\x41\"\n    ```\n\n- noglob after command separator:\n\n    ```zsh\n    % :; noglob echo *\n    ```\n\n- glob after command separator, when the first command starts with 'noglob':\n\n    ```zsh\n    % noglob true; echo *\n    ```\n\n- the region (vi visual mode / set-mark-command) (issue #165)\n\n- redirection and command separators that would be highlighted as `path_approx`\n\n    ```zsh\n    % echo foo;‸\n    % echo <‸\n    ```\n\n    (where `‸` represents the cursor location)\n\n- escaped globbing (outside quotes)\n\n    ```zsh\n    % echo \\*\n    ```\n\n\n## Other changes:\n\n- implemented compatibility with zsh's paste highlighting (issue #175)\n\n- `$?` propagated correctly to wrapped widgets\n\n- don't leak $REPLY into global scope\n\n\n## Developer-visible changes:\n\n- added makefile with `install` and `test` targets\n\n- set `warn_create_global` internally\n\n- document release process\n\n\n\n\n# Version 0.2.1\n\n(Start of changelog.)\n\n"
  },
  {
    "path": "docs/highlighters/brackets.md",
    "content": "zsh-syntax-highlighting / highlighters / brackets\n-------------------------------------------------\n\nThis is the `brackets` highlighter, that highlights brackets and parentheses, and\nmatches them.\n\n\n### How to tweak it\n\nThis highlighter defines the following styles:\n\n* `bracket-error` - unmatched brackets\n* `bracket-level-N` - brackets with nest level N\n* `cursor-matchingbracket` - the matching bracket, if cursor is on a bracket\n\nTo override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,\nfor example in `~/.zshrc`:\n\n```zsh\n# To define styles for nested brackets up to level 4\nZSH_HIGHLIGHT_STYLES[bracket-level-1]='fg=blue,bold'\nZSH_HIGHLIGHT_STYLES[bracket-level-2]='fg=red,bold'\nZSH_HIGHLIGHT_STYLES[bracket-level-3]='fg=yellow,bold'\nZSH_HIGHLIGHT_STYLES[bracket-level-4]='fg=magenta,bold'\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters/cursor.md",
    "content": "zsh-syntax-highlighting / highlighters / cursor\n-----------------------------------------------\n\nThis is the `cursor` highlighter, that highlights the cursor.\n\n\n### How to tweak it\n\nThis highlighter defines the following styles:\n\n* `cursor` - the style for the current cursor position\n\nTo override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,\nfor example in `~/.zshrc`:\n\n```zsh\nZSH_HIGHLIGHT_STYLES[cursor]='bg=blue'\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters/line.md",
    "content": "zsh-syntax-highlighting / highlighters / line\n---------------------------------------------\n\nThis is the `line` highlighter, that highlights the whole line.\n\n\n### How to tweak it\n\nThis highlighter defines the following styles:\n\n* `line` - the style for the whole line\n\nTo override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,\nfor example in `~/.zshrc`:\n\n```zsh\nZSH_HIGHLIGHT_STYLES[line]='bold'\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters/main.md",
    "content": "zsh-syntax-highlighting / highlighters / main\n---------------------------------------------\n\nThis is the `main` highlighter, that highlights:\n\n* Commands\n* Options\n* Arguments\n* Paths\n* Strings\n\nThis highlighter is active by default.\n\n\n### How to tweak it\n\nThis highlighter defines the following styles:\n\n* `unknown-token` - unknown tokens / errors\n* `reserved-word` - shell reserved words (`if`, `for`)\n* `alias` - aliases\n* `suffix-alias` - suffix aliases (requires zsh 5.1.1 or newer)\n* `global-alias` - global aliases\n* `builtin` - shell builtin commands (`shift`, `pwd`, `zstyle`)\n* `function` - function names\n* `command` - command names\n* `precommand` - precommand modifiers (e.g., `noglob`, `builtin`)\n* `commandseparator` - command separation tokens (`;`, `&&`)\n* `hashed-command` - hashed commands\n* `autodirectory` - a directory name in command position when the `AUTO_CD` option is set\n* `path` - existing filenames\n* `path_pathseparator` - path separators in filenames (`/`); if unset, `path` is used (default)\n* `path_prefix` - prefixes of existing filenames\n* `path_prefix_pathseparator` - path separators in prefixes of existing filenames (`/`); if unset, `path_prefix` is used (default)\n* `globbing` - globbing expressions (`*.txt`)\n* `history-expansion` - history expansion expressions (`!foo` and `^foo^bar`)\n* `command-substitution` - command substitutions (`$(echo foo)`)\n* `command-substitution-unquoted` - an unquoted command substitution (`$(echo foo)`)\n* `command-substitution-quoted` - a quoted command substitution (`\"$(echo foo)\"`)\n* `command-substitution-delimiter` - command substitution delimiters (`$(` and `)`)\n* `command-substitution-delimiter-unquoted` - an unquoted command substitution delimiters (`$(` and `)`)\n* `command-substitution-delimiter-quoted` - a quoted command substitution delimiters (`\"$(` and `)\"`)\n* `process-substitution` - process substitutions (`<(echo foo)`)\n* `process-substitution-delimiter` - process substitution delimiters (`<(` and `)`)\n* `arithmetic-expansion` - arithmetic expansion `$(( 42 ))`)\n* `single-hyphen-option` - single-hyphen options (`-o`)\n* `double-hyphen-option` - double-hyphen options (`--option`)\n* `back-quoted-argument` - backtick command substitution (`` `foo` ``)\n* `back-quoted-argument-unclosed` - unclosed backtick command substitution (`` `foo ``)\n* `back-quoted-argument-delimiter` - backtick command substitution delimiters (`` ` ``)\n* `single-quoted-argument` - single-quoted arguments (`` 'foo' ``)\n* `single-quoted-argument-unclosed` - unclosed single-quoted arguments (`` 'foo ``)\n* `double-quoted-argument` - double-quoted arguments (`` \"foo\" ``)\n* `double-quoted-argument-unclosed` - unclosed double-quoted arguments (`` \"foo ``)\n* `dollar-quoted-argument` - dollar-quoted arguments (`` $'foo' ``)\n* `dollar-quoted-argument-unclosed` - unclosed dollar-quoted arguments (`` $'foo ``)\n* `rc-quote` - two single quotes inside single quotes when the `RC_QUOTES` option is set (`` 'foo''bar' ``)\n* `dollar-double-quoted-argument` - parameter expansion inside double quotes (`$foo` inside `\"\"`)\n* `back-double-quoted-argument` -  backslash escape sequences inside double-quoted arguments (`\\\"` in `\"foo\\\"bar\"`)\n* `back-dollar-quoted-argument` -  backslash escape sequences inside dollar-quoted arguments (`\\x` in `$'\\x48'`)\n* `assign` - parameter assignments (`x=foo` and `x=( )`)\n* `redirection` - redirection operators (`<`, `>`, etc)\n* `comment` - comments, when `setopt INTERACTIVE_COMMENTS` is in effect (`echo # foo`)\n* `comment` - elided parameters in command position (`$x ls` when `$x` is unset or empty)\n* `named-fd` - named file descriptor (the `fd` in `echo foo {fd}>&2`)\n* `numeric-fd` - numeric file descriptor (the `2` in `echo foo {fd}>&2`)\n* `arg0` - a command word other than one of those enumerated above (other than a command, precommand, alias, function, or shell builtin command).\n* `default` - everything else\n\nTo override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,\nfor example in `~/.zshrc`:\n\n```zsh\n# Declare the variable\ntypeset -A ZSH_HIGHLIGHT_STYLES\n\n# To differentiate aliases from other command types\nZSH_HIGHLIGHT_STYLES[alias]='fg=magenta,bold'\n\n# To have paths colored instead of underlined\nZSH_HIGHLIGHT_STYLES[path]='fg=cyan'\n\n# To disable highlighting of globbing expressions\nZSH_HIGHLIGHT_STYLES[globbing]='none'\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n#### Parameters\n\nTo avoid partial path lookups on a path, add the path to the `ZSH_HIGHLIGHT_DIRS_BLACKLIST` array.\n\n```zsh\nZSH_HIGHLIGHT_DIRS_BLACKLIST+=(/mnt/slow_share)\n```\n\n### Useless trivia\n\n#### Forward compatibility.\n\nzsh-syntax-highlighting attempts to be forward-compatible with zsh.\nSpecifically, we attempt to facilitate highlighting _command word_ types that\nhad not yet been invented when this version of zsh-syntax-highlighting was\nreleased.\n\nA _command word_ is something like a function name, external command name, et\ncetera.  (See\n[Simple Commands & Pipelines in `zshmisc(1)`][zshmisc-Simple-Commands-And-Pipelines]\nfor a formal definition.)\n\nIf a new _kind_ of command word is ever added to zsh — something conceptually\ndifferent than \"function\" and \"alias\" and \"external command\" — then command words\nof that (new) kind will be highlighted by the style `arg0_$kind`,\nwhere `$kind` is the output of `type -w` on the new kind of command word.  If that\nstyle is not defined, then the style `arg0` will be used instead.\n\n[zshmisc-Simple-Commands-And-Pipelines]: https://zsh.sourceforge.io/Doc/Release/Shell-Grammar.html#Simple-Commands-_0026-Pipelines\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters/pattern.md",
    "content": "zsh-syntax-highlighting / highlighters / pattern\n------------------------------------------------\n\nThis is the `pattern` highlighter, that highlights user-defined patterns.\n\n\n### How to tweak it\n\nTo use this highlighter, associate patterns with styles in the\n`ZSH_HIGHLIGHT_PATTERNS` associative array, for example in `~/.zshrc`:\n\n```zsh\n# Declare the variable\ntypeset -A ZSH_HIGHLIGHT_PATTERNS\n\n# To have commands starting with `rm -rf` in red:\nZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters/regexp.md",
    "content": "zsh-syntax-highlighting / highlighters / regexp\n------------------------------------------------\n\nThis is the `regexp` highlighter, that highlights user-defined regular\nexpressions. It's similar to the `pattern` highlighter, but allows more complex\npatterns.\n\n### How to tweak it\n\nTo use this highlighter, associate regular expressions with styles in the\n`ZSH_HIGHLIGHT_REGEXP` associative array, for example in `~/.zshrc`:\n\n```zsh\ntypeset -A ZSH_HIGHLIGHT_REGEXP\nZSH_HIGHLIGHT_REGEXP+=('^rm .*' fg=red,bold)\n```\n\nThis will highlight lines that start with a call to the `rm` command.\n\nThe regular expressions flavour used is [PCRE][pcresyntax] when the\n`RE_MATCH_PCRE` option is set and POSIX Extended Regular Expressions (ERE),\nas implemented by the platform's C library, otherwise.  For details on the\nlatter, see [the `zsh/regex` module's documentation][MAN_ZSH_REGEX] and the\n`regcomp(3)` and `re_format(7)` manual pages on your system.\n\nFor instance, to highlight `sudo` only as a complete word, i.e., `sudo cmd`,\nbut not `sudoedit`, one might use:\n\n* When the `RE_MATCH_PCRE` is set:\n\n    ```zsh\n    typeset -A ZSH_HIGHLIGHT_REGEXP\n    ZSH_HIGHLIGHT_REGEXP+=('\\bsudo\\b' fg=123,bold)\n    ```\n\n* When the `RE_MATCH_PCRE` is unset, on platforms with GNU `libc` (e.g., many GNU/Linux distributions):\n\n    ```zsh\n    typeset -A ZSH_HIGHLIGHT_REGEXP\n    ZSH_HIGHLIGHT_REGEXP+=('\\<sudo\\>' fg=123,bold)\n    ```\n\n* When the `RE_MATCH_PCRE` is unset, on BSD-based platforms (e.g., macOS):\n\n    ```zsh\n    typeset -A ZSH_HIGHLIGHT_REGEXP\n    ZSH_HIGHLIGHT_REGEXP+=('[[:<:]]sudo[[:>:]]' fg=123,bold)\n    ```\n\nNote, however, that PCRE and POSIX ERE have a large common subset:\nfor instance, the regular expressions `[abc]`, `a*`, and `(a|b)` have the same\nmeaning in both flavours.\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\nSee also: [regular expressions tutorial][perlretut], zsh regexp operator `=~`\nin [the `zshmisc(1)` manual page][zshmisc-Conditional-Expressions]\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n[perlretut]: https://perldoc.perl.org/perlretut\n[zshmisc-Conditional-Expressions]: https://zsh.sourceforge.io/Doc/Release/Conditional-Expressions.html#Conditional-Expressions\n[MAN_ZSH_REGEX]: https://zsh.sourceforge.io/Doc/Release/Zsh-Modules.html#The-zsh_002fregex-Module\n[pcresyntax]: https://www.pcre.org/original/doc/html/pcresyntax.html\n"
  },
  {
    "path": "docs/highlighters/root.md",
    "content": "zsh-syntax-highlighting / highlighters / root\n---------------------------------------------\n\nThis is the `root` highlighter, that highlights the whole line if the current\nuser is root.\n\n\n### How to tweak it\n\nThis highlighter defines the following styles:\n\n* `root` - the style for the whole line if the current user is root.\n\nTo override one of those styles, change its entry in `ZSH_HIGHLIGHT_STYLES`,\nfor example in `~/.zshrc`:\n\n```zsh\nZSH_HIGHLIGHT_STYLES[root]='bg=red'\n```\n\nThe syntax for values is the same as the syntax of \"types of highlighting\" of\nthe zsh builtin `$zle_highlight` array, which is documented in [the `zshzle(1)`\nmanual page][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n"
  },
  {
    "path": "docs/highlighters.md",
    "content": "zsh-syntax-highlighting / highlighters\n======================================\n\nSyntax highlighting is done by pluggable highlighters:\n\n* `main` - the base highlighter, and the only one [active by default][main].\n* `brackets` - [matches brackets][brackets] and parenthesis.\n* `pattern` - matches [user-defined patterns][pattern].\n* `regexp` - matches [user-defined regular expressions][regexp].\n* `cursor` - matches [the cursor position][cursor].\n* `root` - highlights the whole command line [if the current user is root][root].\n* `line` - applied to [the whole command line][line].\n\n[main]: highlighters/main.md\n[brackets]: highlighters/brackets.md\n[pattern]: highlighters/pattern.md\n[regexp]: highlighters/regexp.md\n[cursor]: highlighters/cursor.md\n[root]: highlighters/root.md\n[line]: highlighters/line.md\n\n\nHighlighter-independent settings\n--------------------------------\n\nBy default, all command lines are highlighted.  However, it is possible to\nprevent command lines longer than a fixed number of characters from being\nhighlighted by setting the variable `${ZSH_HIGHLIGHT_MAXLENGTH}` to the maximum\nlength (in characters) of command lines to be highlighter.  This is useful when\nediting very long command lines (for example, with the [`fned`][fned] utility\nfunction).  Example:\n\n[fned]: https://zsh.sourceforge.io/Doc/Release/User-Contributions.html#index-zed\n\n```zsh\nZSH_HIGHLIGHT_MAXLENGTH=512\n```\n\n\nHow to activate highlighters\n----------------------------\n\nTo activate an highlighter, add it to the `ZSH_HIGHLIGHT_HIGHLIGHTERS` array.\nBy default `ZSH_HIGHLIGHT_HIGHLIGHTERS` is `(main)`. For example to activate\n`brackets`, `pattern`, and `cursor` highlighters, in `~/.zshrc` do:\n\n```zsh\nZSH_HIGHLIGHT_HIGHLIGHTERS+=(brackets pattern cursor)\n```\n\n\nHow to tweak highlighters\n-------------------------\n\nHighlighters look up styles from the `ZSH_HIGHLIGHT_STYLES` associative array.\nNavigate into the [individual highlighters' documentation](highlighters/) to\nsee what styles (keys) each highlighter defines; the syntax for values is the\nsame as the syntax of \"types of highlighting\" of the zsh builtin\n`$zle_highlight` array, which is documented in [the `zshzle(1)` manual\npage][zshzle-Character-Highlighting].\n\n[zshzle-Character-Highlighting]: https://zsh.sourceforge.io/Doc/Release/Zsh-Line-Editor.html#Character-Highlighting\n\nSome highlighters support additional configuration parameters; see each\nhighlighter's documentation for details and examples.\n\n\nHow to implement a new highlighter\n----------------------------------\n\nTo create your own `acme` highlighter:\n\n* Create your script at\n    `highlighters/acme/acme-highlighter.zsh`.\n\n* Implement the `_zsh_highlight_highlighter_acme_predicate` function.\n  This function must return 0 when the highlighter needs to be called and\n  non-zero otherwise, for example:\n\n    ```zsh\n    _zsh_highlight_highlighter_acme_predicate() {\n      # Call this highlighter in SVN working copies\n      [[ -d .svn ]]\n    }\n    ```\n\n* Implement the `_zsh_highlight_highlighter_acme_paint` function.\n  This function does the actual syntax highlighting, by calling\n  `_zsh_highlight_add_highlight` with the start and end of the region to\n  be highlighted and the `ZSH_HIGHLIGHT_STYLES` key to use. Define the default\n  style for that key in the highlighter script outside of any function with\n  `: ${ZSH_HIGHLIGHT_STYLES[key]:=value}`, being sure to prefix\n  the key with your highlighter name and a colon. For example:\n\n    ```zsh\n    : ${ZSH_HIGHLIGHT_STYLES[acme:aurora]:=fg=green}\n\n    _zsh_highlight_highlighter_acme_paint() {\n      # Colorize the whole buffer with the 'aurora' style\n      _zsh_highlight_add_highlight 0 $#BUFFER acme:aurora\n    }\n    ```\n\n  If you need to test which options the user has set, test `zsyh_user_options`\n  with a sensible default if the option is not present in supported zsh\n  versions. For example:\n\n    ```zsh\n    [[ ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]\n    ```\n\n  The option name must be all lowercase with no underscores and not an alias.\n\n* Name your own functions and global variables `_zsh_highlight_acme_*`.\n\n    - In zsh-syntax-highlighting 0.4.0 and earlier, the entrypoints \n        `_zsh_highlight_highlighter_acme_predicate` and\n        `_zsh_highlight_highlighter_acme_paint`\n        were named\n        `_zsh_highlight_acme_highlighter_predicate` and\n        `_zsh_highlight_highlighter_acme_paint` respectively.\n\n        These names are still supported for backwards compatibility;\n        however, support for them will be removed in a future major or minor release (v0.x.0 or v1.0.0).\n\n* Activate your highlighter in `~/.zshrc`:\n\n    ```zsh\n    ZSH_HIGHLIGHT_HIGHLIGHTERS+=(acme)\n    ```\n\n* [Write tests](../tests/README.md).\n"
  },
  {
    "path": "highlighters/README.md",
    "content": "zsh-syntax-highlighting / highlighters\n======================================\n\nNavigate into the individual highlighters' documentation to see\nwhat styles (`$ZSH_HIGHLIGHT_STYLES` keys) each highlighter defines.\n\nRefer to the [documentation on highlighters](../docs/highlighters.md) for further\ninformation.\n"
  },
  {
    "path": "highlighters/brackets/brackets-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Define default styles.\n: ${ZSH_HIGHLIGHT_STYLES[bracket-error]:=fg=red,bold}\n: ${ZSH_HIGHLIGHT_STYLES[bracket-level-1]:=fg=blue,bold}\n: ${ZSH_HIGHLIGHT_STYLES[bracket-level-2]:=fg=green,bold}\n: ${ZSH_HIGHLIGHT_STYLES[bracket-level-3]:=fg=magenta,bold}\n: ${ZSH_HIGHLIGHT_STYLES[bracket-level-4]:=fg=yellow,bold}\n: ${ZSH_HIGHLIGHT_STYLES[bracket-level-5]:=fg=cyan,bold}\n: ${ZSH_HIGHLIGHT_STYLES[cursor-matchingbracket]:=standout}\n\n# Whether the brackets highlighter should be called or not.\n_zsh_highlight_highlighter_brackets_predicate()\n{\n  [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved || _zsh_highlight_buffer_modified\n}\n\n# Brackets highlighting function.\n_zsh_highlight_highlighter_brackets_paint()\n{\n  local char style\n  local -i bracket_color_size=${#ZSH_HIGHLIGHT_STYLES[(I)bracket-level-*]} buflen=${#BUFFER} level=0 matchingpos pos\n  local -A levelpos lastoflevel matching\n\n  # Find all brackets and remember which one is matching\n  pos=0\n  for char in ${(s..)BUFFER} ; do\n    (( ++pos ))\n    case $char in\n      [\"([{\"])\n        levelpos[$pos]=$((++level))\n        lastoflevel[$level]=$pos\n        ;;\n      [\")]}\"])\n        if (( level > 0 )); then\n          matchingpos=$lastoflevel[$level]\n          levelpos[$pos]=$((level--))\n          if _zsh_highlight_brackets_match $matchingpos $pos; then\n            matching[$matchingpos]=$pos\n            matching[$pos]=$matchingpos\n          fi\n        else\n          levelpos[$pos]=-1\n        fi\n        ;;\n    esac\n  done\n\n  # Now highlight all found brackets\n  for pos in ${(k)levelpos}; do\n    if (( $+matching[$pos] )); then\n      if (( bracket_color_size )); then\n        _zsh_highlight_add_highlight $((pos - 1)) $pos bracket-level-$(( (levelpos[$pos] - 1) % bracket_color_size + 1 ))\n      fi\n    else\n      _zsh_highlight_add_highlight $((pos - 1)) $pos bracket-error\n    fi\n  done\n\n  # If cursor is on a bracket, then highlight corresponding bracket, if any.\n  if [[ $WIDGET != zle-line-finish ]]; then\n    pos=$((CURSOR + 1))\n    if (( $+levelpos[$pos] )) && (( $+matching[$pos] )); then\n      local -i otherpos=$matching[$pos]\n      _zsh_highlight_add_highlight $((otherpos - 1)) $otherpos cursor-matchingbracket\n    fi\n  fi\n}\n\n# Helper function to differentiate type \n_zsh_highlight_brackets_match()\n{\n  case $BUFFER[$1] in\n    \\() [[ $BUFFER[$2] == \\) ]];;\n    \\[) [[ $BUFFER[$2] == \\] ]];;\n    \\{) [[ $BUFFER[$2] == \\} ]];;\n    *) false;;\n  esac\n}\n"
  },
  {
    "path": "highlighters/brackets/test-data/cursor-matchingbracket-line-finish.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nWIDGET=zle-line-finish\n\nBUFFER=': $foo[bar]'\nCURSOR=6 # cursor is zero-based\n\nexpected_region_highlight=(\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/cursor-matchingbracket.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\nZSH_HIGHLIGHT_STYLES[bracket-level-3]=\n\nBUFFER=': ((( )))'\nCURSOR=2 # cursor is zero-based\n\nexpected_region_highlight=(\n  \"3 3 bracket-level-1\"\n  \"4 4 bracket-level-2\"\n  \"5 5 bracket-level-3\"\n  \"7 7 bracket-level-3\"\n  \"8 8 bracket-level-2\"\n  \"9 9 bracket-level-1\"\n  \"9 9 cursor-matchingbracket\"\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/empty-styles.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': (x)'\n\nexpected_region_highlight=(\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/loop-styles.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\nZSH_HIGHLIGHT_STYLES[bracket-level-3]=\n\nBUFFER=': ({[({[(x)]})]})'\n\nexpected_region_highlight=(\n  \"3  3  bracket-level-1\"\n  \"4  4  bracket-level-2\"\n  \"5  5  bracket-level-3\"\n  \"6  6  bracket-level-1\"\n  \"7  7  bracket-level-2\"\n  \"8  8  bracket-level-3\"\n  \"9  9  bracket-level-1\"\n  \"11 11 bracket-level-1\"\n  \"12 12 bracket-level-3\"\n  \"13 13 bracket-level-2\"\n  \"14 14 bracket-level-1\"\n  \"15 15 bracket-level-3\"\n  \"16 16 bracket-level-2\"\n  \"17 17 bracket-level-1\"\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/mismatch-patentheses.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\n\nBUFFER='echo ({x}]'\n\nexpected_region_highlight=(\n  \"6  6  bracket-error\" # (\n  \"7  7  bracket-level-2\" # {\n  \"9  9  bracket-level-2\" # }\n  \"10 10 bracket-error\" # )\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/near-quotes.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\n\nBUFFER=': {\"{x}\"}'\n\nexpected_region_highlight=(\n  \"3 3 bracket-level-1\"\n  \"5 5 bracket-level-2\"\n  \"7 7 bracket-level-2\"\n  \"9 9 bracket-level-1\"\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/nested-parentheses.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\nZSH_HIGHLIGHT_STYLES[bracket-level-3]=\n\nBUFFER='echo $(echo ${(z)array})'\n\nexpected_region_highlight=(\n  \"7  7  bracket-level-1\" # (\n  \"14 14 bracket-level-2\" # {\n  \"15 15 bracket-level-3\" # (\n  \"17 17 bracket-level-3\" # )\n  \"23 23 bracket-level-2\" # }\n  \"24 24 bracket-level-1\" # )\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/only-error.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': x)'\n\nexpected_region_highlight=(\n  \"4 4 bracket-error\" # )\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/quoted-patentheses.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"foo ( bar\"'\n\nexpected_region_highlight=(\n\"11 11 bracket-error\"\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/simple-parentheses.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\n\nBUFFER='echo ({x})'\n\nexpected_region_highlight=(\n  \"6  6  bracket-level-1\" # (\n  \"7  7  bracket-level-2\" # {\n  \"9  9  bracket-level-2\" # }\n  \"10 10 bracket-level-1\" # )\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/unclosed-patentheses.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\nZSH_HIGHLIGHT_STYLES[bracket-level-2]=\n\nBUFFER='echo ({x}'\n\nexpected_region_highlight=(\n  \"6  6  bracket-error\" # (\n  \"7  7  bracket-level-2\" # {\n  \"9  9  bracket-level-2\" # }\n)\n"
  },
  {
    "path": "highlighters/brackets/test-data/unclosed-patentheses2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsorted=1\n\nZSH_HIGHLIGHT_STYLES[bracket-level-1]=\n\nBUFFER='echo {x})'\n\nexpected_region_highlight=(\n  \"6  6  bracket-level-1\" # {\n  \"8  8  bracket-level-1\" # }\n  \"9  9 bracket-error\" # )\n)\n"
  },
  {
    "path": "highlighters/cursor/cursor-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Define default styles.\n: ${ZSH_HIGHLIGHT_STYLES[cursor]:=standout}\n\n# Whether the cursor highlighter should be called or not.\n_zsh_highlight_highlighter_cursor_predicate()\n{\n  # remove cursor highlighting when the line is finished\n  [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_cursor_moved\n}\n\n# Cursor highlighting function.\n_zsh_highlight_highlighter_cursor_paint()\n{\n  [[ $WIDGET == zle-line-finish ]] && return\n  \n  _zsh_highlight_add_highlight $CURSOR $(( $CURSOR + 1 )) cursor\n}\n"
  },
  {
    "path": "highlighters/line/line-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Define default styles.\n: ${ZSH_HIGHLIGHT_STYLES[line]:=}\n\n# Whether the root highlighter should be called or not.\n_zsh_highlight_highlighter_line_predicate()\n{\n  _zsh_highlight_buffer_modified\n}\n\n# root highlighting function.\n_zsh_highlight_highlighter_line_paint()\n{\n  _zsh_highlight_add_highlight 0 $#BUFFER line\n}\n"
  },
  {
    "path": "highlighters/main/main-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Define default styles.\n: ${ZSH_HIGHLIGHT_STYLES[default]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[unknown-token]:=fg=red,bold}\n: ${ZSH_HIGHLIGHT_STYLES[reserved-word]:=fg=yellow}\n: ${ZSH_HIGHLIGHT_STYLES[suffix-alias]:=fg=green,underline}\n: ${ZSH_HIGHLIGHT_STYLES[global-alias]:=fg=cyan}\n: ${ZSH_HIGHLIGHT_STYLES[precommand]:=fg=green,underline}\n: ${ZSH_HIGHLIGHT_STYLES[commandseparator]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[autodirectory]:=fg=green,underline}\n: ${ZSH_HIGHLIGHT_STYLES[path]:=underline}\n: ${ZSH_HIGHLIGHT_STYLES[path_pathseparator]:=}\n: ${ZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]:=}\n: ${ZSH_HIGHLIGHT_STYLES[globbing]:=fg=blue}\n: ${ZSH_HIGHLIGHT_STYLES[history-expansion]:=fg=blue}\n: ${ZSH_HIGHLIGHT_STYLES[command-substitution]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[command-substitution-delimiter]:=fg=magenta}\n: ${ZSH_HIGHLIGHT_STYLES[process-substitution]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[process-substitution-delimiter]:=fg=magenta}\n: ${ZSH_HIGHLIGHT_STYLES[single-hyphen-option]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[double-hyphen-option]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[back-quoted-argument]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[back-quoted-argument-delimiter]:=fg=magenta}\n: ${ZSH_HIGHLIGHT_STYLES[single-quoted-argument]:=fg=yellow}\n: ${ZSH_HIGHLIGHT_STYLES[double-quoted-argument]:=fg=yellow}\n: ${ZSH_HIGHLIGHT_STYLES[dollar-quoted-argument]:=fg=yellow}\n: ${ZSH_HIGHLIGHT_STYLES[rc-quote]:=fg=cyan}\n: ${ZSH_HIGHLIGHT_STYLES[dollar-double-quoted-argument]:=fg=cyan}\n: ${ZSH_HIGHLIGHT_STYLES[back-double-quoted-argument]:=fg=cyan}\n: ${ZSH_HIGHLIGHT_STYLES[back-dollar-quoted-argument]:=fg=cyan}\n: ${ZSH_HIGHLIGHT_STYLES[assign]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[redirection]:=fg=yellow}\n: ${ZSH_HIGHLIGHT_STYLES[comment]:=fg=black,bold}\n: ${ZSH_HIGHLIGHT_STYLES[named-fd]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[numeric-fd]:=none}\n: ${ZSH_HIGHLIGHT_STYLES[arg0]:=fg=green}\n\n# Whether the highlighter should be called or not.\n_zsh_highlight_highlighter_main_predicate()\n{\n  # may need to remove path_prefix highlighting when the line ends\n  [[ $WIDGET == zle-line-finish ]] || _zsh_highlight_buffer_modified\n}\n\n# Helper to deal with tokens crossing line boundaries.\n_zsh_highlight_main_add_region_highlight() {\n  integer start=$1 end=$2\n  shift 2\n\n  if (( $#in_alias )); then\n    [[ $1 == unknown-token ]] && alias_style=unknown-token\n    return\n  fi\n  if (( in_param )); then\n    if [[ $1 == unknown-token ]]; then\n      param_style=unknown-token\n    fi\n    if [[ -n $param_style ]]; then\n      return\n    fi\n    param_style=$1\n    return\n  fi\n\n  # The calculation was relative to $buf but region_highlight is relative to $BUFFER.\n  (( start += buf_offset ))\n  (( end += buf_offset ))\n\n  list_highlights+=($start $end $1)\n}\n\n_zsh_highlight_main_add_many_region_highlights() {\n  for 1 2 3; do\n    _zsh_highlight_main_add_region_highlight $1 $2 $3\n  done\n}\n\n_zsh_highlight_main_calculate_fallback() {\n  local -A fallback_of; fallback_of=(\n      alias arg0\n      suffix-alias arg0\n      global-alias dollar-double-quoted-argument\n      builtin arg0\n      function arg0\n      command arg0\n      precommand arg0\n      hashed-command arg0\n      autodirectory arg0\n      arg0_\\* arg0\n\n      # TODO: Maybe these? —\n      #   named-fd file-descriptor\n      #   numeric-fd file-descriptor\n\n      path_prefix path\n      # The path separator fallback won't ever be used, due to the optimisation\n      # in _zsh_highlight_main_highlighter_highlight_path_separators().\n      path_pathseparator path\n      path_prefix_pathseparator path_prefix\n\n      single-quoted-argument{-unclosed,}\n      double-quoted-argument{-unclosed,}\n      dollar-quoted-argument{-unclosed,}\n      back-quoted-argument{-unclosed,}\n\n      command-substitution{-quoted,,-unquoted,}\n      command-substitution-delimiter{-quoted,,-unquoted,}\n\n      command-substitution{-delimiter,}\n      process-substitution{-delimiter,}\n      back-quoted-argument{-delimiter,}\n  )\n  local needle=$1 value\n  reply=($1)\n  while [[ -n ${value::=$fallback_of[(k)$needle]} ]]; do\n    unset \"fallback_of[$needle]\" # paranoia against infinite loops\n    reply+=($value)\n    needle=$value\n  done\n}\n\n# Get the type of a command.\n#\n# Uses the zsh/parameter module if available to avoid forks, and a\n# wrapper around 'type -w' as fallback.\n#\n# If $2 is 0, do not consider aliases.\n#\n# The result will be stored in REPLY.\n_zsh_highlight_main__type() {\n  integer -r aliases_allowed=${2-1}\n  # We won't cache replies of anything that exists as an alias at all, to\n  # ensure the cached value is correct regardless of $aliases_allowed.\n  #\n  # ### We probably _should_ cache them in a cache that's keyed on the value of\n  # ### $aliases_allowed, on the assumption that aliases are the common case.\n  integer may_cache=1\n\n  # Cache lookup\n  if (( $+_zsh_highlight_main__command_type_cache )); then\n    REPLY=$_zsh_highlight_main__command_type_cache[(e)$1]\n    if [[ -n \"$REPLY\" ]]; then\n      return\n    fi\n  fi\n\n  # Main logic\n  if (( $#options_to_set )); then\n    setopt localoptions $options_to_set;\n  fi\n  unset REPLY\n  if zmodload -e zsh/parameter; then\n    if (( $+aliases[(e)$1] )); then\n      may_cache=0\n    fi\n    if (( ${+galiases[(e)$1]} )) && (( aliases_allowed )); then\n      REPLY='global alias'\n    elif (( $+aliases[(e)$1] )) && (( aliases_allowed )); then\n      REPLY=alias\n    elif [[ $1 == *.* && -n ${1%.*} ]] && (( $+saliases[(e)${1##*.}] )); then\n      REPLY='suffix alias'\n    elif (( $reswords[(Ie)$1] )); then\n      REPLY=reserved\n    elif (( $+functions[(e)$1] )); then\n      REPLY=function\n    elif (( $+builtins[(e)$1] )); then\n      REPLY=builtin\n    elif (( $+commands[(e)$1] )); then\n      REPLY=command\n    # None of the special hashes had a match, so fall back to 'type -w', for\n    # forward compatibility with future versions of zsh that may add new command\n    # types.\n    #\n    # zsh 5.2 and older have a bug whereby running 'type -w ./sudo' implicitly\n    # runs 'hash ./sudo=/usr/local/bin/./sudo' (assuming /usr/local/bin/sudo\n    # exists and is in $PATH).  Avoid triggering the bug, at the expense of\n    # falling through to the $() below, incurring a fork.  (Issue #354.)\n    #\n    # The first disjunct mimics the isrelative() C call from the zsh bug.\n    elif {  [[ $1 != */* ]] || is-at-least 5.3 } &&\n         # Add a subshell to avoid a zsh upstream bug; see issue #606.\n         # ### Remove the subshell when we stop supporting zsh 5.7.1 (I assume 5.8 will have the bugfix).\n         ! (builtin type -w -- \"$1\") >/dev/null 2>&1; then\n      REPLY=none\n    fi\n  fi\n  if ! (( $+REPLY )); then\n    # zsh/parameter not available or had no matches.\n    #\n    # Note that 'type -w' will run 'rehash' implicitly.\n    #\n    # We 'unalias' in a subshell, so the parent shell is not affected.\n    #\n    # The colon command is there just to avoid a command substitution that\n    # starts with an arithmetic expression [«((…))» as the first thing inside\n    # «$(…)»], which is area that has had some parsing bugs before 5.6\n    # (approximately).\n    REPLY=\"${$(:; (( aliases_allowed )) || unalias -- \"$1\" 2>/dev/null; LC_ALL=C builtin type -w -- \"$1\" 2>/dev/null)##*: }\"\n    if [[ $REPLY == 'alias' ]]; then\n      may_cache=0\n    fi\n  fi\n\n  # Cache population\n  if (( may_cache )) && (( $+_zsh_highlight_main__command_type_cache )); then\n    _zsh_highlight_main__command_type_cache[(e)$1]=$REPLY\n  fi\n  [[ -n $REPLY ]]\n  return $?\n}\n\n# Checks whether $1 is something that can be run.\n#\n# Return 0 if runnable, 1 if not runnable, 2 if trouble.\n_zsh_highlight_main__is_runnable() {\n  if _zsh_highlight_main__type \"$1\"; then\n    [[ $REPLY != none ]]\n  else\n    return 2\n  fi\n}\n\n# Check whether the first argument is a redirection operator token.\n# Report result via the exit code.\n_zsh_highlight_main__is_redirection() {\n  # A redirection operator token:\n  # - starts with an optional single-digit number;\n  # - is one of the tokens listed in zshmisc(1)\n  # - however (z) normalizes ! to |\n  [[ ${1#[0-9]} == (\\<|\\<\\>|(\\>|\\>\\>)(|\\|)|\\<\\<(|-)|\\<\\<\\<|\\<\\&|\\&\\<|(\\>|\\>\\>)\\&(|\\|)|\\&(\\>|\\>\\>)(|\\||\\!)) ]]\n}\n\n# Resolve alias.\n#\n# Takes a single argument.\n#\n# The result will be stored in REPLY.\n_zsh_highlight_main__resolve_alias() {\n  if zmodload -e zsh/parameter; then\n    REPLY=${aliases[$arg]}\n  else\n    REPLY=\"${\"$(alias -- $arg)\"#*=}\"\n  fi\n}\n\n# Return true iff $1 is a global alias\n_zsh_highlight_main__is_global_alias() {\n  if zmodload -e zsh/parameter; then\n    (( ${+galiases[$arg]} ))\n  elif [[ $arg == '='* ]]; then\n    # avoid running into «alias -L '=foo'» erroring out with 'bad assignment'\n    return 1\n  else\n    alias -L -g -- \"$1\" >/dev/null\n  fi\n}\n\n# Check that the top of $braces_stack has the expected value.  If it does, set\n# the style according to $2; otherwise, set style=unknown-token.\n#\n# $1: character expected to be at the top of $braces_stack\n# $2: optional assignment to style it if matches\n# return value is 0 if there is a match else 1\n_zsh_highlight_main__stack_pop() {\n  if [[ $braces_stack[1] == $1 ]]; then\n    braces_stack=${braces_stack:1}\n    if (( $+2 )); then\n      style=$2\n    fi\n    return 0\n  else\n    style=unknown-token\n    return 1\n  fi\n}\n\n# Main syntax highlighting function.\n_zsh_highlight_highlighter_main_paint()\n{\n  setopt localoptions extendedglob\n\n  # At the PS3 prompt and in vared, highlight nothing.\n  #\n  # (We can't check this in _zsh_highlight_highlighter_main_predicate because\n  # if the predicate returns false, the previous value of region_highlight\n  # would be reused.)\n  if [[ $CONTEXT == (select|vared) ]]; then\n    return\n  fi\n\n  typeset -a ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR\n  typeset -a ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW\n  local -a options_to_set reply # used in callees\n  local REPLY\n\n  # $flags_with_argument is a set of letters, corresponding to the option letters\n  # that would be followed by a colon in a getopts specification.\n  local flags_with_argument\n  # $flags_sans_argument is a set of letters, corresponding to the option letters\n  # that wouldn't be followed by a colon in a getopts specification.\n  local flags_sans_argument\n  # $flags_solo is a set of letters, corresponding to option letters that, if\n  # present, mean the precommand will not be acting as a precommand, i.e., will\n  # not be followed by a :start: word.\n  local flags_solo\n  # $precommand_options maps precommand name to values of $flags_with_argument,\n  # $flags_sans_argument, and flags_solo for that precommand, joined by a\n  # colon.  (The value is NOT a getopt(3) spec, although it resembles one.)\n  #\n  # Currently, setting $flags_sans_argument is only important for commands that\n  # have a non-empty $flags_with_argument; see test-data/precommand4.zsh.\n  local -A precommand_options\n  precommand_options=(\n    # Precommand modifiers as of zsh 5.6.2 cf. zshmisc(1).\n    '-' ''\n    'builtin' ''\n    'command' :pvV\n    'exec' a:cl\n    'noglob' ''\n    # 'time' and 'nocorrect' shouldn't be added here; they're reserved words, not precommands.\n\n    # miscellaneous commands\n    'doas' aCu:Lns # as of OpenBSD's doas(1) dated September 4, 2016\n    'nice' n: # as of current POSIX spec\n    'pkexec' '' # doesn't take short options; immune to #121 because it's usually not passed --option flags\n    # Not listed: -h, which has two different meanings.\n    'sudo' Cgprtu:AEHPSbilns:eKkVv # as of sudo 1.8.21p2\n    'stdbuf' ioe:\n    'eatmydata' ''\n    'catchsegv' ''\n    'nohup' ''\n    'setsid' :wc\n    'env' u:i\n    'ionice' cn:t:pPu # util-linux 2.33.1-0.1\n    'strace' IbeaosXPpEuOS:ACdfhikqrtTvVxyDc # strace 4.26-0.2\n    'proxychains' f:q # proxychains 4.4.0\n    'torsocks' idq:upaP # Torsocks 2.3.0\n    'torify' idq:upaP # Torsocks 2.3.0\n    'ssh-agent' aEPt:csDd:k # As of OpenSSH 8.1p1\n    'tabbed' gnprtTuU:cdfhs:v # suckless-tools v44\n    'chronic' :ev # moreutils 0.62-1\n    'ifne' :n # moreutils 0.62-1\n    'grc' :se # grc - a \"generic colouriser\" (that's their spelling, not mine)\n    'cpulimit' elp:ivz # cpulimit 0.2\n    'ktrace' fgpt:aBCcdiT\n    'caffeinate' tw:dimsu # as of macOS's caffeinate(8) dated November 9, 2012\n  )\n  # Commands that would need to skip one positional argument:\n  #    flock\n  #    ssh\n  #    _wanted (skip two)\n\n  if [[ $zsyh_user_options[ignorebraces] == on || ${zsyh_user_options[ignoreclosebraces]:-off} == on ]]; then\n    local right_brace_is_recognised_everywhere=false\n  else\n    local right_brace_is_recognised_everywhere=true\n  fi\n\n  if [[ $zsyh_user_options[pathdirs] == on ]]; then\n    options_to_set+=( PATH_DIRS )\n  fi\n\n  ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR=(\n    '|' '||' ';' '&' '&&'\n    $'\\n' # ${(z)} returns ';' but we convert it to $'\\n'\n    '|&'\n    '&!' '&|'\n    # ### 'case' syntax, but followed by a pattern, not by a command\n    # ';;' ';&' ';|'\n  )\n\n  # Tokens that, at (naively-determined) \"command position\", are followed by\n  # a de jure command position.  All of these are reserved words.\n  ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW=(\n    $'\\x7b' # block\n    $'\\x28' # subshell\n    '()' # anonymous function\n    'while'\n    'until'\n    'if'\n    'then'\n    'elif'\n    'else'\n    'do'\n    'time'\n    'coproc'\n    '!' # reserved word; unrelated to $histchars[1]\n  )\n\n  if (( $+X_ZSH_HIGHLIGHT_DIRS_BLACKLIST )); then\n    print >&2 'zsh-syntax-highlighting: X_ZSH_HIGHLIGHT_DIRS_BLACKLIST is deprecated. Please use ZSH_HIGHLIGHT_DIRS_BLACKLIST.'\n    ZSH_HIGHLIGHT_DIRS_BLACKLIST=($X_ZSH_HIGHLIGHT_DIRS_BLACKLIST)\n    unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST\n  fi\n\n  _zsh_highlight_main_highlighter_highlight_list -$#PREBUFFER '' 1 \"$PREBUFFER$BUFFER\"\n\n  # end is a reserved word\n  local start end_ style\n  for start end_ style in $reply; do\n    (( start >= end_ )) && { print -r -- >&2 \"zsh-syntax-highlighting: BUG: _zsh_highlight_highlighter_main_paint: start($start) >= end($end_)\"; return }\n    (( end_ <= 0 )) && continue\n    (( start < 0 )) && start=0 # having start<0 is normal with e.g. multiline strings\n    _zsh_highlight_main_calculate_fallback $style\n    _zsh_highlight_add_highlight $start $end_ $reply\n  done\n}\n\n# Try to expand $1, if it's possible to do so safely.\n# \n# Uses two parameters from the caller: $parameter_name_pattern and $res.\n#\n# If expansion was done, set $reply to the expansion and return true.\n# Otherwise, return false.\n_zsh_highlight_main_highlighter__try_expand_parameter()\n{\n  local arg=\"$1\"\n  unset reply\n  {\n    # ### For now, expand just '$foo' or '${foo}', possibly with braces, but with\n    # ### no other features of the parameter expansion syntax.  (No ${(x)foo},\n    # ### no ${foo[x]}, no ${foo:-x}.)\n    {\n      local -a match mbegin mend\n      local MATCH; integer MBEGIN MEND\n      local parameter_name\n      local -a words\n      if [[ $arg[1] != '$' ]]; then\n        return 1\n      fi\n      if [[ ${arg[2]} == '{' ]] && [[ ${arg[-1]} == '}' ]]; then\n        parameter_name=${${arg:2}%?}\n      else\n        parameter_name=${arg:1}\n      fi\n      if [[ $res == none ]] && \n         [[ ${parameter_name} =~ ^${~parameter_name_pattern}$ ]] &&\n         [[ ${(tP)MATCH} != *special* ]]\n      then\n        # Set $arg and update $res.\n        case ${(tP)MATCH} in\n          (*array*|*assoc*)\n            words=( ${(P)MATCH} )\n            ;;\n          (\"\")\n            # not set\n            words=( )\n            ;;\n          (*)\n            # scalar, presumably\n            if [[ $zsyh_user_options[shwordsplit] == on ]]; then\n              words=( ${(P)=MATCH} )\n            else\n              words=( ${(P)MATCH} )\n            fi\n            ;;\n        esac\n        reply=( \"${words[@]}\" )\n      else\n        return 1\n      fi\n    }\n  }\n}\n\n# $1 is the offset of $4 from the parent buffer. Added to the returned highlights.\n# $2 is the initial braces_stack (for a closing paren).\n# $3 is 1 if $4 contains the end of $BUFFER, else 0.\n# $4 is the buffer to highlight.\n# Returns:\n# $REPLY: $buf[REPLY] is the last character parsed.\n# $reply is an array of region_highlight additions.\n# exit code is 0 if the braces_stack is empty, 1 otherwise.\n_zsh_highlight_main_highlighter_highlight_list()\n{\n  integer start_pos end_pos=0 buf_offset=$1 has_end=$3\n  # alias_style is the style to apply to an alias once $#in_alias == 0\n  #     Usually 'alias' but set to 'unknown-token' if any word expanded from\n  #     the alias would be highlighted as unknown-token\n  # param_style is analogous for parameter expansions\n  local alias_style param_style last_arg arg buf=$4 highlight_glob=true saw_assignment=false style\n  local in_array_assignment=false # true between 'a=(' and the matching ')'\n  # in_alias is an array of integers with each element equal to the number\n  #     of shifts needed until arg=args[1] pops an arg from the next level up\n  #     alias or from BUFFER.\n  # in_param is analogous for parameter expansions\n  integer in_param=0 len=$#buf\n  local -a in_alias match mbegin mend list_highlights\n  # seen_alias is a map of aliases already seen to avoid loops like alias a=b b=a\n  local -A seen_alias\n  # Pattern for parameter names\n  readonly parameter_name_pattern='([A-Za-z_][A-Za-z0-9_]*|[0-9]+)'\n  list_highlights=()\n\n  # \"R\" for round\n  # \"Q\" for square\n  # \"Y\" for curly\n  # \"T\" for [[ ]]\n  # \"S\" for $( ), =( ), <( ), >( )\n  # \"D\" for do/done\n  # \"$\" for 'end' (matches 'foreach' always; also used with cshjunkiequotes in repeat/while)\n  # \"?\" for 'if'/'fi'; also checked by 'elif'/'else'\n  # \":\" for 'then'\n  local braces_stack=$2\n\n  # State machine\n  #\n  # The states are:\n  # - :start:      Command word\n  # - :start_of_pipeline:      Start of a 'pipeline' as defined in zshmisc(1).\n  #                Only valid when :start: is present\n  # - :sudo_opt:   A leading-dash option to a precommand, whether it takes an\n  #                argument or not.  (Example: sudo's \"-u\" or \"-i\".)\n  # - :sudo_arg:   The argument to a precommand's leading-dash option,\n  #                when given as a separate word; i.e., \"foo\" in \"-u foo\" (two\n  #                words) but not in \"-ufoo\" (one word).\n  #    Note:       :sudo_opt: and :sudo_arg: are used for any precommand\n  #                declared in ${precommand_options}, not just for sudo(8).\n  #                The naming is historical.\n  # - :regular:    \"Not a command word\", and command delimiters are permitted.\n  #                Mainly used to detect premature termination of commands.\n  # - :always:     The word 'always' in the «{ foo } always { bar }» syntax.\n  #\n  # When the kind of a word is not yet known, $this_word / $next_word may contain\n  # multiple states.  For example, after \"sudo -i\", the next word may be either\n  # another --flag or a command name, hence the state would include both ':start:'\n  # and ':sudo_opt:'.\n  #\n  # The tokens are always added with both leading and trailing colons to serve as\n  # word delimiters (an improvised array); [[ $x == *':foo:'* ]] and x=${x//:foo:/}\n  # will DTRT regardless of how many elements or repetitions $x has.\n  #\n  # Handling of redirections: upon seeing a redirection token, we must stall\n  # the current state --- that is, the value of $this_word --- for two iterations\n  # (one for the redirection operator, one for the word following it representing\n  # the redirection target).  Therefore, we set $in_redirection to 2 upon seeing a\n  # redirection operator, decrement it each iteration, and stall the current state\n  # when it is non-zero.  Thus, upon reaching the next word (the one that follows\n  # the redirection operator and target), $this_word will still contain values\n  # appropriate for the word immediately following the word that preceded the\n  # redirection operator.\n  #\n  # The \"the previous word was a redirection operator\" state is not communicated\n  # to the next iteration via $next_word/$this_word as usual, but via\n  # $in_redirection.  The value of $next_word from the iteration that processed\n  # the operator is discarded.\n  #\n  # $in_redirection is currently used for:\n  # - comments\n  # - aliases\n  # - redirections\n  # - parameter elision in command position\n  # - 'repeat' loops\n  #\n  local this_word next_word=':start::start_of_pipeline:'\n  integer in_redirection\n  # Processing buffer\n  local proc_buf=\"$buf\"\n  local -a args\n  if [[ $zsyh_user_options[interactivecomments] == on ]]; then\n    args=(${(zZ+c+)buf})\n  else\n    args=(${(z)buf})\n  fi\n\n  # Special case: $(<*) isn't globbing.\n  if [[ $braces_stack == 'S' ]] && (( $+args[3] && ! $+args[4] )) && [[ $args[3] == $'\\x29' ]] &&\n     [[ $args[1] == *'<'* ]] && _zsh_highlight_main__is_redirection $args[1]; then\n    highlight_glob=false\n  fi\n\n  while (( $#args )); do\n    last_arg=$arg\n    arg=$args[1]\n    shift args\n    if (( $#in_alias )); then\n      (( in_alias[1]-- ))\n      # Remove leading 0 entries\n      in_alias=($in_alias[$in_alias[(i)<1->],-1])\n      if (( $#in_alias == 0 )); then\n        seen_alias=()\n        # start_pos and end_pos are of the alias (previous $arg) here\n        _zsh_highlight_main_add_region_highlight $start_pos $end_pos $alias_style\n      else\n        # We can't unset keys that contain special characters (] \\ and some others).\n        # More details: https://www.zsh.org/workers/43269\n        (){\n          local alias_name\n          for alias_name in ${(k)seen_alias[(R)<$#in_alias->]}; do\n            seen_alias=(\"${(@kv)seen_alias[(I)^$alias_name]}\")\n          done\n        }\n      fi\n    fi\n    if (( in_param )); then\n      (( in_param-- ))\n      if (( in_param == 0 )); then\n        # start_pos and end_pos are of the '$foo' word (previous $arg) here\n        _zsh_highlight_main_add_region_highlight $start_pos $end_pos $param_style\n        param_style=\"\"\n      fi\n    fi\n\n    # Initialize this_word and next_word.\n    if (( in_redirection == 0 )); then\n      this_word=$next_word\n      next_word=':regular:'\n    elif (( !in_param )); then\n      # Stall $next_word.\n      (( --in_redirection ))\n    fi\n\n    # Initialize per-\"simple command\" [zshmisc(1)] variables:\n    #\n    #   $style               how to highlight $arg\n    #   $in_array_assignment boolean flag for \"between '(' and ')' of array assignment\"\n    #   $highlight_glob      boolean flag for \"'noglob' is in effect\"\n    #   $saw_assignment      boolean flag for \"was preceded by an assignment\"\n    #\n    style=unknown-token\n    if [[ $this_word == *':start:'* ]]; then\n      in_array_assignment=false\n      if [[ $arg == 'noglob' ]]; then\n        highlight_glob=false\n      fi\n    fi\n\n    if (( $#in_alias == 0 && in_param == 0 )); then\n      # Compute the new $start_pos and $end_pos, skipping over whitespace in $buf.\n      [[ \"$proc_buf\" = (#b)(#s)(''([ $'\\t']|[\\\\]$'\\n')#)(?|)* ]]\n      # The first, outer parenthesis\n      integer offset=\"${#match[1]}\"\n      (( start_pos = end_pos + offset ))\n      (( end_pos = start_pos + $#arg ))\n\n      # The zsh lexer considers ';' and newline to be the same token, so\n      # ${(z)} converts all newlines to semicolons. Convert them back here to\n      # make later processing simpler.\n      [[ $arg == ';' && ${match[3]} == $'\\n' ]] && arg=$'\\n'\n\n      # Compute the new $proc_buf. We advance it\n      # (chop off characters from the beginning)\n      # beyond what end_pos points to, by skipping\n      # as many characters as end_pos was advanced.\n      #\n      # end_pos was advanced by $offset (via start_pos)\n      # and by $#arg. Note the `start_pos=$end_pos`\n      # below.\n      #\n      # As for the [,len]. We could use [,len-start_pos+offset]\n      # here, but to make it easier on eyes, we use len and\n      # rely on the fact that Zsh simply handles that. The\n      # length of proc_buf is len-start_pos+offset because\n      # we're chopping it to match current start_pos, so its\n      # length matches the previous value of start_pos.\n      #\n      # Why [,-1] is slower than [,length] isn't clear.\n      proc_buf=\"${proc_buf[offset + $#arg + 1,len]}\"\n    fi\n\n    # Handle the INTERACTIVE_COMMENTS option.\n    #\n    # We use the (Z+c+) flag so the entire comment is presented as one token in $arg.\n    if [[ $zsyh_user_options[interactivecomments] == on && $arg[1] == $histchars[3] ]]; then\n      if [[ $this_word == *(':regular:'|':start:')* ]]; then\n        style=comment\n      else\n        style=unknown-token # prematurely terminated\n      fi\n      _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style\n      # Stall this arg\n      in_redirection=1\n      continue\n    fi\n\n    if [[ $this_word == *':start:'* ]] && ! (( in_redirection )); then\n      # Expand aliases.\n      # An alias is ineligible for expansion while it's being expanded (see #652/#653).\n      _zsh_highlight_main__type \"$arg\" \"$(( ! ${+seen_alias[$arg]} ))\"\n      local res=\"$REPLY\"\n      if [[ $res == \"alias\" ]]; then\n        # Mark insane aliases as unknown-token (cf. #263).\n        if [[ $arg == ?*=* ]]; then\n          _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token\n          continue\n        fi\n        seen_alias[$arg]=$#in_alias\n        _zsh_highlight_main__resolve_alias $arg\n        local -a alias_args\n        # Elision is desired in case alias x=''\n        if [[ $zsyh_user_options[interactivecomments] == on ]]; then\n          alias_args=(${(zZ+c+)REPLY})\n        else\n          alias_args=(${(z)REPLY})\n        fi\n        args=( $alias_args $args )\n        if (( $#in_alias == 0 )); then\n          alias_style=alias\n        else\n          # Transfer the count of this arg to the new element about to be appended.\n          (( in_alias[1]-- ))\n        fi\n        # Add one because we will in_alias[1]-- on the next loop iteration so\n        # this iteration should be considered in in_alias as well\n        in_alias=( $(($#alias_args + 1)) $in_alias )\n        (( in_redirection++ )) # Stall this arg\n        continue\n      else\n        _zsh_highlight_main_highlighter_expand_path $arg\n        _zsh_highlight_main__type \"$REPLY\" 0\n        res=\"$REPLY\"\n      fi\n    fi\n\n    # Analyse the current word.\n    if _zsh_highlight_main__is_redirection $arg ; then\n      if (( in_redirection == 1 )); then\n        # Two consecutive redirection operators is an error.\n        _zsh_highlight_main_add_region_highlight $start_pos $end_pos unknown-token\n      else\n        in_redirection=2\n        _zsh_highlight_main_add_region_highlight $start_pos $end_pos redirection\n      fi\n      continue\n    elif [[ $arg == '{'${~parameter_name_pattern}'}' ]] && _zsh_highlight_main__is_redirection $args[1]; then\n      # named file descriptor: {foo}>&2\n      in_redirection=3\n      _zsh_highlight_main_add_region_highlight $start_pos $end_pos named-fd\n      continue\n    fi\n\n    # Expand parameters.\n    if (( ! in_param )) && _zsh_highlight_main_highlighter__try_expand_parameter \"$arg\"; then\n      # That's not entirely correct --- if the parameter's value happens to be a reserved\n      # word, the parameter expansion will be highlighted as a reserved word --- but that\n      # incorrectness is outweighed by the usability improvement of permitting the use of\n      # parameters that refer to commands, functions, and builtins.\n      () {\n        local -a words; words=( \"${reply[@]}\" )\n        if (( $#words == 0 )) && (( ! in_redirection )); then\n          # Parameter elision is happening\n          (( ++in_redirection ))\n          _zsh_highlight_main_add_region_highlight $start_pos $end_pos comment\n          continue\n        else\n          (( in_param = 1 + $#words ))\n          args=( $words $args )\n          arg=$args[1]\n          _zsh_highlight_main__type \"$arg\" 0\n          res=$REPLY\n        fi\n      }\n    fi\n\n    # Parse the sudo command line\n    if (( ! in_redirection )); then\n      if [[ $this_word == *':sudo_opt:'* ]]; then\n        if [[ -n $flags_with_argument ]] &&\n           { \n             # Trenary\n             if [[ -n $flags_sans_argument ]]\n             then [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument] ]]\n             else [[ $arg == '-'[$flags_with_argument] ]]\n             fi\n           } then\n          # Flag that requires an argument\n          this_word=${this_word//:start:/}\n          next_word=':sudo_arg:'\n        elif [[ -n $flags_with_argument ]] &&\n             {\n               # Trenary\n               if [[ -n $flags_sans_argument ]]\n               then [[ $arg == '-'[$flags_sans_argument]#[$flags_with_argument]* ]]\n               else [[ $arg == '-'[$flags_with_argument]* ]]\n               fi\n             } then\n          # Argument attached in the same word\n          this_word=${this_word//:start:/}\n          next_word+=':start:'\n          next_word+=':sudo_opt:'\n        elif [[ -n $flags_sans_argument ]] &&\n             [[ $arg == '-'[$flags_sans_argument]# ]]; then\n          # Flag that requires no argument\n          this_word=':sudo_opt:'\n          next_word+=':start:'\n          next_word+=':sudo_opt:'\n        elif [[ -n $flags_solo ]] && \n             {\n               # Trenary\n               if [[ -n $flags_sans_argument ]]\n               then [[ $arg == '-'[$flags_sans_argument]#[$flags_solo]* ]]\n               else [[ $arg == '-'[$flags_solo]* ]]\n               fi\n             } then\n          # Solo flags\n          this_word=':sudo_opt:'\n          next_word=':regular:' # no :start:, nor :sudo_opt: since we don't know whether the solo flag takes an argument or not\n        elif [[ $arg == '-'* ]]; then\n          # Unknown flag.  We don't know whether it takes an argument or not,\n          # so modify $next_word as we do for flags that require no argument.\n          # With that behaviour, if the flag in fact takes no argument we'll\n          # highlight the inner command word correctly, and if it does take an\n          # argument we'll highlight the command word correctly if the argument\n          # was given in the same shell word as the flag (as in '-uphy1729' or\n          # '--user=phy1729' without spaces).\n          this_word=':sudo_opt:'\n          next_word+=':start:'\n          next_word+=':sudo_opt:'\n        else\n          # Not an option flag; nothing to do.  (If the command line is\n          # syntactically valid, ${this_word//:sudo_opt:/} should be\n          # non-empty now.)\n          this_word=${this_word//:sudo_opt:/}\n        fi\n      elif [[ $this_word == *':sudo_arg:'* ]]; then\n        next_word+=':sudo_opt:'\n        next_word+=':start:'\n      fi\n    fi\n\n    # The Great Fork: is this a command word?  Is this a non-command word?\n    if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#\"$arg\"} ]] &&\n       [[ $braces_stack != *T* || $arg != ('||'|'&&') ]]; then\n\n      # First, determine the style of the command separator itself.\n      if _zsh_highlight_main__stack_pop T || _zsh_highlight_main__stack_pop Q; then\n        # Missing closing square bracket(s)\n        style=unknown-token\n      elif $in_array_assignment; then\n        case $arg in\n          # Literal newlines are just fine.\n          ($'\\n') style=commandseparator;;\n          # Semicolons are parsed the same way as literal newlines.  Nevertheless,\n          # highlight them as errors since they're probably unintended.  Compare\n          # issue #691.\n          (';') style=unknown-token;;\n          # Other command separators aren't allowed.\n          (*) style=unknown-token;;\n        esac\n      elif [[ $this_word == *':regular:'* ]]; then\n        style=commandseparator\n      elif [[ $this_word == *':start:'* ]] && [[ $arg == $'\\n' ]]; then\n        style=commandseparator\n      elif [[ $this_word == *':start:'* ]] && [[ $arg == ';' ]] && (( $#in_alias )); then\n        style=commandseparator \n      else\n        # Empty commands (semicolon follows nothing) are valid syntax.\n        # However, in interactive use they are likely to be erroneous;\n        # therefore, we highlight them as errors.\n        #\n        # Alias definitions are exempted from this check to allow multiline aliases\n        # with explicit (redundant) semicolons: «alias foo=$'bar;\\nbaz'» (issue #677).\n        #\n        # See also #691 about possibly changing the style used here. \n        style=unknown-token\n      fi\n\n      # Second, determine the style of next_word.\n      if [[ $arg == $'\\n' ]] && $in_array_assignment; then\n        # literal newline inside an array assignment\n        next_word=':regular:'\n      elif [[ $arg == ';' ]] && $in_array_assignment; then\n        # literal semicolon inside an array assignment\n        next_word=':regular:'\n      else\n        next_word=':start:'\n        highlight_glob=true\n        saw_assignment=false\n        (){\n          local alias_name\n          for alias_name in ${(k)seen_alias[(R)<$#in_alias->]}; do\n            # We can't unset keys that contain special characters (] \\ and some others).\n            # More details: https://www.zsh.org/workers/43269\n            seen_alias=(\"${(@kv)seen_alias[(I)^$alias_name]}\")\n          done\n        }\n        if [[ $arg != '|' && $arg != '|&' ]]; then\n          next_word+=':start_of_pipeline:'\n        fi\n      fi\n\n    elif ! (( in_redirection)) && [[ $this_word == *':always:'* && $arg == 'always' ]]; then\n      # try-always construct\n      style=reserved-word # de facto a reserved word, although not de jure\n      highlight_glob=true\n      saw_assignment=false\n      next_word=':start::start_of_pipeline:' # only left brace is allowed, apparently\n    elif ! (( in_redirection)) && [[ $this_word == *':start:'* ]]; then # $arg is the command word\n      if (( ${+precommand_options[$arg]} )) && _zsh_highlight_main__is_runnable $arg; then\n        style=precommand\n        () {\n          set -- \"${(@s.:.)precommand_options[$arg]}\"\n          flags_with_argument=$1\n          flags_sans_argument=$2\n          flags_solo=$3\n        }\n        next_word=${next_word//:regular:/}\n        next_word+=':sudo_opt:'\n        next_word+=':start:'\n        if [[ $arg == 'exec' || $arg == 'env' ]]; then\n          # To allow \"exec 2>&1;\" and \"env | grep\" where there's no command word\n          next_word+=':regular:'\n        fi\n      else\n        case $res in\n          (reserved)    # reserved word\n                        style=reserved-word\n                        # Match braces and handle special cases.\n                        case $arg in\n                          (time|nocorrect)\n                            next_word=${next_word//:regular:/}\n                            next_word+=':start:'\n                            ;;\n                          ($'\\x7b')\n                            braces_stack='Y'\"$braces_stack\"\n                            ;;\n                          ($'\\x7d')\n                            # We're at command word, so no need to check $right_brace_is_recognised_everywhere\n                            _zsh_highlight_main__stack_pop 'Y' reserved-word\n                            if [[ $style == reserved-word ]]; then\n                              next_word+=':always:'\n                            fi\n                            ;;\n                          ($'\\x5b\\x5b')\n                            braces_stack='T'\"$braces_stack\"\n                            ;;\n                          ('do')\n                            braces_stack='D'\"$braces_stack\"\n                            ;;\n                          ('done')\n                            _zsh_highlight_main__stack_pop 'D' reserved-word\n                            ;;\n                          ('if')\n                            braces_stack=':?'\"$braces_stack\"\n                            ;;\n                          ('then')\n                            _zsh_highlight_main__stack_pop ':' reserved-word\n                            ;;\n                          ('elif')\n                            if [[ ${braces_stack[1]} == '?' ]]; then\n                              braces_stack=':'\"$braces_stack\"\n                            else\n                              style=unknown-token\n                            fi\n                            ;;\n                          ('else')\n                            if [[ ${braces_stack[1]} == '?' ]]; then\n                              :\n                            else\n                              style=unknown-token\n                            fi\n                            ;;\n                          ('fi')\n                            _zsh_highlight_main__stack_pop '?'\n                            ;;\n                          ('foreach')\n                            braces_stack='$'\"$braces_stack\"\n                            ;;\n                          ('end')\n                            _zsh_highlight_main__stack_pop '$' reserved-word\n                            ;;\n                          ('repeat')\n                            # skip the repeat-count word\n                            in_redirection=2\n                            # The redirection mechanism assumes $this_word describes the word\n                            # following the redirection.  Make it so.\n                            #\n                            # That word can be a command word with shortloops (`repeat 2 ls`)\n                            # or a command separator (`repeat 2; ls` or `repeat 2; do ls; done`).\n                            #\n                            # The repeat-count word will be handled like a redirection target.\n                            this_word=':start::regular:'\n                            ;;\n                          ('!')\n                            if [[ $this_word != *':start_of_pipeline:'* ]]; then\n                              style=unknown-token\n                            else\n                              # '!' reserved word at start of pipeline; style already set above\n                            fi\n                            ;;\n                        esac\n                        if $saw_assignment && [[ $style != unknown-token ]]; then\n                          style=unknown-token\n                        fi\n                        ;;\n          ('suffix alias')\n                        style=suffix-alias\n                        ;;\n          ('global alias')\n                        style=global-alias\n                        ;;\n          (alias)       :;;\n          (builtin)     style=builtin\n                        [[ $arg == $'\\x5b' ]] && braces_stack='Q'\"$braces_stack\"\n                        ;;\n          (function)    style=function;;\n          (command)     style=command;;\n          (hashed)      style=hashed-command;;\n          (none)        if (( ! in_param )) && _zsh_highlight_main_highlighter_check_assign; then\n                          _zsh_highlight_main_add_region_highlight $start_pos $end_pos assign\n                          local i=$(( arg[(i)=] + 1 ))\n                          saw_assignment=true\n                          if [[ $arg[i] == '(' ]]; then\n                            in_array_assignment=true\n                            _zsh_highlight_main_add_region_highlight start_pos+i-1 start_pos+i reserved-word\n                          else\n                            # assignment to a scalar parameter.\n                            # (For array assignments, the command doesn't start until the \")\" token.)\n                            # \n                            # Discard  :start_of_pipeline:, if present, as '!' is not valid\n                            # after assignments.\n                            next_word+=':start:'\n                            if (( i <= $#arg )); then\n                              () {\n                                local highlight_glob=false\n                                [[ $zsyh_user_options[globassign] == on ]] && highlight_glob=true\n                                _zsh_highlight_main_highlighter_highlight_argument $i\n                              }\n                            fi\n                          fi\n                          continue\n                        elif (( ! in_param )) &&\n                             [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then\n                          style=history-expansion\n                        elif (( ! in_param )) &&\n                             [[ $arg[0,1] == $histchars[2,2] ]]; then\n                          style=history-expansion\n                        elif (( ! in_param )) &&\n                             ! $saw_assignment &&\n                             [[ $arg[1,2] == '((' ]]; then\n                          # Arithmetic evaluation.\n                          #\n                          # Note: prior to zsh-5.1.1-52-g4bed2cf (workers/36669), the ${(z)...}\n                          # splitter would only output the '((' token if the matching '))' had\n                          # been typed.  Therefore, under those versions of zsh, BUFFER=\"(( 42\"\n                          # would be highlighted as an error until the matching \"))\" are typed.\n                          #\n                          # We highlight just the opening parentheses, as a reserved word; this\n                          # is how [[ ... ]] is highlighted, too.\n                          _zsh_highlight_main_add_region_highlight $start_pos $((start_pos + 2)) reserved-word\n                          if [[ $arg[-2,-1] == '))' ]]; then\n                            _zsh_highlight_main_add_region_highlight $((end_pos - 2)) $end_pos reserved-word\n                          fi\n                          continue\n                        elif (( ! in_param )) &&\n                             [[ $arg == '()' ]]; then\n                          # anonymous function\n                          style=reserved-word\n                        elif (( ! in_param )) &&\n                             ! $saw_assignment &&\n                             [[ $arg == $'\\x28' ]]; then\n                          # subshell\n                          style=reserved-word\n                          braces_stack='R'\"$braces_stack\"\n                        elif (( ! in_param )) &&\n                             [[ $arg == $'\\x29' ]]; then\n                          # end of subshell or command substitution\n                          if _zsh_highlight_main__stack_pop 'S'; then\n                            REPLY=$start_pos\n                            reply=($list_highlights)\n                            return 0\n                          fi\n                          _zsh_highlight_main__stack_pop 'R' reserved-word\n                        else\n                          if _zsh_highlight_main_highlighter_check_path $arg 1; then\n                            style=$REPLY\n                          else\n                            style=unknown-token\n                          fi\n                        fi\n                        ;;\n          (*)           _zsh_highlight_main_add_region_highlight $start_pos $end_pos arg0_$res\n                        continue\n                        ;;\n        esac\n      fi\n      if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_CONTROL_FLOW:#\"$arg\"} ]]; then\n        next_word=':start::start_of_pipeline:'\n      fi\n    elif _zsh_highlight_main__is_global_alias \"$arg\"; then # $arg is a global alias that isn't in command position\n      style=global-alias\n    else # $arg is a non-command word\n      case $arg in\n        ($'\\x29')\n                  # subshell or end of array assignment\n                  if $in_array_assignment; then\n                    _zsh_highlight_main_add_region_highlight $start_pos $end_pos assign\n                    _zsh_highlight_main_add_region_highlight $start_pos $end_pos reserved-word\n                    in_array_assignment=false\n                    next_word+=':start:'\n                    continue\n                  elif (( in_redirection )); then\n                    style=unknown-token\n                  else\n                    if _zsh_highlight_main__stack_pop 'S'; then\n                      REPLY=$start_pos\n                      reply=($list_highlights)\n                      return 0\n                    fi\n                    _zsh_highlight_main__stack_pop 'R' reserved-word\n                  fi\n                  ;;\n        ($'\\x28\\x29')\n                  # possibly a function definition\n                  if (( in_redirection )) || $in_array_assignment; then\n                    style=unknown-token\n                  else\n                    if [[ $zsyh_user_options[multifuncdef] == on ]] || false # TODO: or if the previous word was a command word\n                    then\n                      next_word+=':start::start_of_pipeline:'\n                    fi\n                    style=reserved-word\n                  fi\n                  ;;\n        (*)       if false; then\n                  elif [[ $arg = $'\\x7d' ]] && $right_brace_is_recognised_everywhere; then\n                    # Parsing rule: {\n                    #\n                    #     Additionally, `tt(})' is recognized in any position if neither the\n                    #     tt(IGNORE_BRACES) option nor the tt(IGNORE_CLOSE_BRACES) option is set.\n                    if (( in_redirection )) || $in_array_assignment; then\n                      style=unknown-token\n                    else\n                      _zsh_highlight_main__stack_pop 'Y' reserved-word\n                      if [[ $style == reserved-word ]]; then\n                        next_word+=':always:'\n                      fi\n                    fi\n                  elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then\n                    style=history-expansion\n                  elif [[ $arg == $'\\x5d\\x5d' ]] && _zsh_highlight_main__stack_pop 'T' reserved-word; then\n                    :\n                  elif [[ $arg == $'\\x5d' ]] && _zsh_highlight_main__stack_pop 'Q' builtin; then\n                    :\n                  else\n                    _zsh_highlight_main_highlighter_highlight_argument 1 $(( 1 != in_redirection ))\n                    continue\n                  fi\n                  ;;\n      esac\n    fi\n    _zsh_highlight_main_add_region_highlight $start_pos $end_pos $style\n  done\n  (( $#in_alias )) && in_alias=() _zsh_highlight_main_add_region_highlight $start_pos $end_pos $alias_style\n  (( in_param == 1 )) && in_param=0 _zsh_highlight_main_add_region_highlight $start_pos $end_pos $param_style\n  [[ \"$proc_buf\" = (#b)(#s)(([[:space:]]|\\\\$'\\n')#) ]]\n  REPLY=$(( end_pos + ${#match[1]} - 1 ))\n  reply=($list_highlights)\n  return $(( $#braces_stack > 0 ))\n}\n\n# Check if $arg is variable assignment\n_zsh_highlight_main_highlighter_check_assign()\n{\n    setopt localoptions extended_glob\n    [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\\[*\\])(|[+])=* ]] ||\n      [[ $arg == [0-9]##(|[+])=* ]]\n}\n\n_zsh_highlight_main_highlighter_highlight_path_separators()\n{\n  local pos style_pathsep\n  style_pathsep=$1_pathseparator\n  reply=()\n  [[ -z \"$ZSH_HIGHLIGHT_STYLES[$style_pathsep]\" || \"$ZSH_HIGHLIGHT_STYLES[$1]\" == \"$ZSH_HIGHLIGHT_STYLES[$style_pathsep]\" ]] && return 0\n  for (( pos = start_pos; $pos <= end_pos; pos++ )) ; do\n    if [[ $BUFFER[pos] == / ]]; then\n      reply+=($((pos - 1)) $pos $style_pathsep)\n    fi\n  done\n}\n\n# Check if $1 is a path.\n# If yes, return 0 and in $REPLY the style to use.\n# Else, return non-zero (and the contents of $REPLY is undefined).\n#\n# $2 should be non-zero iff we're in command position.\n_zsh_highlight_main_highlighter_check_path()\n{\n  _zsh_highlight_main_highlighter_expand_path \"$1\"\n  local expanded_path=\"$REPLY\" tmp_path\n  integer in_command_position=$2\n\n  if [[ $zsyh_user_options[autocd] == on ]]; then\n    integer autocd=1\n  else\n    integer autocd=0\n  fi\n\n  if (( in_command_position )); then\n    # ### Currently, this value is never returned: either it's overwritten\n    # ### below, or the return code is non-zero\n    REPLY=arg0\n  else\n    REPLY=path\n  fi\n\n  if [[ ${1[1]} == '=' && $1 == ??* && ${1[2]} != $'\\x28' && $zsyh_user_options[equals] == 'on' && $expanded_path[1] != '/' ]]; then\n    REPLY=unknown-token # will error out if executed\n    return 0\n  fi\n\n  [[ -z $expanded_path ]] && return 1\n\n  # Check if this is a blacklisted path\n  if [[ $expanded_path[1] == / ]]; then\n    tmp_path=$expanded_path\n  else\n    tmp_path=$PWD/$expanded_path\n  fi\n  tmp_path=$tmp_path:a\n\n  while [[ $tmp_path != / ]]; do\n    [[ -n ${(M)ZSH_HIGHLIGHT_DIRS_BLACKLIST:#$tmp_path} ]] && return 1\n    tmp_path=$tmp_path:h\n  done\n\n  if (( in_command_position )); then\n    if [[ -x $expanded_path ]]; then\n      if (( autocd )); then\n        if [[ -d $expanded_path ]]; then\n          REPLY=autodirectory\n        fi\n        return 0\n      elif [[ ! -d $expanded_path ]]; then\n        # ### This seems unreachable for the current callers\n        return 0\n      fi\n    fi\n  else\n    if [[ -L $expanded_path || -e $expanded_path ]]; then\n      return 0\n    fi\n  fi\n\n  # Search the path in CDPATH\n  if [[ $expanded_path != /* ]] && (( autocd || ! in_command_position )); then\n    # TODO: When we've dropped support for pre-5.0.6 zsh, use the *(Y1) glob qualifier here.\n    local cdpath_dir\n    for cdpath_dir in $cdpath ; do\n      if [[ -d \"$cdpath_dir/$expanded_path\" && -x \"$cdpath_dir/$expanded_path\" ]]; then\n        if (( in_command_position && autocd )); then\n          REPLY=autodirectory\n        fi\n        return 0\n      fi\n    done\n  fi\n\n  # If dirname($1) doesn't exist, neither does $1.\n  [[ ! -d ${expanded_path:h} ]] && return 1\n\n  # If this word ends the buffer, check if it's the prefix of a valid path.\n  if (( has_end && (len == end_pos) )) &&\n     (( ! $#in_alias )) &&\n     [[ $WIDGET != zle-line-finish ]]; then\n    # TODO: When we've dropped support for pre-5.0.6 zsh, use the *(Y1) glob qualifier here.\n    local -a tmp\n    if (( in_command_position )); then\n      # We include directories even when autocd is enabled, because those\n      # directories might contain executable files: e.g., BUFFER=\"/bi\" en route\n      # to typing \"/bin/sh\".\n      tmp=( ${expanded_path}*(N-*,N-/) )\n    else\n      tmp=( ${expanded_path}*(N) )\n    fi\n    (( ${+tmp[1]} )) && REPLY=path_prefix && return 0\n  fi\n\n  # It's not a path.\n  return 1\n}\n\n# Highlight an argument and possibly special chars in quotes starting at $1 in $arg\n# This command will at least highlight $1 to end_pos with the default style\n# If $2 is set to 0, the argument cannot be highlighted as an option.\n#\n# This function currently assumes it's never called for the command word.\n_zsh_highlight_main_highlighter_highlight_argument()\n{\n  local base_style=default i=$1 option_eligible=${2:-1} path_eligible=1 ret start style\n  local -a highlights\n\n  local -a match mbegin mend\n  local MATCH; integer MBEGIN MEND\n\n  case \"$arg[i]\" in\n    '%')\n      if [[ $arg[i+1] == '?' ]]; then\n        (( i += 2 ))\n      fi\n      ;;\n    '-')\n      if (( option_eligible )); then\n        if [[ $arg[i+1] == - ]]; then\n          base_style=double-hyphen-option\n        else\n          base_style=single-hyphen-option\n        fi\n        path_eligible=0\n      fi\n      ;;\n    '=')\n      if [[ $arg[i+1] == $'\\x28' ]]; then\n        (( i += 2 ))\n        _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,-1]\n        ret=$?\n        (( i += REPLY ))\n        highlights+=(\n          $(( start_pos + $1 - 1 )) $(( start_pos + i )) process-substitution\n          $(( start_pos + $1 - 1 )) $(( start_pos + $1 + 1 )) process-substitution-delimiter\n          $reply\n        )\n        if (( ret == 0 )); then\n          highlights+=($(( start_pos + i - 1 )) $(( start_pos + i )) process-substitution-delimiter)\n        fi\n      fi\n  esac\n\n  # This loop is a hot path.  Keep it fast!\n  (( --i ))\n  while (( ++i <= $#arg )); do\n    i=${arg[(ib.i.)[\\\\\\'\\\"\\`\\$\\<\\>\\*\\?]]}\n    case \"$arg[$i]\" in\n      \"\") break;;\n      \"\\\\\") (( i += 1 )); continue;;\n      \"'\")\n        _zsh_highlight_main_highlighter_highlight_single_quote $i\n        (( i = REPLY ))\n        highlights+=($reply)\n        ;;\n      '\"')\n        _zsh_highlight_main_highlighter_highlight_double_quote $i\n        (( i = REPLY ))\n        highlights+=($reply)\n        ;;\n      '`')\n        _zsh_highlight_main_highlighter_highlight_backtick $i\n        (( i = REPLY ))\n        highlights+=($reply)\n        ;;\n      '$')\n        if [[ $arg[i+1] != \"'\" ]]; then\n          path_eligible=0\n        fi\n        if [[ $arg[i+1] == \"'\" ]]; then\n          _zsh_highlight_main_highlighter_highlight_dollar_quote $i\n          (( i = REPLY ))\n          highlights+=($reply)\n          continue\n        elif [[ $arg[i+1] == $'\\x28' ]]; then\n          if [[ $arg[i+2] == $'\\x28' ]] && _zsh_highlight_main_highlighter_highlight_arithmetic $i; then\n            # Arithmetic expansion\n            (( i = REPLY ))\n            highlights+=($reply)\n            continue\n          fi\n          start=$i\n          (( i += 2 ))\n          _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,-1]\n          ret=$?\n          (( i += REPLY ))\n          highlights+=(\n            $(( start_pos + start - 1)) $(( start_pos + i )) command-substitution-unquoted\n            $(( start_pos + start - 1)) $(( start_pos + start + 1)) command-substitution-delimiter-unquoted\n            $reply\n          )\n          if (( ret == 0 )); then\n            highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) command-substitution-delimiter-unquoted)\n          fi\n          continue\n        fi\n        while [[ $arg[i+1] == [=~#+'^'] ]]; do\n          (( i += 1 ))\n        done\n        if [[ $arg[i+1] == [*@#?$!-] ]]; then\n          (( i += 1 ))\n        fi;;\n      [\\<\\>])\n        if [[ $arg[i+1] == $'\\x28' ]]; then # \\x28 = open paren\n          start=$i\n          (( i += 2 ))\n          _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,-1]\n          ret=$?\n          (( i += REPLY ))\n          highlights+=(\n            $(( start_pos + start - 1)) $(( start_pos + i )) process-substitution\n            $(( start_pos + start - 1)) $(( start_pos + start + 1 )) process-substitution-delimiter\n            $reply\n          )\n          if (( ret == 0 )); then\n            highlights+=($(( start_pos + i - 1)) $(( start_pos + i )) process-substitution-delimiter)\n          fi\n          continue\n        fi\n        ;|\n      *)\n        if $highlight_glob &&\n           [[ $zsyh_user_options[multios] == on || $in_redirection -eq 0 ]] &&\n           [[ ${arg[$i]} =~ ^[*?] || ${arg:$i-1} =~ ^\\<[0-9]*-[0-9]*\\> ]]; then\n          highlights+=($(( start_pos + i - 1 )) $(( start_pos + i + $#MATCH - 1)) globbing)\n          (( i += $#MATCH - 1 ))\n          path_eligible=0\n        else\n          continue\n        fi\n        ;;\n    esac\n  done\n\n  if (( path_eligible )); then\n    if (( in_redirection )) && [[ $last_arg == *['<>']['&'] && $arg[$1,-1] == (<0->|p|-) ]]; then\n      if [[ $arg[$1,-1] == (p|-) ]]; then\n        base_style=redirection\n      else\n        base_style=numeric-fd\n      fi\n    # This function is currently never called for the command word, so $2 is hard-coded as 0.\n    elif _zsh_highlight_main_highlighter_check_path $arg[$1,-1] 0; then\n      base_style=$REPLY\n      _zsh_highlight_main_highlighter_highlight_path_separators $base_style\n      highlights+=($reply)\n    fi\n  fi\n\n  highlights=($(( start_pos + $1 - 1 )) $end_pos $base_style $highlights)\n  _zsh_highlight_main_add_many_region_highlights $highlights\n}\n\n# Quote Helper Functions\n#\n# $arg is expected to be set to the current argument\n# $start_pos is expected to be set to the start of $arg in $BUFFER\n# $1 is the index in $arg which starts the quote\n# $REPLY is returned as the end of quote index in $arg\n# $reply is returned as an array of region_highlight additions\n\n# Highlight single-quoted strings\n_zsh_highlight_main_highlighter_highlight_single_quote()\n{\n  local arg1=$1 i q=\\' style\n  i=$arg[(ib:arg1+1:)$q]\n  reply=()\n\n  if [[ $zsyh_user_options[rcquotes] == on ]]; then\n    while [[ $arg[i+1] == \"'\" ]]; do\n      reply+=($(( start_pos + i - 1 )) $(( start_pos + i + 1 )) rc-quote)\n      (( i++ ))\n      i=$arg[(ib:i+1:)$q]\n    done\n  fi\n\n  if [[ $arg[i] == \"'\" ]]; then\n    style=single-quoted-argument\n  else\n    # If unclosed, i points past the end\n    (( i-- ))\n    style=single-quoted-argument-unclosed\n  fi\n  reply=($(( start_pos + arg1 - 1 )) $(( start_pos + i )) $style $reply)\n  REPLY=$i\n}\n\n# Highlight special chars inside double-quoted strings\n_zsh_highlight_main_highlighter_highlight_double_quote()\n{\n  local -a breaks match mbegin mend saved_reply\n  local MATCH; integer last_break=$(( start_pos + $1 - 1 )) MBEGIN MEND\n  local i j k ret style\n  reply=()\n\n  for (( i = $1 + 1 ; i <= $#arg ; i += 1 )) ; do\n    (( j = i + start_pos - 1 ))\n    (( k = j + 1 ))\n    case \"$arg[$i]\" in\n      ('\"') break;;\n      ('`') saved_reply=($reply)\n            _zsh_highlight_main_highlighter_highlight_backtick $i\n            (( i = REPLY ))\n            reply=($saved_reply $reply)\n            continue\n            ;;\n      ('$') style=dollar-double-quoted-argument\n            # Look for an alphanumeric parameter name.\n            if [[ ${arg:$i} =~ ^([A-Za-z_][A-Za-z0-9_]*|[0-9]+) ]] ; then\n              (( k += $#MATCH )) # highlight the parameter name\n              (( i += $#MATCH )) # skip past it\n            elif [[ ${arg:$i} =~ ^[{]([A-Za-z_][A-Za-z0-9_]*|[0-9]+)[}] ]] ; then\n              (( k += $#MATCH )) # highlight the parameter name and braces\n              (( i += $#MATCH )) # skip past it\n            elif [[ $arg[i+1] == '$' ]]; then\n              # $$ - pid\n              (( k += 1 )) # highlight both dollar signs\n              (( i += 1 )) # don't consider the second one as introducing another parameter expansion\n            elif [[ $arg[i+1] == [-#*@?] ]]; then\n              # $#, $*, $@, $?, $- - like $$ above\n              (( k += 1 )) # highlight both dollar signs\n              (( i += 1 )) # don't consider the second one as introducing another parameter expansion\n            elif [[ $arg[i+1] == $'\\x28' ]]; then\n              saved_reply=($reply)\n              if [[ $arg[i+2] == $'\\x28' ]] && _zsh_highlight_main_highlighter_highlight_arithmetic $i; then\n                # Arithmetic expansion\n                (( i = REPLY ))\n                reply=($saved_reply $reply)\n                continue\n              fi\n\n              breaks+=( $last_break $(( start_pos + i - 1 )) )\n              (( i += 2 ))\n              _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,-1]\n              ret=$?\n              (( i += REPLY ))\n              last_break=$(( start_pos + i ))\n              reply=(\n                $saved_reply\n                $j $(( start_pos + i )) command-substitution-quoted\n                $j $(( j + 2 )) command-substitution-delimiter-quoted\n                $reply\n              )\n              if (( ret == 0 )); then\n                reply+=($(( start_pos + i - 1 )) $(( start_pos + i )) command-substitution-delimiter-quoted)\n              fi\n              continue\n            else\n              continue\n            fi\n            ;;\n      \"\\\\\") style=back-double-quoted-argument\n            if [[ \\\\\\`\\\"\\$${histchars[1]} == *$arg[$i+1]* ]]; then\n              (( k += 1 )) # Color following char too.\n              (( i += 1 )) # Skip parsing the escaped char.\n            else\n              continue\n            fi\n            ;;\n      ($histchars[1]) # ! - may be a history expansion\n            if [[ $arg[i+1] != ('='|$'\\x28'|$'\\x7b'|[[:blank:]]) ]]; then\n              style=history-expansion\n            else\n              continue\n            fi\n            ;;\n      *) continue ;;\n\n    esac\n    reply+=($j $k $style)\n  done\n\n  if [[ $arg[i] == '\"' ]]; then\n    style=double-quoted-argument\n  else\n    # If unclosed, i points past the end\n    (( i-- ))\n    style=double-quoted-argument-unclosed\n  fi\n  (( last_break != start_pos + i )) && breaks+=( $last_break $(( start_pos + i )) )\n  saved_reply=($reply)\n  reply=()\n  for 1 2 in $breaks; do\n    (( $1 != $2 )) && reply+=($1 $2 $style)\n  done\n  reply+=($saved_reply)\n  REPLY=$i\n}\n\n# Highlight special chars inside dollar-quoted strings\n_zsh_highlight_main_highlighter_highlight_dollar_quote()\n{\n  local -a match mbegin mend\n  local MATCH; integer MBEGIN MEND\n  local i j k style\n  local AA\n  integer c\n  reply=()\n\n  for (( i = $1 + 2 ; i <= $#arg ; i += 1 )) ; do\n    (( j = i + start_pos - 1 ))\n    (( k = j + 1 ))\n    case \"$arg[$i]\" in\n      \"'\") break;;\n      \"\\\\\") style=back-dollar-quoted-argument\n            for (( c = i + 1 ; c <= $#arg ; c += 1 )); do\n              [[ \"$arg[$c]\" != ([0-9xXuUa-fA-F]) ]] && break\n            done\n            AA=$arg[$i+1,$c-1]\n            # Matching for HEX and OCT values like \\0xA6, \\xA6 or \\012\n            if [[    \"$AA\" =~ \"^(x|X)[0-9a-fA-F]{1,2}\"\n                  || \"$AA\" =~ \"^[0-7]{1,3}\"\n                  || \"$AA\" =~ \"^u[0-9a-fA-F]{1,4}\"\n                  || \"$AA\" =~ \"^U[0-9a-fA-F]{1,8}\"\n               ]]; then\n              (( k += $#MATCH ))\n              (( i += $#MATCH ))\n            else\n              if (( $#arg > $i+1 )) && [[ $arg[$i+1] == [xXuU] ]]; then\n                # \\x not followed by hex digits is probably an error\n                style=unknown-token\n              fi\n              (( k += 1 )) # Color following char too.\n              (( i += 1 )) # Skip parsing the escaped char.\n            fi\n            ;;\n      *) continue ;;\n\n    esac\n    reply+=($j $k $style)\n  done\n\n  if [[ $arg[i] == \"'\" ]]; then\n    style=dollar-quoted-argument\n  else\n    # If unclosed, i points past the end\n    (( i-- ))\n    style=dollar-quoted-argument-unclosed\n  fi\n  reply=($(( start_pos + $1 - 1 )) $(( start_pos + i )) $style $reply)\n  REPLY=$i\n}\n\n# Highlight backtick substitutions\n_zsh_highlight_main_highlighter_highlight_backtick()\n{\n  # buf is the contents of the backticks with a layer of backslashes removed.\n  # last is the index of arg for the start of the string to be copied into buf.\n  #     It is either one past the beginning backtick or one past the last backslash.\n  # offset is a count of consumed \\ (the delta between buf and arg).\n  # offsets is an array indexed by buf offset of when the delta between buf and arg changes.\n  #     It is sparse, so search backwards to the last value\n  local buf highlight style=back-quoted-argument-unclosed style_end\n  local -i arg1=$1 end_ i=$1 last offset=0 start subshell_has_end=0\n  local -a highlight_zone highlights offsets\n  reply=()\n\n  last=$(( arg1 + 1 ))\n  # Remove one layer of backslashes and find the end\n  while i=$arg[(ib:i+1:)[\\\\\\\\\\`]]; do # find the next \\ or `\n    if (( i > $#arg )); then\n      buf=$buf$arg[last,i]\n      offsets[i-arg1-offset]='' # So we never index past the end\n      (( i-- ))\n      subshell_has_end=$(( has_end && (start_pos + i == len) ))\n      break\n    fi\n\n    if [[ $arg[i] == '\\' ]]; then\n      (( i++ ))\n      # POSIX XCU 2.6.3\n      if [[ $arg[i] == ('$'|'`'|'\\') ]]; then\n        buf=$buf$arg[last,i-2]\n        (( offset++ ))\n        # offsets is relative to buf, so adjust by -arg1\n        offsets[i-arg1-offset]=$offset\n      else\n        buf=$buf$arg[last,i-1]\n      fi\n    else # it's an unquoted ` and this is the end\n      style=back-quoted-argument\n      style_end=back-quoted-argument-delimiter\n      buf=$buf$arg[last,i-1]\n      offsets[i-arg1-offset]='' # So we never index past the end\n      break\n    fi\n    last=$i\n  done\n\n  _zsh_highlight_main_highlighter_highlight_list 0 '' $subshell_has_end $buf\n\n  # Munge the reply to account for removed backslashes\n  for start end_ highlight in $reply; do\n    start=$(( start_pos + arg1 + start + offsets[(Rb:start:)?*] ))\n    end_=$(( start_pos + arg1 + end_ + offsets[(Rb:end_:)?*] ))\n    highlights+=($start $end_ $highlight)\n    if [[ $highlight == back-quoted-argument-unclosed && $style == back-quoted-argument ]]; then\n      # An inner backtick command substitution is unclosed, but this level is closed\n      style_end=unknown-token\n    fi\n  done\n\n  reply=(\n    $(( start_pos + arg1 - 1 )) $(( start_pos + i )) $style\n    $(( start_pos + arg1 - 1 )) $(( start_pos + arg1 )) back-quoted-argument-delimiter\n    $highlights\n  )\n  if (( $#style_end )); then\n    reply+=($(( start_pos + i - 1)) $(( start_pos + i )) $style_end)\n  fi\n  REPLY=$i\n}\n\n# Highlight special chars inside arithmetic expansions\n_zsh_highlight_main_highlighter_highlight_arithmetic()\n{\n  local -a saved_reply\n  local style\n  integer i j k paren_depth ret\n  reply=()\n\n  for (( i = $1 + 3 ; i <= end_pos - start_pos ; i += 1 )) ; do\n    (( j = i + start_pos - 1 ))\n    (( k = j + 1 ))\n    case \"$arg[$i]\" in\n      [\\'\\\"\\\\@{}])\n        style=unknown-token\n        ;;\n      '(')\n        (( paren_depth++ ))\n        continue\n        ;;\n      ')')\n        if (( paren_depth )); then\n          (( paren_depth-- ))\n          continue\n        fi\n        [[ $arg[i+1] == ')' ]] && { (( i++ )); break; }\n        # Special case ) at the end of the buffer to avoid flashing command substitution for a character\n        (( has_end && (len == k) )) && break\n        # This is a single paren and there are no open parens, so this isn't an arithmetic expansion\n        return 1\n        ;;\n      '`')\n        saved_reply=($reply)\n        _zsh_highlight_main_highlighter_highlight_backtick $i\n        (( i = REPLY ))\n        reply=($saved_reply $reply)\n        continue\n        ;;\n      '$' )\n        if [[ $arg[i+1] == $'\\x28' ]]; then\n          saved_reply=($reply)\n          if [[ $arg[i+2] == $'\\x28' ]] && _zsh_highlight_main_highlighter_highlight_arithmetic $i; then\n            # Arithmetic expansion\n            (( i = REPLY ))\n            reply=($saved_reply $reply)\n            continue\n          fi\n\n          (( i += 2 ))\n          _zsh_highlight_main_highlighter_highlight_list $(( start_pos + i - 1 )) S $has_end $arg[i,end_pos]\n          ret=$?\n          (( i += REPLY ))\n          reply=(\n            $saved_reply\n            $j $(( start_pos + i )) command-substitution-quoted\n            $j $(( j + 2 )) command-substitution-delimiter-quoted\n            $reply\n          )\n          if (( ret == 0 )); then\n            reply+=($(( start_pos + i - 1 )) $(( start_pos + i )) command-substitution-delimiter)\n          fi\n          continue\n        else\n          continue\n        fi\n        ;;\n      ($histchars[1]) # ! - may be a history expansion\n        if [[ $arg[i+1] != ('='|$'\\x28'|$'\\x7b'|[[:blank:]]) ]]; then\n          style=history-expansion\n        else\n          continue\n        fi\n        ;;\n      *)\n        continue\n        ;;\n\n    esac\n    reply+=($j $k $style)\n  done\n\n  if [[ $arg[i] != ')' ]]; then\n    # If unclosed, i points past the end\n    (( i-- ))\n  fi\n    style=arithmetic-expansion\n  reply=($(( start_pos + $1 - 1)) $(( start_pos + i )) arithmetic-expansion $reply)\n  REPLY=$i\n}\n\n\n# Called with a single positional argument.\n# Perform filename expansion (tilde expansion) on the argument and set $REPLY to the expanded value.\n#\n# Does not perform filename generation (globbing).\n_zsh_highlight_main_highlighter_expand_path()\n{\n  (( $# == 1 )) || print -r -- >&2 \"zsh-syntax-highlighting: BUG: _zsh_highlight_main_highlighter_expand_path: called without argument\"\n\n  # The $~1 syntax normally performs filename generation, but not when it's on the right-hand side of ${x:=y}.\n  setopt localoptions nonomatch\n  unset REPLY\n  : ${REPLY:=${(Q)${~1}}}\n}\n\n# -------------------------------------------------------------------------------------------------\n# Main highlighter initialization\n# -------------------------------------------------------------------------------------------------\n\n_zsh_highlight_main__precmd_hook() {\n  # Unset the WARN_NESTED_VAR option, taking care not to error if the option\n  # doesn't exist (zsh older than zsh-5.3.1-test-2).\n  setopt localoptions\n  if eval '[[ -o warnnestedvar ]]' 2>/dev/null; then\n    unsetopt warnnestedvar\n  fi\n\n  _zsh_highlight_main__command_type_cache=()\n}\n\nautoload -Uz add-zsh-hook\nif add-zsh-hook precmd _zsh_highlight_main__precmd_hook 2>/dev/null; then\n  # Initialize command type cache\n  typeset -gA _zsh_highlight_main__command_type_cache\nelse\n  print -r -- >&2 'zsh-syntax-highlighting: Failed to load add-zsh-hook. Some speed optimizations will not be used.'\n  # Make sure the cache is unset\n  unset _zsh_highlight_main__command_type_cache\nfi\ntypeset -ga ZSH_HIGHLIGHT_DIRS_BLACKLIST\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'/'\n\nexpected_region_highlight=(\n  '1 1 path_prefix' # /\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position1b.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt autocd\nBUFFER=$'/'\n\nexpected_region_highlight=(\n  '1 1 autodirectory' # /\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'/bi'\n\nexpected_region_highlight=(\n  '1 3 path_prefix' # /bi\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'/bin; /bin'\n\nexpected_region_highlight=(\n  '1 4 unknown-token' # /bin (in middle)\n  '5 5 commandseparator' # ;\n  '7 10 path_prefix' # /bin (at end)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position3b.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt autocd\nBUFFER=$'/bin; /bin'\n\nexpected_region_highlight=(\n  '1 4 autodirectory' # /bin (in middle)\n  '5 5 commandseparator' # ;\n  '7 10 autodirectory' # /bin (at end)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'/bin/s'\n\nexpected_region_highlight=(\n  '1 6 path_prefix' # /bin/s\n)\n"
  },
  {
    "path": "highlighters/main/test-data/abspath-in-command-position5.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'/bin/sh'\n\nexpected_region_highlight=(\n  '1 7 command' # /bin/sh\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-assignment1.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Issue #263 (more-pathological case): aliases[x=y]=z works; the ${(z)} splitter considers\n# that a single word; but it's not looked up as an alias.  Hence, highlight it as an error.\naliases[x=y]='lorem ipsum dolor sit amet'\nBUFFER='x=y ls'\n\nexpected_region_highlight=(\n  \"1 3 unknown-token\" # x=y\n  \"5 6 default\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-basic.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias foo=\"echo hello world\"\nBUFFER=\"foo\"\n\nexpected_region_highlight+=(\n  \"1 3 alias\" # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-brackets.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2021 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Have to use cat here as it must be a command that exists.\n# Otherwise, the test would fail with the first token being recognized\n# as an \"unknown-token\".\nalias ]=cat\n\nBUFFER='] /'\n\nexpected_region_highlight=(\n  '1 1 alias' # ]\n  '3 3 path' # /\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-command-substitution.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Alias must be at least 4 characters to test the regression\n# cf. 139ea2b189819c43cc251825981c116959b15cc3\nalias foobar='echo \"$(echo foobar)\"'\nBUFFER='foobar'\n\nexpected_region_highlight=(\n  \"1 6 alias\" # foobar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-comment1.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# see alias-comment2.zsh and comment-followed.zsh\nsetopt interactivecomments\nalias x=$'# foo\\npwd'\nBUFFER='x'\n\nexpected_region_highlight=(\n  '1 1 alias' # x\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-comment2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# see alias-comment1.zsh\nsetopt NO_interactivecomments\nalias x=$'# foo\\npwd'\nBUFFER='x'\n\nexpected_region_highlight=(\n  '1 1 unknown-token' # x (#)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-complex.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias x='echo && ls; >'\n\nBUFFER='x file echo'\n\nexpected_region_highlight=(\n  '1 1 alias' # x\n  '3 6 default' # file\n  '8 11 builtin' # echo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-empty.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias x=''\n\nBUFFER='x echo foo'\n\nexpected_region_highlight=(\n  '1 1 alias' # x\n  '3 6 builtin' # echo\n  '8 10 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-eponymous1.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias ls='command ls'\n\nBUFFER='ls'\n\nexpected_region_highlight=(\n  \"1 2 alias\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-eponymous2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias ls=tmp tmp='command ls'\n\nBUFFER='ls'\n\nexpected_region_highlight=(\n  \"1 2 alias\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-in-cmdsubst.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias p='print -r --'\n\nBUFFER=$'s=$(p foo)'\n\nexpected_region_highlight=(\n  '1 10 assign' # s=$(p foo)\n  '3 10 default' # $(p foo)\n  '3 10 command-substitution-unquoted' # $(p foo)\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 5 alias' # p\n  '7 9 default' # foo\n  '10 10 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-loop.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nfunction b() {} # beware of ALIAS_FUNC_DEF\nalias a=b b=c c=b\n\nBUFFER='a foo; :'\n\nexpected_region_highlight=(\n  # An alias is ineligible for expansion whilst it's being expanded.\n  # Therefore, the \"b\" in the expansion of the alias \"c\" is not considered\n  # as an alias.\n  '1 1 alias' # a\n  '3 5 default' # foo\n  '6 6 commandseparator' # ;\n  '8 8 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-loop2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias ls=\"ls\"\nBUFFER=\"ls\"\n\nexpected_region_highlight+=(\n  \"1 2 alias\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-nested-precommand.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=b b=sudo\nsudo(){}\n\nBUFFER='a -u phy1729 echo; :'\n\nexpected_region_highlight=(\n  '1 1 alias' # a\n  '3 4 single-hyphen-option' # -u\n  '6 12 default' # phy1729\n  '14 17 builtin' # echo\n  '18 18 commandseparator' # ;\n  '20 20 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-nested.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=b b=:\n\nBUFFER='a foo; :'\n\nexpected_region_highlight=(\n  '1 1 alias' # a\n  '3 5 default' # foo\n  '6 6 commandseparator' # ;\n  '8 8 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-parameter.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias '$foo'='echo alias'\nlocal foo; foo=(echo param)\n\nBUFFER='$foo'\n\nexpected_region_highlight=(\n  '1 4 alias' # $foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-precommand-option-argument1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See also param-precommand-option-argument1.zsh\nalias sudo_u='sudo -u'\nsudo(){}\n\nBUFFER='sudo_u phy1729 echo foo'\n\nexpected_region_highlight=(\n  '1 6 alias' # sudo_u\n  '8 14 default' # phy1729\n  '17 19 command \"issue #540\"' # echo (not builtin)\n  '21 23 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-precommand-option-argument2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias sudo_b='sudo -b'\nalias sudo_b_u='sudo_b -u'\nsudo(){}\n\nBUFFER='sudo_b_u phy1729 echo foo'\n\nexpected_region_highlight=(\n  '1 8 alias' # sudo_b_u\n  '10 16 default' # phy1729\n  '18 21 command \"issue #540\"' # echo (not builtin)\n  '23 25 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-precommand-option-argument3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See also param-precommand-option-argument3.zsh\nalias sudo_u='sudo -u'\nsudo(){}\n\nBUFFER='sudo_u phy1729 ls foo'\n\nexpected_region_highlight=(\n  '1 6 alias' # sudo_u\n  '8 14 default' # phy1729\n  '16 17 command' # ls\n  '19 21 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-precommand-option-argument4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias sudo_b='sudo -b'\nalias sudo_b_u='sudo_b -u'\nsudo(){}\n\nBUFFER='sudo_b_u phy1729 ls foo'\n\nexpected_region_highlight=(\n  '1 8 alias' # sudo_b_u\n  '10 16 default' # phy1729\n  '18 19 command' # ls\n  '21 23 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-quoted.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) YYYY zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: ls='ls -l'\nBUFFER='\"a\" foo; \\ls'\n\nexpected_region_highlight=(\n  '1 3 unknown-token' # \"a\"\n  '5 7 default' # foo\n  '8 8 commandseparator' # ;\n  '10 12 command' # \\ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-redirect.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias x=\\>\nBUFFER='x foo echo bar'\n\nexpected_region_highlight=(\n  '1 1 alias' # x\n  '3 5 default' # foo\n  '7 10 builtin' # echo\n  '12 14 default' # bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-reuse1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: b='a | a'\n\nBUFFER='b | b'\n\nexpected_region_highlight=(\n  '1 1 alias' # b\n  '3 3 commandseparator' # |\n  '5 5 alias' # b\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-reuse2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: b='a && a'\n\nBUFFER='b && b'\n\nexpected_region_highlight=(\n  '1 1 alias' # b\n  '3 4 commandseparator' # &&\n  '6 6 alias' # b\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-reuse3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: b='a; a'\n\nBUFFER='b; b'\n\nexpected_region_highlight=(\n  '1 1 alias' # b\n  '2 2 commandseparator' # ;\n  '4 4 alias' # b\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-reuse4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: b='a $(a)'\n\nBUFFER='b $(b)'\n\nexpected_region_highlight=(\n  '1 1 alias' # b\n  '3 6 default' # $(b)\n  '3 6 command-substitution-unquoted' # $(b)\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 5 alias' # b\n  '6 6 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-reuse5.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=: b='a < <(a)'\n\nBUFFER='b < <(b)'\n\nexpected_region_highlight=(\n  '1 1 alias' # b\n  '3 3 redirection' # <\n  '5 8 default' # <(b)\n  '5 8 process-substitution' # <(b)\n  '5 6 process-substitution-delimiter' # <(\n  '7 7 alias' # b\n  '8 8 process-substitution-delimiter' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-self.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias echo='echo foo'\n\nBUFFER='echo bar'\n\nexpected_region_highlight=(\n  '1 4 alias' # echo\n  '6 8 default' # bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-self2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias cat='cat | cat'\n\nBUFFER='cat'\n\nexpected_region_highlight=(\n  '1 3 alias' # cat\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-to-dir.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias x=/\nBUFFER=$'x'\n\nexpected_region_highlight=(\n  '1 1 unknown-token' # x (/)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-to-dir1b.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt autocd\nalias x=/\nBUFFER=$'x'\n\nexpected_region_highlight=(\n  '1 1 alias' # x\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-unknown-token1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=b b=foo\n\nBUFFER='a '\n\nexpected_region_highlight=(\n  '1 1 unknown-token' # a\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias-unknown-token2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a='() { ls \"$@\" ; foo }'\n\nBUFFER='a '\n\nexpected_region_highlight=(\n  '1 1 unknown-token' # a\n)\n"
  },
  {
    "path": "highlighters/main/test-data/alias.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias alias1=\"ls\"\nalias -s alias2=\"echo\"\nfunction alias1() {} # to check that it's highlighted as an alias, not as a function\n\nBUFFER='x.alias2; alias1; alias2'\n\n# Set expected_region_highlight as a function of zsh version.\n#\n# Highlight of suffix alias requires zsh-5.1.1 or newer; see issue #126,\n# and commit 36403 to zsh itself.  Therefore, check if the requisite zsh\n# functionality is present, and skip verifying suffix-alias highlighting\n# if it isn't.\nexpected_region_highlight=()\nif zmodload -e zsh/parameter || [[ \"$(type -w x.alias2)\" == *suffix* ]]; then\n  expected_region_highlight+=(\n    \"1 8 suffix-alias\" # x.alias2\n  )\nfi\nexpected_region_highlight+=(\n  \"9 9 commandseparator\" # ;\n  \"11 16 alias\" # alias1\n  \"17 17 commandseparator\" # ;\n  \"19 24 unknown-token\" # alias2\n)\n"
  },
  {
    "path": "highlighters/main/test-data/always1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='{ ls } always { pwd }'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # {\n  '3 4 command' # ls\n  '6 6 reserved-word' # }\n  '8 13 reserved-word' # always\n  '15 15 reserved-word' # {\n  '17 19 builtin' # pwd\n  '21 21 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/always2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'{\\nls\\n} always { pwd }'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # {\n  '2 2 commandseparator' # \\n\n  '3 4 command' # ls\n  '5 5 commandseparator' # \\n\n  '6 6 reserved-word' # }\n  '8 13 reserved-word' # always\n  '15 15 reserved-word' # {\n  '17 19 builtin' # pwd\n  '21 21 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/always3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt ignorebraces\nBUFFER='echo { foo } always { bar }'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 6 default' # {\n  '8 10 default' # foo\n  '12 12 default' # }\n  '14 19 default' # always\n  '21 21 default' # {\n  '23 25 default' # bar\n  '27 27 default' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/anonymous-function.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='() echo hello; () { echo world } \"argument\"'\n\nexpected_region_highlight=(\n  \"1 2 reserved-word\" # ()\n  \"4 7 builtin\" # echo\n  \"9 13 default\" # hello\n  \"14 14 commandseparator\" # ;\n  \"16 17 reserved-word\" # ()\n  \"19 19 reserved-word\" # {\n  \"21 24 builtin\" # echo\n  \"26 30 default\" # world\n  \"32 32 reserved-word\" # }\n  \"34 43 default\" # \"argument\"\n  \"34 43 double-quoted-argument\" # \"argument\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arg0-colon.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=''\\''x: /'\n\nexpected_region_highlight=(\n  '1 5 unknown-token' # \\'x: /\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arith-cmdsubst-mess.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $((ls); (ls))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # $((ls); (ls))\n  '3 15 command-substitution-unquoted' # $((ls); (ls))\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 5 reserved-word' # (\n  '6 7 command' # ls\n  '8 8 reserved-word' # )\n  '9 9 commandseparator' # ;\n  '11 11 reserved-word' # (\n  '12 13 command' # ls\n  '14 14 reserved-word' # )\n  '15 15 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arith1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( 6 * 9 ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 14 default' # $(( 6 * 9 ))\n  '3 14 arithmetic-expansion' # $(( 6 * 9 ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arith2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \"$(( 6 * 9 ))\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 16 default' # \"$(( 6 * 9 ))\"\n  '3 16 double-quoted-argument' # \"$(( 6 * 9 ))\"\n  '4 15 arithmetic-expansion' # $(( 6 * 9 ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-command-substitution.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( $(echo 2) + 2 ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 22 default' # $(( $(echo 2) + 2 ))\n  '3 22 arithmetic-expansion' # $(( $(echo 2) + 2 ))\n  '7 15 command-substitution-quoted' # $(echo 2)\n  '7 8 command-substitution-delimiter-quoted' # $(\n  '9 12 builtin' # echo\n  '14 14 default' # 2\n  '15 15 command-substitution-delimiter' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-doubled-parens.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( ((42)) ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # $(( ((42)) ))\n  '3 15 arithmetic-expansion' # $(( ((42)) ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-empty.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \"foo\"$(())\"bar\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 17 default' # \"foo\"$(())\"bar\"\n  '3 7 double-quoted-argument' # \"foo\"\n  '8 12 arithmetic-expansion' # $(())\n  '13 17 double-quoted-argument' # \"bar\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-evaluation.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Must be at command word, since the word following 'if' isn't currently considered\n# a command word (issue #207).\n#\n# An opening '((' without matching '))' is highlighted correctly under zsh-5.1.1-52-g4bed2cf\n# or newer, only (issue #188).\nBUFFER='(( x == 42 ))'\n\nexpected_region_highlight=(\n  \"1 2 reserved-word\" # ((\n  \"12 13 reserved-word\" # ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-hist-expn.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( \\!\\! ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 11 default' # $(( !! ))\n  '3 11 arithmetic-expansion' # $(( !! ))\n  '7 8 history-expansion \"issue #713\"' # !!\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-invalid-chars.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( 0 * 1\\'\\'000 ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 19 default' # $(( 0 * 1\\'\\'000 ))\n  '3 19 arithmetic-expansion' # $(( 0 * 1\\'\\'000 ))\n  '12 12 unknown-token' # \\'\n  '13 13 unknown-token' # \\'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-multiplication.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': foo*$(( 42 * 1729 ))*bar'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 26 default' # foo*$(( 42 * 1729 ))*bar\n  '6 6 globbing' # *\n  '7 22 arithmetic-expansion' # $(( 42 * 1729 ))\n  '23 23 globbing' # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-nested.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( $(( 1 + 2 )) * 3 ))'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 25 default' # $(( $(( 1 + 2 )) * 3 ))\n  '3 25 arithmetic-expansion' # $(( $(( 1 + 2 )) * 3 ))\n  '7 18 arithmetic-expansion' # $(( 1 + 2 ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-quoted.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \"$(( 1 + 1 ))\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 16 default' # \"$(( 1 + 1 ))\"\n  '3 16 double-quoted-argument' # \"$(( 1 + 1 ))\"\n  '4 15 arithmetic-expansion' # $(( 1 + 1 ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-unclosed.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( 1'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 7 default' # $(( 1\n  '3 7 arithmetic-expansion' # $(( 1\n)\n"
  },
  {
    "path": "highlighters/main/test-data/arithmetic-unfinished.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(( 1729 )'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 12 default' # $(( 1729 )\n  '3 12 arithmetic-expansion' # $(( 1729 )\n)\n\nif [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug\n  expected_region_highlight[2]='3 13 default' # $(( 1729 )\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/array-cmdsep1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'a=( foo | bar )'\nbar(){}\n\nexpected_region_highlight=(\n  '1 3 assign' # a=(\n  '3 3 reserved-word' # (\n  '5 7 default' # foo\n  '9 9 unknown-token' # |\n  # zsh reports a parse error at this point.  Nevertheless, we test how we\n  # highlight the remainder of $BUFFER.  Currently we recover by treating the pipe\n  # as a command separator.  That's not the only reasonable behaviour, though; if\n  # we change the behaviour, we should adjust the following expectations accordingly.\n  '11 13 function' # bar\n  '15 15 unknown-token' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/array-cmdsep2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'a=( foo ; bar )'\n\nexpected_region_highlight=(\n  '1 3 assign' # a=(\n  '3 3 reserved-word' # (\n  '5 7 default' # foo\n  '9 9 unknown-token' # ; (not commandseparator; see highlighter source code)\n  '11 13 default' # bar\n  '15 15 assign' # )\n  '15 15 reserved-word' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/array-cmdsep3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'a=( foo \\n bar )'\n\nexpected_region_highlight=(\n  '1 3 assign' # a=(\n  '3 3 reserved-word' # (\n  '5 7 default' # foo\n  '9 9 commandseparator' # \\n\n  '11 13 default' # bar\n  '15 15 assign' # )\n  '15 15 reserved-word' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-append.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='a+=(lorem ipsum)'\n\nexpected_region_highlight=(\n  \"1 4 assign\" # a+=(\n  \"4 4 reserved-word\" # (\n  \"5 9 default\" # lorem\n  \"11 15 default\" # ipsum\n  \"16 16 assign\" # )\n  \"16 16 reserved-word\" # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-argv.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch foo\nBUFFER='42=foo 43+=bar'\n\nexpected_region_highlight=(\n  \"1 6 assign\" # 42=foo\n  \"4 6 path\" # foo\n  \"8 14 assign\" # 43+=bar\n  \"12 14 default\" # bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-array.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='(A=(hello world))'\n\nexpected_region_highlight=(\n  \"1 1 reserved-word\" # (\n  \"2 4 assign\" # A=(\n  \"4 4 reserved-word\" # (\n  \"5 9 default\" # hello\n  \"11 15 default\" # world\n  \"16 16 assign\" # )\n  \"16 16 reserved-word\" # )\n  \"17 17 reserved-word\" # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-array2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='A=(hello world) ls'\n\nexpected_region_highlight=(\n  \"1 3 assign\" # A=(\n  \"3 3 reserved-word\" # (\n  \"4 8 default\" # hello\n  \"10 14 default\" # world\n  \"15 15 assign\" # )\n  \"15 15 reserved-word\" # )\n  \"17 18 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-array3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='A=(hello world) b=42'\n\nexpected_region_highlight=(\n  \"1 3 assign\" # A=(\n  \"3 3 reserved-word\" # (\n  \"4 8 default\" # hello\n  \"10 14 default\" # world\n  \"15 15 assign\" # )\n  \"15 15 reserved-word\" # )\n  \"17 20 assign\" # b=42\n  \"19 20 default\" # 42\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-invalid-command.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'x=y nosuchcommand'\n\nexpected_region_highlight=(\n  '1 3 assign' # x=y\n  '3 3 default' # y\n  '5 17 unknown-token' # nosuchcommand\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-not-array.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='a=foo( bar ) :'\n\nexpected_region_highlight=(\n  '1 12 assign' # a=foo( bar )\n  '3 12 default' # foo( bar )\n  '14 14 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-not-array2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='a=foo\\( :'\n\nexpected_region_highlight=(\n  '1 7 assign' # a=foo\\(\n  '3 7 default' # foo\\(\n  '9 9 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-quoted-cmdsubst.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'x=\"$(ls x y z)\"'\n\nexpected_region_highlight=(\n  '1 15 assign' # x=\"$(ls x y z)\"\n  '3 15 default' # \"$(ls x y z)\"\n  '3 3 double-quoted-argument' # \"\n  '15 15 double-quoted-argument' # \"\n  '4 14 command-substitution-quoted' # $(ls x y z)\n  '4 5 command-substitution-delimiter-quoted' # $(\n  '6 7 command' # ls\n  '9 9 default' # x\n  '11 11 default' # y\n  '13 13 default' # z\n  '14 14 command-substitution-delimiter-quoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-semicolon.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='A=1; echo hello world'\n\nexpected_region_highlight=(\n  \"1 3 assign\" # A=1\n  \"3 3 default\" # 1\n  \"4 4 commandseparator\" # ;\n  \"6 9 builtin\" # echo\n  \"11 15 default\" # hello\n  \"17 21 default\" # world\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-subshell.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='(A=1)'\n\nexpected_region_highlight=(\n  \"1 1 reserved-word\" # (\n  \"2 4 assign\" # A=1\n  \"4 4 default\" # 1\n  \"5 5 reserved-word\" # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-value-quote1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'s=\"foo\\'bar\"'\n\nexpected_region_highlight=(\n  '1 11 assign' # s=\"foo'bar\"\n  '3 11 default' # \"foo'bar\"\n  '3 11 double-quoted-argument' # \"foo'bar\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign-value-quote2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'s=\"foo \\'\\' bar\"'\n\nexpected_region_highlight=(\n  '1 14 assign' # s=\"foo '' bar\"\n  '3 14 default' # \"foo '' bar\"\n  '3 14 double-quoted-argument' # \"foo '' bar\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assign.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='A=1 b=(\"foo\" bar)'\n\nexpected_region_highlight=(\n  \"1 3 assign\" # A=1\n  \"3 3 default\" # 1\n  \"5 7 assign\" # b=(\n  \"7 7 reserved-word\" # (\n  \"8 12 default\" # \"foo\"\n  \"8 12 double-quoted-argument\" # \"foo\"\n  \"14 16 default\" # bar\n  \"17 17 assign\" # )\n  \"17 17 reserved-word\" # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-before-resword1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar { :; }'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 9 unknown-token' # {\n  '11 11 builtin' # :\n  '12 12 commandseparator' # ;\n  '14 14 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-before-resword2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar ( :; )'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 9 unknown-token' # (\n  '11 11 builtin' # :\n  '12 12 commandseparator' # ;\n  '14 14 unknown-token' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-before-resword3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar (( foo ))'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 17 unknown-token' # (( foo ))\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-before-resword4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar [[ -n foo ]]'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 10 unknown-token' # [[\n  '12 13 single-hyphen-option' # -n\n  '15 17 default' # foo\n  '19 20 reserved-word' # ]]\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-before-resword5.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar \\! :'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 9 unknown-token' # \\!\n  '11 11 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/assignment-quoted.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'1=\"foo\"'\n\nexpected_region_highlight=(\n  '1 7 assign' # 1=\"foo\"\n  '3 7 default' # \"foo\"\n  '3 7 double-quoted-argument' # \"foo\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/back-quoted-argument.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo `echo \\`42\\`` \"is `echo equal` to\" `echo 6 times 9'\n\nexpected_region_highlight=(\n  \"1 4 builtin\" # echo\n  \"6 18 default\" # `echo \\`42\\``\n  \"6 18 back-quoted-argument\" # `echo \\`42\\``\n  \"6 6 back-quoted-argument-delimiter\" # `\n  \"7 10 builtin\" # echo\n  \"12 17 default\" # \\`42\\`\n  \"12 17 back-quoted-argument\" # \\`42\\`\n  \"12 13 back-quoted-argument-delimiter\" # \\`\n  \"14 15 unknown-token\" # 42\n  \"16 17 back-quoted-argument-delimiter\" # \\`\n  \"18 18 back-quoted-argument-delimiter\" # `\n  \"20 39 default\" # \"is `echo equal` to\"\n  \"20 39 double-quoted-argument\" # \"is `echo equal` to\"\n  \"24 35 back-quoted-argument\" # `echo equal`\n  \"24 24 back-quoted-argument-delimiter\" # `\n  \"25 28 builtin\" # echo\n  \"30 34 default\" # equal\n  \"35 35 back-quoted-argument-delimiter\" # `\n  \"41 55 default\" # `echo 6 times 9\n  \"41 55 back-quoted-argument-unclosed\" # `echo 6 times 9\n  \"41 41 back-quoted-argument-delimiter\" # `\n  \"42 45 builtin\" # echo\n  \"47 47 default\" # 6\n  \"49 53 default\" # times\n  \"55 55 default\" # 9\n)\n"
  },
  {
    "path": "highlighters/main/test-data/back-quoted-open.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch foo\nBUFFER=$': `ls fo'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 8 default' # `ls fo\n  '3 8 back-quoted-argument-unclosed' # `ls fo\n  '3 3 back-quoted-argument-delimiter' # `\n  '4 5 command' # ls\n  '7 8 path_prefix' # fo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/backslash-continuation.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nPREBUFFER=$'echo \\\\\\n'\nBUFFER='noglob'\n\nexpected_region_highlight=(\n  \"1 6 default\" # 'noglob' highlighted as a string, not as a precomand\n)\n"
  },
  {
    "path": "highlighters/main/test-data/backslash-continuation2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'echo foo\\\\\\nbar\"baz\"'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 18 default \"issue #705\"' # foo\\\\\\nbar\"baz\"\n  '14 18 double-quoted-argument \"issue #705\"' # \"baz\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/backslash-space.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'echo \\\\ \\'foo\\' ; ls'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 12 default' # \\ \\'foo\\'\n  '8 12 single-quoted-argument' # 'foo'\n  '14 14 commandseparator' # ;\n  '16 17 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/backslash.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'\\\\'\n\nexpected_region_highlight=(\n  '1 1 unknown-token' # \\\\\n)\n"
  },
  {
    "path": "highlighters/main/test-data/bang-assign-array.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=(bar abaz) \\! ls'\n\nexpected_region_highlight=(\n  '1 5 assign' # foo=(\n  '5 5 reserved-word' # (\n  '6 8 default' # bar\n  '10 13 default' # abaz\n  '14 14 assign' # )\n  '14 14 reserved-word' # )\n  '16 16 unknown-token' # \\!\n  '18 19 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/bang-assign-scalar.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=bar \\! ls'\n\nexpected_region_highlight=(\n  '1 7 assign' # foo=bar\n  '5 7 default' # bar\n  '9 9 unknown-token' # \\!\n  '11 12 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/bang-pipeline.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'\\! ls | \\! ls'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # \\!\n  '3 4 command' # ls\n  '6 6 commandseparator' # |\n  '8 8 unknown-token' # \\!\n  '10 11 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/block-assignment-no-command.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2022 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'{ a=42 }'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # {\n  '3 6 assign' # a=42\n  '5 6 default' # 42\n  '8 8 reserved word \"issue #854\"' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/braces1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'() { echo }\\n}'\n# no special setopts\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # ()\n  '4 4 reserved-word' # {\n  '6 9 builtin' # echo\n  '11 11 reserved-word' # }\n  '12 12 commandseparator' # \\n\n  '13 13 unknown-token' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/braces2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'() { echo }\\n}'\nsetopt ignorebraces\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # ()\n  '4 4 reserved-word' # {\n  '6 9 builtin' # echo\n  '11 11 default' # }\n  '12 12 commandseparator' # \\n\n  '13 13 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-matching1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='[[ -n foo ]]'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # [[\n  '4 5 single-hyphen-option' # -n\n  '7 9 default' # foo\n  '11 12 reserved-word' # ]]\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-matching2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='[ -n foo ]'\n\nexpected_region_highlight=(\n  '1 1 builtin' # [\n  '3 4 single-hyphen-option' # -n\n  '6 8 default' # foo\n  '10 10 builtin' # ]\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='() { echo foo )'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # ()\n  '4 4 reserved-word' # {\n  '6 9 builtin' # echo\n  '11 13 default' # foo\n  '15 15 unknown-token' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch10-if-negative.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='elif true; then echo two; fi'\n\nexpected_region_highlight=(\n  '1 4 unknown-token' # elif\n  '6 9 builtin' # true\n  '10 10 commandseparator' # ;\n  '12 15 unknown-token' # then\n  '17 20 builtin' # echo\n  '22 24 default' # two\n  '25 25 commandseparator' # ;\n  '27 28 unknown-token' # fi\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='() ( echo foo }'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # ()\n  '4 4 reserved-word' # (\n  '6 9 builtin' # echo\n  '11 13 default' # foo\n  '15 15 unknown-token' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo )'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 6 unknown-token' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo }'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 6 unknown-token' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch5.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo { }'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 6 default' # {\n  '8 8 unknown-token' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch6.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='(repeat 1; do)'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # (\n  '2 7 reserved-word' # repeat\n  '9 9 default' # 1\n  '10 10 commandseparator' # ;\n  '12 13 reserved-word' # do\n  '14 14 unknown-token' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch7.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2012 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='for n in *; do echo $n; end'\n\nexpected_region_highlight=(\n  '1 3 reserved-word' # for\n  '5 5 default' # n\n  '7 8 default' # in\n  '10 10 default' # *\n  '10 10 globbing' # *\n  '11 11 commandseparator' # ;\n  '13 14 reserved-word' # do\n  '16 19 builtin' # echo\n  '21 22 default' # $n\n  '23 23 commandseparator' # ;\n  '25 27 unknown-token' # end\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch8-if-positive.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='if false; then echo one; elif true; then echo two; else echo three; fi'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # if\n  '4 8 builtin' # false\n  '9 9 commandseparator' # ;\n  '11 14 reserved-word' # then\n  '16 19 builtin' # echo\n  '21 23 default' # one\n  '24 24 commandseparator' # ;\n  '26 29 reserved-word' # elif\n  '31 34 builtin' # true\n  '35 35 commandseparator' # ;\n  '37 40 reserved-word' # then\n  '42 45 builtin' # echo\n  '47 49 default' # two\n  '50 50 commandseparator' # ;\n  '52 55 reserved-word' # else\n  '57 60 builtin' # echo\n  '62 66 default' # three\n  '67 67 commandseparator' # ;\n  '69 70 reserved-word' # fi\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch8.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='(ls&)'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # (\n  '2 3 command' # ls\n  '4 4 commandseparator' # &\n  '5 5 reserved-word' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-mismatch9-if-positive.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='if false; then echo one; fi'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # if\n  '4 8 builtin' # false\n  '9 9 commandseparator' # ;\n  '11 14 reserved-word' # then\n  '16 19 builtin' # echo\n  '21 23 default' # one\n  '24 24 commandseparator' # ;\n  '26 27 reserved-word' # fi\n)\n"
  },
  {
    "path": "highlighters/main/test-data/brackets-premature-termination.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='[[ -n foo; echo ]]'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # [[\n  '4 5 single-hyphen-option' # -n\n  '7 9 default' # foo\n  '10 10 unknown-token' # ;\n  '12 15 builtin' # echo\n  '17 18 default' # ]]\n)\n"
  },
  {
    "path": "highlighters/main/test-data/cdpath-abspath.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ncdpath=( $PWD )\nmkdir foo foo/bar\n\nBUFFER=\"/foo\"\n\nexpected_region_highlight=(\n  '1 4 unknown-token' # x (/)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/cmdpos-elision-partial.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Test elision of some, but not all of the words\n# See issue #667 for the case of eliding all words\nlocal -a x; x=(sudo \"\")\n\nsudo(){}\nBUFFER=$'$x -u phy1729 ls'\n\nexpected_region_highlight=(\n  '1 2 precommand' # $x\n  # The \"\" is elided.  If it weren't elided, the «ls» would be highlighted as an ordinary argument.\n  '4 5 single-hyphen-option' # -u\n  '7 13 default' # phy1729\n  '15 16 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/command-substitution-adjacent.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"$(echo)$(echo)'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 20 default' # \"$(echo)$(echo)\n  '6 6 double-quoted-argument-unclosed' # \"\n  '7 13 command-substitution-quoted' # $(echo)\n  '7 8 command-substitution-delimiter-quoted' # $(\n  '9 12 builtin' # echo\n  '13 13 command-substitution-delimiter-quoted' # )\n  '14 20 command-substitution-quoted' # $(echo)\n  '14 15 command-substitution-delimiter-quoted' # $(\n  '16 19 builtin' # echo\n  '20 20 command-substitution-delimiter-quoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/command-substitution-in-assignment.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=$(echo bar) :'\n\nexpected_region_highlight=(\n  '1 15 assign' # foo=$(echo bar)\n  '5 15 default' # $(echo bar)\n  '5 15 command-substitution-unquoted' # $(echo bar)\n  '5 6 command-substitution-delimiter-unquoted' # $(\n  '7 10 builtin' # echo\n  '12 14 default' # bar\n  '15 15 command-substitution-delimiter-unquoted' # )\n  '17 17 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/command-substitution-unclosed.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': foo$(echo bar'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # foo$(echo bar\n  '6 15 command-substitution-unquoted' # $(echo bar\n  '6 7 command-substitution-delimiter-unquoted' # $(\n  '8 11 builtin' # echo\n  '13 15 default' # bar\n)\n\nif [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug\n  expected_region_highlight[2]='3 16 default' # foo$(echo bar\n  expected_region_highlight[3]='6 16 command-substitution-unquoted' # $(echo bar\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/commandseparator.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=':; pwd &! ls'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"2 2 commandseparator\" # ;\n  \"4 6 builtin\" # pwd\n  \"8 9 commandseparator\" # &!\n  \"11 12 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/comment-followed.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# see alias-comment1.zsh\nsetopt interactivecomments\nBUFFER=$'# foo\\ntrue'\n\nexpected_region_highlight=(\n  '1 5 comment' # # foo\n  '6 6 commandseparator' # \\n\n  '7 10 builtin' # true\n)\n"
  },
  {
    "path": "highlighters/main/test-data/comment-leading.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt interactive_comments\n\nBUFFER='# echo foo'\n\nexpected_region_highlight=(\n  \"1 10 comment\" # # echo foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/comment-off.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsetopt interactive_comments\n\nBUFFER='# echo foo'\n\nexpected_region_highlight=(\n  \"1 1 unknown-token\" # #\n  \"3 6 default\" # \" echo foo\"\n  \"8 10 default\" # \" echo foo\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/comments.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt interactive_comments\n\nBUFFER='echo \"foo #bar\" #baz # quux'\n\nexpected_region_highlight=(\n  \"1 4 builtin\" # echo\n  \"6 15 default\" # \"foo #bar\"\n  \"6 15 double-quoted-argument\" # \"foo #bar\"\n  \"17 27 comment\" # #baz # quux\n)\n"
  },
  {
    "path": "highlighters/main/test-data/commmand-parameter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal x=/usr/bin/env\nlocal y=sudo\nlocal -a z; z=(zsh -f)\nsudo(){}\n\nBUFFER='$x \"argument\"; $y; $z'\n\nexpected_region_highlight=(\n  \"1 2 command\" # $x\n  \"4 13 default\" # \"argument\"\n  \"4 13 double-quoted-argument\" # \"argument\"\n  \"14 14 commandseparator\" # ;\n  \"16 17 precommand\" # $y (sudo)\n  \"18 18 unknown-token\" # ;\n  \"20 21 command\" # $z - 'zsh' being the command\n)\n"
  },
  {
    "path": "highlighters/main/test-data/control-flow.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='while if echo Hello; then ls /; else ls; fi; do stat \"x\"; done; repeat 10 ls'\n\nexpected_region_highlight+=(\n  \"1 5 reserved-word\" # while\n  \"7 8 reserved-word\" # if\n  \"10 13 builtin\" # echo\n  \"15 19 default\" # Hello\n  \"20 20 commandseparator\" # ;\n  \"22 25 reserved-word\" # then\n  \"27 28 command\" # ls\n  \"30 30 path\" # /\n  \"31 31 commandseparator\" # ;\n  \"33 36 reserved-word\" # else\n  \"38 39 command\" # ls\n  \"40 40 commandseparator\" # ;\n  \"42 43 reserved-word\" # fi\n  \"44 44 commandseparator\" # ;\n  \"46 47 reserved-word\" # do\n  \"49 52 command\" # stat\n  \"54 56 default\" # \"x\"\n  \"54 56 double-quoted-argument\" # \"x\"\n  \"57 57 commandseparator\" # ;\n  \"59 62 reserved-word\" # done\n  \"63 63 commandseparator\" # ;\n  \"65 70 reserved-word\" # repeat\n  \"72 73 default\" # 10\n  \"75 76 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/control-flow2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='repeat 42; do ls; done'\n\nexpected_region_highlight+=(\n  \"1 6 reserved-word\" # repeat\n  \"8 9 default\" # 42\n  \"10 10 commandseparator\" # ;\n  \"12 13 reserved-word\" # do\n  \"15 16 command\" # ls\n  \"17 17 commandseparator\" # ;\n  \"19 22 reserved-word\" # done\n)\n"
  },
  {
    "path": "highlighters/main/test-data/control-flow3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='repeat 42; ls; pwd'\n\nexpected_region_highlight+=(\n  \"1 6 reserved-word\" # repeat\n  \"8 9 default\" # 42\n  \"10 10 commandseparator\" # ;\n  \"12 13 command\" # ls\n  \"14 14 commandseparator\" # ;\n  \"16 18 builtin\" # pwd\n)\n"
  },
  {
    "path": "highlighters/main/test-data/cthulhu.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n#        0000000 0 01111111111222222 222233333 3 333344 4 4 444444555555555 5 6 6666 6 6 6667777777777888 8 8 88888999 9 9999 9 9 00 00 0000001111\n#        1234567 8 90123456789012345 678901234 5 678901 2 3 456789012345678 9 0 1234 5 6 7890123456789012 3 4 56789012 3 4567 8 9 01 23 4567890123\nBUFFER=$'echo Ph\\\\\\'ng`echo lui \"mg\"\\\\`echo lw\\\\\\'nafh \\\\\\\\\\\\`echo Cthu\"lhu\\\\\\\\\\\\` R\\\\\\\\\\'ly$(echo eh wag\\\\\\\\\\\\`echo h\\\\\\'nag\\\\\\\\\\\\`\\'l\\' fht)agn`'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 113 default' # Ph\\'ng`echo lui \"mg\"\\`echo lw\\'nafh \\\\\\`echo Cthu\"lhu\\\\\\` R\\\\'ly$(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)agn`\n  '12 113 back-quoted-argument' # `echo lui \"mg\"\\`echo lw\\'nafh \\\\\\`echo Cthu\"lhu\\\\\\` R\\\\'ly$(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)agn`\n  '12 12 back-quoted-argument-delimiter' # `\n  '13 16 builtin' # echo\n  '18 20 default' # lui\n  '22 112 default' # \"mg\"\\`echo lw\\'nafh \\\\\\`echo Cthu\"lhu\\\\\\` R\\\\'ly$(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)agn\n  '22 25 double-quoted-argument' # \"mg\"\n  '26 112 back-quoted-argument-unclosed' # \\`echo lw\\'nafh \\\\\\`echo Cthu\"lhu\\\\\\` R\\\\'ly$(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)agn\n  '26 27 back-quoted-argument-delimiter' # \\`\n  '28 31 builtin' # echo\n  '33 40 default' # lw\\'nafh\n  '42 62 default' # \\\\\\`echo Cthu\"lhu\\\\\\`\n  '42 62 back-quoted-argument' # \\\\\\`echo Cthu\"lhu\\\\\\`\n  '42 45 back-quoted-argument-delimiter' # \\\\\\`\n  '46 49 builtin' # echo\n  '51 58 default' # Cthu\"lhu\n  '55 58 double-quoted-argument-unclosed' # \"lhu\n  '59 62 back-quoted-argument-delimiter' # \\\\\\`\n  '64 112 default' # R\\\\'ly$(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)agn\n  '70 109 command-substitution-unquoted' # $(echo eh wag\\\\\\`echo h\\'nag\\\\\\`'l' fht)\n  '70 71 command-substitution-delimiter-unquoted' # $(\n  '72 75 builtin' # echo\n  '77 78 default' # eh\n  '80 104 default' # wag\\\\\\`echo h\\'nag\\\\\\`'l'\n  '83 101 back-quoted-argument' # \\\\\\`echo h\\'nag\\\\\\`\n  '83 86 back-quoted-argument-delimiter' # \\\\\\`\n  '87 90 builtin' # echo\n  '92 97 default' # h\\'nag\n  '98 101 back-quoted-argument-delimiter' # \\\\\\`\n  '102 104 single-quoted-argument' # 'l'\n  '106 108 default' # fht\n  '109 109 command-substitution-delimiter-unquoted' # )\n  '113 113 unknown-token' # `\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dinbrack1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'[[ foo && bar || baz ]]'\n\nexpected_region_highlight=(\n  '1 2 reserved-word' # [[\n  '4 6 default' # foo\n  '8 9 default' # &&\n  '11 13 default' # bar\n  '15 16 default' # ||\n  '18 20 default' # baz\n  '22 23 reserved-word' # ]]\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dirs_blacklist.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nmkdir foo\ntouch foo/bar\nBUFFER=\": foo/bar $PWD/foo foo/b\"\nZSH_HIGHLIGHT_DIRS_BLACKLIST=($PWD/foo $PWD/bar)\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 9 default' # foo/bar\n  \"11 $(( 14 + $#PWD )) default\" # $PWD/foo\n  \"$(( 16 + $#PWD )) $(( 20 + $#PWD )) default\" # foo/b\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-dollar.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"$$ $$foo\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 12 default' # \"$$ $$foo\"\n  '3 12 double-quoted-argument' # \"$$ $$foo\"\n  '4 5 dollar-double-quoted-argument' # $$\n  '7 8 dollar-double-quoted-argument' # $$\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-noise.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"$- $# $* $@ $?\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 18 default' # \"$- $# $* $@ $?\"\n  '3 18 double-quoted-argument' # \"$- $# $* $@ $?\"\n  '4 5 dollar-double-quoted-argument' # $-\n  '7 8 dollar-double-quoted-argument' # $#\n  '10 11 dollar-double-quoted-argument' # $*\n  '13 14 dollar-double-quoted-argument' # $@\n  '16 17 dollar-double-quoted-argument' # $?\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-paren.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"$(:)\" \"foo$(:)bar'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 8 default' # \"$(:)\"\n  '3 3 double-quoted-argument' # \"$(:)\"\n  '8 8 double-quoted-argument' # \"$(:)\"\n  '4 7 command-substitution-quoted' # $(:)\n  '4 5 command-substitution-delimiter-quoted' # $(\n  '6 6 builtin' # :\n  '7 7 command-substitution-delimiter-quoted' # )\n  '10 20 default' # \"foo$(:)bar\n  '10 13 double-quoted-argument-unclosed' # \"foo\n  '18 20 double-quoted-argument-unclosed' # bar\n  '14 17 command-substitution-quoted' # $(:)\n  '14 15 command-substitution-delimiter-quoted' # $(\n  '16 16 builtin' # :\n  '17 17 command-substitution-delimiter-quoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-quoted.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=\": \\$'*' 'foo'\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 6 default\" # $'*'\n  \"3 6 dollar-quoted-argument\" # $'*' - not a glob\n  \"8 12 default\" # 'foo'\n  \"8 12 single-quoted-argument\" # 'foo'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-quoted2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=\": \\$'foo\\xbar\\udeadbeef\\uzzzz'\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 29 default\" # $'foo\\xbar\\udeadbeef\\uzzzz'\n  \"3 29 dollar-quoted-argument\" # $'foo\\xbar\\udeadbeef\\uzzzz'\n  \"8 11 back-dollar-quoted-argument\" # \\xba\n  \"13 18 back-dollar-quoted-argument\" # \\dead\n  \"23 24 unknown-token\" # \\u\n)\n"
  },
  {
    "path": "highlighters/main/test-data/dollar-quoted3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Similar to double-quoted2.zsh\n# This test checks that the '1' gets highlighted correctly.  Do not append to the BUFFER.\nBUFFER=\": \\$'\\xa1\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 8 default\" # $'\\xa1\n  \"3 8 dollar-quoted-argument-unclosed\" # $'\\xa1\n  \"5 8 back-dollar-quoted-argument\" # \\xa1\n)\n"
  },
  {
    "path": "highlighters/main/test-data/double-hyphen-option.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='hello --world'\n\nexpected_region_highlight=(\n  \"1 5 unknown-token\" # hello\n  \"7 13 double-hyphen-option\" # --world\n)\n"
  },
  {
    "path": "highlighters/main/test-data/double-quoted.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"foo$bar:\\`:\\\":\\$:'\nBUFFER+=\\\\\\\\:\\\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 24 default\" # \"foo$bar:\\`:\\\":\\$:\\\\:\"\n  \"3 24 double-quoted-argument\" # \"foo$bar:\\`:\\\":\\$:\\\\:\"\n  \"7 10 dollar-double-quoted-argument\" # $bar\n  \"12 13 back-double-quoted-argument\" # \\`\n  \"15 16 back-double-quoted-argument\" # \\$\n  \"18 19 back-double-quoted-argument\" # \\\"\n  \"21 22 back-double-quoted-argument\" # \\\\\n)\n"
  },
  {
    "path": "highlighters/main/test-data/double-quoted2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Similar to dollar-quoted3.zsh\n# This test checks that the 'r' gets highlighted correctly.  Do not append to the BUFFER.\nBUFFER=': \"foo$bar'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 10 default\" # \"foo$bar\n  \"3 10 double-quoted-argument-unclosed\" # \"foo$bar\n  \"7 10 dollar-double-quoted-argument\" # $bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/double-quoted3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"$\" \"$42foo\"'\nBUFFER+=\\ \\\"\\\\\\'\\\\x\\\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 5 default\" # \"$\"\n  \"3 5 double-quoted-argument\" # \"$\"\n  \"7 14 default\" # \"$42foo\"\n  \"7 14 double-quoted-argument\" # \"$42foo\"\n  \"8 10 dollar-double-quoted-argument\" # $42\n  \"16 21 default\" # \"\\'\\x\"\n  \"16 21 double-quoted-argument\" # \"\\'\\x\" - \\' and \\x are not escape sequences\n)\n"
  },
  {
    "path": "highlighters/main/test-data/double-quoted4.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': \"${foo}bar\"'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 13 default\" # \"${foo}bar\"\n  \"3 13 double-quoted-argument\" # \"${foo}bar\"\n  \"4 9 dollar-double-quoted-argument\" # ${foo}\n)\n"
  },
  {
    "path": "highlighters/main/test-data/empty-command-newline.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Newline after semicolon isn't unknown-token\nBUFFER=$':;\\n:'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '2 2 commandseparator' # ;\n  '3 3 commandseparator' # \\n\n  '4 4 builtin' # :\n)\n"
  },
  {
    "path": "highlighters/main/test-data/empty-command.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo; ;'\n\nexpected_region_highlight=(\n  \"1 4 builtin\" # echo\n  \"5 5 commandseparator\" # ;\n  \"7 7 unknown-token\" # ;\n)\n"
  },
  {
    "path": "highlighters/main/test-data/empty-command2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Same test data and expectations as empty-command.zsh; the only difference is:\ntouch ';'\n\nBUFFER='echo; ;'\n\nexpected_region_highlight=(\n  \"1 4 builtin\" # echo\n  \"5 5 commandseparator\" # ;\n  \"7 7 unknown-token\" # ;\n)\n"
  },
  {
    "path": "highlighters/main/test-data/empty-line.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'\\\\\\n; ls'\n\nexpected_region_highlight=(\n  '3 3 unknown-token' # ;\n  '5 6 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/equals1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': =ls'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 5 path' # =ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/equals2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsetopt equals\n\nBUFFER=$': =nosuchcommand'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 16 default' # =nosuchcommand\n)\n"
  },
  {
    "path": "highlighters/main/test-data/equals3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': =nosuchcommand'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 16 unknown-token' # =nosuchcommand\n)\n"
  },
  {
    "path": "highlighters/main/test-data/equals4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': ='\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 3 default' # =\n)\n"
  },
  {
    "path": "highlighters/main/test-data/escaped-single-quote.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \\'foo\\'\\\\\\'\\'bar\\'' # <<<: 'foo'\\''bar'>>>\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 14 default' # 'foo'\\''bar'\n  '3 7 single-quoted-argument' # 'foo'\n  '10 14 single-quoted-argument' # 'bar'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/exec-redirection1.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='exec {foo}>&/tmp ls'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # exec\n  \"6 10 named-fd\" # {foo}\n  \"11 12 redirection\" # >&\n  \"13 16 path\" # /tmp\n  \"18 19 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/fd-target-not-filename.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch 2\n\nBUFFER=$'echo foo>&2'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 8 default' # foo\n  '9 10 redirection' # >&\n  '11 11 numeric-fd' # 2 (not path)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/function-altsyntax.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Define named and anonymous function using the alternative syntax\nBUFFER=$'function f { pwd }; function { pwd }'\n\nexpected_region_highlight=(\n  '1 8 reserved-word' # function\n  '10 10 default' # f\n  '12 12 reserved-word \"issue #237\"' # {\n  '14 16 command \"issue #237\"' # pwd\n  '18 18 reserved-word \"issue #237\"' # }\n  '19 19 commandseparator' # ;\n  '21 28 reserved-word' # function\n  '30 30 reserved-word \"issue #237\"' # {\n  '32 34 command \"issue #237\"' # pwd\n  '36 36 reserved-word \"issue #237\"' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/function-named1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='f() pwd; f() { balanced braces }'\n\nexpected_region_highlight=(\n  '1 1 TBD \"issue #223\"' # f\n  '2 3 reserved-word' # ()\n  '5 7 builtin' # pwd\n  '8 8 commandseparator' # ;\n  '10 10 TBD \"issue #223\"' # f\n  '11 12 reserved-word' # ()\n  '14 14 reserved-word' # {\n  '16 23 unknown-token' # balanced\n  '25 30 default' # braces\n  '32 32 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/function-named2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='f g h () pwd'\n\nexpected_region_highlight=(\n  '1 1 TBD \"issue #223\"' # f\n  '3 3 TBD \"issue #223\"' # g\n  '5 5 TBD \"issue #223\"' # h\n  '7 8 reserved-word' # ()\n  '10 12 builtin' # pwd\n)\n"
  },
  {
    "path": "highlighters/main/test-data/function.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ncd() {\n  builtin cd \"$@\"\n}\nls() {\n  command ls \"$@\"\n}\nBUFFER='cd;ls'\n\nexpected_region_highlight=(\n  \"1 2 function\" # cd\n  \"3 3 commandseparator\" # ;\n  \"4 5 function\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/glob.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': foo* bar? *baz qux\\?'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 6 default\" # foo*\n  \"6 6 globbing\" # *\n  \"8 11 default\" # bar?\n  \"11 11 globbing\" # ?\n  \"13 16 default\" # *baz\n  \"13 13 globbing\" # *\n  \"18 22 default\" # qux\\?\n)\n"
  },
  {
    "path": "highlighters/main/test-data/global-alias1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias -g foo=bar\n\nBUFFER=$'foo foo'\n\nexpected_region_highlight=(\n  '1 3 global-alias' # foo\n  '5 7 global-alias' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/globs-with-quoting.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \"foo\"*\\'bar\\'?\"baz?\"<17-29>\"qu*ux\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 34 default' # \"foo\"*'bar'?\"baz?\"<17-29>\"qu*ux\"\n  '3 7 double-quoted-argument' # \"foo\"\n  '8 8 globbing' # *\n  '9 13 single-quoted-argument' # 'bar'\n  '14 14 globbing' # ?\n  '15 20 double-quoted-argument' # \"baz?\"\n  '21 27 globbing' # <17-29>\n  '28 34 double-quoted-argument' # \"qu*ux\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/hashed-command.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nhash zsh_syntax_highlighting_hash=/doesnotexist\nBUFFER='zsh_syntax_highlighting_hash'\n\nexpected_region_highlight=(\n  \"1 28 hashed-command 'zsh/parameter cannot distinguish between hashed and command'\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-double-quoted-escaped.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"Hello\\!\"'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 14 default' # \"Hello\\!\"\n  '6 14 double-quoted-argument' # \"Hello\\!\"\n  '12 13 back-double-quoted-argument' # \\!\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-double-quoted-followed.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': !!= \"!!=\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 4 history-expansion \"issue #713\"' # !!\n  '7 11 default' # \"!!=\"\n  '7 11 double-quoted-argument' # \"!!=\"\n  '8 9 history-expansion \"issue #713' # !!\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-double-quoted-no.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"foo != bar !{baz}\"'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 24 default' # \"foo != bar !{baz}\"\n  '6 24 double-quoted-argument' # \"foo != bar !{baz}\" - no history expansions\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-double-quoted-unescaped.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"Hello!\"'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 13 default' # \"Hello!\"\n  '6 13 double-quoted-argument' # \"Hello!\"\n  '12 12 history-expansion' # !\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-double-quoted-yes.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"foo !bar\"'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 15 default' # \"foo !bar\"\n  '6 15 double-quoted-argument' # \"foo !bar\"\n  '11 11 history-expansion' # !\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-expansion.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='!foo bar !baz ! ; !'\n\nexpected_region_highlight=(\n  \"1 4 history-expansion\" # !foo\n  \"6 8 default\" # bar\n  \"10 13 history-expansion\" # !baz\n  \"15 15 default\" # !\n  \"17 17 commandseparator\" # ;\n  \"19 19 reserved-word\" # !\n)\n"
  },
  {
    "path": "highlighters/main/test-data/history-expansion2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='^foo^bar'\n\nexpected_region_highlight=(\n  \"1 8 history-expansion\" # ^foo^bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/inheritance.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n_zsh_highlight_add_highlight()\n{\n  region_highlight+=(\"$1 $2 ${(j.,.)argv[3,-1]}\")\n}\n\nBUFFER='type'\n\nexpected_region_highlight=(\n  '1 4 builtin,arg0' # type\n)\n"
  },
  {
    "path": "highlighters/main/test-data/jobsubst-isnt-glob.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018.9958 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': %? %?foo'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 4 default' # %?\n  '6 10 default' # %?foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/jobsubst-isnt-glob2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': foo%?bar'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 10 default' # foo%?bar\n  '7 7 globbing' # ?\n)\n"
  },
  {
    "path": "highlighters/main/test-data/loop-newline.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'for i in \\\\\\n; do done'\n\nexpected_region_highlight=(\n  '1 3 reserved-word' # for\n  '5 5 default' # i\n  '7 8 default' # in\n  '12 12 commandseparator' # ;\n  '14 15 reserved-word' # do\n  '17 20 reserved-word' # done\n)\n"
  },
  {
    "path": "highlighters/main/test-data/meta-no-eval1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(kill -9 $$) ${:-$(kill -9 $$)}'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # $(kill -9 $$)\n  '3 15 command-substitution-unquoted' # $(kill -9 $$)\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 8 builtin' # kill\n  '10 11 single-hyphen-option' # -9\n  '13 14 default' # $$\n  '15 15 command-substitution-delimiter-unquoted' # )\n  '17 34 default' # ${:-$(kill -9 $$)}\n  '21 33 command-substitution-unquoted' # $(kill -9 $$)\n  '21 22 command-substitution-delimiter-unquoted' # $(\n  '23 26 builtin' # kill\n  '28 29 single-hyphen-option' # -9\n  '31 32 default' # $$\n  '33 33 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/meta-no-eval2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# We aren't testing how this is highlighted; we're testing that it's not\n# evaluated.  If it gets evaluated, the test suite will die.\nBUFFER=$': /(e*exit 42*)'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # /(e*exit 42*)\n  '6 6 globbing' # *\n  '14 14 globbing' # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multiline-array-assignment1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'foo=(\\nbar) env'\n\nexpected_region_highlight=(\n  '1 5 assign' # foo=(\n  '5 5 reserved-word' # (\n  '6 6 commandseparator' # \\n\n  '7 9 default' # bar\n  '10 10 assign' # )\n  '10 10 reserved-word' # )\n  '12 14 precommand' # env\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multiline-string.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nPREBUFFER=$'echo \"foo1\\n'\nBUFFER='foo2\" ./'\n\nexpected_region_highlight=(\n  \"1 5 default\" # 'foo2\"'\n  \"1 5 double-quoted-argument\" # 'foo2\"'\n  \"7 8 path\" # './'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multiline-string2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'echo \\'foo1\\n'\n\nexpected_region_highlight=(\n  \"1 4 builtin\" # echo\n  \"6 11 default\" # 'foo1\\n\n  \"6 11 single-quoted-argument-unclosed\" # 'foo1\\n\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multios-negates-globbing.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nunsetopt multios\n\nBUFFER=$'cat < *'\n\nexpected_region_highlight=(\n  '1 3 command' # cat\n  '5 5 redirection' # <\n  '7 7 default' # * - not globbing\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multios-negates-globbing2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'cat < *'\n\nexpected_region_highlight=(\n  '1 3 command' # cat\n  '5 5 redirection' # <\n  '7 7 default' # *\n  '7 7 globbing' # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multiple-quotes.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \\'foo\\'bar\"baz$quux/foo\\\\\\\\bar\"baz$\\'quux\\\\nfoo\\\\001bar\\'baz'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 54 default\" # 'foo'bar\"baz$quux/foo\\\\bar\"baz$'quux\\nfoo\\001'baz\n  \"3 7 single-quoted-argument\" # 'foo'\n  \"11 29 double-quoted-argument\" #\"baz\n  \"15 19 dollar-double-quoted-argument\" # $quux\n  \"24 25 back-double-quoted-argument\" # \\\\\n  \"33 51 dollar-quoted-argument\" # $'quux\\nfoo\\001bar'\n  \"39 40 back-dollar-quoted-argument\" # \\n\n  \"44 47 back-dollar-quoted-argument\" # \\001\n)\n"
  },
  {
    "path": "highlighters/main/test-data/multiple-redirections.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='id bob | grep java | sort | uniq | tail | head'\n\nexpected_region_highlight=(\n  \"1  2  command\" # ps\n  \"4  6  default\" # aux\n  \"8  8  commandseparator\" # |\n  \"10 13 command\" # grep\n  \"15 18 default\" # java\n  \"20 20 commandseparator\" # |\n  \"22 25 command\" # sort\n  \"27 27 commandseparator\" # |\n  \"29 32 command\" # uniq\n  \"34 34 commandseparator\" # |\n  \"36 39 command\" # tail\n  \"41 41 commandseparator\" # |\n  \"43 46 command\" # head\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob-alias.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias x=command\nBUFFER='x ls'\n\nexpected_region_highlight=(\n  \"1 1 alias\" # x\n  \"3 4 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob-always.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'{ noglob echo * } always { echo * }'\n\nexpected_region_highlight=(\n  '1 1 reserved-word' # {\n  '3 8 precommand' # noglob\n  '10 13 builtin' # echo\n  '15 15 default' # *\n  '17 17 reserved-word' # }\n  '19 24 reserved-word' # always\n  '26 26 reserved-word' # {\n  '28 31 builtin' # echo\n  '33 33 default' # *\n  '33 33 globbing' # *\n  '35 35 reserved-word' # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob1.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=':; noglob echo *'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"2 2 commandseparator\" # ;\n  \"4 9 precommand\" # noglob\n  \"11 14 builtin\" # echo\n  \"16 16 default\" # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='noglob echo *; echo *'\n\nexpected_region_highlight=(\n  \"1 6 precommand\" # noglob\n  \"8 11 builtin\" # echo\n  \"13 13 default\" # *\n  \"14 14 commandseparator\" # ;\n  \"16 19 builtin\" # echo\n  \"21 21 default\" # *\n  \"21 21 globbing\" # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch \\*\n\nBUFFER='noglob echo *'\n\nexpected_region_highlight=(\n  \"1 6 precommand\" # noglob\n  \"8 11 builtin\" # echo\n  \"13 13 path\" # *\n)\n"
  },
  {
    "path": "highlighters/main/test-data/noglob4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'noglob cat <(print -r -- *)'\n\nexpected_region_highlight=(\n  '1 6 precommand' # noglob\n  '8 10 command' # cat\n  '12 27 default' # <(print -r -- *)\n  '12 27 process-substitution' # <(print -r -- *)\n  '12 13 process-substitution-delimiter' # <(\n  '14 18 builtin' # print\n  '20 21 single-hyphen-option' # -r\n  '23 24 double-hyphen-option' # --\n  '26 26 default' # *\n  '26 26 globbing' # *\n  '27 27 process-substitution-delimiter' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/null-exec.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'exec >/dev/null;'\n\nexpected_region_highlight=(\n  '1 4 precommand' # exec\n  '6 6 redirection' # >\n  '7 15 path' # /dev/null\n  '16 16 commandseparator' # ;\n)\n"
  },
  {
    "path": "highlighters/main/test-data/null-exec2-printenv.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2021 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'env | grep $needle'\n\nexpected_region_highlight=(\n  '1 3 precommand' # env\n  '5 5 commandseparator' # |\n  '7 10 command' # grep\n  '12 18 default' # $needle\n)\n"
  },
  {
    "path": "highlighters/main/test-data/number_range-glob.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='print <-> x<->y <foo2-3>'\n\nexpected_region_highlight=(\n  '1 5 builtin' # print\n  '7 9 default' # <->\n  '7 9 globbing' # <->\n  '11 15 default' # x<->y\n  '12 14 globbing' # <->\n  '17 17 redirection' # <\n  '18 23 default' # foo2-3 (the filename)\n  '24 24 redirection' # >\n)\n"
  },
  {
    "path": "highlighters/main/test-data/off-by-one.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nalias a=:\nf() {}\n\nBUFFER='a;f;'\n\nexpected_region_highlight=(\n  \"1 1 alias\" # a\n  \"2 2 commandseparator\" # ;\n  \"3 3 function\" # f\n  \"4 4 commandseparator\" # ;\n)\n"
  },
  {
    "path": "highlighters/main/test-data/opt-shwordsplit1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt shwordsplit\nlocal EDITOR='ed -s'\n\ned() { command ed \"$@\" }\n\nBUFFER=$'$EDITOR'\n\nexpected_region_highlight=(\n  '1 7 function' # $EDITOR\n)\n"
  },
  {
    "path": "highlighters/main/test-data/optimized-cmdsubst-input.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See getoutput() and getoutputfile() in zsh's C source code.\n\nBUFFER=$': $(<*)'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 7 default' # $(<*)\n  '3 7 command-substitution-unquoted' # $(<*)\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 5 redirection' # <\n  '6 6 default' # * - not globbing!\n  '7 7 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/option-dollar-quote-isnt-filename.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': -$\\'n\\''\n\ntouch ./-n\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 7 single-hyphen-option' # -$'n'\n  '4 7 dollar-quoted-argument' # $'n'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/option-path_dirs.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nif [[ $OSTYPE == msys ]]; then\n  skip_test='Cannot chmod +x in msys2'\nelse\n  setopt PATH_DIRS\n  mkdir -p foo/bar\n  touch foo/bar/testing-issue-228\n  chmod  +x foo/bar/testing-issue-228\n  path+=( \"$PWD\"/foo )\n\n  BUFFER='bar/testing-issue-228'\n\n  expected_region_highlight=(\n    \"1 21 command\" # bar/testing-issue-228\n  )\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/option-with-quotes.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': --user=\"phy1729\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 18 double-hyphen-option' # --user=\"phy1729\"\n  '10 18 double-quoted-argument' # \"phy1729\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/order-path-after-dollar.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch '$foo'\nBUFFER=': $foo \\$foo'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 6 default' # $foo - if we add a \"unquoted parameter expansion\" style then this expectation should change\n  '8 12 path' # \\$foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/order-path-before-globbing.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch '*'\nBUFFER=': * \\*'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 3 default' # *\n  '3 3 globbing' # *\n  '5 6 path' # \\*\n)\n"
  },
  {
    "path": "highlighters/main/test-data/param-positional-in-array-append.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# This used to be an infinite loop.\n\nBUFFER=$'l+=( $1'\n\nexpected_region_highlight=(\n  '1 4 assign' # l+=(\n  '4 4 reserved-word' # (\n  '6 7 default' # $1\n)\n"
  },
  {
    "path": "highlighters/main/test-data/param-precommand-option-argument1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See also alias-precommand-option-argument1.zsh\nlocal -a sudo_u; sudo_u=(sudo -u)\nsudo(){}\n\nBUFFER='$sudo_u phy1729 echo foo'\n\nexpected_region_highlight=(\n  '1 7 precommand' # $sudo_u\n  '9 15 default' # phy1729\n  '18 20 command \"issue #540\"' # echo (not builtin)\n  '22 24 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/param-precommand-option-argument3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See also alias-precommand-option-argument3.zsh\nlocal -a sudo_u; sudo_u=(sudo -u)\nsudo(){}\n\nBUFFER='$sudo_u phy1729 ls foo'\n\nexpected_region_highlight=(\n  '1 7 precommand' # sudo_u\n  '9 15 default' # phy1729\n  '17 18 command' # ls\n  '20 22 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-elision-command-word.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='$x ls'\n\nexpected_region_highlight=(\n  '1 2 comment' # $x\n  '4 5 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-expansion-shwordsplit.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2021 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt sh_word_split\nlocal foo='echo foo'\n\nBUFFER='$foo'\n\nexpected_region_highlight=(\n  '1 4 builtin' # $foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-expansion-untokenized1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal x=\"()\"\n\nBUFFER=$'$x ls'\n\nexpected_region_highlight=(\n  '1 2 unknown-token' # $x\n  '4 5 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-expansion-untokenized2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal x=\"^foo^bar\"\n\nBUFFER=$'$x ls'\n\nexpected_region_highlight=(\n  '1 2 unknown-token' # $x\n  '4 5 default' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-star.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='() { : $* }'\n\n# This tests that $* isn't highlighted as a glob.\n# If we ever add a \"unquoted parameter\" style, the expectation may change.\nexpected_region_highlight=(\n  \"1 2 reserved-word\" # ()\n  \"4 4 reserved-word\" # {\n  \"6 6 builtin\" # :\n  \"8 9 default\" # $*\n  \"11 11 reserved-word\" # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-to-global-alias.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nif type global_alias >/dev/null; then\n  skip_test=\"Test is written on the assumption that 'global_alias' is not a valid command name, but that assumption does not hold\"\n  return 0\nfi\nalias -g global_alias=y\nlocal s=global_alias\n\nBUFFER=$'$s'\n\nexpected_region_highlight=(\n  '1 2 unknown-token' # $s\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-value-contains-command-position1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal foobar='x=$(ls)'\n\nBUFFER=$'$foobar'\n\nexpected_region_highlight=(\n  # Used to highlight the \"ba\" as 'command' because the 'ls' showed through; issues #670 and #674\n  '1 7 unknown-token' # $foobar (not an assignment)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/parameter-value-contains-command-position2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal y='x=$(ls)'\n\nBUFFER=$'$y'\n\nexpected_region_highlight=(\n  # Used to trigger a \"BUG\" message on stderr - issues #670 and #674\n  '1 2 unknown-token' # $y (not an assignment)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/pasted-quotes.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2013 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': \\'foo\\'bar\"baz\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 15 default' # \\'foo\\'bar\"baz\"\n  '3 7 single-quoted-argument' # \\'foo\\'\n  '11 15 double-quoted-argument' # \"baz\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-broken-symlink.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nif [[ $OSTYPE == msys ]]; then\n  skip_test='Cannot create symlinks in msys2'\nelse\n  ln -s /nonexistent broken-symlink\n  BUFFER=': broken-symlink'\n  CURSOR=5 # to make path_prefix ineligible\n\n  expected_region_highlight=(\n    \"1 1 builtin\" # :\n    \"3 16 path\" # broken-symlink\n  )\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/path-dollared-word.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nif [[ $OSTYPE == msys ]]; then\n  skip_test='Cannot chmod +x in msys2' # cargo culted from option-path_dirs.zsh\nelse\n  mkdir kappa\n  touch kappa.exe\n  chmod +x kappa.exe\n  cd kappa\n  \n  BUFFER='$PWD.exe; ${PWD}.exe'\n  \n  expected_region_highlight=(\n    \"1 8 unknown-token\" # $PWD.exe - not eval'd; issue #328\n    \"9 9 commandseparator\" # ;\n    \"11 20 unknown-token\" # ${PWD}.exe\n  )\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/path-dollared-word2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nlocal lambda=\"''\"\ntouch \\$lambda\nBUFFER=': \\$lambda'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 10 path\" # \\$lambda\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-dollared-word3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# «/usr» at this point would be highlighted as path_prefix; so should\n# a parameter that expands to an equivalent string be highlighted.\n#\n# More complicated parameter substitutions aren't eval'd; issue #328.\nBUFFER='$PWD; ${PWD}'\n\nexpected_region_highlight=(\n  \"1 4 unknown-token\" # $PWD (without AUTO_CD)\n  \"5 5 commandseparator\" # ;\n  \"7 12 path_prefix\" # ${PWD}\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-dollared-word3b.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt autocd\nBUFFER=$'$PWD; ${PWD}'\n\nexpected_region_highlight=(\n  '1 4 autodirectory' # $PWD\n  '5 5 commandseparator' # ;\n  '7 12 autodirectory' # ${PWD}\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-dollared-word4.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# This tests for a regression during development of issue #328: an interim version\n# of that branch failed that test with \"Bail out! output on stderr\".\nBUFFER='${'\n\nexpected_region_highlight=(\n  \"1 2 unknown-token\" # ${\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-mixed-quoting.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch foo\n\nBUFFER=$': \\'f\\'oo'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 7 path' # \\'f\\'oo\n  '3 5 single-quoted-argument' # \\'f\\'\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-separators.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# ZSH_HIGHLIGHT_STYLES is empty in tests. The path-separator code however compares its values.\n# Make sure the relevant ones are set to something.\nZSH_HIGHLIGHT_STYLES[path_pathseparator]=set\nZSH_HIGHLIGHT_STYLES[path_prefix_pathseparator]=set\n\nmkdir A\ntouch A/mu\nBUFFER='ls /bin/ / A/mu A/m'\n\nexpected_region_highlight=(\n  \"1 2 command\"                      # ls\n  \"4 8 path\"                         # /bin/\n  \"4 4 path_pathseparator\"           # /\n  \"8 8 path_pathseparator\"           # /\n\n  \"10 10 path\"                       # /\n  \"10 10 path_pathseparator\"         # /\n\n  \"12 15 path\"                       # A/mu\n  \"13 13 path_pathseparator\"         # /\n\n  \"17 19 path_prefix\"                # A/m\n  \"18 18 path_prefix_pathseparator\"  # /\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-separators2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# ZSH_HIGHLIGHT_STYLES is empty in tests. The path-separator code however compares its values.\n# For this test, make sure both these styles are set and identical:\nZSH_HIGHLIGHT_STYLES[path]=value\nZSH_HIGHLIGHT_STYLES[path_pathseparator]=value\n\nBUFFER='ls /bin/'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 8 path\"    # /bin/\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-space.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nmkdir A\ntouch \"A/mu with spaces\"\nBUFFER='ls A/mu\\ with\\ spaces'\n\nexpected_region_highlight=(\n  \"1 2  command\" # ls\n  \"4 21 path\"    # A/mu\\ with\\ spaces\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-tilde-home.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nHOME=\".\"\nBUFFER='ls ~'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 4 path\"    # ~\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-tilde-home2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nHOME=\"/nonexistent\"\nBUFFER='ls ~'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 4 default\"    # ~\n)\n\n"
  },
  {
    "path": "highlighters/main/test-data/path-tilde-home3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nHOME=\".\"\nBUFFER='ls \\~'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 5 default\"    # \\~\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path-tilde-named.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nmkdir mydir\ntouch mydir/path-tilde-named.test\nhash -d D=mydir\n\nBUFFER='ls ~D/path-tilde-named.test'\n\nexpected_region_highlight=(\n  \"1 2  command\" # ls\n  \"4 27 path\"    # ~D/path-tilde-named.test\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nmkdir A\ntouch A/mu\nBUFFER='ls A/mu'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 7 path\"     # A/mu\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path_prefix.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Assumes that '/bin/sh' exists and '/bin/s' does not exist.\n# Related to path_prefix2.zsh\n\nBUFFER='ls /bin/s'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 9 path_prefix\" # /bin/s\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path_prefix2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Assumes that '/bin/sh' exists and '/bin/s' does not exist.\n# Related to path_prefix.zsh\n\nBUFFER='ls /bin/s'\nWIDGET=zle-line-finish\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 9 default\" # /bin/s\n)\n"
  },
  {
    "path": "highlighters/main/test-data/path_prefix3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Assumes that '/bin/sh' exists and '/bin/s' does not exist.\n# Related to path_prefix.zsh\n\nPREBUFFER=$'ls \\\\\\n'\nBUFFER='/bin/s'\n\nexpected_region_highlight=(\n  '1 6 path_prefix' # /bin/s\n)\n"
  },
  {
    "path": "highlighters/main/test-data/plain-file-in-command-position.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch foo\nchmod -x foo\nBUFFER=$'./foo; ./foo'\n\nexpected_region_highlight=(\n  '1 5 unknown-token' # ./foo (in middle)\n  '6 6 commandseparator' # ;\n  '8 12 unknown-token' # ./foo (at end)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-killing1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nhash sudo=false\ntouch foo\n\nBUFFER='sudo -e ./foo'\n\nexpected_region_highlight=(\n  '1 4 precommand' # sudo\n  '6 7 single-hyphen-option' # -e\n  '9 13 path' # ./foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-killing2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nhash sudo=false\n\nBUFFER='sudo -e /does/not/exist'\n\nexpected_region_highlight=(\n  '1 4 precommand' # sudo\n  '6 7 single-hyphen-option' # -e\n  '9 23 default' # /does/not/exist\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-then-assignment.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'nice x=y ls'\n\nexpected_region_highlight=(\n  '1 4 precommand' # nice\n  '6 8 unknown-token \"issue #641.5\"' # x=y\n  '10 11 default \"issue #641.5 (fallout)\"' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-type1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Test the behaviour of a builtin that exists as a command as well.\n# The spaces in $BUFFER are to align precommand-type*.zsh test files.\nBUFFER=$'test  ; builtin test  ; builtin command test  ; nice test  '\n\n# Our expectations assumes that a 'test' external command exists (in addition\n# to the 'test' builtin).  Let's verify that, using the EQUALS option (which\n# is on by default).  If there's no 'test' command, the expansion will fail,\n# diagnose a message on stdout, and the harness will detect a failure.\n#\n# This seems to work on all platforms, insofar as no one ever reported a bug\n# about their system not having a 'test' binary in PATH.  That said, if someone\n# ever does see this test fail for this reason, we should explicitly create\n# a 'test' executable in cwd and 'rehash'.\n: =test\n\nexpected_region_highlight=(\n  '1 4 builtin' # test\n  '7 7 commandseparator' # ;\n\n  '9 15 precommand' # builtin\n  '17 20 builtin' # test\n  '23 23 commandseparator' # ;\n\n  '25 31 precommand' # builtin\n  '33 39 precommand' # command\n  '41 44 command \"issue #608\"' # test\n  '47 47 commandseparator' # ;\n\n  '49 52 precommand' # nice\n  '54 57 command \"issue #608\"' # test\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-type2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Test the behaviour of a builtin that does not exist as a command.\n# The spaces in $BUFFER are to align precommand-type*.zsh test files.\nBUFFER=$'zstyle; builtin zstyle; builtin command zstyle; nice zstyle'\n\n# Verify that no $^path/zstyle(N) binary exists.\nif (disable zstyle; type zstyle >/dev/null); then\n  echo >&2 \"precommand-type2: error: 'zstyle' exists not only as a builtin\"\nfi\n\nexpected_region_highlight=(\n  '1 6 builtin' # zstyle\n  '7 7 commandseparator' # ;\n\n  '9 15 precommand' # builtin\n  '17 22 builtin' # zstyle\n  '23 23 commandseparator' # ;\n\n  '25 31 precommand' # builtin\n  '33 39 precommand' # command\n  '41 46 unknown-token \"issue #608\"' # zstyle\n  '47 47 commandseparator' # ;\n\n  '49 52 precommand' # nice\n  '54 59 unknown-token \"issue #608\"' # zstyle\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-type3.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Test an external command that does not exist as a builtin.\n# The spaces in $BUFFER are to align precommand-type*.zsh test files.\nBUFFER=$'ls    ; builtin ls    ; builtin command ls    ; nice ls    '\n\n# Verify that the 'ls' command isn't shadowed.\nif [[ $(type -w ls) != \"ls: command\" ]]; then\n  echo >&2 \"precommand-type3: error: the 'ls' command is shadowed (or possibly missing altogether)\"\nfi\n\nexpected_region_highlight=(\n  '1 2 command' # ls\n  '7 7 commandseparator' # ;\n\n  '9 15 precommand' # builtin\n  '17 18 unknown-token \"issue #608\"' # ls\n  '23 23 commandseparator' # ;\n\n  '25 31 precommand' # builtin\n  '33 39 precommand' # command\n  '41 42 command' # ls\n  '47 47 commandseparator' # ;\n\n  '49 52 precommand' # nice\n  '54 55 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-uninstalled.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Simulate sudo not being installed.\n#\n# The 'hash' step is because, if sudo _really_ isn't installed, 'unhash sudo'\n# would error out and break the test.\nhash sudo=/usr/bin/env && unhash sudo\n\nlocal PATH\n\nBUFFER=$'sudo ls'\n\nexpected_region_highlight=(\n  '1 4 unknown-token' # sudo\n  '6 7 default' # ls - not 'command', since sudo isn't installed\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand-unknown-option.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\nBUFFER='sudo -ux ls; sudo -x ls'\n\nexpected_region_highlight=(\n  '1 4 precommand' # sudo\n  '6 8 single-hyphen-option' # -ux\n  '10 11 command' # ls\n  '12 12 commandseparator' # ;\n  '14 17 precommand' # sudo\n  '19 20 single-hyphen-option' # -x\n  '22 23 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': command zzzzzz'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 9 default\" # not precommand\n  \"11 16 default\" # not unknown-token (since 'zzzzzz' is not a command)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='command -v ls'\n\nexpected_region_highlight=(\n  \"1 7 precommand\" # command\n  \"9 10 single-hyphen-option\" # -v\n  \"12 13 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='nice -n10 ls; nice -n 10 ls'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # nice\n  \"6 9 single-hyphen-option\" # -n10\n  \"11 12 command\" # ls\n  \"13 13 commandseparator\" # ;\n  \"15 18 precommand\" # nice\n  \"20 21 single-hyphen-option\" # -n\n  \"23 24 default\" # 10\n  \"26 27 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/precommand4.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ndoas(){}\nBUFFER=$'doas -nu phy1729 ls'\n\nexpected_region_highlight=(\n  '1 4 precommand' # doas\n  '6 8 single-hyphen-option' # -nu\n  '10 16 default' # phy1729\n  '18 19 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/prefix-redirection.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='>/tmp >/tmp command echo >/tmp foo'\n\nexpected_region_highlight=(\n  \"1  1  redirection\" # >\n  \"2  5  path\"       # /tmp\n  \"7  7  redirection\" # >\n  \"8  11 path\"       # /tmp\n  \"13 19 precommand\" # command\n  \"21 24 builtin\"    # echo\n  \"26 26 redirection\" # >\n  \"27 30 path\"       # /tmp\n  \"32 34 default\"    # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/process-substitution-after-redirection.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017, 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'< <(pwd) > >(nl)'\n\nexpected_region_highlight=(\n  '1 1 redirection' # <\n  '3 8 default' # <(pwd)\n  '3 8 process-substitution' # <(pwd)\n  '3 4 process-substitution-delimiter' # <(\n  '5 7 builtin' # pwd\n  '8 8 process-substitution-delimiter' # )\n  '10 10 redirection' # >\n  '12 16 default' # >(nl)\n  '12 16 process-substitution' # >(nl)\n  '12 13 process-substitution-delimiter' # >(\n  '14 15 command' # nl\n  '16 16 process-substitution-delimiter' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/process-substitution-redirection-isnt-globbing.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': =(<foo)'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 9 default' # =(<foo)\n  '3 9 process-substitution' # =(<foo)\n  '3 4 process-substitution-delimiter' # =(\n  '5 5 redirection' # <foo\n  '6 8 default' # foo\n  '9 9 process-substitution-delimiter' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/process-substitution.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': --foo=<(echo bar) \"<(:)\"'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 19 double-hyphen-option' # --foo=<(echo bar)\n  '9 19 process-substitution' # <(echo bar)\n  '9 10 process-substitution-delimiter' # <(\n  '11 14 builtin' # echo\n  '16 18 default' # bar\n  '19 19 process-substitution-delimiter' # )\n  '21 26 default' # \"<(:)\"\n  '21 26 double-quoted-argument' # \"<(:)\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/process-substitution2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo =(:) a=(:) =(echo foo'\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 9 default' # =(:)\n  '6 9 process-substitution' # =(:)\n  '6 7 process-substitution-delimiter' # =(\n  '8 8 builtin' # :\n  '9 9 process-substitution-delimiter' # )\n  '11 15 default' # a=(:)\n  '17 26 default' # =(echo foo\n  '17 26 process-substitution' # =(echo foo\n  '17 18 process-substitution-delimiter' # =(\n  '19 22 builtin' # echo\n  '24 26 default' # foo\n)\n\nif [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug\n  expected_region_highlight[8]='17 27 default' # =(echo foo\n  expected_region_highlight[9]='17 27 process-substitution' # =(echo foo\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/quoted-command-substitution-empty.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='echo \"foo$( '\n\nexpected_region_highlight=(\n  '1 4 builtin' # echo\n  '6 12 default' # \"foo$(\n  '6 9 double-quoted-argument-unclosed' # \"foo\n  '10 12 command-substitution-quoted' # $(\n  '10 11 command-substitution-delimiter-quoted' # $(\n)\n\nif [[ ${(z):-'$('} == '$( ' ]]; then # ignore zsh 5.0.8 bug\n  expected_region_highlight[2]='6 13 default' # \"foo$(\n  expected_region_highlight[4]='10 13 command-substitution-quoted' # $(\nfi\n"
  },
  {
    "path": "highlighters/main/test-data/quoted-redirection-in-command-word.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'\">\" foo ls'\n\nexpected_region_highlight=(\n  '1 3 unknown-token' # \">\" - not \"redirection\"\n  '5 7 default' # foo\n  '9 10 default' # ls - not \"command\"\n)\n"
  },
  {
    "path": "highlighters/main/test-data/rc-quotes.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt RC_QUOTES\n\nBUFFER=\": 'foo''bar'baz\"\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 15 default\" # 'foo''bar'baz\n  \"3 12 single-quoted-argument\" # 'foo''bar'\n  \"7 8 rc-quote\" # ''\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-all.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2024 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': <foo 9<foo <>foo 9<>foo >foo 9>foo >|foo >\\!foo >>foo >>|foo >>\\!foo <<<foo <&9 >&9 <&- >&- <&p >&p >&foo &>foo >&|foo >&\\!foo &>|foo &>\\!foo >>&foo &>>foo >>&|foo >>&\\!foo &>>|foo &>>\\!foo'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 3 redirection' # <\n  '4 6 default' # foo\n  '8 9 redirection' # 9<\n  '10 12 default' # foo\n  '14 15 redirection' # <>\n  '16 18 default' # foo\n  '20 22 redirection' # 9<>\n  '23 25 default' # foo\n  '27 27 redirection' # >\n  '28 30 default' # foo\n  '32 33 redirection' # 9>\n  '34 36 default' # foo\n  '38 39 redirection' # >|\n  '40 42 default' # foo\n  '44 45 redirection' # >\\!\n  '46 48 default' # foo\n  '50 51 redirection' # >>\n  '52 54 default' # foo\n  '56 58 redirection' # >>|\n  '59 61 default' # foo\n  '63 65 redirection' # >>\\!\n  '66 68 default' # foo\n  '70 72 redirection' # <<<\n  '73 75 default' # foo\n  '77 78 redirection' # <&\n  '79 79 numeric-fd' # 9\n  '81 82 redirection' # >&\n  '83 83 numeric-fd' # 9\n  '85 86 redirection' # <&\n  '87 87 redirection' # -\n  '89 90 redirection' # >&\n  '91 91 redirection' # -\n  '93 94 redirection' # <&\n  '95 95 redirection' # p\n  '97 98 redirection' # >&\n  '99 99 redirection' # p\n  '101 102 redirection' # >&\n  '103 105 default' # foo\n  '107 108 redirection' # &>\n  '109 111 default' # foo\n  '113 115 redirection' # >&|\n  '116 118 default' # foo\n  '120 122 redirection' # >&\\!\n  '123 125 default' # foo\n  '127 129 redirection' # &>|\n  '130 132 default' # foo\n  '134 136 redirection' # &>\\!\n  '137 139 default' # foo\n  '141 143 redirection' # >>&\n  '144 146 default' # foo\n  '148 150 redirection' # &>>\n  '151 153 default' # foo\n  '155 158 redirection' # >>&|\n  '159 161 default' # foo\n  '163 166 redirection' # >>&\\!\n  '167 169 default' # foo\n  '171 174 redirection' # &>>|\n  '175 177 default' # foo\n  '179 182 redirection' # &>>\\!\n  '183 185 default' # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-comment.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsetopt interactive_comments\n\nBUFFER=': <<#foo'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 4 redirection\" # <<\n  \"5 8 comment\" # #foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-from-param.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntouch file\nlocal fn=$PWD/file\n\nBUFFER=$'<$fn cat'\n\nexpected_region_highlight=(\n  '1 1 redirection' # <\n  '2 4 path' # $fn\n  '6 8 command' # cat\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-in-cmdsubst.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': $(<foo)'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 9 default' # $(<foo)\n  '3 9 command-substitution-unquoted' # $(<foo)\n  '3 4 command-substitution-delimiter-unquoted' # $(\n  '5 5 redirection' # <\n  '6 8 default' # foo\n  '9 9 command-substitution-delimiter-unquoted' # )\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-inhibits-elision.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'<$foo cat cat'\n\nexpected_region_highlight=(\n  '1 1 redirection' # <\n  '2 5 default' # $foo\n  '7 9 command' # cat\n  '11 13 default' # cat\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-is-not-option.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$': > -x >> --yy'\n\nexpected_region_highlight=(\n  '1 1 builtin' # :\n  '3 3 redirection' # >\n  '5 6 default' # -x\n  '8 9 redirection' # >>\n  '11 14 default' # --yy\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection-special-cases.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See xpandredir() in the zsh source.\n\nBUFFER=$'cat <&p; exec {myfd}>&-'\n\nexpected_region_highlight=(\n  '1 3 command' # cat\n  '5 6 redirection' # <&\n  '7 7 redirection' # p\n  '8 8 commandseparator' # ;\n  '10 13 precommand' # exec\n  '15 20 named-fd' # {myfd}\n  '21 22 redirection' # >&\n  '23 23 redirection' # -\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Redirection before and after the command word are implemented differently; test both.\nBUFFER='<<<foo echo >>&!bar'\n\nexpected_region_highlight=(\n  \"1 3 redirection\" # <<<\n  \"4 6 default\" # foo\n  \"8 11 builtin\" # echo\n  \"13 16 redirection\" # >>&!\n  \"17 19 default\" # bar\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='ls >(wc) | nl'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n  \"4 8 default\" # >(wc)\n  \"4 8 process-substitution\" # >(wc)\n  \"4 5 process-substitution-delimiter\" # >(\n  \"6 7 command\" # wc\n  \"8 8 process-substitution-delimiter\" # )\n  \"10 10 commandseparator\" # |\n  \"12 13 command\" # nl\n)\n"
  },
  {
    "path": "highlighters/main/test-data/redirection3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=': >>>; : <>\\<<<<EOF'\n\nexpected_region_highlight=(\n  \"1 1 builtin\" # :\n  \"3 4 redirection\" # >>\n  \"5 5 unknown-token\" # >\n  \"6 6 commandseparator\" # ;\n  \"8 8 builtin\" # :\n  \"10 11 redirection\" # <>\n  \"12 13 default\" # \\<\n  \"14 16 redirection\" # <<<\n  \"17 19 default\" # EOF\n)\n"
  },
  {
    "path": "highlighters/main/test-data/reserved-word.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='repeat \"1\" do done'\n\nexpected_region_highlight=(\n  \"1 6 reserved-word\" # repeat\n  \"8 10 default\" # \"1\"\n  \"8 10 double-quoted-argument\" # \"1\"\n  \"12 13 reserved-word\" # do\n  \"15 18 reserved-word\" # done\n)\n"
  },
  {
    "path": "highlighters/main/test-data/simple-command.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='ls'\n\nexpected_region_highlight=(\n  \"1 2 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/simple-redirection.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='id bob | grep java'\n\nexpected_region_highlight=(\n  \"1  2  command\" # ps\n  \"4  6  default\" # aux\n  \"8  8  commandseparator\" # |\n  \"10 13 command\" # grep\n  \"15 18 default\" # java\n)\n"
  },
  {
    "path": "highlighters/main/test-data/subshell.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='tar cf - * | (cd /target; tar xfp -) | { cat }'\n\nexpected_region_highlight=(\n  \"1 3 command\" # tar\n  \"5 6 default\" # cf\n  \"8 8 single-hyphen-option\" # -\n  \"10 10 default\" # *\n  \"10 10 globbing\" # *\n  \"12 12 commandseparator\" # |\n  \"14 14 reserved-word\" # (\n  \"15 16 builtin\" # cd\n  \"18 24 default\" # /target\n  \"25 25 commandseparator\" # ;\n  \"27 29 command\" # tar\n  \"31 33 default\" # xfp\n  \"35 35 single-hyphen-option\" # -\n  \"36 36 reserved-word\" # )\n  \"38 38 commandseparator\" # |\n  \"40 40 reserved-word\" # {\n  \"42 44 command\" # cat\n  \"46 46 reserved-word\" # }\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-command.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\n# Tests three codepaths:\n# * -i  (no argument)\n# * -C3 (pasted argument)\n# * -u otheruser (non-pasted argument)\nBUFFER='sudo -C3 -u otheruser -i ls /; sudo ; sudo -u ; sudo notacommand'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # sudo\n  \"6 8 single-hyphen-option\" # -C3\n  \"10 11 single-hyphen-option\" # -u\n  \"13 21 default\" # otheruser\n  \"23 24 single-hyphen-option\" # -i\n  \"26 27 command\" # ls\n  \"29 29 path\" # /\n  \"30 30 commandseparator\" # ;\n  \"32 35 precommand\" # sudo\n  \"37 37 unknown-token\" # ;, error because empty command\n  \"39 42 precommand\" # sudo\n  \"44 45 single-hyphen-option\" # -u\n  \"47 47 unknown-token\" # ;, error because incomplete command\n  \"49 52 precommand\" # sudo\n  \"54 64 unknown-token\" # notacommand - doesn't falls back to \"not a command word\" codepath\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-comment.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\nsetopt interactive_comments\nBUFFER='sudo -u # comment'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # sudo\n  \"6 7 single-hyphen-option\" # -u\n  \"9 17 unknown-token\" # \"# comment\" - error because argument missed\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-longopt.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nhash sudo='false'\nBUFFER='sudo --askpass ls'\n\nexpected_region_highlight=(\n  '1 4 precommand' # sudo\n  '6 14 double-hyphen-option' # --askpass\n  '16 17 command' # ls (we don't know whether --askpass takes an argument)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-redirection.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\nBUFFER='sudo -u >/tmp otheruser ls; sudo ls; sudo -i ls'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # sudo\n  \"6 7 single-hyphen-option\" # -u\n  \"9 9 redirection\" # >\n  \"10 13 path\" # /tmp\n  \"15 23 default\" # otheruser\n  \"25 26 command\" # ls\n  \"27 27 commandseparator\" # ;\n  \"29 32 precommand\" # sudo\n  \"34 35 command\" # ls\n  \"36 36 commandseparator\" # ;\n  \"38 41 precommand\" # sudo\n  \"43 44 single-hyphen-option\" # -i\n  \"46 47 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-redirection2.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\nBUFFER='sudo >/tmp -u otheruser ls'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # sudo\n  \"6 6 redirection\" # >\n  \"7 10 path\" # /tmp\n  \"12 13 single-hyphen-option\" # -u\n  \"15 23 default\" # otheruser\n  \"25 26 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/sudo-redirection3.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nsudo(){}\n\nBUFFER='sudo 2>./. -u otheruser ls'\n\nexpected_region_highlight=(\n  \"1 4 precommand\" # sudo\n  \"6 7 redirection\" # 2>\n  \"8 10 path\" # ./. # a 3-character path, for alignment with sudo-redirection2.zsh\n  \"12 13 single-hyphen-option\" # -u\n  \"15 23 default\" # otheruser\n  \"25 26 command\" # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/tilde-command-word.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nhash -d D=/usr/bin\n\nBUFFER='~D/env foo'\n\nexpected_region_highlight=(\n  \"1 6  command\" # ~D/env [= /usr/bin/env\n  \"8 10 default\" # foo\n)\n"
  },
  {
    "path": "highlighters/main/test-data/time-and-nocorrect1.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'time ls; nocorrect ls'\n\nexpected_region_highlight=(\n  '1 4 reserved-word' # time\n  '6 7 command' # ls\n  '8 8 commandseparator' # ;\n  '10 18 reserved-word' # nocorrect\n  '20 21 command' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/time-and-nocorrect2.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2019 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER=$'time ls; nocorrect ls'\nalias time=':' nocorrect=':'\n\nexpected_region_highlight=(\n  '1 4 alias' # time\n  '6 7 default' # ls\n  '8 8 commandseparator' # ;\n  '10 18 alias' # nocorrect\n  '20 21 default' # ls\n)\n"
  },
  {
    "path": "highlighters/main/test-data/unbackslash.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='\\sh'\n\nexpected_region_highlight=(\n  \"1 3 command\" # \\sh (runs 'sh', bypassing aliases)\n)\n"
  },
  {
    "path": "highlighters/main/test-data/unknown-command.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='azertyuiop'\n\nexpected_region_highlight=(\n  \"1  10  unknown-token\" # azertyuiop\n)\n"
  },
  {
    "path": "highlighters/main/test-data/vanilla-newline.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nPREBUFFER=$'echo foo; echo bar\\n\\n\\n'\nBUFFER=' echo baz; echo qux'\n\nexpected_region_highlight=(\n  \"2 5 builtin\" # echo\n  \"7 9 default\" # baz\n  \"10 10 commandseparator\" # semicolon\n  \"12 15 builtin\" # echo\n  \"17 19 default\" # qux\n)\n"
  },
  {
    "path": "highlighters/main/test-data/vi-linewise-mode.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# See issue #267 for the magic numbers\nBUFFER=$'foo foo\\nbar bar'\nREGION_ACTIVE=2\nCURSOR=4\nMARK=12\n\nexpected_region_highlight=(\n  \"1 3 unknown-token\" # foo\n  \"5 7 default\" # foo\n  \"8 8 commandseparator\" # \\n\n  \"9 11 unknown-token\" # bar\n  \"13 15 default\" # bar\n  \"1 15 standout\" # foo foo\\nbar bar\n)\n"
  },
  {
    "path": "highlighters/pattern/pattern-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# List of keyword and color pairs.\ntypeset -gA ZSH_HIGHLIGHT_PATTERNS\n\n# Whether the pattern highlighter should be called or not.\n_zsh_highlight_highlighter_pattern_predicate()\n{\n  _zsh_highlight_buffer_modified\n}\n\n# Pattern syntax highlighting function.\n_zsh_highlight_highlighter_pattern_paint()\n{\n  setopt localoptions extendedglob\n  local pattern\n  for pattern in ${(k)ZSH_HIGHLIGHT_PATTERNS}; do\n    _zsh_highlight_pattern_highlighter_loop \"$BUFFER\" \"$pattern\"\n  done\n}\n\n_zsh_highlight_pattern_highlighter_loop()\n{\n  # This does *not* do its job syntactically, sorry.\n  local buf=\"$1\" pat=\"$2\"\n  local -a match mbegin mend\n  local MATCH; integer MBEGIN MEND\n  if [[ \"$buf\" == (#b)(*)(${~pat})* ]]; then\n    region_highlight+=(\"$((mbegin[2] - 1)) $mend[2] $ZSH_HIGHLIGHT_PATTERNS[$pat], memo=zsh-syntax-highlighting\")\n    \"$0\" \"$match[1]\" \"$pat\"; return $?\n  fi\n}\n"
  },
  {
    "path": "highlighters/pattern/test-data/rm-rf.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nZSH_HIGHLIGHT_PATTERNS+=('rm -rf *' 'fg=white,bold,bg=red')\n\nBUFFER='rm -rf /'\n\nexpected_region_highlight=(\n  \"1 8 fg=white,bold,bg=red\" # rm -rf /\n)\n"
  },
  {
    "path": "highlighters/regexp/regexp-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# List of keyword and color pairs.\ntypeset -gA ZSH_HIGHLIGHT_REGEXP\n\n# Whether the pattern highlighter should be called or not.\n_zsh_highlight_highlighter_regexp_predicate()\n{\n  _zsh_highlight_buffer_modified\n}\n\n# Pattern syntax highlighting function.\n_zsh_highlight_highlighter_regexp_paint()\n{\n  setopt localoptions extendedglob\n  local pattern\n  for pattern in ${(k)ZSH_HIGHLIGHT_REGEXP}; do\n    _zsh_highlight_regexp_highlighter_loop \"$BUFFER\" \"$pattern\"\n  done\n}\n\n_zsh_highlight_regexp_highlighter_loop()\n{\n  local buf=\"$1\" pat=\"$2\"\n  integer OFFSET=0\n  local MATCH; integer MBEGIN MEND\n  local -a match mbegin mend\n  while true; do\n    [[ \"$buf\" =~ \"$pat\" ]] || return;\n    region_highlight+=(\"$((MBEGIN - 1 + OFFSET)) $((MEND + OFFSET)) $ZSH_HIGHLIGHT_REGEXP[$pat], memo=zsh-syntax-highlighting\")\n    buf=\"$buf[$(($MEND+1)),-1]\"\n    OFFSET=$((MEND+OFFSET));\n  done\n}\n"
  },
  {
    "path": "highlighters/regexp/test-data/complex.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nZSH_HIGHLIGHT_REGEXP+=('[0-9\\+\\-]+' 'fg=white,bold,bg=red')\n\nBUFFER='echo 1+9-3 7+2'\n\nexpected_region_highlight=(\n  \"6 10 fg=white,bold,bg=red\"\n  \"12 14 fg=white,bold,bg=red\"\n)\n"
  },
  {
    "path": "highlighters/regexp/test-data/subexpression.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2018 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nBUFFER='ls foo'\nZSH_HIGHLIGHT_REGEXP=('(^| )(ls|cd)($| )' 'fg=green')\n\nexpected_region_highlight=(\n  '1 3 fg=green' # \"ls \"\n)\n"
  },
  {
    "path": "highlighters/regexp/test-data/word-boundary.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nif zmodload zsh/pcre 2>/dev/null; then\n  setopt RE_MATCH_PCRE\n\n  ZSH_HIGHLIGHT_REGEXP+=('\\bsudo\\b' 'fg=white,bold,bg=red')\n\n  BUFFER='sudo ls'\n\n  expected_region_highlight=(\n    \"1 4 fg=white,bold,bg=red\"\n  )\nelse\n  skip_test='Test requires zsh/pcre'\nfi\n"
  },
  {
    "path": "highlighters/root/root-highlighter.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2011 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Define default styles.\n: ${ZSH_HIGHLIGHT_STYLES[root]:=standout}\n\n# Whether the root highlighter should be called or not.\n_zsh_highlight_highlighter_root_predicate()\n{\n  _zsh_highlight_buffer_modified\n}\n\n# root highlighting function.\n_zsh_highlight_highlighter_root_paint()\n{\n  if (( EUID == 0 )) { _zsh_highlight_add_highlight 0 $#BUFFER root }\n}\n"
  },
  {
    "path": "release.md",
    "content": "# Release procedure (for developers):\n\n- Ensure every `is-at-least` invocation passes a stable zsh release's version number as the first argument\n- For minor (A.B.0) releases:\n  - Check whether the release uses any not-yet-released zsh features\n- Check open issues and outstanding pull requests\n- Confirm `make test` passes\n  - check with multiple zsh versions\n    (easiest to check GitHub Actions: https://github.com/zsh-users/zsh-syntax-highlighting/actions)\n- Update changelog.md\n  `tig --abbrev=12  --abbrev-commit 0.4.1..upstream/master`\n- Make sure there are no local commits and that `git status` is clean;\n  Remove `-dev` suffix from `./.version`;\n  Commit that using `git commit -m \"Tag version $(<.version).\" .version`;\n  Tag it using `git tag -s -m \"Tag version $(<.version)\" $(<.version)`;\n  Increment `./.version` and restore the `-dev` suffix;\n  Commit that using `git commit -C b5c30ae52638e81a38fe5329081c5613d7bd6ca5 .version`.\n- Push with `git push && git push --tags`\n- Notify downstreams (OS packages)\n  - anitya should autodetect the tag\n- Update /topic on IRC\n"
  },
  {
    "path": "tests/README.md",
    "content": "zsh-syntax-highlighting / tests\n===============================\n\nUtility scripts for testing zsh-syntax-highlighting highlighters.\n\nThe tests harness expects the highlighter directory to contain a `test-data`\ndirectory with test data files.\nSee the [main highlighter](../highlighters/main/test-data) for examples.\n\nTests should set the following variables:\n\n1.\nEach test should define the string `$BUFFER` that is to be highlighted and the\narray parameter `$expected_region_highlight`.\nThe value of that parameter is a list of strings of the form  `\"$i $j $style\"`.\nor `\"$i $j $style $todo\"`.\nEach string specifies the highlighting that `$BUFFER[$i,$j]` should have;\nthat is, `$i` and `$j` specify a range, 1-indexed, inclusive of both endpoints.\n`$style` is a key of `$ZSH_HIGHLIGHT_STYLES`.\nIf `$todo` exists, the test point is marked as TODO (the failure of that test\npoint will not fail the test), and `$todo` is used as the explanation.\n\n2. \nIf a test sets `$skip_test` to a non-empty string, the test will be skipped\nwith the provided string as the reason.\n\n3. \nIf a test sets `$fail_test` to a non-empty string, the test will be skipped\nwith the provided string as the reason.\n\n4.\nIf a test sets `unsorted=1` the order of highlights in `$expected_region_highlight`\nneed not match the order in `$region_highlight`.\n\n5.\nNormally, tests fail if `$expected_region_highlight` and `$region_highlight`\nhave different numbers of elements.  To mark this check as expected to fail,\ntests may set `$expected_mismatch` to an explanation string (like `$todo`);\nthis is useful when the only difference between actual and expected is that actual\nhas some additional, superfluous elements.  This check is skipped if the\n`$todo` component is present in any regular test point.\n\n**Note**: `$region_highlight` uses the same `\"$i $j $style\"` syntax but\ninterprets the indexes differently.\n\n**Note**: Tests are run with `setopt NOUNSET WARN_CREATE_GLOBAL`, so any\nvariables the test creates must be declared local.\n\n**Isolation**: Each test is run in a separate subshell, so any variables,\naliases, functions, etc., it defines will be visible to the tested code (that\ncomputes `$region_highlight`), but will not affect subsequent tests.  The\ncurrent working directory of tests is set to a newly-created empty directory,\nwhich is automatically cleaned up after the test exits. For example:\n\n```zsh\nsetopt PATH_DIRS\nmkdir -p foo/bar\ntouch foo/bar/testing-issue-228\nchmod  +x foo/bar/testing-issue-228\npath+=( \"$PWD\"/foo )\n\nBUFFER='bar/testing-issue-228'\n\nexpected_region_highlight=(\n  \"1 21 command\" # bar/testing-issue-228\n)\n```\n\n\nWriting new tests\n-----------------\n\nAn experimental tool is available to generate test files:\n\n```zsh\nzsh -f tests/generate.zsh 'ls -x' acme newfile\n```\n\nThis generates a `highlighters/acme/test-data/newfile.zsh` test file based on\nthe current highlighting of the given `$BUFFER` (in this case, `ls -x`).\n\n_This tool is experimental._  Its interface may change.  In particular it may\ngrow ways to set `$PREBUFFER` to inject free-form code into the generated file.\n\n\nHighlighting test\n-----------------\n\n[`test-highlighting.zsh`](tests/test-highlighting.zsh) tests the correctness of\nthe highlighting. Usage:\n\n```zsh\nzsh test-highlighting.zsh <HIGHLIGHTER NAME>\n```\n\nAll tests may be run with\n\n```zsh\nmake test\n```\n\nwhich will run all highlighting tests and report results in [TAP format][TAP].\nBy default, the results of all tests will be printed; to show only \"interesting\"\nresults (tests that failed but were expected to succeed, or vice-versa), run\n`make quiet-test` (or `make test QUIET=y`).\n\n[TAP]: https://testanything.org/\n\n\nPerformance test\n----------------\n\n[`test-perfs.zsh`](tests/test-perfs.zsh) measures the time spent doing the\nhighlighting. Usage:\n\n```zsh\nzsh test-perfs.zsh <HIGHLIGHTER NAME>\n```\n\nAll tests may be run with\n\n```zsh\nmake perf\n```\n"
  },
  {
    "path": "tests/edit-failed-tests",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\ntype perl sponge >/dev/null || { print -ru2 -- \"$0: This script requires perl(1) and sponge(1) [from moreutils]\"; exit 1; }\n\nlocal editor=( \"${(@Q)${(z)${VISUAL:-${EDITOR:-vi}}}}\" )\n() { \n  > \"$2\" perl -nE '$highlighter = $1 if /^Running test (\\S*)/; say \"highlighters/${highlighter}/test-data/$1.zsh\" if /^## (\\S*)/' \"$1\"\n  >>\"$2\" echo \"\"\n  >>\"$2\" cat <\"$1\"\n  \"${editor[@]}\" -- \"$2\"\n} =(${MAKE:-make} quiet-test) =(:)\n# TODO: tee(1) the quiet-test output to /dev/tty as it's happening, with colors.\n"
  },
  {
    "path": "tests/generate.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2016 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\nemulate -LR zsh\nsetopt localoptions extendedglob\n\n# Required for add-zle-hook-widget.\nzmodload zsh/zle\n\n# Argument parsing.\nif (( $# * $# - 7 * $# + 12 )) || [[ $1 == -* ]]; then\n  print -r -- >&2 \"$0: usage: $0 BUFFER HIGHLIGHTER BASENAME [PREAMBLE]\"\n  print -r -- >&2 \"\"\n  print -r -- >&2 \"Generate highlighters/HIGHLIGHTER/test-data/BASENAME.zsh based on the\"\n  print -r -- >&2 \"current highlighting of BUFFER, using the setup code PREAMBLE.\"\n  exit 1\nfi\nbuffer=$1\nZSH_HIGHLIGHT_HIGHLIGHTERS=( $2 )\nfname=${0:A:h:h}/highlighters/$2/test-data/${3%.zsh}.zsh\npreamble=${4:-\"\"}\n\n# Load the main script.\n. ${0:A:h:h}/zsh-syntax-highlighting.zsh\n\n# Overwrite _zsh_highlight_add_highlight so we get the key itself instead of the style\n_zsh_highlight_add_highlight()\n{\n  region_highlight+=(\"$1 $2 $3\")\n}\n\n\n# Copyright block\nyear=\"`LC_ALL=C date +%Y`\"\nif ! { read -q \"?Set copyright year to $year? \" } always { echo \"\" }; then\n  year=\"YYYY\"\nfi\n<$0 sed -n -e '1,/^$/p' | sed -e \"s/2[0-9][0-9][0-9]/${year}/\" > $fname\n# Assumes stdout is line-buffered\ngit add -- $fname\nexec > >(tee -a $fname)\n\n# Preamble\nif [[ -n $preamble ]]; then\n  print -rl -- \"$preamble\" \"\"\nfi\n\n# Buffer\nprint -n 'BUFFER='\nif [[ $buffer != (#s)[$'\\t -~']#(#e) ]]; then\n  print -r -- ${(qqqq)buffer}\nelse\n  print -r -- ${(qq)buffer}\nfi\necho \"\"\n\n# Expectations\nprint 'expected_region_highlight=('\n() {\n  local i\n  local PREBUFFER\n  local BUFFER\n  \n  PREBUFFER=\"\"\n  BUFFER=\"$buffer\"\n  region_highlight=()\n  eval $(\n    exec 3>&1 >/dev/null\n    typeset -r __tests_tmpdir=\"$(mktemp -d)\"\n    {\n      # Use a subshell to ensure $__tests_tmpdir, which is to be rm -rf'd, won't be modified.\n      (cd -- \"$__tests_tmpdir\" && eval $preamble && _zsh_highlight && typeset -p region_highlight >&3)\n      : # workaround zsh bug workers/45305 with respect to the $(…) subshell we're in\n    } always {\n      rm -rf -- ${__tests_tmpdir}\n    }\n  )\n\n  for ((i=1; i<=${#region_highlight}; i++)); do\n    local -a highlight_zone; highlight_zone=( ${(z)region_highlight[$i]} )\n    integer start=$highlight_zone[1] end=$highlight_zone[2]\n    if (( start < end )) # region_highlight ranges are half-open\n    then\n      (( --end )) # convert to closed range, like expected_region_highlight\n      (( ++start, ++end )) # region_highlight is 0-indexed; expected_region_highlight is 1-indexed\n    fi\n    printf \"  %s # %s\\n\" ${(qq):-\"$start $end $highlight_zone[3]\"} ${${(qqqq)BUFFER[start,end]}[3,-2]}\n  done\n}\nprint ')'\n"
  },
  {
    "path": "tests/tap-colorizer.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015, 2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# This is a stdin-to-stdout filter that takes TAP output (such as 'make test')\n# on stdin and passes it, colorized, to stdout.\n\nemulate -LR zsh\n\nif [[ ! -t 1 ]] ; then\n  exec cat\nfi\n\nwhile read -r line;\ndo\n  case $line in\n    # comment (filename header) or plan\n    (#* | <->..<->)\n      print -nP %F{blue}\n      ;;\n    # SKIP\n    (*# SKIP*)\n      print -nP %F{yellow}\n      ;;\n    # XPASS\n    (ok*# TODO*)\n      print -nP %F{red}\n      ;;\n    # XFAIL\n    (not ok*# TODO*)\n      print -nP %F{yellow}\n      ;;\n    # FAIL\n    (not ok*)\n      print -nP %F{red}\n      ;;\n    # PASS\n    (ok*)\n      print -nP %F{green}\n      ;;\n  esac\n  print -nr - \"$line\"\n  print -nP %f\n  echo \"\" # newline\ndone\n"
  },
  {
    "path": "tests/tap-filter",
    "content": "#!/usr/bin/env perl\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# vim: ft=perl sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# This is a stdin-to-stdout filter that takes TAP output (such as 'make test')\n# on stdin and deletes lines pertaining to expected results.\n#\n# More specifically, if any of the test points in a test file either failed but\n# was expected to pass, or passed but was expected to fail, then emit that test\n# file's output; else, elide that test file's output.\n\nuse v5.10.0;\nuse warnings;\nuse strict;\n\nundef $/; # slurp mode\nprint for\n  grep { /^ok.*# TODO/m or /^not ok(?!.*# TODO)/m or /^Bail out!/m }\n    # Split on plan lines and remove them from the output.  (To keep them,\n    # use the lookahead syntax, «(?=…)», to make the match zero-length.)\n    split /^\\d+\\.\\.\\d+$/m,\n      <STDIN>;\n"
  },
  {
    "path": "tests/test-highlighting.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2017 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\nsetopt NO_UNSET WARN_CREATE_GLOBAL\n\n# Required for add-zle-hook-widget.\nzmodload zsh/zle\n\nlocal -r root=${0:h:h}\nlocal -a anon_argv; anon_argv=(\"$@\")\n\n(){\nset -- \"${(@)anon_argv}\"\n# Check an highlighter was given as argument.\n[[ -n \"$1\" ]] || {\n  echo >&2 \"Bail out! You must provide the name of a valid highlighter as argument.\"\n  exit 2\n}\n\n# Check the highlighter is valid.\n[[ -f $root/highlighters/$1/$1-highlighter.zsh ]] || {\n  echo >&2 \"Bail out! Could not find highlighter ${(qq)1}.\"\n  exit 2\n}\n\n# Check the highlighter has test data.\n[[ -d $root/highlighters/$1/test-data ]] || {\n  echo >&2 \"Bail out! Highlighter ${(qq)1} has no test data.\"\n  exit 2\n}\n\n# Set up results_filter\nlocal results_filter\nif [[ ${QUIET-} == y ]]; then\n  if type -w perl >/dev/null; then\n    results_filter=$root/tests/tap-filter\n  else\n    echo >&2 \"Bail out! quiet mode not supported: perl not found\"; exit 2\n  fi\nelse\n  results_filter=cat\nfi\n[[ -n $results_filter ]] || { echo >&2 \"Bail out! BUG setting \\$results_filter\"; exit 2 }\n\n# Load the main script.\n# While here, test that it doesn't eat aliases.\nprint > >($results_filter | $root/tests/tap-colorizer.zsh) -r -- \"# global (driver) tests\"\nprint > >($results_filter | $root/tests/tap-colorizer.zsh) -r -- \"1..1\"\nalias -- +plus=plus\nalias -- _other=other\nlocal original_alias_dash_L_output=\"$(alias -L)\"\n. $root/zsh-syntax-highlighting.zsh\nif [[ $original_alias_dash_L_output == $(alias -L) ]]; then\n  print -r -- \"ok 1 # 'alias -- +foo=bar' is preserved\"\nelse\n  print -r -- \"not ok 1 # 'alias -- +foo=bar' is preserved\"\n  exit 1\nfi > >($results_filter | $root/tests/tap-colorizer.zsh)\n\n# Overwrite _zsh_highlight_add_highlight so we get the key itself instead of the style\n_zsh_highlight_add_highlight()\n{\n  region_highlight+=(\"$1 $2 $3\")\n}\n\n# Activate the highlighter.\nZSH_HIGHLIGHT_HIGHLIGHTERS=($1)\n\n# In zsh<5.3, 'typeset -p arrayvar' emits two lines, so we use this wrapper instead.\ntypeset_p() {\n  for 1 ; do\n    if [[ ${(tP)1} == *array* ]]; then\n      print -r -- \"$1=( ${(@qqqqP)1} )\"\n    else\n      print -r -- \"$1=${(qqqqP)1}\"\n    fi\n  done\n}\n\n# Escape # as ♯ and newline as ↵ they are illegal in the 'description' part of TAP output\n# The string to escape is «\"$@\"»; the result is returned in $REPLY.\ntap_escape() {\n  local s=\"${(j. .)@}\"\n  REPLY=\"${${s//'#'/♯}//$'\\n'/↵}\"\n}\n\n# Runs a highlighting test\n# $1: data file\nrun_test_internal() {\n\n  local tests_tempdir=\"$1\"; shift\n  local srcdir=\"$PWD\"\n  builtin cd -q -- \"$tests_tempdir\" || { echo >&2 \"Bail out! On ${(qq)1}: cd failed: $?\"; return 1 }\n\n  # Load the data and prepare checking it.\n  local BUFFER CURSOR MARK PENDING PREBUFFER REGION_ACTIVE WIDGET REPLY skip_test fail_test unsorted=0\n  local expected_mismatch\n  local skip_mismatch\n  local -a expected_region_highlight region_highlight\n\n  local ARG=\"$1\"\n  local RETURN=\"\"\n  () {\n    setopt localoptions\n\n    # WARNING: The remainder of this anonymous function will run with the test's options in effect\n    if { ! . \"$srcdir\"/\"$ARG\" } || (( $#fail_test )); then\n      print -r -- \"1..1\"\n      print -r -- \"## ${ARG:t:r}\"\n      tap_escape $fail_test; fail_test=$REPLY\n      print -r -- \"not ok 1 - failed setup: $fail_test\"\n      return ${RETURN:=0}\n    fi\n\n    (( $#skip_test )) && {\n      print -r -- \"1..0 # SKIP $skip_test\"\n      print -r -- \"## ${ARG:t:r}\"\n      return ${RETURN:=0}\n    }\n\n    # Check the data declares $PREBUFFER or $BUFFER.\n    [[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 \"Bail out! On ${(qq)ARG}: Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank\"; return ${RETURN:=1}; }\n    [[ $PREBUFFER == (''|*$'\\n') ]] || { echo >&2 \"Bail out! On ${(qq)ARG}: PREBUFFER=${(qqqq)PREBUFFER} doesn't end with a newline\"; return ${RETURN:=1}; }\n\n    # Set sane defaults for ZLE variables\n    : ${CURSOR=$#BUFFER} ${PENDING=0} ${WIDGET=z-sy-h-test-harness-test-widget}\n\n    # Process the data.\n    _zsh_highlight\n  }; [[ -z $RETURN ]] || return $RETURN\n  unset ARG\n\n  integer print_expected_and_actual=0\n\n  if (( unsorted )); then\n    region_highlight=(\"${(@n)region_highlight}\")\n    expected_region_highlight=(\"${(@n)expected_region_highlight}\")\n  fi\n\n  # Print the plan line, and some comments for human readers\n  echo \"1..$(( $#expected_region_highlight + 1))\"\n  echo \"## ${1:t:r}\" # note: tests/edit-failed-tests looks for the \"##\" emitted by this line\n  [[ -n $PREBUFFER ]] && printf '# %s\\n' \"$(typeset_p PREBUFFER)\"\n  [[ -n $BUFFER ]] && printf '# %s\\n' \"$(typeset_p BUFFER)\"\n\n  local i\n  for ((i=1; i<=$#expected_region_highlight; i++)); do\n    local -a expected_highlight_zone; expected_highlight_zone=( ${(z)expected_region_highlight[i]} )\n    integer exp_start=$expected_highlight_zone[1] exp_end=$expected_highlight_zone[2]\n    local todo=\n    if (( $+expected_highlight_zone[4] )); then\n      todo=\"# TODO $expected_highlight_zone[4]\"\n      skip_mismatch=\"cardinality check disabled whilst regular test points are expected to fail\"\n    fi\n    if ! (( $+region_highlight[i] )); then\n      print -r -- \"not ok $i - unmatched expectation ($exp_start $exp_end $expected_highlight_zone[3])\" \\\n         \"${skip_mismatch:+\"# TODO ${(qqq)skip_mismatch}\"}\"\n      if [[ -z $skip_mismatch ]]; then (( ++print_expected_and_actual )); fi\n      continue\n    fi\n    local -a highlight_zone; highlight_zone=( ${(z)region_highlight[i]} )\n    integer start=$(( highlight_zone[1] + 1 )) end=$highlight_zone[2]\n    local desc=\"[$start,$end] «${BUFFER[$start,$end]}»\"\n    tap_escape $desc; desc=$REPLY\n    if\n      [[ $start != $exp_start ]] ||\n      [[ $end != $exp_end ]] ||\n      [[ ${highlight_zone[3]%,} != ${expected_highlight_zone[3]} ]] # remove the comma that's before the memo field\n    then\n      print -r -- \"not ok $i - $desc - expected ($exp_start $exp_end ${(qqq)expected_highlight_zone[3]}), observed ($start $end ${(qqq)highlight_zone[3]}). $todo\"\n      if [[ -z $todo ]]; then (( ++print_expected_and_actual )); fi\n    else\n      print -r -- \"ok $i - $desc${todo:+ - }$todo\"\n    fi\n    unset expected_highlight_zone\n    unset exp_start exp_end\n    unset todo\n    unset highlight_zone\n    unset start end\n    unset desc\n  done\n\n  # If both $skip_mismatch and $expected_mismatch are set, that means the test\n  # has some XFail test points, _and_ explicitly sets $expected_mismatch as\n  # well.  Explicit settings should have priority, so we ignore $skip_mismatch\n  # if $expected_mismatch is set.\n  if [[ -n $skip_mismatch && -z $expected_mismatch ]]; then\n    tap_escape $skip_mismatch; skip_mismatch=$REPLY\n    print \"ok $i - cardinality check\" \"# SKIP $skip_mismatch\"\n  else\n    local todo\n    if [[ -n $expected_mismatch ]]; then\n      tap_escape $expected_mismatch; expected_mismatch=$REPLY\n      todo=\"# TODO $expected_mismatch\"\n    fi\n    if (( $#expected_region_highlight == $#region_highlight )); then\n      print -r -- \"ok $i - cardinality check${todo:+ - }$todo\"\n    else\n      local details\n      details+=\"have $#expected_region_highlight expectations and $#region_highlight region_highlight entries: \"\n      details+=\"«$(typeset_p expected_region_highlight)» «$(typeset_p region_highlight)»\"\n      tap_escape $details; details=$REPLY\n      print -r -- \"not ok $i - cardinality check - $details${todo:+ - }$todo\"\n      if [[ -z $todo ]]; then (( ++print_expected_and_actual )); fi\n    fi\n  fi\n  if (( print_expected_and_actual )); then\n      () {\n        local -a left_column right_column\n        left_column=( \"expected_region_highlight\" \"${(qq)expected_region_highlight[@]}\" )\n        right_column=( \"region_highlight\" \"${(qq)region_highlight[@]}\" )\n        integer difference=$(( $#right_column - $#left_column ))\n        repeat $difference do left_column+=(.); done\n        paste \\\n          =(print -rC1 -- $left_column) \\\n          =(print -rC1 -- $right_column) \\\n          | if type column >/dev/null; then column -t -s $'\\t'; else cat; fi \\\n          | sed 's/^/# /'\n      }\n  fi\n}\n\n# Run a single test file.  The exit status is 1 if the test harness had\n# an error and 0 otherwise.  The exit status does not depend on whether\n# test points succeeded or failed.\nrun_test() {\n  # Do not combine the declaration and initialization: «local x=\"$(false)\"» does not set $?.\n  local __tests_tempdir\n  __tests_tempdir=\"$(mktemp -d)\" && [[ -d $__tests_tempdir ]] || {\n    echo >&2 \"Bail out! mktemp failed\"; return 1\n  }\n  typeset -r __tests_tempdir # don't allow tests to override the variable that we will 'rm -rf' later on\n\n  {\n    # Use a subshell to isolate tests from each other.\n    # (So tests can alter global shell state using 'cd', 'hash', etc)\n    {\n      # These braces are so multios don't come into play.\n      { (run_test_internal \"$__tests_tempdir\" \"$@\") 3>&1 >&2 2>&3 } | grep \\^\n      local ret=$pipestatus[1] stderr=$pipestatus[2]\n      if (( ! stderr )); then\n        # stdout will become stderr\n        echo \"Bail out! On ${(qq)1}: output on stderr\"; return 1\n      else\n        return $ret\n      fi\n    } 3>&1 >&2 2>&3\n  } always {\n    rm -rf -- \"$__tests_tempdir\"\n  }\n}\n\n# Process each test data file in test data directory.\ninteger something_failed=0\nZSH_HIGHLIGHT_STYLES=()\nlocal data_file\nfor data_file in $root/highlighters/$1/test-data/*.zsh; do\n  run_test \"$data_file\" | tee >($results_filter | $root/tests/tap-colorizer.zsh) | grep -v '^not ok.*# TODO' | grep -Eq '^not ok|^ok.*# TODO' && (( something_failed=1 ))\n  (( $pipestatus[1] )) && exit 2\ndone\n\nexit $something_failed\n}\n"
  },
  {
    "path": "tests/test-perfs.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n\n# Required for add-zle-hook-widget.\nzmodload zsh/zle\n\n# Check an highlighter was given as argument.\n[[ -n \"$1\" ]] || {\n  echo >&2 \"Bail out! You must provide the name of a valid highlighter as argument.\"\n  exit 2\n}\n\n# Check the highlighter is valid.\n[[ -f ${0:h:h}/highlighters/$1/$1-highlighter.zsh ]] || {\n  echo >&2 \"Bail out! Could not find highlighter ${(qq)1}.\"\n  exit 2\n}\n\n# Check the highlighter has test data.\n[[ -d ${0:h:h}/highlighters/$1/test-data ]] || {\n  echo >&2 \"Bail out! Highlighter ${(qq)1} has no test data.\"\n  exit 2\n}\n\n# Load the main script.\ntypeset -a region_highlight\n. ${0:h:h}/zsh-syntax-highlighting.zsh\n\n# Activate the highlighter.\nZSH_HIGHLIGHT_HIGHLIGHTERS=($1)\n\n# Runs a highlighting test\n# $1: data file\nrun_test_internal() {\n  local -a highlight_zone\n\n  local tests_tempdir=\"$1\"; shift\n  local srcdir=\"$PWD\"\n  builtin cd -q -- \"$tests_tempdir\" || { echo >&2 \"Bail out! cd failed: $?\"; return 1 }\n\n  # Load the data and prepare checking it.\n  PREBUFFER= BUFFER= ;\n  . \"$srcdir\"/\"$1\"\n\n  # Check the data declares $PREBUFFER or $BUFFER.\n  [[ -z $PREBUFFER && -z $BUFFER ]] && { echo >&2 \"Bail out! Either 'PREBUFFER' or 'BUFFER' must be declared and non-blank\"; return 1; }\n\n  # Set $? for _zsh_highlight\n  true && _zsh_highlight\n}\n\nrun_test() {\n  # Do not combine the declaration and initialization: «local x=\"$(false)\"» does not set $?.\n  local __tests_tempdir\n  __tests_tempdir=\"$(mktemp -d)\" && [[ -d $__tests_tempdir ]] || {\n    echo >&2 \"Bail out! mktemp failed\"; return 1\n  }\n  typeset -r __tests_tempdir # don't allow tests to override the variable that we will 'rm -rf' later on\n\n  {\n    (run_test_internal \"$__tests_tempdir\" \"$@\")\n  } always {\n    rm -rf -- \"$__tests_tempdir\"\n  }\n}\n\n# Process each test data file in test data directory.\nlocal data_file\nTIMEFMT=\"%*Es\"\n{ time (for data_file in ${0:h:h}/highlighters/$1/test-data/*.zsh; do\n  run_test \"$data_file\"\n  (( $pipestatus[1] )) && exit 2\ndone) } 2>&1 || exit $?\n\nexit 0\n"
  },
  {
    "path": "tests/test-zprof.zsh",
    "content": "#!/usr/bin/env zsh\n# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2015 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# Load the main script.\ntypeset -a region_highlight\n. ${0:h:h}/zsh-syntax-highlighting.zsh\n\n# Activate the highlighter.\nZSH_HIGHLIGHT_HIGHLIGHTERS=(main)\n\nsource_file=0.7.1:highlighters/$1/$1-highlighter.zsh\n\n# Runs a highlighting test\n# $1: data file\nrun_test_internal() {\n  setopt interactivecomments\n\n  local -a highlight_zone\n\n  local tests_tempdir=\"$1\"; shift\n  local srcdir=\"$PWD\"\n  builtin cd -q -- \"$tests_tempdir\" || { echo >&2 \"Bail out! cd failed: $?\"; return 1 }\n\n  # Load the data and prepare checking it.\n  PREBUFFER=\n  BUFFER=$(cd -- \"$srcdir\" && git cat-file blob $source_file)\n  expected_region_highlight=()\n\n  zmodload zsh/zprof\n  zprof -c\n  # Set $? for _zsh_highlight\n  true && _zsh_highlight\n  zprof\n}\n\nrun_test() {\n  # Do not combine the declaration and initialization: «local x=\"$(false)\"» does not set $?.\n  local __tests_tempdir\n  __tests_tempdir=\"$(mktemp -d)\" && [[ -d $__tests_tempdir ]] || {\n    echo >&2 \"Bail out! mktemp failed\"; return 1\n  }\n  typeset -r __tests_tempdir # don't allow tests to override the variable that we will 'rm -rf' later on\n\n  {\n    (run_test_internal \"$__tests_tempdir\" \"$@\")\n  } always {\n    rm -rf -- \"$__tests_tempdir\"\n  }\n}\n\nrun_test\n"
  },
  {
    "path": "zsh-syntax-highlighting.plugin.zsh",
    "content": "0=${(%):-%N}\nsource ${0:A:h}/zsh-syntax-highlighting.zsh\n"
  },
  {
    "path": "zsh-syntax-highlighting.zsh",
    "content": "# -------------------------------------------------------------------------------------------------\n# Copyright (c) 2010-2020 zsh-syntax-highlighting contributors\n# All rights reserved.\n#\n# Redistribution and use in source and binary forms, with or without modification, are permitted\n# provided that the following conditions are met:\n#\n#  * Redistributions of source code must retain the above copyright notice, this list of conditions\n#    and the following disclaimer.\n#  * Redistributions in binary form must reproduce the above copyright notice, this list of\n#    conditions and the following disclaimer in the documentation and/or other materials provided\n#    with the distribution.\n#  * Neither the name of the zsh-syntax-highlighting contributors nor the names of its contributors\n#    may be used to endorse or promote products derived from this software without specific prior\n#    written permission.\n#\n# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\n# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n# FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR\n# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\n# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\n# OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n# -------------------------------------------------------------------------------------------------\n# -*- mode: zsh; sh-indentation: 2; indent-tabs-mode: nil; sh-basic-offset: 2; -*-\n# vim: ft=zsh sw=2 ts=2 et\n# -------------------------------------------------------------------------------------------------\n\n# First of all, ensure predictable parsing.\ntypeset zsh_highlight__aliases=\"$(builtin alias -Lm '[^+]*')\"\n# In zsh <= 5.2, aliases that begin with a plus sign ('alias -- +foo=42')\n# are emitted by `alias -L` without a '--' guard, so they don't round trip.\n#\n# Hence, we exclude them from unaliasing:\nbuiltin unalias -m '[^+]*'\n\n# Set $0 to the expected value, regardless of functionargzero.\n0=${(%):-%N}\nif true; then\n  # $0 is reliable\n  typeset -g ZSH_HIGHLIGHT_VERSION=$(<\"${0:A:h}\"/.version)\n  typeset -g ZSH_HIGHLIGHT_REVISION=$(<\"${0:A:h}\"/.revision-hash)\n  if [[ $ZSH_HIGHLIGHT_REVISION == \\$Format:* ]]; then\n    # When running from a source tree without 'make install', $ZSH_HIGHLIGHT_REVISION\n    # would be set to '$Format:%H$' literally.  That's an invalid value, and obtaining\n    # the valid value (via `git rev-parse HEAD`, as Makefile does) might be costly, so:\n    ZSH_HIGHLIGHT_REVISION=HEAD\n  fi\nfi\n\n# This function takes a single argument F and returns True iff F is an autoload stub.\n_zsh_highlight__function_is_autoload_stub_p() {\n  if zmodload -e zsh/parameter; then\n    #(( ${+functions[$1]} )) &&\n    [[ \"$functions[$1]\" == *\"builtin autoload -X\"* ]]\n  else\n    #[[ $(type -wa -- \"$1\") == *'function'* ]] &&\n    [[ \"${${(@f)\"$(which -- \"$1\")\"}[2]}\" == $'\\t'$histchars[3]' undefined' ]]\n  fi\n  # Do nothing here: return the exit code of the if.\n}\n\n# Return True iff the argument denotes a function name.\n_zsh_highlight__is_function_p() {\n  if zmodload -e zsh/parameter; then\n    (( ${+functions[$1]} ))\n  else\n    [[ $(type -wa -- \"$1\") == *'function'* ]]\n  fi\n}\n\n# This function takes a single argument F and returns True iff F denotes the\n# name of a callable function.  A function is callable if it is fully defined\n# or if it is marked for autoloading and autoloading it at the first call to it\n# will succeed.  In particular, if F has been marked for autoloading\n# but is not available in $fpath, then calling this function on F will return False.\n#\n# See users/21671 https://www.zsh.org/cgi-bin/mla/redirect?USERNUMBER=21671\n_zsh_highlight__function_callable_p() {\n  if _zsh_highlight__is_function_p \"$1\" &&\n     ! _zsh_highlight__function_is_autoload_stub_p \"$1\"\n  then\n    # Already fully loaded.\n    return 0 # true\n  else\n    # \"$1\" is either an autoload stub, or not a function at all.\n    #\n    # Use a subshell to avoid affecting the calling shell.\n    #\n    # We expect 'autoload +X' to return non-zero if it fails to fully load\n    # the function.\n    ( autoload -U +X -- \"$1\" 2>/dev/null )\n    return $?\n  fi\n}\n\n# -------------------------------------------------------------------------------------------------\n# Core highlighting update system\n# -------------------------------------------------------------------------------------------------\n\n# Use workaround for bug in ZSH?\n# zsh-users/zsh@48cadf4 https://www.zsh.org/mla/workers/2017/msg00034.html\nautoload -Uz is-at-least\nif is-at-least 5.4; then\n  typeset -g zsh_highlight__pat_static_bug=false\nelse\n  typeset -g zsh_highlight__pat_static_bug=true\nfi\n\n# Array declaring active highlighters names.\ntypeset -ga ZSH_HIGHLIGHT_HIGHLIGHTERS\n\n# Update ZLE buffer syntax highlighting.\n#\n# Invokes each highlighter that needs updating.\n# This function is supposed to be called whenever the ZLE state changes.\n_zsh_highlight()\n{\n  # Store the previous command return code to restore it whatever happens.\n  local ret=$?\n  # Make it read-only.  Can't combine this with the previous line when POSIX_BUILTINS may be set.\n  typeset -r ret\n\n  # $region_highlight should be predefined, either by zle or by the test suite's mock (non-special) array.\n  (( ${+region_highlight[@]} )) || {\n    echo >&2 'zsh-syntax-highlighting: error: $region_highlight is not defined'\n    echo >&2 'zsh-syntax-highlighting: (Check whether zsh-syntax-highlighting was installed according to the instructions.)'\n    return $ret\n  }\n\n  # Probe the memo= feature, once.\n  (( ${+zsh_highlight__memo_feature} )) || {\n    region_highlight+=( \" 0 0 fg=red, memo=zsh-syntax-highlighting\" )\n    case ${region_highlight[-1]} in\n      (\"0 0 fg=red\")\n        # zsh 5.8 or earlier\n        integer -gr zsh_highlight__memo_feature=0\n        ;;\n      (\"0 0 fg=red memo=zsh-syntax-highlighting\")\n        # zsh 5.9 or later\n        integer -gr zsh_highlight__memo_feature=1\n        ;;\n      (\" 0 0 fg=red, memo=zsh-syntax-highlighting\") ;&\n      (*)\n        # We can get here in two ways:\n        #\n        # 1. When not running as a widget.  In that case, $region_highlight is\n        # not a special variable (= one with custom getter/setter functions\n        # written in C) but an ordinary one, so the third case pattern matches\n        # and we fall through to this block.  (The test suite uses this codepath.)\n        #\n        # 2. When running under a future version of zsh that will have changed\n        # the serialization of $region_highlight elements from their underlying\n        # C structs, so that none of the previous case patterns will match.\n        #\n        # In either case, fall back to a version check.\n        if is-at-least 5.9; then\n          integer -gr zsh_highlight__memo_feature=1\n        else\n          integer -gr zsh_highlight__memo_feature=0\n        fi\n        ;;\n    esac\n    region_highlight[-1]=()\n  }\n\n  # Reset region_highlight to build it from scratch\n  if (( zsh_highlight__memo_feature )); then\n    region_highlight=( \"${(@)region_highlight:#*memo=zsh-syntax-highlighting*}\" )\n  else\n    # Legacy codepath.  Not very interoperable with other plugins (issue #418).\n    region_highlight=()\n  fi\n\n  # Remove all highlighting in isearch, so that only the underlining done by zsh itself remains.\n  # For details see FAQ entry 'Why does syntax highlighting not work while searching history?'.\n  # This disables highlighting during isearch (for reasons explained in README.md) unless zsh is new enough\n  # and doesn't have the pattern matching bug\n  if [[ $WIDGET == zle-isearch-update ]] && { $zsh_highlight__pat_static_bug || ! (( $+ISEARCHMATCH_ACTIVE )) }; then\n    return $ret\n  fi\n\n  # Before we 'emulate -L', save the user's options\n  local -A zsyh_user_options\n  if zmodload -e zsh/parameter; then\n    zsyh_user_options=(\"${(kv)options[@]}\")\n  else\n    local canonical_options onoff option raw_options\n    raw_options=(${(f)\"$(emulate -R zsh; set -o)\"})\n    canonical_options=(${${${(M)raw_options:#*off}%% *}#no} ${${(M)raw_options:#*on}%% *})\n    for option in \"${canonical_options[@]}\"; do\n      [[ -o $option ]]\n      case $? in\n        (0) zsyh_user_options+=($option on);;\n        (1) zsyh_user_options+=($option off);;\n        (*) # Can't happen, surely?\n            echo \"zsh-syntax-highlighting: warning: '[[ -o $option ]]' returned $?\"\n            ;;\n      esac\n    done\n  fi\n  typeset -r zsyh_user_options\n\n  emulate -L zsh\n  setopt localoptions warncreateglobal nobashrematch\n  local REPLY # don't leak $REPLY into global scope\n\n  # Do not highlight if there are more than 300 chars in the buffer. It's most\n  # likely a pasted command or a huge list of files in that case..\n  [[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret\n\n  # Do not highlight if there are pending inputs (copy/paste).\n  (( KEYS_QUEUED_COUNT > 0 )) && return $ret\n  (( PENDING > 0 )) && return $ret\n\n  {\n    local cache_place\n    local -a region_highlight_copy\n\n    # Select which highlighters in ZSH_HIGHLIGHT_HIGHLIGHTERS need to be invoked.\n    local highlighter; for highlighter in $ZSH_HIGHLIGHT_HIGHLIGHTERS; do\n\n      # eval cache place for current highlighter and prepare it\n      cache_place=\"_zsh_highlight__highlighter_${highlighter}_cache\"\n      typeset -ga ${cache_place}\n\n      # If highlighter needs to be invoked\n      if ! type \"_zsh_highlight_highlighter_${highlighter}_predicate\" >&/dev/null; then\n        echo \"zsh-syntax-highlighting: warning: disabling the ${(qq)highlighter} highlighter as it has not been loaded\" >&2\n        # TODO: use ${(b)} rather than ${(q)} if supported\n        ZSH_HIGHLIGHT_HIGHLIGHTERS=( ${ZSH_HIGHLIGHT_HIGHLIGHTERS:#${highlighter}} )\n      elif \"_zsh_highlight_highlighter_${highlighter}_predicate\"; then\n\n        # save a copy, and cleanup region_highlight\n        region_highlight_copy=(\"${region_highlight[@]}\")\n        region_highlight=()\n\n        # Execute highlighter and save result\n        {\n          \"_zsh_highlight_highlighter_${highlighter}_paint\"\n        } always {\n          : ${(AP)cache_place::=\"${region_highlight[@]}\"}\n        }\n\n        # Restore saved region_highlight\n        region_highlight=(\"${region_highlight_copy[@]}\")\n\n      fi\n\n      # Use value form cache if any cached\n      region_highlight+=(\"${(@P)cache_place}\")\n\n    done\n\n    # Re-apply zle_highlight settings\n\n    # region\n    () {\n      (( REGION_ACTIVE )) || return\n      integer min max\n      if (( MARK > CURSOR )) ; then\n        min=$CURSOR max=$MARK\n      else\n        min=$MARK max=$CURSOR\n      fi\n      if (( REGION_ACTIVE == 1 )); then\n        [[ $KEYMAP = vicmd ]] && (( max++ ))\n      elif (( REGION_ACTIVE == 2 )); then\n        local needle=$'\\n'\n        # CURSOR and MARK are 0 indexed between letters like region_highlight\n        # Do not include the newline in the highlight\n        (( min = ${BUFFER[(Ib:min:)$needle]} ))\n        (( max = ${BUFFER[(ib:max:)$needle]} - 1 ))\n      fi\n      _zsh_highlight_apply_zle_highlight region standout \"$min\" \"$max\"\n    }\n\n    # yank / paste (zsh-5.1.1 and newer)\n    (( $+YANK_ACTIVE )) && (( YANK_ACTIVE )) && _zsh_highlight_apply_zle_highlight paste standout \"$YANK_START\" \"$YANK_END\"\n\n    # isearch\n    (( $+ISEARCHMATCH_ACTIVE )) && (( ISEARCHMATCH_ACTIVE )) && _zsh_highlight_apply_zle_highlight isearch underline \"$ISEARCHMATCH_START\" \"$ISEARCHMATCH_END\"\n\n    # suffix\n    (( $+SUFFIX_ACTIVE )) && (( SUFFIX_ACTIVE )) && _zsh_highlight_apply_zle_highlight suffix bold \"$SUFFIX_START\" \"$SUFFIX_END\"\n\n\n    return $ret\n\n\n  } always {\n    typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER=\"$BUFFER\"\n    typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR=$CURSOR\n  }\n}\n\n# Apply highlighting based on entries in the zle_highlight array.\n# This function takes four arguments:\n# 1. The exact entry (no patterns) in the zle_highlight array:\n#    region, paste, isearch, or suffix\n# 2. The default highlighting that should be applied if the entry is unset\n# 3. and 4. Two integer values describing the beginning and end of the\n#    range. The order does not matter.\n_zsh_highlight_apply_zle_highlight() {\n  local entry=\"$1\" default=\"$2\"\n  integer first=\"$3\" second=\"$4\"\n\n  # read the relevant entry from zle_highlight\n  #\n  # ### In zsh≥5.0.8 we'd use ${(b)entry}, but we support older zsh's, so we don't\n  # ### add (b).  The only effect is on the failure mode for callers that violate\n  # ### the precondition.\n  local region=\"${zle_highlight[(r)${entry}:*]-}\"\n\n  if [[ -z \"$region\" ]]; then\n    # entry not specified at all, use default value\n    region=$default\n  else\n    # strip prefix\n    region=\"${region#${entry}:}\"\n\n    # no highlighting when set to the empty string or to 'none'\n    if [[ -z \"$region\" ]] || [[ \"$region\" == none ]]; then\n      return\n    fi\n  fi\n\n  integer start end\n  if (( first < second )); then\n    start=$first end=$second\n  else\n    start=$second end=$first\n  fi\n  region_highlight+=(\"$start $end $region, memo=zsh-syntax-highlighting\")\n}\n\n\n# -------------------------------------------------------------------------------------------------\n# API/utility functions for highlighters\n# -------------------------------------------------------------------------------------------------\n\n# Array used by highlighters to declare user overridable styles.\ntypeset -gA ZSH_HIGHLIGHT_STYLES\n\n# Whether the command line buffer has been modified or not.\n#\n# Returns 0 if the buffer has changed since _zsh_highlight was last called.\n_zsh_highlight_buffer_modified()\n{\n  [[ \"${_ZSH_HIGHLIGHT_PRIOR_BUFFER:-}\" != \"$BUFFER\" ]]\n}\n\n# Whether the cursor has moved or not.\n#\n# Returns 0 if the cursor has moved since _zsh_highlight was last called.\n_zsh_highlight_cursor_moved()\n{\n  [[ -n $CURSOR ]] && [[ -n ${_ZSH_HIGHLIGHT_PRIOR_CURSOR-} ]] && (($_ZSH_HIGHLIGHT_PRIOR_CURSOR != $CURSOR))\n}\n\n# Add a highlight defined by ZSH_HIGHLIGHT_STYLES.\n#\n# Should be used by all highlighters aside from 'pattern' (cf. ZSH_HIGHLIGHT_PATTERN).\n# Overwritten in tests/test-highlighting.zsh when testing.\n_zsh_highlight_add_highlight()\n{\n  local -i start end\n  local highlight\n  start=$1\n  end=$2\n  shift 2\n  for highlight; do\n    if (( $+ZSH_HIGHLIGHT_STYLES[$highlight] )); then\n      region_highlight+=(\"$start $end $ZSH_HIGHLIGHT_STYLES[$highlight], memo=zsh-syntax-highlighting\")\n      break\n    fi\n  done\n}\n\n# -------------------------------------------------------------------------------------------------\n# Setup functions\n# -------------------------------------------------------------------------------------------------\n\n# Helper for _zsh_highlight_bind_widgets\n# $1 is name of widget to call\n_zsh_highlight_call_widget()\n{\n  builtin zle \"$@\" &&\n  _zsh_highlight\n}\n\n# Decide whether to use the zle-line-pre-redraw codepath (colloquially known as\n# \"feature/redrawhook\", after the topic branch's name) or the legacy \"bind all\n# widgets\" codepath.\n#\n# We use the new codepath under two conditions:\n#\n# 1. If it's available, which we check by testing for add-zle-hook-widget's availability.\n# \n# 2. If zsh has the memo= feature, which is required for interoperability reasons.\n#    See issues #579 and #735, and the issues referenced from them.\n#\n#    We check this with a plain version number check, since a functional check,\n#    as done by _zsh_highlight, can only be done from inside a widget\n#    function — a catch-22.\nif is-at-least 5.9 && _zsh_highlight__function_callable_p add-zle-hook-widget\nthen\n  autoload -U add-zle-hook-widget\n  _zsh_highlight__zle-line-finish() {\n    # Reset $WIDGET since the 'main' highlighter depends on it.\n    #\n    # Since $WIDGET is declared by zle as read-only in this function's scope,\n    # a nested function is required in order to shadow its built-in value;\n    # see \"User-defined widgets\" in zshall.\n    () {\n      local -h -r WIDGET=zle-line-finish\n      _zsh_highlight\n    }\n  }\n  _zsh_highlight__zle-line-pre-redraw() {\n    # Set $? to 0 for _zsh_highlight.  Without this, subsequent\n    # zle-line-pre-redraw hooks won't run, since add-zle-hook-widget happens to\n    # call us with $? == 1 in the common case.\n    true && _zsh_highlight \"$@\"\n  }\n  _zsh_highlight_bind_widgets(){}\n  if [[ -o zle ]]; then\n    add-zle-hook-widget zle-line-pre-redraw _zsh_highlight__zle-line-pre-redraw\n    add-zle-hook-widget zle-line-finish _zsh_highlight__zle-line-finish\n  fi\nelse\n  # Rebind all ZLE widgets to make them invoke _zsh_highlights.\n  _zsh_highlight_bind_widgets()\n  {\n    setopt localoptions noksharrays\n    typeset -F SECONDS\n    local prefix=orig-s$SECONDS-r$RANDOM # unique each time, in case we're sourced more than once\n\n    # Load ZSH module zsh/zleparameter, needed to override user defined widgets.\n    zmodload zsh/zleparameter 2>/dev/null || {\n      print -r -- >&2 'zsh-syntax-highlighting: failed loading zsh/zleparameter.'\n      return 1\n    }\n\n    # Override ZLE widgets to make them invoke _zsh_highlight.\n    local -U widgets_to_bind\n    widgets_to_bind=(${${(k)widgets}:#(.*|run-help|which-command|beep|set-local-history|yank|yank-pop)})\n\n    # Always wrap special zle-line-finish widget. This is needed to decide if the\n    # current line ends and special highlighting logic needs to be applied.\n    # E.g. remove cursor imprint, don't highlight partial paths, ...\n    widgets_to_bind+=(zle-line-finish)\n\n    # Always wrap special zle-isearch-update widget to be notified of updates in isearch.\n    # This is needed because we need to disable highlighting in that case.\n    widgets_to_bind+=(zle-isearch-update)\n\n    local cur_widget\n    for cur_widget in $widgets_to_bind; do\n      case ${widgets[$cur_widget]:-\"\"} in\n\n        # Already rebound event: do nothing.\n        user:_zsh_highlight_widget_*);;\n\n        # The \"eval\"'s are required to make $cur_widget a closure: the value of the parameter at function\n        # definition time is used.\n        #\n        # We can't use ${0/_zsh_highlight_widget_} because these widgets are always invoked with\n        # NO_function_argzero, regardless of the option's setting here.\n\n        # User defined widget: override and rebind old one with prefix \"orig-\".\n        user:*) zle -N $prefix-$cur_widget ${widgets[$cur_widget]#*:}\n                eval \"_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget ${(q)prefix}-${(q)cur_widget} -- \\\"\\$@\\\" }\"\n                zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;;\n\n        # Completion widget: override and rebind old one with prefix \"orig-\".\n        completion:*) zle -C $prefix-$cur_widget ${${(s.:.)widgets[$cur_widget]}[2,3]}\n                      eval \"_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget ${(q)prefix}-${(q)cur_widget} -- \\\"\\$@\\\" }\"\n                      zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;;\n\n        # Builtin widget: override and make it call the builtin \".widget\".\n        builtin) eval \"_zsh_highlight_widget_${(q)prefix}-${(q)cur_widget}() { _zsh_highlight_call_widget .${(q)cur_widget} -- \\\"\\$@\\\" }\"\n                 zle -N $cur_widget _zsh_highlight_widget_$prefix-$cur_widget;;\n\n        # Incomplete or nonexistent widget: Bind to z-sy-h directly.\n        *)\n           if [[ $cur_widget == zle-* ]] && (( ! ${+widgets[$cur_widget]} )); then\n             _zsh_highlight_widget_${cur_widget}() { :; _zsh_highlight }\n             zle -N $cur_widget _zsh_highlight_widget_$cur_widget\n           else\n        # Default: unhandled case.\n             print -r -- >&2 \"zsh-syntax-highlighting: unhandled ZLE widget ${(qq)cur_widget}\"\n             print -r -- >&2 \"zsh-syntax-highlighting: (This is sometimes caused by doing \\`bindkey <keys> ${(q-)cur_widget}\\` without creating the ${(qq)cur_widget} widget with \\`zle -N\\` or \\`zle -C\\`.)\"\n           fi\n      esac\n    done\n  }\nfi\n\n# Load highlighters from directory.\n#\n# Arguments:\n#   1) Path to the highlighters directory.\n_zsh_highlight_load_highlighters()\n{\n  setopt localoptions noksharrays bareglobqual\n\n  # Check the directory exists.\n  [[ -d \"$1\" ]] || {\n    print -r -- >&2 \"zsh-syntax-highlighting: highlighters directory ${(qq)1} not found.\"\n    return 1\n  }\n\n  # Load highlighters from highlighters directory and check they define required functions.\n  local highlighter highlighter_dir\n  for highlighter_dir ($1/*/(/)); do\n    highlighter=\"${highlighter_dir:t}\"\n    [[ -f \"$highlighter_dir${highlighter}-highlighter.zsh\" ]] &&\n      . \"$highlighter_dir${highlighter}-highlighter.zsh\"\n    if type \"_zsh_highlight_highlighter_${highlighter}_paint\" &> /dev/null &&\n       type \"_zsh_highlight_highlighter_${highlighter}_predicate\" &> /dev/null;\n    then\n        # New (0.5.0) function names\n    elif type \"_zsh_highlight_${highlighter}_highlighter\" &> /dev/null &&\n         type \"_zsh_highlight_${highlighter}_highlighter_predicate\" &> /dev/null;\n    then\n        # Old (0.4.x) function names\n        if false; then\n            # TODO: only show this warning for plugin authors/maintainers, not for end users\n            print -r -- >&2 \"zsh-syntax-highlighting: warning: ${(qq)highlighter} highlighter uses deprecated entry point names; please ask its maintainer to update it: https://github.com/zsh-users/zsh-syntax-highlighting/issues/329\"\n        fi\n        # Make it work.\n        eval \"_zsh_highlight_highlighter_${(q)highlighter}_paint() { _zsh_highlight_${(q)highlighter}_highlighter \\\"\\$@\\\" }\"\n        eval \"_zsh_highlight_highlighter_${(q)highlighter}_predicate() { _zsh_highlight_${(q)highlighter}_highlighter_predicate \\\"\\$@\\\" }\"\n    else\n        print -r -- >&2 \"zsh-syntax-highlighting: ${(qq)highlighter} highlighter should define both required functions '_zsh_highlight_highlighter_${highlighter}_paint' and '_zsh_highlight_highlighter_${highlighter}_predicate' in ${(qq):-\"$highlighter_dir${highlighter}-highlighter.zsh\"}.\"\n    fi\n  done\n}\n\n\n# -------------------------------------------------------------------------------------------------\n# Setup\n# -------------------------------------------------------------------------------------------------\n\n# Try binding widgets.\n_zsh_highlight_bind_widgets || {\n  print -r -- >&2 'zsh-syntax-highlighting: failed binding ZLE widgets, exiting.'\n  return 1\n}\n\n# Resolve highlighters directory location.\n_zsh_highlight_load_highlighters \"${ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR:-${${0:A}:h}/highlighters}\" || {\n  print -r -- >&2 'zsh-syntax-highlighting: failed loading highlighters, exiting.'\n  return 1\n}\n\n# Reset scratch variables when commandline is done.\n_zsh_highlight_preexec_hook()\n{\n  typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER=\n  typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR=\n}\nautoload -Uz add-zsh-hook\nadd-zsh-hook preexec _zsh_highlight_preexec_hook 2>/dev/null || {\n    print -r -- >&2 'zsh-syntax-highlighting: failed loading add-zsh-hook.'\n  }\n\n# Load zsh/parameter module if available\nzmodload zsh/parameter 2>/dev/null || true\n\n# Initialize the array of active highlighters if needed.\n[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main)\n\nif (( $+X_ZSH_HIGHLIGHT_DIRS_BLACKLIST )); then\n  print >&2 'zsh-syntax-highlighting: X_ZSH_HIGHLIGHT_DIRS_BLACKLIST is deprecated. Please use ZSH_HIGHLIGHT_DIRS_BLACKLIST.'\n  ZSH_HIGHLIGHT_DIRS_BLACKLIST=($X_ZSH_HIGHLIGHT_DIRS_BLACKLIST)\n  unset X_ZSH_HIGHLIGHT_DIRS_BLACKLIST\nfi\n\n# Restore the aliases we unned\neval \"$zsh_highlight__aliases\"\nbuiltin unset zsh_highlight__aliases\n\n# Set $?.\ntrue\n"
  }
]