on master help sign in
.github/.codecov.ymlnew file+1
since splitsnapshots
unifiedsplit
@@ -0,0 +1 @@
1+comment: false
.github/FUNDING.ymlnew file+1
@@ -0,0 +1 @@
1+github: [sharkdp, keith-hall, Enselic]
.github/ISSUE_TEMPLATE/bug_report.md+40−15
@@ -8,32 +8,57 @@ assignees: ''
8---
8---
9
9
10<!--
10<!--
11−Hey there, thanks for creating an issue!
12
11
13−In order to reproduce your issue, we might need to know a little bit more about the environment
12+Hey there, thank you for reporting a bug!
14−which you're running `bat` on.
15
13
16−If you're on Linux or MacOS:
14+Please note that the following bugs have already been reported:
15+
16+* dpkg: error processing archive /some/path/some-program.deb (--unpack):
17+ trying to overwrite '/usr/.crates2.json'
18+
17− Please run the script at https://github.com/sharkdp/bat/blob/master/diagnostics/info.sh and
19+ See https://github.com/sharkdp/bat/issues/938
18− paste the output at the bottom of the bug report.
19
20
20−If you're on Windows:
21− Please tell us about your Windows Version (e.g. "Windows 10 1908") at the
22− bottom of the bug report.
23-->
21-->
24
22
25−**What version of `bat` are you using?**
23+**What steps will reproduce the bug?**
26−[paste the output of `bat --version` here]
24+
25+1. step 1
26+2. step 2
27+3. ...
28+
29+**What happens?**
27
30
28−**Describe the bug you encountered:**
29...
31...
30
32
31−**Describe what you expected to happen?**
33+**What did you expect to happen instead?**
34+
32...
35...
33
36
37+
34**How did you install `bat`?**
38**How did you install `bat`?**
39+
35−apt-get, homebrew, GitHub release, etc.
40+<!-- apt-get, homebrew, GitHub release, etc. -->
36
41
37---
42---
38
43
39−[paste the output of `info.sh` here]
44+**bat version and environment**
45+
46+<!--
47+In order to reproduce your issue, please add some information about the environment
48+in which you're running bat. To do this, run the full `bat` command that demonstrates
49+the bug, and attach the `--diagnostic` option:
50+
51+ bat [other options and arguments…] --diagnostic
52+
53+Finally, paste the Markdown output here. Please make sure that it does not reveal any
54+personal information.
55+
56+
57+If you are running bat 0.17.1 or older (where --diagnostic is not available), please
58+run the script at
59+
60+ https://github.com/sharkdp/bat/blob/master/diagnostics/info.sh
61+
62+(click "Raw" to get the actual source code) and paste the Markdown output here. If you
63+are on Windows, please let us know your bat version and your Windows version.
64+-->
.github/ISSUE_TEMPLATE/config.yml−1
@@ -1,2 +1 @@
1blank_issues_enabled: true
1blank_issues_enabled: true
2−
.github/ISSUE_TEMPLATE/feature_request.md−1
@@ -7,4 +7,3 @@ assignees: ''
7
7
8---
8---
9
9
10−
.github/ISSUE_TEMPLATE/question.md+2−1
@@ -7,4 +7,5 @@ assignees: ''
7
7
8---
8---
9
9
10−
10+<!-- Using a normal ticket is still fine, but feel free to ask your
11+questions about bat on https://github.com/sharkdp/bat/discussions instead. -->
.github/dependabot.ymlnew file+18
@@ -0,0 +1,18 @@
1+version: 2
2+updates:
3+- package-ecosystem: cargo
4+ directory: "/"
5+ schedule:
6+ interval: monthly
7+ time: "04:00"
8+ timezone: Europe/Berlin
9+ ignore:
10+ - dependency-name: git2
11+ versions:
12+ - 0.13.17
13+- package-ecosystem: gitsubmodule
14+ directory: "/"
15+ schedule:
16+ interval: monthly
17+ time: "04:00"
18+ timezone: Europe/Berlin
.github/workflows/CICD.ymlnew file+482
@@ -0,0 +1,482 @@
1+name: CICD
2+
3+env:
4+ MIN_SUPPORTED_RUST_VERSION: "1.51.0"
5+ CICD_INTERMEDIATES_DIR: "_cicd-intermediates"
6+
7+on:
8+ workflow_dispatch:
9+ pull_request:
10+ push:
11+ branches:
12+ - master
13+ tags:
14+ - '*'
15+
16+jobs:
17+ ensure_cargo_fmt:
18+ name: Ensure 'cargo fmt' has been run
19+ runs-on: ubuntu-20.04
20+ steps:
21+ - uses: actions-rs/toolchain@v1
22+ with:
23+ toolchain: stable
24+ default: true
25+ profile: minimal
26+ components: rustfmt
27+ - uses: actions/checkout@v2
28+ - run: cargo fmt -- --check
29+
30+ license_checks:
31+ name: License checks
32+ runs-on: ubuntu-20.04
33+ steps:
34+ - uses: actions/checkout@v2
35+ with:
36+ submodules: true # we especially want to perform license checks on submodules
37+ - run: tests/scripts/license-checks.sh
38+
39+ min_version:
40+ name: Minimum supported rust version
41+ runs-on: ubuntu-20.04
42+ steps:
43+ - name: Checkout source code
44+ uses: actions/checkout@v2
45+
46+ - name: Install rust toolchain (v${{ env.MIN_SUPPORTED_RUST_VERSION }})
47+ uses: actions-rs/toolchain@v1
48+ with:
49+ toolchain: ${{ env.MIN_SUPPORTED_RUST_VERSION }}
50+ default: true
51+ profile: minimal # minimal component installation (ie, no documentation)
52+ components: clippy
53+ - name: Run clippy (on minimum supported rust version to prevent warnings we can't fix)
54+ uses: actions-rs/cargo@v1
55+ with:
56+ command: clippy
57+ args: --locked --all-targets --all-features
58+ - name: Run tests
59+ uses: actions-rs/cargo@v1
60+ with:
61+ command: test
62+ args: --locked
63+
64+ test_with_new_syntaxes_and_themes:
65+ name: Run tests with updated syntaxes and themes
66+ runs-on: ubuntu-20.04
67+ steps:
68+ - name: Git checkout
69+ uses: actions/checkout@v2
70+ with:
71+ submodules: true # we need all syntax and theme submodules
72+ - name: Install Rust toolchain
73+ uses: actions-rs/toolchain@v1
74+ with:
75+ toolchain: stable
76+ default: true
77+ profile: minimal
78+ - name: Build and install bat
79+ uses: actions-rs/cargo@v1
80+ with:
81+ command: install
82+ args: --locked --path .
83+ - name: Rebuild binary assets (syntaxes and themes)
84+ run: bash assets/create.sh
85+ - name: Build and install bat with updated assets
86+ uses: actions-rs/cargo@v1
87+ with:
88+ command: install
89+ args: --locked --path .
90+ - name: Run unit tests with new syntaxes and themes
91+ uses: actions-rs/cargo@v1
92+ with:
93+ command: test
94+ args: --locked --release
95+ - name: Run ignored-by-default unit tests with new syntaxes and themes
96+ uses: actions-rs/cargo@v1
97+ with:
98+ command: test
99+ args: --locked --release -- --ignored
100+ - name: Syntax highlighting regression test
101+ run: tests/syntax-tests/regression_test.sh
102+ - name: List of languages
103+ run: bat --list-languages
104+ - name: List of themes
105+ run: bat --list-themes
106+ - name: Test custom assets
107+ run: tests/syntax-tests/test_custom_assets.sh
108+
109+ documentation:
110+ name: Documentation
111+ runs-on: ubuntu-20.04
112+ steps:
113+ - name: Git checkout
114+ uses: actions/checkout@v2
115+ - name: Install Rust toolchain
116+ uses: actions-rs/toolchain@v1
117+ with:
118+ toolchain: stable
119+ default: true
120+ profile: minimal
121+ - name: Print -h
122+ uses: actions-rs/cargo@v1
123+ with:
124+ command: run
125+ args: --locked -- -h
126+ - name: Print --help
127+ uses: actions-rs/cargo@v1
128+ with:
129+ command: run
130+ args: --locked -- --help
131+ - name: Show man page
132+ run: man $(find . -name bat.1)
133+ - name: Check documentation
134+ env:
135+ RUSTDOCFLAGS: -D warnings
136+ uses: actions-rs/cargo@v1
137+ with:
138+ command: doc
139+ args: --locked --no-deps --document-private-items --all-features
140+
141+ build:
142+ name: ${{ matrix.job.target }} (${{ matrix.job.os }})
143+ runs-on: ${{ matrix.job.os }}
144+ strategy:
145+ fail-fast: false
146+ matrix:
147+ job:
148+ - { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
149+ - { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, use-cross: true }
150+ - { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, use-cross: true }
151+ - { target: i686-pc-windows-msvc , os: windows-2019 }
152+ - { target: i686-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
153+ - { target: i686-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
154+ - { target: x86_64-apple-darwin , os: macos-10.15 }
155+ - { target: x86_64-pc-windows-gnu , os: windows-2019 }
156+ - { target: x86_64-pc-windows-msvc , os: windows-2019 }
157+ - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
158+ - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
159+ steps:
160+ - name: Checkout source code
161+ uses: actions/checkout@v2
162+
163+ - name: Install prerequisites
164+ shell: bash
165+ run: |
166+ case ${{ matrix.job.target }} in
167+ arm-unknown-linux-*) sudo apt-get -y update ; sudo apt-get -y install gcc-arm-linux-gnueabihf ;;
168+ aarch64-unknown-linux-gnu) sudo apt-get -y update ; sudo apt-get -y install gcc-aarch64-linux-gnu ;;
169+ esac
170+
171+ - name: Extract crate information
172+ shell: bash
173+ run: |
174+ echo "PROJECT_NAME=$(sed -n 's/^name = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
175+ echo "PROJECT_VERSION=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -n1)" >> $GITHUB_ENV
176+ echo "PROJECT_MAINTAINER=$(sed -n 's/^authors = \["\(.*\)"\]/\1/p' Cargo.toml)" >> $GITHUB_ENV
177+ echo "PROJECT_HOMEPAGE=$(sed -n 's/^homepage = "\(.*\)"/\1/p' Cargo.toml)" >> $GITHUB_ENV
178+
179+ - name: Install Rust toolchain
180+ uses: actions-rs/toolchain@v1
181+ with:
182+ toolchain: stable
183+ target: ${{ matrix.job.target }}
184+ override: true
185+ profile: minimal # minimal component installation (ie, no documentation)
186+
187+ - name: Show version information (Rust, cargo, GCC)
188+ shell: bash
189+ run: |
190+ gcc --version || true
191+ rustup -V
192+ rustup toolchain list
193+ rustup default
194+ cargo -V
195+ rustc -V
196+
197+ - name: Build
198+ uses: actions-rs/cargo@v1
199+ with:
200+ use-cross: ${{ matrix.job.use-cross }}
201+ command: build
202+ args: --locked --release --target=${{ matrix.job.target }}
203+
204+ - name: Strip debug information from executable
205+ id: strip
206+ shell: bash
207+ run: |
208+ # Figure out suffix of binary
209+ EXE_suffix=""
210+ case ${{ matrix.job.target }} in
211+ *-pc-windows-*) EXE_suffix=".exe" ;;
212+ esac;
213+
214+ # Figure out what strip tool to use if any
215+ STRIP="strip"
216+ case ${{ matrix.job.target }} in
217+ arm-unknown-linux-*) STRIP="arm-linux-gnueabihf-strip" ;;
218+ aarch64-unknown-linux-gnu) STRIP="aarch64-linux-gnu-strip" ;;
219+ *-pc-windows-msvc) STRIP="" ;;
220+ esac;
221+
222+ # Setup paths
223+ BIN_DIR="${{ env.CICD_INTERMEDIATES_DIR }}/stripped-release-bin/"
224+ mkdir -p "${BIN_DIR}"
225+ BIN_NAME="${{ env.PROJECT_NAME }}${EXE_suffix}"
226+ BIN_PATH="${BIN_DIR}/${BIN_NAME}"
227+
228+ # Copy the release build binary to the result location
229+ cp "target/${{ matrix.job.target }}/release/${BIN_NAME}" "${BIN_DIR}"
230+
231+ # Also strip if possible
232+ if [ -n "${STRIP}" ]; then
233+ "${STRIP}" "${BIN_PATH}"
234+ fi
235+
236+ # Let subsequent steps know where to find the (stripped) bin
237+ echo ::set-output name=BIN_PATH::${BIN_PATH}
238+ echo ::set-output name=BIN_NAME::${BIN_NAME}
239+
240+ - name: Set testing options
241+ id: test-options
242+ shell: bash
243+ run: |
244+ # test only library unit tests and binary for arm-type targets
245+ unset CARGO_TEST_OPTIONS
246+ unset CARGO_TEST_OPTIONS ; case ${{ matrix.job.target }} in arm-* | aarch64-*) CARGO_TEST_OPTIONS="--lib --bin ${PROJECT_NAME}" ;; esac;
247+ echo ::set-output name=CARGO_TEST_OPTIONS::${CARGO_TEST_OPTIONS}
248+
249+ - name: Run tests
250+ uses: actions-rs/cargo@v1
251+ with:
252+ use-cross: ${{ matrix.job.use-cross }}
253+ command: test
254+ args: --locked --target=${{ matrix.job.target }} ${{ steps.test-options.outputs.CARGO_TEST_OPTIONS}}
255+
256+ - name: Run bat
257+ uses: actions-rs/cargo@v1
258+ with:
259+ use-cross: ${{ matrix.job.use-cross }}
260+ command: run
261+ args: --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs
262+
263+ - name: Show diagnostics (bat --diagnostic)
264+ uses: actions-rs/cargo@v1
265+ with:
266+ use-cross: ${{ matrix.job.use-cross }}
267+ command: run
268+ args: --locked --target=${{ matrix.job.target }} -- --paging=never --color=always --theme=ansi Cargo.toml src/config.rs --diagnostic
269+
270+ - name: "Feature check: regex-onig"
271+ uses: actions-rs/cargo@v1
272+ with:
273+ use-cross: ${{ matrix.job.use-cross }}
274+ command: check
275+ args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig
276+
277+ - name: "Feature check: regex-onig,git"
278+ uses: actions-rs/cargo@v1
279+ with:
280+ use-cross: ${{ matrix.job.use-cross }}
281+ command: check
282+ args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git
283+
284+ - name: "Feature check: regex-onig,paging"
285+ uses: actions-rs/cargo@v1
286+ with:
287+ use-cross: ${{ matrix.job.use-cross }}
288+ command: check
289+ args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,paging
290+
291+ - name: "Feature check: regex-onig,git,paging"
292+ uses: actions-rs/cargo@v1
293+ with:
294+ use-cross: ${{ matrix.job.use-cross }}
295+ command: check
296+ args: --locked --target=${{ matrix.job.target }} --verbose --lib --no-default-features --features regex-onig,git,paging
297+
298+ - name: "Feature check: minimal-application"
299+ uses: actions-rs/cargo@v1
300+ with:
301+ use-cross: ${{ matrix.job.use-cross }}
302+ command: check
303+ args: --locked --target=${{ matrix.job.target }} --verbose --no-default-features --features minimal-application
304+
305+ - name: Create tarball
306+ id: package
307+ shell: bash
308+ run: |
309+ PKG_suffix=".tar.gz" ; case ${{ matrix.job.target }} in *-pc-windows-*) PKG_suffix=".zip" ;; esac;
310+ PKG_BASENAME=${PROJECT_NAME}-v${PROJECT_VERSION}-${{ matrix.job.target }}
311+ PKG_NAME=${PKG_BASENAME}${PKG_suffix}
312+ echo ::set-output name=PKG_NAME::${PKG_NAME}
313+
314+ PKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/package"
315+ ARCHIVE_DIR="${PKG_STAGING}/${PKG_BASENAME}/"
316+ mkdir -p "${ARCHIVE_DIR}"
317+ mkdir -p "${ARCHIVE_DIR}/autocomplete"
318+
319+ # Binary
320+ cp "${{ steps.strip.outputs.BIN_PATH }}" "$ARCHIVE_DIR"
321+
322+ # Man page
323+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/manual/bat.1 "$ARCHIVE_DIR"
324+
325+ # README, LICENSE and CHANGELOG files
326+ cp "README.md" "LICENSE-MIT" "LICENSE-APACHE" "CHANGELOG.md" "$ARCHIVE_DIR"
327+
328+ # Autocompletion files
329+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.bash "$ARCHIVE_DIR/autocomplete/${{ env.PROJECT_NAME }}.bash"
330+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.fish "$ARCHIVE_DIR/autocomplete/${{ env.PROJECT_NAME }}.fish"
331+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/_bat.ps1 "$ARCHIVE_DIR/autocomplete/_${{ env.PROJECT_NAME }}.ps1"
332+ cp 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.zsh "$ARCHIVE_DIR/autocomplete/${{ env.PROJECT_NAME }}.zsh"
333+
334+ # base compressed package
335+ pushd "${PKG_STAGING}/" >/dev/null
336+ case ${{ matrix.job.target }} in
337+ *-pc-windows-*) 7z -y a "${PKG_NAME}" "${PKG_BASENAME}"/* | tail -2 ;;
338+ *) tar czf "${PKG_NAME}" "${PKG_BASENAME}"/* ;;
339+ esac;
340+ popd >/dev/null
341+
342+ # Let subsequent steps know where to find the compressed package
343+ echo ::set-output name=PKG_PATH::"${PKG_STAGING}/${PKG_NAME}"
344+
345+ - name: Create Debian package
346+ id: debian-package
347+ shell: bash
348+ if: startsWith(matrix.job.os, 'ubuntu')
349+ run: |
350+ COPYRIGHT_YEARS="2018 - "$(date "+%Y")
351+ DPKG_STAGING="${{ env.CICD_INTERMEDIATES_DIR }}/debian-package"
352+ DPKG_DIR="${DPKG_STAGING}/dpkg"
353+ mkdir -p "${DPKG_DIR}"
354+
355+ DPKG_BASENAME=${PROJECT_NAME}
356+ DPKG_CONFLICTS=${PROJECT_NAME}-musl
357+ case ${{ matrix.job.target }} in *-musl) DPKG_BASENAME=${PROJECT_NAME}-musl ; DPKG_CONFLICTS=${PROJECT_NAME} ;; esac;
358+ DPKG_VERSION=${PROJECT_VERSION}
359+
360+ unset DPKG_ARCH
361+ case ${{ matrix.job.target }} in
362+ aarch64-*-linux-*) DPKG_ARCH=arm64 ;;
363+ arm-*-linux-*hf) DPKG_ARCH=armhf ;;
364+ i686-*-linux-*) DPKG_ARCH=i686 ;;
365+ x86_64-*-linux-*) DPKG_ARCH=amd64 ;;
366+ *) DPKG_ARCH=notset ;;
367+ esac;
368+
369+ DPKG_NAME="${DPKG_BASENAME}_${DPKG_VERSION}_${DPKG_ARCH}.deb"
370+ echo ::set-output name=DPKG_NAME::${DPKG_NAME}
371+
372+ # Binary
373+ install -Dm755 "${{ steps.strip.outputs.BIN_PATH }}" "${DPKG_DIR}/usr/bin/${{ steps.strip.outputs.BIN_NAME }}"
374+
375+ # Man page
376+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/manual/bat.1 "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"
377+ gzip -n --best "${DPKG_DIR}/usr/share/man/man1/${{ env.PROJECT_NAME }}.1"
378+
379+ # Autocompletion files
380+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.bash "${DPKG_DIR}/usr/share/bash-completion/completions/${{ env.PROJECT_NAME }}"
381+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.fish "${DPKG_DIR}/usr/share/fish/vendor_completions.d/${{ env.PROJECT_NAME }}.fish"
382+ install -Dm644 'target/${{ matrix.job.target }}/release/build/${{ env.PROJECT_NAME }}'-*/out/assets/completions/bat.zsh "${DPKG_DIR}/usr/share/zsh/vendor-completions/_${{ env.PROJECT_NAME }}"
383+
384+ # README and LICENSE
385+ install -Dm644 "README.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/README.md"
386+ install -Dm644 "LICENSE-MIT" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-MIT"
387+ install -Dm644 "LICENSE-APACHE" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/LICENSE-APACHE"
388+ install -Dm644 "CHANGELOG.md" "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
389+ gzip -n --best "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/changelog"
390+
391+ cat > "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright" <<EOF
392+ Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
393+ Upstream-Name: ${{ env.PROJECT_NAME }}
394+ Source: ${{ env.PROJECT_HOMEPAGE }}
395+
396+ Files: *
397+ Copyright: ${{ env.PROJECT_MAINTAINER }}
398+ Copyright: $COPYRIGHT_YEARS ${{ env.PROJECT_MAINTAINER }}
399+ License: Apache-2.0 or MIT
400+
401+ License: Apache-2.0
402+ On Debian systems, the complete text of the Apache-2.0 can be found in the
403+ file /usr/share/common-licenses/Apache-2.0.
404+
405+ License: MIT
406+ Permission is hereby granted, free of charge, to any
407+ person obtaining a copy of this software and associated
408+ documentation files (the "Software"), to deal in the
409+ Software without restriction, including without
410+ limitation the rights to use, copy, modify, merge,
411+ publish, distribute, sublicense, and/or sell copies of
412+ the Software, and to permit persons to whom the Software
413+ is furnished to do so, subject to the following
414+ conditions:
415+ .
416+ The above copyright notice and this permission notice
417+ shall be included in all copies or substantial portions
418+ of the Software.
419+ .
420+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
421+ ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
422+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
423+ PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
424+ SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
425+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
426+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
427+ IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
428+ DEALINGS IN THE SOFTWARE.
429+ EOF
430+ chmod 644 "${DPKG_DIR}/usr/share/doc/${DPKG_BASENAME}/copyright"
431+
432+ # control file
433+ mkdir -p "${DPKG_DIR}/DEBIAN"
434+ cat > "${DPKG_DIR}/DEBIAN/control" <<EOF
435+ Package: ${DPKG_BASENAME}
436+ Version: ${DPKG_VERSION}
437+ Section: utils
438+ Priority: optional
439+ Maintainer: ${{ env.PROJECT_MAINTAINER }}
440+ Homepage: ${{ env.PROJECT_HOMEPAGE }}
441+ Architecture: ${DPKG_ARCH}
442+ Provides: ${{ env.PROJECT_NAME }}
443+ Conflicts: ${DPKG_CONFLICTS}
444+ Description: cat(1) clone with wings.
445+ A cat(1) clone with syntax highlighting and Git integration.
446+ EOF
447+
448+ DPKG_PATH="${DPKG_STAGING}/${DPKG_NAME}"
449+ echo ::set-output name=DPKG_PATH::${DPKG_PATH}
450+
451+ # build dpkg
452+ fakeroot dpkg-deb --build "${DPKG_DIR}" "${DPKG_PATH}"
453+
454+ - name: "Artifact upload: tarball"
455+ uses: actions/upload-artifact@master
456+ with:
457+ name: ${{ steps.package.outputs.PKG_NAME }}
458+ path: ${{ steps.package.outputs.PKG_PATH }}
459+
460+ - name: "Artifact upload: Debian package"
461+ uses: actions/upload-artifact@master
462+ if: steps.debian-package.outputs.DPKG_NAME
463+ with:
464+ name: ${{ steps.debian-package.outputs.DPKG_NAME }}
465+ path: ${{ steps.debian-package.outputs.DPKG_PATH }}
466+
467+ - name: Check for release
468+ id: is-release
469+ shell: bash
470+ run: |
471+ unset IS_RELEASE ; if [[ $GITHUB_REF =~ ^refs/tags/v[0-9].* ]]; then IS_RELEASE='true' ; fi
472+ echo ::set-output name=IS_RELEASE::${IS_RELEASE}
473+
474+ - name: Publish archives and packages
475+ uses: softprops/action-gh-release@v1
476+ if: steps.is-release.outputs.IS_RELEASE
477+ with:
478+ files: |
479+ ${{ steps.package.outputs.PKG_PATH }}
480+ ${{ steps.debian-package.outputs.DPKG_PATH }}
481+ env:
482+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
.gitignore+2
@@ -2,6 +2,8 @@
2**/*.rs.bk
2**/*.rs.bk
3
3
4# Generated files
4# Generated files
5+/assets/completions/bat.bash
5/assets/completions/bat.fish
6/assets/completions/bat.fish
7+/assets/completions/bat.zsh
6/assets/manual/bat.1
8/assets/manual/bat.1
7/assets/metadata.yaml
9/assets/metadata.yaml
.gitmodules+75−19
@@ -61,21 +61,12 @@
61[submodule "assets/syntaxes/Puppet"]
61[submodule "assets/syntaxes/Puppet"]
62 path = assets/syntaxes/02_Extra/Puppet
62 path = assets/syntaxes/02_Extra/Puppet
63 url = https://github.com/russCloak/SublimePuppet
63 url = https://github.com/russCloak/SublimePuppet
64−[submodule "assets/syntaxes/CSV"]
65− path = assets/syntaxes/02_Extra/CSV
66− url = https://github.com/wadetb/Sublime-Text-Advanced-CSV
67[submodule "assets/themes/onehalf"]
64[submodule "assets/themes/onehalf"]
68 path = assets/themes/onehalf
65 path = assets/themes/onehalf
69 url = https://github.com/sonph/onehalf
66 url = https://github.com/sonph/onehalf
70[submodule "assets/syntaxes/JavaScript (Babel)"]
67[submodule "assets/syntaxes/JavaScript (Babel)"]
71 path = assets/syntaxes/02_Extra/JavaScript (Babel)
68 path = assets/syntaxes/02_Extra/JavaScript (Babel)
72 url = https://github.com/babel/babel-sublime
69 url = https://github.com/babel/babel-sublime
73−[submodule "assets/syntaxes/Cabal"]
74− path = assets/syntaxes/02_Extra/Cabal
75− url = https://github.com/SublimeHaskell/SublimeHaskell
76−[submodule "assets/syntaxes/Dart"]
77− path = assets/syntaxes/02_Extra/Dart
78− url = https://github.com/guillermooo/dart-sublime-bundle
79[submodule "assets/syntaxes/FSharp"]
70[submodule "assets/syntaxes/FSharp"]
80 path = assets/syntaxes/02_Extra/FSharp
71 path = assets/syntaxes/02_Extra/FSharp
81 url = https://github.com/hoest/sublimetext-fsharp
72 url = https://github.com/hoest/sublimetext-fsharp
@@ -97,16 +88,9 @@
97[submodule "assets/themes/sublime-snazzy"]
88[submodule "assets/themes/sublime-snazzy"]
98 path = assets/themes/sublime-snazzy
89 path = assets/themes/sublime-snazzy
99 url = https://github.com/greggb/sublime-snazzy
90 url = https://github.com/greggb/sublime-snazzy
100−[submodule "assets/syntaxes/AsciiDoc"]
101− path = assets/syntaxes/02_Extra/AsciiDoc
102− url = https://github.com/SublimeText/AsciiDoc.git
103[submodule "assets/syntaxes/Assembly (ARM)"]
91[submodule "assets/syntaxes/Assembly (ARM)"]
104 path = assets/syntaxes/02_Extra/Assembly (ARM)
92 path = assets/syntaxes/02_Extra/Assembly (ARM)
105 url = https://github.com/tvi/Sublime-ARM-Assembly
93 url = https://github.com/tvi/Sublime-ARM-Assembly
106−[submodule "assets/syntaxes/syslog-syntax"]
107− path = assets/syntaxes/02_Extra/Syslog
108− url = https://github.com/caos21/syslog-syntax.git
109− branch = master
110[submodule "assets/syntaxes/protobuf-syntax-highlighting"]
94[submodule "assets/syntaxes/protobuf-syntax-highlighting"]
111 path = assets/syntaxes/02_Extra/Protobuf
95 path = assets/syntaxes/02_Extra/Protobuf
112 url = https://github.com/VcamX/protobuf-syntax-highlighting.git
96 url = https://github.com/VcamX/protobuf-syntax-highlighting.git
@@ -126,9 +110,6 @@
126[submodule "assets/syntaxes/Org mode"]
110[submodule "assets/syntaxes/Org mode"]
127 path = assets/syntaxes/02_Extra/Org mode
111 path = assets/syntaxes/02_Extra/Org mode
128 url = https://github.com/jezcope/Org.tmbundle.git
112 url = https://github.com/jezcope/Org.tmbundle.git
129−[submodule "assets/syntaxes/requirementstxt"]
130− path = assets/syntaxes/02_Extra/requirementstxt
131− url = https://github.com/wuub/requirementstxt
132[submodule "assets/syntaxes/DotENV"]
113[submodule "assets/syntaxes/DotENV"]
133 path = assets/syntaxes/02_Extra/DotENV
114 path = assets/syntaxes/02_Extra/DotENV
134 url = https://github.com/zaynali53/DotENV
115 url = https://github.com/zaynali53/DotENV
@@ -188,3 +169,78 @@
188[submodule "assets/syntaxes/02_Extra/QML"]
169[submodule "assets/syntaxes/02_Extra/QML"]
189 path = assets/syntaxes/02_Extra/QML
170 path = assets/syntaxes/02_Extra/QML
190 url = https://github.com/skozlovf/Sublime-QML
171 url = https://github.com/skozlovf/Sublime-QML
172+[submodule "assets/syntaxes/02_Extra/AsciiDoc"]
173+ path = assets/syntaxes/02_Extra/AsciiDoc
174+ url = https://github.com/asciidoctor/sublimetext-asciidoc.git
175+[submodule "assets/syntaxes/02_Extra/GLSL"]
176+ path = assets/syntaxes/02_Extra/GLSL
177+ url = https://github.com/euler0/sublime-glsl
178+[submodule "assets/syntaxes/02_Extra/Nginx"]
179+ path = assets/syntaxes/02_Extra/Nginx
180+ url = https://github.com/brandonwamboldt/sublime-nginx
181+[submodule "assets/syntaxes/02_Extra/Apache"]
182+ path = assets/syntaxes/02_Extra/Apache
183+ url = https://github.com/colinta/ApacheConf.tmLanguage
184+[submodule "assets/syntaxes/02_Extra/Ninja"]
185+ path = assets/syntaxes/02_Extra/Ninja
186+ url = https://github.com/pope/SublimeNinja.git
187+[submodule "assets/syntaxes/02_Extra/Svelte"]
188+ path = assets/syntaxes/02_Extra/Svelte
189+ url = https://github.com/corneliusio/svelte-sublime
190+[submodule "assets/themes/Coldark"]
191+ path = assets/themes/Coldark
192+ url = https://github.com/ArmandPhilippot/coldark-bat.git
193+[submodule "assets/themes/gruvbox"]
194+ path = assets/themes/gruvbox
195+ url = https://github.com/subnut/gruvbox-tmTheme.git
196+ branch = bat-source
197+[submodule "assets/syntaxes/02_Extra/Lean"]
198+ path = assets/syntaxes/02_Extra/Lean
199+ url = https://github.com/leanprover/vscode-lean.git
200+[submodule "assets/syntaxes/02_Extra/LiveScript"]
201+ path = assets/syntaxes/02_Extra/LiveScript
202+ url = https://github.com/paulmillr/LiveScript.tmbundle
203+[submodule "assets/syntaxes/02_Extra/Zig"]
204+ path = assets/syntaxes/02_Extra/Zig
205+ url = https://github.com/ziglang/sublime-zig-language.git
206+[submodule "assets/syntaxes/02_Extra/gnuplot"]
207+ path = assets/syntaxes/02_Extra/gnuplot
208+ url = https://github.com/hesstobi/sublime_gnuplot
209+[submodule "assets/syntaxes/02_Extra/SystemVerilog"]
210+ path = assets/syntaxes/02_Extra/SystemVerilog
211+ url = https://github.com/TheClams/SystemVerilog.git
212+[submodule "assets/themes/visual-studio-dark-plus"]
213+ path = assets/themes/visual-studio-dark-plus
214+ url = https://github.com/vidann1/visual-studio-dark-plus.git
215+[submodule "assets/syntaxes/02_Extra/SublimeEthereum"]
216+ path = assets/syntaxes/02_Extra/SublimeEthereum
217+ url = https://github.com/davidhq/SublimeEthereum.git
218+[submodule "assets/syntaxes/02_Extra/Groff"]
219+ path = assets/syntaxes/02_Extra/Groff
220+ url = https://github.com/carsonoid/sublime_man_page_support
221+[submodule "assets/syntaxes/02_Extra/http-request-response"]
222+ path = assets/syntaxes/02_Extra/http-request-response
223+ url = https://github.com/keith-hall/http-request-response-syntax.git
224+[submodule "assets/syntaxes/02_Extra/LLVM"]
225+ path = assets/syntaxes/02_Extra/LLVM
226+ url = https://github.com/ioncodes/LLVM.tmBundle
227+[submodule "assets/syntaxes/02_Extra/Slim"]
228+ path = assets/syntaxes/02_Extra/Slim
229+ url = https://github.com/slim-template/ruby-slim.tmbundle.git
230+[submodule "assets/syntaxes/02_Extra/Racket"]
231+ path = assets/syntaxes/02_Extra/Racket
232+ url = https://github.com/follesoe/sublime-racket.git
233+[submodule "assets/syntaxes/02_Extra/MediaWiki"]
234+ path = assets/syntaxes/02_Extra/MediaWiki
235+ url = https://github.com/tosher/Mediawiker.git
236+[submodule "assets/syntaxes/02_Extra/Dart"]
237+ path = assets/syntaxes/02_Extra/Dart
238+ url = https://github.com/elMuso/Dartlight.git
239+[submodule "assets/syntaxes/02_Extra/SublimeJQ"]
240+ path = assets/syntaxes/02_Extra/SublimeJQ
241+ url = https://github.com/zogwarg/SublimeJQ.git
242+[submodule "assets/syntaxes/02_Extra/cmd-help"]
243+ path = assets/syntaxes/02_Extra/cmd-help
244+ url = https://github.com/victor-gp/cmd-help-sublime-syntax.git
245+ branch = main
246+ shallow = true
.travis.ymldeleted−106
@@ -1,106 +0,0 @@
1−language: rust
2−
3−matrix:
4− include:
5− # Stable channel.
6− - os: linux
7− rust: stable
8− env: TARGET=x86_64-unknown-linux-gnu
9− - os: linux
10− rust: stable
11− env:
12− - TARGET=x86_64-unknown-linux-musl
13− - CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
14− - os: linux
15− rust: stable
16− env: TARGET=i686-unknown-linux-gnu
17− - os: osx
18− rust: stable
19− env: TARGET=x86_64-apple-darwin
20− - os: linux
21− rust: stable
22− env:
23− - TARGET=arm-unknown-linux-gnueabihf
24− - CC_arm_unknown_linux_gnueabihf=/usr/bin/arm-linux-gnueabihf-gcc-4.8
25− - CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_LINKER=arm-linux-gnueabihf-gcc-4.8
26− - os: linux
27− rust: stable
28− env:
29− - TARGET=aarch64-unknown-linux-gnu
30− - CC_aarch64-unknown-linux-gnu=/usr/bin/aarch64-linux-gnu-gcc-4.8
31− - CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc-4.8
32−
33− # Minimum Rust supported channel.
34− - os: linux
35− rust: 1.40.0
36− env: TARGET=x86_64-unknown-linux-gnu
37− - os: linux
38− rust: 1.40.0
39− env:
40− - TARGET=x86_64-unknown-linux-musl
41− - CC_x86_64_unknown_linux_musl=/usr/bin/musl-gcc
42− - os: osx
43− rust: 1.40.0
44− env: TARGET=x86_64-apple-darwin
45−
46− # Disable nightly for now
47− # # Code formatting check
48− # - os: linux
49− # rust: nightly
50− # # skip the global install step
51− # install:
52− # - cargo install --debug --force rustfmt-nightly
53− # script: cargo fmt -- --check
54−
55−sudo: required
56−
57−before_install:
58− - ci/before_install.bash
59−
60−env:
61− global:
62− # Default target on travis-ci.
63− # Used as conditional check in the install stage
64− - HOST=x86_64-unknown-linux-gnu
65− # Used on the deployment script
66− - PROJECT_NAME=bat
67−
68−install:
69− # prevent target re-add error from rustup
70− - if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
71−
72−script:
73− - ci/script.bash
74−
75−before_deploy:
76− - bash ci/before_deploy.bash
77−
78−deploy:
79− provider: releases
80− # NOTE updating the `api_key.secure`
81− # - go to: https://github.com/settings/tokens/new
82− # - generate new token using `public_repo` scope
83− # - encrypt it using: `travis encrypt API_KEY_HERE`
84− # - paste the output below
85− api_key:
86− secure: "GZL8nYk+/MZGEqejpP0UMMGVmwUEdxiF9CflFIGccu+/tznDyHnHOpyJmbH3M5IKWIxa7xFgqOE8pHuD4oQXt4mzyJGB0KMKKEFLW7ckbTYKya5bw0heKznaqGnS0Yz+vpfqYR25eiPFYCz7mDsGsCzH5QZqt3cdn9MDQGu1D0IaxPjuBNH3T9kBblR0ifBd3Diy0JYhiVcMSI3V1rkel18F1yBHO2GQ95hkWxVgjANQnefq5+zdzbx4ki539ewYENShA8N0w6ULJVY9LmWRWJIp90ggOD3JCH6Nz/fBpYBqwfABO6Dr7Csw7IRm7pM4IVkFZS1taiDYFX9thxZh3UTmI4YYtSTPxH9NGV47kxPipbf4vAXFwW+1VcHKMpBzz+5IVsHnk1Pfx9/GZsXbqXM3PUWCStec36Xtqh5vQapDKEg9khkEs4b1X7/E73gvpRuQl9gbnyufSVWgDsXIWqM+0aDbqQz1FpLmVxz6eij0cB9vR+8kbNoe/CEPHPO9ZllvAHseukOeHPzSBd8rILORXaaGmQausXz2wWgSsffUSYz4705P8joI0zFCfmkHjL+kA1ZUx5SxLCc1ID7CFFZChhAxHoPL7xc21snswwr8QeheERdwvuzKNaerBGZEw8dmMMx98YkjftIj65DDySr2mRZuufBQeQpmMhFyIT4="
87− # for uploading multiple files
88− file_glob: true
89− # NOTE explanation on each env variable
90− # - PROJECT_NAME: name of the project, set on the `env.global` above
91− # - TRAVIS_TAG: tag name that the build is being deployed for, usually the version number
92− # - TARGET: target triple of the build
93− file:
94− - $PROJECT_NAME-$TRAVIS_TAG-$TARGET.*
95− - $PROJECT_NAME*.deb
96− # don't delete artifacts from previous stage
97− skip_cleanup: true
98− on:
99− # deploy only if we push a tag
100− tags: true
101− # deploy only on stable channel that has TARGET env variable sets
102− condition: $TRAVIS_RUST_VERSION = stable && $TARGET != ""
103−
104−notifications:
105− email:
106− on_success: never
CHANGELOG.md+355−5
@@ -2,19 +2,369 @@
2
2
3## Features
3## Features
4
4
5−- Add padding above headers when not using a grid, see #968 and #981 (@pt2121)
5+- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic)
6
6
7## Bugfixes
7## Bugfixes
8
8
9−- bat mishighlights Users that start with digits in SSH config, see #984
9+## Other
10−- `--map-syntax` doesn't work with names provided through `--file-name` (@eth-p)
10+
11+- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
12+
13+## Syntaxes
14+
15+## Themes
16+
17+## `bat` as a library
18+
19+
20+# v0.21.0
21+
22+## Features
23+
24+- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
25+- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
26+- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
27+- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic)
28+
29+## Bugfixes
30+
31+- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic)
32+- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic)
33+
34+## Performance
35+
36+- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
37+- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)
11
38
12## Other
39## Other
13−## New syntaxes
40+
41+- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic)
42+
43+## Syntaxes
44+
45+- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
46+- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
47+- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
48+- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
49+- Slightly adjust Zig syntax. See #2136 (@Enselic)
50+- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
51+
52+## `bat` as a library
53+
54+- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142
55+- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
56+- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic)
57+- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic)
58+- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic)
59+
60+
61+# v0.20.0
62+
63+## Features
64+
65+- New style component `header-filesize` to show size of the displayed file in the header. See #1988 (@mdibaiee)
66+- Use underline for line highlighting on ANSI, see #1730 (@mdibaiee)
67+
68+## Bugfixes
69+
70+- Fix bash completion on bash 3.x and bash-completion 1.x. See #2066 (@joshpencheon)
71+
72+## Syntaxes
73+
74+- `GraphQL`: Add support for interfaces implementing interfaces and consider ampersand an operator. See #2000
75+- Associate `_vimrc` and `_gvimrc` files with the `VimL` syntax. See #2002
76+- Associate `poetry.lock` files with the `TOML` syntax. See #2049
77+- Associate `.mesh`, `.task`, `.rgen`, `.rint`, `.rahit`, `.rchit`, `.rmiss`, and `.rcall` with the `GLSL` syntax. See #2050
78+- Added support for `JQ` syntax, see #2072
79+- Properly associate global git config files rooted in `$XDG_CONFIG_HOME/git/` or `$HOME/.config/git/`. See #2067 (@cyqsimon)
80+
81+## `bat` as a library
82+
83+- Exposed `get_syntax_set` and `get_theme` methods on `HighlightingAssets`. See #2030 (@dandavison)
84+- Added `HeaderFilename` and `HeaderFilesize` to `StyleComponent` enum, and mark it `#[non_exhaustive]`. See #1988 (@mdibaiee)
85+
86+
87+# v0.19.0
88+
89+## Performance
90+
91+- Reduce startup time in loop-through mode (e.g. when redirecting output) by 90%. See #1747 (@Enselic)
92+- Load themes lazily to make bat start 25% faster when disregarding syntax load time. See #1969 (@Enselic)
93+- Python syntax highlighting no longer suffers from abysmal performance in specific scenarios. See #1688 (@keith-hall)
94+- Fix for poor performance when ANSI escape sequences are piped to `bat`, see #1596 (@eth-p)
95+- Fix for incorrect handling of ANSI escape sequences when using `--wrap=never`, see #1596 (@eth-p)
96+- Load custom assets as fast as integrated assets, see #1753 (@Enselic)
97+
98+## Features
99+
100+- Support for `x:-delta` (minus) syntax in line ranges (e.g. `20:-10`). See #1901 (@bojan88)
101+- Support for `--ignored-suffix` argument. See #1892 (@bojan88)
102+- `$BAT_CONFIG_DIR` is now a recognized environment variable. It has precedence over `$XDG_CONFIG_HOME`, see #1727 (@billrisher)
103+- Support for `x:+delta` syntax in line ranges (e.g. `20:+10`). See #1810 (@bojan88)
104+- Add new `--acknowledgements` option that gives credit to theme and syntax definition authors. See #1971 (@Enselic)
105+- Include git hash in `bat -V` and `bat --version` output if present. See #1921 (@Enselic)
106+
107+## Bugfixes
108+
109+- First line not shown in diff context. See #1891 (@divagant-martian)
110+- Do not ignore syntaxes that handle file names with a `*.conf` extension. See #1703 (@cbolgiano)
111+
112+## Other
113+
114+- Add PowerShell completion, see #1826 (@rashil2000)
115+- Minimum supported Rust version (MSRV) bumped to 1.51, see #1994 (@mdibaiee)
116+
117+## Syntaxes
118+
119+- Groff, see #1685 (@scop)
120+- HTTP Requests and Responses, see #1748 (@keith-hall)
121+- LLVM, see #1777 (@ioncodes)
122+- Highlight for `vimrc` and `gvimrc` files, see #1763 (@SuperSandro2000)
123+- Syslog highlighting improvements, see #1793 (@scop)
124+- Added support for `slim` syntax, see #1693 (@mfinelli)
125+- Racket, see #1884 (@jubnzv)
126+- LiveScript, see #1915 (@Enselic)
127+- MediaWiki, see #1925 (@sorairolake)
128+- The `requirements.txt` syntax has been removed due to incompatible license requirements.
129+- Dart, new highlighter, see #1959 (@Ersikan)
130+- SCSS and Sass syntaxes updated, see #1766 (@Enselic)
131+- PowerShell syntax updated, see #1935 (@Enselic)
132+- TypeScript syntax updated, see #1834 (@Enselic)
133+
134+## `bat` as a library
135+
136+- Deprecate `HighlightingAssets::syntaxes()` and `HighlightingAssets::syntax_for_file_name()`. Use `HighlightingAssets::get_syntaxes()` and `HighlightingAssets::get_syntax_for_path()` instead. They return a `Result` which is needed for upcoming lazy-loading work to improve startup performance. They also return which `SyntaxSet` the returned `SyntaxReference` belongs to. See #1747, #1755, #1776, #1862 (@Enselic)
137+- Remove `HighlightingAssets::from_files` and `HighlightingAssets::save_to_cache`. Instead of calling the former and then the latter you now make a single call to `bat::assets::build`. See #1802, #1971 (@Enselic)
138+- Replace the `error::Error(error::ErrorKind, _)` struct and enum with an `error::Error` enum. `Error(ErrorKind::UnknownSyntax, _)` becomes `Error::UnknownSyntax`, etc. Also remove the `error::ResultExt` trait. These changes stem from replacing `error-chain` with `thiserror`. See #1820 (@Enselic)
139+- Add new `MappingTarget` enum variant `MapExtensionToUnknown`. Refer to its documentation for more information. Also mark `MappingTarget` as `#[non_exhaustive]` since more enum variants might be added in the future. See #1703 (@cbolgiano), #2012 (@Enselic)
140+
141+
142+# v0.18.3
143+
144+## Bugfixes
145+
146+- Bump `git2` dependency to fix build with Rust 1.54, see #1761
147+
148+
149+# v0.18.2
150+
151+## Features
152+
153+- Ignore known backup/template filename suffixes when selecting the syntax, see #1687 (@scop)
154+
155+## Bugfixes
156+
157+- Fix for a security vulnerability on Windows. Prior to this release, `bat` would execute programs called `less`/`less.exe` from the current working directory (instead of the one from `PATH`) with priority. An attacker might be able to use this by placing a malicious program in a shared directory where the user would execute `bat`. `bat` users on Windows are advised to upgrade to this version. See #1724 and #1472 (@Ry0taK).
158+
159+## Other
160+
161+- Add bash completion, see #1678 (@scop)
162+- Fix Clippy lints, see #1661 (@mohamed-abdelnour)
163+- Add syntax highlighting test files, see #1213 and #1668 (@mohamed-abdelnour)
164+
165+## Syntaxes
166+
167+- Upgraded Julia syntax to fix a highlighting bug, see #1692
168+- Added support for `dash` syntax, see #1654 (@mohamed-abdelnour)
169+- Added support for `XAML` syntax, see #1590 and #1655 (@mohamed-abdelnour)
170+- Apply `DotENV` syntax also for `.env.default` and `.env.defaults` files, see #1669
171+
172+
173+# v0.18.1
174+
175+## Bugfixes
176+
177+- Mouse support and screen clearing broken for `less` versions with minor version number (581.2), see #1629 and #1639 (@aswild)
178+
179+## Other
180+
181+- `Input::ordinary_file` and `Input::with_name` now accept `Path` rather than `OsStr` see #1571 (@matklad)
182+- The `LESS` environment variable is now included in `bat --diagnostic`, see #1589 (@Enselic)
183+- Increased min. required Rust version to 1.45
184+
185+## Syntaxes
186+
187+- Improved the Syslog syntax highlighting, see #1606 (@keith-hall)
188+- Replaced "Advanced CSV" with a custom CSV syntax definition written especially for `bat`; see #1574 (@keith-hall)
189+- Added SystemVerilog file syntax, see #1580 (@SeanMcLoughlin)
190+- Added Solidity and Vyper syntax, see #1602 (@Ersikan)
191+
14## New themes
192## New themes
193+
194+- Dark+ VS Code theme, see #1588 and #1598 (@PatriotRossii)
195+
196+
197+
198+# v0.18.0
199+
200+## Features
201+
202+- Use a pager when `bat --list-languages` is called, see #1394 (@stku1985)
203+
204+## Bugfixes
205+
206+- If the last line doesn't end with a newline character, don't add it if `--style=plain`, see #1438 (@Enselic)
207+- Only print themes hint in interactive mode (`bat --list-themes`), see #1439 (@rsteube)
208+- Make ./tests/syntax-tests/regression_test.sh work on recent versions of macOS, see #1443 (@Enselic)
209+- VimL syntax highlighting fix, see #1450 (@esensar)
210+- Print an 'Invalid syntax theme settings' error message if a custom theme is broken, see #614 (@Enselic)
211+- If plain mode is set and wrap is not explicitly opted in, long lines will no be truncated, see #1426
212+- If `PAGER` (but not `BAT_PAGER` or `--pager`) is `more` or `most`, silently use `less` instead to ensure support for colors, see #1063 (@Enselic)
213+- If `PAGER` is `bat`, silently use `less` to prevent recursion. For `BAT_PAGER` or `--pager`, exit with error, see #1413 (@Enselic)
214+- Manpage highlighting fix, see #1511 (@keith-hall)
215+- `BAT_CONFIG_PATH` ignored by `bat` if non-existent, see #1550 (@sharkdp)
216+
217+## Other
218+
219+- Performance improvements, see #1421 (@LovecraftianHorror)
220+- Added a new `--diagnostic` option to collect information for bug reports, see #1459 (@sharkdp)
221+- Modified default theme colors to differentiate between a JSON key and a string value, see #1400 (@keith-hall)
222+- Upped min required Rust version to 1.42
223+
224+## Syntaxes
225+
226+- Added Zig syntax, see #1470 (@paulsmith)
227+- Added Lean syntax, see #1446 (@Julian)
228+- Added `.resource` extension for Robot Framework files, see #1386
229+- Added `gnuplot` syntax, see #1431 (@sharkdp)
230+- Highlight *.pac (Proxy auto-config) files as JavaScript, see #1515 (@sharkdp)
231+
232+## New themes
233+
234+- `ansi` replaces `ansi-dark` and `ansi-light`, see #1104 and #1412 (@mk12). **Breaking change:** users that were previously using one of the `ansi-*` themes should switch to `ansi`.
235+- The Gruvbox theme has been updated, see #1291 (@j0hnmeow). **Breaking change:** users that were previously using `gruvbox` or `gruvbox-white` should update and use `gruvbox-dark`/`gruvbox-light` instead.
236+
15## `bat` as a library
237## `bat` as a library
238+
239+- The following `PrettyPrinter` methods have been removed (they were previously deprecated):
240+ - `input_stdin_with_name`
241+ - `input_from_bytes_with_name`
242+ - `input_from_reader_with_name`
243+ - `vcs_modification_markers` (if the `git` feature is not enabled)
244+
245+
246+# v0.17.1
247+
248+## Bugfixes
249+
250+- Running `bat` without arguments fails ("output file is also an input"), see #1396
251+
252+
253+# v0.17.0
254+
255+## Features
256+
257+- Added a new `--style` value, `rule`, which adds a simple horizontal ruled line between files, see #1276 (@tommilligan)
258+- Pass `-S` ("chop long lines") to `less` if `--wrap=never` is set in `bat`, see #1255 (@gahag)
259+
260+## Bugfixes
261+
262+- Detect infinite loop when input and output are the same, see #1193 and #1197 (@niklasmohrin)
263+- Throw an error when `bat` is being used as `pager`, see #1343 (@adrian-rivera)
264+- Bash syntax highlighting not selected for `*.ebuild` and `*.eclass` files, see #1292 (@sharkdp)
265+- Fix `zsh` completion when using `-p`, see #1320 (@xzfc)
266+
267+## Other
268+
269+- Add note to refer to see detailed help with `--help` (and vice versa with `-h`), see #1215 (@henil)
270+- Add a `Contributors` section to `README`, see #1348 (@adrian-rivera)
271+
272+## Syntaxes
273+
274+- Manpage syntax highlighting has been improved, see #1315 (@keith-hall)
275+- Add Svelte file syntax, see #1285 (@kjmph)
276+
277+## New themes
278+
279+- Coldark, see #1329 (@armandphilippot)
280+
281+
282+# v0.16.0
283+
284+## Features
285+
286+- Added support for the `NO_COLOR` environment variable, see #1021 and #1031 (@eth-p)
287+- Added `-P` short flag to disable paging, see #1075 and #1082 (@LordFlashmeow)
288+- Added `--force-colorization`/`-f` flag to provide an alias for forced color and decoration output, see #1141 (@alexanderkarlis)
289+
290+## Bugfixes
291+
292+- Fixed non-printable characters display for redirected output, see #1061 (@gsomix)
293+- Handle file extension conflicts in `--list-languages`, see #1076 and #1135 (@Kienyew)
294+
295+## Other
296+
297+- Switched to "·" (U+00B7) Middle Dot from "•" (U+2022) Bullet for non-printing spaces, see #1056 and #1100 (@LordFlashmeow)
298+- Added zsh shell completion script, see #1136 (@Kienyew)
299+- Improved `--help` text (@sharkdp)
300+- Added custom languages/themes sections to manpage (@eth-p)
301+
302+## Syntaxes
303+
304+- Update AsciiDoc syntax, see #1034 (@rxt1077)
305+- GLSL (@caioalonso)
306+- Add Nginx and Apache config file syntax, see #1137 (@kjmph, @niklasmohrin)
307+- Use `fstab` syntax for `crypttab` files, see #1073 (@sharkdp)
308+- Support syntax highlighting for files in `$XDG_CONFIG_HOME/git/`, see #1191 (@ahmedelgabri)
309+
310+## New themes
311+
312+- Gruvbox, see #1069 (@kyleondy)
313+- base16-256 for [base16-shell](https://github.com/chriskempson/base16-shell) users, see #1111 (@mk12)
314+
315+## `bat` as a library
316+
317+- Add APIs to provide `Input` descriptions with `InputDescription` (@eth-p)
318+- Add function to directly provide `Input`s to `PrettyPrinter` (@eth-p)
319+- **Breaking:** `Input::theme_preview_file` is no longer available. (@eth-p)
320+
16## Packaging
321## Packaging
17
322
323+- Removed build dependency on `liquid` (@sharkdp).
324+
325+# v0.15.4
326+
327+## Bugfixes
328+
329+- Added missing Solarized themes, see #1027
330+- Fixed highlighting bug in Haskell source files, see #1026
331+
332+# v0.15.3
333+
334+## Bugfixes
335+
336+- Cannot run `bat` with relative paths, see #1022
337+- bat mishighlights Users that start with digits in SSH config, see #984
338+
339+## New syntaxes
340+
341+- SML, see #1005 (@kopecs)
342+
343+## Other
344+
345+- Some syntaxes and themes have been updated to the latest version
346+
347+# v0.15.2
348+
349+## Bugfixes
350+
351+- Fix syntax detection for files called 'rails', see #1008
352+- Fix potential errors with syntax detection for symlinked files, see #1001
353+- `--map-syntax` doesn't work with names provided through `--file-name` (@eth-p)
354+
355+## Other
356+
357+- Add padding above headers when not using a grid, see #968 and #981 (@pt2121)
358+- bat now prints an error if an invalid syntax is specified via `-l` or `--map-syntax`, see #1004 (@eth-p)
359+
360+## `bat` as a library
361+
362+- `PrettyPrinter::vcs_modification_markers` has been marked deprecated when building without the `git` feature, see #997 and #1020 (@eth-p, @sharkdp)
363+
364+## Packaging
365+
366+- Compilation problems with `onig_sys` on various platforms have been resolved by upgrading to `syntect 4.2`, which includes a new `onig` version that allows to build `onig_sys` without the `bindgen` dependency. This removes the need for `libclang(-dev)` to be installed to compile `bat`. Package maintainers might want to remove `clang` as a build dependency. See #650 for more details.
367+
18# v0.15.1
368# v0.15.1
19
369
20## Bugfixes
370## Bugfixes
@@ -335,7 +685,7 @@ You can see the API documentation here: https://docs.rs/bat/
335
685
336- Added `BAT_CONFIG_PATH` environment variable to set a non-default path for `bat`s configuration file, see #375 (@deg4uss3r)
686- Added `BAT_CONFIG_PATH` environment variable to set a non-default path for `bat`s configuration file, see #375 (@deg4uss3r)
337
687
338−- Allow for multiple occurences of `--style` to allow for the configuration
688+- Allow for multiple occurrences of `--style` to allow for the configuration
339 of styles from the config file, see #367 (@sindreij)
689 of styles from the config file, see #367 (@sindreij)
340
690
341- Allow for multiple `--line-range` arguments, see #23
691- Allow for multiple `--line-range` arguments, see #23
CONTRIBUTING.mdnew file+70
@@ -0,0 +1,70 @@
1+# Contributing
2+
3+Thank you for considering to contribute to `bat`!
4+
5+
6+
7+## Add an entry to the changelog
8+
9+If your contribution changes the behavior of `bat` (as opposed to a typo-fix
10+in the documentation), please update the [`CHANGELOG.md`](CHANGELOG.md) file
11+and describe your changes. This makes the release process much easier and
12+therefore helps to get your changes into a new `bat` release faster.
13+
14+The top of the `CHANGELOG` contains a *"unreleased"* section with a few
15+subsections (Features, Bugfixes, …). Please add your entry to the subsection
16+that best describes your change.
17+
18+Entries follow this format:
19+```
20+- Short description of what has been changed, see #123 (@user)
21+```
22+Here, `#123` is the number of the original issue and/or your pull request.
23+Please replace `@user` by your GitHub username.
24+
25+
26+## Development
27+
28+Please check out the [Development](https://github.com/sharkdp/bat#development)
29+section in the README.
30+
31+
32+## Adding a new feature
33+
34+Please consider opening a
35+[feature request ticket](https://github.com/sharkdp/bat/issues/new?assignees=&labels=feature-request&template=feature_request.md)
36+first in order to give us a chance to discuss the feature first.
37+
38+
39+## Adding new syntaxes/languages or themes
40+
41+Before you make a pull request that adds a new syntax or theme, please read
42+the [Customization](https://github.com/sharkdp/bat#customization) section
43+in the README first.
44+
45+If you really think that a particular syntax or theme should be added for all
46+users, please read the corresponding
47+[documentation](https://github.com/sharkdp/bat/blob/master/doc/assets.md)
48+first.
49+
50+
51+## Regression tests
52+
53+You are strongly encouraged to add regression tests. Regression tests are great,
54+not least because they:
55+
56+* ensure that your contribution will never completely stop working,
57+
58+* makes code review easier, because it becomes very clear what the code is
59+ supposed to do.
60+
61+For functional changes, you most likely want to add a test to
62+[`tests/integration_tests.rs`](https://github.com/sharkdp/bat/blob/master/tests/integration_tests.rs).
63+Look at existing tests to know how to write a new test. In short, you will
64+invoke the `bat` binary with a certain set of arguments, and then assert on
65+stdout/stderr.
66+
67+To learn how to write regression tests for theme and syntax changes, read the
68+[Syntax
69+tests](https://github.com/sharkdp/bat/blob/master/doc/assets.md#syntax-tests)
70+section in `assets.md`.
Cargo.lock+628−955
@@ -1,1667 +1,1340 @@
1# This file is automatically @generated by Cargo.
1# This file is automatically @generated by Cargo.
2# It is not intended for manual editing.
2# It is not intended for manual editing.
3+version = 3
4+
3[[package]]
5[[package]]
4−name = "adler32"
6+name = "adler"
5−version = "1.0.4"
7+version = "1.0.2"
6source = "registry+https://github.com/rust-lang/crates.io-index"
8source = "registry+https://github.com/rust-lang/crates.io-index"
9+checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
7
10
8[[package]]
11[[package]]
9name = "aho-corasick"
12name = "aho-corasick"
10−version = "0.7.10"
13+version = "0.7.18"
11source = "registry+https://github.com/rust-lang/crates.io-index"
14source = "registry+https://github.com/rust-lang/crates.io-index"
15+checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
12dependencies = [
16dependencies = [
13− "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
17+ "memchr",
14]
18]
15
19
16[[package]]
20[[package]]
17name = "ansi_colours"
21name = "ansi_colours"
18−version = "1.0.1"
22+version = "1.1.1"
19−source = "registry+https://github.com/rust-lang/crates.io-index"
20−dependencies = [
21− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
22−]
23−
24−[[package]]
25−name = "ansi_term"
26−version = "0.11.0"
27source = "registry+https://github.com/rust-lang/crates.io-index"
23source = "registry+https://github.com/rust-lang/crates.io-index"
24+checksum = "32678233b67f9056b0c144b39d46dc3218637e8d84ad6038ded339e08b19620d"
28dependencies = [
25dependencies = [
29− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
26+ "rgb",
30]
27]
31
28
32[[package]]
29[[package]]
33name = "ansi_term"
30name = "ansi_term"
34version = "0.12.1"
31version = "0.12.1"
35source = "registry+https://github.com/rust-lang/crates.io-index"
32source = "registry+https://github.com/rust-lang/crates.io-index"
33+checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
36dependencies = [
34dependencies = [
37− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
35+ "winapi",
38]
36]
39
37
40−[[package]]
41−name = "anymap"
42−version = "0.12.1"
43−source = "registry+https://github.com/rust-lang/crates.io-index"
44−
45−[[package]]
46−name = "arrayref"
47−version = "0.3.6"
48−source = "registry+https://github.com/rust-lang/crates.io-index"
49−
50−[[package]]
51−name = "arrayvec"
52−version = "0.5.1"
53−source = "registry+https://github.com/rust-lang/crates.io-index"
54−
55[[package]]
38[[package]]
56name = "assert_cmd"
39name = "assert_cmd"
57−version = "1.0.1"
40+version = "2.0.4"
58source = "registry+https://github.com/rust-lang/crates.io-index"
41source = "registry+https://github.com/rust-lang/crates.io-index"
42+checksum = "93ae1ddd39efd67689deb1979d80bad3bf7f2b09c6e6117c8d1f2443b5e2f83e"
59dependencies = [
43dependencies = [
60− "doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
44+ "bstr",
61− "predicates 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
45+ "doc-comment",
62− "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
46+ "predicates",
63− "predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
47+ "predicates-core",
64− "wait-timeout 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
48+ "predicates-tree",
49+ "wait-timeout",
65]
50]
66
51
67[[package]]
52[[package]]
68name = "atty"
53name = "atty"
69version = "0.2.14"
54version = "0.2.14"
70source = "registry+https://github.com/rust-lang/crates.io-index"
55source = "registry+https://github.com/rust-lang/crates.io-index"
56+checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
71dependencies = [
57dependencies = [
72− "hermit-abi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
58+ "hermit-abi",
73− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
59+ "libc",
74− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
60+ "winapi",
75]
61]
76
62
77[[package]]
63[[package]]
78name = "autocfg"
64name = "autocfg"
79−version = "1.0.0"
65+version = "1.0.1"
80−source = "registry+https://github.com/rust-lang/crates.io-index"
81−
82−[[package]]
83−name = "backtrace"
84−version = "0.3.46"
85−source = "registry+https://github.com/rust-lang/crates.io-index"
86−dependencies = [
87− "backtrace-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)",
88− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
89− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
90− "rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)",
91−]
92−
93−[[package]]
94−name = "backtrace-sys"
95−version = "0.1.36"
96−source = "registry+https://github.com/rust-lang/crates.io-index"
97−dependencies = [
98− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
99− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
100−]
101−
102−[[package]]
103−name = "base64"
104−version = "0.10.1"
105source = "registry+https://github.com/rust-lang/crates.io-index"
66source = "registry+https://github.com/rust-lang/crates.io-index"
106−dependencies = [
67+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
107− "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
108−]
109
68
110[[package]]
69[[package]]
111name = "base64"
70name = "base64"
112−version = "0.11.0"
71+version = "0.13.0"
113source = "registry+https://github.com/rust-lang/crates.io-index"
72source = "registry+https://github.com/rust-lang/crates.io-index"
73+checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
114
74
115[[package]]
75[[package]]
116name = "bat"
76name = "bat"
117−version = "0.15.1"
77+version = "0.21.0"
118−dependencies = [
78+dependencies = [
119− "ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
79+ "ansi_colours",
120− "ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
80+ "ansi_term",
121− "assert_cmd 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
81+ "assert_cmd",
122− "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
82+ "atty",
123− "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
83+ "bincode",
124− "console 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)",
84+ "bugreport",
85+ "bytesize",
86+ "clap",
87+ "clircle",
88+ "console",
125− "content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
89+ "content_inspector",
126− "dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
90+ "dirs-next",
127− "encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
91+ "encoding",
128− "error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
92+ "flate2",
129− "git2 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)",
93+ "git2",
130− "globset 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
94+ "globset",
131− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
95+ "grep-cli",
132− "liquid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
96+ "nix",
133− "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
97+ "once_cell",
134− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
98+ "path_abs",
135− "serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)",
99+ "predicates",
136− "shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
100+ "regex",
137− "syntect 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
101+ "semver",
138− "tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
102+ "serde",
139− "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
103+ "serde_yaml",
140− "wild 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
104+ "serial_test",
105+ "shell-words",
106+ "syntect",
107+ "tempfile",
108+ "thiserror",
109+ "unicode-width",
110+ "wait-timeout",
111+ "walkdir",
112+ "wild",
141]
113]
142
114
143[[package]]
115[[package]]
144name = "bincode"
116name = "bincode"
145−version = "1.2.1"
117+version = "1.3.3"
146source = "registry+https://github.com/rust-lang/crates.io-index"
118source = "registry+https://github.com/rust-lang/crates.io-index"
119+checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
147dependencies = [
120dependencies = [
148− "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
121+ "serde",
149− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
150−]
151−
152−[[package]]
153−name = "bindgen"
154−version = "0.50.1"
155−source = "registry+https://github.com/rust-lang/crates.io-index"
156−dependencies = [
157− "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
158− "cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
159− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
160− "clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)",
161− "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)",
162− "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
163− "fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
164− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
165− "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
166− "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
167− "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
168− "quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)",
169− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
170− "shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
171− "which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
172]
122]
173
123
174[[package]]
124[[package]]
175name = "bit-set"
125name = "bit-set"
176−version = "0.5.1"
126+version = "0.5.2"
177source = "registry+https://github.com/rust-lang/crates.io-index"
127source = "registry+https://github.com/rust-lang/crates.io-index"
128+checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de"
178dependencies = [
129dependencies = [
179− "bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
130+ "bit-vec",
180]
131]
181
132
182[[package]]
133[[package]]
183name = "bit-vec"
134name = "bit-vec"
184−version = "0.5.1"
135+version = "0.6.3"
185source = "registry+https://github.com/rust-lang/crates.io-index"
136source = "registry+https://github.com/rust-lang/crates.io-index"
137+checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb"
186
138
187[[package]]
139[[package]]
188name = "bitflags"
140name = "bitflags"
189−version = "1.2.1"
141+version = "1.3.2"
190−source = "registry+https://github.com/rust-lang/crates.io-index"
191−
192−[[package]]
193−name = "blake2b_simd"
194−version = "0.5.10"
195−source = "registry+https://github.com/rust-lang/crates.io-index"
196−dependencies = [
197− "arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
198− "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
199− "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
200−]
201−
202−[[package]]
203−name = "block-buffer"
204−version = "0.7.3"
205source = "registry+https://github.com/rust-lang/crates.io-index"
142source = "registry+https://github.com/rust-lang/crates.io-index"
206−dependencies = [
143+checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
207− "block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
208− "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
209− "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
210− "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
211−]
212
144
213[[package]]
145[[package]]
214−name = "block-padding"
146+name = "bstr"
215−version = "0.1.5"
147+version = "0.2.17"
216source = "registry+https://github.com/rust-lang/crates.io-index"
148source = "registry+https://github.com/rust-lang/crates.io-index"
149+checksum = "ba3569f383e8f1598449f1a423e72e99569137b47740b1da11ef19af3d5c3223"
217dependencies = [
150dependencies = [
218− "byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
151+ "lazy_static",
152+ "memchr",
153+ "regex-automata",
219]
154]
220
155
221[[package]]
156[[package]]
222−name = "bstr"
157+name = "bugreport"
223−version = "0.2.12"
158+version = "0.5.0"
224source = "registry+https://github.com/rust-lang/crates.io-index"
159source = "registry+https://github.com/rust-lang/crates.io-index"
160+checksum = "535120b8182547808081a66f1f77a64533c780b23da26763e0ee34dfb94f98c9"
225dependencies = [
161dependencies = [
226− "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
162+ "git-version",
163+ "shell-escape",
164+ "sys-info",
227]
165]
228
166
229[[package]]
167[[package]]
230−name = "byte-tools"
168+name = "bytemuck"
231−version = "0.3.1"
169+version = "1.7.3"
232source = "registry+https://github.com/rust-lang/crates.io-index"
170source = "registry+https://github.com/rust-lang/crates.io-index"
171+checksum = "439989e6b8c38d1b6570a384ef1e49c8848128f5a97f3914baef02920842712f"
233
172
234[[package]]
173[[package]]
235−name = "byteorder"
174+name = "bytesize"
236−version = "1.3.4"
175+version = "1.1.0"
237source = "registry+https://github.com/rust-lang/crates.io-index"
176source = "registry+https://github.com/rust-lang/crates.io-index"
177+checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70"
238
178
239[[package]]
179[[package]]
240name = "cc"
180name = "cc"
241−version = "1.0.52"
181+version = "1.0.72"
242−source = "registry+https://github.com/rust-lang/crates.io-index"
243−dependencies = [
244− "jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)",
245−]
246−
247−[[package]]
248−name = "cexpr"
249−version = "0.3.6"
250source = "registry+https://github.com/rust-lang/crates.io-index"
182source = "registry+https://github.com/rust-lang/crates.io-index"
183+checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee"
251dependencies = [
184dependencies = [
252− "nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
185+ "jobserver",
253]
186]
254
187
255[[package]]
188[[package]]
256name = "cfg-if"
189name = "cfg-if"
257−version = "0.1.10"
190+version = "1.0.0"
258−source = "registry+https://github.com/rust-lang/crates.io-index"
259−
260−[[package]]
261−name = "chrono"
262−version = "0.4.11"
263source = "registry+https://github.com/rust-lang/crates.io-index"
191source = "registry+https://github.com/rust-lang/crates.io-index"
264−dependencies = [
192+checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
265− "num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
266− "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
267− "time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
268−]
269
193
270[[package]]
194[[package]]
271−name = "clang-sys"
195+name = "clap"
272−version = "0.28.1"
196+version = "2.34.0"
273source = "registry+https://github.com/rust-lang/crates.io-index"
197source = "registry+https://github.com/rust-lang/crates.io-index"
198+checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c"
274dependencies = [
199dependencies = [
275− "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
200+ "ansi_term",
276− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
201+ "atty",
277− "libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
202+ "bitflags",
203+ "strsim",
204+ "term_size",
205+ "textwrap",
206+ "unicode-width",
207+ "vec_map",
278]
208]
279
209
280[[package]]
210[[package]]
281−name = "clap"
211+name = "clircle"
282−version = "2.33.0"
212+version = "0.3.0"
283source = "registry+https://github.com/rust-lang/crates.io-index"
213source = "registry+https://github.com/rust-lang/crates.io-index"
214+checksum = "e68bbd985a63de680ab4d1ad77b6306611a8f961b282c8b5ab513e6de934e396"
284dependencies = [
215dependencies = [
285− "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
216+ "cfg-if",
286− "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
217+ "libc",
287− "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
218+ "serde",
288− "strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
219+ "winapi",
289− "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
290− "textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
291− "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
292− "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
293]
220]
294
221
295[[package]]
222[[package]]
296name = "console"
223name = "console"
297−version = "0.11.2"
224+version = "0.15.0"
298source = "registry+https://github.com/rust-lang/crates.io-index"
225source = "registry+https://github.com/rust-lang/crates.io-index"
226+checksum = "a28b32d32ca44b70c3e4acd7db1babf555fa026e385fb95f18028f88848b3c31"
299dependencies = [
227dependencies = [
300− "encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
228+ "encode_unicode",
301− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
229+ "libc",
302− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
230+ "once_cell",
303− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
231+ "regex",
304− "terminal_size 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
232+ "terminal_size",
305− "termios 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
233+ "unicode-width",
306− "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
234+ "winapi",
307− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
308− "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
309]
235]
310
236
311−[[package]]
312−name = "constant_time_eq"
313−version = "0.1.5"
314−source = "registry+https://github.com/rust-lang/crates.io-index"
315−
316[[package]]
237[[package]]
317name = "content_inspector"
238name = "content_inspector"
318version = "0.2.4"
239version = "0.2.4"
319source = "registry+https://github.com/rust-lang/crates.io-index"
240source = "registry+https://github.com/rust-lang/crates.io-index"
241+checksum = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38"
320dependencies = [
242dependencies = [
321− "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
243+ "memchr",
322]
244]
323
245
324[[package]]
246[[package]]
325name = "crc32fast"
247name = "crc32fast"
326−version = "1.2.0"
248+version = "1.3.0"
327source = "registry+https://github.com/rust-lang/crates.io-index"
249source = "registry+https://github.com/rust-lang/crates.io-index"
250+checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836"
328dependencies = [
251dependencies = [
329− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
252+ "cfg-if",
330]
253]
331
254
332[[package]]
255[[package]]
333−name = "crossbeam-utils"
256+name = "difflib"
334−version = "0.7.2"
257+version = "0.4.0"
335source = "registry+https://github.com/rust-lang/crates.io-index"
258source = "registry+https://github.com/rust-lang/crates.io-index"
336−dependencies = [
259+checksum = "6184e33543162437515c2e2b48714794e37845ec9851711914eec9d308f6ebe8"
337− "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
338− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
339− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
340−]
341
260
342[[package]]
261[[package]]
343−name = "difference"
262+name = "dirs-next"
344version = "2.0.0"
263version = "2.0.0"
345source = "registry+https://github.com/rust-lang/crates.io-index"
264source = "registry+https://github.com/rust-lang/crates.io-index"
346−
265+checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1"
347−[[package]]
348−name = "digest"
349−version = "0.8.1"
350−source = "registry+https://github.com/rust-lang/crates.io-index"
351−dependencies = [
352− "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)",
353−]
354−
355−[[package]]
356−name = "dirs"
357−version = "2.0.2"
358−source = "registry+https://github.com/rust-lang/crates.io-index"
359dependencies = [
266dependencies = [
360− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
267+ "cfg-if",
361− "dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
268+ "dirs-sys-next",
362]
269]
363
270
364[[package]]
271[[package]]
365−name = "dirs-sys"
272+name = "dirs-sys-next"
366−version = "0.3.4"
273+version = "0.1.2"
367source = "registry+https://github.com/rust-lang/crates.io-index"
274source = "registry+https://github.com/rust-lang/crates.io-index"
275+checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d"
368dependencies = [
276dependencies = [
369− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
277+ "libc",
370− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
278+ "redox_users",
371− "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
279+ "winapi",
372− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
373]
280]
374
281
375[[package]]
282[[package]]
376name = "doc-comment"
283name = "doc-comment"
377version = "0.3.3"
284version = "0.3.3"
378source = "registry+https://github.com/rust-lang/crates.io-index"
285source = "registry+https://github.com/rust-lang/crates.io-index"
379−
286+checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
380−[[package]]
381−name = "dtoa"
382−version = "0.4.5"
383−source = "registry+https://github.com/rust-lang/crates.io-index"
384
287
385[[package]]
288[[package]]
386name = "either"
289name = "either"
387−version = "1.5.3"
290+version = "1.6.1"
388source = "registry+https://github.com/rust-lang/crates.io-index"
291source = "registry+https://github.com/rust-lang/crates.io-index"
292+checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
389
293
390[[package]]
294[[package]]
391name = "encode_unicode"
295name = "encode_unicode"
392version = "0.3.6"
296version = "0.3.6"
393source = "registry+https://github.com/rust-lang/crates.io-index"
297source = "registry+https://github.com/rust-lang/crates.io-index"
298+checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
394
299
395[[package]]
300[[package]]
396name = "encoding"
301name = "encoding"
397version = "0.2.33"
302version = "0.2.33"
398source = "registry+https://github.com/rust-lang/crates.io-index"
303source = "registry+https://github.com/rust-lang/crates.io-index"
304+checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
399dependencies = [
305dependencies = [
400− "encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
306+ "encoding-index-japanese",
401− "encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
307+ "encoding-index-korean",
402− "encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
308+ "encoding-index-simpchinese",
403− "encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
309+ "encoding-index-singlebyte",
404− "encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)",
310+ "encoding-index-tradchinese",
405]
311]
406
312
407[[package]]
313[[package]]
408name = "encoding-index-japanese"
314name = "encoding-index-japanese"
409version = "1.20141219.5"
315version = "1.20141219.5"
410source = "registry+https://github.com/rust-lang/crates.io-index"
316source = "registry+https://github.com/rust-lang/crates.io-index"
317+checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
411dependencies = [
318dependencies = [
412− "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
319+ "encoding_index_tests",
413]
320]
414
321
415[[package]]
322[[package]]
416name = "encoding-index-korean"
323name = "encoding-index-korean"
417version = "1.20141219.5"
324version = "1.20141219.5"
418source = "registry+https://github.com/rust-lang/crates.io-index"
325source = "registry+https://github.com/rust-lang/crates.io-index"
326+checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
419dependencies = [
327dependencies = [
420− "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
328+ "encoding_index_tests",
421]
329]
422
330
423[[package]]
331[[package]]
424name = "encoding-index-simpchinese"
332name = "encoding-index-simpchinese"
425version = "1.20141219.5"
333version = "1.20141219.5"
426source = "registry+https://github.com/rust-lang/crates.io-index"
334source = "registry+https://github.com/rust-lang/crates.io-index"
335+checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7"
427dependencies = [
336dependencies = [
428− "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
337+ "encoding_index_tests",
429]
338]
430
339
431[[package]]
340[[package]]
432name = "encoding-index-singlebyte"
341name = "encoding-index-singlebyte"
433version = "1.20141219.5"
342version = "1.20141219.5"
434source = "registry+https://github.com/rust-lang/crates.io-index"
343source = "registry+https://github.com/rust-lang/crates.io-index"
344+checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a"
435dependencies = [
345dependencies = [
436− "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
346+ "encoding_index_tests",
437]
347]
438
348
439[[package]]
349[[package]]
440name = "encoding-index-tradchinese"
350name = "encoding-index-tradchinese"
441version = "1.20141219.5"
351version = "1.20141219.5"
442source = "registry+https://github.com/rust-lang/crates.io-index"
352source = "registry+https://github.com/rust-lang/crates.io-index"
353+checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
443dependencies = [
354dependencies = [
444− "encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
355+ "encoding_index_tests",
445]
356]
446
357
447[[package]]
358[[package]]
448name = "encoding_index_tests"
359name = "encoding_index_tests"
449version = "0.1.4"
360version = "0.1.4"
450source = "registry+https://github.com/rust-lang/crates.io-index"
361source = "registry+https://github.com/rust-lang/crates.io-index"
362+checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
451
363
452[[package]]
364[[package]]
453−name = "env_logger"
365+name = "fancy-regex"
454−version = "0.6.2"
366+version = "0.7.1"
455−source = "registry+https://github.com/rust-lang/crates.io-index"
456−dependencies = [
457− "atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)",
458− "humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
459− "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
460− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
461− "termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
462−]
463−
464−[[package]]
465−name = "error-chain"
466−version = "0.12.2"
467source = "registry+https://github.com/rust-lang/crates.io-index"
367source = "registry+https://github.com/rust-lang/crates.io-index"
368+checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf"
468dependencies = [
369dependencies = [
469− "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
370+ "bit-set",
371+ "regex",
470]
372]
471
373
472[[package]]
374[[package]]
473−name = "failure"
375+name = "fastrand"
474−version = "0.1.7"
376+version = "1.7.0"
475source = "registry+https://github.com/rust-lang/crates.io-index"
377source = "registry+https://github.com/rust-lang/crates.io-index"
378+checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf"
476dependencies = [
379dependencies = [
477− "backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)",
380+ "instant",
478]
381]
479
382
480[[package]]
383[[package]]
481−name = "fake-simd"
384+name = "flate2"
482−version = "0.1.2"
385+version = "1.0.23"
483−source = "registry+https://github.com/rust-lang/crates.io-index"
484−
485−[[package]]
486−name = "fancy-regex"
487−version = "0.3.3"
488source = "registry+https://github.com/rust-lang/crates.io-index"
386source = "registry+https://github.com/rust-lang/crates.io-index"
387+checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af"
489dependencies = [
388dependencies = [
490− "bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
389+ "cfg-if",
491− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
390+ "crc32fast",
391+ "libc",
392+ "miniz_oxide",
492]
393]
493
394
494[[package]]
395[[package]]
495−name = "flate2"
396+name = "float-cmp"
496−version = "1.0.14"
397+version = "0.9.0"
497source = "registry+https://github.com/rust-lang/crates.io-index"
398source = "registry+https://github.com/rust-lang/crates.io-index"
399+checksum = "98de4bbd547a563b716d8dfa9aad1cb19bfab00f4fa09a6a4ed21dbcf44ce9c4"
498dependencies = [
400dependencies = [
499− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
401+ "num-traits",
500− "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
501− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
502− "miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
503]
402]
504
403
505[[package]]
404[[package]]
506name = "fnv"
405name = "fnv"
507−version = "1.0.6"
406+version = "1.0.7"
508source = "registry+https://github.com/rust-lang/crates.io-index"
407source = "registry+https://github.com/rust-lang/crates.io-index"
408+checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
509
409
510[[package]]
410[[package]]
511−name = "fuchsia-cprng"
411+name = "form_urlencoded"
512−version = "0.1.1"
412+version = "1.0.1"
513source = "registry+https://github.com/rust-lang/crates.io-index"
413source = "registry+https://github.com/rust-lang/crates.io-index"
414+checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191"
415+dependencies = [
416+ "matches",
417+ "percent-encoding",
418+]
514
419
515[[package]]
420[[package]]
516−name = "fxhash"
421+name = "getrandom"
517−version = "0.2.1"
422+version = "0.2.3"
518source = "registry+https://github.com/rust-lang/crates.io-index"
423source = "registry+https://github.com/rust-lang/crates.io-index"
424+checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
519dependencies = [
425dependencies = [
520− "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
426+ "cfg-if",
427+ "libc",
428+ "wasi",
521]
429]
522
430
523[[package]]
431[[package]]
524−name = "generic-array"
432+name = "git-version"
525−version = "0.12.3"
433+version = "0.3.5"
526source = "registry+https://github.com/rust-lang/crates.io-index"
434source = "registry+https://github.com/rust-lang/crates.io-index"
435+checksum = "f6b0decc02f4636b9ccad390dcbe77b722a77efedfa393caf8379a51d5c61899"
527dependencies = [
436dependencies = [
528− "typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
437+ "git-version-macro",
438+ "proc-macro-hack",
529]
439]
530
440
531[[package]]
441[[package]]
532−name = "getrandom"
442+name = "git-version-macro"
533−version = "0.1.14"
443+version = "0.3.5"
534source = "registry+https://github.com/rust-lang/crates.io-index"
444source = "registry+https://github.com/rust-lang/crates.io-index"
445+checksum = "fe69f1cbdb6e28af2bac214e943b99ce8a0a06b447d15d3e61161b0423139f3f"
535dependencies = [
446dependencies = [
536− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
447+ "proc-macro-hack",
537− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
448+ "proc-macro2",
538− "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)",
449+ "quote",
450+ "syn",
539]
451]
540
452
541[[package]]
453[[package]]
542name = "git2"
454name = "git2"
543−version = "0.13.5"
455+version = "0.14.2"
544source = "registry+https://github.com/rust-lang/crates.io-index"
456source = "registry+https://github.com/rust-lang/crates.io-index"
457+checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c"
545dependencies = [
458dependencies = [
546− "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
459+ "bitflags",
547− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
460+ "libc",
548− "libgit2-sys 0.12.5+1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
461+ "libgit2-sys",
549− "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
462+ "log",
550− "url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
463+ "url",
551]
464]
552
465
553[[package]]
466[[package]]
554name = "glob"
467name = "glob"
555version = "0.3.0"
468version = "0.3.0"
556source = "registry+https://github.com/rust-lang/crates.io-index"
469source = "registry+https://github.com/rust-lang/crates.io-index"
470+checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
557
471
558[[package]]
472[[package]]
559name = "globset"
473name = "globset"
560−version = "0.4.5"
474+version = "0.4.8"
561source = "registry+https://github.com/rust-lang/crates.io-index"
475source = "registry+https://github.com/rust-lang/crates.io-index"
476+checksum = "10463d9ff00a2a068db14231982f5132edebad0d7660cd956a1c30292dbcbfbd"
562dependencies = [
477dependencies = [
563− "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
478+ "aho-corasick",
564− "bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
479+ "bstr",
565− "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
480+ "fnv",
566− "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
481+ "log",
567− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
482+ "regex",
568]
483]
569
484
570[[package]]
485[[package]]
571−name = "hermit-abi"
486+name = "grep-cli"
572−version = "0.1.11"
487+version = "0.1.6"
573source = "registry+https://github.com/rust-lang/crates.io-index"
488source = "registry+https://github.com/rust-lang/crates.io-index"
489+checksum = "2dd110c34bb4460d0de5062413b773e385cbf8a85a63fc535590110a09e79e8a"
574dependencies = [
490dependencies = [
575− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
491+ "atty",
492+ "bstr",
493+ "globset",
494+ "lazy_static",
495+ "log",
496+ "regex",
497+ "same-file",
498+ "termcolor",
499+ "winapi-util",
576]
500]
577
501
578[[package]]
502[[package]]
579−name = "humantime"
503+name = "hashbrown"
580−version = "1.3.0"
504+version = "0.11.2"
581source = "registry+https://github.com/rust-lang/crates.io-index"
505source = "registry+https://github.com/rust-lang/crates.io-index"
582−dependencies = [
506+checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
583− "quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
584−]
585
507
586[[package]]
508[[package]]
587−name = "idna"
509+name = "hermit-abi"
588−version = "0.1.5"
510+version = "0.1.19"
589source = "registry+https://github.com/rust-lang/crates.io-index"
511source = "registry+https://github.com/rust-lang/crates.io-index"
512+checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
590dependencies = [
513dependencies = [
591− "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
514+ "libc",
592− "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
593− "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
594]
515]
595
516
596[[package]]
517[[package]]
597name = "idna"
518name = "idna"
598−version = "0.2.0"
519+version = "0.2.3"
599source = "registry+https://github.com/rust-lang/crates.io-index"
520source = "registry+https://github.com/rust-lang/crates.io-index"
521+checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
600dependencies = [
522dependencies = [
601− "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
523+ "matches",
602− "unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
524+ "unicode-bidi",
603− "unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
525+ "unicode-normalization",
604]
526]
605
527
606[[package]]
528[[package]]
607name = "indexmap"
529name = "indexmap"
608−version = "1.3.2"
530+version = "1.7.0"
609source = "registry+https://github.com/rust-lang/crates.io-index"
531source = "registry+https://github.com/rust-lang/crates.io-index"
532+checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
610dependencies = [
533dependencies = [
611− "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
534+ "autocfg",
535+ "hashbrown",
612]
536]
613
537
614[[package]]
538[[package]]
615−name = "itertools"
539+name = "instant"
616−version = "0.8.2"
540+version = "0.1.12"
617source = "registry+https://github.com/rust-lang/crates.io-index"
541source = "registry+https://github.com/rust-lang/crates.io-index"
542+checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
618dependencies = [
543dependencies = [
619− "either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)",
544+ "cfg-if",
620]
545]
621
546
622[[package]]
547[[package]]
623−name = "itoa"
548+name = "itertools"
624−version = "0.4.5"
549+version = "0.10.3"
625source = "registry+https://github.com/rust-lang/crates.io-index"
550source = "registry+https://github.com/rust-lang/crates.io-index"
551+checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3"
552+dependencies = [
553+ "either",
554+]
626
555
627[[package]]
556[[package]]
628−name = "jobserver"
557+name = "itoa"
629−version = "0.1.21"
558+version = "0.4.8"
630source = "registry+https://github.com/rust-lang/crates.io-index"
559source = "registry+https://github.com/rust-lang/crates.io-index"
631−dependencies = [
560+checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4"
632− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
633−]
634
561
635[[package]]
562[[package]]
636−name = "kernel32-sys"
563+name = "itoa"
637−version = "0.2.2"
564+version = "1.0.1"
638source = "registry+https://github.com/rust-lang/crates.io-index"
565source = "registry+https://github.com/rust-lang/crates.io-index"
639−dependencies = [
566+checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35"
640− "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
641− "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
642−]
643
567
644[[package]]
568[[package]]
645−name = "kstring"
569+name = "jobserver"
646−version = "0.1.0"
570+version = "0.1.24"
647source = "registry+https://github.com/rust-lang/crates.io-index"
571source = "registry+https://github.com/rust-lang/crates.io-index"
572+checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa"
648dependencies = [
573dependencies = [
649− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
574+ "libc",
650]
575]
651
576
652[[package]]
577[[package]]
653name = "lazy_static"
578name = "lazy_static"
654version = "1.4.0"
579version = "1.4.0"
655source = "registry+https://github.com/rust-lang/crates.io-index"
580source = "registry+https://github.com/rust-lang/crates.io-index"
656−
581+checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
657−[[package]]
658−name = "lazycell"
659−version = "1.2.1"
660−source = "registry+https://github.com/rust-lang/crates.io-index"
661
582
662[[package]]
583[[package]]
663name = "libc"
584name = "libc"
664−version = "0.2.69"
585+version = "0.2.125"
665source = "registry+https://github.com/rust-lang/crates.io-index"
586source = "registry+https://github.com/rust-lang/crates.io-index"
587+checksum = "5916d2ae698f6de9bfb891ad7a8d65c09d232dc58cc4ac433c7da3b2fd84bc2b"
666
588
667[[package]]
589[[package]]
668name = "libgit2-sys"
590name = "libgit2-sys"
669−version = "0.12.5+1.0.0"
591+version = "0.13.2+1.4.2"
670−source = "registry+https://github.com/rust-lang/crates.io-index"
671−dependencies = [
672− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
673− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
674− "libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)",
675− "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
676−]
677−
678−[[package]]
679−name = "libloading"
680−version = "0.5.2"
681source = "registry+https://github.com/rust-lang/crates.io-index"
592source = "registry+https://github.com/rust-lang/crates.io-index"
593+checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b"
682dependencies = [
594dependencies = [
683− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
595+ "cc",
684− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
596+ "libc",
597+ "libz-sys",
598+ "pkg-config",
685]
599]
686
600
687[[package]]
601[[package]]
688name = "libz-sys"
602name = "libz-sys"
689−version = "1.0.25"
603+version = "1.1.3"
690source = "registry+https://github.com/rust-lang/crates.io-index"
604source = "registry+https://github.com/rust-lang/crates.io-index"
605+checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66"
691dependencies = [
606dependencies = [
692− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
607+ "cc",
693− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
608+ "libc",
694− "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
609+ "pkg-config",
695− "vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
610+ "vcpkg",
696]
611]
697
612
698[[package]]
613[[package]]
699name = "line-wrap"
614name = "line-wrap"
700version = "0.1.1"
615version = "0.1.1"
701source = "registry+https://github.com/rust-lang/crates.io-index"
616source = "registry+https://github.com/rust-lang/crates.io-index"
617+checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
702dependencies = [
618dependencies = [
703− "safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
619+ "safemem",
704]
620]
705
621
706[[package]]
622[[package]]
707name = "linked-hash-map"
623name = "linked-hash-map"
708−version = "0.5.2"
624+version = "0.5.4"
709−source = "registry+https://github.com/rust-lang/crates.io-index"
710−
711−[[package]]
712−name = "liquid"
713−version = "0.20.0"
714source = "registry+https://github.com/rust-lang/crates.io-index"
625source = "registry+https://github.com/rust-lang/crates.io-index"
715−dependencies = [
626+checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3"
716− "doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
717− "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
718− "liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
719− "liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
720− "liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
721− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
722−]
723−
724−[[package]]
725−name = "liquid-core"
726−version = "0.20.0"
727−source = "registry+https://github.com/rust-lang/crates.io-index"
728−dependencies = [
729− "anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
730− "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
731− "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
732− "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
733− "liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
734− "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
735− "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
736− "pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
737− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
738−]
739−
740−[[package]]
741−name = "liquid-derive"
742−version = "0.20.0"
743−source = "registry+https://github.com/rust-lang/crates.io-index"
744−dependencies = [
745− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
746− "proc-quote 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
747− "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
748−]
749
627
750[[package]]
628[[package]]
751−name = "liquid-lib"
629+name = "lock_api"
752−version = "0.20.0"
630+version = "0.4.5"
753source = "registry+https://github.com/rust-lang/crates.io-index"
631source = "registry+https://github.com/rust-lang/crates.io-index"
632+checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109"
754dependencies = [
633dependencies = [
755− "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
634+ "scopeguard",
756− "itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
757− "kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
758− "liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)",
759− "once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
760− "regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
761− "unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
762− "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
763]
635]
764
636
765[[package]]
637[[package]]
766name = "log"
638name = "log"
767−version = "0.4.8"
639+version = "0.4.14"
768source = "registry+https://github.com/rust-lang/crates.io-index"
640source = "registry+https://github.com/rust-lang/crates.io-index"
641+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
769dependencies = [
642dependencies = [
770− "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
643+ "cfg-if",
771]
644]
772
645
773−[[package]]
774−name = "maplit"
775−version = "1.0.2"
776−source = "registry+https://github.com/rust-lang/crates.io-index"
777−
778[[package]]
646[[package]]
779name = "matches"
647name = "matches"
780−version = "0.1.8"
648+version = "0.1.9"
781source = "registry+https://github.com/rust-lang/crates.io-index"
649source = "registry+https://github.com/rust-lang/crates.io-index"
650+checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f"
782
651
783[[package]]
652[[package]]
784name = "memchr"
653name = "memchr"
785−version = "2.3.3"
654+version = "2.4.1"
786source = "registry+https://github.com/rust-lang/crates.io-index"
655source = "registry+https://github.com/rust-lang/crates.io-index"
656+checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a"
787
657
788[[package]]
658[[package]]
789name = "miniz_oxide"
659name = "miniz_oxide"
790−version = "0.3.6"
660+version = "0.5.1"
791source = "registry+https://github.com/rust-lang/crates.io-index"
661source = "registry+https://github.com/rust-lang/crates.io-index"
662+checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082"
792dependencies = [
663dependencies = [
793− "adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
664+ "adler",
794]
665]
795
666
796[[package]]
667[[package]]
797−name = "nom"
668+name = "nix"
798−version = "4.2.3"
669+version = "0.24.1"
799source = "registry+https://github.com/rust-lang/crates.io-index"
670source = "registry+https://github.com/rust-lang/crates.io-index"
671+checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9"
800dependencies = [
672dependencies = [
801− "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
673+ "bitflags",
802− "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
674+ "cfg-if",
675+ "libc",
803]
676]
804
677
805[[package]]
678[[package]]
806−name = "num-integer"
679+name = "normalize-line-endings"
807−version = "0.1.42"
680+version = "0.3.0"
808source = "registry+https://github.com/rust-lang/crates.io-index"
681source = "registry+https://github.com/rust-lang/crates.io-index"
809−dependencies = [
682+checksum = "61807f77802ff30975e01f4f071c8ba10c022052f98b3294119f3e615d13e5be"
810− "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
811− "num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
812−]
813
683
814[[package]]
684[[package]]
815name = "num-traits"
685name = "num-traits"
816−version = "0.2.11"
686+version = "0.2.14"
817source = "registry+https://github.com/rust-lang/crates.io-index"
687source = "registry+https://github.com/rust-lang/crates.io-index"
688+checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290"
818dependencies = [
689dependencies = [
819− "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
690+ "autocfg",
820]
691]
821
692
822[[package]]
693[[package]]
823name = "once_cell"
694name = "once_cell"
824−version = "1.3.1"
695+version = "1.10.0"
825source = "registry+https://github.com/rust-lang/crates.io-index"
696source = "registry+https://github.com/rust-lang/crates.io-index"
697+checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9"
826
698
827[[package]]
699[[package]]
828name = "onig"
700name = "onig"
829−version = "5.0.0"
701+version = "6.3.1"
830source = "registry+https://github.com/rust-lang/crates.io-index"
702source = "registry+https://github.com/rust-lang/crates.io-index"
703+checksum = "67ddfe2c93bb389eea6e6d713306880c7f6dcc99a75b659ce145d962c861b225"
831dependencies = [
704dependencies = [
832− "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
705+ "bitflags",
833− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
706+ "lazy_static",
834− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
707+ "libc",
835− "onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
708+ "onig_sys",
836]
709]
837
710
838[[package]]
711[[package]]
839name = "onig_sys"
712name = "onig_sys"
840−version = "69.2.0"
713+version = "69.7.1"
841source = "registry+https://github.com/rust-lang/crates.io-index"
714source = "registry+https://github.com/rust-lang/crates.io-index"
715+checksum = "5dd3eee045c84695b53b20255bb7317063df090b68e18bfac0abb6c39cf7f33e"
842dependencies = [
716dependencies = [
843− "bindgen 0.50.1 (registry+https://github.com/rust-lang/crates.io-index)",
717+ "cc",
844− "cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)",
718+ "pkg-config",
845− "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)",
846]
719]
847
720
848[[package]]
721[[package]]
849−name = "opaque-debug"
722+name = "parking_lot"
850−version = "0.2.3"
851−source = "registry+https://github.com/rust-lang/crates.io-index"
852−
853−[[package]]
854−name = "peeking_take_while"
855−version = "0.1.2"
723+version = "0.11.2"
856−source = "registry+https://github.com/rust-lang/crates.io-index"
857−
858−[[package]]
859−name = "percent-encoding"
860−version = "1.0.1"
861−source = "registry+https://github.com/rust-lang/crates.io-index"
862−
863−[[package]]
864−name = "percent-encoding"
865−version = "2.1.0"
866−source = "registry+https://github.com/rust-lang/crates.io-index"
867−
868−[[package]]
869−name = "pest"
870−version = "2.1.3"
871source = "registry+https://github.com/rust-lang/crates.io-index"
724source = "registry+https://github.com/rust-lang/crates.io-index"
725+checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99"
872dependencies = [
726dependencies = [
873− "ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
727+ "instant",
728+ "lock_api",
729+ "parking_lot_core",
874]
730]
875
731
876[[package]]
732[[package]]
877−name = "pest_derive"
733+name = "parking_lot_core"
878−version = "2.1.0"
734+version = "0.8.5"
879source = "registry+https://github.com/rust-lang/crates.io-index"
735source = "registry+https://github.com/rust-lang/crates.io-index"
736+checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216"
880dependencies = [
737dependencies = [
881− "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
738+ "cfg-if",
882− "pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
739+ "instant",
740+ "libc",
741+ "redox_syscall",
742+ "smallvec",
743+ "winapi",
883]
744]
884
745
885[[package]]
746[[package]]
886−name = "pest_generator"
747+name = "path_abs"
887−version = "2.1.3"
748+version = "0.5.1"
888source = "registry+https://github.com/rust-lang/crates.io-index"
749source = "registry+https://github.com/rust-lang/crates.io-index"
750+checksum = "05ef02f6342ac01d8a93b65f96db53fe68a92a15f41144f97fb00a9e669633c3"
889dependencies = [
751dependencies = [
890− "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
752+ "std_prelude",
891− "pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
892− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
893− "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
894− "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
895]
753]
896
754
897[[package]]
755[[package]]
898−name = "pest_meta"
756+name = "percent-encoding"
899−version = "2.1.3"
757+version = "2.1.0"
900source = "registry+https://github.com/rust-lang/crates.io-index"
758source = "registry+https://github.com/rust-lang/crates.io-index"
901−dependencies = [
759+checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
902− "maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
903− "pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
904− "sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
905−]
906
760
907[[package]]
761[[package]]
908name = "pkg-config"
762name = "pkg-config"
909−version = "0.3.17"
763+version = "0.3.24"
910source = "registry+https://github.com/rust-lang/crates.io-index"
764source = "registry+https://github.com/rust-lang/crates.io-index"
765+checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe"
911
766
912[[package]]
767[[package]]
913name = "plist"
768name = "plist"
914−version = "0.5.5"
769+version = "1.3.1"
915source = "registry+https://github.com/rust-lang/crates.io-index"
770source = "registry+https://github.com/rust-lang/crates.io-index"
771+checksum = "bd39bc6cdc9355ad1dc5eeedefee696bb35c34caf21768741e81826c0bbd7225"
916dependencies = [
772dependencies = [
917− "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)",
773+ "base64",
918− "chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)",
774+ "indexmap",
919− "indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
775+ "line-wrap",
920− "line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
776+ "serde",
921− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
777+ "time",
922− "xml-rs 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)",
778+ "xml-rs",
923]
779]
924
780
925[[package]]
781[[package]]
926name = "predicates"
782name = "predicates"
927−version = "1.0.4"
783+version = "2.1.1"
928source = "registry+https://github.com/rust-lang/crates.io-index"
784source = "registry+https://github.com/rust-lang/crates.io-index"
785+checksum = "a5aab5be6e4732b473071984b3164dbbfb7a3674d30ea5ff44410b6bcd960c3c"
929dependencies = [
786dependencies = [
930− "difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
787+ "difflib",
931− "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
788+ "float-cmp",
789+ "itertools",
790+ "normalize-line-endings",
791+ "predicates-core",
792+ "regex",
932]
793]
933
794
934[[package]]
795[[package]]
935name = "predicates-core"
796name = "predicates-core"
936−version = "1.0.0"
797+version = "1.0.2"
937source = "registry+https://github.com/rust-lang/crates.io-index"
798source = "registry+https://github.com/rust-lang/crates.io-index"
799+checksum = "57e35a3326b75e49aa85f5dc6ec15b41108cf5aee58eabb1f274dd18b73c2451"
938
800
939[[package]]
801[[package]]
940name = "predicates-tree"
802name = "predicates-tree"
941−version = "1.0.0"
803+version = "1.0.4"
942−source = "registry+https://github.com/rust-lang/crates.io-index"
943−dependencies = [
944− "predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
945− "treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
946−]
947−
948−[[package]]
949−name = "proc-macro-hack"
950−version = "0.5.15"
951−source = "registry+https://github.com/rust-lang/crates.io-index"
952−
953−[[package]]
954−name = "proc-macro2"
955−version = "0.4.30"
956−source = "registry+https://github.com/rust-lang/crates.io-index"
957−dependencies = [
958− "unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
959−]
960−
961−[[package]]
962−name = "proc-macro2"
963−version = "1.0.10"
964source = "registry+https://github.com/rust-lang/crates.io-index"
804source = "registry+https://github.com/rust-lang/crates.io-index"
805+checksum = "338c7be2905b732ae3984a2f40032b5e94fd8f52505b186c7d4d68d193445df7"
965dependencies = [
806dependencies = [
966− "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
807+ "predicates-core",
808+ "termtree",
967]
809]
968
810
969[[package]]
811[[package]]
970−name = "proc-quote"
812+name = "proc-macro-error"
971−version = "0.3.2"
813+version = "1.0.4"
972source = "registry+https://github.com/rust-lang/crates.io-index"
814source = "registry+https://github.com/rust-lang/crates.io-index"
815+checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
973dependencies = [
816dependencies = [
974− "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
817+ "proc-macro-error-attr",
975− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
818+ "proc-macro2",
976− "proc-quote-impl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
819+ "quote",
977− "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
820+ "syn",
978− "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
821+ "version_check",
979]
822]
980
823
981[[package]]
824[[package]]
982−name = "proc-quote-impl"
825+name = "proc-macro-error-attr"
983−version = "0.3.2"
826+version = "1.0.4"
984source = "registry+https://github.com/rust-lang/crates.io-index"
827source = "registry+https://github.com/rust-lang/crates.io-index"
828+checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
985dependencies = [
829dependencies = [
986− "proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)",
830+ "proc-macro2",
987− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
831+ "quote",
988− "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
832+ "version_check",
989]
833]
990
834
991[[package]]
835[[package]]
992−name = "quick-error"
836+name = "proc-macro-hack"
993−version = "1.2.3"
837+version = "0.5.19"
994source = "registry+https://github.com/rust-lang/crates.io-index"
838source = "registry+https://github.com/rust-lang/crates.io-index"
839+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
995
840
996[[package]]
841[[package]]
997−name = "quote"
842+name = "proc-macro2"
998−version = "0.6.13"
843+version = "1.0.36"
999source = "registry+https://github.com/rust-lang/crates.io-index"
844source = "registry+https://github.com/rust-lang/crates.io-index"
845+checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029"
1000dependencies = [
846dependencies = [
1001− "proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)",
847+ "unicode-xid",
1002]
848]
1003
849
1004[[package]]
850[[package]]
1005name = "quote"
851name = "quote"
1006−version = "1.0.3"
852+version = "1.0.14"
1007−source = "registry+https://github.com/rust-lang/crates.io-index"
1008−dependencies = [
1009− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
1010−]
1011−
1012−[[package]]
1013−name = "rand"
1014−version = "0.4.6"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
853source = "registry+https://github.com/rust-lang/crates.io-index"
854+checksum = "47aa80447ce4daf1717500037052af176af5d38cc3e571d9ec1c7353fc10c87d"
1016dependencies = [
855dependencies = [
1017− "fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
856+ "proc-macro2",
1018− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1019− "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
1020− "rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1021− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
1022]
857]
1023
858
1024[[package]]
859[[package]]
1025−name = "rand_core"
860+name = "redox_syscall"
1026−version = "0.3.1"
861+version = "0.2.10"
1027source = "registry+https://github.com/rust-lang/crates.io-index"
862source = "registry+https://github.com/rust-lang/crates.io-index"
863+checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff"
1028dependencies = [
864dependencies = [
1029− "rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
865+ "bitflags",
1030]
866]
1031
867
1032[[package]]
868[[package]]
1033−name = "rand_core"
869+name = "redox_users"
1034−version = "0.4.2"
1035−source = "registry+https://github.com/rust-lang/crates.io-index"
1036−
1037−[[package]]
1038−name = "rdrand"
1039version = "0.4.0"
870version = "0.4.0"
1040source = "registry+https://github.com/rust-lang/crates.io-index"
871source = "registry+https://github.com/rust-lang/crates.io-index"
872+checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
1041dependencies = [
873dependencies = [
1042− "rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
874+ "getrandom",
875+ "redox_syscall",
1043]
876]
1044
877
1045[[package]]
878[[package]]
1046−name = "redox_syscall"
879+name = "regex"
1047−version = "0.1.56"
880+version = "1.5.5"
1048−source = "registry+https://github.com/rust-lang/crates.io-index"
1049−
1050−[[package]]
1051−name = "redox_users"
1052−version = "0.3.4"
1053source = "registry+https://github.com/rust-lang/crates.io-index"
881source = "registry+https://github.com/rust-lang/crates.io-index"
882+checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286"
1054dependencies = [
883dependencies = [
1055− "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
884+ "aho-corasick",
1056− "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)",
885+ "memchr",
1057− "rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
886+ "regex-syntax",
1058]
887]
1059
888
1060[[package]]
889[[package]]
1061−name = "regex"
890+name = "regex-automata"
1062−version = "1.3.7"
891+version = "0.1.10"
1063source = "registry+https://github.com/rust-lang/crates.io-index"
892source = "registry+https://github.com/rust-lang/crates.io-index"
1064−dependencies = [
893+checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132"
1065− "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)",
1066− "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
1067− "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
1068− "thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1069−]
1070
894
1071[[package]]
895[[package]]
1072name = "regex-syntax"
896name = "regex-syntax"
1073−version = "0.6.17"
897+version = "0.6.25"
1074source = "registry+https://github.com/rust-lang/crates.io-index"
898source = "registry+https://github.com/rust-lang/crates.io-index"
899+checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b"
1075
900
1076[[package]]
901[[package]]
1077name = "remove_dir_all"
902name = "remove_dir_all"
1078−version = "0.5.2"
903+version = "0.5.3"
1079source = "registry+https://github.com/rust-lang/crates.io-index"
904source = "registry+https://github.com/rust-lang/crates.io-index"
905+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
1080dependencies = [
906dependencies = [
1081− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
907+ "winapi",
1082]
908]
1083
909
1084[[package]]
910[[package]]
1085−name = "rust-argon2"
911+name = "rgb"
1086−version = "0.7.0"
912+version = "0.8.31"
1087source = "registry+https://github.com/rust-lang/crates.io-index"
913source = "registry+https://github.com/rust-lang/crates.io-index"
914+checksum = "9a374af9a0e5fdcdd98c1c7b64f05004f9ea2555b6c75f211daa81268a3c50f1"
1088dependencies = [
915dependencies = [
1089− "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
916+ "bytemuck",
1090− "blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
1091− "constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
1092− "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
1093]
917]
1094
918
1095[[package]]
919[[package]]
1096−name = "rustc-demangle"
920+name = "rustversion"
1097−version = "0.1.16"
921+version = "1.0.6"
1098source = "registry+https://github.com/rust-lang/crates.io-index"
922source = "registry+https://github.com/rust-lang/crates.io-index"
923+checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f"
1099
924
1100[[package]]
925[[package]]
1101name = "ryu"
926name = "ryu"
1102−version = "1.0.3"
927+version = "1.0.9"
1103source = "registry+https://github.com/rust-lang/crates.io-index"
928source = "registry+https://github.com/rust-lang/crates.io-index"
929+checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f"
1104
930
1105[[package]]
931[[package]]
1106name = "safemem"
932name = "safemem"
1107version = "0.3.3"
933version = "0.3.3"
1108source = "registry+https://github.com/rust-lang/crates.io-index"
934source = "registry+https://github.com/rust-lang/crates.io-index"
935+checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
1109
936
1110[[package]]
937[[package]]
1111name = "same-file"
938name = "same-file"
1112version = "1.0.6"
939version = "1.0.6"
1113source = "registry+https://github.com/rust-lang/crates.io-index"
940source = "registry+https://github.com/rust-lang/crates.io-index"
941+checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
1114dependencies = [
942dependencies = [
1115− "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
943+ "winapi-util",
1116]
944]
1117
945
1118[[package]]
946[[package]]
1119−name = "semver"
947+name = "scopeguard"
1120−version = "0.9.0"
948+version = "1.1.0"
1121source = "registry+https://github.com/rust-lang/crates.io-index"
949source = "registry+https://github.com/rust-lang/crates.io-index"
1122−dependencies = [
950+checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
1123− "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
1124−]
1125
951
1126[[package]]
952[[package]]
1127−name = "semver-parser"
953+name = "semver"
1128−version = "0.7.0"
954+version = "1.0.7"
1129source = "registry+https://github.com/rust-lang/crates.io-index"
955source = "registry+https://github.com/rust-lang/crates.io-index"
956+checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4"
1130
957
1131[[package]]
958[[package]]
1132name = "serde"
959name = "serde"
1133−version = "1.0.106"
960+version = "1.0.136"
1134source = "registry+https://github.com/rust-lang/crates.io-index"
961source = "registry+https://github.com/rust-lang/crates.io-index"
962+checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789"
1135dependencies = [
963dependencies = [
1136− "serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
964+ "serde_derive",
1137]
965]
1138
966
1139[[package]]
967[[package]]
1140name = "serde_derive"
968name = "serde_derive"
1141−version = "1.0.106"
969+version = "1.0.136"
1142source = "registry+https://github.com/rust-lang/crates.io-index"
970source = "registry+https://github.com/rust-lang/crates.io-index"
971+checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9"
1143dependencies = [
972dependencies = [
1144− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
973+ "proc-macro2",
1145− "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
974+ "quote",
1146− "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)",
975+ "syn",
1147]
976]
1148
977
1149[[package]]
978[[package]]
1150name = "serde_json"
979name = "serde_json"
1151−version = "1.0.51"
980+version = "1.0.74"
1152source = "registry+https://github.com/rust-lang/crates.io-index"
981source = "registry+https://github.com/rust-lang/crates.io-index"
982+checksum = "ee2bb9cd061c5865d345bb02ca49fcef1391741b672b54a0bf7b679badec3142"
1153dependencies = [
983dependencies = [
1154− "itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
984+ "itoa 1.0.1",
1155− "ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
985+ "ryu",
1156− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
986+ "serde",
1157]
987]
1158
988
1159[[package]]
989[[package]]
1160name = "serde_yaml"
990name = "serde_yaml"
1161−version = "0.8.11"
991+version = "0.8.23"
1162source = "registry+https://github.com/rust-lang/crates.io-index"
992source = "registry+https://github.com/rust-lang/crates.io-index"
993+checksum = "a4a521f2940385c165a24ee286aa8599633d162077a54bdcae2a6fd5a7bfa7a0"
1163dependencies = [
994dependencies = [
1164− "dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
995+ "indexmap",
1165− "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
996+ "ryu",
1166− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
997+ "serde",
1167− "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
998+ "yaml-rust",
1168]
999]
1169
1000
1170[[package]]
1001[[package]]
1171−name = "sha-1"
1002+name = "serial_test"
1172−version = "0.8.2"
1003+version = "0.6.0"
1173source = "registry+https://github.com/rust-lang/crates.io-index"
1004source = "registry+https://github.com/rust-lang/crates.io-index"
1005+checksum = "e5bcc41d18f7a1d50525d080fd3e953be87c4f9f1a974f3c21798ca00d54ec15"
1174dependencies = [
1006dependencies = [
1175− "block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
1007+ "lazy_static",
1176− "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
1008+ "parking_lot",
1177− "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
1009+ "serial_test_derive",
1178− "opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
1179]
1010]
1180
1011
1181[[package]]
1012[[package]]
1182−name = "shell-words"
1013+name = "serial_test_derive"
1183−version = "0.1.0"
1014+version = "0.6.0"
1184source = "registry+https://github.com/rust-lang/crates.io-index"
1015source = "registry+https://github.com/rust-lang/crates.io-index"
1016+checksum = "2881bccd7d60fb32dfa3d7b3136385312f8ad75e2674aab2852867a09790cae8"
1017+dependencies = [
1018+ "proc-macro-error",
1019+ "proc-macro2",
1020+ "quote",
1021+ "rustversion",
1022+ "syn",
1023+]
1185
1024
1186[[package]]
1025[[package]]
1187−name = "shlex"
1026+name = "shell-escape"
1188−version = "0.1.1"
1027+version = "0.1.5"
1028+source = "registry+https://github.com/rust-lang/crates.io-index"
1029+checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f"
1030+
1031+[[package]]
1032+name = "shell-words"
1033+version = "1.1.0"
1189source = "registry+https://github.com/rust-lang/crates.io-index"
1034source = "registry+https://github.com/rust-lang/crates.io-index"
1035+checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde"
1190
1036
1191[[package]]
1037[[package]]
1192name = "smallvec"
1038name = "smallvec"
1193−version = "1.3.0"
1039+version = "1.7.0"
1040+source = "registry+https://github.com/rust-lang/crates.io-index"
1041+checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309"
1042+
1043+[[package]]
1044+name = "std_prelude"
1045+version = "0.2.12"
1194source = "registry+https://github.com/rust-lang/crates.io-index"
1046source = "registry+https://github.com/rust-lang/crates.io-index"
1047+checksum = "8207e78455ffdf55661170876f88daf85356e4edd54e0a3dbc79586ca1e50cbe"
1195
1048
1196[[package]]
1049[[package]]
1197name = "strsim"
1050name = "strsim"
1198version = "0.8.0"
1051version = "0.8.0"
1199source = "registry+https://github.com/rust-lang/crates.io-index"
1052source = "registry+https://github.com/rust-lang/crates.io-index"
1053+checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
1200
1054
1201[[package]]
1055[[package]]
1202name = "syn"
1056name = "syn"
1203−version = "1.0.17"
1057+version = "1.0.85"
1204source = "registry+https://github.com/rust-lang/crates.io-index"
1058source = "registry+https://github.com/rust-lang/crates.io-index"
1059+checksum = "a684ac3dcd8913827e18cd09a68384ee66c1de24157e3c556c9ab16d85695fb7"
1205dependencies = [
1060dependencies = [
1206− "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
1061+ "proc-macro2",
1207− "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
1062+ "quote",
1208− "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
1063+ "unicode-xid",
1209]
1064]
1210
1065
1211[[package]]
1066[[package]]
1212name = "syntect"
1067name = "syntect"
1213−version = "4.1.1"
1068+version = "5.0.0"
1214source = "registry+https://github.com/rust-lang/crates.io-index"
1069source = "registry+https://github.com/rust-lang/crates.io-index"
1070+checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8"
1215dependencies = [
1071dependencies = [
1216− "bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
1072+ "bincode",
1217− "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
1073+ "bitflags",
1218− "fancy-regex 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
1074+ "fancy-regex",
1219− "flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)",
1075+ "flate2",
1220− "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
1076+ "fnv",
1221− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1077+ "lazy_static",
1222− "lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
1078+ "once_cell",
1223− "onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
1079+ "onig",
1224− "plist 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)",
1080+ "plist",
1225− "regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)",
1081+ "regex-syntax",
1226− "serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
1082+ "serde",
1227− "serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
1083+ "serde_derive",
1228− "serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)",
1084+ "serde_json",
1229− "walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
1085+ "thiserror",
1230− "yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
1086+ "walkdir",
1087+ "yaml-rust",
1231]
1088]
1232
1089
1233[[package]]
1090[[package]]
1234−name = "tempdir"
1091+name = "sys-info"
1235−version = "0.3.7"
1092+version = "0.9.1"
1093+source = "registry+https://github.com/rust-lang/crates.io-index"
1094+checksum = "0b3a0d0aba8bf96a0e1ddfdc352fc53b3df7f39318c71854910c3c4b024ae52c"
1095+dependencies = [
1096+ "cc",
1097+ "libc",
1098+]
1099+
1100+[[package]]
1101+name = "tempfile"
1102+version = "3.3.0"
1236source = "registry+https://github.com/rust-lang/crates.io-index"
1103source = "registry+https://github.com/rust-lang/crates.io-index"
1104+checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4"
1237dependencies = [
1105dependencies = [
1238− "rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
1106+ "cfg-if",
1239− "remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
1107+ "fastrand",
1108+ "libc",
1109+ "redox_syscall",
1110+ "remove_dir_all",
1111+ "winapi",
1240]
1112]
1241
1113
1242[[package]]
1114[[package]]
1243name = "term_size"
1115name = "term_size"
1244−version = "0.3.1"
1116+version = "0.3.2"
1245source = "registry+https://github.com/rust-lang/crates.io-index"
1117source = "registry+https://github.com/rust-lang/crates.io-index"
1118+checksum = "1e4129646ca0ed8f45d09b929036bafad5377103edd06e50bf574b353d2b08d9"
1246dependencies = [
1119dependencies = [
1247− "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
1120+ "libc",
1248− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1121+ "winapi",
1249− "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
1250]
1122]
1251
1123
1252[[package]]
1124[[package]]
1253name = "termcolor"
1125name = "termcolor"
1254−version = "1.1.0"
1126+version = "1.1.2"
1255source = "registry+https://github.com/rust-lang/crates.io-index"
1127source = "registry+https://github.com/rust-lang/crates.io-index"
1128+checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4"
1256dependencies = [
1129dependencies = [
1257− "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
1130+ "winapi-util",
1258]
1131]
1259
1132
1260[[package]]
1133[[package]]
1261name = "terminal_size"
1134name = "terminal_size"
1262−version = "0.1.12"
1135+version = "0.1.17"
1263source = "registry+https://github.com/rust-lang/crates.io-index"
1136source = "registry+https://github.com/rust-lang/crates.io-index"
1137+checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df"
1264dependencies = [
1138dependencies = [
1265− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1139+ "libc",
1266− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
1140+ "winapi",
1267]
1141]
1268
1142
1269[[package]]
1143[[package]]
1270−name = "termios"
1144+name = "termtree"
1271−version = "0.3.2"
1145+version = "0.2.3"
1272source = "registry+https://github.com/rust-lang/crates.io-index"
1146source = "registry+https://github.com/rust-lang/crates.io-index"
1273−dependencies = [
1147+checksum = "13a4ec180a2de59b57434704ccfad967f789b12737738798fa08798cd5824c16"
1274− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1275−]
1276
1148
1277[[package]]
1149[[package]]
1278name = "textwrap"
1150name = "textwrap"
1279version = "0.11.0"
1151version = "0.11.0"
1280source = "registry+https://github.com/rust-lang/crates.io-index"
1152source = "registry+https://github.com/rust-lang/crates.io-index"
1153+checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
1281dependencies = [
1154dependencies = [
1282− "term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
1155+ "term_size",
1283− "unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
1156+ "unicode-width",
1284]
1157]
1285
1158
1286[[package]]
1159[[package]]
1287−name = "thread_local"
1160+name = "thiserror"
1288−version = "1.0.1"
1161+version = "1.0.31"
1289source = "registry+https://github.com/rust-lang/crates.io-index"
1162source = "registry+https://github.com/rust-lang/crates.io-index"
1163+checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a"
1290dependencies = [
1164dependencies = [
1291− "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1165+ "thiserror-impl",
1292]
1166]
1293
1167
1294[[package]]
1168[[package]]
1295−name = "time"
1169+name = "thiserror-impl"
1296−version = "0.1.43"
1170+version = "1.0.31"
1297source = "registry+https://github.com/rust-lang/crates.io-index"
1171source = "registry+https://github.com/rust-lang/crates.io-index"
1172+checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a"
1298dependencies = [
1173dependencies = [
1299− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1174+ "proc-macro2",
1300− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
1175+ "quote",
1176+ "syn",
1301]
1177]
1302
1178
1303[[package]]
1179[[package]]
1304−name = "treeline"
1180+name = "time"
1305−version = "0.1.0"
1181+version = "0.3.5"
1306source = "registry+https://github.com/rust-lang/crates.io-index"
1182source = "registry+https://github.com/rust-lang/crates.io-index"
1183+checksum = "41effe7cfa8af36f439fac33861b66b049edc6f9a32331e2312660529c1c24ad"
1184+dependencies = [
1185+ "itoa 0.4.8",
1186+ "libc",
1187+]
1307
1188
1308[[package]]
1189[[package]]
1309−name = "typenum"
1190+name = "tinyvec"
1310−version = "1.12.0"
1191+version = "1.5.1"
1311source = "registry+https://github.com/rust-lang/crates.io-index"
1192source = "registry+https://github.com/rust-lang/crates.io-index"
1193+checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2"
1194+dependencies = [
1195+ "tinyvec_macros",
1196+]
1312
1197
1313[[package]]
1198[[package]]
1314−name = "ucd-trie"
1199+name = "tinyvec_macros"
1315−version = "0.1.3"
1200+version = "0.1.0"
1316source = "registry+https://github.com/rust-lang/crates.io-index"
1201source = "registry+https://github.com/rust-lang/crates.io-index"
1202+checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c"
1317
1203
1318[[package]]
1204[[package]]
1319name = "unicode-bidi"
1205name = "unicode-bidi"
1320−version = "0.3.4"
1206+version = "0.3.7"
1321source = "registry+https://github.com/rust-lang/crates.io-index"
1207source = "registry+https://github.com/rust-lang/crates.io-index"
1322−dependencies = [
1208+checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f"
1323− "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
1324−]
1325
1209
1326[[package]]
1210[[package]]
1327name = "unicode-normalization"
1211name = "unicode-normalization"
1328−version = "0.1.12"
1212+version = "0.1.19"
1329source = "registry+https://github.com/rust-lang/crates.io-index"
1213source = "registry+https://github.com/rust-lang/crates.io-index"
1214+checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9"
1330dependencies = [
1215dependencies = [
1331− "smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1216+ "tinyvec",
1332]
1217]
1333
1218
1334−[[package]]
1335−name = "unicode-segmentation"
1336−version = "1.6.0"
1337−source = "registry+https://github.com/rust-lang/crates.io-index"
1338−
1339[[package]]
1219[[package]]
1340name = "unicode-width"
1220name = "unicode-width"
1341−version = "0.1.7"
1221+version = "0.1.9"
1342−source = "registry+https://github.com/rust-lang/crates.io-index"
1343−
1344−[[package]]
1345−name = "unicode-xid"
1346−version = "0.1.0"
1347source = "registry+https://github.com/rust-lang/crates.io-index"
1222source = "registry+https://github.com/rust-lang/crates.io-index"
1223+checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973"
1348
1224
1349[[package]]
1225[[package]]
1350name = "unicode-xid"
1226name = "unicode-xid"
1351−version = "0.2.0"
1227+version = "0.2.2"
1352source = "registry+https://github.com/rust-lang/crates.io-index"
1228source = "registry+https://github.com/rust-lang/crates.io-index"
1229+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
1353
1230
1354[[package]]
1231[[package]]
1355name = "url"
1232name = "url"
1356−version = "1.7.2"
1233+version = "2.2.2"
1357source = "registry+https://github.com/rust-lang/crates.io-index"
1234source = "registry+https://github.com/rust-lang/crates.io-index"
1235+checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c"
1358dependencies = [
1236dependencies = [
1359− "idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
1237+ "form_urlencoded",
1360− "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
1238+ "idna",
1361− "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1239+ "matches",
1362−]
1240+ "percent-encoding",
1363−
1364−[[package]]
1365−name = "url"
1366−version = "2.1.1"
1367−source = "registry+https://github.com/rust-lang/crates.io-index"
1368−dependencies = [
1369− "idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
1370− "matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
1371− "percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1372]
1241]
1373
1242
1374[[package]]
1243[[package]]
1375name = "vcpkg"
1244name = "vcpkg"
1376−version = "0.2.8"
1245+version = "0.2.15"
1377source = "registry+https://github.com/rust-lang/crates.io-index"
1246source = "registry+https://github.com/rust-lang/crates.io-index"
1247+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
1378
1248
1379[[package]]
1249[[package]]
1380name = "vec_map"
1250name = "vec_map"
1381−version = "0.8.1"
1251+version = "0.8.2"
1382−source = "registry+https://github.com/rust-lang/crates.io-index"
1383−
1384−[[package]]
1385−name = "version_check"
1386−version = "0.1.5"
1387source = "registry+https://github.com/rust-lang/crates.io-index"
1252source = "registry+https://github.com/rust-lang/crates.io-index"
1253+checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191"
1388
1254
1389[[package]]
1255[[package]]
1390name = "version_check"
1256name = "version_check"
1391−version = "0.9.1"
1257+version = "0.9.4"
1392source = "registry+https://github.com/rust-lang/crates.io-index"
1258source = "registry+https://github.com/rust-lang/crates.io-index"
1259+checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
1393
1260
1394[[package]]
1261[[package]]
1395name = "wait-timeout"
1262name = "wait-timeout"
1396version = "0.2.0"
1263version = "0.2.0"
1397source = "registry+https://github.com/rust-lang/crates.io-index"
1264source = "registry+https://github.com/rust-lang/crates.io-index"
1265+checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
1398dependencies = [
1266dependencies = [
1399− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1267+ "libc",
1400]
1268]
1401
1269
1402[[package]]
1270[[package]]
1403name = "walkdir"
1271name = "walkdir"
1404−version = "2.3.1"
1272+version = "2.3.2"
1405source = "registry+https://github.com/rust-lang/crates.io-index"
1273source = "registry+https://github.com/rust-lang/crates.io-index"
1274+checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56"
1406dependencies = [
1275dependencies = [
1407− "same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
1276+ "same-file",
1408− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
1277+ "winapi",
1409− "winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
1278+ "winapi-util",
1410]
1279]
1411
1280
1412[[package]]
1281[[package]]
1413name = "wasi"
1282name = "wasi"
1414−version = "0.9.0+wasi-snapshot-preview1"
1283+version = "0.10.2+wasi-snapshot-preview1"
1415−source = "registry+https://github.com/rust-lang/crates.io-index"
1416−
1417−[[package]]
1418−name = "which"
1419−version = "2.0.1"
1420source = "registry+https://github.com/rust-lang/crates.io-index"
1284source = "registry+https://github.com/rust-lang/crates.io-index"
1421−dependencies = [
1285+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
1422− "failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
1423− "libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)",
1424−]
1425
1286
1426[[package]]
1287[[package]]
1427name = "wild"
1288name = "wild"
1428−version = "2.0.2"
1289+version = "2.0.4"
1429source = "registry+https://github.com/rust-lang/crates.io-index"
1290source = "registry+https://github.com/rust-lang/crates.io-index"
1291+checksum = "035793abb854745033f01a07647a79831eba29ec0be377205f2a25b0aa830020"
1430dependencies = [
1292dependencies = [
1431− "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
1293+ "glob",
1432]
1294]
1433
1295
1434[[package]]
1296[[package]]
1435name = "winapi"
1297name = "winapi"
1436−version = "0.2.8"
1298+version = "0.3.9"
1437−source = "registry+https://github.com/rust-lang/crates.io-index"
1438−
1439−[[package]]
1440−name = "winapi"
1441−version = "0.3.8"
1442source = "registry+https://github.com/rust-lang/crates.io-index"
1299source = "registry+https://github.com/rust-lang/crates.io-index"
1300+checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
1443dependencies = [
1301dependencies = [
1444− "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1302+ "winapi-i686-pc-windows-gnu",
1445− "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
1303+ "winapi-x86_64-pc-windows-gnu",
1446]
1304]
1447
1305
1448−[[package]]
1449−name = "winapi-build"
1450−version = "0.1.1"
1451−source = "registry+https://github.com/rust-lang/crates.io-index"
1452−
1453[[package]]
1306[[package]]
1454name = "winapi-i686-pc-windows-gnu"
1307name = "winapi-i686-pc-windows-gnu"
1455version = "0.4.0"
1308version = "0.4.0"
1456source = "registry+https://github.com/rust-lang/crates.io-index"
1309source = "registry+https://github.com/rust-lang/crates.io-index"
1310+checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1457
1311
1458[[package]]
1312[[package]]
1459name = "winapi-util"
1313name = "winapi-util"
1460version = "0.1.5"
1314version = "0.1.5"
1461source = "registry+https://github.com/rust-lang/crates.io-index"
1315source = "registry+https://github.com/rust-lang/crates.io-index"
1316+checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1462dependencies = [
1317dependencies = [
1463− "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
1318+ "winapi",
1464]
1319]
1465
1320
1466[[package]]
1321[[package]]
1467name = "winapi-x86_64-pc-windows-gnu"
1322name = "winapi-x86_64-pc-windows-gnu"
1468version = "0.4.0"
1323version = "0.4.0"
1469source = "registry+https://github.com/rust-lang/crates.io-index"
1324source = "registry+https://github.com/rust-lang/crates.io-index"
1325+checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1470
1326
1471[[package]]
1327[[package]]
1472name = "xml-rs"
1328name = "xml-rs"
1473−version = "0.8.2"
1329+version = "0.8.4"
1474source = "registry+https://github.com/rust-lang/crates.io-index"
1330source = "registry+https://github.com/rust-lang/crates.io-index"
1331+checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3"
1475
1332
1476[[package]]
1333[[package]]
1477name = "yaml-rust"
1334name = "yaml-rust"
1478−version = "0.4.3"
1335+version = "0.4.5"
1479−source = "registry+https://github.com/rust-lang/crates.io-index"
1336+source = "registry+https://github.com/rust-lang/crates.io-index"
1480−dependencies = [
1337+checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85"
1481− "linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)",
1338+dependencies = [
1482−]
1339+ "linked-hash-map",
1483−
1340+]
1484−[metadata]
1485−"checksum adler32 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2"
1486−"checksum aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)" = "8716408b8bc624ed7f65d223ddb9ac2d044c0547b6fa4b0d554f3a9540496ada"
1487−"checksum ansi_colours 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1d0f302a81afc6a7f4350c04f0ba7cfab529cc009bca3324b3fb5764e6add8b6"
1488−"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
1489−"checksum ansi_term 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2"
1490−"checksum anymap 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344"
1491−"checksum arrayref 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544"
1492−"checksum arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8"
1493−"checksum assert_cmd 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c88b9ca26f9c16ec830350d309397e74ee9abdfd8eb1f71cb6ecc71a3fc818da"
1494−"checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
1495−"checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d"
1496−"checksum backtrace 0.3.46 (registry+https://github.com/rust-lang/crates.io-index)" = "b1e692897359247cc6bb902933361652380af0f1b7651ae5c5013407f30e109e"
1497−"checksum backtrace-sys 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "78848718ee1255a2485d1309ad9cdecfc2e7d0362dd11c6829364c6b35ae1bc7"
1498−"checksum base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0b25d992356d2eb0ed82172f5248873db5560c4721f564b13cb5193bda5e668e"
1499−"checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7"
1500−"checksum bincode 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5753e2a71534719bf3f4e57006c3a4f0d2c672a4b676eec84161f763eca87dbf"
1501−"checksum bindgen 0.50.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cb0e5a5f74b2bafe0b39379f616b5975e08bcaca4e779c078d5c31324147e9ba"
1502−"checksum bit-set 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e84c238982c4b1e1ee668d136c510c67a13465279c0cb367ea6baf6310620a80"
1503−"checksum bit-vec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f59bbe95d4e52a6398ec21238d31577f2b28a9d86807f06ca59d191d8440d0bb"
1504−"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
1505−"checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a"
1506−"checksum block-buffer 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c0940dc441f31689269e10ac70eb1002a3a1d3ad1390e030043662eb7fe4688b"
1507−"checksum block-padding 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fa79dedbb091f449f1f39e53edf88d5dbe95f895dae6135a8d7b881fb5af73f5"
1508−"checksum bstr 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)" = "2889e6d50f394968c8bf4240dc3f2a7eb4680844d27308f798229ac9d4725f41"
1509−"checksum byte-tools 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7"
1510−"checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de"
1511−"checksum cc 1.0.52 (registry+https://github.com/rust-lang/crates.io-index)" = "c3d87b23d6a92cd03af510a5ade527033f6aa6fa92161e2d5863a907d4c5e31d"
1512−"checksum cexpr 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "fce5b5fb86b0c57c20c834c1b412fd09c77c8a59b9473f86272709e78874cd1d"
1513−"checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822"
1514−"checksum chrono 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "80094f509cf8b5ae86a4966a39b3ff66cd7e2a3e594accec3743ff3fabeab5b2"
1515−"checksum clang-sys 0.28.1 (registry+https://github.com/rust-lang/crates.io-index)" = "81de550971c976f176130da4b2978d3b524eaa0fd9ac31f3ceb5ae1231fb4853"
1516−"checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9"
1517−"checksum console 0.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0f3e2e8d7dba335e913b97f9e1992c86c4399d54f8be1d31c8727d0652064"
1518−"checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
1519−"checksum content_inspector 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b7bda66e858c683005a53a9a60c69a4aca7eeaa45d124526e389f7aec8e62f38"
1520−"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1"
1521−"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8"
1522−"checksum difference 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
1523−"checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5"
1524−"checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3"
1525−"checksum dirs-sys 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "afa0b23de8fd801745c471deffa6e12d248f962c9fd4b4c33787b055599bde7b"
1526−"checksum doc-comment 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10"
1527−"checksum dtoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3"
1528−"checksum either 1.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "bb1f6b1ce1c140482ea30ddd3335fc0024ac7ee112895426e0a629a6c20adfe3"
1529−"checksum encode_unicode 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
1530−"checksum encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec"
1531−"checksum encoding-index-japanese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91"
1532−"checksum encoding-index-korean 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81"
1533−"checksum encoding-index-simpchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7"
1534−"checksum encoding-index-singlebyte 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a"
1535−"checksum encoding-index-tradchinese 1.20141219.5 (registry+https://github.com/rust-lang/crates.io-index)" = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18"
1536−"checksum encoding_index_tests 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569"
1537−"checksum env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
1538−"checksum error-chain 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d371106cc88ffdfb1eabd7111e432da544f16f3e2d7bf1dfe8bf575f1df045cd"
1539−"checksum failure 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b8529c2421efa3066a5cbd8063d2244603824daccb6936b079010bb2aa89464b"
1540−"checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed"
1541−"checksum fancy-regex 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b0e2de1b89ad299d536b7cefc5d177f5c005957fa2266ce58eca4d189e74bff5"
1542−"checksum flate2 1.0.14 (registry+https://github.com/rust-lang/crates.io-index)" = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42"
1543−"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3"
1544−"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
1545−"checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
1546−"checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec"
1547−"checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb"
1548−"checksum git2 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e1e02a51cd90229028c9bd8be0a0364f85b6b3199cccaa0ef39005ddbd5ac165"
1549−"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"
1550−"checksum globset 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "7ad1da430bd7281dde2576f44c84cc3f0f7b475e7202cd503042dff01a8c8120"
1551−"checksum hermit-abi 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8a0d737e0f947a1864e93d33fdef4af8445a00d1ed8dc0c8ddb73139ea6abf15"
1552−"checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f"
1553−"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
1554−"checksum idna 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9"
1555−"checksum indexmap 1.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292"
1556−"checksum itertools 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f56a2d0bc861f9165be4eb3442afd3c236d8a98afd426f65d92324ae1091a484"
1557−"checksum itoa 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e"
1558−"checksum jobserver 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2"
1559−"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
1560−"checksum kstring 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6382df53100fd22e149030b6634720c94a151076db8d727b3274d7070975d609"
1561−"checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
1562−"checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f"
1563−"checksum libc 0.2.69 (registry+https://github.com/rust-lang/crates.io-index)" = "99e85c08494b21a9054e7fe1374a732aeadaff3980b6990b94bfd3a70f690005"
1564−"checksum libgit2-sys 0.12.5+1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3eadeec65514971355bf7134967a543f71372f35b53ac6c7143e7bd157f07535"
1565−"checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753"
1566−"checksum libz-sys 1.0.25 (registry+https://github.com/rust-lang/crates.io-index)" = "2eb5e43362e38e2bca2fd5f5134c4d4564a23a5c28e9b95411652021a8675ebe"
1567−"checksum line-wrap 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
1568−"checksum linked-hash-map 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ae91b68aebc4ddb91978b11a1b02ddd8602a05ec19002801c5666000e05e0f83"
1569−"checksum liquid 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "62b5a51d24120bc37da30a3bcd741ede7450f00e9fcb0b8648a1d25f7736bc6e"
1570−"checksum liquid-core 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3a922402825d7fd1965364e1d289f909076bcf580e5ae4a5edaf82af1fe7a9dc"
1571−"checksum liquid-derive 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e6fcb48d443dbc49c65b3e5aaecc95e6e911a28b20049d6ac2d94527543fa133"
1572−"checksum liquid-lib 0.20.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0629fbd25a919496d2e621e8a3af892bc438273d0f446eb4f0d66ce45117d15d"
1573−"checksum log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7"
1574−"checksum maplit 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
1575−"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
1576−"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400"
1577−"checksum miniz_oxide 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "aa679ff6578b1cddee93d7e82e263b94a575e0bfced07284eb0c037c1d2416a5"
1578−"checksum nom 4.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6"
1579−"checksum num-integer 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba"
1580−"checksum num-traits 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096"
1581−"checksum once_cell 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b"
1582−"checksum onig 5.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4e723fc996fff1aeab8f62205f3e8528bf498bdd5eadb2784d2d31f30077947"
1583−"checksum onig_sys 69.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0a8d4efbf5f59cece01f539305191485b651acb3785b9d5eef05749f0496514e"
1584−"checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
1585−"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
1586−"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
1587−"checksum percent-encoding 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
1588−"checksum pest 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53"
1589−"checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0"
1590−"checksum pest_generator 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "99b8db626e31e5b81787b9783425769681b347011cc59471e33ea46d2ea0cf55"
1591−"checksum pest_meta 2.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "54be6e404f5317079812fc8f9f5279de376d8856929e21c184ecf6bbd692a11d"
1592−"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677"
1593−"checksum plist 0.5.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9b59eb8d91dfa89208ec74a920e3b55f840476cf46568026c18dbaa2999e0d48"
1594−"checksum predicates 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "347a1b6f0b21e636bc9872fb60b83b8e185f6f5516298b8238699f7f9a531030"
1595−"checksum predicates-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178"
1596−"checksum predicates-tree 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124"
1597−"checksum proc-macro-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = "0d659fe7c6d27f25e9d80a1a094c223f5246f6a6596453e09d7229bf42750b63"
1598−"checksum proc-macro2 0.4.30 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759"
1599−"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3"
1600−"checksum proc-quote 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "06ea4226882439d07839be9c7f683e13d6d69d9c2fe960d61f637d1e2fa4c081"
1601−"checksum proc-quote-impl 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7fb3ec628b063cdbcf316e06a8b8c1a541d28fa6c0a8eacd2bfb2b7f49e88aa0"
1602−"checksum quick-error 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0"
1603−"checksum quote 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1"
1604−"checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f"
1605−"checksum rand 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293"
1606−"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
1607−"checksum rand_core 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc"
1608−"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
1609−"checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84"
1610−"checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431"
1611−"checksum regex 1.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "a6020f034922e3194c711b82a627453881bc4682166cabb07134a10c26ba7692"
1612−"checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae"
1613−"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"
1614−"checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017"
1615−"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
1616−"checksum ryu 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535622e6be132bccd223f4bb2b8ac8d53cda3c7a6394944d3b2b33fb974f9d76"
1617−"checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
1618−"checksum same-file 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502"
1619−"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
1620−"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
1621−"checksum serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "36df6ac6412072f67cf767ebbde4133a5b2e88e76dc6187fa7104cd16f783399"
1622−"checksum serde_derive 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)" = "9e549e3abf4fb8621bd1609f11dfc9f5e50320802273b12f3811a67e6716ea6c"
1623−"checksum serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)" = "da07b57ee2623368351e9a0488bb0b261322a15a6e0ae53e243cbdc0f4208da9"
1624−"checksum serde_yaml 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "691b17f19fc1ec9d94ec0b5864859290dff279dbd7b03f017afda54eb36c3c35"
1625−"checksum sha-1 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df"
1626−"checksum shell-words 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "39acde55a154c4cd3ae048ac78cc21c25f3a0145e44111b523279113dce0d94a"
1627−"checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2"
1628−"checksum smallvec 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05720e22615919e4734f6a99ceae50d00226c3c5aca406e102ebc33298214e0a"
1629−"checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a"
1630−"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03"
1631−"checksum syntect 4.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6bc79276a4d38e39fbeb83c5fd9c23fbd027eeec7c50ee6a3d07deee33d7f621"
1632−"checksum tempdir 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8"
1633−"checksum term_size 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9e5b9a66db815dcfd2da92db471106457082577c3c278d4138ab3e3b4e189327"
1634−"checksum termcolor 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb6bfa289a4d7c5766392812c0a1f4c1ba45afa1ad47803c11e1f407d846d75f"
1635−"checksum terminal_size 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "8038f95fc7a6f351163f4b964af631bd26c9e828f7db085f2a84aca56f70d13b"
1636−"checksum termios 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6f0fcee7b24a25675de40d5bb4de6e41b0df07bc9856295e7e2b3a3600c400c2"
1637−"checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060"
1638−"checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14"
1639−"checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438"
1640−"checksum treeline 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41"
1641−"checksum typenum 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33"
1642−"checksum ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
1643−"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
1644−"checksum unicode-normalization 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5479532badd04e128284890390c1e876ef7a993d0570b3597ae43dfa1d59afa4"
1645−"checksum unicode-segmentation 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0"
1646−"checksum unicode-width 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479"
1647−"checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc"
1648−"checksum unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c"
1649−"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
1650−"checksum url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "829d4a8476c35c9bf0bbce5a3b23f4106f79728039b726d292bb93bc106787cb"
1651−"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168"
1652−"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
1653−"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
1654−"checksum version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "078775d0255232fb988e6fccf26ddc9d1ac274299aaedcedce21c6f72cc533ce"
1655−"checksum wait-timeout 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6"
1656−"checksum walkdir 2.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d"
1657−"checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519"
1658−"checksum which 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b57acb10231b9493c8472b20cb57317d0679a49e0bdbee44b3b803a6473af164"
1659−"checksum wild 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "97d34fecce28871e5c0e059deae21ef7f7d13b98a5964b24c58b3735c8052fc8"
1660−"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
1661−"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6"
1662−"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
1663−"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
1664−"checksum winapi-util 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178"
1665−"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
1666−"checksum xml-rs 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2bb76e5c421bbbeb8924c60c030331b345555024d56261dae8f3e786ed817c23"
1667−"checksum yaml-rust 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "65923dd1784f44da1d2c3dbbc5e822045628c590ba72123e1c73d3c230c4434d"
Cargo.toml+47−32
@@ -1,17 +1,13 @@
1[package]
1[package]
2authors = ["David Peter <mail@david-peter.de>"]
2authors = ["David Peter <mail@david-peter.de>"]
3categories = ["command-line-utilities"]
3categories = ["command-line-utilities"]
4−description="A cat(1) clone with wings."
4+description = "A cat(1) clone with wings."
5homepage = "https://github.com/sharkdp/bat"
5homepage = "https://github.com/sharkdp/bat"
6license = "MIT/Apache-2.0"
6license = "MIT/Apache-2.0"
7name = "bat"
7name = "bat"
8−readme = "README.md"
9repository = "https://github.com/sharkdp/bat"
8repository = "https://github.com/sharkdp/bat"
10−version = "0.15.1"
9+version = "0.21.0"
11−exclude = [
12− "assets/syntaxes/*",
10+exclude = ["assets/syntaxes/*", "assets/themes/*"]
13− "assets/themes/*",
14−]
15build = "build.rs"
11build = "build.rs"
16edition = '2018'
12edition = '2018'
17
13
@@ -20,65 +16,84 @@ default = ["application"]
20# Feature required for bat the application. Should be disabled when depending on
16# Feature required for bat the application. Should be disabled when depending on
21# bat as a library.
17# bat as a library.
22application = [
18application = [
19+ "bugreport",
20+ "build-assets",
21+ "git",
22+ "minimal-application",
23+]
24+# Mainly for developers that want to iterate quickly
25+# Be aware that the included features might change in the future
26+minimal-application = [
23 "atty",
27 "atty",
24 "clap",
28 "clap",
25− "dirs",
29+ "dirs-next",
26− "git",
27− "lazy_static",
28− "liquid",
29 "paging",
30 "paging",
30− "wild",
31 "regex-onig",
31 "regex-onig",
32+ "wild",
32]
33]
33git = ["git2"] # Support indicating git modifications
34git = ["git2"] # Support indicating git modifications
34−paging = ["shell-words"] # Support applying a pager on the output
35+paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
36+build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]
37+
38+# You need to use one of these if you depend on bat as a library:
35regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
39regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
36regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
40regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine
37
41
38[dependencies]
42[dependencies]
39atty = { version = "0.2.14", optional = true }
43atty = { version = "0.2.14", optional = true }
40ansi_term = "^0.12.1"
44ansi_term = "^0.12.1"
41−ansi_colours = "^1.0"
45+ansi_colours = "^1.1"
46+bincode = "1.0"
42−console = "0.11.2"
47+console = "0.15.0"
43−dirs = { version = "2.0", optional = true }
48+flate2 = "1.0"
44−lazy_static = { version = "1.4", optional = true }
49+once_cell = "1.10"
50+thiserror = "1.0"
45wild = { version = "2.0", optional = true }
51wild = { version = "2.0", optional = true }
46content_inspector = "0.2.4"
52content_inspector = "0.2.4"
47encoding = "0.2"
53encoding = "0.2"
48−shell-words = { version = "0.1.0", optional = true }
54+shell-words = { version = "1.1.0", optional = true }
49−unicode-width = "0.1.7"
55+unicode-width = "0.1.9"
50globset = "0.4"
56globset = "0.4"
51serde = { version = "1.0", features = ["derive"] }
57serde = { version = "1.0", features = ["derive"] }
52serde_yaml = "0.8"
58serde_yaml = "0.8"
53−semver = "0.9"
59+semver = "1.0"
60+path_abs = { version = "0.5", default-features = false }
61+clircle = "0.3"
62+bugreport = { version = "0.5.0", optional = true }
63+dirs-next = { version = "2.0.0", optional = true }
64+grep-cli = { version = "0.1.6", optional = true }
65+regex = { version = "1.5.5", optional = true }
66+walkdir = { version = "2.0", optional = true }
67+bytesize = { version = "1.1.0" }
54
68
55[dependencies.git2]
69[dependencies.git2]
56−version = "0.13"
70+version = "0.14"
57optional = true
71optional = true
58default-features = false
72default-features = false
59
73
60[dependencies.syntect]
74[dependencies.syntect]
61−version = "4.1.0"
75+version = "5.0.0"
62default-features = false
76default-features = false
63−features = ["parsing", "yaml-load", "dump-load", "dump-create"]
77+features = ["parsing"]
64
78
65[dependencies.clap]
79[dependencies.clap]
66−version = "2.33"
80+version = "2.34"
67optional = true
81optional = true
68default-features = false
82default-features = false
69features = ["suggestions", "color", "wrap_help"]
83features = ["suggestions", "color", "wrap_help"]
70
84
71−[dependencies.error-chain]
72−version = "0.12"
73−default-features = false
74−
75[dev-dependencies]
85[dev-dependencies]
76−tempdir = "0.3"
77−assert_cmd = "1.0.1"
86+assert_cmd = "2.0.4"
87+serial_test = "0.6.0"
88+predicates = "2.1.1"
89+wait-timeout = "0.2.0"
90+tempfile = "3.3.0"
91+
92+[target.'cfg(unix)'.dev-dependencies]
93+nix = { version = "0.24.1", default-features = false, features = ["term"] }
78
94
79[build-dependencies]
95[build-dependencies]
80−clap = { version = "2.33", optional = true }
96+clap = { version = "2.34", optional = true }
81−liquid = { version = "0.20", optional = true }
82
97
83[profile.release]
98[profile.release]
84lto = true
99lto = true
LICENSE-MIT+1−1
@@ -1,4 +1,4 @@
1−Copyright (c) 2018-2020 bat-developers (https://github.com/sharkdp/bat).
1+Copyright (c) 2018-2021 bat-developers (https://github.com/sharkdp/bat).
2
2
3Permission is hereby granted, free of charge, to any person obtaining a copy
3Permission is hereby granted, free of charge, to any person obtaining a copy
4of this software and associated documentation files (the "Software"), to deal
4of this software and associated documentation files (the "Software"), to deal
NOTICEnew file+6
@@ -0,0 +1,6 @@
1+Copyright (c) 2018-2021 bat-developers (https://github.com/sharkdp/bat).
2+
3+bat is made available under the terms of either the MIT License or the Apache
4+License 2.0, at your option.
5+
6+See the LICENSE-APACHE and LICENSE-MIT files for license details.
README.md+249−93
@@ -1,7 +1,6 @@
1<p align="center">
1<p align="center">
2 <img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
2 <img src="doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
3− <a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
3+ <a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
4− <a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf/branch/master?svg=true"></a>
5 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
4 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
6 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
5 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
7 A <i>cat(1)</i> clone with syntax highlighting and Git integration.
6 A <i>cat(1)</i> clone with syntax highlighting and Git integration.
@@ -12,10 +11,27 @@
12 <a href="#how-to-use">How To Use</a> •
11 <a href="#how-to-use">How To Use</a> •
13 <a href="#installation">Installation</a> •
12 <a href="#installation">Installation</a> •
14 <a href="#customization">Customization</a> •
13 <a href="#customization">Customization</a> •
15− <a href="#project-goals-and-alternatives">Project goals, alternatives</a> •
14+ <a href="#project-goals-and-alternatives">Project goals, alternatives</a><br>
15+ [English]
16+ [<a href="doc/README-zh.md">中文</a>]
16− Translation [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="doc/README-ja.md">日本語</a>][<a href="doc/README-ko.md">한국어</a>]
17+ [<a href="doc/README-ja.md">日本語</a>]
18+ [<a href="doc/README-ko.md">한국어</a>]
19+ [<a href="doc/README-ru.md">Русский</a>]
17</p>
20</p>
18
21
22+### Sponsors
23+
24+A special *thank you* goes to our biggest <a href="doc/sponsors.md">sponsors</a>:<br>
25+<a href="https://workos.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=bat&utm_source=github">
26+ <img src="doc/sponsors/workos-logo-white-bg.svg" width="200" alt="WorkOS">
27+ <br>
28+ <strong>Your app, enterprise-ready.</strong>
29+ <br>
30+ <sub>Start selling to enterprise customers with just a few lines of code.</sub>
31+ <br>
32+ <sup>Add Single Sign-On (and more) in minutes instead of months.</sup>
33+</a>
34+
19### Syntax highlighting
35### Syntax highlighting
20
36
21`bat` supports syntax highlighting for a large number of programming and markup
37`bat` supports syntax highlighting for a large number of programming and markup
@@ -39,14 +55,14 @@ characters:
39
55
40### Automatic paging
56### Automatic paging
41
57
42−`bat` can pipe its own output to `less` if the output is too large for one screen.
58+By default, `bat` pipes its own output to a pager (e.g. `less`) if the output is too large for one screen.
59+If you would rather `bat` work like `cat` all the time (never page output), you can set `--paging=never` as an option, either on the command line or in your configuration file.
60+If you intend to alias `cat` to `bat` in your shell configuration, you can use `alias cat='bat --paging=never'` to preserve the default behavior.
43
61
44−### File concatenation
62+#### File concatenation
45
63
46−Oh.. you can also use it to concatenate files :wink:. Whenever
64+Even with a pager set, you can still use `bat` to concatenate files :wink:.
47−`bat` detects a non-interactive terminal (i.e. when you pipe into another process
65+Whenever `bat` detects a non-interactive terminal (i.e. when you pipe into another process or into a file), `bat` will act as a drop-in replacement for `cat` and fall back to printing the plain file contents, regardless of the `--pager` option's value.
48−or into a file), `bat` will act as a drop-in replacement for `cat` and
49−fall back to printing the plain file contents.
50
66
51## How to use
67## How to use
52
68
@@ -62,7 +78,9 @@ Display multiple files at once
62> bat src/*.rs
78> bat src/*.rs
63```
79```
64
80
65−Read from stdin, determine the syntax automatically
81+Read from stdin, determine the syntax automatically (note, highlighting will
82+only work if the syntax can be determined from the first line of the file,
83+usually through a shebang such as `#!/bin/sh`)
66
84
67```bash
85```bash
68> curl -s https://sh.rustup.rs | bat
86> curl -s https://sh.rustup.rs | bat
@@ -93,14 +111,28 @@ bat f - g # output 'f', then stdin, then 'g'.
93
111
94### Integration with other tools
112### Integration with other tools
95
113
114+#### `fzf`
115+
116+You can use `bat` as a previewer for [`fzf`](https://github.com/junegunn/fzf). To do this,
117+use `bat`s `--color=always` option to force colorized output. You can also use `--line-range`
118+option to restrict the load times for long files:
119+
120+```bash
121+fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'
122+```
123+
124+For more information, see [`fzf`'s `README`](https://github.com/junegunn/fzf#preview-window).
125+
96#### `find` or `fd`
126#### `find` or `fd`
97
127
98You can use the `-exec` option of `find` to preview all search results with `bat`:
128You can use the `-exec` option of `find` to preview all search results with `bat`:
129+
99```bash
130```bash
100find … -exec bat {} +
131find … -exec bat {} +
101```
132```
102
133
103If you happen to use [`fd`](https://github.com/sharkdp/fd), you can use the `-X`/`--exec-batch` option to do the same:
134If you happen to use [`fd`](https://github.com/sharkdp/fd), you can use the `-X`/`--exec-batch` option to do the same:
135+
104```bash
136```bash
105fd … -X bat
137fd … -X bat
106```
138```
@@ -116,9 +148,11 @@ batgrep needle src/
116#### `tail -f`
148#### `tail -f`
117
149
118`bat` can be combined with `tail -f` to continuously monitor a given file with syntax highlighting.
150`bat` can be combined with `tail -f` to continuously monitor a given file with syntax highlighting.
151+
119```bash
152```bash
120tail -f /var/log/pacman.log | bat --paging=never -l log
153tail -f /var/log/pacman.log | bat --paging=never -l log
121```
154```
155+
122Note that we have to switch off paging in order for this to work. We have also specified the syntax
156Note that we have to switch off paging in order for this to work. We have also specified the syntax
123explicitly (`-l log`), as it can not be auto-detected in this case.
157explicitly (`-l log`), as it can not be auto-detected in this case.
124
158
@@ -126,11 +160,23 @@ explicitly (`-l log`), as it can not be auto-detected in this case.
126
160
127You can combine `bat` with `git show` to view an older version of a given file with proper syntax
161You can combine `bat` with `git show` to view an older version of a given file with proper syntax
128highlighting:
162highlighting:
163+
129```bash
164```bash
130git show v0.6.0:src/main.rs | bat -l rs
165git show v0.6.0:src/main.rs | bat -l rs
131```
166```
132
167
168+#### `git diff`
169+
170+You can combine `bat` with `git diff` to view lines around code changes with proper syntax
171+highlighting:
172+```bash
173+batdiff() {
174+ git diff --name-only --relative --diff-filter=d | xargs bat --diff
175+}
176+```
177+If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
178+
133−Note that syntax highlighting within diffs is currently not supported. If you are looking for this, check out [`delta`](https://github.com/dandavison/delta).
179+If you are looking for more support for git and diff operations, check out [`delta`](https://github.com/dandavison/delta).
134
180
135#### `xclip`
181#### `xclip`
136
182
@@ -151,6 +197,7 @@ bat main.cpp | xclip
151export MANPAGER="sh -c 'col -bx | bat -l man -p'"
197export MANPAGER="sh -c 'col -bx | bat -l man -p'"
152man 2 select
198man 2 select
153```
199```
200+(replace `bat` with `batcat` if you are on Debian or Ubuntu)
154
201
155It might also be necessary to set `MANROFFOPT="-c"` if you experience
202It might also be necessary to set `MANROFFOPT="-c"` if you experience
156formatting problems.
203formatting problems.
@@ -159,31 +206,48 @@ If you prefer to have this bundled in a new command, you can also use [`batman`]
159
206
160Note that the [Manpage syntax](assets/syntaxes/02_Extra/Manpage.sublime-syntax) is developed in this repository and still needs some work.
207Note that the [Manpage syntax](assets/syntaxes/02_Extra/Manpage.sublime-syntax) is developed in this repository and still needs some work.
161
208
209+Also, note that this will [not work](https://github.com/sharkdp/bat/issues/1145) with Mandocs `man` implementation.
210+
162#### `prettier` / `shfmt` / `rustfmt`
211#### `prettier` / `shfmt` / `rustfmt`
163
212
164The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
213The [`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) script is a wrapper that will format code and print it with `bat`.
165
214
215+#### Highlighting `--help` messages
216+
217+You can use `bat` to colorize help text: `$ cp --help | bat -plhelp`
218+
219+You can also use a wrapper around this:
220+
221+```bash
222+# in your .bashrc/.zshrc/*rc
223+alias bathelp='bat --plain --language=help'
224+help() {
225+ "$@" --help 2>&1 | bathelp
226+}
227+```
228+
229+Then you can do `$ help cp` or `$ help git commit`.
230+
231+Please report any issues with the help syntax in [this repository](https://github.com/victor-gp/cmd-help-sublime-syntax).
232+
166
233
167## Installation
234## Installation
168
235
169−[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
236+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
170
237
171### On Ubuntu (using `apt`)
238### On Ubuntu (using `apt`)
172*... and other Debian-based Linux distributions.*
239*... and other Debian-based Linux distributions.*
173
240
174−`bat` is making its way through the [Ubuntu](https://packages.ubuntu.com/eoan/bat) and
241+`bat` is available on [Ubuntu since 20.04 ("Focal")](https://packages.ubuntu.com/search?keywords=bat&exact=1) and [Debian since August 2021 (Debian 11 - "Bullseye")](https://packages.debian.org/bullseye/bat).
175−[Debian](https://packages.debian.org/sid/bat) package release process, and is available
176−for Ubuntu as of Eoan 19.10. On Debian `bat` is currently only available on the unstable
177−"Sid" branch.
178
242
179If your Ubuntu/Debian installation is new enough you can simply run:
243If your Ubuntu/Debian installation is new enough you can simply run:
180
244
181```bash
245```bash
182−apt install bat
246+sudo apt install bat
183```
247```
184
248
185−If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name
249+**Important**: If you install `bat` this way, please note that the executable may be installed as `batcat` instead of `bat` (due to [a name
186−clash with another package](https://github.com/sharkdp/bat/issues/982)). You can set up a `bat -> batcat` symlink or alias to prevent any issues that may come up because of this and to be consistent with other distrutions:
250+clash with another package](https://github.com/sharkdp/bat/issues/982)). You can set up a `bat -> batcat` symlink or alias to prevent any issues that may come up because of this and to be consistent with other distributions:
187``` bash
251``` bash
188mkdir -p ~/.local/bin
252mkdir -p ~/.local/bin
189ln -s /usr/bin/batcat ~/.local/bin/bat
253ln -s /usr/bin/batcat ~/.local/bin/bat
@@ -197,7 +261,7 @@ the most recent release of `bat`, download the latest `.deb` package from the
197[release page](https://github.com/sharkdp/bat/releases) and install it via:
261[release page](https://github.com/sharkdp/bat/releases) and install it via:
198
262
199```bash
263```bash
200−sudo dpkg -i bat_0.15.1_amd64.deb # adapt version number and architecture
264+sudo dpkg -i bat_0.18.3_amd64.deb # adapt version number and architecture
201```
265```
202
266
203### On Alpine Linux
267### On Alpine Linux
@@ -226,6 +290,14 @@ You can install [the `bat` package](https://koji.fedoraproject.org/koji/packagei
226dnf install bat
290dnf install bat
227```
291```
228
292
293+### On Funtoo Linux
294+
295+You can install [the `bat` package](https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat) from dev-kit.
296+
297+```bash
298+emerge sys-apps/bat
299+```
300+
229### On Gentoo Linux
301### On Gentoo Linux
230
302
231You can install [the `bat` package](https://packages.gentoo.org/packages/sys-apps/bat)
303You can install [the `bat` package](https://packages.gentoo.org/packages/sys-apps/bat)
@@ -242,6 +314,13 @@ You can install `bat` via xbps-install:
242xbps-install -S bat
314xbps-install -S bat
243```
315```
244
316
317+### On Termux
318+
319+You can install `bat` via pkg:
320+```bash
321+pkg install bat
322+```
323+
245### On FreeBSD
324### On FreeBSD
246
325
247You can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg:
326You can install a precompiled [`bat` package](https://www.freshports.org/textproc/bat) with pkg:
@@ -257,6 +336,14 @@ cd /usr/ports/textproc/bat
257make install
336make install
258```
337```
259
338
339+### On OpenBSD
340+
341+You can install `bat` package using [`pkg_add(1)`](https://man.openbsd.org/pkg_add.1):
342+
343+```bash
344+pkg_add bat
345+```
346+
260### Via nix
347### Via nix
261
348
262You can install `bat` using the [nix package manager](https://nixos.org/nix):
349You can install `bat` using the [nix package manager](https://nixos.org/nix):
@@ -273,14 +360,21 @@ You can install `bat` with zypper:
273zypper install bat
360zypper install bat
274```
361```
275
362
276−### On macOS
363+### Via snap package
364+
365+There is currently no recommended snap package available.
366+Existing packages may be available, but are not officially supported and may contain [issues](https://github.com/sharkdp/bat/issues/1519).
277
367
368+### On macOS (or Linux) via Homebrew
369+
278−You can install `bat` with [Homebrew](http://braumeister.org/formula/bat):
370+You can install `bat` with [Homebrew on MacOS](https://formulae.brew.sh/formula/bat) or [Homebrew on Linux](https://formulae.brew.sh/formula-linux/bat):
279
371
280```bash
372```bash
281brew install bat
373brew install bat
282```
374```
283
375
376+### On macOS via MacPorts
377+
284Or install `bat` with [MacPorts](https://ports.macports.org/port/bat/summary):
378Or install `bat` with [MacPorts](https://ports.macports.org/port/bat/summary):
285
379
286```bash
380```bash
@@ -292,6 +386,10 @@ port install bat
292There are a few options to install `bat` on Windows. Once you have installed `bat`,
386There are a few options to install `bat` on Windows. Once you have installed `bat`,
293take a look at the ["Using `bat` on Windows"](#using-bat-on-windows) section.
387take a look at the ["Using `bat` on Windows"](#using-bat-on-windows) section.
294
388
389+#### Prerequisites
390+
391+You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
392+
295#### With Chocolatey
393#### With Chocolatey
296
394
297You can install `bat` via [Chocolatey](https://chocolatey.org/packages/Bat):
395You can install `bat` via [Chocolatey](https://chocolatey.org/packages/Bat):
@@ -306,50 +404,12 @@ You can install `bat` via [scoop](https://scoop.sh/):
306scoop install bat
404scoop install bat
307```
405```
308
406
309−You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
310−
311#### From prebuilt binaries:
407#### From prebuilt binaries:
312
408
313You can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),
409You can download prebuilt binaries from the [Release page](https://github.com/sharkdp/bat/releases),
314
410
315You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
411You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
316
412
317−### Via Docker
318−
319−There is a [Docker image](https://hub.docker.com/r/danlynn/bat/) that you can use to run `bat` in a container:
320−```bash
321−docker pull danlynn/bat
322−alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
323−```
324−
325−### Via Ansible
326−
327−You can install `bat` with [Ansible](https://www.ansible.com/):
328−
329−```bash
330−# Install role on local machine
331−ansible-galaxy install aeimer.install_bat
332−```
333−
334−```yaml
335−---
336−# Playbook to install bat
337−- host: all
338− roles:
339− - aeimer.install_bat
340−```
341−
342−- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
343−- [GitHub](https://github.com/aeimer/ansible-install-bat)
344−
345−This should work with the following distributions:
346−- Debian/Ubuntu
347−- ARM (eg. Raspberry PI)
348−- Arch Linux
349−- Void Linux
350−- FreeBSD
351−- MacOS
352−
353### From binaries
413### From binaries
354
414
355Check out the [Release page](https://github.com/sharkdp/bat/releases) for
415Check out the [Release page](https://github.com/sharkdp/bat/releases) for
@@ -358,14 +418,15 @@ binaries are also available: look for archives with `musl` in the file name.
358
418
359### From source
419### From source
360
420
361−If you want to build `bat` from source, you need Rust 1.40 or
421+If you want to build `bat` from source, you need Rust 1.51 or
362higher. You can then use `cargo` to build everything:
422higher. You can then use `cargo` to build everything:
363
423
364```bash
424```bash
365cargo install --locked bat
425cargo install --locked bat
366```
426```
367
427
368−On some platforms, you might need to install `llvm` and/or `libclang-dev`.
428+Note that additional files like the man page or shell completion
429+files can not be installed in this way. They will be generated by `cargo` and should be available in the cargo target folder (under `build`).
369
430
370## Customization
431## Customization
371
432
@@ -389,6 +450,26 @@ light background, some themes like `GitHub` or `OneHalfLight` will work better f
389You can also use a custom theme by following the
450You can also use a custom theme by following the
390['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
451['Adding new themes' section below](https://github.com/sharkdp/bat#adding-new-themes).
391
452
453+### 8-bit themes
454+
455+`bat` has three themes that always use [8-bit colors](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors),
456+even when truecolor support is available:
457+
458+- `ansi` looks decent on any terminal. It uses 3-bit colors: black, red, green,
459+ yellow, blue, magenta, cyan, and white.
460+- `base16` is designed for [base16](https://github.com/chriskempson/base16) terminal themes. It uses
461+ 4-bit colors (3-bit colors plus bright variants) in accordance with the
462+ [base16 styling guidelines](https://github.com/chriskempson/base16/blob/master/styling.md).
463+- `base16-256` is designed for [base16-shell](https://github.com/chriskempson/base16-shell).
464+ It replaces certain bright colors with 8-bit colors from 16 to 21. **Do not** use this simply
465+ because you have a 256-color terminal but are not using base16-shell.
466+
467+Although these themes are more restricted, they have three advantages over truecolor themes. They:
468+
469+- Enjoy maximum compatibility. Some terminal utilities do not support more than 3-bit colors.
470+- Adapt to terminal theme changes. Even for already printed output.
471+- Visually harmonize better with other terminal software.
472+
392### Output style
473### Output style
393
474
394You can use the `--style` option to control the appearance of `bat`s output.
475You can use the `--style` option to control the appearance of `bat`s output.
@@ -399,35 +480,45 @@ variable to make these changes permanent or use `bat`s
399
480
400### Adding new syntaxes / language definitions
481### Adding new syntaxes / language definitions
401
482
483+Should you find that a particular syntax is not available within `bat`, you can follow these
484+instructions to easily add new syntaxes to your current `bat` installation.
485+
402`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
486`bat` uses the excellent [`syntect`](https://github.com/trishume/syntect/)
403library for syntax highlighting. `syntect` can read any
487library for syntax highlighting. `syntect` can read any
404[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
488[Sublime Text `.sublime-syntax` file](https://www.sublimetext.com/docs/3/syntax.html)
405−and theme. To add new syntax definitions, do the following.
489+and theme.
406
490
407−Create a folder with syntax definition files:
491+A good resource for finding Sublime Syntax packages is [Package Control](https://packagecontrol.io/). Once you found a
492+syntax:
408
493
409−```bash
494+1. Create a folder with syntax definition files:
410−mkdir -p "$(bat --config-dir)/syntaxes"
411−cd "$(bat --config-dir)/syntaxes"
412
495
413−# Put new '.sublime-syntax' language definition files
496+ ```bash
414−# in this folder (or its subdirectories), for example:
497+ mkdir -p "$(bat --config-dir)/syntaxes"
415−git clone https://github.com/tellnobody1/sublime-purescript-syntax
498+ cd "$(bat --config-dir)/syntaxes"
416−```
417
499
418−Now use the following command to parse these files into a binary cache:
500+ # Put new '.sublime-syntax' language definition files
501+ # in this folder (or its subdirectories), for example:
502+ git clone https://github.com/tellnobody1/sublime-purescript-syntax
503+ ```
419
504
420−```bash
505+2. Now use the following command to parse these files into a binary cache:
421−bat cache --build
422−```
423
506
424−Finally, use `bat --list-languages` to check if the new languages are available.
507+ ```bash
508+ bat cache --build
509+ ```
425
510
426−If you ever want to go back to the default settings, call:
511+3. Finally, use `bat --list-languages` to check if the new languages are available.
427
512
513+ If you ever want to go back to the default settings, call:
514+
428−```bash
515+ ```bash
429−bat cache --clear
516+ bat cache --clear
430−```
517+ ```
518+
519+4. If you think that a specific syntax should be included in `bat` by default, please
520+ consider opening a "syntax request" ticket after reading the policies and
521+ instructions [here](doc/assets.md): [Open Syntax Request](https://github.com/sharkdp/bat/issues/new?labels=syntax-request&template=syntax_request.md).
431
522
432### Adding new themes
523### Adding new themes
433
524
@@ -447,6 +538,34 @@ bat cache --build
447
538
448Finally, use `bat --list-themes` to check if the new themes are available.
539Finally, use `bat --list-themes` to check if the new themes are available.
449
540
541+### Adding or changing file type associations
542+
543+You can add new (or change existing) file name patterns using the `--map-syntax`
544+command line option. The option takes an argument of the form `pattern:syntax` where
545+`pattern` is a glob pattern that is matched against the file name and
546+the absolute file path. The `syntax` part is the full name of a supported language
547+(use `bat --list-languages` for an overview).
548+
549+**Note:** You probably want to use this option as [an entry in `bat`'s configuration file](#configuration-file)
550+for persistence instead of passing it on the command line as a one-off. Generally
551+you'd just use `-l` if you want to manually specify a language for a file.
552+
553+Example: To use "INI" syntax highlighting for all files with a `.conf` file extension, use
554+```bash
555+--map-syntax='*.conf:INI'
556+```
557+
558+Example: To open all files called `.ignore` (exact match) with the "Git Ignore" syntax, use:
559+```bash
560+--map-syntax='.ignore:Git Ignore'
561+```
562+
563+Example: To open all `.conf` files in subfolders of `/etc/apache2` with the "Apache Conf"
564+syntax, use (this mapping is already built in):
565+```bash
566+--map-syntax='/etc/apache2/**/*.conf:Apache Conf'
567+```
568+
450### Using a different pager
569### Using a different pager
451
570
452`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
571`bat` uses the pager that is specified in the `PAGER` environment variable. If this variable is not
@@ -454,6 +573,8 @@ set, `less` is used by default. If you want to use a different pager, you can ei
454`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
573`PAGER` variable or set the `BAT_PAGER` environment variable to override what is specified in
455`PAGER`.
574`PAGER`.
456
575
576+**Note**: If `PAGER` is `more` or `most`, `bat` will silently use `less` instead to ensure support for colors.
577+
457If you want to pass command-line arguments to the pager, you can also set them via the
578If you want to pass command-line arguments to the pager, you can also set them via the
458`PAGER`/`BAT_PAGER` variables:
579`PAGER`/`BAT_PAGER` variables:
459
580
@@ -478,6 +599,16 @@ If you want to enable mouse-wheel scrolling on older versions of `less`, you can
478in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer,
599in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer,
479it should work out of the box.
600it should work out of the box.
480
601
602+### Indentation
603+
604+`bat` expands tabs to 4 spaces by itself, not relying on the pager. To change this, simply add the
605+`--tabs` argument with the number of spaces you want to be displayed.
606+
607+**Note**: Defining tab stops for the pager (via the `--pager` argument by `bat`, or via the `LESS`
608+environment variable for `less`) won't be taken into account because the pager will already get
609+expanded spaces instead of tabs. This behaviour is added to avoid indentation issues caused by the
610+sidebar. Calling `bat` with `--tabs=0` will override it and let tabs be consumed by the pager.
611+
481### Dark mode
612### Dark mode
482
613
483If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
614If you make use of the dark mode feature in macOS, you might want to configure `bat` to use a different
@@ -488,11 +619,12 @@ and the `GitHub` theme when in the _light mode_.
488alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
619alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
489```
620```
490
621
622+
491## Configuration file
623## Configuration file
492
624
493`bat` can also be customized with a configuration file. The location of the file is dependent
625`bat` can also be customized with a configuration file. The location of the file is dependent
494on your operating system. To get the default path for your system, call
626on your operating system. To get the default path for your system, call
495−```
627+```bash
496bat --config-file
628bat --config-file
497```
629```
498
630
@@ -522,17 +654,18 @@ Example configuration file:
522# Use italic text on the terminal (not supported on all terminals)
654# Use italic text on the terminal (not supported on all terminals)
523--italic-text=always
655--italic-text=always
524
656
525−# Use C++ syntax for .ino files
657+# Use C++ syntax for Arduino .ino files
526--map-syntax "*.ino:C++"
658--map-syntax "*.ino:C++"
527−
528−# Use ".gitignore"-style highlighting for ".ignore" files
529−--map-syntax ".ignore:Git Ignore"
530```
659```
531
660
532## Using `bat` on Windows
661## Using `bat` on Windows
533
662
534`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.
663`bat` mostly works out-of-the-box on Windows, but a few features may need extra configuration.
535
664
665+### Prerequisites
666+
667+You will need to install the [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) package.
668+
536### Paging
669### Paging
537
670
538Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
671Windows only includes a very limited pager in the form of `more`. You can download a Windows binary
@@ -573,11 +706,19 @@ bat() {
573
706
574## Troubleshooting
707## Troubleshooting
575
708
709+### Garbled output
710+
711+If an input file contains color codes or other ANSI escape sequences or control characters, `bat` will have problems
712+performing syntax highlighting and text wrapping, and thus the output can become garbled.
713+When displaying such files it is recommended to disable both syntax highlighting and wrapping by
714+passing the `--color=never --wrap=never` options to `bat`.
715+
576### Terminals & colors
716### Terminals & colors
577
717
578−`bat` handles terminals *with* and *without* truecolor support. However, the colors in the syntax
718+`bat` handles terminals *with* and *without* truecolor support. However, the colors in most syntax
579−highlighting themes are not optimized for 8-bit colors and it is therefore strongly recommended
719+highlighting themes are not optimized for 8-bit colors. It is therefore strongly recommended
580−that you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...).
720+that you use a terminal with 24-bit truecolor support (`terminator`, `konsole`, `iTerm2`, ...),
721+or use one of the basic [8-bit themes](#8-bit-themes) designed for a restricted set of colors.
581See [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of
722See [this article](https://gist.github.com/XVilka/8346728) for more details and a full list of
582terminals with truecolor support.
723terminals with truecolor support.
583
724
@@ -616,17 +757,32 @@ cargo build --bins
616cargo test
757cargo test
617
758
618# Install (release version)
759# Install (release version)
619−cargo install --locked
760+cargo install --path . --locked
620
761
621# Build a bat binary with modified syntaxes and themes
762# Build a bat binary with modified syntaxes and themes
622bash assets/create.sh
763bash assets/create.sh
623−cargo install --locked --force
764+cargo install --path . --locked --force
624```
765```
625
766
767+If you want to build an application that uses `bat`s pretty-printing
768+features as a library, check out the [the API documentation](https://docs.rs/bat/).
769+Note that you have to use either `regex-onig` or `regex-fancy` as a feature
770+when you depend on `bat` as a library.
771+
772+## Contributing
773+
774+Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
775+
626## Maintainers
776## Maintainers
627
777
628- [sharkdp](https://github.com/sharkdp)
778- [sharkdp](https://github.com/sharkdp)
629- [eth-p](https://github.com/eth-p)
779- [eth-p](https://github.com/eth-p)
780+- [keith-hall](https://github.com/keith-hall)
781+- [Enselic](https://github.com/Enselic)
782+
783+## Security vulnerabilities
784+
785+Please contact [David Peter](https://david-peter.de/) via email if you want to report a vulnerability in `bat`.
630
786
631## Project goals and alternatives
787## Project goals and alternatives
632
788
@@ -641,8 +797,8 @@ There are a lot of alternatives, if you are looking for similar programs. See
641[this document](doc/alternatives.md) for a comparison.
797[this document](doc/alternatives.md) for a comparison.
642
798
643## License
799## License
644−Copyright (c) 2018-2020 [bat-developers](https://github.com/sharkdp/bat).
800+Copyright (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat).
645
801
646−`bat` is distributed under the terms of both the MIT License and the Apache License 2.0.
802+`bat` is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
647
803
648See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
804See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
appveyor.ymldeleted−49
@@ -1,49 +0,0 @@
1−environment:
2− global:
3− TARGET: x86_64-pc-windows-msvc
4− RUST_VERSION: stable
5− CRATE_NAME: bat
6− CARGO_HOME: "c:\\cargo"
7− RUSTUP_HOME: "c:\\rustup"
8−
9−install:
10− - appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
11− - rustup-init.exe -y --default-host %TARGET% --profile minimal
12− - set PATH=%PATH%;C:\cargo\bin
13− - rustc -Vv
14− - cargo -V
15−
16−build: false
17−test_script:
18− - cargo test --target %TARGET% --verbose
19− - cargo run --target %TARGET% -- src/bin/bat/main.rs README.md --paging=never
20−
21−before_deploy:
22− # Generate artifacts for release
23− - cargo build --bins --release --verbose
24− - ps: ci\before_deploy.ps1
25−
26−deploy:
27− description: 'Automatically deployed release'
28− artifact: /.*\.zip/
29− # Here's how:
30− # - Go to 'https://github.com/settings/tokens/new' and generate a Token with only the
31− # `public_repo` scope enabled
32− # - Then go to 'https://ci.appveyor.com/tools/encrypt' and enter the newly generated token.
33− # - Enter the "encrypted value" below
34− auth_token:
35− secure: oO4/J+hcFXgXcEqEc8gzlQNqLG0IxU78s4EyH+uczGdsyWajb3yipxPR6nXUvmoj
36− provider: GitHub
37− on:
38− RUST_VERSION: stable
39− appveyor_repo_tag: true
40−
41−cache:
42− - C:\Users\appveyor\.cargo\registry
43− - target
44−
45−notifications:
46− - provider: Email
47− on_build_success: false
48− on_build_failure: false
49− on_build_status_changed: false
assets/README.mddeleted−44
@@ -1,44 +0,0 @@
1−## Syntax Highlighting in bat
2−
3−`bat` uses the [syntect](https://github.com/trishume/syntect) library to highlight source
4−code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
5−in the `.sublime-syntax` format.
6−
7−In order to add new syntaxes to `bat`, follow these steps:
8−
9−1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
10− which can be included as a submodule (under `assets/syntaxes`).
11−
12−2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
13− Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
14− *New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
15−
16−3. Run the `create.sh` script. It calls `bat cache --build` to parse all available
17− `.sublime-syntax` files and serialize them to a `syntaxes.bin` file (in this folder).
18−
19−4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
20− `bat` binary.
21−
22−5. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
23− file. A new binary cache file will be created once before every new release of `bat`.
24−
25−### Troubleshooting
26−
27−Make sure that the local cache does not interfere with the internally stored syntaxes and
28−themes (`bat cache --clear`).
29−
30−### Manual modifications
31−
32−The following files have been manually modified after converting from a `.tmLanguage` file:
33−
34−* `Dart.sublime-syntax` => removed `#regex.dart` include.
35−* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types.
36−* `Org mode.sublime-syntax` => removed `task` file type.
37−
38−### Non-submodule additions
39−
40−* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
41−* `Nim.sublime-syntax` has been added manually from https://github.com/getzola/zola/blob/master/sublime_syntaxes/Nim.sublime-syntax as there was no suitable Git repository for it. The original syntax seems to originate from https://github.com/Varriount/NimLime
42−* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
43− as it is not kept in a standalone repository. The file is generated from
44− https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
assets/acknowledgements.binnew file

Binary file not shown.

assets/completions/_bat.ps1.innew file+92
@@ -0,0 +1,92 @@
1+
2+using namespace System.Management.Automation
3+using namespace System.Management.Automation.Language
4+
5+Register-ArgumentCompleter -Native -CommandName '{{PROJECT_EXECUTABLE}}' -ScriptBlock {
6+ param($wordToComplete, $commandAst, $cursorPosition)
7+
8+ $commandElements = $commandAst.CommandElements
9+ $command = @(
10+ '{{PROJECT_EXECUTABLE}}'
11+ for ($i = 1; $i -lt $commandElements.Count; $i++) {
12+ $element = $commandElements[$i]
13+ if ($element -isnot [StringConstantExpressionAst] -or
14+ $element.StringConstantType -ne [StringConstantType]::BareWord -or
15+ $element.Value.StartsWith('-')) {
16+ break
17+ }
18+ $element.Value
19+ }) -join ';'
20+
21+ $completions = @(switch ($command) {
22+ '{{PROJECT_EXECUTABLE}}' {
23+ [CompletionResult]::new('-l', 'l', [CompletionResultType]::ParameterName, 'Set the language for syntax highlighting.')
24+ [CompletionResult]::new('--language', 'language', [CompletionResultType]::ParameterName, 'Set the language for syntax highlighting.')
25+ [CompletionResult]::new('-H', 'H', [CompletionResultType]::ParameterName, 'Highlight lines N through M.')
26+ [CompletionResult]::new('--highlight-line', 'highlight-line', [CompletionResultType]::ParameterName, 'Highlight lines N through M.')
27+ [CompletionResult]::new('--file-name', 'file-name', [CompletionResultType]::ParameterName, 'Specify the name to display for a file.')
28+ [CompletionResult]::new('--diff-context', 'diff-context', [CompletionResultType]::ParameterName, 'diff-context')
29+ [CompletionResult]::new('--tabs', 'tabs', [CompletionResultType]::ParameterName, 'Set the tab width to T spaces.')
30+ [CompletionResult]::new('--wrap', 'wrap', [CompletionResultType]::ParameterName, 'Specify the text-wrapping mode (*auto*, never, character).')
31+ [CompletionResult]::new('--terminal-width', 'terminal-width', [CompletionResultType]::ParameterName, 'Explicitly set the width of the terminal instead of determining it automatically. If prefixed with ''+'' or ''-'', the value will be treated as an offset to the actual terminal width. See also: ''--wrap''.')
32+ [CompletionResult]::new('--color', 'color', [CompletionResultType]::ParameterName, 'When to use colors (*auto*, never, always).')
33+ [CompletionResult]::new('--italic-text', 'italic-text', [CompletionResultType]::ParameterName, 'Use italics in output (always, *never*)')
34+ [CompletionResult]::new('--decorations', 'decorations', [CompletionResultType]::ParameterName, 'When to show the decorations (*auto*, never, always).')
35+ [CompletionResult]::new('--paging', 'paging', [CompletionResultType]::ParameterName, 'Specify when to use the pager, or use `-P` to disable (*auto*, never, always).')
36+ [CompletionResult]::new('--pager', 'pager', [CompletionResultType]::ParameterName, 'Determine which pager to use.')
37+ [CompletionResult]::new('-m', 'm', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
38+ [CompletionResult]::new('--map-syntax', 'map-syntax', [CompletionResultType]::ParameterName, 'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
39+ [CompletionResult]::new('--theme', 'theme', [CompletionResultType]::ParameterName, 'Set the color theme for syntax highlighting.')
40+ [CompletionResult]::new('--style', 'style', [CompletionResultType]::ParameterName, 'Comma-separated list of style elements to display (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
41+ [CompletionResult]::new('-r', 'r', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
42+ [CompletionResult]::new('--line-range', 'line-range', [CompletionResultType]::ParameterName, 'Only print the lines from N to M.')
43+ [CompletionResult]::new('-A', 'A', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
44+ [CompletionResult]::new('--show-all', 'show-all', [CompletionResultType]::ParameterName, 'Show non-printable characters (space, tab, newline, ..).')
45+ [CompletionResult]::new('-p', 'p', [CompletionResultType]::ParameterName, 'Show plain style (alias for ''--style=plain'').')
46+ [CompletionResult]::new('--plain', 'plain', [CompletionResultType]::ParameterName, 'Show plain style (alias for ''--style=plain'').')
47+ [CompletionResult]::new('-d', 'd', [CompletionResultType]::ParameterName, 'Only show lines that have been added/removed/modified.')
48+ [CompletionResult]::new('--diff', 'diff', [CompletionResultType]::ParameterName, 'Only show lines that have been added/removed/modified.')
49+ [CompletionResult]::new('-n', 'n', [CompletionResultType]::ParameterName, 'Show line numbers (alias for ''--style=numbers'').')
50+ [CompletionResult]::new('--number', 'number', [CompletionResultType]::ParameterName, 'Show line numbers (alias for ''--style=numbers'').')
51+ [CompletionResult]::new('-f', 'f', [CompletionResultType]::ParameterName, 'f')
52+ [CompletionResult]::new('--force-colorization', 'force-colorization', [CompletionResultType]::ParameterName, 'force-colorization')
53+ [CompletionResult]::new('-P', 'P', [CompletionResultType]::ParameterName, 'Alias for ''--paging=never''')
54+ [CompletionResult]::new('--no-paging', 'no-paging', [CompletionResultType]::ParameterName, 'Alias for ''--paging=never''')
55+ [CompletionResult]::new('--list-themes', 'list-themes', [CompletionResultType]::ParameterName, 'Display all supported highlighting themes.')
56+ [CompletionResult]::new('-L', 'L', [CompletionResultType]::ParameterName, 'Display all supported languages.')
57+ [CompletionResult]::new('--list-languages', 'list-languages', [CompletionResultType]::ParameterName, 'Display all supported languages.')
58+ [CompletionResult]::new('-u', 'u', [CompletionResultType]::ParameterName, 'u')
59+ [CompletionResult]::new('--unbuffered', 'unbuffered', [CompletionResultType]::ParameterName, 'unbuffered')
60+ [CompletionResult]::new('--no-config', 'no-config', [CompletionResultType]::ParameterName, 'Do not use the configuration file')
61+ [CompletionResult]::new('--no-custom-assets', 'no-custom-assets', [CompletionResultType]::ParameterName, 'Do not load custom assets')
62+ [CompletionResult]::new('--config-file', 'config-file', [CompletionResultType]::ParameterName, 'Show path to the configuration file.')
63+ [CompletionResult]::new('--generate-config-file', 'generate-config-file', [CompletionResultType]::ParameterName, 'Generates a default configuration file.')
64+ [CompletionResult]::new('--config-dir', 'config-dir', [CompletionResultType]::ParameterName, 'Show bat''s configuration directory.')
65+ [CompletionResult]::new('--cache-dir', 'cache-dir', [CompletionResultType]::ParameterName, 'Show bat''s cache directory.')
66+ [CompletionResult]::new('--diagnostic', 'diagnostic', [CompletionResultType]::ParameterName, 'Show diagnostic information for bug reports.')
67+ [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Print this help message.')
68+ [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Print this help message.')
69+ [CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Show version information.')
70+ [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Show version information.')
71+ [CompletionResult]::new('cache', 'cache', [CompletionResultType]::ParameterValue, 'Modify the syntax-definition and theme cache')
72+ break
73+ }
74+ '{{PROJECT_EXECUTABLE}};cache' {
75+ [CompletionResult]::new('--source', 'source', [CompletionResultType]::ParameterName, 'Use a different directory to load syntaxes and themes from.')
76+ [CompletionResult]::new('--target', 'target', [CompletionResultType]::ParameterName, 'Use a different directory to store the cached syntax and theme set.')
77+ [CompletionResult]::new('-b', 'b', [CompletionResultType]::ParameterName, 'Initialize (or update) the syntax/theme cache.')
78+ [CompletionResult]::new('--build', 'build', [CompletionResultType]::ParameterName, 'Initialize (or update) the syntax/theme cache.')
79+ [CompletionResult]::new('-c', 'c', [CompletionResultType]::ParameterName, 'Remove the cached syntax definitions and themes.')
80+ [CompletionResult]::new('--clear', 'clear', [CompletionResultType]::ParameterName, 'Remove the cached syntax definitions and themes.')
81+ [CompletionResult]::new('--blank', 'blank', [CompletionResultType]::ParameterName, 'Create completely new syntax and theme sets (instead of appending to the default sets).')
82+ [CompletionResult]::new('-h', 'h', [CompletionResultType]::ParameterName, 'Prints help information')
83+ [CompletionResult]::new('--help', 'help', [CompletionResultType]::ParameterName, 'Prints help information')
84+ [CompletionResult]::new('-V', 'V', [CompletionResultType]::ParameterName, 'Prints version information')
85+ [CompletionResult]::new('--version', 'version', [CompletionResultType]::ParameterName, 'Prints version information')
86+ break
87+ }
88+ })
89+
90+ $completions.Where{ $_.CompletionText -like "$wordToComplete*" } |
91+ Sort-Object -Property ListItemText
92+}
assets/completions/bat.bash.innew file+101
@@ -0,0 +1,101 @@
1+# shellcheck disable=SC2207
2+
3+# Requires https://github.com/scop/bash-completion
4+
5+# Macs have bash3 for which the bash-completion package doesn't include
6+# _init_completion. This is a minimal version of that function.
7+__bat_init_completion()
8+{
9+ COMPREPLY=()
10+ _get_comp_words_by_ref "$@" cur prev words cword
11+}
12+
13+_bat() {
14+ local cur prev words cword split=false
15+ if declare -F _init_completion >/dev/null 2>&1; then
16+ _init_completion -s || return 0
17+ else
18+ __bat_init_completion -n "=" || return 0
19+ _split_longopt && split=true
20+ fi
21+
22+ if [[ ${words[1]-} == cache ]]; then
23+ case $prev in
24+ --source | --target)
25+ _filedir -d
26+ return 0
27+ ;;
28+ esac
29+ COMPREPLY=($(compgen -W "
30+ --build --clear --source --target --blank --help
31+ " -- "$cur"))
32+ return 0
33+ fi
34+
35+ case $prev in
36+ -l | --language)
37+ local IFS=$'\n'
38+ COMPREPLY=($(compgen -W "$(
39+ "$1" --list-languages | while IFS=: read -r lang _; do
40+ printf "%s\n" "$lang"
41+ done
42+ )" -- "$cur"))
43+ compopt -o filenames # for escaping
44+ return 0
45+ ;;
46+ -H | --highlight-line | --diff-context | --tabs | --terminal-width | \
47+ -m | --map-syntax | --style | --line-range | -h | --help | -V | \
48+ --version | --diagnostic | --config-file | --config-dir | \
49+ --cache-dir | --generate-config-file)
50+ # argument required but no completion available, or option
51+ # causes an exit
52+ return 0
53+ ;;
54+ --file-name)
55+ _filedir
56+ return 0
57+ ;;
58+ --wrap)
59+ COMPREPLY=($(compgen -W "auto never character" -- "$cur"))
60+ return 0
61+ ;;
62+ --color | --decorations | --paging)
63+ COMPREPLY=($(compgen -W "auto never always" -- "$cur"))
64+ return 0
65+ ;;
66+ --italic-text)
67+ COMPREPLY=($(compgen -W "always never" -- "$cur"))
68+ return 0
69+ ;;
70+ --pager)
71+ COMPREPLY=($(compgen -c -- "$cur"))
72+ return 0
73+ ;;
74+ --theme)
75+ local IFS=$'\n'
76+ COMPREPLY=($(compgen -W "$("$1" --list-themes)" -- "$cur"))
77+ compopt -o filenames # for escaping
78+ return 0
79+ ;;
80+ esac
81+
82+ $split && return 0
83+
84+ if [[ $cur == -* ]]; then
85+ COMPREPLY=($(compgen -W "
86+ --show-all --plain --language --highlight-line
87+ --file-name --diff --diff-context --tabs --wrap
88+ --terminal-width --number --color --italic-text
89+ --decorations --paging --pager --map-syntax --theme
90+ --list-themes --style --line-range --list-languages
91+ --help --version --force-colorization --unbuffered
92+ --diagnostic --config-file --config-dir --cache-dir
93+ --generate-config-file
94+ " -- "$cur"))
95+ return 0
96+ fi
97+
98+ _filedir
99+ ((cword == 1)) && COMPREPLY+=($(compgen -W cache -- "$cur"))
100+
101+} && complete -F _bat {{PROJECT_EXECUTABLE}}
assets/completions/bat.fish.in+4−2
@@ -34,7 +34,7 @@ complete -c {{PROJECT_EXECUTABLE}} -s H -l highlight-line -x -d "<N> Highlight t
34
34
35complete -c {{PROJECT_EXECUTABLE}} -l italic-text -xka "always never" -d "Specify when to use ANSI sequences for italic text (default: never)" -n "not __fish_seen_subcommand_from cache"
35complete -c {{PROJECT_EXECUTABLE}} -l italic-text -xka "always never" -d "Specify when to use ANSI sequences for italic text (default: never)" -n "not __fish_seen_subcommand_from cache"
36
36
37−complete -c {{PROJECT_EXECUTABLE}} -s l -l language -d "Set the language for syntax highlighting" -n "not __fish_seen_subcommand_from cache" -xa "(__{{PROJECT_EXECUTABLE}}_autocomplete_languages)"
37+complete -c {{PROJECT_EXECUTABLE}} -s l -l language -d "Set the language for syntax highlighting" -n "not __fish_seen_subcommand_from cache" -xa "(__{{PROJECT_EXECUTABLE}}_autocomplete_languages)"
38
38
39complete -c {{PROJECT_EXECUTABLE}} -s r -l line-range -x -d "<N:M> Only print the specified range of lines for each file" -n "not __fish_seen_subcommand_from cache"
39complete -c {{PROJECT_EXECUTABLE}} -s r -l line-range -x -d "<N:M> Only print the specified range of lines for each file" -n "not __fish_seen_subcommand_from cache"
40
40
@@ -52,9 +52,11 @@ complete -c {{PROJECT_EXECUTABLE}} -l paging -xka "auto never always" -d "Specif
52
52
53complete -c {{PROJECT_EXECUTABLE}} -s p -l plain -d "Only show plain style, no decorations. Alias for '--style=plain'" -n "not __fish_seen_subcommand_from cache"
53complete -c {{PROJECT_EXECUTABLE}} -s p -l plain -d "Only show plain style, no decorations. Alias for '--style=plain'" -n "not __fish_seen_subcommand_from cache"
54
54
55+complete -c {{PROJECT_EXECUTABLE}} -s P -d "Disable paging. Alias for '--paging=never'" -n "not __fish_seen_subcommand_from cache"
56+
55complete -c {{PROJECT_EXECUTABLE}} -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
57complete -c {{PROJECT_EXECUTABLE}} -s A -l show-all -d "Show non-printable characters like space/tab/newline" -n "not __fish_seen_subcommand_from cache"
56
58
57−complete -c {{PROJECT_EXECUTABLE}} -l style -xka "auto full plain changes header grid numbers" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
59+complete -c {{PROJECT_EXECUTABLE}} -l style -xka "default auto full plain changes header header-filename header-filesize grid rule numbers snip" -d "Comma-separated list of style elements or presets to display with file contents" -n "not __fish_seen_subcommand_from cache"
58
60
59complete -c {{PROJECT_EXECUTABLE}} -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
61complete -c {{PROJECT_EXECUTABLE}} -l tabs -x -d "<T> Set the tab width to T spaces (width of 0 passes tabs through directly)" -n "not __fish_seen_subcommand_from cache"
60
62
assets/completions/bat.zsh.innew file+99
@@ -0,0 +1,99 @@
1+#compdef {{PROJECT_EXECUTABLE}}
2+
3+local context state state_descr line
4+typeset -A opt_args
5+
6+(( $+functions[_{{PROJECT_EXECUTABLE}}_cache_subcommand] )) ||
7+_{{PROJECT_EXECUTABLE}}_cache_subcommand() {
8+ local -a args
9+ args=(
10+ '(-b --build -c --clear)'{-b,--build}'[Initialize or update the syntax/theme cache]'
11+ '(-b --build -c --clear)'{-c,--clear}'[Remove the cached syntax definitions and themes]'
12+ '(--source)'--source='[Use a different directory to load syntaxes and themes from]:directory:_files -/'
13+ '(--target)'--target='[Use a different directory to store the cached syntax and theme set]:directory:_files -/'
14+ '(--blank)'--blank'[Create completely new syntax and theme sets]'
15+ '(: -)'{-h,--help}'[Prints help information]'
16+ '*: :'
17+ )
18+
19+ _arguments -S -s $args
20+}
21+
22+(( $+functions[_{{PROJECT_EXECUTABLE}}_main] )) ||
23+_{{PROJECT_EXECUTABLE}}_main() {
24+ local -a args
25+ args=(
26+ '(-A --show-all)'{-A,--show-all}'[Show non-printable characters (space, tab, newline, ..)]'
27+ '*'{-p,--plain}'[Show plain style (alias for `--style=plain`), repeat twice to disable disable automatic paging (alias for `--paging=never`)]'
28+ '(-l --language)'{-l+,--language=}'[Set the language for syntax highlighting]:<language>:->language'
29+ '(-H --highlight-line)'{-H,--highlight-line}'[Highlight lines N through M]:<N\:M>...'
30+ '(--file-name)'--file-name'[Specify the name to display for a file]:<name>...:_files'
31+ '(-d --diff)'--diff'[Only show lines that have been added/removed/modified]'
32+ '(--diff-context)'--diff-context'[Include N lines of context around added/removed/modified lines when using `--diff`]:<N> (lines):()'
33+ '(--tabs)'--tabs'[Set the tab width to T spaces]:<T> (tab width):()'
34+ '(--wrap)'--wrap='[Specify the text-wrapping mode]:<when>:(auto never character)'
35+ '(--terminal-width)'--terminal-width'[Explicitly set the width of the terminal instead of determining it automatically]:<width>'
36+ '(-n --number)'{-n,--number}'[Show line numbers]'
37+ '(--color)'--color='[When to use colors]:<when>:(auto never always)'
38+ '(--italic-text)'--italic-text='[Use italics in output]:<when>:(always never)'
39+ '(--decorations)'--decorations='[When to show the decorations]:<when>:(auto never always)'
40+ '(--paging)'--paging='[Specify when to use the pager]:<when>:(auto never always)'
41+ '(-m --map-syntax)'{-m+,--map-syntax=}'[Use the specified syntax for files matching the glob pattern]:<glob\:syntax>...'
42+ '(--theme)'--theme='[Set the color theme for syntax highlighting]:<theme>:->theme'
43+ '(: --list-themes --list-languages -L)'--list-themes'[Display all supported highlighting themes]'
44+ '(--style)'--style='[Comma-separated list of style elements to display]:<components>:->style'
45+ '(-r --line-range)'{-r+,--line-range=}'[Only print the lines from N to M]:<N\:M>...'
46+ '(: --list-themes --list-languages -L)'{-L,--list-languages}'[Display all supported languages]'
47+ '(: --no-config)'--no-config'[Do not use the configuration file]'
48+ '(: --no-custom-assets)'--no-custom-assets'[Do not load custom assets]'
49+ '(: --config-dir)'--config-dir'[Show bat'"'"'s configuration directory]'
50+ '(: --config-file)'--config-file'[Show path to the configuration file]'
51+ '(: --generate-config-file)'--generate-config-file'[Generates a default configuration file]'
52+ '(: --cache-dir)'--cache-dir'[Show bat'"'"'s cache directory]'
53+ '(: -)'{-h,--help}'[Print this help message]'
54+ '(: -)'{-V,--version}'[Show version information]'
55+ '*: :_files'
56+ )
57+
58+ _arguments -S -s $args
59+
60+ case "$state" in
61+ language)
62+ local IFS=$'\n'
63+ local -a languages
64+ languages=( $({{PROJECT_EXECUTABLE}} --list-languages | awk -F':|,' '{ for (i = 1; i <= NF; ++i) printf("%s:%s\n", $i, $1) }') )
65+
66+ _describe 'language' languages
67+ ;;
68+
69+ theme)
70+ local IFS=$'\n'
71+ local -a themes
72+ themes=( $({{PROJECT_EXECUTABLE}} --list-themes | sort) )
73+
74+ _values 'theme' $themes
75+ ;;
76+
77+ style)
78+ _values -s , 'style' default auto full plain changes header header-filename header-filesize grid rule numbers snip
79+ ;;
80+ esac
81+}
82+
83+# first positional argument
84+if (( ${#words} == 2 )); then
85+ local -a subcommands
86+ subcommands=('cache:Modify the syntax-definition and theme cache')
87+ _describe subcommand subcommands
88+ _{{PROJECT_EXECUTABLE}}_main
89+else
90+ case $words[2] in
91+ cache)
92+ _{{PROJECT_EXECUTABLE}}_cache_subcommand
93+ ;;
94+
95+ *)
96+ _{{PROJECT_EXECUTABLE}}_main
97+ ;;
98+ esac
99+fi
assets/create.sh+15−9
@@ -1,11 +1,11 @@
1−#!/bin/bash
1+#!/usr/bin/env bash
2set -euo pipefail
2set -euo pipefail
3
3
4ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
4ASSET_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
5REPO_DIR="$ASSET_DIR/.."
5REPO_DIR="$ASSET_DIR/.."
6
6
7# Ensure submodules are initialized.
7# Ensure submodules are initialized.
8−function update_submodules() {
8+update_submodules() {
9 local submodule
9 local submodule
10 local submodule_prompt=unspecified
10 local submodule_prompt=unspecified
11 local submodule_path
11 local submodule_path
@@ -46,6 +46,7 @@ bat cache --clear
46# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
46# - Remove the JavaDoc patch once https://github.com/trishume/syntect/issues/222 has been fixed
47# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
47# - Remove the C# patch once https://github.com/sublimehq/Packages/pull/2331 has been merged
48
48
49+# Apply patches
49(
50(
50 cd "$ASSET_DIR"
51 cd "$ASSET_DIR"
51 for patch in patches/*.patch; do
52 for patch in patches/*.patch; do
@@ -53,11 +54,16 @@ bat cache --clear
53 done
54 done
54)
55)
55
56
56−bat cache --build --blank --source="$ASSET_DIR" --target="$ASSET_DIR"
57+reverse_patches() {
58+ (
59+ cd "$ASSET_DIR"
60+ for patch in patches/*.patch; do
61+ patch --strip=0 --reverse <"$patch"
62+ done
63+ )
64+}
57
65
58−(
66+# Make sure to always reverse patches, even if the `bat cache` command fails or aborts
59− cd "$ASSET_DIR"
67+trap reverse_patches EXIT
60− for patch in patches/*.patch; do
68+
61− patch --strip=0 --reverse < "$patch"
69+bat cache --build --blank --acknowledgements --source="$ASSET_DIR" --target="$ASSET_DIR"
62− done
63−)
assets/manual/bat.1.in+75−10
@@ -1,4 +1,4 @@
1−.TH {{PROJECT_EXECUTABLE | upcase}} "1"
1+.TH {{PROJECT_EXECUTABLE_UPPERCASE}} "1"
2.SH NAME
2.SH NAME
3{{PROJECT_EXECUTABLE}} \- a cat(1) clone with syntax highlighting and Git integration.
3{{PROJECT_EXECUTABLE}} \- a cat(1) clone with syntax highlighting and Git integration.
4.SH "USAGE"
4.SH "USAGE"
@@ -40,7 +40,7 @@ language names and file extensions.
40.HP
40.HP
41\fB\-H\fR, \fB\-\-highlight\-line\fR <N:M>...
41\fB\-H\fR, \fB\-\-highlight\-line\fR <N:M>...
42.IP
42.IP
43−Highlight the specified line ranges with a different background color For example:
43+Highlight the specified line ranges with a different background color. For example:
44.RS
44.RS
45.IP "\-\-highlight\-line 40"
45.IP "\-\-highlight\-line 40"
46highlights line 40
46highlights line 40
@@ -50,8 +50,22 @@ highlights lines 30 to 40
50highlights lines 1 to 40
50highlights lines 1 to 40
51.IP "\-\-highlight\-line 40:"
51.IP "\-\-highlight\-line 40:"
52highlights lines 40 to the end of the file
52highlights lines 40 to the end of the file
53+.IP "\-\-highlight\-line 30:+10"
54+highlights lines 30 to 40
53.RE
55.RE
54.HP
56.HP
57+\fB\-\-file\-name\fR <name>...
58+.IP
59+Specify the name to display for a file. Useful when piping data to {{PROJECT_EXECUTABLE}} from STDIN when {{PROJECT_EXECUTABLE}} does not otherwise know the filename. Note that the provided file name is also used for syntax detection.
60+.HP
61+\fB\-d\fR, \fB\-\-diff\fR
62+.IP
63+Only show lines that have been added/removed/modified with respect to the Git index. Use '\-\-diff\-context=N' to control how much context you want to see.
64+.HP
65+\fB\-\-diff\-context\fR <N>...
66+.IP
67+Include N lines of context around added/removed/modified lines when using '\-\-diff'.
68+.HP
55\fB\-\-tabs\fR <T>
69\fB\-\-tabs\fR <T>
56.IP
70.IP
57Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
71Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
@@ -87,18 +101,25 @@ Specify when to use the decorations that have been specified via '\-\-style'. Th
87automatic mode only enables decorations if an interactive terminal is detected. Possible
101automatic mode only enables decorations if an interactive terminal is detected. Possible
88values: *auto*, never, always.
102values: *auto*, never, always.
89.HP
103.HP
104+\fB\-f\fR, \fB\-\-force\-colorization\fR
105+.IP
106+Alias for '--decorations=always --color=always'. This is useful \
107+if the output of {{PROJECT_EXECUTABLE}} is piped to another program, but you want \
108+to keep the colorization/decorations.
109+.HP
90\fB\-\-paging\fR <when>
110\fB\-\-paging\fR <when>
91.IP
111.IP
92−Specify when to use the pager. To control which pager is used, set the PAGER or
112+Specify when to use the pager. To disable the pager, use \&'\-\-paging=never' or its alias,
93−BAT_PAGER environment variables (the latter takes precedence) or use the '\-\-pager'
113+\fB-P\fR. To disable the pager permanently, set BAT_PAGER to an empty string. To control
94−option. To disable the pager permanently, set BAT_PAGER to an empty string or set
95−\&'\-\-paging=never' in the configuration file. Possible values: *auto*, never, always.
114+which pager is used, see the '\-\-pager' option. Possible values: *auto*, never, always.
96.HP
115.HP
97\fB\-\-pager\fR <command>
116\fB\-\-pager\fR <command>
98.IP
117.IP
99−Determine which pager is used. This option will overwrite the PAGER and BAT_PAGER
118+Determine which pager is used. This option will override the PAGER and BAT_PAGER
100−environment variables. The default pager is 'less'. To disable the pager completely, use
119+environment variables. The default pager is 'less'. To control when the pager is used, see
101the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
120the '\-\-paging' option. Example: '\-\-pager "less \fB\-RF\fR"'.
121+
122+Note: By default, if the pager is set to 'less' (and no command-line options are specified), 'bat' will pass the following command line options to the pager: '-R'/'--RAW-CONTROL-CHARS', '-F'/'--quit-if-one-screen' and '-X'/'--no-init'. The last option ('-X') is only used for 'less' versions older than 530. The '-R' option is needed to interpret ANSI colors correctly. The second option ('-F') instructs less to exit immediately if the output size is smaller than the vertical size of the terminal. This is convenient for small files because you do not have to press 'q' to quit the pager. The third option ('-X') is needed to fix a bug with the '--quit-if-one-screen' feature in old versions of 'less'. Unfortunately, it also breaks mouse-wheel support in 'less'. If you want to enable mouse-wheel scrolling on older versions of 'less', you can pass just '-R' (as in the example above, this will disable the quit-if-one-screen feature). For less 530 or newer, it should work out of the box.
102.HP
123.HP
103\fB\-m\fR, \fB\-\-map\-syntax\fR <glob-pattern:syntax-name>...
124\fB\-m\fR, \fB\-\-map\-syntax\fR <glob-pattern:syntax-name>...
104.IP
125.IP
@@ -106,6 +127,7 @@ Map a glob pattern to an existing syntax name. The glob pattern is matched on th
106path and the filename. For example, to highlight *.build files with the Python syntax,
127path and the filename. For example, to highlight *.build files with the Python syntax,
107use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore
128use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignore
108syntax, use -m '.myignore:Git Ignore'.
129syntax, use -m '.myignore:Git Ignore'.
130+Note that the right-hand side is the *name* of the syntax, not a file extension.
109.HP
131.HP
110\fB\-\-theme\fR <theme>
132\fB\-\-theme\fR <theme>
111.IP
133.IP
@@ -124,7 +146,8 @@ Configure which elements (line numbers, file headers, grid borders, Git modifica
124of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
146of components to display (e.g. 'numbers,changes,grid') or a pre\-defined style ('full').
125To set a default style, add the '\-\-style=".."' option to the configuration file or
147To set a default style, add the '\-\-style=".."' option to the configuration file or
126export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
148export the BAT_STYLE environment variable (e.g.: export BAT_STYLE=".."). Possible
127−values: *auto*, full, plain, changes, header, grid, numbers, snip.
149+values: *default*, full, auto, plain, changes, header, header-filename, header-filesize, grid,
150+rule, numbers, snip.
128.HP
151.HP
129\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
152\fB\-r\fR, \fB\-\-line\-range\fR <N:M>...
130.IP
153.IP
@@ -136,6 +159,8 @@ prints lines 30 to 40
136prints lines 1 to 40
159prints lines 1 to 40
137.IP "\-\-line\-range 40:"
160.IP "\-\-line\-range 40:"
138prints lines 40 to the end of the file
161prints lines 40 to the end of the file
162+.IP "\-\-line\-range 30:+10"
163+prints lines 30 to 40
139.RE
164.RE
140.HP
165.HP
141\fB\-L\fR, \fB\-\-list\-languages\fR
166\fB\-L\fR, \fB\-\-list\-languages\fR
@@ -169,5 +194,45 @@ is dependent on your operating system. To get the default path for your system,
169
194
170\fB{{PROJECT_EXECUTABLE}} --config-file\fR
195\fB{{PROJECT_EXECUTABLE}} --config-file\fR
171
196
172−Alternatively, you can use the BAT_CONFIG_PATH environment variable to point bat to a non-default
197+Alternatively, you can use the BAT_CONFIG_PATH environment variable to point {{PROJECT_EXECUTABLE}} to a non-default
173location of the configuration file.
198location of the configuration file.
199+
200+To generate a default configuration file, call:
201+
202+\fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR
203+.SH "ADDING CUSTOM LANGUAGES"
204+{{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be
205+customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language
206+files to `\fB$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes\fR` and run `\fB{{PROJECT_EXECUTABLE}} cache --build\fR`.
207+
208+\fBExample:\fR
209+
210+.RS 0.5i
211+mkdir -p "$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes"
212+.br
213+cd "$({{PROJECT_EXECUTABLE}} --config-dir)/syntaxes"
214+
215+# Put new '.sublime-syntax' language definition files
216+.br
217+# in this folder (or its subdirectories), for example:
218+.br
219+git clone https://github.com/tellnobody1/sublime-purescript-syntax
220+
221+# And then build the cache.
222+.br
223+{{PROJECT_EXECUTABLE}} cache --build
224+.RE
225+
226+Once the cache is built, the new language will be visible in `\fB{{PROJECT_EXECUTABLE}} --list-languages\fR`.
227+.br
228+If you ever want to remove the custom languages, you can clear the cache with `\fB{{PROJECT_EXECUTABLE}} cache --clear\fR`.
229+
230+.SH "ADDING CUSTOM THEMES"
231+Similarly to custom languages, {{PROJECT_EXECUTABLE}} supports Sublime Text \fB.tmTheme\fR themes.
232+These can be installed to `\fB$({{PROJECT_EXECUTABLE}} --config-dir)/themes\fR`, and are added to the cache with
233+`\fB{{PROJECT_EXECUTABLE}} cache --build`.
234+.SH "MORE INFORMATION"
235+
236+For more information and up-to-date documentation, visit the {{PROJECT_EXECUTABLE}} repo:
237+.br
238+\fBhttps://github.com/sharkdp/bat\fR
assets/patches/Groff.sublime-syntax.patchnew file+16
@@ -0,0 +1,16 @@
1+diff --git syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
2+index 57834af..6648664 100644
3+--- syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
4++++ syntaxes/02_Extra/Groff/Man Page/Man Page.sublime-syntax
5+@@ -4,9 +4,9 @@
6+ # - man-pages(7)
7+ # - groff(7)
8+ ---
9+-name: Man Page (groff/troff)
10++name: Groff/troff
11+ scope: text.groff
12+-file_extensions: [man, groff, troff, '1', '2', '3', '4', '5', '6', '7']
13++file_extensions: [groff, troff, '1', '2', '3', '4', '5', '6', '7', '8', '9']
14+
15+ contexts:
16+ main:
assets/patches/Markdown.sublime-syntax.patch+10−1
@@ -1,5 +1,5 @@
1diff --git syntaxes/01_Packages/Markdown/Markdown.sublime-syntax syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
1diff --git syntaxes/01_Packages/Markdown/Markdown.sublime-syntax syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
2−index 19dc685d..6afd87ae 100644
2+index 19dc685d..44440c7f 100644
3--- syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
3--- syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
4+++ syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
4+++ syntaxes/01_Packages/Markdown/Markdown.sublime-syntax
5@@ -24,7 +24,6 @@ variables:
5@@ -24,7 +24,6 @@ variables:
@@ -166,3 +166,12 @@ index 19dc685d..6afd87ae 100644
166 - match: ^\s*$\n?
166 - match: ^\s*$\n?
167 scope: invalid.illegal.non-terminated.bold-italic.markdown
167 scope: invalid.illegal.non-terminated.bold-italic.markdown
168 pop: true
168 pop: true
169+@@ -1152,7 +1110,7 @@ contexts:
170+ - match: |-
171+ (?x)
172+ {{fenced_code_block_start}}
173+- ((?i:rust))
174++ ((?i:rust|rs))
175+ {{fenced_code_block_trailing_infostring_characters}}
176+ captures:
177+ 0: meta.code-fence.definition.begin.rust.markdown-gfm
assets/patches/MediaWiki.sublime-syntax.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
2+index f542c9e..8eaf020 100644
3+--- syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
4++++ syntaxes/02_Extra/MediaWiki/MediawikiNG.sublime-syntax
5+@@ -1,7 +1,7 @@
6+ %YAML 1.2
7+ ---
8+ # http://www.sublimetext.com/docs/3/syntax.html
9+-name: Mediawiki NG
10++name: MediaWiki
11+ file_extensions: [mediawiki, wikipedia, wiki]
12+ scope: text.html.mediawiki
13+
assets/patches/Monokai-Extended.tmTheme.patchnew file+36
@@ -0,0 +1,36 @@
1+diff --git themes/sublime-monokai-extended/Monokai\ Extended.tmTheme themes/sublime-monokai-extended/Monokai\ Extended.tmTheme
2+index 9c2aa3e..180cbbf 100644
3+--- themes/sublime-monokai-extended/Monokai Extended.tmTheme
4++++ themes/sublime-monokai-extended/Monokai Extended.tmTheme
5+@@ -810,11 +810,11 @@
6+ <key>name</key>
7+ <string>JSON String</string>
8+ <key>scope</key>
9+- <string>meta.structure.dictionary.json string.quoted.double.json</string>
10++ <string>meta.mapping.key.json string.quoted.double.json, punctuation.separator.sequence.csv</string>
11+ <key>settings</key>
12+ <dict>
13+ <key>foreground</key>
14+- <string>#cfcfc2</string>
15++ <string>#fd971f</string>
16+ </dict>
17+ </dict>
18+ <dict>
19+@@ -1027,7 +1027,7 @@
20+ <key>name</key>
21+ <string>Invalid</string>
22+ <key>scope</key>
23+- <string>invalid</string>
24++ <string>invalid, markup.error</string>
25+ <key>settings</key>
26+ <dict>
27+ <key>background</key>
28+@@ -1042,7 +1042,7 @@
29+ <key>name</key>
30+ <string>Invalid deprecated</string>
31+ <key>scope</key>
32+- <string>invalid.deprecated</string>
33++ <string>invalid.deprecated, markup.warning</string>
34+ <key>settings</key>
35+ <dict>
36+ <key>background</key>
assets/patches/Python.sublime-syntax.patchnew file+15
@@ -0,0 +1,15 @@
1+diff --git syntaxes/01_Packages/Python/Python.sublime-syntax syntaxes/01_Packages/Python/Python.sublime-syntax
2+index 2acd86d8..86257f7b 100644
3+--- syntaxes/01_Packages/Python/Python.sublime-syntax
4++++ syntaxes/01_Packages/Python/Python.sublime-syntax
5+@@ -988,10 +988,6 @@ contexts:
6+ - match: \}
7+ scope: punctuation.section.mapping-or-set.end.python
8+ set: after-expression
9+- - match: (?={{simple_expression}}:|\s*\*\*)
10+- set: inside-dictionary
11+- - match: (?={{simple_expression}}[,}]|\s*\*)
12+- set: inside-set
13+ - match: ','
14+ scope: punctuation.separator.set.python
15+ set: inside-set
assets/patches/ShellScript.sublime-syntax.patchnew file+20
@@ -0,0 +1,20 @@
1+diff --git syntaxes/01_Packages/ShellScript/Bash.sublime-syntax syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
2+index e973e319..07c170a7 100644
3+--- syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
4++++ syntaxes/01_Packages/ShellScript/Bash.sublime-syntax
5+@@ -30,12 +30,12 @@ file_extensions:
6+ - .zshenv
7+ - .zshrc
8+ - PKGBUILD # https://jlk.fjfi.cvut.cz/arch/manpages/man/PKGBUILD.5
9+- - .ebuild
10+- - .eclass
11++ - ebuild
12++ - eclass
13+
14+ first_line_match: |
15+ (?x)
16+- ^\#! .* \b(bash|zsh|sh|tcsh|ash)\b
17++ ^\#! .* \b(bash|zsh|sh|tcsh|ash|dash)\b
18+ | ^\# \s* -\*- [^*]* mode: \s* shell-script [^*]* -\*-
19+
20+ #-------------------------------------------------------------------------------
assets/patches/XML.sublime-syntax.patchnew file+12
@@ -0,0 +1,12 @@
1+diff --git syntaxes/01_Packages/XML/XML.sublime-syntax syntaxes/01_Packages/XML/XML.sublime-syntax
2+index ad7d9c87..af4a00f0 100644
3+--- syntaxes/01_Packages/XML/XML.sublime-syntax
4++++ syntaxes/01_Packages/XML/XML.sublime-syntax
5+@@ -12,6 +12,7 @@ file_extensions:
6+ - rss
7+ - opml
8+ - svg
9++ - xaml
10+ first_line_match: |-
11+ (?x:
12+ ^(?:
assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/AWK+1−1

Submodule changed.

assets/syntaxes/02_Extra/Apachenew file+1

Submodule changed.

assets/syntaxes/02_Extra/Apache.sublime-syntaxnew file+221
@@ -0,0 +1,221 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Apache Conf
5+file_extensions:
6+ - envvars
7+ - htaccess
8+ - HTACCESS
9+ - htgroups
10+ - HTGROUPS
11+ - htpasswd
12+ - HTPASSWD
13+ - .htaccess
14+ - .HTACCESS
15+ - .htgroups
16+ - .HTGROUPS
17+ - .htpasswd
18+ - .HTPASSWD
19+scope: source.apacheconf
20+contexts:
21+ main:
22+ - match: ^(\s)*(#).*$\n?
23+ scope: comment.line.hash.ini
24+ captures:
25+ 1: punctuation.definition.comment.apacheconf
26+ - match: (<)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(\s(.+?))?(>)
27+ captures:
28+ 1: punctuation.definition.tag.apacheconf
29+ 2: entity.tag.apacheconf
30+ 4: string.value.apacheconf
31+ 5: punctuation.definition.tag.apacheconf
32+ - match: (</)(Proxy|ProxyMatch|IfVersion|Directory|DirectoryMatch|Files|FilesMatch|IfDefine|IfModule|Limit|LimitExcept|Location|LocationMatch|VirtualHost|Macro|If|Else|ElseIf)(>)
33+ captures:
34+ 1: punctuation.definition.tag.apacheconf
35+ 2: entity.tag.apacheconf
36+ 3: punctuation.definition.tag.apacheconf
37+ - match: (?<=(Rewrite(Rule|Cond)))\s+(.+?)\s+(.+?)($|\s)
38+ captures:
39+ 3: string.regexp.apacheconf
40+ 4: string.replacement.apacheconf
41+ - match: (?<=RedirectMatch)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
42+ captures:
43+ 2: entity.status.apacheconf
44+ 3: string.regexp.apacheconf
45+ 5: string.path.apacheconf
46+ - match: (?<=Redirect)(\s+(\d\d\d|permanent|temp|seeother|gone))?\s+(.+?)\s+((.+?)($|\s))?
47+ captures:
48+ 2: entity.status.apacheconf
49+ 3: string.path.apacheconf
50+ 5: string.path.apacheconf
51+ - match: (?<=ScriptAliasMatch|AliasMatch)\s+(.+?)\s+((.+?)\s)?
52+ captures:
53+ 1: string.regexp.apacheconf
54+ 3: string.path.apacheconf
55+ - match: (?<=RedirectPermanent|RedirectTemp|ScriptAlias|Alias)\s+(.+?)\s+((.+?)($|\s))?
56+ captures:
57+ 1: string.path.apacheconf
58+ 3: string.path.apacheconf
59+ - match: \b(AcceptPathInfo|AccessFileName|AddDefaultCharset|AddOutputFilterByType|AllowEncodedSlashes|AllowOverride|AuthName|AuthType|CGIMapExtension|ContentDigest|DefaultType|Define|DocumentRoot|EnableMMAP|EnableSendfile|ErrorDocument|ErrorLog|FileETag|ForceType|HostnameLookups|IdentityCheck|Include(Optional)?|KeepAlive|KeepAliveTimeout|LimitInternalRecursion|LimitRequestBody|LimitRequestFields|LimitRequestFieldSize|LimitRequestLine|LimitXMLRequestBody|LogLevel|MaxKeepAliveRequests|Mutex|NameVirtualHost|Options|Require|RLimitCPU|RLimitMEM|RLimitNPROC|Satisfy|ScriptInterpreterSource|ServerAdmin|ServerAlias|ServerName|ServerPath|ServerRoot|ServerSignature|ServerTokens|SetHandler|SetInputFilter|SetOutputFilter|Time(O|o)ut|TraceEnable|UseCanonicalName|Use|ErrorLogFormat|GlobalLog|PHPIniDir|SSLHonorCipherOrder|SSLCompression|SSLUseStapling|SSLStapling\w+|SSLCARevocationCheck|SSLSRPVerifierFile|SSLSessionTickets|RequestReadTimeout|ProxyHTML\w+|MaxRanges)\b
60+ captures:
61+ 1: keyword.core.apacheconf
62+ - match: \b(AcceptMutex|AssignUserID|BS2000Account|ChildPerUserID|CoreDumpDirectory|EnableExceptionHook|Group|Listen|ListenBacklog|LockFile|MaxClients|MaxConnectionsPerChild|MaxMemFree|MaxRequestsPerChild|MaxRequestsPerThread|MaxRequestWorkers|MaxSpareServers|MaxSpareThreads|MaxThreads|MaxThreadsPerChild|MinSpareServers|MinSpareThreads|NumServers|PidFile|ReceiveBufferSize|ScoreBoardFile|SendBufferSize|ServerLimit|StartServers|StartThreads|ThreadLimit|ThreadsPerChild|ThreadStackSize|User|Win32DisableAcceptEx)\b
63+ captures:
64+ 1: keyword.mpm.apacheconf
65+ - match: \b(Allow|Deny|Order)\b
66+ captures:
67+ 1: keyword.access.apacheconf
68+ - match: \b(Action|Script)\b
69+ captures:
70+ 1: keyword.actions.apacheconf
71+ - match: \b(Alias|AliasMatch|Redirect|RedirectMatch|RedirectPermanent|RedirectTemp|ScriptAlias|ScriptAliasMatch)\b
72+ captures:
73+ 1: keyword.alias.apacheconf
74+ - match: \b(AuthAuthoritative|AuthGroupFile|AuthUserFile|AuthBasicProvider|AuthBasicFake|AuthBasicAuthoritative|AuthBasicUseDigestAlgorithm)\b
75+ captures:
76+ 1: keyword.auth.apacheconf
77+ - match: \b(Anonymous|Anonymous_Authoritative|Anonymous_LogEmail|Anonymous_MustGiveEmail|Anonymous_NoUserID|Anonymous_VerifyEmail)\b
78+ captures:
79+ 1: keyword.auth_anon.apacheconf
80+ - match: \b(AuthDBMAuthoritative|AuthDBMGroupFile|AuthDBMType|AuthDBMUserFile)\b
81+ captures:
82+ 1: keyword.auth_dbm.apacheconf
83+ - match: \b(AuthDigestAlgorithm|AuthDigestDomain|AuthDigestFile|AuthDigestGroupFile|AuthDigestNcCheck|AuthDigestNonceFormat|AuthDigestNonceLifetime|AuthDigestQop|AuthDigestShmemSize|AuthDigestProvider)\b
84+ captures:
85+ 1: keyword.auth_digest.apacheconf
86+ - match: \b(AuthLDAPAuthoritative|AuthLDAPBindDN|AuthLDAPBindPassword|AuthLDAPCharsetConfig|AuthLDAPCompareDNOnServer|AuthLDAPDereferenceAliases|AuthLDAPEnabled|AuthLDAPFrontPageHack|AuthLDAPGroupAttribute|AuthLDAPGroupAttributeIsDN|AuthLDAPRemoteUserIsDN|AuthLDAPUrl)\b
87+ captures:
88+ 1: keyword.auth_ldap.apacheconf
89+ - match: \b(AddAlt|AddAltByEncoding|AddAltByType|AddDescription|AddIcon|AddIconByEncoding|AddIconByType|DefaultIcon|HeaderName|IndexIgnore|IndexOptions|IndexOrderDefault|IndexStyleSheet|IndexHeadInsert|ReadmeName)\b
90+ captures:
91+ 1: keyword.autoindex.apacheconf
92+ - match: \b(BalancerMember|BalancerGrowth|BalancerPersist|BalancerInherit)\b
93+ captures:
94+ 1: keyword.filter.apacheconf
95+ - match: \b(CacheDefaultExpire|CacheDisable|CacheEnable|CacheForceCompletion|CacheIgnoreCacheControl|CacheIgnoreHeaders|CacheIgnoreNoLastMod|CacheLastModifiedFactor|CacheMaxExpire)\b
96+ captures:
97+ 1: keyword.cache.apacheconf
98+ - match: \b(MetaDir|MetaFiles|MetaSuffix)\b
99+ captures:
100+ 1: keyword.cern_meta.apacheconf
101+ - match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength)\b
102+ captures:
103+ 1: keyword.cgi.apacheconf
104+ - match: \b(ScriptLog|ScriptLogBuffer|ScriptLogLength|ScriptSock)\b
105+ captures:
106+ 1: keyword.cgid.apacheconf
107+ - match: \b(CharsetDefault|CharsetOptions|CharsetSourceEnc)\b
108+ captures:
109+ 1: keyword.charset_lite.apacheconf
110+ - match: \b(Dav|DavDepthInfinity|DavMinTimeout|DavLockDB)\b
111+ captures:
112+ 1: keyword.dav.apacheconf
113+ - match: \b(DeflateBufferSize|DeflateCompressionLevel|DeflateFilterNote|DeflateMemLevel|DeflateWindowSize)\b
114+ captures:
115+ 1: keyword.deflate.apacheconf
116+ - match: \b(DirectoryIndex|DirectorySlash|FallbackResource)\b
117+ captures:
118+ 1: keyword.dir.apacheconf
119+ - match: \b(CacheDirLength|CacheDirLevels|CacheExpiryCheck|CacheGcClean|CacheGcDaily|CacheGcInterval|CacheGcMemUsage|CacheGcUnused|CacheMaxFileSize|CacheMinFileSize|CacheRoot|CacheSize|CacheTimeMargin)\b
120+ captures:
121+ 1: keyword.disk_cache.apacheconf
122+ - match: \b(DumpIOInput|DumpIOOutput)\b
123+ captures:
124+ 1: keyword.dumpio.apacheconf
125+ - match: \b(PassEnv|SetEnv|UnsetEnv)\b
126+ captures:
127+ 1: keyword.env.apacheconf
128+ - match: \b(ExpiresActive|ExpiresByType|ExpiresDefault)\b
129+ captures:
130+ 1: keyword.expires.apacheconf
131+ - match: \b(ExtFilterDefine|ExtFilterOptions)\b
132+ captures:
133+ 1: keyword.ext_filter.apacheconf
134+ - match: \b(CacheFile|MMapFile)\b
135+ captures:
136+ 1: keyword.file_cache.apacheconf
137+ - match: \b(AddOutputFilterByType|FilterChain|FilterDeclare|FilterProtocol|FilterProvider|FilterTrace)\b
138+ captures:
139+ 1: keyword.filter.apacheconf
140+ - match: \b(Header|RequestHeader)\b
141+ captures:
142+ 1: keyword.headers.apacheconf
143+ - match: \b(ImapBase|ImapDefault|ImapMenu)\b
144+ captures:
145+ 1: keyword.imap.apacheconf
146+ - match: \b(SSIEndTag|SSIErrorMsg|SSIStartTag|SSITimeFormat|SSIUndefinedEcho|XBitHack)\b
147+ captures:
148+ 1: keyword.include.apacheconf
149+ - match: \b(ISAPIAppendLogToErrors|ISAPIAppendLogToQuery|ISAPICacheFile|ISAPIFakeAsync|ISAPILogNotSupported|ISAPIReadAheadBuffer)\b
150+ captures:
151+ 1: keyword.isapi.apacheconf
152+ - match: \b(LDAPCacheEntries|LDAPCacheTTL|LDAPConnectionTimeout|LDAPOpCacheEntries|LDAPOpCacheTTL|LDAPSharedCacheFile|LDAPSharedCacheSize|LDAPTrustedCA|LDAPTrustedCAType)\b
153+ captures:
154+ 1: keyword.ldap.apacheconf
155+ - match: \b(BufferedLogs|CookieLog|CustomLog|LogFormat|TransferLog|ForensicLog)\b
156+ captures:
157+ 1: keyword.log.apacheconf
158+ - match: \b(MCacheMaxObjectCount|MCacheMaxObjectSize|MCacheMaxStreamingBuffer|MCacheMinObjectSize|MCacheRemovalAlgorithm|MCacheSize)\b
159+ captures:
160+ 1: keyword.mem_cache.apacheconf
161+ - match: \b(AddCharset|AddEncoding|AddHandler|AddInputFilter|AddLanguage|AddOutputFilter|AddType|DefaultLanguage|ModMimeUsePathInfo|MultiviewsMatch|RemoveCharset|RemoveEncoding|RemoveHandler|RemoveInputFilter|RemoveLanguage|RemoveOutputFilter|RemoveType|TypesConfig)\b
162+ captures:
163+ 1: keyword.mime.apacheconf
164+ - match: \b(ProtocolEcho|Example|AddModuleInfo|MimeMagicFile|CheckSpelling|ExtendedStatus|SuexecUserGroup|UserDir)\b
165+ captures:
166+ 1: keyword.misc.apacheconf
167+ - match: \b(CacheNegotiatedDocs|ForceLanguagePriority|LanguagePriority)\b
168+ captures:
169+ 1: keyword.negotiation.apacheconf
170+ - match: \b(NWSSLTrustedCerts|NWSSLUpgradeable|SecureListen)\b
171+ captures:
172+ 1: keyword.nw_ssl.apacheconf
173+ - match: \b(AllowCONNECT|NoProxy|ProxyBadHeader|ProxyBlock|ProxyDomain|ProxyErrorOverride|ProxyFtpDirCharset|ProxyIOBufferSize|ProxyMaxForwards|ProxyPass|ProxyPassMatch|ProxyPassReverse|ProxyPreserveHost|ProxyReceiveBufferSize|ProxyRemote|ProxyRemoteMatch|ProxyRequests|ProxyTimeout|ProxyVia)\b
174+ captures:
175+ 1: keyword.proxy.apacheconf
176+ - match: \b(RewriteBase|RewriteCond|RewriteEngine|RewriteLock|RewriteLog|RewriteLogLevel|RewriteMap|RewriteOptions|RewriteRule)\b
177+ captures:
178+ 1: keyword.rewrite.apacheconf
179+ - match: \b(BrowserMatch|BrowserMatchNoCase|SetEnvIf|SetEnvIfNoCase)\b
180+ captures:
181+ 1: keyword.setenvif.apacheconf
182+ - match: \b(LoadFile|LoadModule)\b
183+ captures:
184+ 1: keyword.so.apacheconf
185+ - match: \b(SSLCACertificateFile|SSLCACertificatePath|SSLCARevocationFile|SSLCARevocationPath|SSLCertificateChainFile|SSLCertificateFile|SSLCertificateKeyFile|SSLCipherSuite|SSLEngine|SSLMutex|SSLOptions|SSLPassPhraseDialog|SSLProtocol|SSLProxyCACertificateFile|SSLProxyCACertificatePath|SSLProxyCARevocationFile|SSLProxyCARevocationPath|SSLProxyCipherSuite|SSLProxyEngine|SSLProxyMachineCertificateFile|SSLProxyMachineCertificatePath|SSLProxyProtocol|SSLProxyVerify|SSLProxyVerifyDepth|SSLRandomSeed|SSLRequire|SSLRequireSSL|SSLSessionCache|SSLSessionCacheTimeout|SSLUserName|SSLVerifyClient|SSLVerifyDepth|SSLInsecureRenegotiation|SSLOpenSSLConfCmd)\b
186+ captures:
187+ 1: keyword.ssl.apacheconf
188+ - match: \b(Substitute|SubstituteInheritBefore|SubstituteMaxLineLength)\b
189+ captures:
190+ 1: keyword.substitute.apacheconf
191+ - match: \b(CookieDomain|CookieExpires|CookieName|CookieStyle|CookieTracking)\b
192+ captures:
193+ 1: keyword.usertrack.apacheconf
194+ - match: \b(VirtualDocumentRoot|VirtualDocumentRootIP|VirtualScriptAlias|VirtualScriptAliasIP)\b
195+ captures:
196+ 1: keyword.vhost_alias.apacheconf
197+ - match: \b(php_value|php_flag|php_admin_value|php_admin_flag)\b(\s+(.+?)(\s+(".+?"|.+?))?)?\s
198+ captures:
199+ 1: keyword.php.apacheconf
200+ 3: entity.property.apacheconf
201+ 5: string.value.apacheconf
202+ - match: '(%\{)((HTTP_USER_AGENT|HTTP_REFERER|HTTP_COOKIE|HTTP_FORWARDED|HTTP_HOST|HTTP_PROXY_CONNECTION|HTTP_ACCEPT|REMOTE_ADDR|REMOTE_HOST|REMOTE_PORT|REMOTE_USER|REMOTE_IDENT|REQUEST_METHOD|SCRIPT_FILENAME|PATH_INFO|QUERY_STRING|AUTH_TYPE|DOCUMENT_ROOT|SERVER_ADMIN|SERVER_NAME|SERVER_ADDR|SERVER_PORT|SERVER_PROTOCOL|SERVER_SOFTWARE|TIME_YEAR|TIME_MON|TIME_DAY|TIME_HOUR|TIME_MIN|TIME_SEC|TIME_WDAY|TIME|API_VERSION|THE_REQUEST|REQUEST_URI|REQUEST_FILENAME|IS_SUBREQ|HTTPS)|(.*?))(\})'
203+ captures:
204+ 1: punctuation.variable.apacheconf
205+ 3: variable.env.apacheconf
206+ 4: variable.misc.apacheconf
207+ 5: punctuation.variable.apacheconf
208+ - match: \b((text|image|application|video|audio)/.+?)\s
209+ captures:
210+ 1: entity.mime-type.apacheconf
211+ - match: \b(?i)(export|from|unset|set|on|off)\b
212+ captures:
213+ 1: entity.helper.apacheconf
214+ - match: \b(\d+)\b
215+ captures:
216+ 1: constant.numeric.integer.decimal.apacheconf
217+ - match: '\s(\[)(.*?)(\])\s'
218+ captures:
219+ 1: punctuation.definition.flag.apacheconf
220+ 2: string.flag.apacheconf
221+ 3: punctuation.definition.flag.apacheconf
assets/syntaxes/02_Extra/AsciiDoc+1−1

Submodule changed.

assets/syntaxes/02_Extra/AsciiDoc.sublime-syntax+937−223
@@ -1,283 +1,997 @@
1%YAML 1.2
1%YAML 1.2
2---
2---
3# http://www.sublimetext.com/docs/3/syntax.html
3# http://www.sublimetext.com/docs/3/syntax.html
4−name: AsciiDoc
4+name: AsciiDoc (Asciidoctor)
5−comment: |
6− A very early hack. Mostly ripped from other syntaxes.
7− Only the very basic stuff is working.
8file_extensions:
5file_extensions:
9 - adoc
6 - adoc
7+ - ad
10 - asciidoc
8 - asciidoc
11− - asc
12−scope: text.html.asciidoc
9+scope: text.asciidoc
13contexts:
10contexts:
14 main:
11 main:
15− - include: heading_inline
12+ - include: lists
16− - include: heading-block
13+ - include: blocks
17− - include: heading-blockattr
14+ - include: section_titles
15+ - include: lines
16+ - include: inline
17+ - include: characters
18+ attribute_entry:
18− - match: \$\$(?!\$)
19+ - match: |-
20+ (?x)
21+ ^(:) # opening delimiter
22+ (!)? # bang symbol (unset attribute)
23+ ([A-Za-z0-9_][A-Za-z0-9_-]*) # attribute name
24+ (!)? # bang symbol (unset attribute)
25+ (:) # closing delimiter
26+ (?:\s+|(?=$))
27+ comment: |
28+ An attribute entry.
29+
30+ Examples:
31+ :my-attribute: value
32+ :sectnums!:
33+ :!sectnums:
34+ captures:
35+ 1: punctuation.definition.attributeentry.attrname.begin.asciidoc
36+ 2: punctuation.definition.attributeentry.unset.asciidoc
37+ 3: support.variable.attribute.asciidoc
38+ 4: punctuation.definition.attributeentry.unset.asciidoc
39+ 5: punctuation.definition.attributeentry.attrname.end.asciidoc
19 push:
40 push:
20− - meta_scope: comment.block.passthrough.macro.doubledollar.asciidoc
41+ - meta_scope: meta.attributeentry.asciidoc
42+ - meta_content_scope: meta.attributeentry.value.asciidoc
21− - match: \$\$(?!\$)
43+ - match: $\n?
22 pop: true
44 pop: true
45+ - include: characters
46+ attribute_list_line:
47+ - match: '^(\[)[^\[\]]*(\])\s*$\n?'
48+ comment: "Attribute list as paragraph: single brackets. No need for special treatment of escape; follows literal block, section template as being a more general regex."
49+ scope: support.variable.attributelist.asciidoc
50+ captures:
51+ 1: punctuation.definition.attributelistline.begin.asciidoc
52+ 2: punctuation.definition.attributelistline.end.asciidoc
53+ attribute_reference:
23− - match: \+\+\+(?!\+)
54+ - match: "({)([A-Za-z0-9_][A-Za-z0-9_-]*)(})"
55+ comment: |
56+ Examples:
57+ {my-attribute}
58+ scope: variable.other
59+ captures:
60+ 1: constant.character.attributes.reference.begin.asciidoc
61+ 2: support.variable.attribute.asciidoc
62+ 3: constant.character.attributes.reference.end.asciidoc
63+ biblio_anchor:
64+ - match: '(?<!\[)(\[\[\[).*?(\]\]\])(?!\])'
65+ comment: |
66+ Bibliography anchor
67+
68+ Examples:
69+ [[[Lorem ipsum]]]
70+ scope: storage.type.reference.biblioanchor.asciidoc
71+ captures:
72+ 1: punctuation.definition.biblioanchor.begin.asciidoc
73+ 2: punctuation.definition.biblioanchor.end.asciidoc
74+ block_admonition_label:
75+ - match: ^(NOTE|TIP|IMPORTANT|WARNING|CAUTION):(?=\s+)
76+ comment: |
77+ Label of an admonition block.
78+
79+ Examples:
80+ NOTE: This is a admonition block.
81+ WARNING: Be aware of them!
82+ scope: support.constant.admonitionword.asciidoc
83+ block_comment:
84+ - match: '^(/{4,})\s*$\n?'
85+ comment: |
86+ Examples:
87+ ////
88+ A multi-line comment.
89+ Notice it's a delimited block.
90+ ////
91+ captures:
92+ 0: punctuation.definition.comment.begin.asciidoc
24 push:
93 push:
25− - meta_scope: comment.block.passthrough.macro.tripeplus.asciidoc
94+ - meta_scope: comment.block.asciidoc
95+ - meta_content_scope: meta.block.comment.content.asciidoc
26− - match: \+\+\+(?!\+)
96+ - match: ^\1\s*$\n?
97+ captures:
98+ 0: punctuation.definition.comment.end.asciidoc
27 pop: true
99 pop: true
100+ - include: macro
101+ block_example:
28− - match: (//).*$\n?
102+ - match: '^(={4,})\s*$\n?'
29− scope: comment.line.double-slash.asciidoc
103+ comment: |
30− - match: |-
104+ Examples:
31− (?x)^
105+ ====
32− (?= ([/+-.*_=]{4,})\s*$
106+ Lorem ipsum.
33− | ([ \t]{1,})
107+ ====
34− | [=]{1,6}\s*+
108+
35− | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
109+ Note: Might need to add more includes, but these are the ones that arise in
36− )
110+ practice for me.
111+ captures:
112+ 0: constant.delimiter.example.begin.asciidoc
37 push:
113 push:
114+ - meta_scope: string.unquoted.block.example.asciidoc
38− - meta_scope: meta.block-level.asciidoc
115+ - meta_content_scope: meta.block.example.content.asciidoc
39− - match: |-
116+ - match: ^\1\s*$\n?
40− (?x)^
117+ captures:
41− (?! \1
118+ 0: constant.delimiter.example.end.asciidoc
42− | ([ \t]{1,})
43− | [=]{1,6}\s*+
44− | [ ]{,3}(?<marker>[-*_])([ ]{,2}\k<marker>){2,}[ \t]*+$
45− )
46 pop: true
119 pop: true
47− - include: block_quote
120+ - include: lists
48− - include: block_raw
121+ - include: block_listing
49− - include: heading_inline
122+ - include: lines
50− - include: heading-block
123+ - include: inline
51− - include: separator
124+ - include: characters
125+ block_id:
126+ - match: '^(\[\[)([^\[].*)(\]\])\s*$\n?'
127+ comment: |
128+ A block id (i.e. anchor).
129+
130+ Examples:
131+ [[myid]]
132+ Lorem ipsum dolor.
133+ scope: meta.tag.blockid.asciidoc
134+ captures:
135+ 1: punctuation.definition.blockid.begin.asciidoc
136+ 2: markup.underline.blockid.id.asciidoc
137+ 3: punctuation.definition.blockid.end.asciidoc
138+ block_listing:
52− - match: '^[ ]{0,3}([*+-])(?=\s)'
139+ - match: '^(\-{4,})\s*$\n?'
140+ comment: |
141+ Examples:
142+ ----
143+ Lorem ipsum.
144+ ----
53− captures:
145+ captures:
54− 1: punctuation.definition.list_item.asciidoc
146+ 0: constant.delimiter.listing.begin.asciidoc
55 push:
147 push:
56− - meta_scope: markup.list.unnumbered.asciidoc
148+ - meta_scope: meta.embedded.block.listing.asciidoc
149+ - meta_content_scope: source.block.listing.content.asciidoc
57− - match: ^(?=\S)
150+ - match: ^\1\s*$\n?
58 captures:
151 captures:
59− 1: punctuation.definition.list_item.asciidoc
152+ 0: constant.delimiter.listing.end.asciidoc
60 pop: true
153 pop: true
61− - include: list-paragraph
154+ - include: inline_callout
155+ block_literal:
62− - match: '^[ ]{0,3}[0-9]+(\.)(?=\s)'
156+ - match: '^(\.{4,})\s*$\n?'
157+ comment: |
158+ Examples:
159+ ....
160+ Lorem ipsum.
161+ ....
63 captures:
162 captures:
64− 1: punctuation.definition.list_item.asciidoc
163+ 0: constant.delimiter.block.literal.begin.asciidoc
65 push:
164 push:
66− - meta_scope: markup.list.numbered.asciidoc
165+ - meta_scope: string.literal.block.delimited.asciidoc
166+ - meta_content_scope: meta.block.literal.content.asciidoc
67− - match: ^(?=\S)
167+ - match: ^\1\s*$\n?
68 captures:
168 captures:
69− 1: punctuation.definition.list_item.asciidoc
169+ 0: constant.delimiter.block.literal.end.asciidoc
70 pop: true
170 pop: true
71− - include: list-paragraph
171+ - include: inline_callout
172+ block_open:
72− - match: '^([/+-.*_=]){4,}\s*$'
173+ - match: ^\-\-\s*$\n?
174+ comment: |
175+ Examples:
176+ --
177+ Lorem ipsum
178+ --
179+ Note: Might need to check on these includes.
180+ captures:
181+ 0: constant.delimiter.block.open.begin.asciidoc
73 push:
182 push:
74− - meta_scope: comment.block.asciidoc
183+ - meta_scope: meta.block.open.asciidoc
184+ - meta_content_scope: meta.block.open.content.asciidoc
75− - match: '^\1{4,}\s*$'
185+ - match: ^\-\-\s*$\n?
186+ captures:
187+ 0: constant.delimiter.block.open.end.asciidoc
76 pop: true
188 pop: true
189+ - include: lists
190+ - include: block_comment
191+ - include: block_listing
192+ - include: block_pass
193+ - include: lines
194+ - include: inline
195+ - include: characters
196+ block_page_break:
197+ - match: '^<{3,}$\n?'
198+ comment: |
199+ A page break.
200+
201+ Examples:
202+ <<<
203+ <<<<<
204+ scope: meta.separator.pagebreak.asciidoc
205+ block_pass:
77− - match: '^([/+.]){4,}\s*$'
206+ - match: '^(\+{4,})\s*$\n?'
78− comment: asciidoc formatting is disabled inside certain blocks.
207+ captures:
208+ 0: constant.delimiter.block.passthrough.begin.asciidoc
79 push:
209 push:
80− - meta_scope: meta.disable-asciidoc
210+ - meta_scope: meta.embedded.block.passthrough.asciidoc
211+ - meta_content_scope: text.xml.block.passthrough.content.asciidoc
81− - match: '^[/+.]{4,}\s*$'
212+ - match: ^\1\s*$\n?
213+ captures:
214+ 0: constant.delimiter.block.passthrough.end.asciidoc
82 pop: true
215 pop: true
216+ - include: scope:text.xml
217+ block_quote:
83− - match: '^(?=\S)(?![=-]{3,}(?=$))(?!\.\S+)'
218+ - match: '^(_{4,})\s*$\n?'
219+ comment: |
220+ Examples:
221+ ____
222+ Lorem ipsum
223+ ____
224+
225+ Note: Might need to add more includes, but these are the ones that arise for me in practice.
226+ captures:
227+ 0: constant.delimiter.block.quote.begin.asciidoc
84 push:
228 push:
85− - meta_scope: meta.paragraph.asciidoc
229+ - meta_scope: markup.quote.block.asciidoc
230+ - meta_content_scope: meta.block.quote.content.asciidoc
86− - match: '^(?:\s*$|(?=[ ]{,3}>.))|(?=[ \t]*\n)(?<=^===|^====|=====|^---|^----|-----)[ \t]*\n'
231+ - match: ^\1\s*$\n?
232+ captures:
233+ 0: constant.delimiter.block.quote.end.asciidoc
87 pop: true
234 pop: true
235+ - include: lines
88 - include: inline
236 - include: inline
89− - include: scope:text.html.basic
237+ - include: characters
238+ block_sidebar:
90− - match: '^(={3,})(?=[ \t]*$)'
239+ - match: '^(\*{4,})\s*$\n?'
91− scope: markup.heading.0.asciidoc
240+ comment: |
92− captures:
241+ Examples:
93− 1: punctuation.definition.heading.asciidoc
242+ ****
94− - match: '^(-{3,})(?=[ \t]*$)'
243+ Lorem ipsum
95− scope: markup.heading.1.asciidoc
244+ ****
245+
246+ Note: Might need to add more includes, but these are the ones that arise
247+ for me in practice.
248+ captures:
249+ 0: constant.delimiter.block.sidebar.begin.asciidoc
250+ push:
251+ - meta_scope: string.quoted.block.sidebar.asciidoc
252+ - meta_content_scope: meta.block.sidebar.content.asciidoc
253+ - match: ^\1\s*$\n?
96 captures:
254 captures:
97− 1: punctuation.definition.heading.asciidoc
255+ 0: constant.delimiter.block.sidebar.end.asciidoc
98− - match: '^(~{3,})(?=[ \t]*$)'
256+ pop: true
99− scope: markup.heading.2.asciidoc
257+ - include: lists
258+ - include: block_comment
259+ - include: block_listing
260+ - include: lines
261+ - include: inline
262+ - include: characters
263+ block_source_fenced:
264+ - match: ^(```)(\w+)?\s*$\n?
265+ comment: |
266+ Fenced code block (ala Markdown)
267+
268+ Examples:
269+ ```rb
270+ puts 'Hello world!'
271+ ```
272+ captures:
273+ 0: constant.delimiter.listing.begin.asciidoc
274+ push:
275+ - meta_scope: meta.embedded.block.listing.asciidoc
276+ - meta_content_scope: source.block.listing.content.asciidoc
277+ - match: ^\1\s*$\n?
100 captures:
278 captures:
279+ 0: constant.delimiter.listing.end.asciidoc
280+ pop: true
281+ - include: inline_callout
282+ block_thematic_break:
283+ - match: '^''{3,}$\n?'
284+ comment: |
285+ A thematic break (aka horizontal rule).
286+
287+ Examples:
288+ '''
289+ ''''''
290+ scope: meta.separator.ruler.asciidoc
291+ block_title:
292+ - match: ^(\.)\w.*$\n?
293+ comment: |
294+ Title of a block.
295+
296+ Examples:
297+ .My title
298+ Lorem ipsum dolor.
299+ scope: markup.heading.block.asciidoc
300+ captures:
101− 1: punctuation.definition.heading.asciidoc
301+ 1: punctuation.definition.blockheading.asciidoc
302+ blocks:
303+ - include: block_literal
304+ - include: block_comment
305+ - include: block_listing
306+ - include: block_source_fenced
307+ - include: block_sidebar
308+ - include: block_pass
309+ - include: block_quote
310+ - include: block_example
311+ - include: block_open
312+ characters:
313+ - include: attribute_reference
314+ - include: entity_number
315+ - include: entity_name
316+ - include: escape
317+ - include: replacement
318+ - include: macro_pass
319+ - include: macro
320+ - include: xref
321+ - include: biblio_anchor
322+ - include: indexterm_triple
323+ - include: indexterm_double
324+ colist_item_marker:
102− - match: '^(\^{3,})(?=[ \t]*$)'
325+ - match: ^(\s*((<)\d+?(>)))\s+(?=\S)
326+ comment: |
327+ Marker of a callout list item.
328+
329+ Examples:
330+ <1> a callout
331+ <42> another callout
332+ scope: markup.list.numbered.callout.asciidoc
333+ captures:
334+ 1: string.unquoted.list.callout.asciidoc
335+ 2: constant.numeric.callout.asciidoc
336+ 3: punctuation.definition.calloutlistnumber.begin.asciidoc
337+ 4: punctuation.definition.calloutlistnumber.end.asciidoc
338+ dlist_item_label:
339+ - match: '^\s*(?=.*:{2,4}(?:\s|$))'
340+ comment: |
341+ Label of a definition (labeled) list item.
342+
343+ Examples:
344+ Label level 1:: lorem ipsum
345+ Label level 2::: dolor sit amet
346+ Label level 3:::: consectetur
347+ Label level 1::
348+ lorem ipsum
349+ Another label :: lorem ipsum
350+ Last::label:: dolor sit amet
351+
352+ Note: This rule is not strictly correct, because Asciidoctor allows
353+ double colon followed by a space inside a label, i.e. it matches the
354+ *last* double colon, not the first. I don't know how to do that
355+ *effectively.
356+ push:
103− scope: markup.heading.3.asciidoc
357+ - meta_scope: markup.list.labeled.asciidoc
358+ - meta_content_scope: meta.list.label.asciidoc
359+ - match: '(:{2,4})(?:\s|$\n?)'
104 captures:
360 captures:
105− 1: punctuation.definition.heading.asciidoc
361+ 1: constant.labeledlist.separator.asciidoc
362+ pop: true
363+ - include: inline
364+ - include: characters
365+ emphasis:
106− - match: '^(\+{3,})(?=[ \t]*$)'
366+ - match: |-
107− scope: markup.heading.4.asciidoc
367+ (?x)
368+ (\[[^\]]*?\])? # might be preceded by an attributes list
369+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
370+ (_)(?=\S) # delimiter underscore that must be followed by a nonspace character
371+ comment: |
372+ Emphasized (italic) text (constrained variant).
373+
374+ Examples:
375+ _Lorem ipsum_ dolor
376+ [red]_Lorem ipsum_ dolor
377+ captures:
378+ 1: support.variable.attributelist.asciidoc
379+ 2: punctuation.definition.italic.single.begin.asciidoc
380+ push:
381+ - meta_scope: markup.italic.single.asciidoc
382+ - meta_content_scope: meta.italicinner.single.asciidoc
383+ - match: |-
384+ (?x)
385+ (?<=\S)(_) # delimiter underscore that must be preceded by a nonspace character
386+ (?!\w) # ...and followed by a nonword character
108 captures:
387 captures:
109− 1: punctuation.definition.heading.asciidoc
388+ 1: punctuation.definition.italic.single.end.asciidoc
110− attribute-entry:
389+ pop: true
111− - match: '^:[-_. A-Za-z0-9]+:\s*(.*)\s*$'
390+ - include: strong_double
112− scope: variable.other
391+ - include: monospaced_double
113− attribute-reference:
392+ - include: mark_double
114− - match: "{[-_. A-Za-z0-9]+}"
393+ - include: strong
115− scope: variable.other
394+ - include: monospaced
116− attribute-reference-predefined:
395+ - include: mark
117− - match: "{(?i:amp|asciidoc-dir|asciidoc-file|asciidoc-version|author|authored|authorinitials|backend-docbook|backend-xhtml11|backend-html4|docbook-article|xhtml11-article|html4-article|docbook-book|xhtml11-book|html4-book|docbook-manpage|xhtml11-manpage|html4-manpage|backend|backslash|basebackend|brvbar|date|docdate|doctime|docname|docfile|docdir|doctitle|doctype-article|doctype-book|doctype-manpage|doctype|email|empty|encoding|filetype|firstname|gt|id|indir|infile|lastname|level|listindex|localdate|localtime|lt|manname|manpurpose|mantitle|manvolnum|middlename|nbsp|outdir|outfile|reftext|revision|sectnum|showcomments|title|two_colons|two_semicolons|user-dir|verbose)}"
396+ - include: superscript
397+ - include: subscript
398+ - include: characters
399+ emphasis_double:
400+ - match: |-
401+ (?x)
402+ (\[[^\]]*?\])? # might start with attribute list
403+ (?<!\\) # must not be preceded by escape
404+ (__)
405+ comment: |
406+ Emphasized (italic) text (unconstrained variant).
407+
408+ Examples:
409+ Lo__re__m __ipsum dolor__.
410+ Lo[red]__re__m
411+ captures:
118− scope: support.variable
412+ 1: support.variable.attributelist.asciidoc
119− block_quote:
413+ 2: punctuation.definition.italic.double.begin.asciidoc
120− - match: '^([/+-.*_=]){4,}\s*$'
121 push:
414 push:
122− - meta_scope: comment.block.asciidoc
415+ - meta_scope: markup.italic.double.asciidoc
416+ - meta_content_scope: meta.italicinner.double.asciidoc
123− - match: '^\1{4,}\s*$'
417+ - match: __
418+ captures:
419+ 0: punctuation.definition.italic.double.end.asciidoc
124 pop: true
420 pop: true
125− block_raw:
421+ - include: strong_double
422+ - include: monospaced_double
423+ - include: mark_double
424+ - include: strong
425+ - include: monospaced
426+ - include: mark
427+ - include: superscript
428+ - include: subscript
429+ - include: characters
430+ entity_name:
126− - match: '\G([ ]{4}|\t).*$\n?'
431+ - match: '(?<!\\)&([a-zA-Z][a-zA-Z0-9]*);'
127− scope: markup.raw.block.asciidoc
432+ comment: |
128− bracket:
433+ Character entity reference
129− - match: '<(?![a-z/?\$!])'
434+
435+ Examples:
436+ &nbsp;
437+ &sup2;
438+ scope: constant.character.entity.xml.asciidoc
439+ entity_number:
440+ - match: '(?<!\\)&#(x?[0-9a-fA-f]{2,4});'
130− comment: |
441+ comment: |
131− asciidoc will convert this for us. We match it so that the
442+ Numeric character reference
132− HTML grammar will not mark it up as invalid.
443+
133− scope: meta.other.valid-bracket.asciidoc
444+ Examples:
134− character-replacements:
445+ &#x278a;
135− - match: \(C\)|\(R\)|\(TM\)|--(?!-)|\.\.\.(?!\.)|->|<-|=>|<=
446+ &#182;
136− scope: constant.character.asciidoc
447+ scope: constant.character.entity.asciidoc
137 escape:
448 escape:
138− - match: '\\[-`*_#+.!(){}\[\]\\>:]'
449+ - match: '\\(?=[-`*_#+.!(){}\[\]\\>:])'
450+ comment: |
451+ List of special characters that may be escaped.
452+
453+ Note: I do not really know if this is a good list, adopted wholesale from
454+ original bundle.
139 scope: constant.character.escape.asciidoc
455 scope: constant.character.escape.asciidoc
140− heading:
456+ indexterm_double:
141− - match: '(?m)^(\S+)$([=-~^+])+\s*$'
457+ - match: '(?<!\()(\({2})([^\(\s].*?)(\){2})(?!\))'
142− scope: markup.heading.asciidoc
458+ comment: |
459+ Double parenthesis indexterm.
460+
461+ Examples:
462+ ((Arthur))
463+ scope: variable.other.indexterm.double.asciidoc
143 captures:
464 captures:
144− 1: punctuation.definition.heading.asciidoc
465+ 1: constant.character.indexterm.double.begin.asciidoc
145− heading-block:
466+ 3: constant.character.indexterm.double.end.asciidoc
467+ indexterm_triple:
146− - match: ^\.(\w.*)$
468+ - match: '(?<!\()(\({3})([^\(].*?)(\){3})(?!\))'
147− scope: markup.heading.asciidoc
469+ comment: |
470+ Triple parenthesis indexterm.
471+
472+ Examples:
473+ (((Sword, Broadsword, Excalibur)))
474+ scope: variable.other.indexterm.triple.asciidoc
148 captures:
475 captures:
149− 1: punctuation.definition.heading.asciidoc
476+ 1: constant.character.indexterm.triple.begin.asciidoc
150− heading-blockattr:
477+ 3: constant.character.indexterm.triple.end.asciidoc
478+ inline:
479+ - include: passthrough
480+ - include: strong_double
481+ - include: emphasis_double
482+ - include: monospaced_double
483+ - include: mark_double
484+ - include: strong
485+ - include: emphasis
486+ - include: monospaced
487+ - include: mark
488+ - include: superscript
489+ - include: subscript
490+ inline_break:
151− - match: '^\[\[?(\w.*)\]$'
491+ - match: (?<=\s)\+$\n?
492+ comment: |
493+ Line hard break with a plus sign (+).
494+
495+ Examples:
496+ Rubies are red, +
497+ Topazes are blue.
498+ scope: constant.linebreak.asciidoc
499+ inline_callout:
500+ - match: (?<!\\)(<)\d+(>)
501+ comment: |
502+ Callout label
503+
504+ Examples:
505+ <1>
506+ <42>
152− scope: markup.heading.asciidoc
507+ scope: constant.other.callout.asciidoc
153 captures:
508 captures:
154− 1: punctuation.definition.heading.asciidoc
509+ 1: punctuation.definition.callout.begin.asciidoc
155− heading_inline:
510+ 2: punctuation.definition.callout.end.asciidoc
511+ inline_comment:
156− - match: '\G(={1,6})(?!=)\s*(?=\S)'
512+ - match: '^(//)([^/\n].*|)$\n?'
513+ comment: |
514+ Inline comment.
515+
516+ Examples:
517+ // This is just a comment!
518+ scope: comment.line.double-slash.asciidoc
157 captures:
519 captures:
158− 1: punctuation.definition.heading.asciidoc
520+ 1: punctuation.definition.comment.line.asciidoc
521+ 2: meta.line.comment.content.asciidoc
522+ lines:
523+ - include: inline_comment
524+ - include: list_continuation
525+ - include: inline_break
526+ - include: block_page_break
527+ - include: block_thematic_break
528+ - include: block_title
529+ - include: block_id
530+ - include: section_template
531+ - include: attribute_list_line
532+ - include: attribute_entry
533+ list_continuation:
534+ - match: ^\+\s*$\n?
535+ scope: constant.listcontinuation.asciidoc
536+ lists:
537+ - include: block_admonition_label
538+ - include: ulist_item_marker
539+ - include: olist_item_marker
540+ - include: dlist_item_label
541+ - include: colist_item_marker
542+ macro:
543+ - match: |-
544+ (?x)
545+ (?:
546+ ((?:https?|mailto|ftp|file) # specify separately so we can mark them as links that TextMate opens
547+ ?:{1} # inline only
548+ \S*) # (others such as image are partial URLs and/or TextMate cannot handle them)
549+ |
550+ (([a-zA-Z0-9][a-zA-Z0-9_]*)
551+ (:{1,2})
552+ (\S*))
553+ )
554+ (?:(\[)([^\]]*)(\]))
555+ comment: |
556+ Note: There are other macro notations, but I match only those that end in
557+ square brackets.
558+ scope: meta.macro.asciidoc
559+ captures:
560+ 1: markup.underline.link.macro.asciidoc
561+ 3: keyword.control.name.macro.asciidoc
562+ 4: constant.character.separator.macro.asciidoc
563+ 5: markup.underline.target.macro.asciidoc
564+ 6: constant.character.attributes.macro.begin.asciidoc
565+ 7: variable.parameter.attributes.macro.asciidoc
566+ 8: constant.character.attributes.macro.end.asciidoc
567+ macro_pass:
568+ - match: |-
569+ (?x)
570+ (pass)
571+ (:{1,2})
572+ (\S*)
573+ (\[)(?=[^\]]*\])
574+ comment: |
575+ Passthrough macro
576+
577+ Examples:
578+ pass:[Lorem ipsum]
579+ pass::[Lorem ipsum]
580+ captures:
581+ 1: keyword.control.name.macro.pass.asciidoc
582+ 2: constant.character.separator.macro.asciidoc
583+ 3: markup.underline.target.macro.asciidoc
584+ 4: constant.character.attributes.macro.begin.asciidoc
159 push:
585 push:
160− - meta_scope: markup.heading.asciidoc
586+ - meta_scope: meta.macro.pass.asciidoc
161− - meta_content_scope: entity.name.section.asciidoc
587+ - meta_content_scope: variable.parameter.attributes.macro.pass.asciidoc
162− - match: \s*(=*)$\n?
588+ - match: '\]'
163 captures:
589 captures:
164− 1: punctuation.definition.heading.asciidoc
590+ 0: constant.character.attributes.macro.end.asciidoc
165 pop: true
591 pop: true
166− - include: inline
592+ - include: scope:text.xml
167− inline:
593+ mark:
168− - include: line-break
169− - include: line-page-break
170− - include: line-ruler
171− - include: escape
172− - include: passthrough-macro-trippleplus-inline
173− - include: passthrough-macro-doubledollar-inline
174− - include: character-replacements
175− - include: bracket
176− - include: raw
177− - include: text-quote-single
178− - include: text-quote-double
179− - include: text-quote-other
180− - include: text-bold-unconstrained
181− - include: text-italic-unconstrained
182− - include: text-monospace-unconstrained
183− - include: text-unquoted-unconstrained
184− - include: text-bold
185− - include: text-italic
186− - include: text-monospace
187− - include: text-unquoted
188− - include: attribute-entry
189− - include: attribute-reference-predefined
190− - include: attribute-reference
191− line-break:
192− - match: (?<=\S)\s+\+$
193− scope: constant.character.escape.asciidoc
194− line-page-break:
195− - match: "^<{3,}$"
594+ - match: |-
196− scope: constant.character.escape.asciidoc
595+ (?x)
197− line-ruler:
596+ (\[[^\]]*?\])? # might start with attribute list (darned well better or why are we here)
198− - match: "^'{3,}$"
597+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
199− scope: constant.character.escape.asciidoc
598+ (\#)(?=\S) # delimiter hash that must be followed by a nonspace character
200− list-paragraph:
599+ comment: |
201− - match: \G\s+(?=\S)
600+ Marked text (constrained variant).
601+
602+ Examples:
603+ #Lorem ipsum# dolor
604+ [red]#Lorem ipsum# dolor
605+ captures:
606+ 1: support.variable.attributelist.asciidoc
607+ 2: punctuation.definition.string.unquoted.single.begin.asciidoc
202 push:
608 push:
203− - meta_scope: meta.paragraph.list.asciidoc
609+ - meta_scope: string.other.unquoted.single.asciidoc
610+ - meta_content_scope: string.unquoted.unquotedinner.single.asciidoc
204− - match: ^\s*$
611+ - match: |-
612+ (?x)
613+ (?<=\S)(\#) # delimiter hash that must be preceded by a nonspace character
614+ (?!\w) # ...and followed by a nonword character
615+ captures:
616+ 1: punctuation.definition.string.unquoted.single.end.asciidoc
205 pop: true
617 pop: true
206− - include: inline
618+ - include: strong_double
207− passthrough-macro-doubledollar-inline:
619+ - include: emphasis_double
620+ - include: monospaced_double
621+ - include: strong
622+ - include: emphasis
623+ - include: monospaced
624+ - include: superscript
625+ - include: subscript
626+ - include: characters
627+ mark_double:
208− - match: '(?:\[.*\])?\$\$(?!\$).+\$\$(?!\$)'
628+ - match: |-
209− scope: comment.block.passthrough.asciidoc
629+ (?x)
210− passthrough-macro-trippleplus-inline:
630+ (\[[^\]]*?\])? # might start with an attribute list (indeed, that is its purpose)
631+ (?<!\\) # must not be preceded by escape
632+ (\#\#)
633+ comment: |
634+ Marked text (unconstrained variant).
635+
636+ Examples:
637+ Lo##re##m ##ipsum dolor##.
638+ Lo[red]##re##m
639+ captures:
640+ 1: support.variable.attributelist.asciidoc
641+ 2: punctuation.definition.string.unquoted.double.begin.asciidoc
642+ push:
643+ - meta_scope: string.other.unquoted.double.asciidoc
644+ - meta_content_scope: string.unquoted.unquotedinner.double.asciidoc
645+ - match: '\#\#'
646+ captures:
647+ 0: punctuation.definition.string.unquoted.double.end.asciidoc
648+ pop: true
649+ - include: strong_double
650+ - include: emphasis_double
651+ - include: monospaced_double
652+ - include: strong
653+ - include: emphasis
654+ - include: monospaced
655+ - include: superscript
656+ - include: subscript
657+ - include: characters
658+ monospaced:
211− - match: '(?:\[.*\])?\+\+\+(?!\+).+\+\+\+(?!\+)'
659+ - match: |-
212− scope: comment.block.passthrough.asciidoc
660+ (?x)
213− raw:
661+ (\[[^\]]*?\])? # might start with attributes list
214− - match: '(`+)(?:[^`]|(?!(?<!`)\1(?!`))`)*+(\1)'
662+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
215− scope: markup.raw.inline.asciidoc
663+ (`)(?=\S) # delimiter backtick that must be followed by a nonspace character
664+ comment: |
665+ Monospaced text (constrained variant).
666+
667+ Examples:
668+ `Lorem ipsum` dolor
669+ [red]`Lorem ipsum` dolor
216− captures:
670+ captures:
217− 1: punctuation.definition.raw.asciidoc
671+ 1: support.variable.attributelist.asciidoc
218− 2: punctuation.definition.raw.asciidoc
672+ 2: punctuation.definition.literal.single.begin.asciidoc
219− separator:
673+ push:
220− - match: '\G[ ]{,3}([-*_])([ ]{,2}\1){2,}[ \t]*$\n?'
674+ - meta_scope: string.other.literal.single.asciidoc
221− scope: meta.separator.asciidoc
675+ - meta_content_scope: meta.literalinner.single.asciidoc
222− text-bold:
676+ - match: |-
223− - match: (?<!\w)(\*)(?=\S)
677+ (?x)
678+ (?<=\S)(`) # delimiter backtick that must be preceded by a nonspace character
679+ (?!\w) # ...and followed by a nonword character
680+ captures:
681+ 1: punctuation.definition.literal.single.end.asciidoc
682+ pop: true
683+ - include: strong_double
684+ - include: emphasis_double
685+ - include: mark_double
686+ - include: strong
687+ - include: emphasis
688+ - include: mark
689+ - include: superscript
690+ - include: subscript
691+ - include: characters
692+ monospaced_double:
693+ - match: |-
694+ (?x)
695+ (\[[^\]]*?\])? # might start with attribute list
696+ (?<!\\) # must not be preceded by escape
697+ (``)
698+ comment: |
699+ Monospaced text (unconstrained variant).
700+
701+ Examples:
702+ Lo``re``m ``ipsum dolor``.
703+ Lo[red]``re``m
704+ captures:
705+ 1: support.variable.attributelist.asciidoc
706+ 2: punctuation.definition.literal.double.begin.asciidoc
707+ push:
708+ - meta_scope: string.other.literal.double.asciidoc
709+ - meta_content_scope: meta.literalinner.double.asciidoc
710+ - match: "``"
711+ captures:
712+ 0: punctuation.definition.literal.double.end.asciidoc
713+ pop: true
714+ - include: strong_double
715+ - include: emphasis_double
716+ - include: mark_double
717+ - include: strong
718+ - include: emphasis
719+ - include: mark
720+ - include: superscript
721+ - include: subscript
722+ - include: characters
723+ olist_item_marker:
724+ - match: '^(\s*(\.{1,5}))\s+(?=\S)'
725+ comment: |
726+ Marker of an ordered (numbered) list item.
727+
728+ Examples:
729+ . level 1
730+ .. level 2
731+ ... level 3
732+ .... level 4
733+ ..... level 5
734+
735+ Note: The space distinguishes it from a block title.
736+ scope: markup.list.numbered.dotted.asciidoc
224− captures:
737+ captures:
225− 1: punctuation.definition.bold.asciidoc
738+ 1: string.unquoted.list.dotted.asciidoc
739+ 2: constant.numeric.list.dot.asciidoc
740+ passthrough:
741+ - match: (\+\+\+|\$\$)
742+ comment: |
743+ Inline triple-plus and double dolar passthrough.
744+
745+ Examples:
746+ Lo+++re++++m +++ipsum dolor+++.
747+ Lo$$re$$m $$ipsum dolor$$.
748+
749+ Note: Must be dead first among the inlines, so as to take priority.
750+ captures:
751+ 1: constant.character.passthru.begin.asciidoc
226 push:
752 push:
227− - meta_scope: markup.bold.asciidoc
753+ - meta_scope: meta.passthru.inline.asciidoc
754+ - meta_content_scope: variable.parameter.passthruinner.asciidoc
228− - match: (?<=\S)(\1)(?!\w)
755+ - match: \1
229 captures:
756 captures:
230− 1: punctuation.definition.bold.asciidoc
757+ 0: constant.character.passthru.end.asciidoc
231 pop: true
758 pop: true
232− text-bold-unconstrained:
759+ replacement:
760+ - match: |-
761+ (?x)
762+ (?<!\\) # must not be escaped
763+ (
764+ \(C\)
765+ | \(TM\)
766+ | \(R\)
767+ | ((?<!\-)\-\-(?!\-)) # exactly two, and even this may not rule out all that I want to
768+ | ((?<!\.)\.\.\.(?!\.)) # exactly three
769+ | \->
770+ | <\-
771+ | =>
772+ | <=
773+ )
774+ scope: constant.character.replacement.asciidoc
775+ section_template:
233− - match: (\*\*)(?=\S)
776+ - match: |-
777+ (?x)^
778+ (\[) # in square brackets
779+ (template\s*=\s*)?(")? # might start with template-equals and might have template name in quotes
780+ (
781+ sect\d|abstract|preface|colophon|dedication|glossary|bibliography|synopsis|appendix|index # fixed list of known templates
782+ )
783+ (".*(\])|(\])) # either close the quote (and perhaps go on) and close the bracket, or close the bracket immediately
784+ \s*$\n?
785+ comment: fixed list of known template names
786+ scope: variable.parameter.sectiontemplate.asciidoc
234 captures:
787 captures:
235− 1: punctuation.definition.bold.asciidoc
788+ 1: punctuation.definition.sectiontemplate.begin.asciidoc
789+ 4: meta.tag.sectiontemplate.asciidoc
790+ 6: punctuation.definition.sectiontemplate.end.asciidoc
791+ 7: punctuation.definition.sectiontemplate.end.asciidoc
792+ section_titles:
793+ - include: title_level_5
794+ - include: title_level_4
795+ - include: title_level_3
796+ - include: title_level_2
797+ - include: title_level_1
798+ - include: title_level_0
799+ strong:
800+ - match: |-
801+ (?x)
802+ (\[[^\]]*?\])? # might start with an attributes list
803+ (?<=^|\W)(?<!\\|}) # must be preceded by nonword character, and not by escape or } (attribute)
804+ (\*)(?=\S) # delimiter star that must be followed by a nonspace character
805+ comment: |
806+ Strong (bold) text (constrained variant).
807+
808+ Examples:
809+ *Lorem ipsum* dolor
810+ [red]*Lorem ipsum* dolor
811+ captures:
812+ 1: support.variable.attributelist.asciidoc
813+ 2: punctuation.definition.bold.single.begin.asciidoc
236 push:
814 push:
237− - meta_scope: markup.bold.asciidoc
815+ - meta_scope: markup.bold.single.asciidoc
816+ - meta_content_scope: meta.boldinner.single.asciidoc
238− - match: (?<=\S)(\1)
817+ - match: |-
818+ (?x)
819+ (?<=\S)(\*) # delimiter star that must be preceded by a nonspace character
820+ (?!\w) # ...and followed by a nonword character
239 captures:
821 captures:
240− 1: punctuation.definition.bold.asciidoc
822+ 1: punctuation.definition.bold.single.end.asciidoc
241 pop: true
823 pop: true
242− text-italic:
824+ - include: emphasis_double
825+ - include: monospaced_double
826+ - include: mark_double
827+ - include: emphasis
828+ - include: monospaced
829+ - include: mark
830+ - include: superscript
831+ - include: subscript
832+ - include: characters
833+ strong_double:
243− - match: (?<!\w)('|_)(?=\S)
834+ - match: |-
835+ (?x)
836+ (\[[^\]]*?\])? # might start with an attribute list
837+ (?<!\\) # must not be preceded by escape
838+ (\*\*)
839+ comment: |
840+ Strong (bold) text (unconstrained variant).
841+
842+ Examples:
843+ Lo**re**m **ipsum dolor**.
844+ Lo[red]**re**m
244 captures:
845 captures:
846+ 1: support.variable.attributelist.asciidoc
245− 1: punctuation.definition.italic.asciidoc
847+ 2: punctuation.definition.bold.double.begin.asciidoc
246 push:
848 push:
247− - meta_scope: markup.italic.asciidoc
849+ - meta_scope: markup.bold.double.asciidoc
850+ - meta_content_scope: meta.boldinner.double.asciidoc
248− - match: (?<=\S)(\1)((?!\1)|(?=\1\1))(?!\w)
851+ - match: \*\*
249 captures:
852 captures:
250− 1: punctuation.definition.italic.asciidoc
853+ 0: punctuation.definition.bold.double.end.asciidoc
251 pop: true
854 pop: true
252− text-italic-unconstrained:
855+ - include: emphasis_double
856+ - include: monospaced_double
857+ - include: mark_double
858+ - include: emphasis
859+ - include: monospaced
860+ - include: mark
861+ - include: superscript
862+ - include: subscript
863+ - include: characters
864+ subscript:
253− - match: (__)(?=\S)
865+ - match: |-
866+ (?x)
867+ (\[[^\]]*?\])? # might start with attribute list
868+ (?<!\\) # must not be preceded by escape
869+ (~)
870+ comment: |
871+ Subscript text.
872+
873+ Examples:
874+ E=mc^2^
875+ E=mc[red]^2^
254 captures:
876 captures:
877+ 1: support.variable.attributelist.asciidoc
255− 1: punctuation.definition.italic.asciidoc
878+ 2: punctuation.definition.string.subscript.begin.asciidoc
256 push:
879 push:
257− - meta_scope: markup.italic.asciidoc
880+ - meta_scope: string.other.subscript.asciidoc
258− - match: (?<=\S)(\1)
881+ - meta_content_scope: meta.subscriptinner.asciidoc
882+ - match: '~' # this tilda a problem if unquoted
259 captures:
883 captures:
260− 1: punctuation.definition.italic.asciidoc
884+ 0: punctuation.definition.string.subscript.end.asciidoc
261 pop: true
885 pop: true
262− text-monospace:
886+ - include: strong_double
263− - match: '(?<!\w)([\+`])[^\+]*(\1)(?!\w)'
887+ - include: emphasis_double
264− scope: string.interpolated.asciidoc
888+ - include: monospaced_double
265− text-monospace-unconstrained:
889+ - include: mark_double
266− - match: (\+\+).*(\1)
890+ - include: strong
267− scope: string.interpolated.asciidoc
891+ - include: emphasis
268− text-quote-double:
892+ - include: monospaced
893+ - include: mark
894+ - include: superscript
895+ - include: characters
896+ superscript:
269− - match: '(?<!\w)(?:\[.*\])?``(?!`).*''''(?!'')(?!\w)'
897+ - match: |-
270− scope: string.quoted.double.asciidoc
898+ (?x)
271− text-quote-other:
899+ (\[[^\]]*?\])? # might start with attribute list
272− - match: '(?<!\w)(?:\[.*\])?([~^]).*(\1)(?!\w)'
900+ (?<!\\) # no preceding escape
273− scope: string.quoted.single.asciidoc
901+ (\^)
274− text-quote-single:
902+ comment: |
903+ Superscript text.
904+
905+ Examples:
906+ H~2~O
907+ H[red]~2~O
908+ captures:
909+ 1: support.variable.attributelist.asciidoc
910+ 2: punctuation.definition.string.superscript.begin.asciidoc
911+ push:
912+ - meta_scope: string.other.superscript.asciidoc
913+ - meta_content_scope: meta.superscriptinner.asciidoc
914+ - match: ^
915+ captures:
916+ 0: punctuation.definition.string.superscript.end.asciidoc
917+ pop: true
918+ - include: strong_double
919+ - include: emphasis_double
920+ - include: monospaced_double
921+ - include: mark_double
922+ - include: strong
923+ - include: emphasis
924+ - include: monospaced
925+ - include: mark
926+ - include: subscript
927+ - include: characters
928+ title_level_0:
929+ - match: ^(=) (\w.*)$\n?
930+ scope: markup.heading.level.0.asciidoc
931+ captures:
932+ 1: punctuation.definition.heading.asciidoc
933+ 2: entity.name.section.asciidoc
934+ title_level_1:
935+ - match: ^(==) (\w.*)$\n?
936+ scope: markup.heading.level.1.asciidoc
937+ captures:
938+ 1: punctuation.definition.heading.asciidoc
939+ 2: entity.name.section.asciidoc
940+ title_level_2:
941+ - match: ^(===) (\w.*)$\n?
942+ scope: markup.heading.level.2.asciidoc
943+ captures:
944+ 1: punctuation.definition.heading.asciidoc
945+ 2: entity.name.section.asciidoc
946+ title_level_3:
947+ - match: ^(====) (\w.*)$\n?
948+ scope: markup.heading.level.3.asciidoc
949+ captures:
950+ 1: punctuation.definition.heading.asciidoc
951+ 2: entity.name.section.asciidoc
952+ title_level_4:
953+ - match: ^(=====) (\w.*)$\n?
954+ scope: markup.heading.level.4.asciidoc
955+ captures:
956+ 1: punctuation.definition.heading.asciidoc
957+ 2: entity.name.section.asciidoc
958+ title_level_5:
959+ - match: ^(======) (\w.*)$\n?
960+ scope: markup.heading.level.5.asciidoc
961+ captures:
962+ 1: punctuation.definition.heading.asciidoc
963+ 2: entity.name.section.asciidoc
964+ ulist_item_marker:
965+ - match: '^(\s*(\-|\*{1,5}))\s+(?=\S)'
966+ comment: |
967+ Marker of an unordered (bullet) list item.
968+
969+ Examples:
970+ * level 1
971+ ** level 2
972+ *** level 3
973+ **** level 4
974+ ***** level 5
975+ - level 1
976+ -- level 2
977+ --- level 3
978+ ---- level 4
979+ ----- level 5
980+ scope: markup.list.bulleted.asciidoc
981+ captures:
982+ 1: string.unquoted.list.bullet.asciidoc
983+ 2: constant.numeric.list.bullet.asciidoc
984+ xref:
275− - match: '(?<!\w)(?:\[.*\])?`(?!`).*''(?!'')(?!\w)'
985+ - match: '(?<!<)(<<)([^,]*?)((,\s*)(.*?))?(>>)(?!<)'
276− comment: "TODO: Sub- and Superscript are really unconstrained"
986+ comment: |
987+ Internal cross-reference
988+
989+ Examples:
990+ <<lorem>>
991+ <<lorem, see here>>
277− scope: string.quoted.single.asciidoc
992+ scope: meta.xref.asciidoc
278− text-unquoted:
993+ captures:
279− - match: (?<!\w)(#).*(\1)(?!\w)
994+ 1: constant.character.xref.begin.asciidoc
280− scope: string.unquoted.asciidoc
995+ 2: markup.underline.term.xref.asciidoc
281− text-unquoted-unconstrained:
996+ 5: variable.parameter.xref.asciidoc
282− - match: (##).*(\1)
997+ 6: constant.character.xref.end.asciidoc
283− scope: string.unquoted.asciidoc
assets/syntaxes/02_Extra/CMake+1−1

Submodule changed.

assets/syntaxes/02_Extra/CSVdeleted−1

Submodule changed.

assets/syntaxes/02_Extra/CSV.sublime-syntax+71−39
@@ -1,46 +1,78 @@
1%YAML 1.2
1%YAML 1.2
2---
2---
3−# http://www.sublimetext.com/docs/3/syntax.html
3+# See http://www.sublimetext.com/docs/3/syntax.html
4−name: Advanced CSV
4+name: Comma Separated Values
5file_extensions:
5file_extensions:
6 - csv
6 - csv
7 - tsv
7 - tsv
8−scope: text.advanced_csv
8+scope: text.csv
9+variables:
10+ field_separator: (?:[,;\t])
11+ record_separator: (?:$\n?)
9contexts:
12contexts:
10− main:
13+ prototype:
11− - match: (\")
14+ - match: (?={{record_separator}})
12− captures:
13− 1: string.quoted.double.advanced_csv
14− push:
15− - meta_scope: meta.quoted.advanced_csv
16− - match: (\")
17− captures:
18− 1: string.quoted.double.advanced_csv
19− pop: true
15+ pop: true
20− - include: main
16+ fields:
21− - match: '(\[([+-]?\d*)(\:)?([+-]?\d*)(\,)?([+-]?\d*)(\:)?([+-]?\d*)\])?\s*([<>v^])?\s*(=)'
17+ - match: ''
22− captures:
23− 1: keyword.operator.advanced_csv
24− 2: constant.numeric.formula.advanced_csv
25− 4: constant.numeric.formula.advanced_csv
26− 6: constant.numeric.formula.advanced_csv
27− 8: constant.numeric.formula.advanced_csv
28− 9: keyword.operator.advanced_csv
29− 10: keyword.operator.advanced_csv
30 push:
18 push:
31− - meta_scope: meta.range.advanced_csv
19+ - field_or_record_separator
32− - match: (?=(\")|$)
20+ - field4
33− pop: true
21+ - field_or_record_separator
34− - include: scope:source.python
22+ - field3
35− - match: '(?<=^|,|\s|\")([0-9.eE+-]+)(?=$|,|\s|\")'
23+ - field_or_record_separator
36− scope: meta.number.advanced_csv
24+ - field2
37− captures:
25+ - field_or_record_separator
38− 1: constant.numeric.advanced_csv
26+ - field1
27+ main:
28+ - meta_include_prototype: false
39− - match: '(?<=^|,|\s|\")([^, \t\"]+)(?=$|,|\s|\")'
29+ - match: '^'
40− scope: meta.nonnumber.advanced_csv
30+ set: fields
41− captures:
31+
42− 1: storage.type.advanced_csv
32+ field_or_record_separator:
33+ - meta_include_prototype: false
34+ - match: '{{record_separator}}'
35+ scope: punctuation.terminator.record.csv
36+ pop: true
37+ - match: '{{field_separator}}'
38+ scope: punctuation.separator.sequence.csv
39+ pop: true
40+
41+ field_contents:
42+ - match: '"'
43+ scope: punctuation.definition.string.begin.csv
44+ push: double_quoted_string
45+
46+ - match: (?={{field_separator}}|{{record_separator}})
47+ pop: true
48+
49+ double_quoted_string:
50+ - meta_include_prototype: false
51+ - meta_scope: string.quoted.double.csv
52+ - match: '""'
53+ scope: constant.character.escape.csv
54+ - match: '"'
55+ scope: punctuation.definition.string.end.csv
56+ pop: true
57+
58+ field1:
59+ - match: ''
60+ set:
61+ - meta_content_scope: meta.field-1.csv support.type
62+ - include: field_contents
63+ field2:
64+ - match: ''
65+ set:
66+ - meta_content_scope: meta.field-2.csv support.function
67+ - include: field_contents
68+ field3:
43− - match: (\,)
69+ - match: ''
44− scope: meta.delimiter.advanced_csv
70+ set:
45− captures:
71+ - meta_content_scope: meta.field-3.csv constant.numeric
72+ - include: field_contents
73+ field4:
74+ - match: ''
75+ set:
46− 1: keyword.operator.advanced_csv
76+ - meta_content_scope: meta.field-4.csv keyword.operator
77+ - include: field_contents
78+
assets/syntaxes/02_Extra/Cabaldeleted−1

Submodule changed.

assets/syntaxes/02_Extra/Crystal+1−1

Submodule changed.

assets/syntaxes/02_Extra/Crystal.sublime-syntax+4−3
@@ -108,7 +108,7 @@ contexts:
108 - match: (?<!\.)\belse(\s)+if\b
108 - match: (?<!\.)\belse(\s)+if\b
109 comment: else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.
109 comment: else if is a common mistake carried over from other languages. it works if you put in a second end, but it’s never what you want.
110 scope: invalid.deprecated.crystal
110 scope: invalid.deprecated.crystal
111− - match: '(?<!\.)\b(BEGIN|alias|as|begin|case|select|abstract|class|END|ensure|for|fun|if|ifdef|in|lib|module|of|out|private|protected|rescue|struct|with|union|enum|macro|then|type|unless|until|while)\b(?![?!])'
111+ - match: '(?<!\.)\b(BEGIN|alias|as|begin|case|select|abstract|class|END|ensure|for|fun|if|ifdef|in|lib|module|of|out|private|protected|rescue|struct|with|union|enum|macro|then|unless|until|while)\b(?![?!])|(?<!\.)\btype\b\s*(?=[A-Z])'
112 comment: everything being a reserved word, not a value and needing a 'end' is a..
112 comment: everything being a reserved word, not a value and needing a 'end' is a..
113 scope: keyword.control.primary.crystal
113 scope: keyword.control.primary.crystal
114 - match: '(?<!\.)\b(when|else|elsif)\b(?![?!])'
114 - match: '(?<!\.)\b(when|else|elsif)\b(?![?!])'
@@ -131,7 +131,7 @@ contexts:
131 scope: keyword.control.pseudo-method.crystal
131 scope: keyword.control.pseudo-method.crystal
132 - match: '\b(nil|true|false)\b(?![?!])'
132 - match: '\b(nil|true|false)\b(?![?!])'
133 scope: constant.language.crystal
133 scope: constant.language.crystal
134− - match: '\b(__(DIR|FILE|LINE|END_LINE)__|self)\b(?![?!])'
134+ - match: '\b(__(DIR|FILE|LINE|END_LINE)__|self)\b(?![?!])|self[?]'
135 scope: variable.language.crystal
135 scope: variable.language.crystal
136 - match: '\b(initialize|new|loop|include|extend|raise|getter|setter|property|class_getter|class_setter|class_property|describe|context|it|with|delegate|def_hash|def_equals|def_equals_and_hash|forward_missing_to|record|assert_responds_to|spawn|annotation|verbatim)\b[!?]?'
136 - match: '\b(initialize|new|loop|include|extend|raise|getter|setter|property|class_getter|class_setter|class_property|describe|context|it|with|delegate|def_hash|def_equals|def_equals_and_hash|forward_missing_to|record|assert_responds_to|spawn|annotation|verbatim)\b[!?]?'
137 comment: everything being a method but having a special function is a..
137 comment: everything being a method but having a special function is a..
@@ -190,7 +190,7 @@ contexts:
190 push:
190 push:
191 - meta_scope: meta.function.method.with-arguments.crystal
191 - meta_scope: meta.function.method.with-arguments.crystal
192 - meta_content_scope: variable.parameter.function.crystal
192 - meta_content_scope: variable.parameter.function.crystal
193− - match: \)\s*$|\)\s*:|\)\s*;
193+ - match: \)
194 captures:
194 captures:
195 0: punctuation.definition.parameters.crystal
195 0: punctuation.definition.parameters.crystal
196 pop: true
196 pop: true
@@ -705,6 +705,7 @@ contexts:
705 0: punctuation.definition.string.end.crystal
705 0: punctuation.definition.string.end.crystal
706 pop: true
706 pop: true
707 - include: heredoc
707 - include: heredoc
708+ - include: scope:text.html.basic
708 - include: scope:source.js
709 - include: scope:source.js
709 - include: interpolated_crystal
710 - include: interpolated_crystal
710 - include: escaped_char
711 - include: escaped_char
assets/syntaxes/02_Extra/Dart+1−1

Submodule changed.

assets/syntaxes/02_Extra/Dart.sublime-syntax+85−243
@@ -1,6 +1,6 @@
1%YAML 1.2
1%YAML 1.2
2---
2---
3−# http://www.sublimetext.com/docs/3/syntax.html
3+# http://www.sublimetext.com/docs/syntax.html
4name: Dart
4name: Dart
5file_extensions:
5file_extensions:
6 - dart
6 - dart
@@ -9,7 +9,7 @@ contexts:
9 main:
9 main:
10 - match: ^(#!.*)$
10 - match: ^(#!.*)$
11 scope: meta.preprocessor.script.dart
11 scope: meta.preprocessor.script.dart
12− - match: ^\s*\b(library|import|export|part of|part)\b
12+ - match: ^\w*\b(library|import|part of|part|export)\b
13 captures:
13 captures:
14 0: keyword.other.import.dart
14 0: keyword.other.import.dart
15 push:
15 push:
@@ -19,242 +19,114 @@ contexts:
19 0: punctuation.terminator.dart
19 0: punctuation.terminator.dart
20 pop: true
20 pop: true
21 - include: strings
21 - include: strings
22+ - include: comments
22− - match: \b(as|show|hide|deferred)\b
23+ - match: \b(as|show|hide)\b
23 scope: keyword.other.import.dart
24 scope: keyword.other.import.dart
24 - include: comments
25 - include: comments
25− - include: constants-and-special-vars
26+ - include: punctuation
26 - include: annotations
27 - include: annotations
27− - include: decl-typedef
28− - include: decl-class
29− - include: decl-enum
30− - include: decl-function
31 - include: keywords
28 - include: keywords
29+ - include: constants-and-special-vars
32 - include: strings
30 - include: strings
33 annotations:
31 annotations:
34− - match: '^(?:\s*)((@)([a-zA-Z0-9_]+))'
32+ - match: '@[a-zA-Z]+'
35− captures:
33+ scope: storage.type.annotation.dart
36− 1: annotation.dart
37− 2: entity.name.function.annotation.dart
38− 3: support.type.dart
39 comments:
34 comments:
40 - match: /\*\*/
35 - match: /\*\*/
41 scope: comment.block.empty.dart
36 scope: comment.block.empty.dart
42 captures:
37 captures:
43 0: punctuation.definition.comment.dart
38 0: punctuation.definition.comment.dart
39+ - include: comments-doc-oldschool
40+ - include: comments-doc
44 - include: comments-inline
41 - include: comments-inline
45− comments-inline:
42+ comments-block:
46 - match: /\*
43 - match: /\*
47 push:
44 push:
48 - meta_scope: comment.block.dart
45 - meta_scope: comment.block.dart
49 - match: \*/
46 - match: \*/
50 pop: true
47 pop: true
51− - include: scope:text.dart-doccomments
48+ - include: comments-block
49+ comments-doc:
52− - match: (///)
50+ - match: ///
53− captures:
54− 1: marker.dart
55 push:
51 push:
56− - meta_scope: comment.line.triple-slash.dart
52+ - meta_scope: comment.block.documentation.dart
57− - match: $
53+ - match: .*
58 pop: true
54 pop: true
59− - include: scope:text.dart-doccomments
55+ - include: dartdoc
56+ comments-doc-oldschool:
60− - match: (//)
57+ - match: /\*\*
61− captures:
62− 1: marker.dart
63 push:
58 push:
64− - meta_scope: comment.line.double-slash.dart
59+ - meta_scope: comment.block.documentation.dart
65− - match: $
60+ - match: \*/
66 pop: true
61 pop: true
67− - include: scope:text.dart-doccomments
62+ - include: comments-doc-oldschool
63+ - include: comments-block
64+ - include: dartdoc
65+ comments-inline:
66+ - include: comments-block
67+ - match: ((//).*)$
68+ captures:
69+ 1: comment.line.double-slash.dart
68 constants-and-special-vars:
70 constants-and-special-vars:
69− - match: \b(true|false|null)\b
71+ - match: (?<!\$)\b(true|false|null)\b(?!\$)
70 scope: constant.language.dart
72 scope: constant.language.dart
71− - match: \b(this|super)\b
73+ - match: (?<!\$)\b(this|super)\b(?!\$)
72 scope: variable.language.dart
74 scope: variable.language.dart
73− - match: '\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b'
75+ - match: '(?<!\$)\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)\b(?!\$)'
74 scope: constant.numeric.dart
76 scope: constant.numeric.dart
75− decl-class:
77+ - match: '(?<![a-zA-Z0-9_$])([_$]*[A-Z][a-zA-Z0-9_$]*|bool\b|num\b|int\b|double\b|dynamic\b)'
76− - match: \bclass\b
78+ scope: support.class.dart
79+ - match: '([_$]*[a-z][a-zA-Z0-9_$]*)(<|\(|\s+=>)'
77 captures:
80 captures:
78− 0: keyword.control.new.dart
81+ 1: entity.name.function.dart
79− push:
82+ dartdoc:
80− - meta_scope: meta.declaration.class.dart
81− - match: "(?={)"
82− pop: true
83− - include: keywords
84− - match: "[A-Za-z_][A-Za-z0-9_]*"
85− scope: class.name.dart
86− decl-enum:
87− - match: \benum\b
83+ - match: '(\[.*?\])'
88− captures:
89− 0: keyword.declaration.dart
90− push:
91− - meta_scope: meta.declaration.enum.dart
92− - match: "(?={)"
93− pop: true
94− - include: keywords
95− - match: "[A-Za-z_][A-Za-z0-9_]*"
96− scope: enum.name.dart
97− decl-function:
98− - match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(get)\s+(\w+)\s+(?==>)
99− comment: A getter with a primitive return type.
100− scope: meta.declaration.function.dart
101 captures:
84 captures:
102− 1: storage.type.primitive.dart
85+ 0: variable.name.source.dart
103− 2: keyword.declaration.dart
104− 3: function.name.dart
105− - match: ^\s*(?:\b(\w+)\b\s+)?(get)\s+(\w+)\s+(?==>)
106− comment: A getter with a user-defined return type or no return type.
107− scope: meta.declaration.function.dart
108− captures:
109− 1: type.user-defined.dart
110− 2: keyword.declaration.dart
111− 3: function.name.dart
112− - match: ^\s*(set)\s+(\w+)(?=\()
86+ - match: '^ {4,}(?![ \*]).*'
113− comment: A setter.
114− captures:
115− 1: keyword.declaration.dart
116− 2: function.name.dart
117− push:
118− - meta_scope: meta.declaration.function.dart
119− - match: \)
120− pop: true
121− - include: comments-inline
122− - include: decl-function-parameter
123− - include: strings
124− - include: keywords
125− - match: ^\s*(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\()
126− comment: A function with a primitive return type.
127− captures:
128− 1: storage.type.primitive.dart
129− 2: function.name.dart
130− push:
131− - meta_scope: meta.declaration.function.dart
132− - match: \)
133− pop: true
134− - include: comments-inline
135− - include: decl-function-parameter
136− - include: strings
137− - include: keywords
138− - match: ^\s*(?:\b(return)\b)\s+(\w+)(?=\()
139− comment: A function invocation after 'return'
140− captures:
141− 1: keyword.control.dart
142− 2: function.name.dart
143− push:
144− - meta_scope: meta.invocation.function.dart
145− - match: \)
146− pop: true
147− - include: comments-inline
148− - include: decl-function-parameter
149− - include: strings
150− - include: keywords
151− - match: ^\s*\b(new)\b\s+(\w+)(?=\()
152− comment: A class instantiation after 'new'
153− captures:
154− 1: keyword.declaration.dart
155− 2: function.name.dart
156− push:
157− - meta_scope: meta.invocation.function.dart
158− - match: \)
159− pop: true
160− - include: comments-inline
161− - include: decl-function-parameter
162− - include: strings
163− - include: keywords
164− decl-function-parameter:
165− - include: constants-and-special-vars
166− - match: (?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b)\s+(\w+)(?=\()
167− comment: A function with a primitive return type.
168− captures:
169− 1: storage.type.primitive.dart
170− 2: function.name.dart
171− push:
172− - meta_scope: meta.parameter.function.dart
173− - match: \)
174− pop: true
175− - include: decl-function-parameter
176− - include: strings
177− - include: keywords
178− - match: \b(new)\b\s+(\w+)(?=\()
179− comment: A class instantiation after 'new'
180 captures:
87 captures:
181− 1: keyword.declaration.dart
182− 2: function.name.dart
88+ 0: variable.name.source.dart
89+ - match: '```.*?$'
183 push:
90 push:
184− - meta_scope: meta.invocation.function.dart
91+ - meta_content_scope: variable.other.source.dart
185− - match: \)
92+ - match: '```'
186 pop: true
93 pop: true
187− - include: decl-function-parameter
188− - include: strings
189− - include: keywords
190− - match: (?:\b(\w+)\b)\s+(\w+)(?=\()
94+ - match: (`.*?`)
191− comment: A function with a user-defined return type.
192 captures:
95 captures:
193− 1: type.user-defined.dart
96+ 0: variable.other.source.dart
194− 2: function.name.dart
195− push:
196− - meta_scope: meta.parameter.function.dart
197− - match: \)
198− pop: true
199− - include: decl-function-parameter
200− - include: strings
201− - include: keywords
202− - match: (\w+)(?=\()
97+ - match: (`.*?`)
203− comment: A function with no return type.
204 captures:
98 captures:
205− 1: function.name.dart
99+ 0: variable.other.source.dart
206− push:
207− - meta_scope: meta.parameter.function.dart
208− - match: \)
100+ - match: (\* (( ).*))$
209− pop: true
210− - include: decl-function-parameter
211− - include: strings
212− - include: keywords
213− decl-typedef:
214− - match: typedef
215 captures:
101 captures:
216− 0: keyword.control.new.dart
102+ 2: variable.other.source.dart
217− push:
218− - meta_scope: meta.declaration.typedef.dart
219− - match: ;
220− captures:
221− 0: punctuation.terminator.dart
222− pop: true
223− - match: '(?:\b(void|bool|num|int|double|dynamic|var|String|List|Map)\b|([a-zA-Z_][a-zA-Z0-9_]*))\s+([a-zA-Z_][a-zA-Z0-9_]+)'
224− captures:
225− 1: storage.type.primitive.dart
226− 2: typedef.return.dart
227− 3: typedef.name.dart
228− - match: \(
103+ - match: (\* .*)$
229− push:
230− - meta_scope: typedef.params.dart
231− - match: \)
232− pop: true
233− - include: keywords
234 keywords:
104 keywords:
235− - match: \bassert\b
105+ - match: (?<!\$)\bas\b(?!\$)
236− scope: keyword.control.assert.dart
237− - match: \bas\b
238 scope: keyword.cast.dart
106 scope: keyword.cast.dart
239− - match: \b(try|catch|finally|throw|on|rethrow)\b
107+ - match: (?<!\$)\b(try|on|catch|finally|throw|rethrow)\b(?!\$)
240 scope: keyword.control.catch-exception.dart
108 scope: keyword.control.catch-exception.dart
241− - match: \s+\?\s+|\s+:\s+
242− scope: keyword.control.ternary.dart
243− - match: \b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b
109+ - match: (?<!\$)\b(break|case|continue|default|do|else|for|if|in|return|switch|while)\b(?!\$)
244 scope: keyword.control.dart
110 scope: keyword.control.dart
245− - match: \b(async\*|async|await\*|await|yield)\b
111+ - match: (?<!\$)\b(sync(\*)?|async(\*)?|await|yield(\*)?)\b(?!\$)
246− scope: keyword.control.async.dart
112+ scope: keyword.control.dart
113+ - match: (?<!\$)\bassert\b(?!\$)
114+ scope: keyword.control.dart
247− - match: \b(new)\b
115+ - match: (?<!\$)\b(new)\b(?!\$)
248 scope: keyword.control.new.dart
116 scope: keyword.control.new.dart
249− - match: \b(abstract|extends|external|factory|implements|with|interface|get|native|operator|set|typedef)\b
117+ - match: (?<!\$)\b(abstract|class|enum|extends|external|factory|implements|get|mixin|native|operator|set|typedef|with|covariant)\b(?!\$)
250 scope: keyword.declaration.dart
118 scope: keyword.declaration.dart
251− - match: \b(is\!?)\b
119+ - match: (?<!\$)\b(is\!?)\b(?!\$)
252 scope: keyword.operator.dart
120 scope: keyword.operator.dart
121+ - match: '\?|:'
122+ scope: keyword.operator.ternary.dart
253 - match: (<<|>>>?|~|\^|\||&)
123 - match: (<<|>>>?|~|\^|\||&)
254 scope: keyword.operator.bitwise.dart
124 scope: keyword.operator.bitwise.dart
255 - match: ((&|\^|\||<<|>>>?)=)
125 - match: ((&|\^|\||<<|>>>?)=)
256 scope: keyword.operator.assignment.bitwise.dart
126 scope: keyword.operator.assignment.bitwise.dart
257− - match: (===?|!==?|<=?|>=?)
127+ - match: (=>)
128+ scope: keyword.operator.closure.dart
129+ - match: (==|!=|<=?|>=?)
258 scope: keyword.operator.comparison.dart
130 scope: keyword.operator.comparison.dart
259 - match: '(([+*/%-]|\~)=)'
131 - match: '(([+*/%-]|\~)=)'
260 scope: keyword.operator.assignment.arithmetic.dart
132 scope: keyword.operator.assignment.arithmetic.dart
@@ -266,56 +138,22 @@ contexts:
266 scope: keyword.operator.arithmetic.dart
138 scope: keyword.operator.arithmetic.dart
267 - match: (!|&&|\|\|)
139 - match: (!|&&|\|\|)
268 scope: keyword.operator.logical.dart
140 scope: keyword.operator.logical.dart
269− - match: ;
270− scope: punctuation.terminator.dart
271− - match: \b(static|final|const)\b
141+ - match: (?<!\$)\b(static|final|const)\b(?!\$)
272 scope: storage.modifier.dart
142 scope: storage.modifier.dart
273− - match: \b(?:void|bool|num|int|double|dynamic|var|String|List|Map)\b
143+ - match: (?<!\$)\b(?:void|var)\b(?!\$)
274 scope: storage.type.primitive.dart
144 scope: storage.type.primitive.dart
275− regexp:
145+ punctuation:
276− - match: '\\[^''"]'
146+ - match: ','
277− scope: constant.character.escaped.regex.dart
147+ scope: punctuation.comma.dart
278− - match: \(
148+ - match: ;
279− push:
149+ scope: punctuation.terminator.dart
280− - meta_content_scope: meta.capture.regex.dart
281− - match: \)
282− pop: true
283− - match: \?(:|=|!)
284− scope: ignore.capture.regex.dart
285− - match: \*|\+|\?|\.|\|
286− scope: keyword.other.regex.dart
287− - match: \^|\$
288− scope: keyword.other.regex.dart
289 - match: \.
150 - match: \.
290− scope: constant.other.regex.dart
151+ scope: punctuation.dot.dart
291− - match: '\[(\^)?'
292− captures:
293− 1: keyword.other.negation.regex.dart
294− push:
295− - meta_scope: constant.character.range.regex.dart
296− - match: '\]'
297− pop: true
298− - match: '\\[^"'']'
299− scope: constant.character.escaped.regex.dart
300− - match: '\{(?:\d+)?,(?:\d+)?\}'
301− scope: keyword.other.regex.dart
302 string-interp:
152 string-interp:
303− - match: '(\$)(\{)'
153+ - match: '\$((\w+)|\{([^{}]+)\})'
304 captures:
154 captures:
305− 1: keyword.other.dart
306− 2: keyword.other.dart
307− push:
308− - meta_scope: interpolation.dart
309− - meta_content_scope: source.dart
310− - match: '(\})'
311− captures:
312− 1: keyword.other.dart
313− pop: true
314− - include: main
315− - match: (\$)(\w+)
316− captures:
317− 1: keyword.other.dart
318 2: variable.parameter.dart
155 2: variable.parameter.dart
156+ 3: variable.parameter.dart
319 - match: \\.
157 - match: \\.
320 scope: constant.character.escape.dart
158 scope: constant.character.escape.dart
321 strings:
159 strings:
@@ -328,7 +166,7 @@ contexts:
328 - match: (?<!r)'''
166 - match: (?<!r)'''
329 push:
167 push:
330 - meta_scope: string.interpolated.triple.single.dart
168 - meta_scope: string.interpolated.triple.single.dart
331− - match: "'''(?!')"
169+ - match: '''''''(?!'')'
332 pop: true
170 pop: true
333 - include: string-interp
171 - include: string-interp
334 - match: r"""
172 - match: r"""
@@ -339,9 +177,9 @@ contexts:
339 - match: r'''
177 - match: r'''
340 push:
178 push:
341 - meta_scope: string.quoted.triple.single.dart
179 - meta_scope: string.quoted.triple.single.dart
342− - match: "'''(?!')"
180+ - match: '''''''(?!'')'
343 pop: true
181 pop: true
344− - match: (?<!\\|r)"
182+ - match: (?<!\|r)"
345 push:
183 push:
346 - meta_scope: string.interpolated.double.dart
184 - meta_scope: string.interpolated.double.dart
347 - match: '"'
185 - match: '"'
@@ -354,16 +192,20 @@ contexts:
354 - meta_scope: string.quoted.double.dart
192 - meta_scope: string.quoted.double.dart
355 - match: '"'
193 - match: '"'
356 pop: true
194 pop: true
357− - include: regexp
195+ - match: \n
196+ scope: invalid.string.newline
358 - match: (?<!\|r)'
197 - match: (?<!\|r)'
359 push:
198 push:
360 - meta_scope: string.interpolated.single.dart
199 - meta_scope: string.interpolated.single.dart
361 - match: "'"
200 - match: "'"
362 pop: true
201 pop: true
202+ - match: \n
203+ scope: invalid.string.newline
363 - include: string-interp
204 - include: string-interp
364 - match: r'
205 - match: r'
365 push:
206 push:
366 - meta_scope: string.quoted.single.dart
207 - meta_scope: string.quoted.single.dart
367 - match: "'"
208 - match: "'"
368 pop: true
209 pop: true
369− - include: regexp
210+ - match: \n
211+ scope: invalid.string.newline
assets/syntaxes/02_Extra/DotENV+1−1

Submodule changed.

assets/syntaxes/02_Extra/DotENV.sublime-syntax+4−2
@@ -4,7 +4,6 @@
4name: DotENV
4name: DotENV
5file_extensions:
5file_extensions:
6 - .env
6 - .env
7− - .envrc
8 - .env.dist
7 - .env.dist
9 - .env.local
8 - .env.local
10 - .env.sample
9 - .env.sample
@@ -19,8 +18,11 @@ file_extensions:
19 - .env.production
18 - .env.production
20 - .env.production.local
19 - .env.production.local
21 - .env.dusk.local
20 - .env.dusk.local
22− - .flaskenv
23 - .env.staging
21 - .env.staging
22+ - .env.default
23+ - .env.defaults
24+ - .envrc
25+ - .flaskenv
24scope: source.env
26scope: source.env
25contexts:
27contexts:
26 main:
28 main:
assets/syntaxes/02_Extra/Elixir+1−1

Submodule changed.

assets/syntaxes/02_Extra/Email+1−1

Submodule changed.

assets/syntaxes/02_Extra/FSharp+1−1

Submodule changed.

assets/syntaxes/02_Extra/Fish+1−1

Submodule changed.

assets/syntaxes/02_Extra/Fstab.sublime-syntax+2
@@ -4,6 +4,8 @@
4name: fstab
4name: fstab
5file_extensions:
5file_extensions:
6 - fstab
6 - fstab
7+ - crypttab
8+ - mtab
7scope: source.fstab
9scope: source.fstab
8
10
9contexts:
11contexts:
assets/syntaxes/02_Extra/GLSLnew file+1

Submodule changed.

assets/syntaxes/02_Extra/GraphQL+1−1

Submodule changed.

assets/syntaxes/02_Extra/Groffnew file+1

Submodule changed.

assets/syntaxes/02_Extra/INI.sublime-syntax+4−3
@@ -5,8 +5,8 @@ name: INI
5file_extensions:
5file_extensions:
6 - ini
6 - ini
7 - INI
7 - INI
8− - inf
8+ - "inf"
9− - INF
9+ - "INF"
10 - reg
10 - reg
11 - REG
11 - REG
12 - lng
12 - lng
@@ -25,12 +25,13 @@ contexts:
25 scope: comment.line.semicolon.ini
25 scope: comment.line.semicolon.ini
26 captures:
26 captures:
27 1: punctuation.definition.comment.ini
27 1: punctuation.definition.comment.ini
28− - match: '^\s*(\[)(.*?)(\])'
28+ - match: '^\s*(\[)(.*?)(\])\s*(;.*)?$\n?'
29 scope: meta.tag.section.ini
29 scope: meta.tag.section.ini
30 captures:
30 captures:
31 1: punctuation.definition.section.ini
31 1: punctuation.definition.section.ini
32 2: entity.section.ini
32 2: entity.section.ini
33 3: punctuation.definition.section.ini
33 3: punctuation.definition.section.ini
34+ 4: comment.definition.section.ini
34 - match: '^(\s*(["'']?)(.+?)(\2)\s*(=))?\s*((["'']?)(.*?)(\7))\s*(;.*)?$\n?'
35 - match: '^(\s*(["'']?)(.+?)(\2)\s*(=))?\s*((["'']?)(.*?)(\7))\s*(;.*)?$\n?'
35 scope: meta.declaration.ini
36 scope: meta.declaration.ini
36 captures:
37 captures:
assets/syntaxes/02_Extra/Julia+1−1

Submodule changed.

assets/syntaxes/02_Extra/LESS+1−1

Submodule changed.

assets/syntaxes/02_Extra/LLVMnew file+1

Submodule changed.

assets/syntaxes/02_Extra/Leannew file+1

Submodule changed.

assets/syntaxes/02_Extra/Lean.sublime-syntaxnew file+125
@@ -0,0 +1,125 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Lean
5+file_extensions:
6+ - lean
7+scope: source.lean
8+contexts:
9+ main:
10+ - include: comments
11+ - match: '\b(?<!\.)(inductive|coinductive|structure|theorem|axiom|axioms|abbreviation|lemma|definition|def|instance|class|constant)\b\s+(\{[^}]*\})?'
12+ captures:
13+ 1: keyword.other.definitioncommand.lean
14+ push:
15+ - meta_scope: meta.definitioncommand.lean
16+ - match: '(?=\bwith\b|\bextends\b|[:\|\(\[\{⦃<>])'
17+ pop: true
18+ - include: comments
19+ - include: definitionName
20+ - match: ","
21+ - match: \b(Prop|Type|Sort)\b
22+ scope: storage.type.lean
23+ - match: '\battribute\b\s*\[[^\]]*\]'
24+ scope: storage.modifier.lean
25+ - match: '@\[[^\]]*\]'
26+ scope: storage.modifier.lean
27+ - match: \b(?<!\.)(private|meta|mutual|protected|noncomputable)\b
28+ scope: keyword.control.definition.modifier.lean
29+ - match: \b(sorry)\b
30+ scope: invalid.illegal.lean
31+ - match: '#print\s+(def|definition|inductive|instance|structure|axiom|axioms|class)\b'
32+ scope: keyword.other.command.lean
33+ - match: '#(print|eval|reduce|check|help|exit|find|where)\b'
34+ scope: keyword.other.command.lean
35+ - match: \b(?<!\.)(import|export|prelude|theory|definition|def|abbreviation|instance|renaming|hiding|exposing|parameter|parameters|begin|constant|constants|lemma|variable|variables|theorem|example|open|axiom|inductive|coinductive|with|structure|universe|universes|alias|precedence|reserve|postfix|prefix|infix|infixl|infixr|notation|end|using|namespace|section|local|set_option|extends|include|omit|class|classes|instances|raw|run_cmd|restate_axiom)(?!\.)\b
36+ scope: keyword.other.lean
37+ - match: \b(?<!\.)(calc|have|this|match|do|suffices|show|by|in|at|let|forall|fun|exists|assume|from|obtain|haveI|λ)(?!\.)\b
38+ scope: keyword.other.lean
39+ - match: «
40+ push:
41+ - meta_content_scope: entity.name.lean
42+ - match: »
43+ pop: true
44+ - match: \b(?<!\.)(if|then|else)\b
45+ scope: keyword.control.lean
46+ - match: '"'
47+ captures:
48+ 0: punctuation.definition.string.begin.lean
49+ push:
50+ - meta_scope: string.quoted.double.lean
51+ - match: '"'
52+ captures:
53+ 0: punctuation.definition.string.end.lean
54+ pop: true
55+ - match: '\\[\\"nt'']'
56+ scope: constant.character.escape.lean
57+ - match: '\\x[0-9A-Fa-f][0-9A-Fa-f]'
58+ scope: constant.character.escape.lean
59+ - match: '\\u[0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f]'
60+ scope: constant.character.escape.lean
61+ - match: '''[^\\'']'''
62+ scope: string.quoted.single.lean
63+ - match: '''(\\(x..|u....|.))'''
64+ scope: string.quoted.single.lean
65+ captures:
66+ 1: constant.character.escape.lean
67+ - match: '`+[^\[(]\S+'
68+ scope: entity.name.lean
69+ - match: '\b([0-9]+|0([xX][0-9a-fA-F]+))\b'
70+ scope: constant.numeric.lean
71+ blockComment:
72+ - match: /-
73+ push:
74+ - meta_scope: comment.block.lean
75+ - match: "-/"
76+ pop: true
77+ - include: scope:source.lean.markdown
78+ - include: blockComment
79+ comments:
80+ - include: dashComment
81+ - include: docComment
82+ - include: stringBlock
83+ - include: modDocComment
84+ - include: blockComment
85+ dashComment:
86+ - match: (--)
87+ captures:
88+ 0: punctuation.definition.comment.lean
89+ push:
90+ - meta_scope: comment.line.double-dash.lean
91+ - match: $
92+ pop: true
93+ - include: scope:source.lean.markdown
94+ definitionName:
95+ - match: '\b[^:«»\(\)\{\}[:space:]=→λ∀?][^:«»\(\)\{\}[:space:]]*'
96+ scope: entity.name.function.lean
97+ - match: «
98+ push:
99+ - meta_content_scope: entity.name.function.lean
100+ - match: »
101+ pop: true
102+ docComment:
103+ - match: /--
104+ push:
105+ - meta_scope: comment.block.documentation.lean
106+ - match: "-/"
107+ pop: true
108+ - include: scope:source.lean.markdown
109+ - include: blockComment
110+ modDocComment:
111+ - match: /-!
112+ push:
113+ - meta_scope: comment.block.documentation.lean
114+ - match: "-/"
115+ pop: true
116+ - include: scope:source.lean.markdown
117+ - include: blockComment
118+ stringBlock:
119+ - match: /-"
120+ push:
121+ - meta_scope: comment.block.string.lean
122+ - match: '"-/'
123+ pop: true
124+ - include: scope:source.lean.markdown
125+ - include: blockComment
assets/syntaxes/02_Extra/LiveScriptnew file+1

Submodule changed.

assets/syntaxes/02_Extra/LiveScript.sublime-syntaxnew file+400
@@ -0,0 +1,400 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: LiveScript
5+comment: "LiveScript Syntax: version 1"
6+file_extensions:
7+ - ls
8+ - Slakefile
9+ - ls.erb
10+first_line_match: ^#!.*\bls
11+scope: source.livescript
12+contexts:
13+ main:
14+ - match: |-
15+ (?x)
16+ !?[~-]{1,2}>\*?
17+ |<[~-]{1,2}!?
18+ |\(\s* (?= instanceof[\s)]|and[\s)]|or[\s)]|is[\s)]|isnt[\s)]|in[\s)]|import[\s)]|import\ all[\s)] |\.|[-+/*%^&<>=|][\b\s)\w$]|\*\*|\%\%)
19+ | (?<=[\s(]instanceof|[\s(]and|[\s(]or|[\s(]is|[\s(]isnt|[\s(]in|[\s(]import|[\s(]import\ all|[\s(]do|\.|\*\*|\%\%|[\b\s(\w$][-+/*%^&<>=|]) \s*\)
20+ scope: storage.type.function.livescript
21+ - match: \/\*
22+ captures:
23+ 0: punctuation.definition.comment.livescript
24+ push:
25+ - meta_scope: comment.block.livescript
26+ - match: \*\/
27+ captures:
28+ 0: punctuation.definition.comment.livescript
29+ pop: true
30+ - match: '@\w*'
31+ scope: storage.type.annotation.livescriptscript
32+ - match: '(#)(?!\{).*$\n?'
33+ scope: comment.line.number-sign.livescript
34+ captures:
35+ 1: punctuation.definition.comment.livescript
36+ - match: '((?:!|~|!~|~!)?function\*?)\s+([$\w\-]*[$\w]+)'
37+ captures:
38+ 1: storage.type.function.livescript
39+ 2: entity.name.function.livescript
40+ - match: (new)\s+(\w+(?:\.\w*)*)
41+ captures:
42+ 1: keyword.operator.new.livescript
43+ 2: entity.name.type.instance.livescript
44+ - match: \b(package|private|protected|public|interface|enum|static)(?!-)\b
45+ scope: keyword.illegal.livescript
46+ - match: "'''"
47+ captures:
48+ 0: punctuation.definition.string.begin.livescript
49+ push:
50+ - meta_scope: string.quoted.heredoc.livescript
51+ - match: "'''"
52+ captures:
53+ 0: punctuation.definition.string.end.livescript
54+ pop: true
55+ - match: '"""'
56+ captures:
57+ 0: punctuation.definition.string.begin.livescript
58+ push:
59+ - meta_scope: string.quoted.double.heredoc.livescript
60+ - match: '"""'
61+ captures:
62+ 0: punctuation.definition.string.end.livescript
63+ pop: true
64+ - match: \\.
65+ scope: constant.character.escape.livescript
66+ - include: interpolated_livescript
67+ - match: "``"
68+ captures:
69+ 0: punctuation.definition.string.begin.livescript
70+ push:
71+ - meta_scope: string.quoted.script.livescript
72+ - match: "``"
73+ captures:
74+ 0: punctuation.definition.string.end.livescript
75+ pop: true
76+ - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
77+ scope: constant.character.escape.livescript
78+ - match: '<\['
79+ push:
80+ - meta_scope: string.array-literal.livescript
81+ - match: '\]>'
82+ pop: true
83+ - match: '/{2}(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])/{2}'
84+ scope: string.regexp.livescript
85+ - match: '/{2}\n'
86+ push:
87+ - meta_scope: string.regexp.livescript
88+ - match: "/{2}[imgy]{0,4}"
89+ pop: true
90+ - include: embedded_spaced_comment
91+ - include: interpolated_livescript
92+ - match: "/{2}"
93+ push:
94+ - meta_scope: string.regexp.livescript
95+ - match: "/{2}[imgy]{0,4}"
96+ pop: true
97+ - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
98+ scope: constant.character.escape.livescript
99+ - include: interpolated_livescript
100+ - match: '/(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])'
101+ scope: string.regexp.livescript
102+ - match: |-
103+ (?x)
104+ \b(?<![\.\$\-@])(
105+ instanceof|new|delete|typeof|and|or|is|isnt|not
106+ )(?!\-|\s*:)\b
107+ scope: keyword.operator.livescript
108+ - match: <\||\|>
109+ scope: keyword.operator.livescript
110+ - match: "=>"
111+ scope: keyword.control.livescript
112+ - match: |-
113+ (?x)
114+ \b(?<![\.\$\-@])(?:
115+ return|break|continue|throw
116+ |try|if|while|for|for\s+own|switch|unless|until
117+ |catch|finally|else|nobreak|case|default|fallthrough|when|otherwise|then
118+ |yield
119+ )(?!\-|\s*:)\b
120+ scope: keyword.control.livescript
121+ - match: |-
122+ (?x)
123+ and=|or=|%|&|\^|\*|\/|(?<![a-zA-Z$_])(\-)?\-(?!\-?>)|\+\+|\+|
124+ ~(?!~?>)|==|=|!=|<=|>=|<<=|>>=|
125+ >>>=|<>|<(?!\[)|(?<!\])>|(?<!\w)!(?!([~\-]+)?>)|&&|\.\.(\.)?|\s\.\s|\?|\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|\.=|&=
126+ |\^=
127+ scope: keyword.operator.livescript
128+ - match: |-
129+ (?x)
130+ \b(?<![\.\$\-@])(?:
131+ function
132+ )(?!\-|\s*:)\b
133+ scope: storage.type.function.livescript
134+ - match: |-
135+ (?x)
136+ \b(?<![\.\$\-@])(?:
137+ this|throw|then|try|typeof!?|til|to
138+ |continue|const|case|catch|class
139+ |in|instanceof|import|import\s+all|implements|if|is
140+ |default|delete|debugger|do
141+ |for|for\s+own|finally|function|from|fallthrough
142+ |super|switch
143+ |else|nobreak|extends|export|eval
144+ |and|arguments
145+ |new|not
146+ |unless|until
147+ |while|with|when
148+ |of|or|otherwise
149+ |let|var|loop
150+ |match
151+ |by|yield
152+ )(?!\-|\s*:)\b
153+ scope: keyword.other.livescript
154+ - match: '([a-zA-Z\$_](?:[\w$.-])*)\s*(?!\::)((:)|(=(?!>)))\s*(?!(\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?))'
155+ captures:
156+ 1: variable.assignment.livescript
157+ 3: punctuation.separator.key-value, keyword.operator.livescript
158+ 4: keyword.operator.livescript
159+ - match: '(?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=])'
160+ captures:
161+ 0: keyword.operator.livescript
162+ push:
163+ - meta_scope: meta.variable.assignment.destructured.livescript
164+ - match: '([\]\}]\s*[:=])'
165+ captures:
166+ 0: keyword.operator.livescript
167+ pop: true
168+ - include: variable_name
169+ - include: instance_variable
170+ - include: single_quoted_string
171+ - include: double_quoted_string
172+ - include: numeric
173+ - match: |-
174+ (?x)
175+ (\s*)
176+ (?=[a-zA-Z\$_])
177+ ([a-zA-Z\$_]([\w$.:-])*)\s*
178+ (?=[:=](\s*!?\s*\(.*\))?\s*(!?[~-]{1,2}>\*?))
179+ scope: meta.function.livescript
180+ captures:
181+ 2: entity.name.function.livescript
182+ 3: entity.name.function.livescript
183+ 4: variable.parameter.function.livescript
184+ 5: storage.type.function.livescript
185+ - match: \b(?<!\.)(true|on|yes)(?!\s*:)\b
186+ scope: constant.language.boolean.true.livescript
187+ - match: \b(?<!\.)(false|off|no)(?!\s*:)\b
188+ scope: constant.language.boolean.false.livescript
189+ - match: \b(?<!\.)(null|void)(?!\s*:)\b
190+ scope: constant.language.null.livescript
191+ - match: \b(?<!\.)(super|this|extends)(?!\s*:)\b
192+ scope: variable.language.livescript
193+ - match: '(class\b)\s+(@?[a-zA-Z$_][\w$.-]*)?(?:\s+(extends)\s+(@?[a-zA-Z$_][\w$.-]*))?'
194+ scope: meta.class.livescript
195+ captures:
196+ 1: storage.type.class.livescript
197+ 2: entity.name.type.class.livescript
198+ 3: keyword.control.inheritance.livescript
199+ 4: entity.other.inherited-class.livescript
200+ - match: \b(debugger|\\)\b
201+ scope: keyword.other.livescript
202+ - match: |-
203+ (?x)\b(
204+ Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|
205+ Int(8|16|32|64)Array|Math|Map|Number|
206+ Object|Proxy|RegExp|Set|String|WeakMap|
207+ window|Uint(8|16|32|64)Array|XMLHttpRequest
208+ )\b
209+ scope: support.class.livescript
210+ - match: \b(console)\b
211+ scope: entity.name.type.object.livescript
212+ - match: \b(Infinity|NaN|undefined)\b
213+ scope: constant.language.livescript
214+ - match: \;
215+ scope: punctuation.terminator.statement.livescript
216+ - match: ',[ |\t]*'
217+ scope: meta.delimiter.object.comma.livescript
218+ - match: \.
219+ scope: meta.delimiter.method.period.livescript
220+ - match: '\{|\}'
221+ scope: meta.brace.curly.livescript
222+ - match: \(|\)
223+ scope: meta.brace.round.livescript
224+ - match: '\[|\]\s*'
225+ scope: meta.brace.square.livescript
226+ - include: instance_variable
227+ - include: backslash_string
228+ - include: single_quoted_string
229+ - include: double_quoted_string
230+ - include: numeric
231+ - match: '()(@|@@|[$\w\-]*[$\w]+)\s*(`)'
232+ captures:
233+ 1: keyword.operator.livescript
234+ 2: meta.function-call.livescript
235+ 3: keyword.operator.livescript
236+ - match: "`"
237+ scope: keyword.operator.livescript
238+ - match: '()(@|@@|[$\w\-]*[$\w]+)(?:(\??\!)|[(])'
239+ captures:
240+ 1: keyword.operator.livescript
241+ 2: meta.function-call.livescript
242+ 3: keyword.operator.livescript
243+ - match: '(@|@@|[$\w\-]*[$\w]+)(\?)? (?!\s*(((by|of|and|or|with|when|unless|if|is|isnt|else|nobreak|for|from|not in|in|catch|til|to|then|import|extends|implements|instanceof)\b)|[=:.*\/+\-%\^<>][ =)]|[`}%*)]|/(?!.*?/)|&&|[.][^.]|=>|\/ +|\||\|\||\-\-|\+\+|\|>|<|\||$|\n|\#|/\*))'
244+ captures:
245+ 1: meta.function-call.livescript
246+ 2: keyword.operator.livescript
247+ - match: \| _
248+ scope: keyword.control.livescript
249+ - match: '\|(?![.])'
250+ scope: keyword.control.livescript
251+ - match: \|
252+ scope: keyword.operator.livescript
253+ - match: ((?<=console\.)(debug|warn|info|log|error|time(End|-end)|assert))\b
254+ scope: support.function.console.livescript
255+ - match: |-
256+ (?x)\b(
257+ decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require
258+ )\b
259+ scope: support.function.livescript
260+ - match: |-
261+ (?x)(?<![.-])\b(
262+ map|filter|reject|partition|find|each|head|tail|last|initial|empty|
263+ values|keys|length|cons|append|join|reverse|fold(l|r)?1?|unfoldr|
264+ and(List|-list)|or(List|-list)|any|all|unique|sum|product|mean|compact|
265+ concat(Map|-map)?|maximum|minimum|scan(l|r)?1?|replicate|slice|apply|
266+ split(At|-at)?|take(While|-while)?|drop(While|-while)?|span|first|
267+ break(It|-it)|list(ToObj|-to-obj)|obj(ToFunc|-to-func)|
268+ pairs(ToObj|-to-obj)|obj(ToPairs|-to-pairs|ToLists|-to-lists)|
269+ zip(All|-all)?(With|-with)?|compose|curry|partial|flip|fix|
270+ sort(With|-with|By|-by)?|group(By|-by)|break(List|-list|Str|-str)|
271+ difference|intersection|union|average|flatten|chars|unchars|repeat|
272+ lines|unlines|words|unwords|max|min|negate|abs|signum|quot|rem|div|mod|
273+ recip|pi|tau|exp|sqrt|ln|pow|sin|cos|tan|asin|acos|atan|atan2|truncate|
274+ round|ceiling|floor|is(It|-it)NaN|even|odd|gcd|lcm|disabled__id
275+ )\b(?![.-])
276+ comment: |
277+ Generated by DOM query from http://gkz.github.com/prelude-ls/:
278+ [].slice
279+ .call(document.querySelectorAll(".nav-pills li a"))
280+ .map(function(_) {return _.innerText})
281+ .filter(function(_) {return _.trim() !== '})
282+ .slice(2)
283+ .join("|")
284+ scope: support.function.prelude.livescript
285+ - match: '(?x)(?<![.-])\b(that|it|e|_)\b'
286+ scope: support.function.semireserved.livescript
287+ - match: |-
288+ (?x)((?<=(\.|\]|\)))(
289+ apply|call|concat|every|filter|for(Each|-each)|
290+ from|has(Own|-own)(Property|-property)|index(Of|-of)|
291+ is(Prototype|-prototype)(Of|-of)|join|last(Index|-index)(Of|-of)|
292+ map|of|pop|property(Is|-is)(Enumerable|-enumerable)|push|
293+ reduce(Right|-right)?|reverse|shift|slice|some|sort|
294+ splice|to(Locale|-locale)?(String|-string)|unshift|valueOf
295+ ))\b(?!-)
296+ scope: support.function.method.array.livescript
297+ - match: |-
298+ (?x)((?<=Array\.)(
299+ isArray
300+ ))\b
301+ scope: support.function.static.array.livescript
302+ - match: |-
303+ (?x)((?<=Object\.)(
304+ create|define(Propert|-propert)(ies|y)|freeze|
305+ get(Own|-own)(Property|-property)(Descriptors?|Names)|
306+ get(Property|-property)(Descriptor|Names)|getPrototypeOf|
307+ is((Extensible|-extensible)|(Frozen|-frozen)|(Sealed|-sealed))?|
308+ keys|prevent(Extensions|-extensions)|seal
309+ ))\b
310+ scope: support.function.static.object.livescript
311+ - match: |-
312+ (?x)((?<=Math\.)(
313+ abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|
314+ hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|
315+ tan|tanh|trunc
316+ ))\b
317+ scope: support.function.static.math.livescript
318+ - match: |-
319+ (?x)((?<=Number\.)(
320+ is(Finite|Integer|NaN)|to(Integer|-integer)
321+ ))\b
322+ scope: support.function.static.number.livescript
323+ - match: '[\$\w][\w-]*'
324+ scope: variable.other.livescript
325+ backslash_string:
326+ - match: '\\([\\)\s,\};\]])?'
327+ captures:
328+ 0: string.quoted.single.livescript
329+ push:
330+ - meta_content_scope: string.quoted.single.livescript
331+ - match: '([\\)\s,\};\]])'
332+ captures:
333+ 0: punctuation.definition.string.end.livescript
334+ pop: true
335+ constructor_variable:
336+ - match: '([a-zA-Z$_][\w$-]*)(@{2})([a-zA-Z$_][\w$-]*)?'
337+ scope: variable.other.readwrite.constructor.livescript
338+ double_quoted_string:
339+ - match: '"'
340+ captures:
341+ 0: punctuation.definition.string.begin.livescript
342+ push:
343+ - meta_scope: string.quoted.double.livescript
344+ - match: '"'
345+ captures:
346+ 0: punctuation.definition.string.end.livescript
347+ pop: true
348+ - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)'
349+ scope: constant.character.escape.livescript
350+ - include: interpolated_livescript
351+ embedded_comment:
352+ - match: (?<!\\)(#).*$\n
353+ scope: comment.line.number-sign.livescript
354+ captures:
355+ 1: punctuation.definition.comment.livescript
356+ embedded_spaced_comment:
357+ - match: (?<!\\)(#\s).*$\n
358+ scope: comment.line.number-sign.livescript
359+ captures:
360+ 1: punctuation.definition.comment.livescript
361+ instance_variable:
362+ - match: '(?<![$\w\-])(@)'
363+ scope: variable.other.readwrite.instance.livescript
364+ interpolated_livescript:
365+ - match: '\#\{'
366+ captures:
367+ 0: punctuation.section.embedded.livescript
368+ push:
369+ - meta_scope: source.livescript.embedded.source
370+ - match: '\}'
371+ captures:
372+ 0: punctuation.section.embedded.livescript
373+ pop: true
374+ - include: main
375+ - match: '\#'
376+ push:
377+ - meta_scope: source.livescript.embedded.source.simple
378+ - match: ""
379+ pop: true
380+ - include: main
381+ numeric:
382+ - match: '(?<![\$@a-zA-Z_])(([0-9]+r[0-9_]+)|((16r|0[xX])[0-9a-fA-F_]+)|([0-9]+(\.[0-9]+[0-9_]*)?(e[+\-]?[0-9_]+)?)[_a-zA-Z0-9]*)'
383+ scope: constant.numeric.livescript
384+ single_quoted_string:
385+ - match: "'"
386+ captures:
387+ 0: punctuation.definition.string.begin.livescript
388+ push:
389+ - meta_scope: string.quoted.single.livescript
390+ - match: "'"
391+ captures:
392+ 0: punctuation.definition.string.end.livescript
393+ pop: true
394+ - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)'
395+ scope: constant.character.escape.livescript
396+ variable_name:
397+ - match: '([a-zA-Z\$_][\w$-]*(\.\w+)*)(?!\-)'
398+ scope: variable.assignment.livescript
399+ captures:
400+ 1: variable.assignment.livescript
assets/syntaxes/02_Extra/Manpage.sublime-syntax+144−26
@@ -7,47 +7,165 @@ file_extensions:
7scope: source.man
7scope: source.man
8
8
9variables:
9variables:
10− section_heading: '^\S.*$'
10+ section_heading: '^(?!#)\S.*$'
11+ command_line_option: '(--?[A-Za-z0-9][_A-Za-z0-9-]*)'
11
12
12contexts:
13contexts:
14+ prototype:
15+ # ignore syntax test lines
16+ - match: '^#'
17+ push:
18+ - meta_scope: comment.syntax-test.man
19+ - match: $\n?
20+ pop: true
13 main:
21 main:
14 - match: ^
22 - match: ^
15 push: first_line
23 push: first_line
16
24
17 first_line:
25 first_line:
18− - match: '([A-Z0-9_\-]+)(\()([^)]+)(\))'
26+ - match: '([A-Z0-9_\-]+)(\()([^)]+)(\))\s*'
19 captures:
27 captures:
20− 1: meta.preprocessor
28+ 1: meta.preprocessor.man
21− 2: keyword.operator
29+ 2: keyword.operator.man
22− 3: string.quoted.other
30+ 3: string.quoted.other.man
23− 4: keyword.operator
31+ 4: keyword.operator.man
32+ push:
33+ - match: (?:[\w'-]+|\s(?!\s))
34+ scope: markup.heading.title.man
35+ - match: \s\s
36+ pop: true
37+ - match: '(?=\S|$)'
38+ pop: true
24
39
25 - match: '$'
40 - match: '$'
26− push: body
41+ set: body
27
42
28 body:
43 body:
44+ # English, ..., ..., ..., Russian, ...
45+
29− - match: '^(SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
46+ - match: '^(?:SYNOPSIS|SYNTAX|SINTASSI|SKŁADNIA|СИНТАКСИС|書式)'
30− push: Packages/C/C.sublime-syntax
31− scope: markup.heading
47+ scope: markup.heading.synopsis.man
32− with_prototype:
48+ embed: synopsis
33− - match: '(?={{section_heading}})'
49+ escape: '(?={{section_heading}})'
34− pop: true
35
50
36− - match: '^\S.*$'
51+ - match: '^(?:USAGE)'
37− scope: markup.heading
52+ scope: markup.heading.synopsis.man
53+ embed: synopsis
54+ escape: '(?={{section_heading}})'
38
55
56+ - match: '{{section_heading}}'
57+ scope: markup.heading.other.man
58+ embed: options # some man pages put command line options under the description heading
59+ escape: '(?={{section_heading}})'
60+
61+ function-call:
39− - match: '\b([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
62+ - match: '\b([A-Za-z0-9_\-]+\.)?([A-Za-z0-9_\-]+)(\()([^)]*)(\))'
63+ captures:
64+ 1: entity.name.function.man
65+ 2: entity.name.function.man
66+ 3: keyword.operator.man
67+ 4: constant.numeric.man
68+ 5: keyword.operator.man
69+
70+ env-var:
71+ - match: '(\$)(?!\d)(\w+)\b'
40 captures:
72 captures:
41− 1: entity.name.function
73+ 1: punctuation.definition.variable.man
42− 2: keyword.operator
43− 3: constant.numeric
74+ 2: constant.other.man
44− 4: keyword.operator
45
75
76+ options:
46 # command-line options like --option=value, --some-flag, or -x
77 # command-line options like --option=value, --some-flag, or -x
47− - match: '(?:[^a-zA-Z0-9_-]|^|\s)(--?[A-Za-z0-9][A-Za-z0-9-]*)(?:(=)?("?)([A-Za-z0-9]+)("?))?'
78+ - match: '^[ ]{7}(?=-)'
79+ push: expect-command-line-option
80+ - match: '(?:[^a-zA-Z0-9_-]|^|\s){{command_line_option}}'
81+ captures:
82+ 1: entity.name.command-line-option
83+ push:
84+ - match: '='
85+ scope: keyword.operator.man
86+ set:
87+ - match: '[^],.() ]+'
88+ scope: variable.parameter.man
89+ pop: true
90+ - match: $
91+ pop: true
92+ - match: ''
93+ pop: true
94+ - include: function-call
95+ - include: c-code
96+ - include: env-var
97+
98+ expect-command-line-option:
99+ - match: '[A-Za-z0-9-]+'
100+ scope: entity.name.command-line-option.man
101+ - match: '(\[)(=)'
102+ captures:
103+ 1: punctuation.section.brackets.begin.man
104+ 2: keyword.operator.man
105+ push: [command-line-option-or-pipe, expect-parameter]
106+ - match: '\['
107+ push:
108+ - meta_scope: entity.name.command-line-option.man
109+ - match: '\]'
110+ pop: true
111+ - match: '='
112+ scope: keyword.operator.man
113+ push: expect-parameter
114+ - match: (?=.*\.)
115+ pop: true
116+ - match: '\s'
117+ push: expect-parameter
118+ - match: '(,)\s*'
119+ captures:
120+ 1: punctuation.separator.man
121+ - match: $|(?=\])
122+ pop: true
123+
124+ expect-parameter:
125+ - match: '[A-Za-z0-9-]+'
126+ scope: variable.parameter.man
127+ - match: (?=\s+\|)
128+ pop: true
129+ - match: \|
130+ scope: keyword.operator.logical.man
131+ - match: '\['
132+ scope: punctuation.section.brackets.begin.man
133+ push:
134+ - match: '\]'
135+ scope: punctuation.section.brackets.end.man
136+ pop: true
137+ - include: expect-parameter
138+ - match: '$|(?=[],]|{{command_line_option}})'
139+ pop: true
140+
141+ c-code:
142+ - match: '^(?=\s+(?:#include\b|#define\b|/\*|struct\s+(\w+\s*)?\{))'
143+ embed: scope:source.c
144+ #embed_scope: source.c.embedded.man
145+ #escape: ^(?!#|\1|\s*(?:$|/\*|#include\b|#define\b))
146+ escape: ^(?=\s*(?:\(.*\.\)\s*$|[A-Z](?![A-Z])))
147+
148+ synopsis:
149+ - include: c-code
150+ - match: \[
151+ scope: punctuation.section.brackets.begin.man
152+ push: command-line-option-or-pipe
153+ - include: options
154+
155+ command-line-option-or-pipe:
156+ - match: (\|)\s*
48 captures:
157 captures:
49− 1: entity.name
50− 2: keyword.operator
158+ 1: keyword.operator.logical.man
51− 3: punctuation.definition.string.begin
159+ #- match: (?={{command_line_option}})
52− 4: variable.parameter
160+ - match: \w+-\w+
53− 3: punctuation.definition.string.end
161+ - match: (?=-)
162+ push:
163+ - match: (?=\s*\|)
164+ pop: true
165+ - include: expect-command-line-option
166+ - match: \]
167+ scope: punctuation.section.brackets.end.man
168+ pop: true
169+ - match: \[
170+ scope: punctuation.section.brackets.begin.man
171+ push: command-line-option-or-pipe
assets/syntaxes/02_Extra/MediaWikinew file+1

Submodule changed.

assets/syntaxes/02_Extra/Nginxnew file+1

Submodule changed.

assets/syntaxes/02_Extra/Nim.sublime-syntax+1
@@ -5,6 +5,7 @@ name: Nim
5file_extensions:
5file_extensions:
6 - nim
6 - nim
7 - nims
7 - nims
8+ - nimble
8scope: source.nim
9scope: source.nim
9contexts:
10contexts:
10 main:
11 main:
assets/syntaxes/02_Extra/Ninjanew file+1

Submodule changed.

assets/syntaxes/02_Extra/Ninja.sublime-syntaxnew file+52
@@ -0,0 +1,52 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Ninja
5+file_extensions:
6+ - ninja
7+scope: source.ninja
8+contexts:
9+ main:
10+ - match: (#).*$\n?
11+ comment: Comment line.
12+ scope: comment.line.number-sign.ninja
13+ captures:
14+ 1: punctuation.definition.comment.ninja
15+ - match: ^(rule)\b
16+ comment: Rule keyword and keywords for a rule.
17+ captures:
18+ 1: keyword.other.ninja
19+ push:
20+ - match: ^(?=\S)
21+ pop: true
22+ - include: main
23+ - match: \b(?:command|deps|depfile|description|generator|pool|restat|rspfile|rspfile_content)\b
24+ scope: keyword.other.ninja
25+ - match: ^(pool)\b
26+ comment: Pool keyword and keywords for a pool.
27+ captures:
28+ 1: keyword.other.ninja
29+ push:
30+ - match: ^(?=\S)
31+ pop: true
32+ - include: main
33+ - match: \b(?:depth)\b
34+ scope: keyword.other.ninja
35+ - match: ^(?:build|rule|default|include|subninja)\b
36+ comment: Other Keywords.
37+ scope: keyword.other.ninja
38+ - match: '(?:[=:]|\|{1,2})(?=\s)'
39+ comment: Operators for variable assignment (=), rule definition (:), implicit (|) and order only (||) dependencies.
40+ scope: keyword.operator.ninja
41+ - match: \$$
42+ comment: Line wrap.
43+ scope: keyword.operator.ninja
44+ - match: \$\$
45+ comment: Dollar literal.
46+ scope: keyword.operator.ninja
47+ - match: '\$[[:alnum:]_-]+'
48+ comment: Simple variables, e.g. $var.
49+ scope: variable.other.ninja
50+ - match: '\${[[:alnum:]_.-]+}'
51+ comment: "Variables, e.g. ${some.var.name}."
52+ scope: variable.other.ninja
assets/syntaxes/02_Extra/PowerShell+1−1

Submodule changed.

assets/syntaxes/02_Extra/PowerShell.sublime-syntax+58−48
@@ -24,7 +24,7 @@ contexts:
24 - include: commands
24 - include: commands
25 - include: commentLine
25 - include: commentLine
26 - include: variable
26 - include: variable
27− - include: interpolatedStringContent
27+ - include: subexpression
28 - include: function
28 - include: function
29 - include: attribute
29 - include: attribute
30 - include: UsingDirective
30 - include: UsingDirective
@@ -33,32 +33,38 @@ contexts:
33 - include: doubleQuotedString
33 - include: doubleQuotedString
34 - include: scriptblock
34 - include: scriptblock
35 - include: doubleQuotedStringEscapes
35 - include: doubleQuotedStringEscapes
36− - match: (?<!')'
36+ - match: '[''\x{2018}-\x{201B}]'
37 captures:
37 captures:
38 0: punctuation.definition.string.begin.powershell
38 0: punctuation.definition.string.begin.powershell
39 push:
39 push:
40 - meta_scope: string.quoted.single.powershell
40 - meta_scope: string.quoted.single.powershell
41− - match: "'(?!')"
41+ - match: '[''\x{2018}-\x{201B}]{2}'
42+ scope: constant.character.escape.powershell
43+ - match: '[''\x{2018}-\x{201B}]'
42 captures:
44 captures:
43 0: punctuation.definition.string.end.powershell
45 0: punctuation.definition.string.end.powershell
44 pop: true
46 pop: true
45− - match: "''"
46− scope: constant.character.escape.powershell
47− - match: \@"(?=$)
47+ - match: '(@["\x{201C}-\x{201E}])\s*$'
48+ captures:
49+ 1: punctuation.definition.string.begin.powershell
48 push:
50 push:
49 - meta_scope: string.quoted.double.heredoc.powershell
51 - meta_scope: string.quoted.double.heredoc.powershell
50− - match: ^"@
52+ - match: '^["\x{201C}-\x{201E}]@'
53+ captures:
54+ 0: punctuation.definition.string.end.powershell
51 pop: true
55 pop: true
52 - include: variableNoProperty
56 - include: variableNoProperty
53 - include: doubleQuotedStringEscapes
57 - include: doubleQuotedStringEscapes
54 - include: interpolation
58 - include: interpolation
55− - match: \@'(?=$)
59+ - match: '(@[''\x{2018}-\x{201B}])\s*$'
60+ captures:
61+ 1: punctuation.definition.string.begin.powershell
56 push:
62 push:
57 - meta_scope: string.quoted.single.heredoc.powershell
63 - meta_scope: string.quoted.single.heredoc.powershell
58− - match: ^'@
64+ - match: '^[''\x{2018}-\x{201B}]@'
65+ captures:
66+ 0: punctuation.definition.string.end.powershell
59 pop: true
67 pop: true
60− - match: "''"
61− scope: constant.character.escape.powershell
62 - include: numericConstant
68 - include: numericConstant
63 - match: (@)(\()
69 - match: (@)(\()
64 captures:
70 captures:
@@ -71,11 +77,12 @@ contexts:
71 0: punctuation.section.group.end.powershell
77 0: punctuation.section.group.end.powershell
72 pop: true
78 pop: true
73 - include: main
79 - include: main
74− - match: (\$)(\()
80+ - match: ((\$))(\()
75 comment: "TODO: move to repo; make recursive."
81 comment: "TODO: move to repo; make recursive."
76 captures:
82 captures:
77− 1: punctuation.definition.variable.powershell
83+ 1: keyword.other.substatement.powershell
84+ 2: punctuation.definition.subexpression.powershell
78− 2: punctuation.section.group.begin.powershell
85+ 3: punctuation.section.group.begin.powershell
79 push:
86 push:
80 - meta_scope: meta.group.complex.subexpression.powershell
87 - meta_scope: meta.group.complex.subexpression.powershell
81 - match: \)
88 - match: \)
@@ -85,7 +92,7 @@ contexts:
85 - include: main
92 - include: main
86 - match: '(\b(([A-Za-z0-9\-_\.]+)\.(?i:exe|com|cmd|bat))\b)'
93 - match: '(\b(([A-Za-z0-9\-_\.]+)\.(?i:exe|com|cmd|bat))\b)'
87 scope: support.function.powershell
94 scope: support.function.powershell
88− - match: (?<!\w|-|\.)((?i:begin|break|catch|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\?)(?!\w)
95+ - match: (?<!\w|-|\.)((?i:begin|break|catch|clean|continue|data|default|define|do|dynamicparam|else|elseif|end|exit|finally|for|from|if|in|inlinescript|parallel|param|process|return|sequence|switch|throw|trap|try|until|var|while)|%|\?)(?!\w)
89 scope: keyword.control.powershell
96 scope: keyword.control.powershell
90 - match: '(?<!\w|-|[^\)]\.)((?i:(foreach|where)(?!-object))|%|\?)(?!\w)'
97 - match: '(?<!\w|-|[^\)]\.)((?i:(foreach|where)(?!-object))|%|\?)(?!\w)'
91 scope: keyword.control.powershell
98 scope: keyword.control.powershell
@@ -135,7 +142,7 @@ contexts:
135 - meta_scope: meta.requires.powershell
142 - meta_scope: meta.requires.powershell
136 - match: $
143 - match: $
137 pop: true
144 pop: true
138− - match: \-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version)
145+ - match: \-(?i:Modules|PSSnapin|RunAsAdministrator|ShellId|Version|Assembly|PSEdition)
139 scope: keyword.other.powershell
146 scope: keyword.other.powershell
140 - match: '(?<!-)\b\p{L}+|\d+(?:\.\d+)*'
147 - match: '(?<!-)\b\p{L}+|\d+(?:\.\d+)*'
141 scope: variable.parameter.powershell
148 scope: variable.parameter.powershell
@@ -187,51 +194,53 @@ contexts:
187 comment: Builtin cmdlets with reserved verbs
194 comment: Builtin cmdlets with reserved verbs
188 scope: support.function.powershell
195 scope: support.function.powershell
189 commentEmbeddedDocs:
196 commentEmbeddedDocs:
190− - match: ^(?i:(?:\s?|#)+(\.)(COMPONENT|DESCRIPTION|EXAMPLE|EXTERNALHELP|FORWARDHELPCATEGORY|FORWARDHELPTARGETNAME|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|REMOTEHELPRUNSPACE|ROLE|SYNOPSIS))
197+ - match: (?:^|\G)(?i:\s*(\.)(COMPONENT|DESCRIPTION|EXAMPLE|FUNCTIONALITY|INPUTS|LINK|NOTES|OUTPUTS|ROLE|SYNOPSIS))\s*$
198+ comment: these embedded doc keywords do not support arguments, must be the only thing on the line
191 scope: comment.documentation.embedded.powershell
199 scope: comment.documentation.embedded.powershell
192 captures:
200 captures:
193 1: constant.string.documentation.powershell
201 1: constant.string.documentation.powershell
194 2: keyword.operator.documentation.powershell
202 2: keyword.operator.documentation.powershell
195− - match: '(?i:\s?(\.)(PARAMETER|FORWARDHELPTARGETNAME|FORWARDHELPCATEGORY|REMOTEHELPRUNSPACE|EXTERNALHELP)\s+([a-z0-9-_]+))'
203+ - match: (?:^|\G)(?i:\s*(\.)(EXTERNALHELP|FORWARDHELP(?:CATEGORY|TARGETNAME)|PARAMETER|REMOTEHELPRUNSPACE))\s+(.+?)\s*$
204+ comment: these embedded doc keywords require arguments though the type required may be inconsistent, they may not all be able to use the same argument match
196 scope: comment.documentation.embedded.powershell
205 scope: comment.documentation.embedded.powershell
197 captures:
206 captures:
198 1: constant.string.documentation.powershell
207 1: constant.string.documentation.powershell
199 2: keyword.operator.documentation.powershell
208 2: keyword.operator.documentation.powershell
200 3: keyword.operator.documentation.powershell
209 3: keyword.operator.documentation.powershell
201 commentLine:
210 commentLine:
202− - match: '(?<![`\\-])#'
211+ - match: '(?<![`\\-])(#)#*'
203 captures:
212 captures:
204− 0: punctuation.definition.comment.powershell
213+ 1: punctuation.definition.comment.powershell
205 push:
214 push:
206 - meta_scope: comment.line.powershell
215 - meta_scope: comment.line.powershell
207 - match: $\n?
216 - match: $\n?
208 captures:
217 captures:
209− 0: punctuation.definition.comment.powershell
218+ 1: punctuation.definition.comment.powershell
210 pop: true
219 pop: true
211 - include: commentEmbeddedDocs
220 - include: commentEmbeddedDocs
212 - include: RequiresDirective
221 - include: RequiresDirective
213 doubleQuotedString:
222 doubleQuotedString:
214− - match: (?<!(?<!`)")"
223+ - match: '["\x{201C}-\x{201E}]'
215 captures:
224 captures:
216 0: punctuation.definition.string.begin.powershell
225 0: punctuation.definition.string.begin.powershell
217 push:
226 push:
218 - meta_scope: string.quoted.double.powershell
227 - meta_scope: string.quoted.double.powershell
219− - match: '"(?!")'
220− captures:
221− 0: punctuation.definition.string.end.powershell
222− pop: true
223 - match: '(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,64}\b'
228 - match: '(?i)\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,64}\b'
224 - include: variableNoProperty
229 - include: variableNoProperty
225 - include: doubleQuotedStringEscapes
230 - include: doubleQuotedStringEscapes
231+ - match: '["\x{201C}-\x{201E}]{2}'
232+ scope: constant.character.escape.powershell
226 - include: interpolation
233 - include: interpolation
227 - match: '`\s*$'
234 - match: '`\s*$'
228 scope: keyword.other.powershell
235 scope: keyword.other.powershell
236+ - match: '["\x{201C}-\x{201E}]'
237+ captures:
238+ 0: punctuation.definition.string.end.powershell
239+ pop: true
229 doubleQuotedStringEscapes:
240 doubleQuotedStringEscapes:
230− - match: '`[`0abefnrtv"''$]'
241+ - match: '`[`0abefnrtv''"\x{2018}-\x{201E}$]'
231 scope: constant.character.escape.powershell
242 scope: constant.character.escape.powershell
232 - include: unicodeEscape
243 - include: unicodeEscape
233− - match: '""'
234− scope: constant.character.escape.powershell
235 function:
244 function:
236 - match: '^(?:\s*+)(?i)(function|filter|configuration|workflow)\s+(?:(global|local|script|private):)?((?:\p{L}|\d|_|-|\.)+)'
245 - match: '^(?:\s*+)(?i)(function|filter|configuration|workflow)\s+(?:(global|local|script|private):)?((?:\p{L}|\d|_|-|\.)+)'
237 captures:
246 captures:
@@ -263,33 +272,23 @@ contexts:
263 4: keyword.operator.assignment.powershell
272 4: keyword.operator.assignment.powershell
264 - include: scriptblock
273 - include: scriptblock
265 - include: main
274 - include: main
266− interpolatedStringContent:
267− - match: \(
268− captures:
269− 0: punctuation.section.group.begin.powershell
270− push:
271− - meta_content_scope: interpolated.simple.source.powershell
272− - match: \)
273− captures:
274− 0: punctuation.section.group.end.powershell
275− pop: true
276− - include: main
277− - include: interpolation
278− - include: interpolatedStringContent
279 interpolation:
275 interpolation:
280− - match: (\$)(\()
276+ - match: (((\$)))((\())
281 captures:
277 captures:
282− 1: punctuation.definition.variable.powershell
278+ 1: keyword.other.substatement.powershell
279+ 2: punctuation.definition.substatement.powershell
280+ 3: punctuation.section.embedded.substatement.begin.powershell
283− 2: punctuation.section.group.begin.powershell
281+ 4: punctuation.section.group.begin.powershell
282+ 5: punctuation.section.embedded.substatement.begin.powershell
284 push:
283 push:
284+ - meta_scope: meta.embedded.substatement.powershell
285 - meta_content_scope: interpolated.complex.source.powershell
285 - meta_content_scope: interpolated.complex.source.powershell
286− - match: \)
286+ - match: (\))
287 captures:
287 captures:
288 0: punctuation.section.group.end.powershell
288 0: punctuation.section.group.end.powershell
289+ 1: punctuation.section.embedded.substatement.end.powershell
289 pop: true
290 pop: true
290 - include: main
291 - include: main
291− - include: interpolation
292− - include: interpolatedStringContent
293 numericConstant:
292 numericConstant:
294 - match: '(?<!\w)([-+]?0(?:x|X)[0-9a-fA-F_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\b'
293 - match: '(?<!\w)([-+]?0(?:x|X)[0-9a-fA-F_]+(?:U|u|L|l|UL|Ul|uL|ul|LU|Lu|lU|lu)?)((?i:[kmgtp]b)?)\b'
295 captures:
294 captures:
@@ -330,6 +329,17 @@ contexts:
330 0: punctuation.section.braces.end.powershell
329 0: punctuation.section.braces.end.powershell
331 pop: true
330 pop: true
332 - include: main
331 - include: main
332+ subexpression:
333+ - match: \(
334+ captures:
335+ 0: punctuation.section.group.begin.powershell
336+ push:
337+ - meta_scope: meta.group.simple.subexpression.powershell
338+ - match: \)
339+ captures:
340+ 0: punctuation.section.group.end.powershell
341+ pop: true
342+ - include: main
333 type:
343 type:
334 - match: '\['
344 - match: '\['
335 captures:
345 captures:
assets/syntaxes/02_Extra/Racketnew file+1

Submodule changed.

assets/syntaxes/02_Extra/Racket.sublime-syntaxnew file+52
@@ -0,0 +1,52 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: Racket
5+file_extensions:
6+ - rkt
7+scope: source.racket
8+contexts:
9+ main:
10+ - match: '[^\\](\"[^\"]*\")'
11+ captures:
12+ 1: string.quoted.double.source.racket
13+ - match: '\((define)\s+([a-zA-Z0-9_\-?\+^]+)\s*'
14+ scope: meta.variable.source.racket
15+ captures:
16+ 1: keyword.source.racket
17+ 2: entity.name.variable.source.racket
18+ - match: '\((define)\s+\(([a-zA-Z0-9_\-?\+^]+)\s*'
19+ scope: meta.function.source.racket
20+ captures:
21+ 1: keyword.source.racket
22+ 2: entity.name.function
23+ - match: '\((struct)\s+([a-zA-Z0-9_\-?\+^]+)\s+'
24+ scope: meta.struct.source.racket
25+ captures:
26+ 1: keyword.source.racket
27+ 2: entity.name.type
28+ - match: '[\s\(](if|lambda|cond|define|type-case|let|letrec|let!|\#lang|require|test|else|first|rest|define-type|define-type-alias|define-struct|not|local|error|lang)[\s\)]'
29+ scope: meta.keywords.source.racket
30+ captures:
31+ 1: keyword.source.racket
32+ - match: '[\s\(](true|false|empty|null)[\s\)]'
33+ captures:
34+ 1: constant.language.source.racket
35+ - match: '[\s\(\[\{](#t|#true|#f|#false)[\s\)\]\}]'
36+ captures:
37+ 1: constant.language.source.racket
38+ - match: '(#\\[a-zA-Z0-9_\-?\+\.\!\"]+)'
39+ captures:
40+ 1: constant.language.source.racket
41+ - match: '\b(0|([1-9][0-9_]*))\b'
42+ scope: constant.numeric.integer.source.racket
43+ - match: ;
44+ push:
45+ - meta_scope: comment.line.documentation.source.racket
46+ - match: $\n
47+ pop: true
48+ - match: '#\|'
49+ push:
50+ - meta_scope: comment.block.source.racket
51+ - match: '\|#'
52+ pop: true
assets/syntaxes/02_Extra/Robot.sublime-syntax+2−1
@@ -1,9 +1,10 @@
1%YAML 1.2
1%YAML 1.2
2---
2---
3# http://www.sublimetext.com/docs/3/syntax.html
3# http://www.sublimetext.com/docs/3/syntax.html
4−name: Robot Framework syntax highlighting.
4+name: Robot Framework
5file_extensions:
5file_extensions:
6 - robot
6 - robot
7+ - resource
7scope: source.robot
8scope: source.robot
8contexts:
9contexts:
9 main:
10 main:
assets/syntaxes/02_Extra/SCSS_Sass+1−1

Submodule changed.

assets/syntaxes/02_Extra/SML.sublime-syntaxnew file+33
@@ -0,0 +1,33 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: SML
5+file_extensions:
6+ - sml
7+ - cm
8+ - sig
9+scope: source.sml
10+contexts:
11+ main:
12+ - match: \b(EQUAL|GREATER|LESS|NONE|SOME|abstraction|abstype|and|andalso|array|as|before|bool|case|char|datatype|do|else|end|eqtype|exception|exn|false|fn|fun|functor|handle|if|in|include|infix|infixr|int|let|list|local|nil|nonfix|not|o|of|op|open|option|orelse|overload|print|raise|real|rec|ref|sharing|sig|signature|string|struct|structure|substring|then|true|type|unit|val|vector|where|while|with|withtype|word)\b
13+ comment: SML keywords
14+ scope: keyword.source.sml
15+ - match: '\b[0-9]+\b'
16+ comment: Numeric constants
17+ scope: constant.numeric.sml
18+ - match: '\b[A-Z]([A-z0-9]*)\b'
19+ comment: Built in types
20+ scope: support.type.sml
21+ - match: '"(\\"|[^"])*"'
22+ comment: String constant
23+ scope: string.sml
24+ - match: \(\*
25+ comment: Comment
26+ push:
27+ - meta_scope: comment.sml
28+ - match: \*\)
29+ pop: true
30+ - match: '(\(\)|=>|::|\[\]|->|:>)'
31+ comment: Character
32+ scope: constant.character.sml
33+
assets/syntaxes/02_Extra/Slimnew file+1

Submodule changed.

assets/syntaxes/02_Extra/Slim.sublime-syntaxnew file+306
@@ -0,0 +1,306 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/syntax.html
4+name: Ruby Slim
5+file_extensions:
6+ - slim
7+ - skim
8+scope: text.slim
9+contexts:
10+ main:
11+ - match: ^(\s*)(ruby):$
12+ captures:
13+ 2: constant.language.name.ruby.filter.slim
14+ push:
15+ - meta_scope: text.ruby.filter.slim
16+ - match: ^(?!(\1\s)|\s*$)
17+ pop: true
18+ - include: scope:source.ruby
19+ - match: ^(\s*)(javascript):$
20+ captures:
21+ 2: constant.language.name.javascript.filter.slim
22+ push:
23+ - meta_scope: source.js.filter.slim
24+ - match: ^(?!(\1\s)|\s*$)
25+ pop: true
26+ - include: scope:source.js
27+ - match: ^(---)\s*\n
28+ captures:
29+ 1: storage.frontmatter.slim
30+ push:
31+ - meta_scope: source.yaml.meta.slim
32+ - match: ^(---)\s*\n
33+ captures:
34+ 1: storage.frontmatter.slim
35+ pop: true
36+ - include: scope:source.yaml
37+ - match: ^(\s*)(coffee):$
38+ captures:
39+ 2: constant.language.name.coffeescript.filter.slim
40+ push:
41+ - meta_scope: text.coffeescript.filter.slim
42+ - match: ^(?!(\1\s)|\s*$)
43+ pop: true
44+ - include: scope:source.coffee
45+ - match: ^(\s*)(markdown):$
46+ captures:
47+ 2: constant.language.name.markdown.filter.slim
48+ push:
49+ - meta_scope: text.markdown.filter.slim
50+ - match: ^(?!(\1\s)|\s*$)
51+ pop: true
52+ - include: scope:text.html.markdown
53+ - match: ^(\s*)(css):$
54+ captures:
55+ 2: constant.language.name.css.filter.slim
56+ push:
57+ - meta_scope: text.css.filter.slim
58+ - match: ^(?!(\1\s)|\s*$)
59+ pop: true
60+ - include: scope:source.css
61+ - match: ^(\s*)(sass):$
62+ captures:
63+ 2: constant.language.name.sass.filter.slim
64+ push:
65+ - meta_scope: text.sass.filter.slim
66+ - match: ^(?!(\1\s)|\s*$)
67+ pop: true
68+ - include: scope:source.sass
69+ - match: ^(\s*)(scss):$
70+ captures:
71+ 2: constant.language.name.scss.filter.slim
72+ push:
73+ - meta_scope: text.scss.filter.slim
74+ - match: ^(?!(\1\s)|\s*$)
75+ pop: true
76+ - include: scope:source.scss
77+ - match: ^(\s*)(less):$
78+ captures:
79+ 2: constant.language.name.less.filter.slim
80+ push:
81+ - meta_scope: text.less.filter.slim
82+ - match: ^(?!(\1\s)|\s*$)
83+ pop: true
84+ - include: scope:source.less
85+ - match: ^(\s*)(erb):$
86+ captures:
87+ 2: constant.language.name.erb.filter.slim
88+ push:
89+ - meta_scope: text.erb.filter.slim
90+ - match: ^(?!(\1\s)|\s*$)
91+ pop: true
92+ - include: scope:source.erb
93+ - match: ^(! )($|\s.*)
94+ scope: meta.prolog.slim
95+ captures:
96+ 1: punctuation.definition.prolog.slim
97+ - match: ^(\s*)(/)\s*.*$
98+ captures:
99+ 2: comment.line.slash.slim
100+ push:
101+ - meta_scope: comment.block.slim
102+ - match: ^(?!(\1\s)|\s*$)
103+ pop: true
104+ - match: ^\s*(?=-)
105+ push:
106+ - match: $
107+ pop: true
108+ - include: rubyline
109+ - match: (?==+|~)
110+ push:
111+ - match: $
112+ pop: true
113+ - include: rubyline
114+ - include: tag-attribute
115+ - include: embedded-ruby
116+ - match: ^(\s*)(\||')\s*
117+ comment: Verbatim text (can include HTML tags and copied lines)
118+ push:
119+ - match: ^(?!(\1\s)|\s*$)
120+ pop: true
121+ - include: scope:text.html.basic
122+ - include: embedded-ruby
123+ - match: '^\s*(\.|#|[-a-zA-Z0-9]+)([\w-]+)?'
124+ comment: '1 - dot OR hash OR any combination of word, number; 2 - OPTIONAL any combination of word, number, dash or underscore (following a . or'
125+ captures:
126+ 1: entity.name.tag.slim
127+ 2: entity.other.attribute-name.event.slim
128+ push:
129+ - meta_scope: meta.tag
130+ - match: '$|(?!\.|#|:|-|~|/|\}|\]|\*|\s?[\*\{])'
131+ captures:
132+ 1: entity.name.tag.slim
133+ 2: entity.other.attribute-name.event.slim
134+ pop: true
135+ - match: '(:[\w\d]+)+'
136+ comment: XML
137+ push:
138+ - meta_scope: entity.name.tag.slim
139+ - match: $|\s
140+ pop: true
141+ - match: '(:\s)(\.|#|[a-zA-Z0-9]+)([\w-]+)?'
142+ comment: Inline HTML / 1 - colon; 2 - dot OR hash OR any combination of word, number; 3 - OPTIONAL any combination of word, number, dash or underscore (following a . or
143+ captures:
144+ 1: punctuation.definition.tag.end.slim
145+ 2: entity.name.tag.slim
146+ 3: entity.other.attribute-name.event.slim
147+ push:
148+ - match: '$|(?!\.|#|=|-|~|/|\}|\]|\*|\s?[\*\{])'
149+ captures:
150+ 1: punctuation.definition.tag.end.slim
151+ 2: entity.name.tag.slim
152+ 3: entity.other.attribute-name.event.slim
153+ pop: true
154+ - include: root-class-id-tag
155+ - include: tag-attribute
156+ - match: '(\*\{)(?=.*\}|.*\|\s*$)'
157+ comment: Splat attributes
158+ captures:
159+ 1: punctuation.section.embedded.ruby
160+ push:
161+ - meta_scope: source.ruby.embedded.slim
162+ - match: '(\})|$|^(?!.*\|\s*$)'
163+ captures:
164+ 1: punctuation.section.embedded.ruby
165+ pop: true
166+ - include: embedded-ruby
167+ - include: root-class-id-tag
168+ - include: rubyline
169+ - match: /
170+ scope: punctuation.terminator.tag.slim
171+ - match: ^\s*(\\.)
172+ captures:
173+ 1: meta.escape.slim
174+ - match: ^\s*(?=\||')
175+ push:
176+ - match: $
177+ pop: true
178+ - include: embedded-ruby
179+ - include: scope:text.html.basic
180+ - match: '(?=<[\w\d\:]+)'
181+ comment: Inline and root-level HTML tags
182+ push:
183+ - match: $|\/\>
184+ pop: true
185+ - include: scope:text.html.basic
186+ continuation:
187+ - match: '([\\,])\s*\n'
188+ captures:
189+ 1: punctuation.separator.continuation.slim
190+ delimited-ruby-a:
191+ - match: '=\('
192+ push:
193+ - meta_scope: source.ruby.embedded.slim
194+ - match: \)(?=( \w|$))
195+ pop: true
196+ - include: scope:source.ruby.rails
197+ delimited-ruby-b:
198+ - match: '=\['
199+ push:
200+ - meta_scope: source.ruby.embedded.slim
201+ - match: '\](?=( \w|$))'
202+ pop: true
203+ - include: scope:source.ruby.rails
204+ delimited-ruby-c:
205+ - match: '=\{'
206+ push:
207+ - meta_scope: source.ruby.embedded.slim
208+ - match: '\}(?=( \w|$))'
209+ pop: true
210+ - include: scope:source.ruby.rails
211+ embedded-ruby:
212+ - match: '(?<!\\)#\{{1,2}'
213+ captures:
214+ 0: punctuation.section.embedded.ruby
215+ push:
216+ - meta_scope: source.ruby.embedded.html
217+ - match: '\}{1,2}'
218+ captures:
219+ 0: punctuation.section.embedded.ruby
220+ pop: true
221+ - include: scope:source.ruby.rails
222+ entities:
223+ - match: '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)'
224+ scope: constant.character.entity.html
225+ captures:
226+ 1: punctuation.definition.entity.html
227+ 3: punctuation.definition.entity.html
228+ - match: '&'
229+ scope: invalid.illegal.bad-ampersand.html
230+ interpolated-ruby:
231+ - match: '=(?=\b)'
232+ push:
233+ - meta_scope: source.ruby.embedded.html
234+ - match: \s|\w$
235+ pop: true
236+ root-class-id-tag:
237+ - match: '(\.|#)([\w\d\-]+)'
238+ captures:
239+ 1: punctuation.separator.key-value.html
240+ 2: entity.other.attribute-name.html
241+ rubyline:
242+ - match: (==|=)(<>|><|<'|'<|<|>)?|-
243+ comment: Hack to thwart Sublime's Ruby highlighter. It thinks do without a variable continues the next line (this can be muted with a / at the end of the line). For things like yields, do is unnecessary without an argument, so this hack will suffice
244+ push:
245+ - meta_scope: meta.line.ruby.slim
246+ - meta_content_scope: source.ruby.embedded.slim
247+ - match: (do\s*\n$)|(?<!\\|,|,\n|\\\n)$
248+ captures:
249+ 1: keyword.control.start-block.ruby
250+ pop: true
251+ - match: '#.*$'
252+ comment: Hack to let ruby comments work in this context properly
253+ scope: comment.line.number-sign.ruby
254+ - include: continuation
255+ - include: scope:source.ruby.rails
256+ string-double-quoted:
257+ - match: (")(?=.*")
258+ captures:
259+ 0: punctuation.definition.string.begin.html
260+ push:
261+ - meta_scope: string.quoted.double.html
262+ - meta_content_scope: meta.toc-list.id.html
263+ - match: '"'
264+ captures:
265+ 0: punctuation.definition.string.end.html
266+ pop: true
267+ - include: embedded-ruby
268+ - include: entities
269+ string-single-quoted:
270+ - match: (')(?=.*')
271+ captures:
272+ 0: punctuation.definition.string.begin.html
273+ push:
274+ - meta_scope: string.quoted.single.html
275+ - meta_content_scope: meta.toc-list.id.html
276+ - match: "'"
277+ captures:
278+ 0: punctuation.definition.string.end.html
279+ pop: true
280+ - include: embedded-ruby
281+ - include: entities
282+ tag-attribute:
283+ - match: '([\w.#_-]+)(=)(?!\s)(true|false|nil)?(\s*\(|\{)?'
284+ captures:
285+ 1: entity.other.attribute-name.event.slim
286+ 2: punctuation.separator.key-value.html
287+ 3: constant.language.slim
288+ push:
289+ - meta_scope: meta.attribute-with-value.slim
290+ - match: '\}|\)|$'
291+ captures:
292+ 1: entity.other.attribute-name.event.slim
293+ 2: punctuation.separator.key-value.html
294+ 3: constant.language.slim
295+ pop: true
296+ - include: tag-stuff
297+ - include: string-double-quoted
298+ - include: string-single-quoted
299+ tag-stuff:
300+ - include: tag-attribute
301+ - include: interpolated-ruby
302+ - include: delimited-ruby-a
303+ - include: delimited-ruby-b
304+ - include: delimited-ruby-c
305+ - include: rubyline
306+ - include: embedded-ruby
assets/syntaxes/02_Extra/Stylus.sublime-syntax+2−2
@@ -197,7 +197,7 @@ contexts:
197 scope: entity.other.attribute-name.stylus
197 scope: entity.other.attribute-name.stylus
198 - match: |-
198 - match: |-
199 (?x) # multi-line regex definition mode
199 (?x) # multi-line regex definition mode
200− (?<=^|;|{)\s* # starts after begining of line, '{' or ';''
200+ (?<=^|;|{)\s* # starts after beginning of line, '{' or ';''
201 (?= # lookahead for
201 (?= # lookahead for
202 (
202 (
203 [a-zA-Z0-9_-] # then a letter
203 [a-zA-Z0-9_-] # then a letter
@@ -207,7 +207,7 @@ contexts:
207 (/\*.*?\*/) # comment
207 (/\*.*?\*/) # comment
208 )+
208 )+
209
209
210− \s*[:\s]\s* # value is separted by colon or space
210+ \s*[:\s]\s* # value is separated by colon or space
211
211
212 (?!(\s*\{)) # if there are only spaces afterwards
212 (?!(\s*\{)) # if there are only spaces afterwards
213
213
assets/syntaxes/02_Extra/SublimeEthereumnew file+1

Submodule changed.

assets/syntaxes/02_Extra/SublimeJQnew file+1

Submodule changed.

assets/syntaxes/02_Extra/Sveltenew file+1

Submodule changed.

assets/syntaxes/02_Extra/Syslogdeleted−1

Submodule changed.

assets/syntaxes/02_Extra/SystemVerilognew file+1

Submodule changed.

assets/syntaxes/02_Extra/TOML+1−1

Submodule changed.

assets/syntaxes/02_Extra/Terraform+1−1

Submodule changed.

assets/syntaxes/02_Extra/TypeScript+1−1

Submodule changed.

assets/syntaxes/02_Extra/TypeScript.sublime-syntax+247−161
@@ -9,10 +9,7 @@ contexts:
9 main:
9 main:
10 - include: directives
10 - include: directives
11 - include: statements
11 - include: statements
12− - match: \A(#!).*(?=$)
12+ - include: shebang
13− scope: comment.line.shebang.ts
14− captures:
15− 1: punctuation.definition.comment.ts
16 comment:
13 comment:
17 - match: /\*\*(?!/)
14 - match: /\*\*(?!/)
18 captures:
15 captures:
@@ -47,7 +44,7 @@ contexts:
47 - match: (?=$)
44 - match: (?=$)
48 pop: true
45 pop: true
49 access-modifier:
46 access-modifier:
50− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|public|protected|private|readonly|static|declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
47+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|declare|override|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
51 scope: storage.modifier.ts
48 scope: storage.modifier.ts
52 after-operator-block-as-object-literal:
49 after-operator-block-as-object-literal:
53 - match: '(?<!\+\+|--)(?<=[:=(,\[?+!>]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)'
50 - match: '(?<!\+\+|--)(?<=[:=(,\[?+!>]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)'
@@ -109,7 +106,7 @@ contexts:
109 (?=
106 (?=
110 # sure shot arrow functions even if => is on new line
107 # sure shot arrow functions even if => is on new line
111 (
108 (
112− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
109+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
113 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
110 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
114 (
111 (
115 ([)]\s*:) | # ():
112 ([)]\s*:) | # ():
@@ -119,9 +116,9 @@ contexts:
119
116
120 # arrow function possible to detect only with => on same line
117 # arrow function possible to detect only with => on same line
121 (
118 (
122− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
119+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
123− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
120+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
124− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
121+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
125 \s*=> # arrow operator
122 \s*=> # arrow operator
126 )
123 )
127 )
124 )
@@ -271,7 +268,7 @@ contexts:
271 - include: decorator
268 - include: decorator
272 - match: (?<=:)\s*
269 - match: (?<=:)\s*
273 push:
270 push:
274− - match: '(?=\s|[;),}\]:\-\+]|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
271+ - match: '(?=\s|[;),}\]:\-\+]|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
275 pop: true
272 pop: true
276 - include: expression
273 - include: expression
277 - include: method-declaration
274 - include: method-declaration
@@ -320,7 +317,12 @@ contexts:
320 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
317 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
321 scope: keyword.control.loop.ts
318 scope: keyword.control.loop.ts
322 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
319 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
320+ captures:
323− scope: keyword.control.flow.ts
321+ 0: keyword.control.flow.ts
322+ push:
323+ - match: '(?=[;}]|$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
324+ pop: true
325+ - include: expression
324 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
326 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
325 scope: keyword.control.switch.ts
327 scope: keyword.control.switch.ts
326 - include: if-statement
328 - include: if-statement
@@ -765,7 +767,7 @@ contexts:
765 4: keyword.control.default.ts
767 4: keyword.control.default.ts
766 push:
768 push:
767 - meta_scope: meta.export.default.ts
769 - meta_scope: meta.export.default.ts
768− - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
770+ - match: (?=$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
769 pop: true
771 pop: true
770 - include: interface-declaration
772 - include: interface-declaration
771 - include: expression
773 - include: expression
@@ -775,7 +777,7 @@ contexts:
775 2: keyword.control.type.ts
777 2: keyword.control.type.ts
776 push:
778 push:
777 - meta_scope: meta.export.ts
779 - meta_scope: meta.export.ts
778− - match: (?=$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
780+ - match: (?=$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
779 pop: true
781 pop: true
780 - include: import-export-declaration
782 - include: import-export-declaration
781 expression:
783 expression:
@@ -788,11 +790,11 @@ contexts:
788 - include: string
790 - include: string
789 - include: decorator
791 - include: decorator
790 - include: destructuring-parameter
792 - include: destructuring-parameter
791− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
793+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|protected|private|readonly)\s+(?=(override|public|protected|private|readonly)\s+)'
792 captures:
794 captures:
793 1: storage.modifier.ts
795 1: storage.modifier.ts
794 - match: |-
796 - match: |-
795− (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
797+ (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
796 # function assignment |
798 # function assignment |
797 (=\s*(
799 (=\s*(
798 ((async\s+)?(
800 ((async\s+)?(
@@ -801,10 +803,10 @@ contexts:
801 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
803 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
802 )) |
804 )) |
803 ((async\s*)?(
805 ((async\s*)?(
804− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
806+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
805 # sure shot arrow functions even if => is on new line
807 # sure shot arrow functions even if => is on new line
806 (
808 (
807− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
809+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
808 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
810 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
809 (
811 (
810 ([)]\s*:) | # ():
812 ([)]\s*:) | # ():
@@ -814,9 +816,9 @@ contexts:
814
816
815 # arrow function possible to detect only with => on same line
817 # arrow function possible to detect only with => on same line
816 (
818 (
817− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
819+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
818− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
820+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
819− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
821+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
820 \s*=> # arrow operator
822 \s*=> # arrow operator
821 )
823 )
822 ))
824 ))
@@ -834,18 +836,18 @@ contexts:
834 ))
836 ))
835 )) |
837 )) |
836 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
838 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
837− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
839+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
838− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
840+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
839 ((async\s+)?(
841 ((async\s+)?(
840 (function\s*[(<*]) |
842 (function\s*[(<*]) |
841 (function\s+) |
843 (function\s+) |
842 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
844 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
843 )) |
845 )) |
844 ((async\s*)?(
846 ((async\s*)?(
845− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
847+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
846 # sure shot arrow functions even if => is on new line
848 # sure shot arrow functions even if => is on new line
847 (
849 (
848− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
850+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
849 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
851 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
850 (
852 (
851 ([)]\s*:) | # ():
853 ([)]\s*:) | # ():
@@ -855,9 +857,9 @@ contexts:
855
857
856 # arrow function possible to detect only with => on same line
858 # arrow function possible to detect only with => on same line
857 (
859 (
858− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
860+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
859− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
861+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
860− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
862+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
861 \s*=> # arrow operator
863 \s*=> # arrow operator
862 )
864 )
863 ))
865 ))
@@ -868,7 +870,7 @@ contexts:
868 3: entity.name.function.ts variable.language.this.ts
870 3: entity.name.function.ts variable.language.this.ts
869 4: entity.name.function.ts
871 4: entity.name.function.ts
870 5: keyword.operator.optional.ts
872 5: keyword.operator.optional.ts
871− - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*[:,]|$)'
873+ - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*[:,]|$)'
872 captures:
874 captures:
873 1: storage.modifier.ts
875 1: storage.modifier.ts
874 2: keyword.operator.rest.ts
876 2: keyword.operator.rest.ts
@@ -918,7 +920,7 @@ contexts:
918 captures:
920 captures:
919 1: keyword.control.as.ts
921 1: keyword.control.as.ts
920 push:
922 push:
921− - match: '(?=$|^|[;,:})\]]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
923+ - match: '(?=^|[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
922 pop: true
924 pop: true
923 - include: type
925 - include: type
924 - match: \.\.\.
926 - match: \.\.\.
@@ -933,10 +935,11 @@ contexts:
933 scope: keyword.operator.comparison.ts
935 scope: keyword.operator.comparison.ts
934 - match: <=|>=|<>|<|>
936 - match: <=|>=|<>|<|>
935 scope: keyword.operator.relational.ts
937 scope: keyword.operator.relational.ts
936− - match: '(\!)\s*(/)(?![/*])'
938+ - match: '(?<=[_$[:alnum:]])(\!)\s*(?:(/=)|(?:(/)(?![/*])))'
937 captures:
939 captures:
938 1: keyword.operator.logical.ts
940 1: keyword.operator.logical.ts
939− 2: keyword.operator.arithmetic.ts
941+ 2: keyword.operator.assignment.compound.ts
942+ 3: keyword.operator.arithmetic.ts
940 - match: \!|&&|\|\||\?\?
943 - match: \!|&&|\|\||\?\?
941 scope: keyword.operator.logical.ts
944 scope: keyword.operator.logical.ts
942 - match: \&|~|\^|\|
945 - match: \&|~|\^|\|
@@ -949,16 +952,18 @@ contexts:
949 scope: keyword.operator.increment.ts
952 scope: keyword.operator.increment.ts
950 - match: '%|\*|/|-|\+'
953 - match: '%|\*|/|-|\+'
951 scope: keyword.operator.arithmetic.ts
954 scope: keyword.operator.arithmetic.ts
952− - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(/)(?![/*]))'
955+ - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(?:(/=)|(?:(/)(?![/*]))))'
953 push:
956 push:
954− - match: '(/)(?!\*([^\*]|(\*[^\/]))*\*\/)'
957+ - match: '(?:(/=)|(?:(/)(?!\*([^\*]|(\*[^\/]))*\*\/)))'
955 captures:
958 captures:
956− 1: keyword.operator.arithmetic.ts
959+ 1: keyword.operator.assignment.compound.ts
960+ 2: keyword.operator.arithmetic.ts
957 pop: true
961 pop: true
958 - include: comment
962 - include: comment
959− - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
963+ - match: '(?<=[_$[:alnum:])\]])\s*(?:(/=)|(?:(/)(?![/*])))'
960 captures:
964 captures:
961− 1: keyword.operator.arithmetic.ts
965+ 1: keyword.operator.assignment.compound.ts
966+ 2: keyword.operator.arithmetic.ts
962 expressionPunctuations:
967 expressionPunctuations:
963 - include: punctuation-comma
968 - include: punctuation-comma
964 - include: punctuation-accessor
969 - include: punctuation-accessor
@@ -1024,10 +1029,10 @@ contexts:
1024 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1029 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1025 )) |
1030 )) |
1026 ((async\s*)?(
1031 ((async\s*)?(
1027− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1032+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1028 # sure shot arrow functions even if => is on new line
1033 # sure shot arrow functions even if => is on new line
1029 (
1034 (
1030− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1035+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1031 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1036 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1032 (
1037 (
1033 ([)]\s*:) | # ():
1038 ([)]\s*:) | # ():
@@ -1037,9 +1042,9 @@ contexts:
1037
1042
1038 # arrow function possible to detect only with => on same line
1043 # arrow function possible to detect only with => on same line
1039 (
1044 (
1040− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1045+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1041− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1046+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1042− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1047+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1043 \s*=> # arrow operator
1048 \s*=> # arrow operator
1044 )
1049 )
1045 ))
1050 ))
@@ -1057,18 +1062,18 @@ contexts:
1057 ))
1062 ))
1058 )) |
1063 )) |
1059 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1064 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1060− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
1065+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
1061− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1066+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1062 ((async\s+)?(
1067 ((async\s+)?(
1063 (function\s*[(<*]) |
1068 (function\s*[(<*]) |
1064 (function\s+) |
1069 (function\s+) |
1065 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1070 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1066 )) |
1071 )) |
1067 ((async\s*)?(
1072 ((async\s*)?(
1068− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1073+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1069 # sure shot arrow functions even if => is on new line
1074 # sure shot arrow functions even if => is on new line
1070 (
1075 (
1071− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1076+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1072 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1077 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1073 (
1078 (
1074 ([)]\s*:) | # ():
1079 ([)]\s*:) | # ():
@@ -1078,9 +1083,9 @@ contexts:
1078
1083
1079 # arrow function possible to detect only with => on same line
1084 # arrow function possible to detect only with => on same line
1080 (
1085 (
1081− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1086+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1082− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1087+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1083− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1088+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1084 \s*=> # arrow operator
1089 \s*=> # arrow operator
1085 )
1090 )
1086 ))
1091 ))
@@ -1121,29 +1126,47 @@ contexts:
1121 - include: type-parameters
1126 - include: type-parameters
1122 - include: function-parameters
1127 - include: function-parameters
1123 - include: return-type
1128 - include: return-type
1129+ - include: type-function-return-type
1124 - include: decl-block
1130 - include: decl-block
1125 - match: \*
1131 - match: \*
1126 scope: keyword.generator.asterisk.ts
1132 scope: keyword.generator.asterisk.ts
1127 function-call:
1133 function-call:
1128− - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1134+ - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
1129 push:
1135 push:
1130− - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1136+ - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
1131 pop: true
1137 pop: true
1132 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1138 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1133 push:
1139 push:
1134 - meta_scope: meta.function-call.ts
1140 - meta_scope: meta.function-call.ts
1135− - match: '(?=\s*(?:(\?\.\s*)|(\!))?(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\()'
1141+ - match: '(?=\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
1136 pop: true
1142 pop: true
1137− - include: support-function-call-identifiers
1143+ - include: function-call-target
1138− - match: '(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1139− scope: entity.name.function.ts
1140 - include: comment
1144 - include: comment
1141− - match: \?\.
1145+ - include: function-call-optionals
1142− scope: meta.function-call.ts punctuation.accessor.optional.ts
1143− - match: \!
1144− scope: meta.function-call.ts keyword.operator.definiteassignment.ts
1145 - include: type-arguments
1146 - include: type-arguments
1146 - include: paren-expression
1147 - include: paren-expression
1148+ - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))(<\s*[\{\[\(]\s*$))'
1149+ push:
1150+ - match: '(?<=\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))(<\s*[\{\[\(]\s*$))'
1151+ pop: true
1152+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1153+ push:
1154+ - meta_scope: meta.function-call.ts
1155+ - match: '(?=(<\s*[\{\[\(]\s*$))'
1156+ pop: true
1157+ - include: function-call-target
1158+ - include: comment
1159+ - include: function-call-optionals
1160+ - include: type-arguments
1161+ function-call-optionals:
1162+ - match: \?\.
1163+ scope: meta.function-call.ts punctuation.accessor.optional.ts
1164+ - match: \!
1165+ scope: meta.function-call.ts keyword.operator.definiteassignment.ts
1166+ function-call-target:
1167+ - include: support-function-call-identifiers
1168+ - match: '(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1169+ scope: entity.name.function.ts
1147 function-declaration:
1170 function-declaration:
1148 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1171 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1149 captures:
1172 captures:
@@ -1155,7 +1178,7 @@ contexts:
1155 6: meta.definition.function.ts entity.name.function.ts
1178 6: meta.definition.function.ts entity.name.function.ts
1156 push:
1179 push:
1157 - meta_scope: meta.function.ts
1180 - meta_scope: meta.function.ts
1158− - match: '(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1181+ - match: '(?=;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1159 pop: true
1182 pop: true
1160 - include: function-name
1183 - include: function-name
1161 - include: function-body
1184 - include: function-body
@@ -1207,10 +1230,10 @@ contexts:
1207 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1230 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1208 )) |
1231 )) |
1209 ((async\s*)?(
1232 ((async\s*)?(
1210− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1233+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1211 # sure shot arrow functions even if => is on new line
1234 # sure shot arrow functions even if => is on new line
1212 (
1235 (
1213− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1236+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1214 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1237 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1215 (
1238 (
1216 ([)]\s*:) | # ():
1239 ([)]\s*:) | # ():
@@ -1220,9 +1243,9 @@ contexts:
1220
1243
1221 # arrow function possible to detect only with => on same line
1244 # arrow function possible to detect only with => on same line
1222 (
1245 (
1223− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1246+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1224− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1247+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1225− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1248+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1226 \s*=> # arrow operator
1249 \s*=> # arrow operator
1227 )
1250 )
1228 ))
1251 ))
@@ -1246,7 +1269,7 @@ contexts:
1246 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1269 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1247 scope: variable.other.readwrite.ts
1270 scope: variable.other.readwrite.ts
1248 if-statement:
1271 if-statement:
1249− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\([^\(\)]*\)))*\))\s*(?!\{))'
1272+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))\s*(?!\{))'
1250 push:
1273 push:
1251 - match: '(?=;|$|\})'
1274 - match: '(?=;|$|\})'
1252 pop: true
1275 pop: true
@@ -1261,12 +1284,12 @@ contexts:
1261 0: meta.brace.round.ts
1284 0: meta.brace.round.ts
1262 pop: true
1285 pop: true
1263 - include: expression
1286 - include: expression
1264− - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
1287+ - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)*\])+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
1265 captures:
1288 captures:
1266 0: punctuation.definition.string.begin.ts
1289 0: punctuation.definition.string.begin.ts
1267 push:
1290 push:
1268 - meta_scope: string.regexp.ts
1291 - meta_scope: string.regexp.ts
1269− - match: "(/)([gimsuy]*)"
1292+ - match: "(/)([dgimsuy]*)"
1270 captures:
1293 captures:
1271 1: punctuation.definition.string.end.ts
1294 1: punctuation.definition.string.end.ts
1272 2: keyword.other.ts
1295 2: keyword.other.ts
@@ -1400,6 +1423,9 @@ contexts:
1400 2: keyword.operator.type.modifier.ts
1423 2: keyword.operator.type.modifier.ts
1401 3: keyword.operator.optional.ts
1424 3: keyword.operator.optional.ts
1402 pop: true
1425 pop: true
1426+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
1427+ captures:
1428+ 1: keyword.control.as.ts
1403 - include: type
1429 - include: type
1404 inline-tags:
1430 inline-tags:
1405 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
1431 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
@@ -1431,7 +1457,7 @@ contexts:
1431 captures:
1457 captures:
1432 1: keyword.operator.expression.instanceof.ts
1458 1: keyword.operator.expression.instanceof.ts
1433 push:
1459 push:
1434− - match: '(?<=\))|(?=[;),}\]:?]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1460+ - match: '(?<=\))|(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|(([\&\~\^\|]\s*)?[_$[:alpha:]][_$[:alnum:]]*\s+instanceof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1435 pop: true
1461 pop: true
1436 - include: type
1462 - include: type
1437 interface-declaration:
1463 interface-declaration:
@@ -1490,25 +1516,27 @@ contexts:
1490 - include: this-literal
1516 - include: this-literal
1491 - include: super-literal
1517 - include: super-literal
1492 method-declaration:
1518 method-declaration:
1493− - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1519+ - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1494 captures:
1520 captures:
1495 1: storage.modifier.ts
1521 1: storage.modifier.ts
1496 2: storage.modifier.ts
1522 2: storage.modifier.ts
1497− 3: storage.modifier.async.ts
1523+ 3: storage.modifier.ts
1498− 4: storage.type.ts
1524+ 4: storage.modifier.async.ts
1525+ 5: storage.type.ts
1499 push:
1526 push:
1500 - meta_scope: meta.method.declaration.ts
1527 - meta_scope: meta.method.declaration.ts
1501 - match: '(?=\}|;|,|$)|(?<=\})'
1528 - match: '(?=\}|;|,|$)|(?<=\})'
1502 pop: true
1529 pop: true
1503 - include: method-declaration-name
1530 - include: method-declaration-name
1504 - include: function-body
1531 - include: function-body
1505− - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])'
1532+ - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])'
1506 captures:
1533 captures:
1507 1: storage.modifier.ts
1534 1: storage.modifier.ts
1508 2: storage.modifier.ts
1535 2: storage.modifier.ts
1509− 3: storage.modifier.async.ts
1536+ 3: storage.modifier.ts
1537+ 4: storage.modifier.async.ts
1510− 4: keyword.operator.new.ts
1538+ 5: keyword.operator.new.ts
1511− 5: keyword.generator.asterisk.ts
1539+ 6: keyword.generator.asterisk.ts
1512 push:
1540 push:
1513 - meta_scope: meta.method.declaration.ts
1541 - meta_scope: meta.method.declaration.ts
1514 - match: '(?=\}|;|,|$)|(?<=\})'
1542 - match: '(?=\}|;|,|$)|(?<=\})'
@@ -1516,7 +1544,7 @@ contexts:
1516 - include: method-declaration-name
1544 - include: method-declaration-name
1517 - include: function-body
1545 - include: function-body
1518 - match: |-
1546 - match: |-
1519− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1547+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1520 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1548 (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1521 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1549 (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1522 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1550 (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
@@ -1525,13 +1553,14 @@ contexts:
1525 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1553 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1526 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1554 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1527 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1555 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1528− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1556+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1529 captures:
1557 captures:
1530 1: storage.modifier.ts
1558 1: storage.modifier.ts
1531 2: storage.modifier.ts
1559 2: storage.modifier.ts
1532− 3: storage.modifier.async.ts
1560+ 3: storage.modifier.ts
1561+ 4: storage.modifier.async.ts
1533− 4: storage.type.property.ts
1562+ 5: storage.type.property.ts
1534− 5: keyword.generator.asterisk.ts
1563+ 6: keyword.generator.asterisk.ts
1535 push:
1564 push:
1536 - meta_scope: meta.method.declaration.ts
1565 - meta_scope: meta.method.declaration.ts
1537 - match: '(?=\}|;|,|$)|(?<=\})'
1566 - match: '(?=\}|;|,|$)|(?<=\})'
@@ -1568,7 +1597,7 @@ contexts:
1568 3: storage.type.namespace.ts
1597 3: storage.type.namespace.ts
1569 push:
1598 push:
1570 - meta_scope: meta.namespace.declaration.ts
1599 - meta_scope: meta.namespace.declaration.ts
1571− - match: '(?<=\})|(?=;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1600+ - match: '(?<=\})|(?=;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1572 pop: true
1601 pop: true
1573 - include: comment
1602 - include: comment
1574 - include: string
1603 - include: string
@@ -1582,11 +1611,9 @@ contexts:
1582 1: keyword.operator.new.ts
1611 1: keyword.operator.new.ts
1583 push:
1612 push:
1584 - meta_scope: new.expr.ts
1613 - meta_scope: new.expr.ts
1585− - match: '(?<=\))|(?=[;),}\]:\-\+]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1614+ - match: '(?<=\))|(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1586 pop: true
1615 pop: true
1587− - include: paren-expression
1616+ - include: expression
1588− - include: class-declaration
1589− - include: type
1590 null-literal:
1617 null-literal:
1591 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1618 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1592 scope: constant.language.null.ts
1619 scope: constant.language.null.ts
@@ -1767,7 +1794,7 @@ contexts:
1767 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1794 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1768 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1795 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1769 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1796 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1770− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1797+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1771 captures:
1798 captures:
1772 1: storage.modifier.async.ts
1799 1: storage.modifier.async.ts
1773 2: storage.type.property.ts
1800 2: storage.type.property.ts
@@ -1788,7 +1815,7 @@ contexts:
1788 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1815 (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1789 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1816 (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1790 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1817 (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1791− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1818+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1792 captures:
1819 captures:
1793 1: storage.modifier.async.ts
1820 1: storage.modifier.async.ts
1794 2: storage.type.property.ts
1821 2: storage.type.property.ts
@@ -1850,10 +1877,10 @@ contexts:
1850 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1877 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1851 )) |
1878 )) |
1852 ((async\s*)?(
1879 ((async\s*)?(
1853− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1880+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1854 # sure shot arrow functions even if => is on new line
1881 # sure shot arrow functions even if => is on new line
1855 (
1882 (
1856− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1883+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1857 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1884 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1858 (
1885 (
1859 ([)]\s*:) | # ():
1886 ([)]\s*:) | # ():
@@ -1863,9 +1890,9 @@ contexts:
1863
1890
1864 # arrow function possible to detect only with => on same line
1891 # arrow function possible to detect only with => on same line
1865 (
1892 (
1866− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1893+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1867− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1894+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1868− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1895+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1869 \s*=> # arrow operator
1896 \s*=> # arrow operator
1870 )
1897 )
1871 ))
1898 ))
@@ -1900,7 +1927,7 @@ contexts:
1900 1: keyword.control.as.ts
1927 1: keyword.control.as.ts
1901 push:
1928 push:
1902 - meta_scope: meta.object.member.ts
1929 - meta_scope: meta.object.member.ts
1903− - match: '(?=$|^|[,}]|\|\||\&\&|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
1930+ - match: '(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|^|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
1904 pop: true
1931 pop: true
1905 - include: type
1932 - include: type
1906 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1933 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
@@ -1916,7 +1943,7 @@ contexts:
1916 - meta_scope: meta.object.member.ts
1943 - meta_scope: meta.object.member.ts
1917 - match: '(?=,|\})'
1944 - match: '(?=,|\})'
1918 pop: true
1945 pop: true
1919− - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1946+ - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1920 captures:
1947 captures:
1921 1: storage.modifier.async.ts
1948 1: storage.modifier.async.ts
1922 push:
1949 push:
@@ -1932,7 +1959,7 @@ contexts:
1932 0: meta.brace.round.ts
1959 0: meta.brace.round.ts
1933 pop: true
1960 pop: true
1934 - include: expression-inside-possibly-arrow-parens
1961 - include: expression-inside-possibly-arrow-parens
1935− - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1962+ - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1936 captures:
1963 captures:
1937 1: storage.modifier.async.ts
1964 1: storage.modifier.async.ts
1938 2: meta.brace.round.ts
1965 2: meta.brace.round.ts
@@ -1949,7 +1976,7 @@ contexts:
1949 - match: (?<=\>)
1976 - match: (?<=\>)
1950 pop: true
1977 pop: true
1951 - include: type-parameters
1978 - include: type-parameters
1952− - match: '(?<=\>)\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1979+ - match: '(?<=\>)\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1953 captures:
1980 captures:
1954 1: meta.brace.round.ts
1981 1: meta.brace.round.ts
1955 push:
1982 push:
@@ -1983,11 +2010,11 @@ contexts:
1983 - include: destructuring-parameter-rest
2010 - include: destructuring-parameter-rest
1984 - include: variable-initializer
2011 - include: variable-initializer
1985 parameter-name:
2012 parameter-name:
1986− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
2013+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|protected|private|readonly)\s+(?=(override|public|protected|private|readonly)\s+)'
1987 captures:
2014 captures:
1988 1: storage.modifier.ts
2015 1: storage.modifier.ts
1989 - match: |-
2016 - match: |-
1990− (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
2017+ (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
1991 # function assignment |
2018 # function assignment |
1992 (=\s*(
2019 (=\s*(
1993 ((async\s+)?(
2020 ((async\s+)?(
@@ -1996,10 +2023,10 @@ contexts:
1996 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2023 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1997 )) |
2024 )) |
1998 ((async\s*)?(
2025 ((async\s*)?(
1999− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2026+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2000 # sure shot arrow functions even if => is on new line
2027 # sure shot arrow functions even if => is on new line
2001 (
2028 (
2002− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2029+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2003 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2030 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2004 (
2031 (
2005 ([)]\s*:) | # ():
2032 ([)]\s*:) | # ():
@@ -2009,9 +2036,9 @@ contexts:
2009
2036
2010 # arrow function possible to detect only with => on same line
2037 # arrow function possible to detect only with => on same line
2011 (
2038 (
2012− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2039+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2013− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2040+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
2014− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2041+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2015 \s*=> # arrow operator
2042 \s*=> # arrow operator
2016 )
2043 )
2017 ))
2044 ))
@@ -2029,18 +2056,18 @@ contexts:
2029 ))
2056 ))
2030 )) |
2057 )) |
2031 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2058 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
2032− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2059+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2033− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2060+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2034 ((async\s+)?(
2061 ((async\s+)?(
2035 (function\s*[(<*]) |
2062 (function\s*[(<*]) |
2036 (function\s+) |
2063 (function\s+) |
2037 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2064 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2038 )) |
2065 )) |
2039 ((async\s*)?(
2066 ((async\s*)?(
2040− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2067+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2041 # sure shot arrow functions even if => is on new line
2068 # sure shot arrow functions even if => is on new line
2042 (
2069 (
2043− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2070+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2044 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2071 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2045 (
2072 (
2046 ([)]\s*:) | # ():
2073 ([)]\s*:) | # ():
@@ -2050,9 +2077,9 @@ contexts:
2050
2077
2051 # arrow function possible to detect only with => on same line
2078 # arrow function possible to detect only with => on same line
2052 (
2079 (
2053− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2080+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2054− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2081+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
2055− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2082+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2056 \s*=> # arrow operator
2083 \s*=> # arrow operator
2057 )
2084 )
2058 ))
2085 ))
@@ -2063,7 +2090,7 @@ contexts:
2063 3: entity.name.function.ts variable.language.this.ts
2090 3: entity.name.function.ts variable.language.this.ts
2064 4: entity.name.function.ts
2091 4: entity.name.function.ts
2065 5: keyword.operator.optional.ts
2092 5: keyword.operator.optional.ts
2066− - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
2093+ - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
2067 captures:
2094 captures:
2068 1: storage.modifier.ts
2095 1: storage.modifier.ts
2069 2: keyword.operator.rest.ts
2096 2: keyword.operator.rest.ts
@@ -2123,14 +2150,14 @@ contexts:
2123 pop: true
2150 pop: true
2124 - include: expression
2151 - include: expression
2125 paren-expression-possibly-arrow:
2152 paren-expression-possibly-arrow:
2126− - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2153+ - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2127 captures:
2154 captures:
2128 1: storage.modifier.async.ts
2155 1: storage.modifier.async.ts
2129 push:
2156 push:
2130 - match: (?<=\))
2157 - match: (?<=\))
2131 pop: true
2158 pop: true
2132 - include: paren-expression-possibly-arrow-with-typeparameters
2159 - include: paren-expression-possibly-arrow-with-typeparameters
2133− - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
2160+ - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
2134 captures:
2161 captures:
2135 1: storage.modifier.async.ts
2162 1: storage.modifier.async.ts
2136 push:
2163 push:
@@ -2150,7 +2177,7 @@ contexts:
2150 pop: true
2177 pop: true
2151 - include: expression-inside-possibly-arrow-parens
2178 - include: expression-inside-possibly-arrow-parens
2152 possibly-arrow-return-type:
2179 possibly-arrow-return-type:
2153− - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
2180+ - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
2154 captures:
2181 captures:
2155 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
2182 1: meta.arrow.ts meta.return.type.arrow.ts keyword.operator.type.annotation.ts
2156 push:
2183 push:
@@ -2197,23 +2224,23 @@ contexts:
2197 pop: true
2224 pop: true
2198 - include: string-character-escape
2225 - include: string-character-escape
2199 regex:
2226 regex:
2200− - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2227+ - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2201 captures:
2228 captures:
2202 1: punctuation.definition.string.begin.ts
2229 1: punctuation.definition.string.begin.ts
2203 push:
2230 push:
2204 - meta_scope: string.regexp.ts
2231 - meta_scope: string.regexp.ts
2205− - match: "(/)([gimsuy]*)"
2232+ - match: "(/)([dgimsuy]*)"
2206 captures:
2233 captures:
2207 1: punctuation.definition.string.end.ts
2234 1: punctuation.definition.string.end.ts
2208 2: keyword.other.ts
2235 2: keyword.other.ts
2209 pop: true
2236 pop: true
2210 - include: regexp
2237 - include: regexp
2211− - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/([gimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2238+ - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)*\])+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2212 captures:
2239 captures:
2213 0: punctuation.definition.string.begin.ts
2240 0: punctuation.definition.string.begin.ts
2214 push:
2241 push:
2215 - meta_scope: string.regexp.ts
2242 - meta_scope: string.regexp.ts
2216− - match: "(/)([gimsuy]*)"
2243+ - match: "(/)([dgimsuy]*)"
2217 captures:
2244 captures:
2218 1: punctuation.definition.string.end.ts
2245 1: punctuation.definition.string.end.ts
2219 2: keyword.other.ts
2246 2: keyword.other.ts
@@ -2313,6 +2340,11 @@ contexts:
2313 - include: type-object
2340 - include: type-object
2314 - include: type-predicate-operator
2341 - include: type-predicate-operator
2315 - include: type
2342 - include: type
2343+ shebang:
2344+ - match: \A(#!).*(?=$)
2345+ scope: comment.line.shebang.ts
2346+ captures:
2347+ 1: punctuation.definition.comment.ts
2316 single-line-comment-consuming-line-ending:
2348 single-line-comment-consuming-line-ending:
2317 - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2349 - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2318 captures:
2350 captures:
@@ -2411,7 +2443,7 @@ contexts:
2411 4: support.variable.property.target.ts
2443 4: support.variable.property.target.ts
2412 - match: |-
2444 - match: |-
2413 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2445 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2414− (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2446+ (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2415 |
2447 |
2416 (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2448 (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2417 captures:
2449 captures:
@@ -2517,7 +2549,7 @@ contexts:
2517 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2549 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2518 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2550 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2519 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2551 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2520− |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2552+ |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2521 captures:
2553 captures:
2522 1: punctuation.accessor.ts
2554 1: punctuation.accessor.ts
2523 2: punctuation.accessor.optional.ts
2555 2: punctuation.accessor.optional.ts
@@ -2684,20 +2716,34 @@ contexts:
2684 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2716 0: case-clause.expr.ts punctuation.definition.section.case-statement.ts
2685 - include: statements
2717 - include: statements
2686 template:
2718 template:
2687− - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2719+ - include: template-call
2720+ - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2721+ captures:
2722+ 1: entity.name.function.tagged-template.ts
2723+ 2: punctuation.definition.string.template.begin.ts
2724+ push:
2725+ - meta_scope: string.template.ts
2726+ - match: "`"
2727+ captures:
2728+ 0: punctuation.definition.string.template.end.ts
2729+ pop: true
2730+ - include: template-substitution-element
2731+ - include: string-character-escape
2732+ template-call:
2733+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2688 push:
2734 push:
2689 - meta_scope: string.template.ts
2735 - meta_scope: string.template.ts
2690 - match: (?=`)
2736 - match: (?=`)
2691 pop: true
2737 pop: true
2692 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2738 - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2693 push:
2739 push:
2694− - match: '(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2740+ - match: '(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2695 pop: true
2741 pop: true
2696 - include: support-function-call-identifiers
2742 - include: support-function-call-identifiers
2697 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2743 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2698 scope: entity.name.function.tagged-template.ts
2744 scope: entity.name.function.tagged-template.ts
2699 - include: type-arguments
2745 - include: type-arguments
2700− - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2746+ - match: '([_$[:alpha:]][_$[:alnum:]]*)?\s*(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2701 captures:
2747 captures:
2702 1: entity.name.function.tagged-template.ts
2748 1: entity.name.function.tagged-template.ts
2703 push:
2749 push:
@@ -2705,6 +2751,20 @@ contexts:
2705 - match: (?=`)
2751 - match: (?=`)
2706 pop: true
2752 pop: true
2707 - include: type-arguments
2753 - include: type-arguments
2754+ template-substitution-element:
2755+ - match: '\$\{'
2756+ captures:
2757+ 0: punctuation.definition.template-expression.begin.ts
2758+ push:
2759+ - meta_scope: meta.template.expression.ts
2760+ - meta_content_scope: meta.embedded.line.ts
2761+ - match: '\}'
2762+ captures:
2763+ 0: punctuation.definition.template-expression.end.ts
2764+ pop: true
2765+ - include: expression
2766+ template-type:
2767+ - include: template-call
2708 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2768 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2709 captures:
2769 captures:
2710 1: entity.name.function.tagged-template.ts
2770 1: entity.name.function.tagged-template.ts
@@ -2715,9 +2775,9 @@ contexts:
2715 captures:
2775 captures:
2716 0: punctuation.definition.string.template.end.ts
2776 0: punctuation.definition.string.template.end.ts
2717 pop: true
2777 pop: true
2718− - include: template-substitution-element
2778+ - include: template-type-substitution-element
2719 - include: string-character-escape
2779 - include: string-character-escape
2720− template-substitution-element:
2780+ template-type-substitution-element:
2721 - match: '\$\{'
2781 - match: '\$\{'
2722 captures:
2782 captures:
2723 0: punctuation.definition.template-expression.begin.ts
2783 0: punctuation.definition.template-expression.begin.ts
@@ -2728,7 +2788,7 @@ contexts:
2728 captures:
2788 captures:
2729 0: punctuation.definition.template-expression.end.ts
2789 0: punctuation.definition.template-expression.end.ts
2730 pop: true
2790 pop: true
2731− - include: expression
2791+ - include: type
2732 ternary-expression:
2792 ternary-expression:
2733 - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2793 - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2734 captures:
2794 captures:
@@ -2744,7 +2804,7 @@ contexts:
2744 scope: variable.language.this.ts
2804 scope: variable.language.this.ts
2745 type:
2805 type:
2746 - include: comment
2806 - include: comment
2747− - include: string
2807+ - include: type-string
2748 - include: numeric-literal
2808 - include: numeric-literal
2749 - include: type-primitive
2809 - include: type-primitive
2750 - include: type-builtin-literals
2810 - include: type-builtin-literals
@@ -2769,15 +2829,23 @@ contexts:
2769 4: entity.name.type.alias.ts
2829 4: entity.name.type.alias.ts
2770 push:
2830 push:
2771 - meta_scope: meta.type.declaration.ts
2831 - meta_scope: meta.type.declaration.ts
2772− - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2832+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2773 pop: true
2833 pop: true
2774 - include: comment
2834 - include: comment
2775 - include: type-parameters
2835 - include: type-parameters
2836+ - match: '(=)\s*(intrinsic)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2837+ captures:
2838+ 1: keyword.operator.assignment.ts
2839+ 2: keyword.control.intrinsic.ts
2840+ push:
2841+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2842+ pop: true
2843+ - include: type
2776 - match: (=)\s*
2844 - match: (=)\s*
2777 captures:
2845 captures:
2778 1: keyword.operator.assignment.ts
2846 1: keyword.operator.assignment.ts
2779 push:
2847 push:
2780− - match: '(?=\}|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2848+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2781 pop: true
2849 pop: true
2782 - include: type
2850 - include: type
2783 type-annotation:
2851 type-annotation:
@@ -2835,17 +2903,19 @@ contexts:
2835 - include: type
2903 - include: type
2836 - include: type
2904 - include: type
2837 type-fn-type-parameters:
2905 type-fn-type-parameters:
2838− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
2906+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(new)\b(?=\s*\<)'
2839 captures:
2907 captures:
2840− 1: meta.type.constructor.ts keyword.control.new.ts
2908+ 1: meta.type.constructor.ts storage.modifier.ts
2909+ 2: meta.type.constructor.ts keyword.control.new.ts
2841 push:
2910 push:
2842 - match: (?<=>)
2911 - match: (?<=>)
2843 pop: true
2912 pop: true
2844 - include: comment
2913 - include: comment
2845 - include: type-parameters
2914 - include: type-parameters
2846− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
2915+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(new)\b\s*(?=\()'
2847 captures:
2916 captures:
2848− 1: keyword.control.new.ts
2917+ 1: storage.modifier.ts
2918+ 2: keyword.control.new.ts
2849 push:
2919 push:
2850 - meta_scope: meta.type.constructor.ts
2920 - meta_scope: meta.type.constructor.ts
2851 - match: (?<=\))
2921 - match: (?<=\))
@@ -3016,7 +3086,7 @@ contexts:
3016 ))
3086 ))
3017 )) |
3087 )) |
3018 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3088 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3019− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
3089+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
3020 captures:
3090 captures:
3021 1: storage.modifier.ts
3091 1: storage.modifier.ts
3022 2: keyword.operator.rest.ts
3092 2: keyword.operator.rest.ts
@@ -3053,6 +3123,10 @@ contexts:
3053 type-primitive:
3123 type-primitive:
3054 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3124 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3055 scope: support.type.primitive.ts
3125 scope: support.type.primitive.ts
3126+ type-string:
3127+ - include: qstring-single
3128+ - include: qstring-double
3129+ - include: template-type
3056 type-tuple:
3130 type-tuple:
3057 - match: '\['
3131 - match: '\['
3058 captures:
3132 captures:
@@ -3063,11 +3137,23 @@ contexts:
3063 captures:
3137 captures:
3064 0: meta.brace.square.ts
3138 0: meta.brace.square.ts
3065 pop: true
3139 pop: true
3140+ - match: \.\.\.
3141+ scope: keyword.operator.rest.ts
3142+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))([_$[:alpha:]][_$[:alnum:]]*)\s*(\?)?\s*(:)'
3143+ captures:
3144+ 1: entity.name.label.ts
3145+ 2: keyword.operator.optional.ts
3146+ 3: punctuation.separator.label.ts
3066 - include: type
3147 - include: type
3067 - include: punctuation-comma
3148 - include: punctuation-comma
3068 typeof-operator:
3149 typeof-operator:
3069 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3150 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3070− scope: keyword.operator.expression.typeof.ts
3151+ captures:
3152+ 0: keyword.operator.expression.typeof.ts
3153+ push:
3154+ - match: '(?=[,);}\]=>:&|{\?]|$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
3155+ pop: true
3156+ - include: expression
3071 undefined-literal:
3157 undefined-literal:
3072 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3158 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3073 scope: constant.language.undefined.ts
3159 scope: constant.language.undefined.ts
@@ -3075,7 +3161,7 @@ contexts:
3075 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3161 - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
3076 push:
3162 push:
3077 - meta_scope: meta.var.expr.ts
3163 - meta_scope: meta.var.expr.ts
3078− - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
3164+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
3079 pop: true
3165 pop: true
3080 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3166 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3081 captures:
3167 captures:
@@ -3108,7 +3194,7 @@ contexts:
3108 3: storage.type.ts
3194 3: storage.type.ts
3109 push:
3195 push:
3110 - meta_scope: meta.var.expr.ts
3196 - meta_scope: meta.var.expr.ts
3111− - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$|;|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
3197+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
3112 pop: true
3198 pop: true
3113 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3199 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3114 captures:
3200 captures:
@@ -3145,10 +3231,10 @@ contexts:
3145 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3231 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3146 )) |
3232 )) |
3147 ((async\s*)?(
3233 ((async\s*)?(
3148− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3234+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3149 # sure shot arrow functions even if => is on new line
3235 # sure shot arrow functions even if => is on new line
3150 (
3236 (
3151− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3237+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3152 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3238 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3153 (
3239 (
3154 ([)]\s*:) | # ():
3240 ([)]\s*:) | # ():
@@ -3158,9 +3244,9 @@ contexts:
3158
3244
3159 # arrow function possible to detect only with => on same line
3245 # arrow function possible to detect only with => on same line
3160 (
3246 (
3161− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3247+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3162− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3248+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3163− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3249+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3164 \s*=> # arrow operator
3250 \s*=> # arrow operator
3165 )
3251 )
3166 ))
3252 ))
@@ -3178,18 +3264,18 @@ contexts:
3178 ))
3264 ))
3179 )) |
3265 )) |
3180 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3266 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3181− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3267+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3182− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3268+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3183 ((async\s+)?(
3269 ((async\s+)?(
3184 (function\s*[(<*]) |
3270 (function\s*[(<*]) |
3185 (function\s+) |
3271 (function\s+) |
3186 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3272 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3187 )) |
3273 )) |
3188 ((async\s*)?(
3274 ((async\s*)?(
3189− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3275+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3190 # sure shot arrow functions even if => is on new line
3276 # sure shot arrow functions even if => is on new line
3191 (
3277 (
3192− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3278+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3193 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3279 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3194 (
3280 (
3195 ([)]\s*:) | # ():
3281 ([)]\s*:) | # ():
@@ -3199,9 +3285,9 @@ contexts:
3199
3285
3200 # arrow function possible to detect only with => on same line
3286 # arrow function possible to detect only with => on same line
3201 (
3287 (
3202− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3288+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3203− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3289+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3204− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3290+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3205 \s*=> # arrow operator
3291 \s*=> # arrow operator
3206 )
3292 )
3207 ))
3293 ))
@@ -3232,10 +3318,10 @@ contexts:
3232 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3318 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3233 )) |
3319 )) |
3234 ((async\s*)?(
3320 ((async\s*)?(
3235− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3321+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3236 # sure shot arrow functions even if => is on new line
3322 # sure shot arrow functions even if => is on new line
3237 (
3323 (
3238− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3324+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3239 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3325 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3240 (
3326 (
3241 ([)]\s*:) | # ():
3327 ([)]\s*:) | # ():
@@ -3245,9 +3331,9 @@ contexts:
3245
3331
3246 # arrow function possible to detect only with => on same line
3332 # arrow function possible to detect only with => on same line
3247 (
3333 (
3248− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3334+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3249− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3335+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3250− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3336+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3251 \s*=> # arrow operator
3337 \s*=> # arrow operator
3252 )
3338 )
3253 ))
3339 ))
@@ -3265,18 +3351,18 @@ contexts:
3265 ))
3351 ))
3266 )) |
3352 )) |
3267 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3353 (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3268− (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3354+ (:\s*((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3269− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3355+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3270 ((async\s+)?(
3356 ((async\s+)?(
3271 (function\s*[(<*]) |
3357 (function\s*[(<*]) |
3272 (function\s+) |
3358 (function\s+) |
3273 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3359 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3274 )) |
3360 )) |
3275 ((async\s*)?(
3361 ((async\s*)?(
3276− ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{[^\{\}]*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[[^\[\]]*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3362+ ((<\s*$)|((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?[\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3277 # sure shot arrow functions even if => is on new line
3363 # sure shot arrow functions even if => is on new line
3278 (
3364 (
3279− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3365+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3280 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3366 [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3281 (
3367 (
3282 ([)]\s*:) | # ():
3368 ([)]\s*:) | # ():
@@ -3286,9 +3372,9 @@ contexts:
3286
3372
3287 # arrow function possible to detect only with => on same line
3373 # arrow function possible to detect only with => on same line
3288 (
3374 (
3289− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3375+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3290− \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3376+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3291− (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<[^<>]+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3377+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3292 \s*=> # arrow operator
3378 \s*=> # arrow operator
3293 )
3379 )
3294 ))
3380 ))
assets/syntaxes/02_Extra/TypsecriptReact.sublime-syntax+896−477
@@ -9,10 +9,7 @@ contexts:
9 main:
9 main:
10 - include: directives
10 - include: directives
11 - include: statements
11 - include: statements
12− - match: \A(#!).*(?=$)
12+ - include: shebang
13− scope: comment.line.shebang.ts
14− captures:
15− 1: punctuation.definition.comment.ts
16 comment:
13 comment:
17 - match: /\*\*(?!/)
14 - match: /\*\*(?!/)
18 captures:
15 captures:
@@ -44,10 +41,10 @@ contexts:
44 5: punctuation.decorator.internaldeclaration.tsx
41 5: punctuation.decorator.internaldeclaration.tsx
45 push:
42 push:
46 - meta_content_scope: comment.line.double-slash.tsx
43 - meta_content_scope: comment.line.double-slash.tsx
47− - match: (?=^)
44+ - match: (?=$)
48 pop: true
45 pop: true
49 access-modifier:
46 access-modifier:
50− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
47+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(abstract|declare|override|public|protected|private|readonly|static)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
51 scope: storage.modifier.tsx
48 scope: storage.modifier.tsx
52 after-operator-block-as-object-literal:
49 after-operator-block-as-object-literal:
53 - match: '(?<!\+\+|--)(?<=[:=(,\[?+!>]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)'
50 - match: '(?<!\+\+|--)(?<=[:=(,\[?+!>]|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^yield|[^\._$[:alnum:]]yield|^throw|[^\._$[:alnum:]]throw|^in|[^\._$[:alnum:]]in|^of|[^\._$[:alnum:]]of|^typeof|[^\._$[:alnum:]]typeof|&&|\|\||\*)\s*(\{)'
@@ -109,8 +106,8 @@ contexts:
109 (?=
106 (?=
110 # sure shot arrow functions even if => is on new line
107 # sure shot arrow functions even if => is on new line
111 (
108 (
112− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
109+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
113− [(]\s*
110+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
114 (
111 (
115 ([)]\s*:) | # ():
112 ([)]\s*:) | # ():
116 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
113 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -121,9 +118,9 @@ contexts:
121 ) |
118 ) |
122 # arrow function possible to detect only with => on same line
119 # arrow function possible to detect only with => on same line
123 (
120 (
124− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
121+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
125− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
122+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
126− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
123+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
127 \s*=> # arrow operator
124 \s*=> # arrow operator
128 )
125 )
129 )
126 )
@@ -138,13 +135,15 @@ contexts:
138 - include: type-parameters
135 - include: type-parameters
139 - include: function-parameters
136 - include: function-parameters
140 - include: arrow-return-type
137 - include: arrow-return-type
138+ - include: possibly-arrow-return-type
141 - match: "=>"
139 - match: "=>"
142 captures:
140 captures:
143 0: storage.type.function.arrow.tsx
141 0: storage.type.function.arrow.tsx
144 push:
142 push:
145 - meta_scope: meta.arrow.tsx
143 - meta_scope: meta.arrow.tsx
146− - match: '(?<=\}|\S)(?<!=>)|((?!\{)(?=\S))'
144+ - match: '((?<=\}|\S)(?<!=>)|((?!\{)(?=\S)))(?!\/[\/\*])'
147 pop: true
145 pop: true
146+ - include: single-line-comment-consuming-line-ending
148 - include: decl-block
147 - include: decl-block
149 - include: expression
148 - include: expression
150 arrow-return-type:
149 arrow-return-type:
@@ -170,6 +169,8 @@ contexts:
170 binding-element:
169 binding-element:
171 - include: comment
170 - include: comment
172 - include: string
171 - include: string
172+ - include: numeric-literal
173+ - include: regex
173 - include: object-binding-pattern
174 - include: object-binding-pattern
174 - include: array-binding-pattern
175 - include: array-binding-pattern
175 - include: destructuring-variable-rest
176 - include: destructuring-variable-rest
@@ -177,6 +178,8 @@ contexts:
177 binding-element-const:
178 binding-element-const:
178 - include: comment
179 - include: comment
179 - include: string
180 - include: string
181+ - include: numeric-literal
182+ - include: regex
180 - include: object-binding-pattern-const
183 - include: object-binding-pattern-const
181 - include: array-binding-pattern-const
184 - include: array-binding-pattern-const
182 - include: destructuring-variable-rest-const
185 - include: destructuring-variable-rest-const
@@ -200,11 +203,12 @@ contexts:
200 cast:
203 cast:
201 - include: jsx
204 - include: jsx
202 class-declaration:
205 class-declaration:
203− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
206+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(class)\b(?=\s+|/[/*])'
204 captures:
207 captures:
205 1: keyword.control.export.tsx
208 1: keyword.control.export.tsx
206 2: storage.modifier.tsx
209 2: storage.modifier.tsx
207− 3: storage.type.class.tsx
210+ 3: storage.modifier.tsx
211+ 4: storage.type.class.tsx
208 push:
212 push:
209 - meta_scope: meta.class.tsx
213 - meta_scope: meta.class.tsx
210 - match: '(?<=\})'
214 - match: '(?<=\})'
@@ -219,9 +223,10 @@ contexts:
219 - include: type-parameters
223 - include: type-parameters
220 - include: class-or-interface-body
224 - include: class-or-interface-body
221 class-expression:
225 class-expression:
222− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(class)\b(?=\s+|[<{]|\/[\/*])'
226+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(class)\b(?=\s+|[<{]|\/[\/*])'
223 captures:
227 captures:
224− 1: storage.type.class.tsx
228+ 1: storage.modifier.tsx
229+ 2: storage.type.class.tsx
225 push:
230 push:
226 - meta_scope: meta.class.tsx
231 - meta_scope: meta.class.tsx
227 - match: '(?<=\})'
232 - match: '(?<=\})'
@@ -238,6 +243,11 @@ contexts:
238 pop: true
243 pop: true
239 - include: comment
244 - include: comment
240 - include: decorator
245 - include: decorator
246+ - match: (?<=:)\s*
247+ push:
248+ - match: '(?=\s|[;),}\]:\-\+]|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
249+ pop: true
250+ - include: expression
241 - include: method-declaration
251 - include: method-declaration
242 - include: indexer-declaration
252 - include: indexer-declaration
243 - include: field-declaration
253 - include: field-declaration
@@ -284,9 +294,15 @@ contexts:
284 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
294 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(break|continue|do|goto|while)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
285 scope: keyword.control.loop.tsx
295 scope: keyword.control.loop.tsx
286 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
296 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(return)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
287− scope: keyword.control.flow.tsx
297+ captures:
298+ 0: keyword.control.flow.tsx
299+ push:
300+ - match: '(?=[;}]|$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
301+ pop: true
302+ - include: expression
288 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
303 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(case|default|switch)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
289 scope: keyword.control.switch.tsx
304 scope: keyword.control.switch.tsx
305+ - include: if-statement
290 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(else|if)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
306 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(else|if)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
291 scope: keyword.control.conditional.tsx
307 scope: keyword.control.conditional.tsx
292 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(with)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
308 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(with)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
@@ -295,8 +311,6 @@ contexts:
295 scope: keyword.control.tsx
311 scope: keyword.control.tsx
296 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
312 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(debugger)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
297 scope: keyword.other.debugger.tsx
313 scope: keyword.other.debugger.tsx
298− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(declare)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
299− scope: storage.modifier.tsx
300 decl-block:
314 decl-block:
301 - match: '\{'
315 - match: '\{'
302 captures:
316 captures:
@@ -320,6 +334,8 @@ contexts:
320 - include: import-equals-declaration
334 - include: import-equals-declaration
321 - include: import-declaration
335 - include: import-declaration
322 - include: export-declaration
336 - include: export-declaration
337+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(declare|export)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
338+ scope: storage.modifier.tsx
323 decorator:
339 decorator:
324 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))\@'
340 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))\@'
325 captures:
341 captures:
@@ -333,7 +349,7 @@ contexts:
333 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
349 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
334 push:
350 push:
335 - meta_scope: meta.object-binding-pattern-variable.tsx
351 - meta_scope: meta.object-binding-pattern-variable.tsx
336− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
352+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
337 pop: true
353 pop: true
338 - include: object-binding-pattern-const
354 - include: object-binding-pattern-const
339 - include: type-annotation
355 - include: type-annotation
@@ -341,15 +357,16 @@ contexts:
341 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
357 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
342 push:
358 push:
343 - meta_scope: meta.array-binding-pattern-variable.tsx
359 - meta_scope: meta.array-binding-pattern-variable.tsx
344− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
360+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
345 pop: true
361 pop: true
346 - include: array-binding-pattern-const
362 - include: array-binding-pattern-const
347 - include: type-annotation
363 - include: type-annotation
348 - include: comment
364 - include: comment
349 destructuring-parameter:
365 destructuring-parameter:
350− - match: '(?<!=|:)\s*(\{)'
366+ - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\{)'
351 captures:
367 captures:
352− 1: punctuation.definition.binding-pattern.object.tsx
368+ 1: keyword.operator.rest.tsx
369+ 2: punctuation.definition.binding-pattern.object.tsx
353 push:
370 push:
354 - meta_scope: meta.parameter.object-binding-pattern.tsx
371 - meta_scope: meta.parameter.object-binding-pattern.tsx
355 - match: '\}'
372 - match: '\}'
@@ -357,9 +374,10 @@ contexts:
357 0: punctuation.definition.binding-pattern.object.tsx
374 0: punctuation.definition.binding-pattern.object.tsx
358 pop: true
375 pop: true
359 - include: parameter-object-binding-element
376 - include: parameter-object-binding-element
360− - match: '(?<!=|:)\s*(\[)'
377+ - match: '(?<!=|:)\s*(?:(\.\.\.)\s*)?(\[)'
361 captures:
378 captures:
362− 1: punctuation.definition.binding-pattern.array.tsx
379+ 1: keyword.operator.rest.tsx
380+ 2: punctuation.definition.binding-pattern.array.tsx
363 push:
381 push:
364 - meta_scope: meta.paramter.array-binding-pattern.tsx
382 - meta_scope: meta.paramter.array-binding-pattern.tsx
365 - match: '\]'
383 - match: '\]'
@@ -377,7 +395,7 @@ contexts:
377 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
395 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\{)'
378 push:
396 push:
379 - meta_scope: meta.object-binding-pattern-variable.tsx
397 - meta_scope: meta.object-binding-pattern-variable.tsx
380− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
398+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
381 pop: true
399 pop: true
382 - include: object-binding-pattern
400 - include: object-binding-pattern
383 - include: type-annotation
401 - include: type-annotation
@@ -385,7 +403,7 @@ contexts:
385 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
403 - match: '(?<!=|:|^of|[^\._$[:alnum:]]of|^in|[^\._$[:alnum:]]in)\s*(?=\[)'
386 push:
404 push:
387 - meta_scope: meta.array-binding-pattern-variable.tsx
405 - meta_scope: meta.array-binding-pattern-variable.tsx
388− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
406+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
389 pop: true
407 pop: true
390 - include: array-binding-pattern
408 - include: array-binding-pattern
391 - include: type-annotation
409 - include: type-annotation
@@ -401,12 +419,12 @@ contexts:
401 1: keyword.operator.rest.tsx
419 1: keyword.operator.rest.tsx
402 2: meta.definition.variable.tsx variable.other.constant.tsx
420 2: meta.definition.variable.tsx variable.other.constant.tsx
403 directives:
421 directives:
404− - match: '^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|lib|name)\s*=\s*((\''([^\''\\]|\\\''|\\)*\'')|(\"([^\"\\]|\\\"|\\)*\")))+\s*/>\s*$)'
422+ - match: '^(///)\s*(?=<(reference|amd-dependency|amd-module)(\s+(path|types|no-default-lib|lib|name)\s*=\s*((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)))+\s*/>\s*$)'
405 captures:
423 captures:
406 1: punctuation.definition.comment.tsx
424 1: punctuation.definition.comment.tsx
407 push:
425 push:
408 - meta_scope: comment.line.triple-slash.directive.tsx
426 - meta_scope: comment.line.triple-slash.directive.tsx
409− - match: (?=^)
427+ - match: (?=$)
410 pop: true
428 pop: true
411 - match: (<)(reference|amd-dependency|amd-module)
429 - match: (<)(reference|amd-dependency|amd-module)
412 captures:
430 captures:
@@ -668,13 +686,18 @@ contexts:
668 captures:
686 captures:
669 1: punctuation.definition.block.tag.jsdoc
687 1: punctuation.definition.block.tag.jsdoc
670 - include: inline-tags
688 - include: inline-tags
689+ - match: '((@)(?:[_$[:alpha:]][_$[:alnum:]]*))(?=\s+)'
690+ captures:
691+ 1: storage.type.class.jsdoc
692+ 2: punctuation.definition.block.tag.jsdoc
671 enum-declaration:
693 enum-declaration:
672− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)'
694+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:\b(const)\s+)?\b(enum)\s+([_$[:alpha:]][_$[:alnum:]]*)'
673 captures:
695 captures:
674 1: keyword.control.export.tsx
696 1: keyword.control.export.tsx
675 2: storage.modifier.tsx
697 2: storage.modifier.tsx
676− 3: storage.type.enum.tsx
698+ 3: storage.modifier.tsx
677− 4: entity.name.type.enum.tsx
699+ 4: storage.type.enum.tsx
700+ 5: entity.name.type.enum.tsx
678 push:
701 push:
679 - meta_scope: meta.enum.declaration.tsx
702 - meta_scope: meta.enum.declaration.tsx
680 - match: '(?<=\})'
703 - match: '(?<=\})'
@@ -697,7 +720,7 @@ contexts:
697 pop: true
720 pop: true
698 - include: comment
721 - include: comment
699 - include: variable-initializer
722 - include: variable-initializer
700− - match: '(?=((\''([^\''\\]|\\\''|\\)*\'')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\])))'
723+ - match: '(?=((\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\])))'
701 push:
724 push:
702 - match: '(?=,|\}|$)'
725 - match: '(?=,|\}|$)'
703 pop: true
726 pop: true
@@ -713,22 +736,25 @@ contexts:
713 2: keyword.control.as.tsx
736 2: keyword.control.as.tsx
714 3: storage.type.namespace.tsx
737 3: storage.type.namespace.tsx
715 4: entity.name.type.module.tsx
738 4: entity.name.type.module.tsx
716− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?:(?:\s*(=))|(?:\s+(default)(?=\s+)))'
739+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?:\s+(type))?(?:(?:\s*(=))|(?:\s+(default)(?=\s+)))'
717 captures:
740 captures:
718 1: keyword.control.export.tsx
741 1: keyword.control.export.tsx
719− 2: keyword.operator.assignment.tsx
742+ 2: keyword.control.type.tsx
720− 3: keyword.control.default.tsx
743+ 3: keyword.operator.assignment.tsx
744+ 4: keyword.control.default.tsx
721 push:
745 push:
722 - meta_scope: meta.export.default.tsx
746 - meta_scope: meta.export.default.tsx
723− - match: (?=$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)
747+ - match: (?=$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
724 pop: true
748 pop: true
749+ - include: interface-declaration
725 - include: expression
750 - include: expression
726− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?!\s*:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
751+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(export)(?:\s+(type))?\b(?!(\$)|(\s*:))((?=\s*[\{*])|((?=\s*[_$[:alpha:]][_$[:alnum:]]*(\s|,))(?!\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b)))'
727 captures:
752 captures:
728− 0: keyword.control.export.tsx
753+ 1: keyword.control.export.tsx
754+ 2: keyword.control.type.tsx
729 push:
755 push:
730 - meta_scope: meta.export.tsx
756 - meta_scope: meta.export.tsx
731− - match: (?=$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)
757+ - match: (?=$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))
732 pop: true
758 pop: true
733 - include: import-export-declaration
759 - include: import-export-declaration
734 expression:
760 expression:
@@ -737,7 +763,105 @@ contexts:
737 - include: expressionPunctuations
763 - include: expressionPunctuations
738 expression-inside-possibly-arrow-parens:
764 expression-inside-possibly-arrow-parens:
739 - include: expressionWithoutIdentifiers
765 - include: expressionWithoutIdentifiers
740− - include: function-parameters-body
766+ - include: comment
767+ - include: string
768+ - include: decorator
769+ - include: destructuring-parameter
770+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|protected|private|readonly)\s+(?=(override|public|protected|private|readonly)\s+)'
771+ captures:
772+ 1: storage.modifier.tsx
773+ - match: |-
774+ (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
775+ # function assignment |
776+ (=\s*(
777+ ((async\s+)?(
778+ (function\s*[(<*]) |
779+ (function\s+) |
780+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
781+ )) |
782+ ((async\s*)?(
783+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
784+ # sure shot arrow functions even if => is on new line
785+ (
786+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
787+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
788+ (
789+ ([)]\s*:) | # ():
790+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
791+ )
792+ ) |
793+ (
794+ [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
795+ ) |
796+ # arrow function possible to detect only with => on same line
797+ (
798+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
799+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
800+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
801+ \s*=> # arrow operator
802+ )
803+ ))
804+ )) |
805+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
806+ (:\s*(
807+ (<) |
808+ ([(]\s*(
809+ ([)]) |
810+ (\.\.\.) |
811+ ([_$[:alnum:]]+\s*(
812+ ([:,?=])|
813+ ([)]\s*=>)
814+ ))
815+ ))
816+ )) |
817+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
818+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
819+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
820+ ((async\s+)?(
821+ (function\s*[(<*]) |
822+ (function\s+) |
823+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
824+ )) |
825+ ((async\s*)?(
826+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
827+ # sure shot arrow functions even if => is on new line
828+ (
829+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
830+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
831+ (
832+ ([)]\s*:) | # ():
833+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
834+ )
835+ ) |
836+ (
837+ [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
838+ ) |
839+ # arrow function possible to detect only with => on same line
840+ (
841+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
842+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
843+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
844+ \s*=> # arrow operator
845+ )
846+ ))
847+ )))
848+ captures:
849+ 1: storage.modifier.tsx
850+ 2: keyword.operator.rest.tsx
851+ 3: entity.name.function.tsx variable.language.this.tsx
852+ 4: entity.name.function.tsx
853+ 5: keyword.operator.optional.tsx
854+ - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*[:,]|$)'
855+ captures:
856+ 1: storage.modifier.tsx
857+ 2: keyword.operator.rest.tsx
858+ 3: variable.parameter.tsx variable.language.this.tsx
859+ 4: variable.parameter.tsx
860+ 5: keyword.operator.optional.tsx
861+ - include: type-annotation
862+ - include: variable-initializer
863+ - match: ","
864+ scope: punctuation.separator.parameter.tsx
741 - include: identifiers
865 - include: identifiers
742 - include: expressionPunctuations
866 - include: expressionPunctuations
743 expression-operators:
867 expression-operators:
@@ -769,11 +893,15 @@ contexts:
769 - include: typeof-operator
893 - include: typeof-operator
770 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
894 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))void(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
771 scope: keyword.operator.expression.void.tsx
895 scope: keyword.operator.expression.void.tsx
896+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*($|[;,:})\]]))'
897+ captures:
898+ 1: keyword.control.as.tsx
899+ 2: storage.modifier.tsx
772 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
900 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
773 captures:
901 captures:
774 1: keyword.control.as.tsx
902 1: keyword.control.as.tsx
775 push:
903 push:
776− - match: '(?=$|^|[;,:})\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
904+ - match: '(?=^|[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+)|(\s+\<))'
777 pop: true
905 pop: true
778 - include: type
906 - include: type
779 - match: \.\.\.
907 - match: \.\.\.
@@ -788,7 +916,12 @@ contexts:
788 scope: keyword.operator.comparison.tsx
916 scope: keyword.operator.comparison.tsx
789 - match: <=|>=|<>|<|>
917 - match: <=|>=|<>|<|>
790 scope: keyword.operator.relational.tsx
918 scope: keyword.operator.relational.tsx
791− - match: \!|&&|\|\|
919+ - match: '(?<=[_$[:alnum:]])(\!)\s*(?:(/=)|(?:(/)(?![/*])))'
920+ captures:
921+ 1: keyword.operator.logical.tsx
922+ 2: keyword.operator.assignment.compound.tsx
923+ 3: keyword.operator.arithmetic.tsx
924+ - match: \!|&&|\|\||\?\?
792 scope: keyword.operator.logical.tsx
925 scope: keyword.operator.logical.tsx
793 - match: \&|~|\^|\|
926 - match: \&|~|\^|\|
794 scope: keyword.operator.bitwise.tsx
927 scope: keyword.operator.bitwise.tsx
@@ -800,9 +933,18 @@ contexts:
800 scope: keyword.operator.increment.tsx
933 scope: keyword.operator.increment.tsx
801 - match: '%|\*|/|-|\+'
934 - match: '%|\*|/|-|\+'
802 scope: keyword.operator.arithmetic.tsx
935 scope: keyword.operator.arithmetic.tsx
803− - match: '(?<=[_$[:alnum:])\]])\s*(/)(?![/*])'
936+ - match: '(?<=[_$[:alnum:])\]])\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)+(?:(/=)|(?:(/)(?![/*]))))'
937+ push:
938+ - match: '(?:(/=)|(?:(/)(?!\*([^\*]|(\*[^\/]))*\*\/)))'
939+ captures:
940+ 1: keyword.operator.assignment.compound.tsx
941+ 2: keyword.operator.arithmetic.tsx
942+ pop: true
943+ - include: comment
944+ - match: '(?<=[_$[:alnum:])\]])\s*(?:(/=)|(?:(/)(?![/*])))'
804 captures:
945 captures:
805− 1: keyword.operator.arithmetic.tsx
946+ 1: keyword.operator.assignment.compound.tsx
947+ 2: keyword.operator.arithmetic.tsx
806 expressionPunctuations:
948 expressionPunctuations:
807 - include: punctuation-comma
949 - include: punctuation-comma
808 - include: punctuation-accessor
950 - include: punctuation-accessor
@@ -810,7 +952,6 @@ contexts:
810 - include: jsx
952 - include: jsx
811 - include: string
953 - include: string
812 - include: regex
954 - include: regex
813− - include: template
814 - include: comment
955 - include: comment
815 - include: function-expression
956 - include: function-expression
816 - include: class-expression
957 - include: class-expression
@@ -828,143 +969,123 @@ contexts:
828 - include: paren-expression
969 - include: paren-expression
829 field-declaration:
970 field-declaration:
830 - match: |-
971 - match: |-
831− (?x)(?<!\()(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s+)?(?=\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
972+ (?x)(?<!\()(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)\s+)?(?=\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
832− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
973+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
833− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
974+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
834− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
975+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
835− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
976+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
836− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
977+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
837− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
978+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
838− (?:\B(\.)[0-9][0-9_]*\b)| # .1
979+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
839− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
980+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
840− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
981+ )(?!\$))|(\#?[_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|\}|$))
841 captures:
982 captures:
842 1: storage.modifier.tsx
983 1: storage.modifier.tsx
843 push:
984 push:
844 - meta_scope: meta.field.declaration.tsx
985 - meta_scope: meta.field.declaration.tsx
845 - match: |-
986 - match: |-
846− (?x)(?=\}|;|,|$|(^(?!\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
987+ (?x)(?=\}|;|,|$|(^(?!\s*((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
847− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
988+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
848− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
989+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
849− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
990+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
850− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
991+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
851− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
992+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
852− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
993+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
853− (?:\B(\.)[0-9][0-9_]*\b)| # .1
994+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
854− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
995+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
855− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(?<=\})
996+ )(?!\$))|(\#?[_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(?:(?:(\?)|(\!))\s*)?(=|:|;|,|$))))|(?<=\})
856 pop: true
997 pop: true
857 - include: variable-initializer
998 - include: variable-initializer
999+ - include: type-annotation
1000+ - include: string
1001+ - include: array-literal
1002+ - include: numeric-literal
1003+ - include: comment
858 - match: |-
1004 - match: |-
859− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1005+ (?x)(\#?[_$[:alpha:]][_$[:alnum:]]*)(?:(\?)|(\!))?(?=\s*\s*
860− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1006+ # function assignment |
861− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1007+ (=\s*(
862− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1008+ ((async\s+)?(
863− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1009+ (function\s*[(<*]) |
864− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1010+ (function\s+) |
865− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1011+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
866− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1012+ )) |
867− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1013+ ((async\s*)?(
868− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))
1014+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
869− push:
1015+ # sure shot arrow functions even if => is on new line
870− - match: |-
1016+ (
871− (?x)(?=[};,=]|$|(^(?!\s*((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1017+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
872− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1018+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
873− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1019+ (
874− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1020+ ([)]\s*:) | # ():
875− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1021+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
876− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1022+ )
877− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1023+ ) |
878− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1024+ (
879− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1025+ [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
880− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\?\s*)?(=|:))))|(?<=\})
1026+ ) |
881− pop: true
1027+ # arrow function possible to detect only with => on same line
882− - include: type-annotation
1028+ (
883− - include: string
1029+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
884− - include: array-literal
1030+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
885− - include: numeric-literal
1031+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
886− - include: comment
1032+ \s*=> # arrow operator
887− - match: |-
1033+ )
888− (?x)([_$[:alpha:]][_$[:alnum:]]*)(\?)?(?=(\?\s*)?\s*
1034+ ))
889− # function assignment |
1035+ )) |
890− (=\s*(
1036+ # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
891− ((async\s+)?(
1037+ (:\s*(
892− (function\s*[(<*]) |
1038+ (<) |
893− (function\s+) |
1039+ ([(]\s*(
894− ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1040+ ([)]) |
895− )) |
1041+ (\.\.\.) |
896− ((async\s*)?(
1042+ ([_$[:alnum:]]+\s*(
897− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
1043+ ([:,?=])|
898− # sure shot arrow functions even if => is on new line
1044+ ([)]\s*=>)
899− (
1045+ ))
900− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1046+ ))
901− [(]\s*
1047+ )) |
902− (
1048+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
903− ([)]\s*:) | # ():
1049+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
904− ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1050+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
905− )
1051+ ((async\s+)?(
906− ) |
1052+ (function\s*[(<*]) |
907− (
1053+ (function\s+) |
908− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
1054+ ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
909− ) |
1055+ )) |
910− # arrow function possible to detect only with => on same line
1056+ ((async\s*)?(
911− (
1057+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
912− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1058+ # sure shot arrow functions even if => is on new line
913− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1059+ (
914− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1060+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
915− \s*=> # arrow operator
1061+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
916− )
1062+ (
917− ))
1063+ ([)]\s*:) | # ():
918− )) |
1064+ ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
919− # typeannotation is fn type: < | () | (... | (param: | (param, | (param? | (param= | (param) =>
1065+ )
920− (:\s*(
1066+ ) |
921− (<) |
1067+ (
922− ([(]\s*(
1068+ [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
923− ([)]) |
1069+ ) |
924− (\.\.\.) |
1070+ # arrow function possible to detect only with => on same line
925− ([_$[:alnum:]]+\s*(
1071+ (
926− ([:,?=])|
1072+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
927− ([)]\s*=>)
1073+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
928− ))
1074+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
929− ))
1075+ \s*=> # arrow operator
930− )) |
1076+ )
931− (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
1077+ ))
932− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1078+ )))
933− ((async\s+)?(
1079+ captures:
934− (function\s*[(<*]) |
1080+ 1: meta.definition.property.tsx entity.name.function.tsx
935− (function\s+) |
1081+ 2: keyword.operator.optional.tsx
936− ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1082+ 3: keyword.operator.definiteassignment.tsx
937− )) |
1083+ - match: '\#?[_$[:alpha:]][_$[:alnum:]]*'
938− ((async\s*)?(
1084+ scope: meta.definition.property.tsx variable.object.property.tsx
939− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
1085+ - match: \?
940− # sure shot arrow functions even if => is on new line
1086+ scope: keyword.operator.optional.tsx
941− (
1087+ - match: \!
942− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1088+ scope: keyword.operator.definiteassignment.tsx
943− [(]\s*
944− (
945− ([)]\s*:) | # ():
946− ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
947− )
948− ) |
949− (
950− [<]\s*[_$[:alpha:]][_$[:alnum:]]*\s+extends\s*[^=>] # < typeparam extends
951− ) |
952− # arrow function possible to detect only with => on same line
953− (
954− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
955− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
956− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
957− \s*=> # arrow operator
958− )
959− ))
960− )))
961− captures:
962− 1: meta.definition.property.tsx entity.name.function.tsx
963− 2: keyword.operator.optional.tsx
964− - match: "[_$[:alpha:]][_$[:alnum:]]*"
965− scope: meta.definition.property.tsx variable.object.property.tsx
966− - match: \?
967− scope: keyword.operator.optional.tsx
968 for-loop:
1089 for-loop:
969 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
1090 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))for(?=((\s+|(\s*\/\*([^\*]|(\*[^\/]))*\*\/\s*))await)?\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)?(\())'
970 captures:
1091 captures:
@@ -991,43 +1112,59 @@ contexts:
991 - include: type-parameters
1112 - include: type-parameters
992 - include: function-parameters
1113 - include: function-parameters
993 - include: return-type
1114 - include: return-type
1115+ - include: type-function-return-type
994 - include: decl-block
1116 - include: decl-block
995 - match: \*
1117 - match: \*
996 scope: keyword.generator.asterisk.tsx
1118 scope: keyword.generator.asterisk.tsx
997 function-call:
1119 function-call:
998− - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1120+ - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
999 push:
1121 push:
1000− - match: '(?<=\))(?!(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1122+ - match: '(?<=\))(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
1001 pop: true
1123 pop: true
1002− - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
1124+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1003 push:
1125 push:
1004 - meta_scope: meta.function-call.tsx
1126 - meta_scope: meta.function-call.tsx
1005− - match: '(?=\s*(\?\.\s*)?(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)?\()'
1127+ - match: '(?=\s*(?:(\?\.\s*)|(\!))?((<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?\())'
1006 pop: true
1128 pop: true
1007− - include: literal
1129+ - include: function-call-target
1008− - include: support-objects
1009− - include: object-identifiers
1010− - include: punctuation-accessor
1011− - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
1012− scope: keyword.operator.expression.import.tsx
1013− - match: "([_$[:alpha:]][_$[:alnum:]]*)"
1014− scope: entity.name.function.tsx
1015 - include: comment
1130 - include: comment
1016− - match: \?\.
1131+ - include: function-call-optionals
1017− scope: meta.function-call.tsx punctuation.accessor.optional.tsx
1018 - include: type-arguments
1132 - include: type-arguments
1019 - include: paren-expression
1133 - include: paren-expression
1134+ - match: '(?=(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))(<\s*[\{\[\(]\s*$))'
1135+ push:
1136+ - match: '(?<=\>)(?!(((([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))|(?<=[\)]))(<\s*[\{\[\(]\s*$))'
1137+ pop: true
1138+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*)(\s*\??\.\s*(\#?[_$[:alpha:]][_$[:alnum:]]*))*)|(\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*))'
1139+ push:
1140+ - meta_scope: meta.function-call.tsx
1141+ - match: '(?=(<\s*[\{\[\(]\s*$))'
1142+ pop: true
1143+ - include: function-call-target
1144+ - include: comment
1145+ - include: function-call-optionals
1146+ - include: type-arguments
1147+ function-call-optionals:
1148+ - match: \?\.
1149+ scope: meta.function-call.tsx punctuation.accessor.optional.tsx
1150+ - match: \!
1151+ scope: meta.function-call.tsx keyword.operator.definiteassignment.tsx
1152+ function-call-target:
1153+ - include: support-function-call-identifiers
1154+ - match: '(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1155+ scope: entity.name.function.tsx
1020 function-declaration:
1156 function-declaration:
1021− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1157+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?(?:(async)\s+)?(function\b)(?:\s*(\*))?(?:(?:\s+|(?<=\*))([_$[:alpha:]][_$[:alnum:]]*))?\s*'
1022 captures:
1158 captures:
1023 1: keyword.control.export.tsx
1159 1: keyword.control.export.tsx
1024− 2: storage.modifier.async.tsx
1160+ 2: storage.modifier.tsx
1025− 3: storage.type.function.tsx
1161+ 3: storage.modifier.async.tsx
1026− 4: keyword.generator.asterisk.tsx
1162+ 4: storage.type.function.tsx
1027− 5: meta.definition.function.tsx entity.name.function.tsx
1163+ 5: keyword.generator.asterisk.tsx
1164+ 6: meta.definition.function.tsx entity.name.function.tsx
1028 push:
1165 push:
1029 - meta_scope: meta.function.tsx
1166 - meta_scope: meta.function.tsx
1030− - match: '(?=$|^|;)|(?<=\})'
1167+ - match: '(?=;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|(?<=\})'
1031 pop: true
1168 pop: true
1032 - include: function-name
1169 - include: function-name
1033 - include: function-body
1170 - include: function-body
@@ -1040,9 +1177,10 @@ contexts:
1040 4: meta.definition.function.tsx entity.name.function.tsx
1177 4: meta.definition.function.tsx entity.name.function.tsx
1041 push:
1178 push:
1042 - meta_scope: meta.function.expression.tsx
1179 - meta_scope: meta.function.expression.tsx
1043− - match: '(?<=\})'
1180+ - match: '(?=;)|(?<=\})'
1044 pop: true
1181 pop: true
1045 - include: function-name
1182 - include: function-name
1183+ - include: single-line-comment-consuming-line-ending
1046 - include: function-body
1184 - include: function-body
1047 function-name:
1185 function-name:
1048 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1186 - match: "[_$[:alpha:]][_$[:alnum:]]*"
@@ -1060,10 +1198,11 @@ contexts:
1060 - include: function-parameters-body
1198 - include: function-parameters-body
1061 function-parameters-body:
1199 function-parameters-body:
1062 - include: comment
1200 - include: comment
1201+ - include: string
1063 - include: decorator
1202 - include: decorator
1064 - include: destructuring-parameter
1203 - include: destructuring-parameter
1065 - include: parameter-name
1204 - include: parameter-name
1066− - include: type-annotation
1205+ - include: parameter-type-annotation
1067 - include: variable-initializer
1206 - include: variable-initializer
1068 - match: ","
1207 - match: ","
1069 scope: punctuation.separator.parameter.tsx
1208 scope: punctuation.separator.parameter.tsx
@@ -1077,11 +1216,11 @@ contexts:
1077 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1216 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1078 )) |
1217 )) |
1079 ((async\s*)?(
1218 ((async\s*)?(
1080− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
1219+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1081 # sure shot arrow functions even if => is on new line
1220 # sure shot arrow functions even if => is on new line
1082 (
1221 (
1083− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
1222+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1084− [(]\s*
1223+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1085 (
1224 (
1086 ([)]\s*:) | # ():
1225 ([)]\s*:) | # ():
1087 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
1226 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -1092,9 +1231,9 @@ contexts:
1092 ) |
1231 ) |
1093 # arrow function possible to detect only with => on same line
1232 # arrow function possible to detect only with => on same line
1094 (
1233 (
1095− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
1234+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1096− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
1235+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1097− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
1236+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1098 \s*=> # arrow operator
1237 \s*=> # arrow operator
1099 )
1238 )
1100 ))
1239 ))
@@ -1103,12 +1242,12 @@ contexts:
1103 1: punctuation.accessor.tsx
1242 1: punctuation.accessor.tsx
1104 2: punctuation.accessor.optional.tsx
1243 2: punctuation.accessor.optional.tsx
1105 3: entity.name.function.tsx
1244 3: entity.name.function.tsx
1106− - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])'
1245+ - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(\#?[[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])'
1107 captures:
1246 captures:
1108 1: punctuation.accessor.tsx
1247 1: punctuation.accessor.tsx
1109 2: punctuation.accessor.optional.tsx
1248 2: punctuation.accessor.optional.tsx
1110 3: variable.other.constant.property.tsx
1249 3: variable.other.constant.property.tsx
1111− - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*([_$[:alpha:]][_$[:alnum:]]*)'
1250+ - match: '(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(\#?[_$[:alpha:]][_$[:alnum:]]*)'
1112 captures:
1251 captures:
1113 1: punctuation.accessor.tsx
1252 1: punctuation.accessor.tsx
1114 2: punctuation.accessor.optional.tsx
1253 2: punctuation.accessor.optional.tsx
@@ -1117,15 +1256,46 @@ contexts:
1117 scope: variable.other.constant.tsx
1256 scope: variable.other.constant.tsx
1118 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1257 - match: "[_$[:alpha:]][_$[:alnum:]]*"
1119 scope: variable.other.readwrite.tsx
1258 scope: variable.other.readwrite.tsx
1259+ if-statement:
1260+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?=\bif\s*(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))\s*(?!\{))'
1261+ push:
1262+ - match: '(?=;|$|\})'
1263+ pop: true
1264+ - include: comment
1265+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(if)\s*(\()'
1266+ captures:
1267+ 1: keyword.control.conditional.tsx
1268+ 2: meta.brace.round.tsx
1269+ push:
1270+ - match: \)
1271+ captures:
1272+ 0: meta.brace.round.tsx
1273+ pop: true
1274+ - include: expression
1275+ - match: '(?<=\))\s*\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)*\])+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
1276+ captures:
1277+ 0: punctuation.definition.string.begin.tsx
1278+ push:
1279+ - meta_scope: string.regexp.tsx
1280+ - match: "(/)([dgimsuy]*)"
1281+ captures:
1282+ 1: punctuation.definition.string.end.tsx
1283+ 2: keyword.other.tsx
1284+ pop: true
1285+ - include: regexp
1286+ - include: statements
1120 import-declaration:
1287 import-declaration:
1121− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1288+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type)(?!\s+from))?(?!\s*[:\(])(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1122 captures:
1289 captures:
1123 1: keyword.control.export.tsx
1290 1: keyword.control.export.tsx
1124− 2: keyword.control.import.tsx
1291+ 2: storage.modifier.tsx
1292+ 3: keyword.control.import.tsx
1293+ 4: keyword.control.type.tsx
1125 push:
1294 push:
1126 - meta_scope: meta.import.tsx
1295 - meta_scope: meta.import.tsx
1127 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1296 - match: '(?<!^import|[^\._$[:alnum:]]import)(?=;|$|^)'
1128 pop: true
1297 pop: true
1298+ - include: single-line-comment-consuming-line-ending
1129 - include: comment
1299 - include: comment
1130 - include: string
1300 - include: string
1131 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
1301 - match: '(?<=^import|[^\._$[:alnum:]]import)(?!\s*["''])'
@@ -1137,14 +1307,16 @@ contexts:
1137 - include: import-export-declaration
1307 - include: import-export-declaration
1138 - include: import-export-declaration
1308 - include: import-export-declaration
1139 import-equals-declaration:
1309 import-equals-declaration:
1140− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1310+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type))?\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(require)\s*(\()'
1141 captures:
1311 captures:
1142 1: keyword.control.export.tsx
1312 1: keyword.control.export.tsx
1143− 2: keyword.control.import.tsx
1313+ 2: storage.modifier.tsx
1144− 3: variable.other.readwrite.alias.tsx
1314+ 3: keyword.control.import.tsx
1145− 4: keyword.operator.assignment.tsx
1315+ 4: keyword.control.type.tsx
1146− 5: keyword.control.require.tsx
1316+ 5: variable.other.readwrite.alias.tsx
1147− 6: meta.brace.round.tsx
1317+ 6: keyword.operator.assignment.tsx
1318+ 7: keyword.control.require.tsx
1319+ 8: meta.brace.round.tsx
1148 push:
1320 push:
1149 - meta_scope: meta.import-equals.external.tsx
1321 - meta_scope: meta.import-equals.external.tsx
1150 - match: \)
1322 - match: \)
@@ -1153,16 +1325,19 @@ contexts:
1153 pop: true
1325 pop: true
1154 - include: comment
1326 - include: comment
1155 - include: string
1327 - include: string
1156− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(import)\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1328+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(import)(?:\s+(type))?\s+([_$[:alpha:]][_$[:alnum:]]*)\s*(=)\s*(?!require\b)'
1157 captures:
1329 captures:
1158 1: keyword.control.export.tsx
1330 1: keyword.control.export.tsx
1159− 2: keyword.control.import.tsx
1331+ 2: storage.modifier.tsx
1160− 3: variable.other.readwrite.alias.tsx
1332+ 3: keyword.control.import.tsx
1161− 4: keyword.operator.assignment.tsx
1333+ 4: keyword.control.type.tsx
1334+ 5: variable.other.readwrite.alias.tsx
1335+ 6: keyword.operator.assignment.tsx
1162 push:
1336 push:
1163 - meta_scope: meta.import-equals.internal.tsx
1337 - meta_scope: meta.import-equals.internal.tsx
1164 - match: (?=;|$|^)
1338 - match: (?=;|$|^)
1165 pop: true
1339 pop: true
1340+ - include: single-line-comment-consuming-line-ending
1166 - include: comment
1341 - include: comment
1167 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1342 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
1168 captures:
1343 captures:
@@ -1184,7 +1359,7 @@ contexts:
1184 - include: import-export-clause
1359 - include: import-export-clause
1185 import-export-clause:
1360 import-export-clause:
1186 - include: comment
1361 - include: comment
1187− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(\bdefault(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(\b[_$[:alpha:]][_$[:alnum:]]*))'
1362+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bdefault)|(\*)|(\b[_$[:alpha:]][_$[:alnum:]]*))\s+(as)\s+(?:(default(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|([_$[:alpha:]][_$[:alnum:]]*))'
1188 captures:
1363 captures:
1189 1: keyword.control.default.tsx
1364 1: keyword.control.default.tsx
1190 2: constant.language.import-export-all.tsx
1365 2: constant.language.import-export-all.tsx
@@ -1236,6 +1411,9 @@ contexts:
1236 2: keyword.operator.type.modifier.tsx
1411 2: keyword.operator.type.modifier.tsx
1237 3: keyword.operator.optional.tsx
1412 3: keyword.operator.optional.tsx
1238 pop: true
1413 pop: true
1414+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
1415+ captures:
1416+ 1: keyword.control.as.tsx
1239 - include: type
1417 - include: type
1240 inline-tags:
1418 inline-tags:
1241 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
1419 - match: '(\[)[^\]]+(\])(?={@(?:link|linkcode|linkplain|tutorial))'
@@ -1267,15 +1445,16 @@ contexts:
1267 captures:
1445 captures:
1268 1: keyword.operator.expression.instanceof.tsx
1446 1: keyword.operator.expression.instanceof.tsx
1269 push:
1447 push:
1270− - match: '(?<=\))|(?=[;),}\]:?]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1448+ - match: '(?<=\))|(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|(([\&\~\^\|]\s*)?[_$[:alpha:]][_$[:alnum:]]*\s+instanceof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1271 pop: true
1449 pop: true
1272 - include: type
1450 - include: type
1273 interface-declaration:
1451 interface-declaration:
1274− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(export)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1452+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(?:(abstract)\s+)?\b(interface)\b(?=\s+|/[/*])'
1275 captures:
1453 captures:
1276 1: keyword.control.export.tsx
1454 1: keyword.control.export.tsx
1277 2: storage.modifier.tsx
1455 2: storage.modifier.tsx
1278− 3: storage.type.interface.tsx
1456+ 3: storage.modifier.tsx
1457+ 4: storage.type.interface.tsx
1279 push:
1458 push:
1280 - meta_scope: meta.interface.tsx
1459 - meta_scope: meta.interface.tsx
1281 - match: '(?<=\})'
1460 - match: '(?<=\})'
@@ -1323,7 +1502,7 @@ contexts:
1323 captures:
1502 captures:
1324 0: punctuation.section.embedded.begin.tsx
1503 0: punctuation.section.embedded.begin.tsx
1325 push:
1504 push:
1326− - meta_scope: meta.embedded.expression.tsx
1505+ - meta_content_scope: meta.embedded.expression.tsx
1327 - match: '\}'
1506 - match: '\}'
1328 captures:
1507 captures:
1329 0: punctuation.section.embedded.end.tsx
1508 0: punctuation.section.embedded.end.tsx
@@ -1352,10 +1531,10 @@ contexts:
1352 pop: true
1531 pop: true
1353 - include: jsx-entities
1532 - include: jsx-entities
1354 jsx-tag:
1533 jsx-tag:
1355− - match: '(?=(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))'
1534+ - match: '(?=(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))'
1356 push:
1535 push:
1357 - meta_scope: meta.tag.tsx
1536 - meta_scope: meta.tag.tsx
1358− - match: '(/>)|(?:(</)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1537+ - match: '(/>)|(?:(</)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1359 captures:
1538 captures:
1360 1: punctuation.definition.tag.end.tsx
1539 1: punctuation.definition.tag.end.tsx
1361 2: punctuation.definition.tag.begin.tsx
1540 2: punctuation.definition.tag.begin.tsx
@@ -1365,7 +1544,7 @@ contexts:
1365 6: support.class.component.tsx
1544 6: support.class.component.tsx
1366 7: punctuation.definition.tag.end.tsx
1545 7: punctuation.definition.tag.end.tsx
1367 pop: true
1546 pop: true
1368− - match: '(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>)'
1547+ - match: '(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>)'
1369 captures:
1548 captures:
1370 1: punctuation.definition.tag.begin.tsx
1549 1: punctuation.definition.tag.begin.tsx
1371 2: entity.name.tag.namespace.tsx
1550 2: entity.name.tag.namespace.tsx
@@ -1393,8 +1572,8 @@ contexts:
1393 - match: |-
1572 - match: |-
1394 (?x)
1573 (?x)
1395 \s*
1574 \s*
1396− (?:([_$[:alpha:]][-$[:alnum:].]*)(:))?
1575+ (?:([_$[:alpha:]][-_$[:alnum:].]*)(:))?
1397− ([_$[:alpha:]][-$[:alnum:]]*)
1576+ ([_$[:alpha:]][-_$[:alnum:]]*)
1398 (?=\s|=|/?>|/\*|//)
1577 (?=\s|=|/?>|/\*|//)
1399 captures:
1578 captures:
1400 1: entity.other.attribute-name.namespace.tsx
1579 1: entity.other.attribute-name.namespace.tsx
@@ -1419,15 +1598,15 @@ contexts:
1419 jsx-tag-in-expression:
1598 jsx-tag-in-expression:
1420 - match: |-
1599 - match: |-
1421 (?x)
1600 (?x)
1422− (?<!\+\+|--)(?<=[({\[,?=>:*]|&&|\|\||\?|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s*
1601+ (?<!\+\+|--)(?<=[({\[,?=>:*]|&&|\|\||\?|\*\/|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s*
1423 (?!<\s*[_$[:alpha:]][_$[:alnum:]]*((\s+extends\s+[^=>])|,)) # look ahead is not type parameter of arrow
1602 (?!<\s*[_$[:alpha:]][_$[:alnum:]]*((\s+extends\s+[^=>])|,)) # look ahead is not type parameter of arrow
1424− (?=(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))
1603+ (?=(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))
1425 push:
1604 push:
1426− - match: '(?!(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))'
1605+ - match: '(?!(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))(?=((<\s*)|(\s+))(?!\?)|\/?>))'
1427 pop: true
1606 pop: true
1428 - include: jsx-tag
1607 - include: jsx-tag
1429 jsx-tag-without-attributes:
1608 jsx-tag-without-attributes:
1430− - match: '(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))?\s*(>)'
1609+ - match: '(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))?\s*(>)'
1431 captures:
1610 captures:
1432 1: punctuation.definition.tag.begin.tsx
1611 1: punctuation.definition.tag.begin.tsx
1433 2: entity.name.tag.namespace.tsx
1612 2: entity.name.tag.namespace.tsx
@@ -1438,7 +1617,7 @@ contexts:
1438 push:
1617 push:
1439 - meta_scope: meta.tag.without-attributes.tsx
1618 - meta_scope: meta.tag.without-attributes.tsx
1440 - meta_content_scope: meta.jsx.children.tsx
1619 - meta_content_scope: meta.jsx.children.tsx
1441− - match: '(</)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))?\s*(>)'
1620+ - match: '(</)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))?\s*(>)'
1442 captures:
1621 captures:
1443 1: punctuation.definition.tag.begin.tsx
1622 1: punctuation.definition.tag.begin.tsx
1444 2: entity.name.tag.namespace.tsx
1623 2: entity.name.tag.namespace.tsx
@@ -1449,9 +1628,9 @@ contexts:
1449 pop: true
1628 pop: true
1450 - include: jsx-children
1629 - include: jsx-children
1451 jsx-tag-without-attributes-in-expression:
1630 jsx-tag-without-attributes-in-expression:
1452− - match: '(?<!\+\+|--)(?<=[({\[,?=>:*]|&&|\|\||\?|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s*(?=(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1631+ - match: '(?<!\+\+|--)(?<=[({\[,?=>:*]|&&|\|\||\?|\*\/|^await|[^\._$[:alnum:]]await|^return|[^\._$[:alnum:]]return|^default|[^\._$[:alnum:]]default|^yield|[^\._$[:alnum:]]yield|^)\s*(?=(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1453 push:
1632 push:
1454− - match: '(?!(<)\s*(?:([_$[:alpha:]][-$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1633+ - match: '(?!(<)\s*(?:([_$[:alpha:]][-_$[:alnum:].]*)(?<!\.|-)(:))?((?:[a-z][a-z0-9]*|([_$[:alpha:]][-_$[:alnum:].]*))(?<!\.|-))?\s*(>))'
1455 pop: true
1634 pop: true
1456 - include: jsx-tag-without-attributes
1635 - include: jsx-tag-without-attributes
1457 label:
1636 label:
@@ -1477,25 +1656,27 @@ contexts:
1477 - include: this-literal
1656 - include: this-literal
1478 - include: super-literal
1657 - include: super-literal
1479 method-declaration:
1658 method-declaration:
1480− - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1659+ - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?\s*\b(constructor)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1481 captures:
1660 captures:
1482 1: storage.modifier.tsx
1661 1: storage.modifier.tsx
1483 2: storage.modifier.tsx
1662 2: storage.modifier.tsx
1484− 3: storage.modifier.async.tsx
1663+ 3: storage.modifier.tsx
1485− 4: storage.type.tsx
1664+ 4: storage.modifier.async.tsx
1665+ 5: storage.type.tsx
1486 push:
1666 push:
1487 - meta_scope: meta.method.declaration.tsx
1667 - meta_scope: meta.method.declaration.tsx
1488 - match: '(?=\}|;|,|$)|(?<=\})'
1668 - match: '(?=\}|;|,|$)|(?<=\})'
1489 pop: true
1669 pop: true
1490 - include: method-declaration-name
1670 - include: method-declaration-name
1491 - include: function-body
1671 - include: function-body
1492− - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*[\(\<])'
1672+ - match: '(?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:(?:\s*\b(new)\b(?!:)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|(?:(\*)\s*)?)(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])'
1493 captures:
1673 captures:
1494 1: storage.modifier.tsx
1674 1: storage.modifier.tsx
1495 2: storage.modifier.tsx
1675 2: storage.modifier.tsx
1496− 3: storage.modifier.async.tsx
1676+ 3: storage.modifier.tsx
1497− 4: keyword.operator.new.tsx
1677+ 4: storage.modifier.async.tsx
1498− 5: keyword.generator.asterisk.tsx
1678+ 5: keyword.operator.new.tsx
1679+ 6: keyword.generator.asterisk.tsx
1499 push:
1680 push:
1500 - meta_scope: meta.method.declaration.tsx
1681 - meta_scope: meta.method.declaration.tsx
1501 - match: '(?=\}|;|,|$)|(?<=\})'
1682 - match: '(?=\}|;|,|$)|(?<=\})'
@@ -1503,22 +1684,23 @@ contexts:
1503 - include: method-declaration-name
1684 - include: method-declaration-name
1504 - include: function-body
1685 - include: function-body
1505 - match: |-
1686 - match: |-
1506− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1687+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(override)\s+)?(?:\b(public|private|protected)\s+)?(?:\b(abstract)\s+)?(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1507− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1688+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1508− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1689+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1509− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1690+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1510− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1691+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1511− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1692+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1512− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1693+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1513− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1694+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1514− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1695+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1515− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1696+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1516 captures:
1697 captures:
1517 1: storage.modifier.tsx
1698 1: storage.modifier.tsx
1518 2: storage.modifier.tsx
1699 2: storage.modifier.tsx
1519− 3: storage.modifier.async.tsx
1700+ 3: storage.modifier.tsx
1520− 4: storage.type.property.tsx
1701+ 4: storage.modifier.async.tsx
1521− 5: keyword.generator.asterisk.tsx
1702+ 5: storage.type.property.tsx
1703+ 6: keyword.generator.asterisk.tsx
1522 push:
1704 push:
1523 - meta_scope: meta.method.declaration.tsx
1705 - meta_scope: meta.method.declaration.tsx
1524 - match: '(?=\}|;|,|$)|(?<=\})'
1706 - match: '(?=\}|;|,|$)|(?<=\})'
@@ -1527,16 +1709,16 @@ contexts:
1527 - include: function-body
1709 - include: function-body
1528 method-declaration-name:
1710 method-declaration-name:
1529 - match: |-
1711 - match: |-
1530− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1712+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1531− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1713+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1532− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1714+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1533− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1715+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1534− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1716+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1535− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1717+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1536− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1718+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1537− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1719+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1538− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1720+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1539− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1721+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??)\s*[\(\<])
1540 push:
1722 push:
1541 - match: (?=\(|\<)
1723 - match: (?=\(|\<)
1542 pop: true
1724 pop: true
@@ -1548,13 +1730,14 @@ contexts:
1548 - match: \?
1730 - match: \?
1549 scope: keyword.operator.optional.tsx
1731 scope: keyword.operator.optional.tsx
1550 namespace-declaration:
1732 namespace-declaration:
1551− - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1733+ - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(namespace|module)\s+(?=[_$[:alpha:]"''`]))'
1552 captures:
1734 captures:
1553 1: keyword.control.export.tsx
1735 1: keyword.control.export.tsx
1554− 2: storage.type.namespace.tsx
1736+ 2: storage.modifier.tsx
1737+ 3: storage.type.namespace.tsx
1555 push:
1738 push:
1556 - meta_scope: meta.namespace.declaration.tsx
1739 - meta_scope: meta.namespace.declaration.tsx
1557− - match: '(?<=\})|(?=;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
1740+ - match: '(?<=\})|(?=;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
1558 pop: true
1741 pop: true
1559 - include: comment
1742 - include: comment
1560 - include: string
1743 - include: string
@@ -1568,41 +1751,53 @@ contexts:
1568 1: keyword.operator.new.tsx
1751 1: keyword.operator.new.tsx
1569 push:
1752 push:
1570 - meta_scope: new.expr.tsx
1753 - meta_scope: new.expr.tsx
1571− - match: '(?<=\))|(?=[;),}\]:]|\|\||\&\&|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1754+ - match: '(?<=\))|(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))new(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))function((\s+[_$[:alpha:]][_$[:alnum:]]*)|(\s*[\(]))))'
1572 pop: true
1755 pop: true
1573− - include: paren-expression
1756+ - include: expression
1574− - include: class-declaration
1575− - include: type
1576 null-literal:
1757 null-literal:
1577 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1758 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))null(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1578 scope: constant.language.null.tsx
1759 scope: constant.language.null.tsx
1579 numeric-literal:
1760 numeric-literal:
1580− - match: '\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$)'
1761+ - match: '\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$)'
1581 scope: constant.numeric.hex.tsx
1762 scope: constant.numeric.hex.tsx
1582− - match: '\b(?<!\$)0(b|B)[01][01_]*\b(?!\$)'
1763+ captures:
1764+ 1: storage.type.numeric.bigint.tsx
1765+ - match: '\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$)'
1583 scope: constant.numeric.binary.tsx
1766 scope: constant.numeric.binary.tsx
1584− - match: '\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$)'
1767+ captures:
1768+ 1: storage.type.numeric.bigint.tsx
1769+ - match: '\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$)'
1585 scope: constant.numeric.octal.tsx
1770 scope: constant.numeric.octal.tsx
1771+ captures:
1772+ 1: storage.type.numeric.bigint.tsx
1586 - match: |-
1773 - match: |-
1587 (?x)
1774 (?x)
1588 (?<!\$)(?:
1775 (?<!\$)(?:
1589− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1776+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1590− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1777+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1591− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1778+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1592− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1779+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1593− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1780+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1594− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1781+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1595− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1782+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1596− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1783+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1597 )(?!\$)
1784 )(?!\$)
1598 captures:
1785 captures:
1599 0: constant.numeric.decimal.tsx
1786 0: constant.numeric.decimal.tsx
1600 1: meta.delimiter.decimal.period.tsx
1787 1: meta.delimiter.decimal.period.tsx
1601− 2: meta.delimiter.decimal.period.tsx
1788+ 2: storage.type.numeric.bigint.tsx
1602 3: meta.delimiter.decimal.period.tsx
1789 3: meta.delimiter.decimal.period.tsx
1603− 4: meta.delimiter.decimal.period.tsx
1790+ 4: storage.type.numeric.bigint.tsx
1604 5: meta.delimiter.decimal.period.tsx
1791 5: meta.delimiter.decimal.period.tsx
1605− 6: meta.delimiter.decimal.period.tsx
1792+ 6: storage.type.numeric.bigint.tsx
1793+ 7: storage.type.numeric.bigint.tsx
1794+ 8: meta.delimiter.decimal.period.tsx
1795+ 9: storage.type.numeric.bigint.tsx
1796+ 10: meta.delimiter.decimal.period.tsx
1797+ 11: storage.type.numeric.bigint.tsx
1798+ 12: meta.delimiter.decimal.period.tsx
1799+ 13: storage.type.numeric.bigint.tsx
1800+ 14: storage.type.numeric.bigint.tsx
1606 numericConstant-literal:
1801 numericConstant-literal:
1607 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1802 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))NaN(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
1608 scope: constant.language.nan.tsx
1803 scope: constant.language.nan.tsx
@@ -1611,16 +1806,16 @@ contexts:
1611 object-binding-element:
1806 object-binding-element:
1612 - include: comment
1807 - include: comment
1613 - match: |-
1808 - match: |-
1614− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1809+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1615− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1810+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1616− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1811+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1617− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1812+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1618− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1813+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1619− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1814+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1620− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1815+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1621− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1816+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1622− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1817+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1623− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1818+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1624 push:
1819 push:
1625 - match: '(?=,|\})'
1820 - match: '(?=,|\})'
1626 pop: true
1821 pop: true
@@ -1633,16 +1828,16 @@ contexts:
1633 object-binding-element-const:
1828 object-binding-element-const:
1634 - include: comment
1829 - include: comment
1635 - match: |-
1830 - match: |-
1636− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1831+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1637− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1832+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1638− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1833+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1639− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1834+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1640− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1835+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1641− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1836+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1642− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1837+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1643− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1838+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1644− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1839+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1645− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1840+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1646 push:
1841 push:
1647 - match: '(?=,|\})'
1842 - match: '(?=,|\})'
1648 pop: true
1843 pop: true
@@ -1654,16 +1849,16 @@ contexts:
1654 - include: punctuation-comma
1849 - include: punctuation-comma
1655 object-binding-element-propertyName:
1850 object-binding-element-propertyName:
1656 - match: |-
1851 - match: |-
1657− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1852+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1658− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1853+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1659− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1854+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1660− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1855+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1661− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1856+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1662− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1857+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1663− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1858+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1664− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1859+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1665− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1860+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1666− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1861+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
1667 push:
1862 push:
1668 - match: (:)
1863 - match: (:)
1669 captures:
1864 captures:
@@ -1701,9 +1896,9 @@ contexts:
1701 scope: support.class.tsx
1896 scope: support.class.tsx
1702 - match: |-
1897 - match: |-
1703 (?x)(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
1898 (?x)(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(?:
1704− ([[:upper:]][_$[:digit:][:upper:]]*) |
1899+ (\#?[[:upper:]][_$[:digit:][:upper:]]*) |
1705− ([_$[:alpha:]][_$[:alnum:]]*)
1900+ (\#?[_$[:alpha:]][_$[:alnum:]]*)
1706− )(?=\s*\??\.\s*[_$[:alpha:]][_$[:alnum:]]*)
1901+ )(?=\s*\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*)
1707 captures:
1902 captures:
1708 1: punctuation.accessor.tsx
1903 1: punctuation.accessor.tsx
1709 2: punctuation.accessor.optional.tsx
1904 2: punctuation.accessor.optional.tsx
@@ -1713,7 +1908,7 @@ contexts:
1713 (?x)(?:
1908 (?x)(?:
1714 ([[:upper:]][_$[:digit:][:upper:]]*) |
1909 ([[:upper:]][_$[:digit:][:upper:]]*) |
1715 ([_$[:alpha:]][_$[:alnum:]]*)
1910 ([_$[:alpha:]][_$[:alnum:]]*)
1716− )(?=\s*\??\.\s*[_$[:alpha:]][_$[:alnum:]]*)
1911+ )(?=\s*\??\.\s*\#?[_$[:alpha:]][_$[:alnum:]]*)
1717 captures:
1912 captures:
1718 1: variable.other.constant.object.tsx
1913 1: variable.other.constant.object.tsx
1719 2: variable.other.object.tsx
1914 2: variable.other.object.tsx
@@ -1730,16 +1925,16 @@ contexts:
1730 - include: object-member
1925 - include: object-member
1731 object-literal-method-declaration:
1926 object-literal-method-declaration:
1732 - match: |-
1927 - match: |-
1733− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1928+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1734− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1929+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1735− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1930+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1736− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1931+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1737− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1932+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1738− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1933+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1739− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1934+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1740− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1935+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1741− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1936+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1742− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1937+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1743 captures:
1938 captures:
1744 1: storage.modifier.async.tsx
1939 1: storage.modifier.async.tsx
1745 2: storage.type.property.tsx
1940 2: storage.type.property.tsx
@@ -1751,16 +1946,16 @@ contexts:
1751 - include: method-declaration-name
1946 - include: method-declaration-name
1752 - include: function-body
1947 - include: function-body
1753 - match: |-
1948 - match: |-
1754− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
1949+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:\b(async)\s+)?(?:\b(get|set)\s+)?(?:(\*)\s*)?(?=\s*(((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1755− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
1950+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1756− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
1951+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1757− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
1952+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1758− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
1953+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1759− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
1954+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1760− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
1955+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1761− (?:\B(\.)[0-9][0-9_]*\b)| # .1
1956+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1762− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
1957+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1763− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*[\(\<])
1958+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(\??))\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?[\(])
1764 captures:
1959 captures:
1765 1: storage.modifier.async.tsx
1960 1: storage.modifier.async.tsx
1766 2: storage.type.property.tsx
1961 2: storage.type.property.tsx
@@ -1777,37 +1972,56 @@ contexts:
1777 - meta_scope: meta.object.member.tsx meta.object-literal.key.tsx
1972 - meta_scope: meta.object.member.tsx meta.object-literal.key.tsx
1778 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1973 - match: '(?=:)|((?<=[\]])(?=\s*[\(\<]))'
1779 pop: true
1974 pop: true
1975+ - include: comment
1780 - include: array-literal
1976 - include: array-literal
1781− - match: '(?=[\''\"])'
1977+ - match: '(?=[\''\"\`])'
1782 push:
1978 push:
1783 - meta_scope: meta.object.member.tsx meta.object-literal.key.tsx
1979 - meta_scope: meta.object.member.tsx meta.object-literal.key.tsx
1784− - match: '(?=:)|((?<=[\''\"])(?=\s*[\(\<]))'
1980+ - match: '(?=:)|((?<=[\''\"\`])(?=((\s*[\(\<,}])|(\s+(as)\s+))))'
1785 pop: true
1981 pop: true
1982+ - include: comment
1786 - include: string
1983 - include: string
1787− - match: '(?<=[\]\''\"])(?=\s*[\(\<])'
1984+ - match: |-
1985+ (?x)(?=(\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
1986+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
1987+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
1988+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
1989+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
1990+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
1991+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
1992+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
1993+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
1994+ )(?!\$)))
1995+ push:
1996+ - meta_scope: meta.object.member.tsx meta.object-literal.key.tsx
1997+ - match: '(?=:)|(?=\s*([\(\<,}])|(\s+as\s+))'
1998+ pop: true
1999+ - include: comment
2000+ - include: numeric-literal
2001+ - match: '(?<=[\]\''\"\`])(?=\s*[\(\<])'
1788 push:
2002 push:
1789 - meta_scope: meta.method.declaration.tsx
2003 - meta_scope: meta.method.declaration.tsx
1790 - match: '(?=\}|;|,)|(?<=\})'
2004 - match: '(?=\}|;|,)|(?<=\})'
1791 pop: true
2005 pop: true
1792 - include: function-body
2006 - include: function-body
1793− - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=:)'
2007+ - match: '(?![_$[:alpha:]])([[:digit:]]+)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1794 scope: meta.object.member.tsx
2008 scope: meta.object.member.tsx
1795 captures:
2009 captures:
1796 0: meta.object-literal.key.tsx
2010 0: meta.object-literal.key.tsx
1797 1: constant.numeric.decimal.tsx
2011 1: constant.numeric.decimal.tsx
1798 - match: |-
2012 - match: |-
1799− (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=:\s*(
2013+ (?x)(?:([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:(\s*\/\*([^\*]|(\*[^\/]))*\*\/)*\s*(
1800 ((async\s+)?(
2014 ((async\s+)?(
1801 (function\s*[(<*]) |
2015 (function\s*[(<*]) |
1802 (function\s+) |
2016 (function\s+) |
1803 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2017 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1804 )) |
2018 )) |
1805 ((async\s*)?(
2019 ((async\s*)?(
1806− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
2020+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1807 # sure shot arrow functions even if => is on new line
2021 # sure shot arrow functions even if => is on new line
1808 (
2022 (
1809− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
2023+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1810− [(]\s*
2024+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1811 (
2025 (
1812 ([)]\s*:) | # ():
2026 ([)]\s*:) | # ():
1813 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2027 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -1818,9 +2032,9 @@ contexts:
1818 ) |
2032 ) |
1819 # arrow function possible to detect only with => on same line
2033 # arrow function possible to detect only with => on same line
1820 (
2034 (
1821− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
2035+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1822− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2036+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1823− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
2037+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1824 \s*=> # arrow operator
2038 \s*=> # arrow operator
1825 )
2039 )
1826 ))
2040 ))
@@ -1829,7 +2043,7 @@ contexts:
1829 captures:
2043 captures:
1830 0: meta.object-literal.key.tsx
2044 0: meta.object-literal.key.tsx
1831 1: entity.name.function.tsx
2045 1: entity.name.function.tsx
1832− - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=:)'
2046+ - match: '(?:[_$[:alpha:]][_$[:alnum:]]*)\s*(?=(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*:)'
1833 scope: meta.object.member.tsx
2047 scope: meta.object.member.tsx
1834 captures:
2048 captures:
1835 0: meta.object-literal.key.tsx
2049 0: meta.object-literal.key.tsx
@@ -1841,14 +2055,27 @@ contexts:
1841 - match: '(?=,|\})'
2055 - match: '(?=,|\})'
1842 pop: true
2056 pop: true
1843 - include: expression
2057 - include: expression
1844− - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$)'
2058+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=,|\}|$|\/\/|\/\*)'
1845 scope: meta.object.member.tsx
2059 scope: meta.object.member.tsx
1846 captures:
2060 captures:
1847 1: variable.other.readwrite.tsx
2061 1: variable.other.readwrite.tsx
2062+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+(const)(?=\s*([,}]|$))'
2063+ scope: meta.object.member.tsx
2064+ captures:
2065+ 1: keyword.control.as.tsx
2066+ 2: storage.modifier.tsx
2067+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+'
2068+ captures:
2069+ 1: keyword.control.as.tsx
2070+ push:
2071+ - meta_scope: meta.object.member.tsx
2072+ - match: '(?=[;),}\]:?\-\+\>]|\|\||\&\&|\!\=\=|$|^|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(as)\s+))'
2073+ pop: true
2074+ - include: type
1848 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
2075 - match: '(?=[_$[:alpha:]][_$[:alnum:]]*\s*=)'
1849 push:
2076 push:
1850 - meta_scope: meta.object.member.tsx
2077 - meta_scope: meta.object.member.tsx
1851− - match: '(?=,|\}|$)'
2078+ - match: '(?=,|\}|$|\/\/|\/\*)'
1852 pop: true
2079 pop: true
1853 - include: expression
2080 - include: expression
1854 - match: ":"
2081 - match: ":"
@@ -1858,7 +2085,7 @@ contexts:
1858 - meta_scope: meta.object.member.tsx
2085 - meta_scope: meta.object.member.tsx
1859 - match: '(?=,|\})'
2086 - match: '(?=,|\})'
1860 pop: true
2087 pop: true
1861− - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)\(\s*([\{\[]\s*)?$)'
2088+ - match: '(?<=:)\s*(async)?(?=\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1862 captures:
2089 captures:
1863 1: storage.modifier.async.tsx
2090 1: storage.modifier.async.tsx
1864 push:
2091 push:
@@ -1874,7 +2101,7 @@ contexts:
1874 0: meta.brace.round.tsx
2101 0: meta.brace.round.tsx
1875 pop: true
2102 pop: true
1876 - include: expression-inside-possibly-arrow-parens
2103 - include: expression-inside-possibly-arrow-parens
1877− - match: '(?<=:)\s*(async)?\s*(\()(?=\s*([\{\[]\s*)?$)'
2104+ - match: '(?<=:)\s*(async)?\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
1878 captures:
2105 captures:
1879 1: storage.modifier.async.tsx
2106 1: storage.modifier.async.tsx
1880 2: meta.brace.round.tsx
2107 2: meta.brace.round.tsx
@@ -1884,6 +2111,23 @@ contexts:
1884 0: meta.brace.round.tsx
2111 0: meta.brace.round.tsx
1885 pop: true
2112 pop: true
1886 - include: expression-inside-possibly-arrow-parens
2113 - include: expression-inside-possibly-arrow-parens
2114+ - match: (?<=:)\s*(async)?\s*(?=\<\s*$)
2115+ captures:
2116+ 1: storage.modifier.async.tsx
2117+ push:
2118+ - match: (?<=\>)
2119+ pop: true
2120+ - include: type-parameters
2121+ - match: '(?<=\>)\s*(\()(?=\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2122+ captures:
2123+ 1: meta.brace.round.tsx
2124+ push:
2125+ - match: \)
2126+ captures:
2127+ 0: meta.brace.round.tsx
2128+ pop: true
2129+ - include: expression-inside-possibly-arrow-parens
2130+ - include: possibly-arrow-return-type
1887 - include: expression
2131 - include: expression
1888 - include: punctuation-comma
2132 - include: punctuation-comma
1889 parameter-array-binding-pattern:
2133 parameter-array-binding-pattern:
@@ -1901,16 +2145,18 @@ contexts:
1901 parameter-binding-element:
2145 parameter-binding-element:
1902 - include: comment
2146 - include: comment
1903 - include: string
2147 - include: string
2148+ - include: numeric-literal
2149+ - include: regex
1904 - include: parameter-object-binding-pattern
2150 - include: parameter-object-binding-pattern
1905 - include: parameter-array-binding-pattern
2151 - include: parameter-array-binding-pattern
1906 - include: destructuring-parameter-rest
2152 - include: destructuring-parameter-rest
1907 - include: variable-initializer
2153 - include: variable-initializer
1908 parameter-name:
2154 parameter-name:
1909− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|protected|private|readonly)\s+(?=(public|protected|private|readonly)\s+)'
2155+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|protected|private|readonly)\s+(?=(override|public|protected|private|readonly)\s+)'
1910 captures:
2156 captures:
1911 1: storage.modifier.tsx
2157 1: storage.modifier.tsx
1912 - match: |-
2158 - match: |-
1913− (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
2159+ (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)(?=\s*
1914 # function assignment |
2160 # function assignment |
1915 (=\s*(
2161 (=\s*(
1916 ((async\s+)?(
2162 ((async\s+)?(
@@ -1919,11 +2165,11 @@ contexts:
1919 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2165 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1920 )) |
2166 )) |
1921 ((async\s*)?(
2167 ((async\s*)?(
1922− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
2168+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1923 # sure shot arrow functions even if => is on new line
2169 # sure shot arrow functions even if => is on new line
1924 (
2170 (
1925− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
2171+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1926− [(]\s*
2172+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1927 (
2173 (
1928 ([)]\s*:) | # ():
2174 ([)]\s*:) | # ():
1929 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2175 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -1934,9 +2180,9 @@ contexts:
1934 ) |
2180 ) |
1935 # arrow function possible to detect only with => on same line
2181 # arrow function possible to detect only with => on same line
1936 (
2182 (
1937− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
2183+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1938− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2184+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1939− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
2185+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1940 \s*=> # arrow operator
2186 \s*=> # arrow operator
1941 )
2187 )
1942 ))
2188 ))
@@ -1953,19 +2199,20 @@ contexts:
1953 ))
2199 ))
1954 ))
2200 ))
1955 )) |
2201 )) |
1956− (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
2202+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
1957− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
2203+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
2204+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
1958 ((async\s+)?(
2205 ((async\s+)?(
1959 (function\s*[(<*]) |
2206 (function\s*[(<*]) |
1960 (function\s+) |
2207 (function\s+) |
1961 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2208 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
1962 )) |
2209 )) |
1963 ((async\s*)?(
2210 ((async\s*)?(
1964− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
2211+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
1965 # sure shot arrow functions even if => is on new line
2212 # sure shot arrow functions even if => is on new line
1966 (
2213 (
1967− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
2214+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
1968− [(]\s*
2215+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
1969 (
2216 (
1970 ([)]\s*:) | # ():
2217 ([)]\s*:) | # ():
1971 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
2218 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -1976,9 +2223,9 @@ contexts:
1976 ) |
2223 ) |
1977 # arrow function possible to detect only with => on same line
2224 # arrow function possible to detect only with => on same line
1978 (
2225 (
1979− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
2226+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
1980− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
2227+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
1981− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
2228+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
1982 \s*=> # arrow operator
2229 \s*=> # arrow operator
1983 )
2230 )
1984 ))
2231 ))
@@ -1989,7 +2236,7 @@ contexts:
1989 3: entity.name.function.tsx variable.language.this.tsx
2236 3: entity.name.function.tsx variable.language.this.tsx
1990 4: entity.name.function.tsx
2237 4: entity.name.function.tsx
1991 5: keyword.operator.optional.tsx
2238 5: keyword.operator.optional.tsx
1992− - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
2239+ - match: '(?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(override|public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*(\??)'
1993 captures:
2240 captures:
1994 1: storage.modifier.tsx
2241 1: storage.modifier.tsx
1995 2: keyword.operator.rest.tsx
2242 2: keyword.operator.rest.tsx
@@ -1999,16 +2246,16 @@ contexts:
1999 parameter-object-binding-element:
2246 parameter-object-binding-element:
2000 - include: comment
2247 - include: comment
2001 - match: |-
2248 - match: |-
2002− (?x)(?=((\b(?<!\$)0(x|X)[0-9a-fA-F][0-9a-fA-F_]*\b(?!\$))|(\b(?<!\$)0(b|B)[01][01_]*\b(?!\$))|(\b(?<!\$)0(o|O)?[0-7][0-7_]*\b(?!\$))|((?<!\$)(?:
2249+ (?x)(?=((\b(?<!\$)0(?:x|X)[0-9a-fA-F][0-9a-fA-F_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:b|B)[01][01_]*(n)?\b(?!\$))|(\b(?<!\$)0(?:o|O)?[0-7][0-7_]*(n)?\b(?!\$))|((?<!\$)(?:
2003− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1.1E+3
2250+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.1E+3
2004− (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*\b)| # 1.E+3
2251+ (?:\b[0-9][0-9_]*(\.)[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1.E+3
2005− (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # .1E+3
2252+ (?:\B(\.)[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # .1E+3
2006− (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*\b)| # 1E+3
2253+ (?:\b[0-9][0-9_]*[eE][+-]?[0-9][0-9_]*(n)?\b)| # 1E+3
2007− (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*\b)| # 1.1
2254+ (?:\b[0-9][0-9_]*(\.)[0-9][0-9_]*(n)?\b)| # 1.1
2008− (?:\b[0-9][0-9_]*(\.)\B)| # 1.
2255+ (?:\b[0-9][0-9_]*(\.)(n)?\B)| # 1.
2009− (?:\B(\.)[0-9][0-9_]*\b)| # .1
2256+ (?:\B(\.)[0-9][0-9_]*(n)?\b)| # .1
2010− (?:\b[0-9][0-9_]*\b(?!\.)) # 1
2257+ (?:\b[0-9][0-9_]*(n)?\b(?!\.)) # 1
2011− )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\\'|\\)*\')|(\"([^\"\\]|\\\"|\\)*\")|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
2258+ )(?!\$))|([_$[:alpha:]][_$[:alnum:]]*)|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`)|(\[([^\[\]]|\[[^\[\]]*\])+\]))\s*(:))
2012 push:
2259 push:
2013 - match: '(?=,|\})'
2260 - match: '(?=,|\})'
2014 pop: true
2261 pop: true
@@ -2029,6 +2276,15 @@ contexts:
2029 0: punctuation.definition.binding-pattern.object.tsx
2276 0: punctuation.definition.binding-pattern.object.tsx
2030 pop: true
2277 pop: true
2031 - include: parameter-object-binding-element
2278 - include: parameter-object-binding-element
2279+ parameter-type-annotation:
2280+ - match: (:)
2281+ captures:
2282+ 1: keyword.operator.type.annotation.tsx
2283+ push:
2284+ - meta_scope: meta.type.annotation.tsx
2285+ - match: "(?=[,)])|(?==[^>])"
2286+ pop: true
2287+ - include: type
2032 paren-expression:
2288 paren-expression:
2033 - match: \(
2289 - match: \(
2034 captures:
2290 captures:
@@ -2040,14 +2296,14 @@ contexts:
2040 pop: true
2296 pop: true
2041 - include: expression
2297 - include: expression
2042 paren-expression-possibly-arrow:
2298 paren-expression-possibly-arrow:
2043− - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\(\s*[\{\[]\s*$)'
2299+ - match: '(?<=[(=,])\s*(async)?(?=\s*((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\(\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))'
2044 captures:
2300 captures:
2045 1: storage.modifier.async.tsx
2301 1: storage.modifier.async.tsx
2046 push:
2302 push:
2047 - match: (?<=\))
2303 - match: (?<=\))
2048 pop: true
2304 pop: true
2049 - include: paren-expression-possibly-arrow-with-typeparameters
2305 - include: paren-expression-possibly-arrow-with-typeparameters
2050− - match: '(?<=[(=,]|=>)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*))?\()|(<))\s*$)'
2306+ - match: '(?<=[(=,]|=>|^return|[^\._$[:alnum:]]return)\s*(async)?(?=\s*((((<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*))?\()|(<))\s*$)'
2051 captures:
2307 captures:
2052 1: storage.modifier.async.tsx
2308 1: storage.modifier.async.tsx
2053 push:
2309 push:
@@ -2067,7 +2323,7 @@ contexts:
2067 pop: true
2323 pop: true
2068 - include: expression-inside-possibly-arrow-parens
2324 - include: expression-inside-possibly-arrow-parens
2069 possibly-arrow-return-type:
2325 possibly-arrow-return-type:
2070− - match: '(?<=\))\s*(:)(?=\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+\s*=>)'
2326+ - match: '(?<=\)|^)\s*(:)(?=\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*=>)'
2071 captures:
2327 captures:
2072 1: meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx
2328 1: meta.arrow.tsx meta.return.type.arrow.tsx keyword.operator.type.annotation.tsx
2073 push:
2329 push:
@@ -2114,23 +2370,23 @@ contexts:
2114 pop: true
2370 pop: true
2115 - include: string-character-escape
2371 - include: string-character-escape
2116 regex:
2372 regex:
2117− - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2373+ - match: '(?<!\+\+|--|})(?<=[=(:,\[?+!]|^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case|=>|&&|\|\||\*\/)\s*(\/)(?![\/*])(?=(?:[^\/\\\[\()]|\\.|\[([^\]\\]|\\.)+\]|\(([^\)\\]|\\.)+\))+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2118 captures:
2374 captures:
2119 1: punctuation.definition.string.begin.tsx
2375 1: punctuation.definition.string.begin.tsx
2120 push:
2376 push:
2121 - meta_scope: string.regexp.tsx
2377 - meta_scope: string.regexp.tsx
2122− - match: "(/)([gimsuy]*)"
2378+ - match: "(/)([dgimsuy]*)"
2123 captures:
2379 captures:
2124 1: punctuation.definition.string.end.tsx
2380 1: punctuation.definition.string.end.tsx
2125 2: keyword.other.tsx
2381 2: keyword.other.tsx
2126 pop: true
2382 pop: true
2127 - include: regexp
2383 - include: regexp
2128− - match: '(?<![_$[:alnum:])\]]|\+\+|--|})\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)+\])+\/[gimsuy]*(?!\s*[a-zA-Z0-9_$]))'
2384+ - match: '((?<![_$[:alnum:])\]]|\+\+|--|}|\*\/)|((?<=^return|[^\._$[:alnum:]]return|^case|[^\._$[:alnum:]]case))\s*)\/(?![\/*])(?=(?:[^\/\\\[]|\\.|\[([^\]\\]|\\.)*\])+\/([dgimsuy]+|(?![\/\*])|(?=\/\*))(?!\s*[a-zA-Z0-9_$]))'
2129 captures:
2385 captures:
2130 0: punctuation.definition.string.begin.tsx
2386 0: punctuation.definition.string.begin.tsx
2131 push:
2387 push:
2132 - meta_scope: string.regexp.tsx
2388 - meta_scope: string.regexp.tsx
2133− - match: "(/)([gimsuy]*)"
2389+ - match: "(/)([dgimsuy]*)"
2134 captures:
2390 captures:
2135 1: punctuation.definition.string.end.tsx
2391 1: punctuation.definition.string.end.tsx
2136 2: keyword.other.tsx
2392 2: keyword.other.tsx
@@ -2230,10 +2486,24 @@ contexts:
2230 - include: type-object
2486 - include: type-object
2231 - include: type-predicate-operator
2487 - include: type-predicate-operator
2232 - include: type
2488 - include: type
2489+ shebang:
2490+ - match: \A(#!).*(?=$)
2491+ scope: comment.line.shebang.tsx
2492+ captures:
2493+ 1: punctuation.definition.comment.tsx
2494+ single-line-comment-consuming-line-ending:
2495+ - match: '(^[ \t]+)?((//)(?:\s*((@)internal)(?=\s|$))?)'
2496+ captures:
2497+ 1: punctuation.whitespace.comment.leading.tsx
2498+ 2: comment.line.double-slash.tsx
2499+ 3: punctuation.definition.comment.tsx
2500+ 4: storage.type.internaldeclaration.tsx
2501+ 5: punctuation.decorator.internaldeclaration.tsx
2502+ push:
2503+ - meta_content_scope: comment.line.double-slash.tsx
2504+ - match: (?=^)
2505+ pop: true
2233 statements:
2506 statements:
2234− - include: string
2235− - include: template
2236− - include: comment
2237 - include: declaration
2507 - include: declaration
2238 - include: control-statement
2508 - include: control-statement
2239 - include: after-operator-block-as-object-literal
2509 - include: after-operator-block-as-object-literal
@@ -2241,21 +2511,31 @@ contexts:
2241 - include: label
2511 - include: label
2242 - include: expression
2512 - include: expression
2243 - include: punctuation-semicolon
2513 - include: punctuation-semicolon
2514+ - include: string
2515+ - include: comment
2244 string:
2516 string:
2245 - include: qstring-single
2517 - include: qstring-single
2246 - include: qstring-double
2518 - include: qstring-double
2519+ - include: template
2247 string-character-escape:
2520 string-character-escape:
2248− - match: '\\(x[0-9A-Fa-f]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)'
2521+ - match: '\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}|u\{[0-9A-Fa-f]+\}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.|$)'
2249 scope: constant.character.escape.tsx
2522 scope: constant.character.escape.tsx
2250 super-literal:
2523 super-literal:
2251 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2524 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))super\b(?!\$)'
2252 scope: variable.language.super.tsx
2525 scope: variable.language.super.tsx
2526+ support-function-call-identifiers:
2527+ - include: literal
2528+ - include: support-objects
2529+ - include: object-identifiers
2530+ - include: punctuation-accessor
2531+ - match: '(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))import(?=\s*[\(]\s*[\"\''\`]))'
2532+ scope: keyword.operator.expression.import.tsx
2253 support-objects:
2533 support-objects:
2254 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2534 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(arguments)\b(?!\$)'
2255 scope: variable.language.arguments.tsx
2535 scope: variable.language.arguments.tsx
2256 - match: |-
2536 - match: |-
2257− (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|Boolean|DataView|Date|Float32Array|Float64Array|Function|Generator
2537+ (?x)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(Array|ArrayBuffer|Atomics|BigInt|BigInt64Array|BigUint64Array|Boolean|DataView|Date|Float32Array
2258− |GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2538+ |Float64Array|Function|Generator|GeneratorFunction|Int8Array|Int16Array|Int32Array|Intl|Map|Number|Object|Proxy
2259 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2539 |Reflect|RegExp|Set|SharedArrayBuffer|SIMD|String|Symbol|TypedArray
2260 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2540 |Uint8Array|Uint16Array|Uint32Array|Uint8ClampedArray|WeakMap|WeakSet)\b(?!\$)
2261 scope: support.class.builtin.tsx
2541 scope: support.class.builtin.tsx
@@ -2309,9 +2589,9 @@ contexts:
2309 4: support.variable.property.target.tsx
2589 4: support.variable.property.target.tsx
2310 - match: |-
2590 - match: |-
2311 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2591 (?x) (?:(\.)|(\?\.(?!\s*[[:digit:]]))) \s* (?:
2312− (constructor|length|prototype|__proto__)
2592+ (?:(constructor|length|prototype|__proto__)\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\())
2313 |
2593 |
2314− (EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY))\b(?!\$)
2594+ (?:(EPSILON|MAX_SAFE_INTEGER|MAX_VALUE|MIN_SAFE_INTEGER|MIN_VALUE|NEGATIVE_INFINITY|POSITIVE_INFINITY)\b(?!\$)))
2315 captures:
2595 captures:
2316 1: punctuation.accessor.tsx
2596 1: punctuation.accessor.tsx
2317 2: punctuation.accessor.optional.tsx
2597 2: punctuation.accessor.optional.tsx
@@ -2415,7 +2695,7 @@ contexts:
2415 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2695 |siblingBelow|size|source|specified|standby|start|status|statusbar|statusText|style|styleSheets|suffixes|summary
2416 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2696 |systemId|systemLanguage|tagName|tags|target|tBodies|text|textAlign|textDecoration|textIndent|textTransform|tFoot|tHead
2417 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2697 |title|toolbar|top|type|undefined|uniqueID|updateInterval|URL|URLUnencoded|useMap|userAgent|userLanguage|userProfile
2418− |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?\()
2698+ |vAlign|value|valueType|vendor|vendorSub|version|visibility|vspace|whiteSpace|width|X[MS]LDocument|zIndex))\b(?!\$|\s*(<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?\()
2419 captures:
2699 captures:
2420 1: punctuation.accessor.tsx
2700 1: punctuation.accessor.tsx
2421 2: punctuation.accessor.optional.tsx
2701 2: punctuation.accessor.optional.tsx
@@ -2539,6 +2819,7 @@ contexts:
2539 captures:
2819 captures:
2540 0: punctuation.definition.block.tsx
2820 0: punctuation.definition.block.tsx
2541 pop: true
2821 pop: true
2822+ - include: comment
2542 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2823 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(switch)\s*(\()'
2543 captures:
2824 captures:
2544 1: keyword.control.switch.tsx
2825 1: keyword.control.switch.tsx
@@ -2581,7 +2862,34 @@ contexts:
2581 0: case-clause.expr.tsx punctuation.definition.section.case-statement.tsx
2862 0: case-clause.expr.tsx punctuation.definition.section.case-statement.tsx
2582 - include: statements
2863 - include: statements
2583 template:
2864 template:
2584− - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?=(<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>|\<\s*(((keyof|infer)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\''[^\'']*\'')|(\"[^\"]*\")|(\`[^\`]*\`))(?=\s*([\<\>\,\.\[=]|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(?<==)\>)*(?!=)\>)*(?!=)>\s*)`)'
2865+ - include: template-call
2866+ - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2867+ captures:
2868+ 1: entity.name.function.tagged-template.tsx
2869+ 2: punctuation.definition.string.template.begin.tsx
2870+ push:
2871+ - meta_scope: string.template.tsx
2872+ - match: "`"
2873+ captures:
2874+ 0: punctuation.definition.string.template.end.tsx
2875+ pop: true
2876+ - include: template-substitution-element
2877+ - include: string-character-escape
2878+ template-call:
2879+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*)(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2880+ push:
2881+ - meta_scope: string.template.tsx
2882+ - match: (?=`)
2883+ pop: true
2884+ - match: '(?=(([_$[:alpha:]][_$[:alnum:]]*\s*\??\.\s*)*|(\??\.\s*)?)([_$[:alpha:]][_$[:alnum:]]*))'
2885+ push:
2886+ - match: '(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)?`)'
2887+ pop: true
2888+ - include: support-function-call-identifiers
2889+ - match: "([_$[:alpha:]][_$[:alnum:]]*)"
2890+ scope: entity.name.function.tagged-template.tsx
2891+ - include: type-arguments
2892+ - match: '([_$[:alpha:]][_$[:alnum:]]*)?\s*(?=(<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))(([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>|\<\s*(((keyof|infer|typeof|readonly)\s+)|(([_$[:alpha:]][_$[:alnum:]]*|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\''([^\''\\]|\\.)*\'')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))(?=\s*([\<\>\,\.\[]|=>|&(?!&)|\|(?!\|)))))([^<>\(]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(?<==)\>)*(?<!=)\>))*(?<!=)\>)*(?<!=)>\s*)`)'
2585 captures:
2893 captures:
2586 1: entity.name.function.tagged-template.tsx
2894 1: entity.name.function.tagged-template.tsx
2587 push:
2895 push:
@@ -2589,6 +2897,20 @@ contexts:
2589 - match: (?=`)
2897 - match: (?=`)
2590 pop: true
2898 pop: true
2591 - include: type-arguments
2899 - include: type-arguments
2900+ template-substitution-element:
2901+ - match: '\$\{'
2902+ captures:
2903+ 0: punctuation.definition.template-expression.begin.tsx
2904+ push:
2905+ - meta_scope: meta.template.expression.tsx
2906+ - meta_content_scope: meta.embedded.line.tsx
2907+ - match: '\}'
2908+ captures:
2909+ 0: punctuation.definition.template-expression.end.tsx
2910+ pop: true
2911+ - include: expression
2912+ template-type:
2913+ - include: template-call
2592 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2914 - match: "([_$[:alpha:]][_$[:alnum:]]*)?(`)"
2593 captures:
2915 captures:
2594 1: entity.name.function.tagged-template.tsx
2916 1: entity.name.function.tagged-template.tsx
@@ -2599,9 +2921,9 @@ contexts:
2599 captures:
2921 captures:
2600 0: punctuation.definition.string.template.end.tsx
2922 0: punctuation.definition.string.template.end.tsx
2601 pop: true
2923 pop: true
2602− - include: template-substitution-element
2924+ - include: template-type-substitution-element
2603 - include: string-character-escape
2925 - include: string-character-escape
2604− template-substitution-element:
2926+ template-type-substitution-element:
2605 - match: '\$\{'
2927 - match: '\$\{'
2606 captures:
2928 captures:
2607 0: punctuation.definition.template-expression.begin.tsx
2929 0: punctuation.definition.template-expression.begin.tsx
@@ -2612,9 +2934,9 @@ contexts:
2612 captures:
2934 captures:
2613 0: punctuation.definition.template-expression.end.tsx
2935 0: punctuation.definition.template-expression.end.tsx
2614 pop: true
2936 pop: true
2615− - include: expression
2937+ - include: type
2616 ternary-expression:
2938 ternary-expression:
2617− - match: '(?!\?\.\s*[^[:digit:]])(\?)'
2939+ - match: '(?!\?\.\s*[^[:digit:]])(\?)(?!\?)'
2618 captures:
2940 captures:
2619 1: keyword.operator.ternary.tsx
2941 1: keyword.operator.ternary.tsx
2620 push:
2942 push:
@@ -2628,7 +2950,7 @@ contexts:
2628 scope: variable.language.this.tsx
2950 scope: variable.language.this.tsx
2629 type:
2951 type:
2630 - include: comment
2952 - include: comment
2631− - include: string
2953+ - include: type-string
2632 - include: numeric-literal
2954 - include: numeric-literal
2633 - include: type-primitive
2955 - include: type-primitive
2634 - include: type-builtin-literals
2956 - include: type-builtin-literals
@@ -2640,24 +2962,36 @@ contexts:
2640 - include: type-fn-type-parameters
2962 - include: type-fn-type-parameters
2641 - include: type-paren-or-function-parameters
2963 - include: type-paren-or-function-parameters
2642 - include: type-function-return-type
2964 - include: type-function-return-type
2965+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(readonly)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
2966+ captures:
2967+ 1: storage.modifier.tsx
2643 - include: type-name
2968 - include: type-name
2644 type-alias-declaration:
2969 type-alias-declaration:
2645− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2970+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(type)\b\s+([_$[:alpha:]][_$[:alnum:]]*)\s*'
2646 captures:
2971 captures:
2647 1: keyword.control.export.tsx
2972 1: keyword.control.export.tsx
2648− 2: storage.type.type.tsx
2973+ 2: storage.modifier.tsx
2649− 3: entity.name.type.alias.tsx
2974+ 3: storage.type.type.tsx
2975+ 4: entity.name.type.alias.tsx
2650 push:
2976 push:
2651 - meta_scope: meta.type.declaration.tsx
2977 - meta_scope: meta.type.declaration.tsx
2652− - match: '(?=\}|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
2978+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2653 pop: true
2979 pop: true
2654 - include: comment
2980 - include: comment
2655 - include: type-parameters
2981 - include: type-parameters
2982+ - match: '(=)\s*(intrinsic)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2983+ captures:
2984+ 1: keyword.operator.assignment.tsx
2985+ 2: keyword.control.intrinsic.tsx
2986+ push:
2987+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2988+ pop: true
2989+ - include: type
2656 - match: (=)\s*
2990 - match: (=)\s*
2657 captures:
2991 captures:
2658 1: keyword.operator.assignment.tsx
2992 1: keyword.operator.assignment.tsx
2659 push:
2993 push:
2660− - match: '(?=\}|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)'
2994+ - match: '(?=\}|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
2661 pop: true
2995 pop: true
2662 - include: type
2996 - include: type
2663 type-annotation:
2997 type-annotation:
@@ -2687,8 +3021,13 @@ contexts:
2687 captures:
3021 captures:
2688 0: punctuation.definition.typeparameters.end.tsx
3022 0: punctuation.definition.typeparameters.end.tsx
2689 pop: true
3023 pop: true
2690− - include: type
3024+ - include: type-arguments-body
2691− - include: punctuation-comma
3025+ type-arguments-body:
3026+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(_)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3027+ captures:
3028+ 0: keyword.operator.type.tsx
3029+ - include: type
3030+ - include: punctuation-comma
2692 type-builtin-literals:
3031 type-builtin-literals:
2693 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3032 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(this|true|false|undefined|null|object)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2694 scope: support.type.builtin.tsx
3033 scope: support.type.builtin.tsx
@@ -2710,13 +3049,19 @@ contexts:
2710 - include: type
3049 - include: type
2711 - include: type
3050 - include: type
2712 type-fn-type-parameters:
3051 type-fn-type-parameters:
2713− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b(?=\s*\<)'
3052+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(new)\b(?=\s*\<)'
2714− scope: meta.type.constructor.tsx
2715 captures:
3053 captures:
2716− 1: keyword.control.new.tsx
3054+ 1: meta.type.constructor.tsx storage.modifier.tsx
2717− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(new)\b\s*(?=\()'
3055+ 2: meta.type.constructor.tsx keyword.control.new.tsx
3056+ push:
3057+ - match: (?<=>)
3058+ pop: true
3059+ - include: comment
3060+ - include: type-parameters
3061+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(abstract)\s+)?(new)\b\s*(?=\()'
2718 captures:
3062 captures:
2719− 1: keyword.control.new.tsx
3063+ 1: storage.modifier.tsx
3064+ 2: keyword.control.new.tsx
2720 push:
3065 push:
2721 - meta_scope: meta.type.constructor.tsx
3066 - meta_scope: meta.type.constructor.tsx
2722 - match: (?<=\))
3067 - match: (?<=\))
@@ -2767,6 +3112,30 @@ contexts:
2767 - include: type-predicate-operator
3112 - include: type-predicate-operator
2768 - include: type
3113 - include: type
2769 type-name:
3114 type-name:
3115+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))\s*(<)'
3116+ captures:
3117+ 1: entity.name.type.module.tsx
3118+ 2: punctuation.accessor.tsx
3119+ 3: punctuation.accessor.optional.tsx
3120+ 4: meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx
3121+ push:
3122+ - meta_content_scope: meta.type.parameters.tsx
3123+ - match: (>)
3124+ captures:
3125+ 1: meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
3126+ pop: true
3127+ - include: type-arguments-body
3128+ - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(<)'
3129+ captures:
3130+ 1: entity.name.type.tsx
3131+ 2: meta.type.parameters.tsx punctuation.definition.typeparameters.begin.tsx
3132+ push:
3133+ - meta_content_scope: meta.type.parameters.tsx
3134+ - match: (>)
3135+ captures:
3136+ 1: meta.type.parameters.tsx punctuation.definition.typeparameters.end.tsx
3137+ pop: true
3138+ - include: type-arguments-body
2770 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
3139 - match: '([_$[:alpha:]][_$[:alnum:]]*)\s*(?:(\.)|(\?\.(?!\s*[[:digit:]])))'
2771 captures:
3140 captures:
2772 1: entity.name.type.module.tsx
3141 1: entity.name.type.module.tsx
@@ -2802,18 +3171,16 @@ contexts:
2802 - include: type
3171 - include: type
2803 type-operators:
3172 type-operators:
2804 - include: typeof-operator
3173 - include: typeof-operator
2805− - match: '(?:([&|])|(=(?!>)))(?=\s*\{)'
3174+ - match: '([&|])(?=\s*\{)'
2806 captures:
3175 captures:
2807− 1: keyword.operator.type.tsx
3176+ 0: keyword.operator.type.tsx
2808− 2: keyword.operator.assignment.tsx
2809 push:
3177 push:
2810 - match: '(?<=\})'
3178 - match: '(?<=\})'
2811 pop: true
3179 pop: true
2812 - include: type-object
3180 - include: type-object
2813− - match: "([&|])|(=(?!>))"
3181+ - match: "[&|]"
2814 captures:
3182 captures:
2815− 1: keyword.operator.type.tsx
3183+ 0: keyword.operator.type.tsx
2816− 2: keyword.operator.assignment.tsx
2817 push:
3184 push:
2818 - match: (?=\S)
3185 - match: (?=\S)
2819 pop: true
3186 pop: true
@@ -2840,6 +3207,8 @@ contexts:
2840 scope: storage.modifier.tsx
3207 scope: storage.modifier.tsx
2841 - include: type
3208 - include: type
2842 - include: punctuation-comma
3209 - include: punctuation-comma
3210+ - match: (=)(?!>)
3211+ scope: keyword.operator.assignment.tsx
2843 type-paren-or-function-parameters:
3212 type-paren-or-function-parameters:
2844 - match: \(
3213 - match: \(
2845 captures:
3214 captures:
@@ -2850,7 +3219,6 @@ contexts:
2850 captures:
3219 captures:
2851 0: meta.brace.round.tsx
3220 0: meta.brace.round.tsx
2852 pop: true
3221 pop: true
2853− - include: destructuring-parameter
2854 - match: |-
3222 - match: |-
2855 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
3223 (?x)(?:(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(public|private|protected|readonly)\s+)?(?:(\.\.\.)\s*)?(?<!=|:)(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s*(\??)(?=\s*(:\s*(
2856 (<) |
3224 (<) |
@@ -2863,7 +3231,8 @@ contexts:
2863 ))
3231 ))
2864 ))
3232 ))
2865 )) |
3233 )) |
2866− (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))))
3234+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3235+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))))
2867 captures:
3236 captures:
2868 1: storage.modifier.tsx
3237 1: storage.modifier.tsx
2869 2: keyword.operator.rest.tsx
3238 2: keyword.operator.rest.tsx
@@ -2882,11 +3251,28 @@ contexts:
2882 scope: punctuation.separator.parameter.tsx
3251 scope: punctuation.separator.parameter.tsx
2883 - include: type
3252 - include: type
2884 type-predicate-operator:
3253 type-predicate-operator:
3254+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(asserts)\s+)?(?!asserts)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))\s(is)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3255+ captures:
3256+ 1: keyword.operator.type.asserts.tsx
3257+ 2: variable.parameter.tsx variable.language.this.tsx
3258+ 3: variable.parameter.tsx
3259+ 4: keyword.operator.expression.is.tsx
3260+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(asserts)\s+(?!is)(?:(this)|([_$[:alpha:]][_$[:alnum:]]*))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3261+ captures:
3262+ 1: keyword.operator.type.asserts.tsx
3263+ 2: variable.parameter.tsx variable.language.this.tsx
3264+ 3: variable.parameter.tsx
3265+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))asserts(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3266+ scope: keyword.operator.type.asserts.tsx
2885 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3267 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))is(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2886 scope: keyword.operator.expression.is.tsx
3268 scope: keyword.operator.expression.is.tsx
2887 type-primitive:
3269 type-primitive:
2888− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|boolean|symbol|any|void|never)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3270+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(string|number|bigint|boolean|symbol|any|void|never|unknown)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2889 scope: support.type.primitive.tsx
3271 scope: support.type.primitive.tsx
3272+ type-string:
3273+ - include: qstring-single
3274+ - include: qstring-double
3275+ - include: template-type
2890 type-tuple:
3276 type-tuple:
2891 - match: '\['
3277 - match: '\['
2892 captures:
3278 captures:
@@ -2897,56 +3283,84 @@ contexts:
2897 captures:
3283 captures:
2898 0: meta.brace.square.tsx
3284 0: meta.brace.square.tsx
2899 pop: true
3285 pop: true
3286+ - match: \.\.\.
3287+ scope: keyword.operator.rest.tsx
3288+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))([_$[:alpha:]][_$[:alnum:]]*)\s*(\?)?\s*(:)'
3289+ captures:
3290+ 1: entity.name.label.tsx
3291+ 2: keyword.operator.optional.tsx
3292+ 3: punctuation.separator.label.tsx
2900 - include: type
3293 - include: type
2901 - include: punctuation-comma
3294 - include: punctuation-comma
2902 typeof-operator:
3295 typeof-operator:
2903 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3296 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))typeof(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2904− scope: keyword.operator.expression.typeof.tsx
3297+ captures:
3298+ 0: keyword.operator.expression.typeof.tsx
3299+ push:
3300+ - match: '(?=[,);}\]=>:&|{\?]|$|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))'
3301+ pop: true
3302+ - include: expression
2905 undefined-literal:
3303 undefined-literal:
2906 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3304 - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))undefined(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
2907 scope: constant.language.undefined.tsx
3305 scope: constant.language.undefined.tsx
2908 var-expr:
3306 var-expr:
2909− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3307+ - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
2910− captures:
2911− 1: keyword.control.export.tsx
2912− 2: storage.type.tsx
2913 push:
3308 push:
2914 - meta_scope: meta.var.expr.tsx
3309 - meta_scope: meta.var.expr.tsx
2915− - match: '((?=;|}|(\s+(of|in)\s+)|^\s*$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)|((?<=\S)(?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
3310+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^let|[^\._$[:alnum:]]let|^var|[^\._$[:alnum:]]var)(?=\s*$)))'
2916 pop: true
3311 pop: true
3312+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(var|let)(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3313+ captures:
3314+ 1: keyword.control.export.tsx
3315+ 2: storage.modifier.tsx
3316+ 3: storage.type.tsx
3317+ push:
3318+ - match: (?=\S)
3319+ pop: true
2917 - include: destructuring-variable
3320 - include: destructuring-variable
2918 - include: var-single-variable
3321 - include: var-single-variable
2919 - include: variable-initializer
3322 - include: variable-initializer
2920 - include: comment
3323 - include: comment
2921− - match: (,)\s*(?!\S)
3324+ - match: (,)\s*((?!\S)|(?=\/\/))
2922 captures:
3325 captures:
2923 1: punctuation.separator.comma.tsx
3326 1: punctuation.separator.comma.tsx
2924 push:
3327 push:
2925− - match: '(?<!,)(((?==|;|}|(\s+(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3328+ - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
2926 pop: true
3329 pop: true
3330+ - include: single-line-comment-consuming-line-ending
2927 - include: comment
3331 - include: comment
2928 - include: destructuring-variable
3332 - include: destructuring-variable
2929 - include: var-single-variable
3333 - include: var-single-variable
2930 - include: punctuation-comma
3334 - include: punctuation-comma
2931 - include: punctuation-comma
3335 - include: punctuation-comma
2932− - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))'
3336+ - match: '(?=(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))'
2933 captures:
3337 captures:
2934 1: keyword.control.export.tsx
3338 1: keyword.control.export.tsx
2935− 2: storage.type.tsx
3339+ 2: storage.modifier.tsx
3340+ 3: storage.type.tsx
2936 push:
3341 push:
2937 - meta_scope: meta.var.expr.tsx
3342 - meta_scope: meta.var.expr.tsx
2938− - match: '((?=;|}|(\s+(of|in)\s+)|^\s*$|;|^\s*abstract\b|^\s*async\b|^\s*class\b|^\s*const\b|^\s*declare\b|^\s*enum\b|^\s*export\b|^\s*function\b|^\s*import\b|^\s*interface\b|^\s*let\b|^\s*module\b|^\s*namespace\b|^\s*return\b|^\s*type\b|^\s*var\b)|((?<=\S)(?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
3343+ - match: '(?!(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.)))((?=;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|;|^\s*$|(?:^\s*(?:abstract|async|class|const|declare|enum|export|function|import|interface|let|module|namespace|return|type|var)\b))|((?<!^const|[^\._$[:alnum:]]const)(?=\s*$)))'
2939 pop: true
3344 pop: true
3345+ - match: '(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(\bexport)\s+)?(?:(\bdeclare)\s+)?\b(const(?!\s+enum\b))(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))\s*'
3346+ captures:
3347+ 1: keyword.control.export.tsx
3348+ 2: storage.modifier.tsx
3349+ 3: storage.type.tsx
3350+ push:
3351+ - match: (?=\S)
3352+ pop: true
2940 - include: destructuring-const
3353 - include: destructuring-const
2941 - include: var-single-const
3354 - include: var-single-const
2942 - include: variable-initializer
3355 - include: variable-initializer
2943 - include: comment
3356 - include: comment
2944− - match: (,)\s*(?!\S)
3357+ - match: (,)\s*((?!\S)|(?=\/\/))
2945 captures:
3358 captures:
2946 1: punctuation.separator.comma.tsx
3359 1: punctuation.separator.comma.tsx
2947 push:
3360 push:
2948− - match: '(?<!,)(((?==|;|}|(\s+(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
3361+ - match: '(?<!,)(((?==|;|}|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+)|^\s*$))|((?<=\S)(?=\s*$)))'
2949 pop: true
3362 pop: true
3363+ - include: single-line-comment-consuming-line-ending
2950 - include: comment
3364 - include: comment
2951 - include: destructuring-const
3365 - include: destructuring-const
2952 - include: var-single-const
3366 - include: var-single-const
@@ -2963,11 +3377,11 @@ contexts:
2963 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3377 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
2964 )) |
3378 )) |
2965 ((async\s*)?(
3379 ((async\s*)?(
2966− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
3380+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
2967 # sure shot arrow functions even if => is on new line
3381 # sure shot arrow functions even if => is on new line
2968 (
3382 (
2969− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3383+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
2970− [(]\s*
3384+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
2971 (
3385 (
2972 ([)]\s*:) | # ():
3386 ([)]\s*:) | # ():
2973 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3387 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -2978,9 +3392,9 @@ contexts:
2978 ) |
3392 ) |
2979 # arrow function possible to detect only with => on same line
3393 # arrow function possible to detect only with => on same line
2980 (
3394 (
2981− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3395+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
2982− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3396+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
2983− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3397+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
2984 \s*=> # arrow operator
3398 \s*=> # arrow operator
2985 )
3399 )
2986 ))
3400 ))
@@ -2997,19 +3411,20 @@ contexts:
2997 ))
3411 ))
2998 ))
3412 ))
2999 )) |
3413 )) |
3000− (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
3414+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3001− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3415+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3416+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3002 ((async\s+)?(
3417 ((async\s+)?(
3003 (function\s*[(<*]) |
3418 (function\s*[(<*]) |
3004 (function\s+) |
3419 (function\s+) |
3005 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3420 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3006 )) |
3421 )) |
3007 ((async\s*)?(
3422 ((async\s*)?(
3008− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
3423+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3009 # sure shot arrow functions even if => is on new line
3424 # sure shot arrow functions even if => is on new line
3010 (
3425 (
3011− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3426+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3012− [(]\s*
3427+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3013 (
3428 (
3014 ([)]\s*:) | # ():
3429 ([)]\s*:) | # ():
3015 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3430 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -3020,9 +3435,9 @@ contexts:
3020 ) |
3435 ) |
3021 # arrow function possible to detect only with => on same line
3436 # arrow function possible to detect only with => on same line
3022 (
3437 (
3023− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3438+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3024− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3439+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3025− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3440+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3026 \s*=> # arrow operator
3441 \s*=> # arrow operator
3027 )
3442 )
3028 ))
3443 ))
@@ -3031,7 +3446,7 @@ contexts:
3031 1: meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx
3446 1: meta.definition.variable.tsx variable.other.constant.tsx entity.name.function.tsx
3032 push:
3447 push:
3033 - meta_scope: meta.var-single-variable.expr.tsx
3448 - meta_scope: meta.var-single-variable.expr.tsx
3034− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3449+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3035 pop: true
3450 pop: true
3036 - include: var-single-variable-type-annotation
3451 - include: var-single-variable-type-annotation
3037 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3452 - match: "([_$[:alpha:]][_$[:alnum:]]*)"
@@ -3039,12 +3454,12 @@ contexts:
3039 1: meta.definition.variable.tsx variable.other.constant.tsx
3454 1: meta.definition.variable.tsx variable.other.constant.tsx
3040 push:
3455 push:
3041 - meta_scope: meta.var-single-variable.expr.tsx
3456 - meta_scope: meta.var-single-variable.expr.tsx
3042− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3457+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3043 pop: true
3458 pop: true
3044 - include: var-single-variable-type-annotation
3459 - include: var-single-variable-type-annotation
3045 var-single-variable:
3460 var-single-variable:
3046 - match: |-
3461 - match: |-
3047− (?x)([_$[:alpha:]][_$[:alnum:]]*)(?=\s*
3462+ (?x)([_$[:alpha:]][_$[:alnum:]]*)(\!)?(?=\s*
3048 # function assignment |
3463 # function assignment |
3049 (=\s*(
3464 (=\s*(
3050 ((async\s+)?(
3465 ((async\s+)?(
@@ -3053,11 +3468,11 @@ contexts:
3053 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3468 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3054 )) |
3469 )) |
3055 ((async\s*)?(
3470 ((async\s*)?(
3056− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
3471+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3057 # sure shot arrow functions even if => is on new line
3472 # sure shot arrow functions even if => is on new line
3058 (
3473 (
3059− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3474+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3060− [(]\s*
3475+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3061 (
3476 (
3062 ([)]\s*:) | # ():
3477 ([)]\s*:) | # ():
3063 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3478 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -3068,9 +3483,9 @@ contexts:
3068 ) |
3483 ) |
3069 # arrow function possible to detect only with => on same line
3484 # arrow function possible to detect only with => on same line
3070 (
3485 (
3071− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3486+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3072− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3487+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3073− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3488+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3074 \s*=> # arrow operator
3489 \s*=> # arrow operator
3075 )
3490 )
3076 ))
3491 ))
@@ -3087,19 +3502,20 @@ contexts:
3087 ))
3502 ))
3088 ))
3503 ))
3089 )) |
3504 )) |
3090− (:\s*((<\s*$)|([\(]\s*([\{\[]\s*)?$))) |
3505+ (:\s*(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))Function(?![_$[:alnum:]])(?:(?=\.\.\.)|(?!\.))) |
3091− (:\s*(=>|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3506+ (:\s*((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*))))))) |
3507+ (:\s*(=>|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(<[^<>]*>)|[^<>(),=])+=\s*(
3092 ((async\s+)?(
3508 ((async\s+)?(
3093 (function\s*[(<*]) |
3509 (function\s*[(<*]) |
3094 (function\s+) |
3510 (function\s+) |
3095 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3511 ([_$[:alpha:]][_$[:alnum:]]*\s*=>)
3096 )) |
3512 )) |
3097 ((async\s*)?(
3513 ((async\s*)?(
3098− ((<\s*$)|([\(]\s*([\{\[]\s*)?$)) |
3514+ ((<\s*$)|([\(]\s*((([\{\[]\s*)?$)|((\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})\s*((:\s*\{?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))|((\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])\s*((:\s*\[?$)|((\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+\s*)?=\s*)))))) |
3099 # sure shot arrow functions even if => is on new line
3515 # sure shot arrow functions even if => is on new line
3100 (
3516 (
3101− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)?
3517+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)?
3102− [(]\s*
3518+ [(]\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*
3103 (
3519 (
3104 ([)]\s*:) | # ():
3520 ([)]\s*:) | # ():
3105 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
3521 ((\.\.\.\s*)?[_$[:alpha:]][_$[:alnum:]]*\s*:) # [(]param: | [(]...param:
@@ -3110,34 +3526,37 @@ contexts:
3110 ) |
3526 ) |
3111 # arrow function possible to detect only with => on same line
3527 # arrow function possible to detect only with => on same line
3112 (
3528 (
3113− (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\(([^\(\)]|(\([^\(\)]*\)))*\))|(\[([^\[\]]|(\[[^\[\]]*\]))*\]))([^=<>]|=[^<])*\>)*>\s*)? # typeparameters
3529+ (<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<]|\<\s*([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\]))([^=<>]|=[^<])*\>)*\>)*>\s*)? # typeparameters
3114− \(\s*(([_$[:alpha:]]|(\{([^\{\}]|(\{[^\{\}]*\}))*\})|(\[([^\[\]]|(\[[^\[\]]*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()]|(\(([^\(\)]|(\([^\(\)]*\)))*\)))*)?\) # parameters
3530+ \(\s*(\/\*([^\*]|(\*[^\/]))*\*\/\s*)*(([_$[:alpha:]]|(\{([^\{\}]|(\{([^\{\}]|\{[^\{\}]*\})*\}))*\})|(\[([^\[\]]|(\[([^\[\]]|\[[^\[\]]*\])*\]))*\])|(\.\.\.\s*[_$[:alpha:]]))([^()\'\"\`]|(\(([^\(\)]|(\(([^\(\)]|\([^\(\)]*\))*\)))*\))|(\'([^\'\\]|\\.)*\')|(\"([^\"\\]|\\.)*\")|(\`([^\`\\]|\\.)*\`))*)?\) # parameters
3115− (\s*:\s*([^<>\(\)]|\<[^<>]+\>|\([^\(\)]+\))+)? # return type
3531+ (\s*:\s*([^<>\(\)\{\}]|\<([^<>]|\<([^<>]|\<[^<>]+\>)+\>)+\>|\([^\(\)]+\)|\{[^\{\}]+\})+)? # return type
3116 \s*=> # arrow operator
3532 \s*=> # arrow operator
3117 )
3533 )
3118 ))
3534 ))
3119 )))
3535 )))
3120 captures:
3536 captures:
3121 1: meta.definition.variable.tsx entity.name.function.tsx
3537 1: meta.definition.variable.tsx entity.name.function.tsx
3538+ 2: keyword.operator.definiteassignment.tsx
3122 push:
3539 push:
3123 - meta_scope: meta.var-single-variable.expr.tsx
3540 - meta_scope: meta.var-single-variable.expr.tsx
3124− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3541+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3125 pop: true
3542 pop: true
3126 - include: var-single-variable-type-annotation
3543 - include: var-single-variable-type-annotation
3127− - match: "([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])"
3544+ - match: '([[:upper:]][_$[:digit:][:upper:]]*)(?![_$[:alnum:]])(\!)?'
3128 captures:
3545 captures:
3129 1: meta.definition.variable.tsx variable.other.constant.tsx
3546 1: meta.definition.variable.tsx variable.other.constant.tsx
3547+ 2: keyword.operator.definiteassignment.tsx
3130 push:
3548 push:
3131 - meta_scope: meta.var-single-variable.expr.tsx
3549 - meta_scope: meta.var-single-variable.expr.tsx
3132− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3550+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3133 pop: true
3551 pop: true
3134 - include: var-single-variable-type-annotation
3552 - include: var-single-variable-type-annotation
3135− - match: "([_$[:alpha:]][_$[:alnum:]]*)"
3553+ - match: '([_$[:alpha:]][_$[:alnum:]]*)(\!)?'
3136 captures:
3554 captures:
3137 1: meta.definition.variable.tsx variable.other.readwrite.tsx
3555 1: meta.definition.variable.tsx variable.other.readwrite.tsx
3556+ 2: keyword.operator.definiteassignment.tsx
3138 push:
3557 push:
3139 - meta_scope: meta.var-single-variable.expr.tsx
3558 - meta_scope: meta.var-single-variable.expr.tsx
3140− - match: '(?=$|^|[;,=}]|(\s+(of|in)\s+))'
3559+ - match: '(?=$|^|[;,=}]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3141 pop: true
3560 pop: true
3142 - include: var-single-variable-type-annotation
3561 - include: var-single-variable-type-annotation
3143 var-single-variable-type-annotation:
3562 var-single-variable-type-annotation:
@@ -3145,17 +3564,17 @@ contexts:
3145 - include: string
3564 - include: string
3146 - include: comment
3565 - include: comment
3147 variable-initializer:
3566 variable-initializer:
3148− - match: (?<!=|!)(=)(?!=)(?=\s*\S)
3567+ - match: (?<!=|!)(=)(?!=)(?=\s*\S)(?!\s*.*=>\s*$)
3149 captures:
3568 captures:
3150 1: keyword.operator.assignment.tsx
3569 1: keyword.operator.assignment.tsx
3151 push:
3570 push:
3152− - match: '(?=$|^|[,);}\]])'
3571+ - match: '(?=$|^|[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))'
3153 pop: true
3572 pop: true
3154 - include: expression
3573 - include: expression
3155 - match: (?<!=|!)(=)(?!=)
3574 - match: (?<!=|!)(=)(?!=)
3156 captures:
3575 captures:
3157 1: keyword.operator.assignment.tsx
3576 1: keyword.operator.assignment.tsx
3158 push:
3577 push:
3159− - match: '(?=[,);}\]])|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3578+ - match: '(?=[,);}\]]|((?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(of|in)\s+))|(?=^\s*$)|(?<=\S)(?<!=)(?=\s*$)'
3160 pop: true
3579 pop: true
3161 - include: expression
3580 - include: expression
assets/syntaxes/02_Extra/VimL+1−1

Submodule changed.

assets/syntaxes/02_Extra/VimL.sublime-syntaxdeleted−91
@@ -1,91 +0,0 @@
1−%YAML 1.2
2−---
3−# http://www.sublimetext.com/docs/3/syntax.html
4−name: VimL
5−file_extensions:
6− - vim
7− - .vimrc
8−scope: source.viml
9−contexts:
10− main:
11− - include: comment
12− - include: string_quoted_double
13− - include: string_quoted_single
14− - include: string_regex
15− - include: inline_comment
16− - include: number_int
17− - include: number_hex
18− - include: keyword
19− - include: support_function
20− - include: support_variable
21− - include: support_type
22− - include: function_params
23− - include: function_definition
24− - include: function_call
25− - include: function
26− - include: variable
27− - include: expr
28− comment:
29− - match: ^\s*".*$
30− scope: comment.line.quotes.viml
31− captures:
32− 1: punctuation.definition.comment.vim
33− expr:
34− - match: (\|\||&&|==(\?|#)?|(!|>|<)=(#|\?)?|(=|!)~(#|\?)?|(>|<)(#|\?)is|isnot|\.|\*|\\|%)
35− scope: storage.function.viml
36− function:
37− - match: \b(fu(n|nction)?|end(f|fu|fun|function)?)\b
38− scope: storage.function.viml
39− function_call:
40− - match: '(([sgbwtl]|)?:?[0-9a-zA-Z_#]+)(?=\()'
41− scope: support.function.any-method
42− function_definition:
43− - match: '^\s*(function)\s*!?\s+(?=(s:)?[0-9a-zA-Z_#]+\s*\()'
44− captures:
45− 1: storage.function.viml
46− push:
47− - meta_scope: meta.function.viml
48− - match: (\()
49− captures:
50− 1: punctuation.definition.parameters.begin.viml
51− pop: true
52− - match: "(s:)?[0-9a-zA-Z_#]+"
53− scope: entity.name.function.viml
54− function_params:
55− - match: '-\w+='
56− scope: support.type.viml
57− inline_comment:
58− - match: '(?!\$)(")(?!\{).*$\n?'
59− scope: comment.line.quotes.viml
60− captures:
61− 1: punctuation.definition.comment.vim
62− keyword:
63− - match: \b(if|while|for|try|return|throw|end(if|for|while|try)?|au(g|group)|else(if|)?|do|in|catch|finally|:)\b
64− scope: keyword.control.viml
65− number_hex:
66− - match: "0x[0-9a-f]+"
67− scope: constant.numeric.hex
68− number_int:
69− - match: '-?\d+'
70− scope: constant.numeric.integer
71− string_quoted_double:
72− - match: '"(\\\\|\\"|\n[^\S\n]*\\|[^\n"])*"'
73− scope: string.quoted.double.viml
74− string_quoted_single:
75− - match: '''(''''|\n[^\S\n]*\\|[^\n''])*'''
76− scope: string.quoted.single.viml
77− string_regex:
78− - match: '/(\\\\|\\/|\n[^\S\n]*\\|[^\n/])*/'
79− scope: string.regexp.viml
80− support_function:
81− - match: \b(set(local|global)?|let|command|filetype|colorscheme|\w*map|\w*a(b|brev)?|syn|exe(c|cute)?|ec(ho|)?|au(tocmd|)?)\b
82− scope: support.function.viml
83− support_type:
84− - match: <.*?>
85− scope: support.type.viml
86− support_variable:
87− - match: '\b(am(enu|)?|(hl|inc)?search|[Bb]uf([Nn]ew[Ff]ile|[Rr]ead)?|[Ff]ile[Tt]ype)\b'
88− scope: support.variable.viml
89− variable:
90− - match: '([sSgGbBwWlLaAvV]:|@|$|&(?!&))\w*'
91− scope: variable.other.viml
assets/syntaxes/02_Extra/Zignew file+1

Submodule changed.

assets/syntaxes/02_Extra/cmd-helpnew file+1

Submodule changed.

assets/syntaxes/02_Extra/gnuplotnew file+1

Submodule changed.

assets/syntaxes/02_Extra/gnuplot.sublime-syntaxnew file+182
@@ -0,0 +1,182 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: gnuplot
5+file_extensions:
6+ - gp
7+ - gpl
8+ - gnuplot
9+ - gnu
10+ - plot
11+ - plt
12+scope: source.gnuplot
13+contexts:
14+ main:
15+ - include: number
16+ - include: string_single
17+ - include: string_double
18+ - match: '\b(for)\b\s*(\[)'
19+ comment: |
20+ gnuplot iteration statement.
21+ There are two forms:
22+ numeric [n = 1:2{:inc}]
23+ string based [str in "x y z"]
24+ but both can also iterate over lists etc, so this is kept loose.
25+ captures:
26+ 1: keyword.other.iteration.gnuplot
27+ 2: punctuation.definition.range.begin.gnuplot
28+ push:
29+ - meta_scope: meta.structure.iteration.gnuplot
30+ - match: '\]'
31+ captures:
32+ 0: punctuation.definition.range.end.gnuplot
33+ pop: true
34+ - include: number
35+ - include: operator
36+ - include: string_double
37+ - include: string_single
38+ - match: ":"
39+ scope: punctuation.separator.range.gnuplot
40+ - match: '\b([a-zA-Z]\w*)\b\s*(=|in)'
41+ scope: variable-assignment.range.gnuplot
42+ - match: '(?i:[^\s(pi|e)\]])'
43+ scope: invalid.illegal.expected-range-separator.gnuplot
44+ - match: '\['
45+ comment: "gnuplot range statement [a:b]. Lots of things are legal, still more make no sense!"
46+ captures:
47+ 0: punctuation.definition.range.begin.gnuplot
48+ push:
49+ - meta_scope: meta.structure.range.gnuplot
50+ - match: '\]'
51+ captures:
52+ 0: punctuation.definition.range.end.gnuplot
53+ pop: true
54+ - include: number
55+ - include: operator
56+ - match: ":"
57+ scope: punctuation.separator.range.gnuplot
58+ - match: '(?i:[^\s(pi|e)\]])'
59+ scope: invalid.illegal.expected-range-separator.gnuplot
60+ - match: \\.
61+ scope: constant.character.escape.gnuplot
62+ - match: '(?<!\$)(#)(?!\{).*$\n?'
63+ scope: comment.line.number-sign.gnuplot
64+ captures:
65+ 1: punctuation.definition.comment.gnuplot
66+ - match: for
67+ comment: introduce in gnuplot 4.3.
68+ scope: keyword.other.iteration.gnuplot
69+ - match: \b(angles|arrow|autoscale|bars|border|boxwidth|clabel|clip|cntrparam|colorbox|contour|decimalsign|dgrid3d|dummy|encoding|fit|format|grid|hidden3d|historysize|isosamples|key|label|locale|logscale|macros|bmargin|lmargin|rmargin|tmargin|mapping|mouse|multiplot|offsets|origin|output|palette|parametric|pm3d|pointsize|polar|print|rrange|trange|urange|vrange|samples|size|style|surface|tics|ticscale|ticslevel|timestamp|timefmt|title|view|xyplane|x2data|xdata|y2data|ydata|z2data|zdata|x2label|xlabel|y2label|ylabel|z2label|zlabel|x2range|xrange|y2range|yrange|z2range|zrange|mx2tics|mxtics|my2tics|mytics|mz2tics|mztics|nomx2tics|nomxtics|nomy2tics|nomytics|nomz2tics|nomztics|nox2tics|noxtics|noy2tics|noytics|noz2tics|noztics|x2tics|xtics|y2tics|ytics|z2tics|ztics|x2dtics|x2mtics|xdtics|xmtics|y2dtics|y2mtics|ydtics|ymtics|z2dtics|z2mtics|zdtics|zmtics|x2zeroaxis|xzeroaxis|y2zeroaxis|yzeroaxis|z2zeroaxis|zeroaxis|zzeroaxis|zero|)\b
70+ scope: keyword.other.setting.gnuplot
71+ - match: \b(cd|call|clear|exit|plot|splot|help|load|pause|quit|fit|replot|if|FIT_LIMIT|FIT_MAXITER|FIT_START_LAMBDA|FIT_LAMBDA_FACTOR|FIT_LOG|FIT_SCRIPT|print|pwd|reread|reset|save|show|test|!|functions|var)\b
72+ comment: missuse of scopes alert! Just for pretty colours
73+ scope: keyword.other.command.gnuplot
74+ - match: \b(abs|acos|acosh|arg|asin|asinh|atan|atan2|atanh|besj0|besj1|besy0|besy1|ceil|cos|cosh|erf|erfc|exp|floor|gamma|ibeta|igamma|imag|int|inverf|invnorm|lambertw|lgamma|log|log10|norm|rand|real|sgn|sin|sinh|sqrt|tan|tanh)\b
75+ scope: support.function.gnuplot
76+ - match: \b(gprintf|sprintf|strlen|strstrt|substr|system|word|words)\b
77+ scope: support.function.string.gnuplot
78+ - match: \b(on|off|default|inside|outside|lmargin|rmargin|tmargin|bmargin|at|left|right|center|top|bottom|center|vertical|horizontal|Left|Right|noreverse|noinvert|samplen|spacing|width|height|noautotitle|columnheader|title|noenhanced|nobox|linestyle|ls|linetype|lt|linewidth|lw)\b
79+ scope: constant.other.type.gnuplot
80+ - match: \b(aed512|aed767|aifm|aqua|bitgraph|cgm|corel|dumb|dxf|eepic|emf|emtex|epslatex|epson_180dpi|epson_60dpi|epson_lx800|fig|gif|gpic|hp2623A|hp2648|hp500c|hpdj|hpgl|hpljii|hppj|imagen|jpeg|kc_tek40xx|km_tek40xx|latex|mf|mif|mp|nec_cp6|okidata|pbm|pcl5|pdf|png|postscript|pslatex|pstex|pstricks|qms|regis|selanar|starc|svg|tandy_60dpi|tek40xx|tek410x|texdraw|tgif|tkcanvas|tpic|unknown|vttek)\b
81+ scope: constant.other.terminal.gnuplot
82+ - match: \b(u(sing)?|t(it(le)?)?|notit(le)?|w(i(th)?)?|steps|fs(teps)?|notitle|l(i(nes)?)?|linespoints|via)\b
83+ scope: keyword.modifier.gnuplot
84+ - match: |-
85+ (?x:
86+ \b # Start with a word boundary
87+ (?=\b[\w$]*(\(|.*=)) # Look-ahead for a bracket or equals
88+ (?![^(]*\)) # negative look ahead for a closing bracket without an opening one. This stops a from matching in f(a)
89+ ( # Group variable name
90+ [A-Za-z] # A letter
91+ [\w$]* # Any word chars or $
92+ ) # That is it for the name.
93+ )
94+ comment: user defined function / variable
95+ scope: variable.other.gnuplot
96+ - match: \b(if)\b
97+ scope: keyword.control.gnuplot
98+ - match: \b(show)\b
99+ captures:
100+ 0: keyword.other.command.gnuplot
101+ push:
102+ - meta_scope: keyword.line.show.gnuplot
103+ - meta_content_scope: keyword.line.show.gnuplot
104+ - match: (?!\#)($\n?)
105+ pop: true
106+ - include: main
107+ - match: \b(set)\b\s*\b(terminal|term)\b
108+ captures:
109+ 1: keyword.other.command.gnuplot
110+ 2: keyword.other.setting.gnuplot
111+ push:
112+ - meta_scope: keyword.line.set.terminal.gnuplot
113+ - match: (?!\#)($\n?)
114+ pop: true
115+ - include: main
116+ - match: \b(set)\b\s*\b(key)\b
117+ captures:
118+ 1: keyword.other.command.gnuplot
119+ 2: keyword.other.setting.gnuplot
120+ push:
121+ - meta_scope: keyword.line.set.key.gnuplot
122+ - match: (?!\#)($\n?)
123+ pop: true
124+ - include: main
125+ - match: \b(set|unset)\b\s*(?!\b(terminal|key|for)\b)
126+ captures:
127+ 1: keyword.other.command.gnuplot
128+ 2: keyword.other.setting.gnuplot
129+ push:
130+ - meta_scope: keyword.line.set.gnuplot
131+ - meta_content_scope: keyword.line.set.gnuplot
132+ - match: (?!\#)($\n?)
133+ pop: true
134+ - include: main
135+ number:
136+ - match: |-
137+ (?x: # turn on extended mode
138+ -? # an optional minus
139+ (?:
140+ 0 # a zero
141+ | # ...or...
142+ [1-9] # a 1-9 character
143+ \d* # followed by zero or more digits
144+ )
145+ (?:
146+ \. # a period
147+ \d+ # followed by one or more digits
148+ (?:
149+ [eE] # an e character
150+ [+-]? # followed by an option +/-
151+ \d+ # followed by one or more digits
152+ )? # make exponent optional
153+ )? # make decimal portion optional
154+ )
155+ comment: borrowed from textmate book
156+ scope: constant.numeric.gnuplot
157+ operator:
158+ - match: \s*(==|~=|>|>=|<|<=|&|&&|:|\||\|\||\+|-|\*|\.\*|/|\./|\\|\.\\|\^|\.\^)\s*
159+ comment: Operator symbols
160+ scope: keyword.operator.symbols.matlab
161+ string_double:
162+ - match: '"'
163+ captures:
164+ 0: punctuation.definition.string.begin.gnuplot
165+ push:
166+ - meta_scope: string.quoted.double.gnuplot
167+ - match: '"'
168+ captures:
169+ 0: punctuation.definition.string.end.gnuplot
170+ pop: true
171+ - match: '\\[\$`"\\\n]'
172+ scope: constant.character.escape.gnuplot
173+ string_single:
174+ - match: "'"
175+ captures:
176+ 0: punctuation.definition.string.begin.gnuplot
177+ push:
178+ - meta_scope: string.quoted.single.gnuplot
179+ - match: "'"
180+ captures:
181+ 0: punctuation.definition.string.end.gnuplot
182+ pop: true
assets/syntaxes/02_Extra/http-request-responsenew file+1

Submodule changed.

assets/syntaxes/02_Extra/log.sublime-syntaxnew file+140
@@ -0,0 +1,140 @@
1+%YAML 1.2
2+---
3+# See http://www.sublimetext.com/docs/3/syntax.html
4+file_extensions:
5+ - log
6+scope: text.log
7+variables:
8+ ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)
9+ hours_minutes_seconds: (?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)
10+contexts:
11+ main:
12+ - match: (\w+)(=)
13+ captures:
14+ 1: variable.parameter.log
15+ 2: keyword.operator.assignment.log
16+ - match: (')([^']*)(')
17+ scope: string.quoted.single.log
18+ captures:
19+ 1: punctuation.definition.string.begin.log
20+ 3: punctuation.definition.string.end.log
21+ - match: \"
22+ captures:
23+ 1: punctuation.definition.string.begin.log
24+ push: double_quoted_string
25+ - include: dates
26+ - include: ip_addresses
27+ - include: numbers
28+ - match: \b(?i:fail(?:ure|ed)?|error|exception)\b
29+ scope: markup.error.log
30+ - match: \b(?i:warn(?:ing)?)\b
31+ scope: markup.warning.log
32+ - match: \b(?i:debug)\b
33+ scope: markup.info.log
34+ #- include: scope:text.html.markdown#autolink-inet
35+ - match: \b\w+:/{2,3}
36+ scope: markup.underline.link.scheme.log
37+ push: url-host
38+ dates:
39+ - match: \b\d{4}-\d{2}-\d{2}(?=\b|T)
40+ scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
41+ push: maybe_date_time_separator
42+ - match: \b\d{4}/\d{2}/\d{2}(?=\b|T)
43+ scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log
44+ push: maybe_date_time_separator
45+ - match: \b(?={{hours_minutes_seconds}})
46+ push: time
47+ time:
48+ - match: (?:{{hours_minutes_seconds}})(?:(\.)\d{3})?\b
49+ scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log
50+ captures:
51+ 1: punctuation.separator.decimal.log
52+ - match: ''
53+ pop: true
54+ maybe_date_time_separator:
55+ - match: T(?={{hours_minutes_seconds}})
56+ scope: meta.date.log meta.time.log keyword.other.log
57+ set: time
58+ - match: ''
59+ pop: true
60+ ip_addresses:
61+ - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b)
62+ push:
63+ - meta_scope: meta.ipaddress.v4.log meta.number.integer.decimal.log
64+ - match: \d+
65+ scope: constant.numeric.value.log
66+ - match: \.
67+ scope: punctuation.separator.sequence.log
68+ - match: ''
69+ pop: true
70+ - match: (?=(?:\h{0,4}:){2,6}\h{1,4}\b)
71+ push:
72+ - meta_scope: meta.ipaddress.v6.log meta.number.integer.hexadecimal.log
73+ - match: \h{1,4}
74+ scope: constant.numeric.value.log
75+ - match: ':'
76+ scope: punctuation.separator.sequence.log
77+ - match: ''
78+ pop: true
79+ numbers:
80+ - match: \b(0x)(\h+)(?:(\.)(\h+))?\b
81+ scope: meta.number.float.hexadecimal.log
82+ captures:
83+ 1: constant.numeric.base.log
84+ 2: constant.numeric.value.log
85+ 3: constant.numeric.value.log punctuation.separator.decimal.log
86+ 4: constant.numeric.value.log
87+ - match: \b\d+(\.)\d+\b
88+ scope: meta.number.float.log constant.numeric.value.log
89+ captures:
90+ 1: punctuation.separator.decimal.log
91+ - match: \b\d+\b
92+ scope: meta.number.integer.log constant.numeric.value.log
93+ url-host:
94+ - meta_content_scope: markup.underline.link.host.log
95+ - match: \[
96+ scope: punctuation.section.brackets.begin.log
97+ push:
98+ - match: \]
99+ scope: punctuation.section.brackets.end.log
100+ pop: true
101+ - include: ip_addresses
102+ - match: '[^:/\s]+'
103+ - match: ''
104+ set: url-after-host
105+ url-after-host:
106+ - match: (:)(\d+)
107+ scope: markup.underline.link.port.log
108+ captures:
109+ 1: punctuation.separator.mapping.port.log
110+ 2: constant.numeric.value.log
111+ #- include: scope:text.html.markdown#url-escaped-chars
112+ - match: (%)\h{2}
113+ scope: markup.underline.link.path.log constant.character.escape.url.log
114+ captures:
115+ 1: punctuation.definition.escape.log
116+ # After a valid domain, zero or more non-space non-< characters may follow
117+ - match: (?=[?!.,:*_~]*[\s<]) # Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink, though they may be included in the interior of the link
118+ pop: true
119+ - match: \( # When an autolink ends in ), we scan the entire autolink for the total number of parentheses. If there is a greater number of closing parentheses than opening ones, we don’t consider the last character part of the autolink, in order to facilitate including an autolink inside a parenthesis
120+ push:
121+ - meta_scope: markup.underline.link.path.log
122+ - match: (?=[?!.,:*_~]*[\s<])
123+ pop: true
124+ - match: \)
125+ pop: true
126+ - match: (?=\)[?!.,:*_~]*[\s<])
127+ pop: true
128+ - match: '[^?!.,:*_~\s<&()%]+|\S'
129+ scope: markup.underline.link.path.log
130+ - match: ''
131+ pop: true
132+ double_quoted_string:
133+ - meta_scope: string.quoted.double.log
134+ - match: \\"
135+ scope: constant.character.escape.log
136+ - match: \\n
137+ scope: constant.character.escape.log
138+ - match: \"
139+ scope: punctuation.definition.string.end.log
140+ pop: true
assets/syntaxes/02_Extra/requirementstxtdeleted−1

Submodule changed.

assets/syntaxes/02_Extra/requirementstxt.sublime-syntaxdeleted−19
@@ -1,19 +0,0 @@
1−%YAML 1.2
2−---
3−# http://www.sublimetext.com/docs/3/syntax.html
4−name: requirements.txt
5−file_extensions:
6− - requirements.txt
7−scope: source.requirementstxt
8−contexts:
9− main:
10− - match: (#).*$\n?
11− scope: comment.line.requirementstxt
12− captures:
13− 1: punctuation.definition.comment.requirementstxt
14− - match: '(?i)^[a-z0-9_\-\.]+'
15− scope: string.package_name.requirementstxt
16− - match: (?i)==|<|<=|>=|>
17− scope: keyword.operator.logical.punctuation.requirementstxt
18− - match: '(?i)\d+\.[\da-z\-_\.]*'
19− scope: constant.numeric.verions.requirementstxt
assets/syntaxes/02_Extra/show-nonprintable.sublime-syntax+1−1
@@ -7,7 +7,7 @@ file_extensions:
7scope: whitespace
7scope: whitespace
8contexts:
8contexts:
9 main:
9 main:
10− - match: "•"
10+ - match: "·"
11 scope: support.function.show-nonprintable.space
11 scope: support.function.show-nonprintable.space
12 - match: "├─*┤"
12 - match: "├─*┤"
13 scope: constant.character.escape.show-nonprintable.tab
13 scope: constant.character.escape.show-nonprintable.tab
assets/syntaxes/02_Extra/ssh-config+1−1

Submodule changed.

assets/syntaxes/02_Extra/syntax_test_csv.csvnew file+60
@@ -0,0 +1,60 @@
1+# SYNTAX TEST "CSV.sublime-syntax"
2+Forename,Surname,House No.,Street,City,Postcode
3+#^^^^^^^ meta.field-1
4+# ^ punctuation.separator.sequence
5+# ^^^^^^^ meta.field-2
6+# ^ punctuation.separator.sequence
7+# ^^^^^^^^^ meta.field-3
8+# ^ punctuation.separator.sequence
9+# ^^^^^^ meta.field-4
10+# ^ punctuation.separator.sequence
11+# ^^^^ meta.field-1
12+# ^ punctuation.separator.sequence
13+# ^^^^^^^^ meta.field-2
14+John,Doe,87,Logon Road,Citiville,TU43 6GH
15+#^^^ meta.field-1
16+# ^ punctuation.separator.sequence
17+# ^^^ meta.field-2
18+# ^ punctuation.separator.sequence
19+# ^^ meta.field-3
20+# ^ punctuation.separator.sequence
21+# ^^^^^^^^^^ meta.field-4
22+# ^ punctuation.separator.sequence
23+# ^^^^^^^^^ meta.field-1
24+# ^ punctuation.separator.sequence
25+# ^^^^^^^^ meta.field-2
26+Jane,Doe,22,"""Fun"" Street","The City, County",FA90 1XA
27+#^^^ meta.field-1
28+# ^ punctuation.separator.sequence
29+# ^^^ meta.field-2
30+# ^ punctuation.separator.sequence
31+# ^^ meta.field-3
32+# ^ punctuation.separator.sequence
33+# ^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
34+# ^^ constant.character.escape
35+# ^^ constant.character.escape
36+# ^ punctuation.separator.sequence
37+# ^ meta.field-1 string.quoted.double punctuation.definition.string.begin
38+# ^^^^^^^^^^^^^^^^^ meta.field-1 string.quoted.double
39+# ^ meta.field-1 string.quoted.double punctuation.definition.string.end
40+# ^ punctuation.separator.sequence
41+# ^^^^^^^^ meta.field-2
42+Fred,Bloggs,"19","Street
43+#^^^ meta.field-1
44+# ^ punctuation.separator.sequence
45+# ^^^^^^ meta.field-2
46+# ^ punctuation.separator.sequence
47+# ^^^ meta.field-3 string.quoted.double
48+# ^ punctuation.separator.sequence
49+# ^ meta.field-4 punctuation.definition.string.begin
50+# ^^^^^^^^ meta.field-4 string.quoted.double
51+Spanning Multiple ""
52+#^^^^^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
53+# ^^ constant.character.escape
54+Lines",Citee,P0stc0d3
55+#^^^^^ meta.field-4 string.quoted.double
56+# ^ meta.field-4 punctuation.definition.string.end
57+# ^ punctuation.separator.sequence
58+# ^^^^^ meta.field-1
59+# ^ punctuation.separator.sequence
60+# ^^^^^^^^ meta.field-2
assets/syntaxes/02_Extra/syntax_test_man.mannew file+162
@@ -0,0 +1,162 @@
1+# SYNTAX TEST "Manpage.sublime-syntax"
2+SOMETHING(8) System Manager's Manual SOMETHING(8)
3+# ^^^^^ meta.preprocessor
4+# ^^^^^^^^^^^^^^^^^^^^^^^ markup.heading.title
5+# ^^^^^^^ meta.preprocessor
6+
7+NAME
8+#^^^ markup.heading.other
9+ example - do something useful
10+
11+SYNOPSIS
12+ example [options] [--home DIR] [--shell SHELL] [--no-create-home]
13+# ^ punctuation.section.brackets.begin
14+# ^^^^^^ entity.name.command-line-option
15+# ^^^ variable.parameter
16+# ^ punctuation.section.brackets.end
17+# ^ punctuation.section.brackets.begin
18+# ^^^^^^^ entity.name.command-line-option
19+# ^^^^^ variable.parameter
20+# ^ punctuation.section.brackets.end
21+# ^ punctuation.section.brackets.begin
22+# ^^^^^^^^^^^^^^^^ entity.name.command-line-option
23+# ^ punctuation.section.brackets.end
24+ [-u | --set-upstream] [-o <string> | --push-option=<string>]
25+# ^ punctuation.section.brackets.begin
26+# ^^ entity.name.command-line-option
27+# ^ keyword.operator.logical
28+# ^^^^^^^^^^^^^^ entity.name.command-line-option
29+# ^ punctuation.section.brackets.end
30+# ^^^^^^^^^^^^^ entity.name.command-line-option
31+ [--force-with-lease[=<refname>[:<expect>]]]
32+# ^ punctuation.section.brackets.begin
33+# ^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
34+# ^ punctuation.section.brackets.begin
35+# ^ keyword.operator
36+# ^^^^^^^ variable.parameter
37+# ^ punctuation.section.brackets.begin
38+# ^^^^^^ variable.parameter
39+# ^^^ punctuation.section.brackets.end
40+
41+ example --system [options]
42+# ^^^^^^^^ entity.name
43+
44+ COMMON OPTIONS
45+ [--quiet] [--debug] [--help|-h] [--version] [--conf FILE]
46+
47+ /* According to POSIX.1-2001, POSIX.1-2008 */
48+# ^^ source.c comment.block punctuation.definition.comment
49+ #include <sys/select.h>
50+# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include
51+ struct timeval {
52+# ^^^^^^ source.c storage.type
53+
54+ time_t tv_sec; /* seconds */
55+ suseconds_t tv_usec; /* microseconds */
56+ };
57+
58+
59+
60+DESCRIPTION
61+ example does something useful in relation to the command line options
62+ and configuration information in /etc/example.conf.
63+
64+OPTIONS
65+ --conf FILE
66+# ^^^^^^ entity.name.command-line-option
67+#^^^^^^ - variable - entity - markup
68+# ^^^^ variable.parameter
69+ Use FILE instead of /etc/example.conf.
70+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - variable - entity
71+
72+ --disabled-login
73+ Do not run passwd to set the password. The user won't be able
74+ to use her account until the password is set.
75+
76+ --disabled-password
77+ Like --disabled-login, but logins are still possible (for exam-
78+# ^^^^^^^^^^^^^^^^ entity.name
79+#^^^^^^^^^^^^^^^^^^ - entity - variable - markup
80+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - entity - variable - markup
81+ ple using SSH RSA keys) but not using password authentication.
82+
83+ --help Display brief instructions.
84+# ^^^^^^ entity.name.command-line-option
85+# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - variable.parameter
86+
87+ --home DIR
88+# ^^^^^^ entity.name.command-line-option
89+# ^^^ variable.parameter
90+# ^ - variable - entity - markup
91+ Use DIR as the user's home directory, rather than the default
92+ specified by the configuration file. If the directory does not
93+ exist, it is created and skeleton files are copied.
94+
95+ --[no-]signed, --signed=(true|false|if-asked)
96+# ^^^^^^^^^^^^^ entity.name.command-line-option
97+# ^ punctuation.separator
98+# ^^^^^^^^ entity.name.command-line-option
99+# ^ keyword.operator
100+# ^ - variable
101+# ^^^^ variable.parameter
102+# ^ keyword.operator.logical
103+# ^^^^^ variable.parameter
104+# ^ keyword.operator.logical
105+# ^^^^^^^^ variable.parameter
106+# ^ - variable
107+ --no-recurse-submodules, --recurse-submodules=check|on-demand|only|no
108+# ^^^^^^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
109+# ^ punctuation.separator
110+# ^^^^^^^^^^^^^^^^^^^^ entity.name.command-line-option
111+# ^ keyword.operator
112+# ^^^^^ variable.parameter
113+# ^ keyword.operator.logical
114+# ^^^^^^^^^ variable.parameter
115+# ^ keyword.operator.logical
116+# ^^^^ variable.parameter
117+# ^ keyword.operator.logical
118+# ^^ variable.parameter
119+ May be used to make sure all submodule commits used by the
120+
121+ -c, -C NUM, --context[=NUM]
122+# ^^ entity.name.command-line-option
123+# ^ punctuation.separator
124+# ^^ entity.name.command-line-option
125+# ^^^ variable.parameter
126+# ^ punctuation.separator
127+# ^^^^^^^^^ entity.name.command-line-option
128+# ^^^^^^^ - entity.name
129+# ^ keyword.operator
130+# ^^^ variable.parameter
131+# ^^ - variable
132+ output NUM (default 3) lines of copied context
133+
134+EXAMPLE
135+ #include <stdio.h>
136+# ^^^^^^^^ source.c meta.preprocessor.include keyword.control.import.include
137+
138+ (This is not C code.)
139+# ^^^^^^^^^^^^^^^^^^^^^^ - source.c
140+
141+ struct timeval {
142+ time_t tv_sec; /* seconds */
143+ suseconds_t tv_usec; /* microseconds */
144+ };
145+# ^ source.c punctuation.terminator
146+
147+ The corresponding argument for pselect() has the following type:
148+#^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - source.c
149+ #define POLLIN_SET (EPOLLRDNORM | EPOLLRDBAND | EPOLLIN |
150+ EPOLLHUP | EPOLLERR)
151+# ^ source.c meta.preprocessor.macro meta.group punctuation.section.group.end
152+
153+ENVIRONMENT
154+ $SYSTEMD_LOG_LEVEL
155+# ^ punctuation.definition.variable
156+# ^^^^^^^^^^^^^^^^^ constant.other
157+ systemd reads the log level from this environment variable. This
158+ can be overridden with --log-level=.
159+
160+SEE ALSO
161+ The systemd Homepage[11], systemd-system.conf(5), locale.conf(5)
162+# ^^^^^^^^^^^^^^^^^^^ entity.name.function
assets/syntaxes/02_Extra/syntax_test_tsv.tsvnew file+60
@@ -0,0 +1,60 @@
1+# SYNTAX TEST "CSV.sublime-syntax"
2+Forename Surname House No. Street City Postcode
3+#^^^^^^^ meta.field-1
4+# ^ punctuation.separator.sequence
5+# ^^^^^^^ meta.field-2
6+# ^ punctuation.separator.sequence
7+# ^^^^^^^^^ meta.field-3
8+# ^ punctuation.separator.sequence
9+# ^^^^^^ meta.field-4
10+# ^ punctuation.separator.sequence
11+# ^^^^ meta.field-1
12+# ^ punctuation.separator.sequence
13+# ^^^^^^^^ meta.field-2
14+John Doe 87 Logon Road Citiville TU43 6GH
15+#^^^ meta.field-1
16+# ^ punctuation.separator.sequence
17+# ^^^ meta.field-2
18+# ^ punctuation.separator.sequence
19+# ^^ meta.field-3
20+# ^ punctuation.separator.sequence
21+# ^^^^^^^^^^ meta.field-4
22+# ^ punctuation.separator.sequence
23+# ^^^^^^^^^ meta.field-1
24+# ^ punctuation.separator.sequence
25+# ^^^^^^^^ meta.field-2
26+Jane Doe 22 """Fun"" Street" "The City County" FA90 1XA
27+#^^^ meta.field-1
28+# ^ punctuation.separator.sequence
29+# ^^^ meta.field-2
30+# ^ punctuation.separator.sequence
31+# ^^ meta.field-3
32+# ^ punctuation.separator.sequence
33+# ^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
34+# ^^ constant.character.escape
35+# ^^ constant.character.escape
36+# ^ punctuation.separator.sequence
37+# ^ meta.field-1 string.quoted.double punctuation.definition.string.begin
38+# ^^^^^^^^^^^^^^^^^ meta.field-1 string.quoted.double
39+# ^ meta.field-1 string.quoted.double punctuation.definition.string.end
40+# ^ punctuation.separator.sequence
41+# ^^^^^^^^ meta.field-2
42+Fred Bloggs "19" "Street
43+#^^^ meta.field-1
44+# ^ punctuation.separator.sequence
45+# ^^^^^^ meta.field-2
46+# ^ punctuation.separator.sequence
47+# ^^^ meta.field-3 string.quoted.double
48+# ^ punctuation.separator.sequence
49+# ^ meta.field-4 punctuation.definition.string.begin
50+# ^^^^^^^^ meta.field-4 string.quoted.double
51+Spanning Multiple ""
52+#^^^^^^^^^^^^^^^^^^^^ meta.field-4 string.quoted.double
53+# ^^ constant.character.escape
54+Lines" Citee P0stc0d3
55+#^^^^^ meta.field-4 string.quoted.double
56+# ^ meta.field-4 punctuation.definition.string.end
57+# ^ punctuation.separator.sequence
58+# ^^^^^ meta.field-1
59+# ^ punctuation.separator.sequence
60+# ^^^^^^^^ meta.field-2
assets/syntaxes/02_Extra/syslog.sublime-syntaxnew file+63
@@ -0,0 +1,63 @@
1+%YAML 1.2
2+---
3+# http://www.sublimetext.com/docs/3/syntax.html
4+name: syslog
5+file_extensions:
6+ - syslog
7+scope: text.log.syslog
8+contexts:
9+ main:
10+ - match: ^(\w+\s+\d+)\s+(\d{2}:\d{2}:\d{2})
11+ scope: meta.datetime.syslog constant.numeric.syslog
12+ captures:
13+ 1: meta.date.syslog
14+ 2: meta.time.syslog
15+ push: loghost
16+ - match: ^
17+ push: text
18+ loghost:
19+ - match: '[\w:.-]+'
20+ scope: entity.other.attribute-name.loghost.syslog
21+ set: process
22+ process:
23+ - match: ([\w.-]+)(?:(\[)(\d+)(\]))?([ :])
24+ captures:
25+ 1: support.function.process.syslog
26+ 2: punctuation.separator.pid.begin.syslog
27+ 3: meta.pid.syslog meta.number.integer.syslog constant.numeric.value.syslog
28+ 4: punctuation.separator.pid.end.syslog
29+ 5: punctuation.separator.mapping.syslog
30+ set: structured-data
31+ structured-data:
32+ - match: '\['
33+ scope: punctuation.section.mapping.begin.syslog
34+ push:
35+ - match: \]
36+ scope: punctuation.section.mapping.end.syslog
37+ pop: true
38+ - match: \w+
39+ scope: variable.parameter.syslog
40+ - match: =
41+ scope: keyword.operator.assignment.syslog
42+ push:
43+ - match: '[^\s\]]+'
44+ scope: constant.other.syslog
45+ pop: true
46+ - match: (?=\])
47+ pop: true
48+ - match: (?=\S)
49+ set: text
50+ text:
51+ - match: $
52+ pop: true
53+ - match: '<\w+>'
54+ scope: constant.language.syslog
55+ - match: \b(CMD)\b\s+(\()
56+ captures:
57+ 1: entity.name.label.syslog
58+ 2: punctuation.section.block.begin.syslog
59+ embed: scope:source.shell.bash
60+ escape: \)$
61+ escape_captures:
62+ 0: punctuation.section.block.end.syslog
63+ - include: scope:text.log
assets/themes.bin

Binary file not shown.

assets/themes/Coldarknew file+1

Submodule changed.

assets/themes/Solarized+1−1

Submodule changed.

assets/themes/ansi-light.tmTheme → assets/themes/ansi.tmThemerenamed+13−87
@@ -3,14 +3,14 @@
3<plist version="1.0">
3<plist version="1.0">
4 <dict>
4 <dict>
5 <!--
5 <!--
6− The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
6+ The colors in this theme are encoded as #RRGGBBAA where:
7− palette number from 00 to 0f, and AA is the special value 00 to indicate
7+ * If AA is 00, then RR is an ANSI palette number from 00 to 07.
8− that this encoding is being used.
8+ * If AA is 01, the terminal's default fg/bg color is used.
9 -->
9 -->
10 <key>author</key>
10 <key>author</key>
11 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
11 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
12 <key>name</key>
12 <key>name</key>
13− <string>ANSI Light</string>
13+ <string>ANSI</string>
14 <key>colorSpaceName</key>
14 <key>colorSpaceName</key>
15 <string>sRGB</string>
15 <string>sRGB</string>
16 <key>settings</key>
16 <key>settings</key>
@@ -19,32 +19,17 @@
19 <key>settings</key>
19 <key>settings</key>
20 <dict>
20 <dict>
21 <key>background</key>
21 <key>background</key>
22− <string>#07000000</string>
22+ <string>#00000001</string>
23− <key>caret</key>
23+ <key>foreground</key>
24− <string>#00000000</string>
24+ <string>#00000001</string>
25− <key>foreground</key>
25+ <!--
26− <string>#00000000</string>
26+ Explicitly set the gutter color since bat falls back to a
27− <key>invisibles</key>
27+ hardcoded DEFAULT_GUTTER_COLOR otherwise.
28− <string>#00000000</string>
28+ -->
29− <key>lineHighlight</key>
30− <string>#00000000</string>
31− <key>selection</key>
32− <string>#00000000</string>
33 <key>gutter</key>
29 <key>gutter</key>
34− <string>#07000000</string>
30+ <string>#00000001</string>
35 <key>gutterForeground</key>
31 <key>gutterForeground</key>
36− <string>#00000000</string>
32+ <string>#00000001</string>
37− </dict>
38− </dict>
39− <dict>
40− <key>name</key>
41− <string>Text</string>
42− <key>scope</key>
43− <string>variable.parameter.function</string>
44− <key>settings</key>
45− <dict>
46− <key>foreground</key>
47− <string>#00000000</string>
48 </dict>
33 </dict>
49 </dict>
34 </dict>
50 <dict>
35 <dict>
@@ -58,39 +43,6 @@
58 <string>#02000000</string>
43 <string>#02000000</string>
59 </dict>
44 </dict>
60 </dict>
45 </dict>
61− <dict>
62− <key>name</key>
63− <string>Punctuation</string>
64− <key>scope</key>
65− <string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>
66− <key>settings</key>
67− <dict>
68− <key>foreground</key>
69− <string>#00000000</string>
70− </dict>
71− </dict>
72− <dict>
73− <key>name</key>
74− <string>Delimiters</string>
75− <key>scope</key>
76− <string>none</string>
77− <key>settings</key>
78− <dict>
79− <key>foreground</key>
80− <string>#00000000</string>
81− </dict>
82− </dict>
83− <dict>
84− <key>name</key>
85− <string>Operators</string>
86− <key>scope</key>
87− <string>keyword.operator</string>
88− <key>settings</key>
89− <dict>
90− <key>foreground</key>
91− <string>#00000000</string>
92− </dict>
93− </dict>
94 <dict>
46 <dict>
95 <key>name</key>
47 <key>name</key>
96 <string>Keywords</string>
48 <string>Keywords</string>
@@ -102,17 +54,6 @@
102 <string>#05000000</string>
54 <string>#05000000</string>
103 </dict>
55 </dict>
104 </dict>
56 </dict>
105− <dict>
106− <key>name</key>
107− <string>Variables</string>
108− <key>scope</key>
109− <string>variable</string>
110− <key>settings</key>
111− <dict>
112− <key>foreground</key>
113− <string>#00000000</string>
114− </dict>
115− </dict>
116 <dict>
57 <dict>
117 <key>name</key>
58 <key>name</key>
118 <string>Functions</string>
59 <string>Functions</string>
@@ -146,17 +87,6 @@
146 <string>#03000000</string>
87 <string>#03000000</string>
147 </dict>
88 </dict>
148 </dict>
89 </dict>
149− <dict>
150− <key>name</key>
151− <string>Classes</string>
152− <key>scope</key>
153− <string>meta.class</string>
154− <key>settings</key>
155− <dict>
156− <key>foreground</key>
157− <string>#00000000</string>
158− </dict>
159− </dict>
160 <dict>
90 <dict>
161 <key>name</key>
91 <key>name</key>
162 <string>Methods</string>
92 <string>Methods</string>
@@ -480,8 +410,6 @@
480 <dict>
410 <dict>
481 <key>background</key>
411 <key>background</key>
482 <string>#01000000</string>
412 <string>#01000000</string>
483− <key>foreground</key>
484− <string>#00000000</string>
485 </dict>
413 </dict>
486 </dict>
414 </dict>
487 <dict>
415 <dict>
@@ -493,8 +421,6 @@
493 <dict>
421 <dict>
494 <key>background</key>
422 <key>background</key>
495 <string>#03000000</string>
423 <string>#03000000</string>
496− <key>foreground</key>
497− <string>#07000000</string>
498 </dict>
424 </dict>
499 </dict>
425 </dict>
500 </array>
426 </array>
assets/themes/ansi-dark.tmTheme → assets/themes/base16-256.tmThemerenamed+69−22
@@ -3,14 +3,22 @@
3<plist version="1.0">
3<plist version="1.0">
4 <dict>
4 <dict>
5 <!--
5 <!--
6+ Most base16 users should use the base16 theme. This theme, base16-256,
7+ is for users who configure their terminal with a 256-color variant of a
8+ base16 theme, and who use base16-shell. DO NOT use this theme simply
9+ because your terminal supports 256 colors.
10+
11+ base16: https://github.com/chriskempson/base16
12+ base16-shell: https://github.com/chriskempson/base16-shell
13+
6 The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
14 The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
7− palette number from 00 to 0f, and AA is the special value 00 to indicate
15+ palette number from 00 to ff (the 256 terminal colors), and AA is the
8− that this encoding is being used.
16+ special value 00 to indicate this encoding is being used.
9 -->
17 -->
10 <key>author</key>
18 <key>author</key>
11 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
19 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
12 <key>name</key>
20 <key>name</key>
13− <string>ANSI Dark</string>
21+ <string>Base16 256</string>
14 <key>colorSpaceName</key>
22 <key>colorSpaceName</key>
15 <string>sRGB</string>
23 <string>sRGB</string>
16 <key>settings</key>
24 <key>settings</key>
@@ -25,15 +33,15 @@
25 <key>foreground</key>
33 <key>foreground</key>
26 <string>#07000000</string>
34 <string>#07000000</string>
27 <key>invisibles</key>
35 <key>invisibles</key>
28− <string>#07000000</string>
36+ <string>#08000000</string>
29 <key>lineHighlight</key>
37 <key>lineHighlight</key>
30− <string>#07000000</string>
38+ <string>#08000000</string>
31 <key>selection</key>
39 <key>selection</key>
32− <string>#07000000</string>
40+ <string>#13000000</string>
33 <key>gutter</key>
41 <key>gutter</key>
34− <string>#00000000</string>
42+ <string>#12000000</string>
35 <key>gutterForeground</key>
43 <key>gutterForeground</key>
36− <string>#07000000</string>
44+ <string>#08000000</string>
37 </dict>
45 </dict>
38 </dict>
46 </dict>
39 <dict>
47 <dict>
@@ -55,7 +63,7 @@
55 <key>settings</key>
63 <key>settings</key>
56 <dict>
64 <dict>
57 <key>foreground</key>
65 <key>foreground</key>
58− <string>#02000000</string>
66+ <string>#08000000</string>
59 </dict>
67 </dict>
60 </dict>
68 </dict>
61 <dict>
69 <dict>
@@ -132,7 +140,7 @@
132 <key>settings</key>
140 <key>settings</key>
133 <dict>
141 <dict>
134 <key>foreground</key>
142 <key>foreground</key>
135− <string>#06000000</string>
143+ <string>#11000000</string>
136 </dict>
144 </dict>
137 </dict>
145 </dict>
138 <dict>
146 <dict>
@@ -154,7 +162,7 @@
154 <key>settings</key>
162 <key>settings</key>
155 <dict>
163 <dict>
156 <key>foreground</key>
164 <key>foreground</key>
157− <string>#07000000</string>
165+ <string>#0f000000</string>
158 </dict>
166 </dict>
159 </dict>
167 </dict>
160 <dict>
168 <dict>
@@ -209,7 +217,7 @@
209 <key>settings</key>
217 <key>settings</key>
210 <dict>
218 <dict>
211 <key>foreground</key>
219 <key>foreground</key>
212− <string>#03000000</string>
220+ <string>#10000000</string>
213 </dict>
221 </dict>
214 </dict>
222 </dict>
215 <dict>
223 <dict>
@@ -220,7 +228,7 @@
220 <key>settings</key>
228 <key>settings</key>
221 <dict>
229 <dict>
222 <key>foreground</key>
230 <key>foreground</key>
223− <string>#03000000</string>
231+ <string>#10000000</string>
224 </dict>
232 </dict>
225 </dict>
233 </dict>
226 <dict>
234 <dict>
@@ -231,7 +239,7 @@
231 <key>settings</key>
239 <key>settings</key>
232 <dict>
240 <dict>
233 <key>foreground</key>
241 <key>foreground</key>
234− <string>#03000000</string>
242+ <string>#10000000</string>
235 </dict>
243 </dict>
236 </dict>
244 </dict>
237 <dict>
245 <dict>
@@ -242,7 +250,7 @@
242 <key>settings</key>
250 <key>settings</key>
243 <dict>
251 <dict>
244 <key>foreground</key>
252 <key>foreground</key>
245− <string>#03000000</string>
253+ <string>#10000000</string>
246 </dict>
254 </dict>
247 </dict>
255 </dict>
248 <dict>
256 <dict>
@@ -264,7 +272,7 @@
264 <key>settings</key>
272 <key>settings</key>
265 <dict>
273 <dict>
266 <key>foreground</key>
274 <key>foreground</key>
267− <string>#03000000</string>
275+ <string>#10000000</string>
268 </dict>
276 </dict>
269 </dict>
277 </dict>
270 <dict>
278 <dict>
@@ -297,7 +305,7 @@
297 <key>settings</key>
305 <key>settings</key>
298 <dict>
306 <dict>
299 <key>foreground</key>
307 <key>foreground</key>
300− <string>#03000000</string>
308+ <string>#10000000</string>
301 </dict>
309 </dict>
302 </dict>
310 </dict>
303 <dict>
311 <dict>
@@ -321,7 +329,7 @@
321 <key>settings</key>
329 <key>settings</key>
322 <dict>
330 <dict>
323 <key>foreground</key>
331 <key>foreground</key>
324− <string>#03000000</string>
332+ <string>#10000000</string>
325 </dict>
333 </dict>
326 </dict>
334 </dict>
327 <dict>
335 <dict>
@@ -380,7 +388,7 @@
380 <key>settings</key>
388 <key>settings</key>
381 <dict>
389 <dict>
382 <key>foreground</key>
390 <key>foreground</key>
383− <string>#03000000</string>
391+ <string>#10000000</string>
384 </dict>
392 </dict>
385 </dict>
393 </dict>
386 <dict>
394 <dict>
@@ -391,7 +399,20 @@
391 <key>settings</key>
399 <key>settings</key>
392 <dict>
400 <dict>
393 <key>foreground</key>
401 <key>foreground</key>
394− <string>#03000000</string>
402+ <string>#10000000</string>
403+ </dict>
404+ </dict>
405+ <dict>
406+ <key>name</key>
407+ <string>Separator</string>
408+ <key>scope</key>
409+ <string>meta.separator</string>
410+ <key>settings</key>
411+ <dict>
412+ <key>background</key>
413+ <string>#13000000</string>
414+ <key>foreground</key>
415+ <string>#07000000</string>
395 </dict>
416 </dict>
396 </dict>
417 </dict>
397 <dict>
418 <dict>
@@ -481,7 +502,7 @@
481 <key>background</key>
502 <key>background</key>
482 <string>#01000000</string>
503 <string>#01000000</string>
483 <key>foreground</key>
504 <key>foreground</key>
484− <string>#07000000</string>
505+ <string>#0f000000</string>
485 </dict>
506 </dict>
486 </dict>
507 </dict>
487 <dict>
508 <dict>
@@ -492,11 +513,37 @@
492 <key>settings</key>
513 <key>settings</key>
493 <dict>
514 <dict>
494 <key>background</key>
515 <key>background</key>
495− <string>#03000000</string>
516+ <string>#10000000</string>
496 <key>foreground</key>
517 <key>foreground</key>
497 <string>#00000000</string>
518 <string>#00000000</string>
498 </dict>
519 </dict>
499 </dict>
520 </dict>
521+ <dict>
522+ <key>name</key>
523+ <string>Deprecated</string>
524+ <key>scope</key>
525+ <string>invalid.deprecated</string>
526+ <key>settings</key>
527+ <dict>
528+ <key>background</key>
529+ <string>#11000000</string>
530+ <key>foreground</key>
531+ <string>#0f000000</string>
532+ </dict>
533+ </dict>
534+ <dict>
535+ <key>name</key>
536+ <string>Unimplemented</string>
537+ <key>scope</key>
538+ <string>invalid.unimplemented</string>
539+ <key>settings</key>
540+ <dict>
541+ <key>background</key>
542+ <string>#08000000</string>
543+ <key>foreground</key>
544+ <string>#0f000000</string>
545+ </dict>
546+ </dict>
500 </array>
547 </array>
501 <key>uuid</key>
548 <key>uuid</key>
502 <string>uuid</string>
549 <string>uuid</string>
assets/themes/base16.tmTheme+9−2
@@ -3,9 +3,16 @@
3<plist version="1.0">
3<plist version="1.0">
4 <dict>
4 <dict>
5 <!--
5 <!--
6+ This theme is meant for users who configure their terminal with a base16
7+ color theme. If you use a 256-color variant along with base16-shell, use
8+ the bat theme base16-256 instead.
9+
10+ base16: https://github.com/chriskempson/base16
11+ base16-shell: https://github.com/chriskempson/base16-shell
12+
6 The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
13 The colors in this theme are encoded as #RRGGBBAA where RR is an ANSI
7− palette number from 00 to 0f, and AA is the special value 00 to indicate
14+ palette number from 00 to 0f (the 8 colors and their bright versions),
8− that this encoding is being used.
15+ and AA is the special value 00 to indicate this encoding is being used.
9 -->
16 -->
10 <key>author</key>
17 <key>author</key>
11 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
18 <string>Template: Chris Kempson, Scheme: Mitchell Kember</string>
assets/themes/dracula-sublime+1−1

Submodule changed.

assets/themes/gruvboxnew file+1

Submodule changed.

assets/themes/onehalf+1−1

Submodule changed.

assets/themes/visual-studio-dark-plusnew file+1

Submodule changed.

assets/themes/zenburn+1−1

Submodule changed.

build.rs+32−11
@@ -8,6 +8,7 @@ fn main() {}
8
8
9#[cfg(feature = "application")]
9#[cfg(feature = "application")]
10fn main() -> Result<(), Box<dyn std::error::Error>> {
10fn main() -> Result<(), Box<dyn std::error::Error>> {
11+ use std::collections::HashMap;
11 use std::error::Error;
12 use std::error::Error;
12 use std::fs;
13 use std::fs;
13 use std::path::Path;
14 use std::path::Path;
@@ -15,27 +16,32 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
15 // Read environment variables.
16 // Read environment variables.
16 let project_name = option_env!("PROJECT_NAME").unwrap_or("bat");
17 let project_name = option_env!("PROJECT_NAME").unwrap_or("bat");
17 let executable_name = option_env!("PROJECT_EXECUTABLE").unwrap_or(project_name);
18 let executable_name = option_env!("PROJECT_EXECUTABLE").unwrap_or(project_name);
19+ let executable_name_uppercase = executable_name.to_uppercase();
18 static PROJECT_VERSION: &str = env!("CARGO_PKG_VERSION");
20 static PROJECT_VERSION: &str = env!("CARGO_PKG_VERSION");
19
21
20− /// Generates a file from a liquid template.
22+ /// Generates a file from a template.
21 fn template(
23 fn template(
22− variables: &liquid::Object,
24+ variables: &HashMap<&str, &str>,
23 in_file: &str,
25 in_file: &str,
24 out_file: impl AsRef<Path>,
26 out_file: impl AsRef<Path>,
25 ) -> Result<(), Box<dyn Error>> {
27 ) -> Result<(), Box<dyn Error>> {
26− let template = liquid::ParserBuilder::with_stdlib()
28+ let mut content = fs::read_to_string(in_file)?;
27− .build()?
28− .parse(&fs::read_to_string(in_file)?)?;
29
29
30− fs::write(out_file, template.render(variables)?)?;
30+ for (variable_name, value) in variables {
31+ // Replace {{variable_name}} by the value
32+ let pattern = format!("{{{{{variable_name}}}}}", variable_name = variable_name);
33+ content = content.replace(&pattern, value);
34+ }
35+
36+ fs::write(out_file, content)?;
31 Ok(())
37 Ok(())
32 }
38 }
33
39
34− let variables = liquid::object!({
40+ let mut variables = HashMap::new();
35− "PROJECT_NAME": project_name,
41+ variables.insert("PROJECT_NAME", project_name);
36− "PROJECT_EXECUTABLE": executable_name,
42+ variables.insert("PROJECT_EXECUTABLE", executable_name);
37− "PROJECT_VERSION": PROJECT_VERSION,
43+ variables.insert("PROJECT_EXECUTABLE_UPPERCASE", &executable_name_uppercase);
38− });
44+ variables.insert("PROJECT_VERSION", PROJECT_VERSION);
39
45
40 let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs");
46 let out_dir_env = std::env::var_os("OUT_DIR").expect("OUT_DIR to be set in build.rs");
41 let out_dir = Path::new(&out_dir_env);
47 let out_dir = Path::new(&out_dir_env);
@@ -48,11 +54,26 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
48 "assets/manual/bat.1.in",
54 "assets/manual/bat.1.in",
49 out_dir.join("assets/manual/bat.1"),
55 out_dir.join("assets/manual/bat.1"),
50 )?;
56 )?;
57+ template(
58+ &variables,
59+ "assets/completions/bat.bash.in",
60+ out_dir.join("assets/completions/bat.bash"),
61+ )?;
51 template(
62 template(
52 &variables,
63 &variables,
53 "assets/completions/bat.fish.in",
64 "assets/completions/bat.fish.in",
54 out_dir.join("assets/completions/bat.fish"),
65 out_dir.join("assets/completions/bat.fish"),
55 )?;
66 )?;
67+ template(
68+ &variables,
69+ "assets/completions/_bat.ps1.in",
70+ out_dir.join("assets/completions/_bat.ps1"),
71+ )?;
72+ template(
73+ &variables,
74+ "assets/completions/bat.zsh.in",
75+ out_dir.join("assets/completions/bat.zsh"),
76+ )?;
56
77
57 Ok(())
78 Ok(())
58}
79}
ci/before_deploy.bashdeleted−188
@@ -1,188 +0,0 @@
1−#!/usr/bin/env bash
2−# Building and packaging for release
3−set -ex
4−
5−# Ensure environment variables exist.
6−if [[ -z "$PROJECT_NAME" ]]; then
7− export PROJECT_NAME="bat"
8−fi
9−
10−build() {
11− cargo build --bins --target "$TARGET" --release --verbose
12−}
13−
14−pack() {
15− local tempdir
16− local out_dir
17− local package_name
18− local gcc_prefix
19−
20− tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
21− out_dir=$(pwd)
22− package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
23−
24− if [[ $TARGET == "arm-unknown-linux-gnueabihf" ]]; then
25− gcc_prefix="arm-linux-gnueabihf-"
26− elif [[ $TARGET == "aarch64-unknown-linux-gnu" ]]; then
27− gcc_prefix="aarch64-linux-gnu-"
28− else
29− gcc_prefix=""
30− fi
31−
32− # create a "staging" directory
33− mkdir "$tempdir/$package_name"
34− mkdir "$tempdir/$package_name/autocomplete"
35−
36− # copying the main binary
37− cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
38− "${gcc_prefix}"strip "$tempdir/$package_name/$PROJECT_NAME"
39−
40− # manpage, readme and license
41− cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/manual/bat.1 "$tempdir/$package_name/$PROJECT_NAME.1"
42− cp README.md "$tempdir/$package_name"
43− cp LICENSE-MIT "$tempdir/$package_name"
44− cp LICENSE-APACHE "$tempdir/$package_name"
45−
46− # various autocomplete
47− # TODO: disabled for now, see issue #372
48− # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".bash "$tempdir/$package_name/autocomplete/${PROJECT_NAME}.bash-completion"
49− # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/"$PROJECT_NAME".fish "$tempdir/$package_name/autocomplete"
50− cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/completions/bat.fish "$tempdir/$package_name/autocomplete/$PROJECT_NAME.fish"
51− # cp target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/_"$PROJECT_NAME" "$tempdir/$package_name/autocomplete"
52−
53− # archiving
54− pushd "$tempdir"
55− tar czf "$out_dir/$package_name.tar.gz" "$package_name"/*
56− popd
57− rm -r "$tempdir"
58−}
59−
60−make_deb() {
61− local tempdir
62− local architecture
63− local version
64− local dpkgname
65− local conflictname
66− local gcc_prefix
67− local homepage
68− local maintainer
69−
70− homepage="https://github.com/sharkdp/bat"
71− maintainer="David Peter <mail@david-peter.de>"
72−
73− case $TARGET in
74− x86_64*)
75− architecture=amd64
76− gcc_prefix=""
77− ;;
78− i686*)
79− architecture=i386
80− gcc_prefix=""
81− ;;
82− aarch64*)
83− architecture=arm64
84− gcc_prefix="aarch64-linux-gnu-"
85− ;;
86− arm*hf)
87− architecture=armhf
88− gcc_prefix="arm-linux-gnueabihf-"
89− ;;
90− *)
91− echo "make_deb: skipping target '${TARGET}'" >&2
92− return 0
93− ;;
94− esac
95− version=${TRAVIS_TAG#v}
96− if [[ $TARGET = *musl* ]]; then
97− dpkgname=$PROJECT_NAME-musl
98− conflictname=$PROJECT_NAME
99− else
100− dpkgname=$PROJECT_NAME
101− conflictname=$PROJECT_NAME-musl
102− fi
103−
104− tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
105−
106− # copy the main binary
107− install -Dm755 "target/$TARGET/release/$PROJECT_NAME" "$tempdir/usr/bin/$PROJECT_NAME"
108− "${gcc_prefix}"strip "$tempdir/usr/bin/$PROJECT_NAME"
109−
110− # manpage
111− install -Dm644 target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/manual/bat.1 "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
112− gzip --best "$tempdir/usr/share/man/man1/$PROJECT_NAME.1"
113−
114− # completions
115− install -Dm644 target/"$TARGET"/release/build/"$PROJECT_NAME"-*/out/assets/completions/bat.fish "$tempdir/usr/share/fish/vendor_completions.d/$PROJECT_NAME.fish"
116−
117− # readme and license
118− install -Dm644 README.md "$tempdir/usr/share/doc/$PROJECT_NAME/README.md"
119− install -Dm644 LICENSE-MIT "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-MIT"
120− install -Dm644 LICENSE-APACHE "$tempdir/usr/share/doc/$PROJECT_NAME/LICENSE-APACHE"
121− cat > "$tempdir/usr/share/doc/$PROJECT_NAME/copyright" <<EOF
122−Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
123−Upstream-Name: $PROJECT_NAME
124−Source: $homepage
125−
126−Files: *
127−Copyright: $maintainer
128−License: Apache-2.0 or MIT
129−
130−License: Apache-2.0
131− On Debian systems, the complete text of the Apache-2.0 can be found in the
132− file /usr/share/common-licenses/Apache-2.0.
133−
134−License: MIT
135− Permission is hereby granted, free of charge, to any
136− person obtaining a copy of this software and associated
137− documentation files (the "Software"), to deal in the
138− Software without restriction, including without
139− limitation the rights to use, copy, modify, merge,
140− publish, distribute, sublicense, and/or sell copies of
141− the Software, and to permit persons to whom the Software
142− is furnished to do so, subject to the following
143− conditions:
144− .
145− The above copyright notice and this permission notice
146− shall be included in all copies or substantial portions
147− of the Software.
148− .
149− THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
150− ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
151− TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
152− PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
153− SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
154− CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
155− OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
156− IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
157− DEALINGS IN THE SOFTWARE.
158−EOF
159−
160− # Control file
161− mkdir "$tempdir/DEBIAN"
162− cat > "$tempdir/DEBIAN/control" <<EOF
163−Package: $dpkgname
164−Version: $version
165−Section: utils
166−Priority: optional
167−Maintainer: $maintainer
168−Homepage: $homepage
169−Architecture: $architecture
170−Provides: $PROJECT_NAME
171−Conflicts: $conflictname
172−Description: A cat(1) clone with wings.
173− A cat(1) clone with syntax highlighting and Git integration.
174−EOF
175−
176− fakeroot dpkg-deb --build "$tempdir" "${dpkgname}_${version}_${architecture}.deb"
177−}
178−
179−
180−main() {
181− build
182− pack
183− if [[ $TARGET = *linux* ]]; then
184− make_deb
185− fi
186−}
187−
188−main
ci/before_deploy.ps1deleted−28
@@ -1,28 +0,0 @@
1−# This script takes care of packaging the build artifacts that will go in the
2−# release zipfile
3−
4−$SRC_DIR = $PWD.Path
5−$STAGE = [System.Guid]::NewGuid().ToString()
6−
7−Set-Location $ENV:Temp
8−New-Item -Type Directory -Name $STAGE
9−Set-Location $STAGE
10−
11−$ZIP = "$SRC_DIR\$($Env:CRATE_NAME)-$($Env:APPVEYOR_REPO_TAG_NAME)-$($Env:TARGET).zip"
12−
13−Copy-Item "$SRC_DIR\target\release\bat.exe" '.\'
14−# TODO: disabled for now, see issue #372
15−# Copy-Item $SRC_DIR\target\release\build\bat-*\out\_bat.ps1 '.\'
16−
17−# readme and license
18−Copy-Item $SRC_DIR\README.md '.\'
19−Copy-Item $SRC_DIR\LICENSE-MIT '.\'
20−Copy-Item $SRC_DIR\LICENSE-APACHE '.\'
21−
22−7z a "$ZIP" *
23−
24−Push-AppveyorArtifact "$ZIP"
25−
26−Set-Location ..
27−Remove-Item $STAGE -Force -Recurse
28−Set-Location $SRC_DIR
ci/before_install.bashdeleted−38
@@ -1,38 +0,0 @@
1−#!/usr/bin/env bash
2−
3−set -ex
4−
5−if [ "$TRAVIS_OS_NAME" != linux ]; then
6− exit 0
7−fi
8−
9−sudo apt-get update
10−
11−# needed for musl targets
12−sudo apt-get install -y musl-tools
13−
14−# needed to build deb packages
15−sudo apt-get install -y fakeroot
16−
17−# needed for i686 linux gnu target
18−if [[ $TARGET == i686-unknown-linux-gnu ]]; then
19− sudo apt-get install -y gcc-multilib
20−fi
21−
22−# needed for cross-compiling for arm
23−if [[ $TARGET == arm-unknown-linux-gnueabihf ]]; then
24− sudo apt-get install -y \
25− gcc-4.8-arm-linux-gnueabihf \
26− binutils-arm-linux-gnueabihf \
27− libc6-armhf-cross \
28− libc6-dev-armhf-cross
29−fi
30−
31−# needed for cross-compiling for arm64
32−if [[ $TARGET == aarch64-unknown-linux-gnu ]]; then
33− sudo apt-get install -y \
34− gcc-4.8-aarch64-linux-gnu \
35− binutils-aarch64-linux-gnu \
36− gcc-aarch64-linux-gnu \
37− libc6-dev-arm64-cross
38−fi
ci/script.bashdeleted−20
@@ -1,20 +0,0 @@
1−#!/usr/bin/env bash
2−
3−set -ex
4−
5−# Incorporate TARGET env var to the build and test process
6−cargo build --target "$TARGET" --verbose
7−
8−# We cannot run arm executables on linux
9−if [[ $TARGET != arm-unknown-linux-gnueabihf ]] && [[ $TARGET != aarch64-unknown-linux-gnu ]]; then
10− cargo test --target "$TARGET" --verbose
11−
12− # Run 'bat' on its own source code and the README
13− cargo run --target "$TARGET" -- src/bin/bat/main.rs README.md --paging=never
14−fi
15−
16−# Check bat-as-a-library, which has a smaller set of dependencies
17−cargo check --target "$TARGET" --verbose --lib --no-default-features --features regex-onig
18−cargo check --target "$TARGET" --verbose --lib --no-default-features --features regex-onig,git
19−cargo check --target "$TARGET" --verbose --lib --no-default-features --features regex-onig,paging
20−cargo check --target "$TARGET" --verbose --lib --no-default-features --features regex-onig,git,paging
ci/.gitattributes → diagnostics/.gitattributesrenamed

The content is the same.

diagnostics/info.sh+6−4
@@ -58,7 +58,8 @@ _bat_:run() {
58 _out "$BAT" --version
58 _out "$BAT" --version
59 _out env | grep '^BAT_\|^PAGER='
59 _out env | grep '^BAT_\|^PAGER='
60
60
61− local cache_dir="$(bat --cache-dir)"
61+ local cache_dir
62+ cache_dir="$($BAT --cache-dir)"
62 if [[ -f "${cache_dir}/syntaxes.bin" ]]; then
63 if [[ -f "${cache_dir}/syntaxes.bin" ]]; then
63 _print_command "$BAT" "--list-languages"
64 _print_command "$BAT" "--list-languages"
64 echo "Found custom syntax set."
65 echo "Found custom syntax set."
@@ -79,8 +80,8 @@ _bat_config_:run() {
79_bat_wrapper_:run() {
80_bat_wrapper_:run() {
80 _bat_wrapper_:detect_wrapper() {
81 _bat_wrapper_:detect_wrapper() {
81 local bat="$1"
82 local bat="$1"
82− if file "$(which "${bat}")" | grep "text executable" &> /dev/null; then
83+ if file "$(command -v "${bat}")" | grep "text executable" &> /dev/null; then
83− _out_fence cat "$(which "${bat}")"
84+ _out_fence cat "$(command -v "${bat}")"
84 return
85 return
85 fi
86 fi
86
87
@@ -104,7 +105,8 @@ _bat_wrapper_function_:run() {
104 fi ;;
105 fi ;;
105
106
106 *bash* | *zsh*)
107 *bash* | *zsh*)
107− local type="$("$SHELL" --login -i -c "type ${command}" 2>&1)"
108+ local type
109+ type="$("$SHELL" --login -i -c "type ${command}" 2>&1)"
108 if grep 'function' <<< "$type" &> /dev/null; then
110 if grep 'function' <<< "$type" &> /dev/null; then
109 _out_fence "$SHELL" --login -i -c "declare -f ${command}"
111 _out_fence "$SHELL" --login -i -c "declare -f ${command}"
110 return
112 return
doc/README-ja.md+59−34
@@ -1,7 +1,6 @@
1<p align="center">
1<p align="center">
2 <img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
2 <img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
3− <a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
3+ <a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
4− <a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf?svg=true"></a>
5 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
4 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
6 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
5 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
7 シンタックスハイライトとGitとの連携機能付きの <i>cat(1)</i> クローン。
6 シンタックスハイライトとGitとの連携機能付きの <i>cat(1)</i> クローン。
@@ -12,8 +11,12 @@
12 <a href="#使い方">使い方</a> •
11 <a href="#使い方">使い方</a> •
13 <a href="#インストール">インストール</a> •
12 <a href="#インストール">インストール</a> •
14 <a href="#カスタマイズ">カスタマイズ</a> •
13 <a href="#カスタマイズ">カスタマイズ</a> •
15− <a href="#プロジェクトの目標と既存の類似したOSS">プロジェクトの目標と既存の類似したOSS</a> •
14+ <a href="#プロジェクトの目標と既存の類似したOSS">プロジェクトの目標と既存の類似したOSS</a><br>
16− 翻訳 [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="README-ja.md">日本語</a>][<a href="README-ko.md">한국어</a>]
15+ [<a href="../README.md">English</a>]
16+ [<a href="README-zh.md">中文</a>]
17+ [日本語]
18+ [<a href="README-ko.md">한국어</a>]
19+ [<a href="README-ru.md">Русский</a>]
17</p>
20</p>
18
21
19### シンタックスハイライト
22### シンタックスハイライト
@@ -39,18 +42,18 @@
39
42
40### 自動ページング
43### 自動ページング
41
44
42−出力が1つの画面に対して大きすぎる場合、`bat` は自身の出力を `less` にパイプで繋げることが可能です。
45+出力が1つの画面に対して大きすぎる場合、`bat` は自身の出力をページャー(例えば `less`) にパイプで繋げます。
43
46
44### ファイルの連結
47### ファイルの連結
45
48
46−あなたはさらにファイルを連結させるに使うことも可能です:wink:。
49+あなたはさらにファイルを連結させるために使うことも可能です:wink:。
47−`bat` は非対話型のターミナルを検出すると、
50+`bat` は非対話型のターミナルを検出すると(すなわち他のプロセスにパイプしたりファイル出力していると)、
48−いつでも `cat` の完全互換として振る舞い、
51+`bat` は `cat` の完全互換として振る舞い、
49プレーンなファイルを表示します。
52プレーンなファイルを表示します。
50
53
51## 使い方
54## 使い方
52
55
53−単一のファイルを表示させたい
56+単一のファイルを表示させたい場合
54
57
55```bash
58```bash
56> bat README.md
59> bat README.md
@@ -62,7 +65,9 @@
62> bat src/*.rs
65> bat src/*.rs
63```
66```
64
67
65−標準入力から自動的に構文を決定させたい場合
68+標準入力から自動的に構文を決定させたい場合(ハイライトされるのは、
69+たいていは `#!/bin/sh` のようなシバンを利用して、
70+ファイルの一行目から構文を決定できる場合のみです)
66
71
67```bash
72```bash
68> curl -s https://sh.rustup.rs | bat
73> curl -s https://sh.rustup.rs | bat
@@ -93,6 +98,17 @@ bat f - g # output 'f', then stdin, then 'g'.
93
98
94### 他のツールとの統合
99### 他のツールとの統合
95
100
101+#### `fzf`
102+
103+[`fzf`](https://github.com/junegunn/fzf) のプレビューウィンドウに `bat` を使用できます。
104+その場合、`bat` の `--color=always` オプションを用いてカラー出力を強制しなければなりません。
105+また、`--line-range` オプションを用いることで巨大なファイルの読み込み時間を制限できます:
106+```bash
107+fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'
108+```
109+
110+詳しくは [`fzf` の `README`](https://github.com/junegunn/fzf#preview-window) を参照してください。
111+
96#### `find` or `fd`
112#### `find` or `fd`
97
113
98`find` の `-exec` オプションを使用して、`bat` ですべての検索結果をプレビューできます:
114`find` の `-exec` オプションを使用して、`bat` ですべての検索結果をプレビューできます:
@@ -119,8 +135,7 @@ batgrep needle src/
119```bash
135```bash
120tail -f /var/log/pacman.log | bat --paging=never -l log
136tail -f /var/log/pacman.log | bat --paging=never -l log
121```
137```
122−Note that we have to switch off paging in order for this to work. We have also specified the syntax
138+注意事項:`tail -f`と組み合わせるには、ページングをオフにしなければなりません。また、この場合は構文が自動検出されないため、明示的に指定(`-l log`)しています。
123−explicitly (`-l log`), as it can not be auto-detected in this case.
124
139
125#### `git`
140#### `git`
126
141
@@ -153,7 +168,7 @@ man 2 select
153```
168```
154
169
155フォーマットの問題が発生した場合は
170フォーマットの問題が発生した場合は
156−`MANROFFOPT = "-c"` を設定する必要もあります。
171+`MANROFFOPT="-c"` を設定する必要もあります。
157
172
158これを新しいコマンドにバンドルしたい場合は [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md) も使用できます。
173これを新しいコマンドにバンドルしたい場合は [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md) も使用できます。
159
174
@@ -166,21 +181,31 @@ man 2 select
166
181
167## インストール
182## インストール
168
183
169−[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
184+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
170
185
171−### On Ubuntu
186+### On Ubuntu (`apt` を使用)
172*... や他のDebianベースのLinuxディストリビューション*
187*... や他のDebianベースのLinuxディストリビューション*
173
188
174−Ubuntu Eoan 19.10 または Debian 不安定版 sid 以降の [the Ubuntu `bat` package](https://packages.ubuntu.com/eoan/bat) または [the Debian `bat` package](https://packages.debian.org/sid/bat) をインストールできます:
189+Ubuntu Eoan 19.10 または Debian 不安定版 sid 以降の [the Ubuntu `bat` package](https://packages.ubuntu.com/eoan/bat) または [the Debian `bat` package](https://packages.debian.org/sid/bat) からインストールできます:
175
190
176```bash
191```bash
177apt install bat
192apt install bat
178```
193```
179
194
195+`apt` を使用して `bat` をインストールした場合、実行可能ファイルの名前が `bat` ではなく `batcat` になることがあります([他のパッケージとの名前衝突のため](https://github.com/sharkdp/bat/issues/982))。`bat -> batcat` のシンボリックリンクまたはエイリアスを設定することで、実行可能ファイル名が異なることによる問題の発生を防ぎ、他のディストリビューションと一貫性を保てます。
196+
197+``` bash
198+mkdir -p ~/.local/bin
199+ln -s /usr/bin/batcat ~/.local/bin/bat
200+```
201+
202+### On Ubuntu (最新の `.deb` パッケージを使用)
203+*... や他のDebianベースのLinuxディストリビューション
204+
180batの最新リリースを実行する場合、または Ubuntu/Debian の古いバージョンを使用している場合は、[release page](https://github.com/sharkdp/bat/releases) から最新の `.deb` パッケージをダウンロードし、
205batの最新リリースを実行する場合、または Ubuntu/Debian の古いバージョンを使用している場合は、[release page](https://github.com/sharkdp/bat/releases) から最新の `.deb` パッケージをダウンロードし、
181次の方法でインストールします:
206次の方法でインストールします:
182```bash
207```bash
183−sudo dpkg -i bat_0.15.1_amd64.deb # adapt version number and architecture
208+sudo dpkg -i bat_0.18.3_amd64.deb # adapt version number and architecture
184```
209```
185
210
186### On Alpine Linux
211### On Alpine Linux
@@ -220,7 +245,7 @@ emerge sys-apps/bat
220
245
221### On Void Linux
246### On Void Linux
222
247
223−xbps-ininstall経由で `bat` をインストールできます。
248+xbps-install経由で `bat` をインストールできます。
224```
249```
225xbps-install -S bat
250xbps-install -S bat
226```
251```
@@ -233,7 +258,7 @@ pkg を使用してプリコンパイルされた [`bat` package](https://www.fr
233pkg install bat
258pkg install bat
234```
259```
235
260
236−または FreeBSD ポートから自分でビルドする:
261+または FreeBSD ポートから自分でビルドすることもできます:
237
262
238```bash
263```bash
239cd /usr/ports/textproc/bat
264cd /usr/ports/textproc/bat
@@ -336,13 +361,13 @@ ansible-galaxy install aeimer.install_bat
336### From binaries
361### From binaries
337
362
338
363
339−多くの異なるアーキテクチャのためのプレビルドバージョンを[リリースページ](https://github.com/sharkdp/bat/releases)からチェックしてみてください。静的にリンクされている多くのバイナリも利用できます: ファイル名に `musl` を含むアーカイブを探します。
364+多くの異なるアーキテクチャのためのプレビルドバージョンを[リリースページ](https://github.com/sharkdp/bat/releases)からチェックしてみてください。静的にリンクされている多くのバイナリも利用できます: ファイル名に `musl` を含むアーカイブを探してみてください。
340
365
341### From source
366### From source
342
367
343
368
344−`bat` をソースからビルドしたいならば、Rust 1.36 以上の環境が必要です。
369+`bat` をソースからビルドしたいならば、Rust 1.51 以上の環境が必要です。
345−そして `cargo` をビルドに対して使用します:
370+`cargo` を使用してビルドすることができます:
346
371
347```bash
372```bash
348cargo install --locked bat
373cargo install --locked bat
@@ -382,12 +407,12 @@ bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
382
407
383### 新しい構文の追加 / 言語の定義
408### 新しい構文の追加 / 言語の定義
384
409
385−`bat` はシンタックスハイライトのための [`syntext`](https://github.com/trishume/syntect/)
410+`bat` はシンタックスハイライトのための [`syntect`](https://github.com/trishume/syntect/)
386という素晴らしいライブラリを使用しています。`syntect` は、
411という素晴らしいライブラリを使用しています。`syntect` は、
387[Sublime Text の `.sublime-syntax` ファイル](https://www.sublimetext.com/docs/3/syntax.html)
412[Sublime Text の `.sublime-syntax` ファイル](https://www.sublimetext.com/docs/3/syntax.html)
388とテーマを読み取ることができます。新しい構文を定義するために以下の手順を行います。
413とテーマを読み取ることができます。新しい構文を定義するために以下の手順を行います。
389
414
390−構文定義ファイルを入れておくためのフォルダを作る:
415+構文定義ファイルを入れておくためのフォルダを作ります:
391
416
392```bash
417```bash
393mkdir -p "$(bat --config-dir)/syntaxes"
418mkdir -p "$(bat --config-dir)/syntaxes"
@@ -428,13 +453,13 @@ git clone https://github.com/greggb/sublime-snazzy
428bat cache --build
453bat cache --build
429```
454```
430
455
431−最後に、 `bat --list-themes` で新しいテーマが利用可能がチェックします
456+最後に、 `bat --list-themes` で新しいテーマが利用可能かチェックします
432
457
433### 異なるページャーの使用
458### 異なるページャーの使用
434
459
435`bat` は環境変数 `PAGER` に使用するページャーを明記します。
460`bat` は環境変数 `PAGER` に使用するページャーを明記します。
436この環境変数が定義されていない場合、デフォルトで `less` が使用されます。
461この環境変数が定義されていない場合、デフォルトで `less` が使用されます。
437−もし、異なるページャーが使用したい場合は、`PAGER` を修正してください。
462+もし、異なるページャーを使用したい場合は、`PAGER` を修正してください。
438または、`PAGER` を上書きする環境変数として `BAT_PAGER` を定義することも可能です。
463または、`PAGER` を上書きする環境変数として `BAT_PAGER` を定義することも可能です。
439
464
440もし、ページャーにコマンドライン引数を渡したい場合は、
465もし、ページャーにコマンドライン引数を渡したい場合は、
@@ -500,7 +525,7 @@ export BAT_CONFIG_PATH="/path/to/bat.conf"
500# Use italic text on the terminal (not supported on all terminals)
525# Use italic text on the terminal (not supported on all terminals)
501--italic-text=always
526--italic-text=always
502
527
503−# Use C++ syntax for .ino files
528+# Use C++ syntax for Arduino .ino files
504--map-syntax "*.ino:C++"
529--map-syntax "*.ino:C++"
505
530
506# Use ".gitignore"-style highlighting for ".ignore" files
531# Use ".gitignore"-style highlighting for ".ignore" files
@@ -526,14 +551,14 @@ Windows 10では、`conhost.exe` (コマンドプロンプト)と
526[ConEmu](https://conemu.github.io/) を含む [Cmder](http://cmder.net/) を使用できます。
551[ConEmu](https://conemu.github.io/) を含む [Cmder](http://cmder.net/) を使用できます。
527
552
528**注意:** Git と MSYS の `less` はWindows上で色を正しく解釈しません。
553**注意:** Git と MSYS の `less` はWindows上で色を正しく解釈しません。
529−もし、あなたが他のページャーをインストールしていないのであれば、 `--paging=never` オプションを付け加える
554+もし、あなたが他のページャーをインストールしていないのであれば、 `--paging=never` オプションを付け加えるか
530−または `BAT_PAGER` に空文字を設定することでページングを完全に無効にできます。
555+`BAT_PAGER` に空文字を設定することでページングを完全に無効にできます。
531
556
532### Cygwin
557### Cygwin
533
558
534Windows上の `bat` は Cygwin のunix風のpath(`/cygdrive/*`)をネイティブサポートしていません。絶対的なcygwinパスを引数として受けたときに、 `bat` は以下のエラーを返すでしょう: `The system cannot find the path specified. (os error 3)`
559Windows上の `bat` は Cygwin のunix風のpath(`/cygdrive/*`)をネイティブサポートしていません。絶対的なcygwinパスを引数として受けたときに、 `bat` は以下のエラーを返すでしょう: `The system cannot find the path specified. (os error 3)`
535
560
536−wrapperを作成するまたは以下の関数を `.bash_profile` に追記することでこの問題を解決することができます:
561+wrapperを作成するか、以下の関数を `.bash_profile` に追記することで、この問題を解決することができます:
537
562
538```bash
563```bash
539bat() {
564bat() {
@@ -553,7 +578,7 @@ bat() {
553
578
554### ターミナルと色
579### ターミナルと色
555
580
556−`bat` はターミナルがトゥルーカラーをサポートしている/していない関係なくサポートします。
581+`bat` はターミナルがトゥルーカラーをサポートしている/していないに関係なくサポートします。
557しかし、シンタックスハイライトのテーマの色が8-bitカラーに最適化されていない場合、
582しかし、シンタックスハイライトのテーマの色が8-bitカラーに最適化されていない場合、
55824-bitであるトゥルーカラーをサポートしているターミナルを使用することを強く推奨します(`terminator`, `konsole`, `iTerm2`, ...)。
58324-bitであるトゥルーカラーをサポートしているターミナルを使用することを強く推奨します(`terminator`, `konsole`, `iTerm2`, ...)。
559この [記事](https://gist.github.com/XVilka/8346728) には
584この [記事](https://gist.github.com/XVilka/8346728) には
@@ -610,16 +635,16 @@ cargo install --locked --force
610
635
611`bat` は以下の目標を達成しようと試みています:
636`bat` は以下の目標を達成しようと試みています:
612
637
613−- 美しい高度なシンタックスハイライトの提供
638+- 美しく高度なシンタックスハイライトの提供
614- ファイルの差分を表示するためのGitとの連携
639- ファイルの差分を表示するためのGitとの連携
615- (POSIX) `cat` との完全互換
640- (POSIX) `cat` との完全互換
616−- ユーザーフレンドリーがコマンドラインインターフェースの提供
641+- ユーザーフレンドリーなコマンドラインインターフェースの提供
617
642
618あなたが同様のプログラムを探しているなら、多くの選択肢があります。
643あなたが同様のプログラムを探しているなら、多くの選択肢があります。
619比較については [このドキュメント](alternatives.md) を参照してください。
644比較については [このドキュメント](alternatives.md) を参照してください。
620
645
621## ライセンス
646## ライセンス
622−Copyright (c) 2018-2020 [bat-developers](https://github.com/sharkdp/bat).
647+Copyright (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat).
623
648
624`bat` は MIT License 及び Apache License 2.0 の両方の条件の下で配布されています。
649`bat` は MIT License 及び Apache License 2.0 の両方の条件の下で配布されています。
625
650
doc/README-ko.md+466−191
@@ -1,75 +1,90 @@
1<p align="center">
1<p align="center">
2− <img src="../doc/logo-header.svg" alt="bat - a cat clone with wings"><br>
2+ <img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
3− <a href="https://travis-ci.org/sharkdp/bat"><img src="https://travis-ci.org/sharkdp/bat.svg?branch=master" alt="Build Status"></a>
3+ <a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
4− <a href="https://ci.appveyor.com/project/sharkdp/bat"><img src="https://ci.appveyor.com/api/projects/status/cptsmtbiwbnr2vhf/branch/master?svg=true"></a>
5 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
4 <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
6 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
5 <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
7−
6+ 문법 강조와 Git 통합 기능의 <i>cat(1)</i> 클론
8− 문법 강조와 깃 통합 기능의 <i>cat(1)</i> 클론
9</p>
7</p>
10
8
11<p align="center">
9<p align="center">
12 <a href="#문법-강조">주요 기능들</a> •
10 <a href="#문법-강조">주요 기능들</a> •
13 <a href="#사용법">사용법</a> •
11 <a href="#사용법">사용법</a> •
14 <a href="#설치">설치</a> •
12 <a href="#설치">설치</a> •
15− <a href="#커스터마이즈">커스터마이즈</a> •
13+ <a href="#사용자화">사용자화</a> •
16− <a href="#프로젝트-목표와-대안들">프로젝트 목표와 대안들</a> •
14+ <a href="#프로젝트-목표와-대안들">프로젝트 목표와 대안들</a><br>
17− 번역 [<a href="https://github.com/chinanf-boy/bat-zh">中文</a>][<a href="../doc/README-ja.md">日本語</a>]
15+ [<a href="../README.md">English</a>]
16+ [<a href="README-zh.md">中文</a>]
17+ [<a href="README-ja.md">日本語</a>]
18+ [한국어]
19+ [<a href="README-ru.md">Русский</a>]
18</p>
20</p>
19
21
20### 문법 강조
22### 문법 강조
21
23
22−`bat`은 다양한 프로그래밍 언어와 마크업 언어에 대해 문법 강조(Syntax highlighting)기능을 지원하고 있습니다:
24+`bat`은 다양한 프로그래밍 및 마크업 언어의 문법 강조(syntax highlighting) 기능을
25+지원합니다:
23
26
24![Syntax highlighting example](https://imgur.com/rGsdnDe.png)
27![Syntax highlighting example](https://imgur.com/rGsdnDe.png)
25
28
26### Git 통합
29### Git 통합
27
30
28−`bat`은 `git`을 통해 인덱스와 함께 변경분을 표시합니다 (왼쪽 바를 확인하세요):
31+`bat`은 `git`을 통해 인덱스와 함께 변경분을 표시합니다
32+(왼쪽 사이드바를 확인하세요):
29
33
30![Git integration example](https://i.imgur.com/2lSW4RE.png)
34![Git integration example](https://i.imgur.com/2lSW4RE.png)
31
35
32−### 표시할 수 없는 문자 처리
36+### 비인쇄 문자 처리
33
37
34−`-A`/`--show-all` 옵션을 사용하여 표시할수 없는 문자를 시각화 해줍니다:
38+`-A`/`--show-all` 옵션을 사용하여 비인쇄 문자를 표시 및 강조할 수 있습니다:
35
39
36![Non-printable character example](https://i.imgur.com/WndGp9H.png)
40![Non-printable character example](https://i.imgur.com/WndGp9H.png)
37
41
38−### 자동 페이징
42+### 자동 페이징
39
43
40−하나의 화면에 비해 출력이 너무 큰 경우, `less` 를 이용해 출력들을 연결할 수 있습니다.
44+`bat`은 기본적으로 한 화면에 비해 출력이 큰 경우 `less`와 같은 페이저(pager)로
45+출력을 연결(pipe)합니다.
46+만약 `bat`을 언제나 `cat`처럼 작동하게 하려면 (출력을 페이지하지 않기),
47+`--paging=never` 옵션을 커맨드 라인이나 설정 파일에 넣을 수 있습니다.
48+셸(shell) 설정에서 `cat`을 `bat`의 alias로 사용하려면,
49+`alias cat='bat --paging=never'`를 써서 기본 행동을 유지할 수 있습니다.
41
50
42−### 파일 연결
51+### 파일 연결(concatenation)
43
52
44−이 뿐만 아니라 파일을 연결할 때도 사용 할 수 있습니다. :wink: `bat`가 인터렉티브 하지 않은(non-interactive)가 감지하면 (예를 들어,다른 프로세스 혹은 파일과 파이프라인을 연결 한 경우) `bat`은 `cat`을 대신하여 동작하며 일반 파일 내용을 표기해줍니다.
53+페이저(pager)를 사용하더라도 `bat`은 파일들을 연결(concatenate)할 수 있습니다
54+:wink:.
55+`bat`이 비대화형(non-interactive) 터미널(예를 들어, 다른 프로세스나 파일에
56+연결(pipe)한 경우)을 감지하면, `bat`은 `--pager` 옵션의 값과 상관없이 `cat`과
57+동일하게 파일 내용을 그대로 출력합니다.
45
58
46## 사용법
59## 사용법
47
60
48−터미널에서 하나의 파일 표시하기
61+터미널에 하나의 파일 표시하기
49
62
50```bash
63```bash
51> bat README.md
64> bat README.md
52```
65```
53
66
54−여러 파일 한번에 보여주기
67+여러 파일 한 번에 보여주기
55
68
56```bash
69```bash
57> bat src/*.rs
70> bat src/*.rs
58```
71```
59
72
60−stdin에서 읽고, 자동으로 맞는 문법 강조 적용하기
73+stdin에서 읽고, 자동으로 맞는 문법 결정하기 (참고로, 문법 강조는 파일의 첫
74+줄만으로 문법이 결정될 수 있을 때만 작동합니다.
75+이는 보통 `#!/bin/sh`와 같은 셔뱅(shebang)으로 판단합니다.)
61
76
62```bash
77```bash
63> curl -s https://sh.rustup.rs | bat
78> curl -s https://sh.rustup.rs | bat
64```
79```
65
80
66−stdin에서 읽고, 명시적으로 언어 지정하여 적용하기
81+stdin에서 읽고, 명시적으로 언어 지정하기
67
82
68```bash
83```bash
69> yaml2json .travis.yml | json_pp | bat -l json
84> yaml2json .travis.yml | json_pp | bat -l json
70```
85```
71
86
72−표시할 수 없는 문자 처리하기
87+비인쇄 문자 표시 및 강조하기
73```bash
88```bash
74> bat -A /etc/hosts
89> bat -A /etc/hosts
75```
90```
@@ -86,23 +101,38 @@ bat -n main.rs # show line numbers (only)
86bat f - g # output 'f', then stdin, then 'g'.
101bat f - g # output 'f', then stdin, then 'g'.
87```
102```
88
103
89−### 다른 툴과의 통합
104+### 다른 도구들과 통합하기
105+
106+#### `fzf`
107+
108+`bat`을 [`fzf`](https://github.com/junegunn/fzf)의 프리뷰로 쓸 수 있습니다.
109+이를 위해서는 `bat`의 `--color=always` 옵션으로 항상 컬러 출력이 나오게 해야
110+합니다.
111+또한 `--line-range` 옵션으로 긴 파일의 로드 시간을 제한할 수 있습니다:
112+```bash
113+fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'
114+```
115+더 많은 정보는
116+[`fzf`의 `README`](https://github.com/junegunn/fzf#preview-window)를 참고하세요.
90
117
91−#### `find` 와 `fd`
118+#### `find`와 `fd`
92
119
93−`find`의 `-exec` 옵션을 사용하여 `bat`의 모든 검색 결과를 미리 볼 수 있습니다:
120+`find`의 `-exec` 옵션을 사용하여 모든 검색 결과를 `bat`로 미리 볼 수 있습니다:
94```bash
121```bash
95find … -exec bat {} +
122find … -exec bat {} +
96```
123```
97
124
98−[`fd`](https://github.com/sharkdp/fd)를 사용하고 있는 경우, `-X`/`--exec-batch` 옵션을 이용하여 동일하게 사용할 수 있습니다:
125+[`fd`](https://github.com/sharkdp/fd)를 사용하는 경우, `-X`/`--exec-batch`
126+옵션을 이용하여 동일하게 사용할 수 있습니다:
99```bash
127```bash
100fd … -X bat
128fd … -X bat
101```
129```
102
130
103#### `ripgrep`
131#### `ripgrep`
104
132
105−[`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md)과 함께, [`ripgrep`](https://github.com/BurntSushi/ripgrep)의 검색 결과를 `bat`을 이용하여 볼 수 있습니다.
133+[`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md)을
134+통해 `bat`로 [`ripgrep`](https://github.com/BurntSushi/ripgrep)의 검색 결과를
135+출력할 수 있습니다.
106
136
107```bash
137```bash
108batgrep needle src/
138batgrep needle src/
@@ -110,279 +140,401 @@ batgrep needle src/
110
140
111#### `tail -f`
141#### `tail -f`
112
142
113−`bat` 과 `tail -f`를 함께 사용하여, 특정 파일을 문법 강조하며 지속적으로 모니터링 할 수 있습니다.
143+`bat`와 `tail -f`를 함께 사용하여 주어진 파일을 문법 강조하며 지속적으로
144+모니터할 수 있습니다.
114```bash
145```bash
115tail -f /var/log/pacman.log | bat --paging=never -l log
146tail -f /var/log/pacman.log | bat --paging=never -l log
116```
147```
117−이 작업을 하려면 페이징 기능을 꺼야합니다. 또, 자동 감지가 되지 않기 때문에, 적용되어야할 문법을 명시적(`-l log`)으로 지정해야 합니다.
148+참고로 이 작업을 하려면 페이징 기능을 꺼야 합니다.
149+또한 이 경우 문법을 자동 감지할 수 없기 때문에, 적용할 문법을 직접 지정해야
150+합니다 (`-l log`).
118
151
119#### `git`
152#### `git`
120
153
121−`bat`과 `git show`를 함께 사용하여 주어진 파일의 이전 기록을 문법 강조와 함께 볼 수 있습니다:
154+`bat`과 `git show`를 함께 사용하여 주어진 파일의 이전 버전을 올바른 문법 강조로
155+볼 수 있습니다:
122```bash
156```bash
123git show v0.6.0:src/main.rs | bat -l rs
157git show v0.6.0:src/main.rs | bat -l rs
124```
158```
125
159
126−diffs 내에서 문법 강조 표시는 현재 지원되지 않습니다. 이 기능은 [`delta`](https://github.com/dandavison/delta)에서 찾아 볼 수 있습니다.
160+#### `git diff`
161+
162+`bat`과 `git diff`를 함께 사용하여 수정된 코드 주위의 줄들을 올바른 문법 강조로
163+볼 수 있습니다:
164+```bash
165+batdiff() {
166+ git diff --name-only --diff-filter=d | xargs bat --diff
167+}
168+```
169+이것을 별도의 도구로 쓰고 싶다면
170+[`bat-extras`](https://github.com/eth-p/bat-extras)의 `batdiff`를 확인해 보세요.
171+
172+Git과 diff의 더 많은 지원을 원한다면
173+[`delta`](https://github.com/dandavison/delta)를 확인해 보세요.
127
174
128#### `xclip`
175#### `xclip`
129
176
130−`bat` 출력에서 라인 넘버와 Git 수정 내역이 같이 있어 파일 내용을 복사하기가 어려울 수도 있습니다. 이 경우에는 `-p`/`--plain` 옵션을 사용 하거나 출력 시 파이프라인으로 `xclip`을 사용하면 됩니다:
177+`bat` 출력에 줄 번호와 Git 수정 내역이 포함되어서 파일의 내용을 복사하기
178+어려울 수 있습니다.
179+이 경우에는 `bat`의 `-p`/`--plain` 옵션을 사용하거나 간단히 `xclip`으로 출력을
180+연결(pipe)하면 됩니다:
131```bash
181```bash
132bat main.cpp | xclip
182bat main.cpp | xclip
133```
183```
134−`bat` 에서는 리다이렉트된 것으로 감지하여, 파일 내용만 출력합니다.
184+`bat`는 출력이 우회되고 있다는 것을 감지하여 파일 내용 그대로를 출력합니다.
135
185
136#### `man`
186#### `man`
137
187
138−`bat`은 `MANPAGER` 환경 변수 설정을 통해 `man`에 대하여 컬러 페이져를 사용할 수 있습니다:
188+`MANPAGER` 환경 변수 설정을 통해 `bat`을 `man`의 컬러 페이저(pager)로 쓸 수
189+있습니다.
139
190
140```bash
191```bash
141export MANPAGER="sh -c 'col -bx | bat -l man -p'"
192export MANPAGER="sh -c 'col -bx | bat -l man -p'"
142man 2 select
193man 2 select
143```
194```
195+(Debian이나 Ubuntu를 사용한다면 `bat`을 `batcat`으로 치환하세요.)
144
196
145−포매팅 문제가 발생한다면, `MANROFFOPT="-c"` 설정 해야 할 수도 있습니다 .
197+포팻 문제가 발생한다면, `MANROFFOPT="-c"`을 써야 할 수 있습니다.
146
198
147−새 커맨드에서 이 번들을 사용하려면, [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md)을 이용 할 수 있습니다.
199+이 기능을 포함한 새로운 명령어를 선호한다면,
200+[`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md)을 쓸
201+수도 있습니다.
148
202
203+참고로 [Manpage 문법](../assets/syntaxes/Manpage.sublime-syntax)은 본 저장소에서
204+개발 중에 있으며, 아직 더 손봐야 합니다.
149
205
150−참고 : [Manpage syntax](../assets/syntaxes/Manpage.sublime-syntax)는 이 저장소에서 개발되고 있으며, 아직 작업 중 입니다.
206+또한, 이는 Mandoc의 `man` 구현에서
207+[작동하지 않습니다](https://github.com/sharkdp/bat/issues/1145).
151
208
152#### `prettier` / `shfmt` / `rustfmt`
209#### `prettier` / `shfmt` / `rustfmt`
153
210
154−[`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) 스크립트는 코드를 포맷팅하고 `bat`으로 출력해주는 랩퍼(wrapper) 입니다.
211+[`prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md)
212+스크립트는 코드를 포맷하고 `bat`으로 출력하는 래퍼(wrapper)입니다.
155
213
156
214
157## 설치
215## 설치
158
216
159−[![Packaging status](https://repology.org/badge/vertical-allrepos/bat.svg)](https://repology.org/project/bat/versions)
217+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
160
218
161−### On Ubuntu
219+### Ubuntu에서 (`apt` 사용)
162−*... 그리고 기타 Debian 기반의 Linux 배포판들.*
220+*... 그리고 다른 Debian 기반의 Linux 배포판들에서.*
163
221
164−Ubuntu Eoan 19.10 혹은 Debian unstable sid 이후 버전 부터는 [Ubuntu용 `bat` 패키지](https://packages.ubuntu.com/eoan/bat)나 [Debian용 `bat` 패키지](https://packages.debian.org/sid/bat) 를 설치 할 수 있습니다.
222+`bat`은 [Ubuntu](https://packages.ubuntu.com/eoan/bat)와
223+[Debian](https://packages.debian.org/sid/bat) 패키지 배포 과정에 도입되는 중이며,
224+Eoan 19.10 버전의 Ubuntu에서부터 제공됩니다.
225+현재 Debian에서는 불안정한 "Sid" 브랜치에서만 `bat`이 제공됩니다.
226+
227+만약 충분히 최신 버전의 Ubuntu/Debian이 설치되어 있다면 간단히 다음을 실행하세요:
165
228
166```bash
229```bash
167apt install bat
230apt install bat
168```
231```
169
232
170−만약 최근 릴리즈된 bat을 사용을 원하거나 buntu/Debian 예전 버전을 사용하는 경우, [릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 다음과 같이 `.deb` 패키지를 받아 설치 할 수도 있습니다:
233+**중요**: 만약 `bat`을 이와 같이 설치한다면, ([다른 패키지와의 이름
234+충돌](https://github.com/sharkdp/bat/issues/982)로 인하여) `bat` 대신에
235+`batcat`이라는 이름의 실행 파일로 설치될 수 있음을 참고하세요.
236+이에 따른 문제들과 다른 배포판들과의 일관성을 위하여 `bat -> batcat` symlink
237+혹은 alias를 설정할 수 있습니다:
238+``` bash
239+mkdir -p ~/.local/bin
240+ln -s /usr/bin/batcat ~/.local/bin/bat
241+```
242+
243+### Ubuntu에서 (가장 최신 `.deb` 패키지들 사용)
244+*... 그리고 다른 Debian 기반의 Linux 배포판들에서.*
245+
246+만약 여러분이 설치한 Ubuntu/Debian에 패키지가 배포되지 않거나 가장 최신 릴리즈된
247+`bat`을 원한다면, [릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서
248+다음과 같이 `.deb` 패키지를 받아 설치하세요:
171
249
172```bash
250```bash
173−sudo dpkg -i bat_0.15.1_amd64.deb # adapt version number and architecture
251+sudo dpkg -i bat_0.18.3_amd64.deb # adapt version number and architecture
174```
252```
175
253
176−### On Alpine Linux
254+### Alpine Linux에서
177
255
178−공식 소스를 통해 [`bat` 패키지](https://pkgs.alpinelinux.org/packages?name=bat) 를 설치 할 수 있습니다:
256+적절한 저장소가 활성화되어 있다면, 공식 소스를 통해
257+[`bat` 패키지](https://pkgs.alpinelinux.org/packages?name=bat)를 설치할 수
258+있습니다:
179
259
180```bash
260```bash
181apk add bat
261apk add bat
182```
262```
183
263
184−### On Arch Linux
264+### Arch Linux에서
185
265
186−공식 소스를 통해 [`bat` 패키지](https://www.archlinux.org/packages/community/x86_64/bat/)를 설치할 수 있습니다:
266+공식 소스를 통해
267+[`bat` 패키지](https://www.archlinux.org/packages/community/x86_64/bat/)를
268+설치할 수 있습니다:
187
269
188```bash
270```bash
189pacman -S bat
271pacman -S bat
190```
272```
191
273
192−### On Fedora
274+### Fedora에서
193
275
194−[공식 Fedora 모듈 저장소](https://docs.fedoraproject.org/en-US/modularity/using-modules/)에서 [`bat` 패키지](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506)을 설치할 수 있습니다:
276+공식
277+[Fedora 모듈](https://docs.fedoraproject.org/en-US/modularity/using-modules/)
278+저장소에서
279+[`bat` 패키지](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506)를
280+설치할 수 있습니다:
195
281
196```bash
282```bash
197dnf install bat
283dnf install bat
198```
284```
199
285
200−### On Gentoo Linux
286+### Funtoo Linux에서
287+
288+dev-kit을 통해 [`bat` 패키지](https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat)를 설치할 수 있습니다:
289+
290+```bash
291+emerge sys-apps/bat
292+```
293+
294+### Gentoo Linux에서
201
295
202−공식 소스를 통해 [`bat` 패키지](https://packages.gentoo.org/packages/sys-apps/bat)를 설치할 수 있습니다.
296+공식 소스를 통해
297+[`bat` 패키지](https://packages.gentoo.org/packages/sys-apps/bat)를 설치할 수
298+있습니다:
203
299
204```bash
300```bash
205emerge sys-apps/bat
301emerge sys-apps/bat
206```
302```
207
303
208−### On Void Linux
304+### Void Linux에서
209
305
210−xbps-install를 이용해 `bat`을 설치할 수 있습니다:
306+xbps-install을 이용해 `bat`을 설치할 수 있습니다:
211```bash
307```bash
212xbps-install -S bat
308xbps-install -S bat
213```
309```
214
310
215−### On FreeBSD
311+### Termux에서
312+
313+pkg를 이용해 `bat`을 설치할 수 있습니다:
314+```bash
315+pkg install bat
316+```
317+
318+### FreeBSD에서
216
319
217−pkg를 이용하여 미리 컴파일된 [`bat` 패키지](https://www.freshports.org/textproc/bat)를 설치할 수 있습니다:
320+pkg를 이용하여 미리 컴파일된
321+[`bat` 패키지](https://www.freshports.org/textproc/bat)를 설치할 수 있습니다:
218
322
219```bash
323```bash
220pkg install bat
324pkg install bat
221```
325```
222
326
223−또는 FreeBSD 포트에서 직접 빌드할 수도 있습니다:
327+또는 FreeBSD 포트에서 직접 빌드할 수도 있습니다:
224
328
225```bash
329```bash
226cd /usr/ports/textproc/bat
330cd /usr/ports/textproc/bat
227make install
331make install
228```
332```
229
333
230−### Via nix
334+### nix를 써서
231
335
232−[nix package manager](https://nixos.org/nix)를 이용해 `bat`을 설치할 수 있습니다:
336+[nix package manager](https://nixos.org/nix)를 이용해 `bat`을 설치할 수
337+있습니다:
233
338
234```bash
339```bash
235nix-env -i bat
340nix-env -i bat
236```
341```
237
342
238−### On openSUSE
343+### openSUSE에서
239
344
240−zypper을 이용해 `bat`을 설치할 수 있습니다:
345+zypper를 이용해 `bat`을 설치할 수 있습니다:
241
346
242```bash
347```bash
243zypper install bat
348zypper install bat
244```
349```
245
350
246−### On macOS
351+### snap 패키지를 써서
352+
353+지금으로서는 추천하는 snap 패키지가 없습니다.
354+제공되는 패키지들이 존재할 수는 있지만, 공식적으로 지원되지 않으며
355+[문제](https://github.com/sharkdp/bat/issues/1519)가 있을 수 있습니다.
356+
247
357
248−[Homebrew](http://braumeister.org/formula/bat)를 이용해 `bat`을 설치할 수 있습니다:
358+### macOS (또는 Linux)에서 Homebrew를 써서
359+
360+[macOS의 Homebrew](https://formulae.brew.sh/formula/bat) 또는
361+[Linux의 Homebrew](https://formulae.brew.sh/formula-linux/bat)를 이용하여
362+`bat`을 설치할 수 있습니다.
249
363
250```bash
364```bash
251brew install bat
365brew install bat
252```
366```
253
367
254−또는 [MacPorts](https://ports.macports.org/port/bat/summary)를 사용할 수도 있습니다:
368+### macOS에서 MacPorts를 써서
369+
370+[MacPorts](https://ports.macports.org/port/bat/summary)를 이용하여 `bat`을
371+설치할 수 있습니다:
255
372
256```bash
373```bash
257port install bat
374port install bat
258```
375```
259
376
260−### On Windows
377+### Windows에서
261
378
262−Windows에서 `bat`을 설치할 수 있는 몇 가지 옵션들이 있습니다. 먼저 `bat`을 설치 한 후, ["Windows에서 사용하기"](#Windows에서-사용하기) 참고하시기 바랍니다.
379+Windows에서 `bat`을 설치할 수 있는 몇 가지 옵션들이 있습니다.
380+먼저 `bat`을 설치한 후,
381+["Windows에서 `bat` 사용하기"](#windows에서-bat-사용하기) 섹션을 살펴보세요.
263
382
264−#### With Chocolatey
383+#### 전제 조건
265
384
266−[Chocolatey](https://chocolatey.org/packages/Bat)를 이용해 `bat`을 설치할 수 있습니다:
385+[Visual C++ 재배포 가능](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
386+패키지를 설치해야 합니다.
387+
388+#### Chocolatey를 써서
389+
390+[Chocolatey](https://chocolatey.org/packages/Bat)를 이용해 `bat`을 설치할 수
391+있습니다:
267```bash
392```bash
268choco install bat
393choco install bat
269```
394```
270
395
271−#### With Scoop
396+#### Scoop을 써서
272
397
273[scoop](https://scoop.sh/)을 이용해 `bat`을 설치할 수 있습니다:
398[scoop](https://scoop.sh/)을 이용해 `bat`을 설치할 수 있습니다:
274```bash
399```bash
275scoop install bat
400scoop install bat
276```
401```
277−[Visual C++ Redistributable 패키지](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)를 같이 설치해 주어야 합니다.
278
402
279−#### From prebuilt binaries:
403+#### 사전 빌드된 바이너리들로
280
404
281−[릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 빌드된 바이너리를 다운받을 수 있습니다.
405+[릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 사전 빌드된
406+바이너리를 다운받을 수 있습니다.
282
407
283−[Visual C++ Redistributable 패키지](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)를 같이 설치해 주어야 합니다.
408+[Visual C++ 재배포 가능](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
409+패키지를 설치해야 합니다.
284
410
285−### Via Docker
411+### 바이너리들로
286
412
287−컨테이너에서 `bat`을 사용할 수 있는 [Docker image](https://hub.docker.com/r/danlynn/bat/)가 있습니다.:
413+[릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 다양한 아키텍처를
288−```bash
414+위해 사전 빌드된 버전들을 확인할 수 있습니다.
289−docker pull danlynn/bat
415+정적 링크 바이너리들은 파일 이름에 `musl` 이 포함된 아카이브들을 확인하세요.
290−alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
291−```
292
416
293−### Via Ansible
417+### 소스에서
294
418
295−[Ansible](https://www.ansible.com/)을 사용해 `bat`을 설치할 수 있습니다:
419+`bat`의 소스를 빌드하기 위해서는, Rust 1.51 이상이 필요합니다.
420+`cargo`를 이용해 전부 빌드할 수 있습니다:
296
421
297```bash
422```bash
298−# Install role on local machine
423+cargo install --locked bat
299−ansible-galaxy install aeimer.install_bat
300−```
301−
302−```yaml
303−---
304−# Playbook to install bat
305−- host: all
306− roles:
307− - aeimer.install_bat
308```
424```
309
425
310−- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
426+참고로 man 페이지나 셸 자동 완성 파일과 같은 부가 파일들은 이 방법으로 설치될 수
311−- [GitHub](https://github.com/aeimer/ansible-install-bat)
427+없습니다.
312−
428+이것들은 `cargo`에 의해 생성이 되고 (`build` 밑의) cargo 타켓 폴더에서 찾을 수
313−다음 배포판들에서 동작합니다:
429+있습니다.
314−- Debian/Ubuntu
315−- ARM (eg. Raspberry PI)
316−- Arch Linux
317−- Void Linux
318−- FreeBSD
319−- MacOS
320
430
321−### From binaries
431+## 사용자화
322
432
323−[릴리즈 페이지](https://github.com/sharkdp/bat/releases)에서 다양한 환경을 위해 빌드된 버전들을 확인 할 수 있습니다. 정적 링크 바이너리들은 아카이브에서 파일 이름에 `musl` 이 포함 파일로 확인 할 수 있습니다.
433+### 문법 강조 테마
324
434
325−### From source
435+`bat --list-themes`을 사용하여 사용 가능한 문법 강조 테마들의 목록을 확인할 수
436+있습니다.
437+`TwoDark` 테마를 선택하려면, `--theme=TwoDark` 옵션과 함께 `bat`을 사용하거나
438+`BAT_THEME` 환경 변수를 `TwoDark`로 설정하세요.
439+셸 시작 파일에 `export BAT_THEME="TwoDark"` 를 정의해 영구적으로 설정할 수
440+있습니다.
441+이 밖에 `bat`의 [설정 파일](#설정-파일)을 이용할 수 있습니다.
326
442
327−`bat`의 소스를 직접 빌드하기 위해서는, Rust 1.36 이상이 필요하며 `cargo`를 이용해 빌드할 수 있습니다.
443+만약 다른 테마들을 사용하여 특정 파일을 보고 싶다면, 다음 명령어를 쓸 수
444+있습니다(이 경우 [`fzf`](https://github.com/junegunn/fzf)가 필요합니다.)
328
445
329```bash
446```bash
330−cargo install --locked bat
447+bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
331```
448```
332
449
333−일부 플랫폼에서는 `llvm` 그리고/또는 `libclang-dev` 설치가 필요할 수도 있습니다.
450+`bat`은 기본적으로 어두운 배경에 적합합니다.
451+그러나 밝은 배경의 터미널을 사용한다면 `GitHub`이나 `OneHalfLight`과 같은 테마가
452+더 잘 어울립니다.
453+아래 [새로운 테마 추가하기](#새로운-테마-추가하기) 섹션에 따라 커스텀 테마를
454+사용할 수도 있습니다.
334
455
335−## 커스터마이즈
456+### 8비트 테마
336
457
337−### 문법 강조 테마
458+`bat`은 트루컬러 지원이 되더라도 항상
459+[8비트 색상](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors)을 사용하는
460+세 개의 테마가 있습니다.
338
461
339−`bat --list-themes`을 사용하면, 현재 사용 가능한 문법 강조 테마들을 확인할 수 있습니다. `TwoDark` 테마 선택하는 경우, `--theme=TwoDark` 옵션과 함께 `bat`을 사용하거나 환경변수에서 `BAT_THEME`를 `TwoDark`로 세팅해주면 됩니다. 쉘 시작 파일에 `export BAT_THEME="TwoDark"` 를 정의해 계속 사용도 가능합니다. 이 밖에 `bat`의 [설정 파일](#설정-파일)을 이용할 수도 있습니다.
462+- `ansi`는 어떤 터미널에서도 무난하게 보입니다. 이는 3비트 색상을 사용합니다:
463+ 검정, 빨강, 녹색, 노랑, 파랑, 마젠타, 시안, 하양.
464+- `base16`은 [base16](https://github.com/chriskempson/base16) 터미널 테마를 위해
465+ 디자인되었습니다.
466+ 이는 [base16 스타일 가이드라인](https://github.com/chriskempson/base16/blob/master/styling.md)에
467+ 따라 4비트 색상(3비트 색상에 밝은 변형 추가)을 사용합니다.
468+- `base16-256`는 [base16-shell](https://github.com/chriskempson/base16-shell)을
469+ 위해 디자인되었습니다.
470+ 이는 16부터 21의 일부 밝은 색상을 8비트 색상으로 대치합니다.
471+ 단지 256-색상 터미널을 쓰지만 base16-shell을 쓰지 않는다고 해서 이것을
472+ 사용하지 **마십시오**.
340
473
341−다른 테마를 미리 보고 싶은경우 다음 명령어와 같이 사용할 수 있습니다.(이 경우 [`fzf`](https://github.com/junegunn/fzf)가 필요합니다.)
474+이들 테마는 더 제한적이지만, 트루컬러 테마에 비해 두 장점이 있습니다:
342
475
343−```bash
476+- 이들은 3비트 혹은 4비트 색상을 쓰는 다른 터미널 소프트웨어와 더 잘
344−bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
477+ 어울립니다.
345−```
478+- 만약 터미널 테마를 바꾼다면, 이미 화면 상의 `bat`의 출력도 이에 맞추어
346−`bat`의 기본 테마는 어두운 배경색 터미널에 적합합니다. 만일 밝은 배경색을 사용할 경우에는 `GitHub` 이나 `OneHalfLight` 과 같은 테마가 더 잘 어울립니다. 아래 [새로운 테마 추가하기](#새로운-테마-추가하기)에 따라 커스텀 테마를 사용할수도 있습니다.
479+ 업데이트됩니다.
347
480
348### 출력 스타일
481### 출력 스타일
349
482
350−`--style` 옵션을 이용하여 `bat`의 출력 스타일을 변경 할 수 있습니다. 예를 들어, `--style=numbers,changes`는 Git 변경분과 라인 넘버에 대해서만 출력하며 눈금과 파일 헤더가 표시되지 않습니다. `BAT_STYLE` 환경 변수로 정의하여 계속해서 사용하거나`bat`의 [설정 파일](#설정-파일)을 사용할 수도 있습니다.
483+`--style` 옵션을 이용하면 `bat`의 출력 모양을 조절할 수 있습니다.
484+예를 들어, `--style=numbers,changes`를 통해 Git 변경분과 줄 번호는 출력하지만
485+격자와 파일 헤더는 출력하지 않을 수 있습니다.
486+`BAT_STYLE` 환경 변수를 정의하여 이러한 수정을 영구적으로 하거나 `bat`의
487+[설정 파일](#설정-파일)을 사용하세요.
351
488
352−### 새로운 문법 강조 / 언어 추가하기
489+### 새로운 문법 / 언어 정의 추가하기
353
490
354−`bat`은 문법 강조를 위해 [`syntect`](https://github.com/trishume/syntect/) 라이브러리를 사용하고 있습니다. `syntect`는 [Sublime Text의 `.sublime-syntax` 파일](https://www.sublimetext.com/docs/3/syntax.html)과 테마를 읽을 수 있습니다. 새로운 문법 강조를 추가하는 방법은 다음과 같습니다.
491+만약 `bat`에서 특정 문법이 지원되지 않을 경우, 다음의 절차를 통해 현재 `bat`
492+설치본에 새로운 문법을 쉽게 추가할 수 있습니다.
355
493
356−우선 문법 정의 파일을 넣을 폴더를 만듭니다:
494+`bat`은 문법 강조를 위해 훌륭한
495+[`syntect`](https://github.com/trishume/syntect/) 라이브러리를 사용합니다.
496+`syntect`는 임의의 [Sublime Text의 `.sublime-syntax`
497+파일](https://www.sublimetext.com/docs/3/syntax.html)과 테마를 읽을 수 있습니다.
357
498
358−```bash
499+[Package Control](https://packagecontrol.io/)에 Sublime 문법 패키지를 찾는
359−mkdir -p "$(bat --config-dir)/syntaxes"
500+방법이 잘 정리되어 있습니다.
360−cd "$(bat --config-dir)/syntaxes"
501+일단 문법을 찾았다면:
361
502
362−# Put new '.sublime-syntax' language definition files
503+1. 문법 정의 파일들을 넣을 폴더를 만듭니다:
363−# in this folder (or its subdirectories), for example:
364−git clone https://github.com/tellnobody1/sublime-purescript-syntax
365−```
366
504
367−다음 명령어를 통해 파일을 바이너리 캐시로 파싱합니다.
505+ ```bash
506+ mkdir -p "$(bat --config-dir)/syntaxes"
507+ cd "$(bat --config-dir)/syntaxes"
368
508
369−```bash
509+ # Put new '.sublime-syntax' language definition files
370−bat cache --build
510+ # in this folder (or its subdirectories), for example:
371−```
511+ git clone https://github.com/tellnobody1/sublime-purescript-syntax
512+ ```
372
513
373−마지막으로 `bat --list-languages`을 통해 새로운 언어가 사용 가능한지 확인합니다.
514+2. 이제 다음 명령어를 통해 파일들을 파싱(parse)하여 바이너리 캐시를 만듭니다.
374
515
375−기본 설정으로 돌아가려면, 다음 명령어를 이용합니다.:
516+ ```bash
517+ bat cache --build
518+ ```
376
519
377−```bash
520+3. 마지막으로, `bat --list-languages`로 새로 추가한 언어가 사용 가능한지
378−bat cache --clear
521+ 확인합니다.
379−```
522+
523+ 만약 기본 설정으로 돌아갈 일이 생긴다면, 다음 명령어를 이용합니다:
524+
525+ ```bash
526+ bat cache --clear
527+ ```
528+
529+4. 만약 특정 문법이 `bat`에 기본적으로 포함되어 있어야 한다고 생각한다면, 방침과
530+ 절차를 [여기](../doc/assets.md)서 읽은 후 "문법 요청(syntax request)"을 열어
531+ 주세요: [문법 요청하기](https://github.com/sharkdp/bat/issues/new?labels=syntax-request&template=syntax_request.md).
380
532
381### 새로운 테마 추가하기
533### 새로운 테마 추가하기
382
534
383−새로운 문법 정의 추가와 매우 유사합니다.
535+이 과정은 새로운 문법 정의 추가 방식과 매우 비슷합니다.
384
536
385−먼저, 새로운 문법 강조 테마 폴더를 만듭니다.
537+먼저, 새로운 문법 강조 테마 폴더를 만듭니다.
386```bash
538```bash
387mkdir -p "$(bat --config-dir)/themes"
539mkdir -p "$(bat --config-dir)/themes"
388cd "$(bat --config-dir)/themes"
540cd "$(bat --config-dir)/themes"
@@ -394,32 +546,93 @@ git clone https://github.com/greggb/sublime-snazzy
394bat cache --build
546bat cache --build
395```
547```
396
548
397−마지막으로 `bat --list-themes`을 통해 새로운 테마가 사용 가능한지 확인합니다.
549+마지막으로 `bat --list-themes`을 통해 새로 추가한 테마들이 사용 가능한지
550+확인합니다.
551+
552+### 파일 타입 설정을 추가하거나 변경하기
553+
554+새로운 파일 이름 패턴을 추가하려면 (혹은 이미 존재하는 것을 변경하려면)
555+`--map-syntax` 커맨드 라인 옵션을 사용하세요.
556+이 옵션은 `pattern:syntax` 꼴의 인자를 받습니다.
557+이때 `pattern`은 파일 이름과 절대 파일 경로를 매치할 글로브(glob) 패턴입니다.
558+`syntax` 부분은 지원되는 언어의 전체 이름입니다
559+(`bat --list-languages`를 통해 개요를 확인하세요).
560+
561+참고: 이 옵션은 커맨드 라인에 넘겨 주는 것보다는 `bat`의 설정 파일에 넣는 것이
562+좋을 것입니다 (아래를 보세요).
563+
564+예시: "INI" 문법 강조를 `.conf` 파일 확장자의 모든 파일에 적용하려면, 다음을
565+사용하세요:
566+```bash
567+--map-syntax='*.conf:INI'
568+```
569+
570+예시: `.ignore`(완전 일치)이라는 이름의 모든 파일을 "Git Ignore" 문법으로
571+열려면, 다음을 사용하세요:
572+```bash
573+--map-syntax='.ignore:Git Ignore'
574+```
575+
576+예시: `/etc/apache2`의 하위 폴더들에 있는 모든 `.conf` 파일들을 "Apache Conf"
577+문법으로 열려면, 다음을 사용하세요 (이 대응(mapping)은 이미 내장되어 있습니다):
578+```bash
579+--map-syntax='/etc/apache2/**/*.conf:Apache Conf'
580+```
398
581
399−### 다른 페이져 사용하기
582+### 다른 페이저 사용하기
400
583
401−`bat`은 환경변수 `PAGER`로 사용할 페이져를 명시합니다. 만약 이 변수가 정의되어있지 않다면 `less`가 기본입니다. 만약 다른 페이져를 사용하고 싶다면 `PAGER` 변수를 수정하거나 `BAT_PAGER` 환경 변수로 `PAGER` 대신 정의 할 수도 있습니다.
584+`bat`은 환경 변수 `PAGER`에 명시된 페이저를 사용합니다.
585+이 변수가 정의되어 있지 않다면, `less`가 기본으로 사용됩니다.
586+만약 다른 페이저를 사용하고 싶다면, `PAGER` 변수를 수정하거나 `BAT_PAGER` 환경
587+변수를 설정하여 `PAGER`의 설정을 오버라이드(override)할 수 있습니다.
402
588
403−만약 커맨드라인 인수로 넘기려면, `PAGER`/`BAT_PAGER` 변수를 정의를 통해 사용 할 수 있습니다. :
589+만약 커맨드라인 인수들을 페이저에게 넘겨 주려면, `PAGER`/`BAT_PAGER` 변수로
590+설정할 수 있습니다:
404
591
405```bash
592```bash
406export BAT_PAGER="less -RF"
593export BAT_PAGER="less -RF"
407```
594```
408
595
409−환경 변수 대신, `bat`의 [설정 파일](#설정-파일)에서 페이져를 설정 할 수도 있습니다.(`--pager` 옵션)
596+환경 변수를 사용하는 대신, `bat`의 [설정 파일](#설정-파일)로 페이저를 설정할
597+수도 있습니다 (`--pager` 옵션).
410
598
411−**참고**: 기본적으로 페이져가 `less`로 설정 되어있다면, `bat`은 다음 옵션들을 받을 수 있습니다: `-R`/`--RAW-CONTROL-CHARS`,
599+**참고**: 기본적으로, 페이저가 `less`로 설정되어 있다면 (그리고 커맨드 라인
412−`-F`/`--quit-if-one-screen` 그리고 `-X`/`--no-init`. 마지막 옵션(`-X`)은 530 이전 버전에서만 사용됩니다.
600+옵션이 지정되어 있지 않다면), `bat`은 다음 옵션들을 페이저로 넘겨줍니다:
601+`-R`/`--RAW-CONTROL-CHARS`, `-F`/`--quit-if-one-screen` 그리고 `-X`/`--no-init`.
602+마지막 옵션(`-X`)은 530 이전 버전의 `less`에만 사용됩니다.
413
603
414−`-R` 옵션은 ANSI 컬러를 올바르게 해석하기 위해 필요합니다. 두번째 옵션 (`-F`)은 출력 크기가 터미널의 세로 크기보다 작을 경우 즉시 종료되도록 합니다.
604+`-R` 옵션은 ANSI 색상을 올바르게 해석하기 위해 필요합니다.
415−페이져를 종료하기 위해 `q`를 누를 필요 없기 때문에 작은 파일을 다룰 때 용이합니다. 세번째 옵션(`-X`)는 `less` 이전 버전의 `--quit-if-one-screen` 기능과 함께 버그를 잡을 때 필요합니다. 안타깝게도, `less`의 마우스 휠 지원은 종료합니다.
605+두 번째 옵션(`-F`)은 출력 크기가 터미널의 세로 크기보다 작을 경우 less가 즉시
606+종료되도록 합니다.
607+이는 작은 파일을 다룰 때 페이저를 종료하기 위해 `q`를 누를 필요 없어서
608+편리합니다.
609+세 번째 옵션(`-X`)는 예전 버전의 `less`에 있는 `--quit-if-one-screen` 기능의
610+버그를 고치기 위해 필요합니다.
611+안타깝게도, 이는 `less`의 마우스 휠 지원과 호환되지 않습니다.
416
612
417−`less` 예전 버전에서 마우스 휠 기능을 활성화 시키려면, `-R` 옵션을 사용하면 됩니다. (위의 예제처럼, 이 옵션은 quit-if-one-screen 기능을 비활성화 시킵니다.)
613+`less`의 예전 버전에서 마우스 휠 기능을 활성화하려면, `-R` 옵션을 넘겨주세요
418−530 이하 버전에서는 그대로 사용할 수 있습니다.
614+(위의 예제처럼, 이 옵션은 quit-if-one-screen 기능을 비활성화합니다).
615+less 530과 이후 버전에서는 그대로 사용할 수 있습니다.
616+
617+### 들여쓰기
618+
619+`bat`은 페이저에 의존하지 않고 탭을 4 스페이스로 확장합니다.
620+이를 변경하려면 간단히 `--tabs` 인자에 표시되기를 원하는 스페이스 개수를
621+추가하세요.
622+
623+**참고**: (`bat`의 `--pager` 인자 혹은 `less`의 `LESS` 환경 변수를 통해)
624+페이저의 탭 길이를 지정하는 것은 효과가 없을 것인데, 이는 페이저가 이미
625+스페이스로 확장된 탭을 받기 때문입니다.
626+이 기능은 사이드바에 의한 들여쓰기 문제를 회피하기 위해 추가되었습니다.
627+`bat`을 `--tabs=0`과 함께 호출하면 이를 오버라이드하여 페이저가 탭을 처리하게
628+합니다.
419
629
420### 다크 모드
630### 다크 모드
421
631
422−macOS에서 다크 모드를 사용하고 있다면, OS 테마에 따라 다른 테마를 사용하도록 `bat`의 구성할 수 있습니다. 아래 코드는 라이트 모드에서는 `default` 테마를 다크모드에서는 `Github` 테마를 사용하는 방법입니다.
632+macOS에서 다크 모드를 사용하고 있다면, `bat`가 OS 테마에 따라 다른 테마를
633+사용하도록 구성할 수 있습니다.
634+아래 스니펫은 _다크 모드_에서는 `default` 테마를, _라이트 모드_에서는 `GitHub`
635+테마를 사용하는 방법입니다.
423
636
424```bash
637```bash
425alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
638alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
@@ -427,57 +640,89 @@ alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /de
427
640
428## 설정 파일
641## 설정 파일
429
642
430−`bat` 설정 파일로 커스터마이즈 할 수 있습니다. 파일의 위치는 운영 체제에 따라 다릅니다. 아래 커맨드를 통해 시스템의 기본 경로를 알 수 있습니다.
643+`bat`는 설정 파일로도 사용자화 할 수 있습니다.
644+설정 파일의 위치는 운영 체제에 따라 다릅니다.
645+아래 커맨드를 통해 시스템의 기본 경로를 확인할 수 있습니다.
431```
646```
432bat --config-file
647bat --config-file
433```
648```
434
649
435−또는, `BAT_CONFIG_PATH` 환경 변수를 사용하여 `bat`의 설정 파일 위치를 지정할 수 있습니다.
650+또는, `BAT_CONFIG_PATH` 환경 변수를 사용하여 `bat`가 설정 파일의 기본 경로
651+이외의 위치를 사용하도록 할 수 있습니다.
436```bash
652```bash
437export BAT_CONFIG_PATH="/path/to/bat.conf"
653export BAT_CONFIG_PATH="/path/to/bat.conf"
438```
654```
439
655
656+기본 설정 파일은 `--generate-config-file` 옵션으로 생성할 수 있습니다.
657+```bash
658+bat --generate-config-file
659+```
660+
440### 포맷
661### 포맷
441
662
442−설정 파일은 명령어 인수들의 리스트 입니다. `bat --help`를 이용하여 가능한 옵션들과 값들을 확인해 볼 수 있습니다. 또, `#` 으로 주석을 추가할수도 있습니다.
663+설정 파일은 단순히 커맨드 라인 인자들의 리스트입니다.
664+`bat --help`로 가능한 모든 옵션과 값들을 확인하세요.
665+추가적으로, 줄 앞에 `#` 문자를 추가해 주석을 넣을 수 있습니다.
443
666
444−설정 파일의 예:
667+설정 파일 예시:
445```bash
668```bash
446−# Set the theme to "TwoDark"
669+# "TwoDark" 테마 설정하기
447--theme="TwoDark"
670--theme="TwoDark"
448
671
449−# Show line numbers, Git modifications and file header (but no grid)
672+# 줄 번호, Git 변경 내용, 파일 헤더 보이기 (격자 없이)
450--style="numbers,changes,header"
673--style="numbers,changes,header"
451
674
452−# Use italic text on the terminal (not supported on all terminals)
675+# 터미널에서 이탤릭체 쓰기 (일부 터미널에서 미지원)
453--italic-text=always
676--italic-text=always
454
677
455−# Use C++ syntax for .ino files
678+# Arduino .ino 파일에 C++ 문법 쓰기
456--map-syntax "*.ino:C++"
679--map-syntax "*.ino:C++"
457−
458−# Use ".gitignore"-style highlighting for ".ignore" files
459−--map-syntax ".ignore:Git Ignore"
460```
680```
461
681
462−## Windows에서 사용하기
682+## Windows에서 `bat` 사용하기
683+
684+`bat`는 대부분의 경우 Windows에서 기본적으로 잘 작동하지만, 일부 기능은 추가적인
685+구성이 필요할 수 있습니다.
463
686
464−`bat` 대부분의 경우 Windows에서 기본적으로 잘 작동하지만, 일부 기능에는 추가 적인 구성이 필요할 수 있습니다.
687+#### 전제 조건
465
688
466−### 페이징
689+[Visual C++ 재배포 가능](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads)
690+패키지를 설치해야 합니다.
467
691
468−Windows는 `more` 형식의 매우 제한된 페이저만이 포함되어있습니다. `less`용 Windows 바이너리는 [이 홈페이지](http://www.greenwoodsoftware.com/less/download.html)나 [Chocolatey](https://chocolatey.org/packages/Less)에서 다운로드 받을 수 있습니다. 이를 사용하려면 바이너리를 `PATH` 디렉토리에 배치하거나 [환경 변수로 정의](#using-a-different-pager) 하세요. [Chocolatey 패키지](#on-windows)로 `less`를 자동으로 설치할 수 있습니다.
692+### 페이징
693+
694+Windows는 `more` 형식의 매우 제한된 페이저만 포함합니다.
695+Windows용 `less` 바이너리는
696+[공식 홈페이지](http://www.greenwoodsoftware.com/less/download.html)나
697+[Chocolatey](https://chocolatey.org/packages/Less)를 통해 다운로드 받을 수
698+있습니다.
699+이를 사용하려면 디렉터리 안의 바이너리를 `PATH`에 넣거나
700+[환경 변수로 정의](#using-a-different-pager)하세요.
701+[Chocolatey 패키지](#on-windows)는 `less`를 자동으로 설치합니다.
469
702
470### 색상
703### 색상
471
704
472−Windows 10은 기본 내장기능으로 [v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)) 이후의 `conhost.exe`(Command Prompt) 와 PowerShell, 그리고 최신 버전의 bash에서 색상을 지원합니다. 이전 버전의 Windows에서는, [ConEmu](https://conemu.github.io/)가 포함 된 [Cmder](http://cmder.net/)를 사용할 수 있습니다 .
705+Windows 10은
706+[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update))부터
707+기본적으로 `conhost.exe`(Command Prompt)와 PowerShell에서 색상을 지원하며,
708+최신 버전의 bash에서도 색상을 지원합니다.
709+이전 버전의 Windows에서는, [ConEmu](https://conemu.github.io/)가 포함된
710+[Cmder](http://cmder.net/)를 사용할 수 있습니다.
473
711
474−**참고:** `less`의 Git과 MSYS 버전은 Windows에서 색상을 올바르게 해석하지 않습니다. 다른 페이져가 설치되어 있지 않은 경우, `--paging=never` 하거나 `BAT_PAGER`를 빈 문자열로 설정하여 페이징을 완전히 비활성화 할 수 있습니다 .
712+**참고:** Git과 MSYS 버전의 `less`는 Windows에서 색상을 올바르게 해석하지
713+않습니다.
714+다른 페이저가 설치되어 있지 않은 경우, `--paging=never`을 넘겨주거나
715+`BAT_PAGER`을 빈 문자열로 설정하여 페이징을 완전히 비활성화 할 수 있습니다.
475
716
476### Cygwin
717### Cygwin
477
718
478−Windows에서의 `bat`은 기본적으로 Cygwin의 unix 스타일의 경로(`/cygdrive/*`)를 지원하지 않습니다. cygwin 절대경로를 인자로 받았을 때, `bat`은 다음과 같이 오류를 반환합니다. `:The system cannot find the path specified. (os error 3)`
719+Windows에서의 `bat`은 기본적으로 Cygwin의 unix 스타일 경로(`/cygdrive/*`)를
720+지원하지 않습니다.
721+Cygwin 절대 경로를 인자로 받았을 때, `bat`은 다음과 같은 오류를 반환합니다:
722+`The system cannot find the path specified. (os error 3)`
479
723
480−이 경우, wrapper를 만들거나 다음 함수를 `.bash_profile`추가하여 문제를 해결하실 수 있습니다 :
724+이는 wrapper를 만들거나 다음 함수를 `.bash_profile`에 추가하여 해결할 수
725+있습니다:
481
726
482```bash
727```bash
483bat() {
728bat() {
@@ -493,68 +738,98 @@ bat() {
493}
738}
494```
739```
495
740
496−## 트러블슈팅
741+## 문제 해결
497
742
498### 터미널과 색상
743### 터미널과 색상
499
744
500−`bat`은 터미널 트루컬러 지원 여부와 상관없이 동작합니다. 하지만, 문법 강조 테마의 색상이 8-bit 컬러에는 최적화 되어 있지 않고 있으며, 24-bit 트루컬러 지원하는 터미널 사용하는 것을 적극 권장합니다.(`terminator`, `konsole`, `iTerm2`, ...). [이 글](https://gist.github.com/XVilka/8346728)에서 24-bit 트루컬러 지원하는 터미널들을 찾아보실 수 있습니다.
745+`bat`은 터미널의 트루컬러 지원 여부와 상관 없이 동작합니다.
746+그러나 대부분 문법 강조 테마의 색상은 8비트 색상에 최적화되어 있지 않습니다.
747+따라서 24비트 트루컬러 지원이 되는 터미널(`terminator`, `konsole`, `iTerm2`,
748+...)을 사용하는 것을 적극 권장합니다.
749+트루컬러를 지원하는 터미널들과 더 자세한 정보는
750+[이 글](https://gist.github.com/XVilka/8346728)에서 찾아보실 수 있습니다.
501
751
502−사용하고 있는 터미널에서 `COLORTERM`을 `truecolor` 혹은
752+사용하고 있는 트루컬러 터미널에서 `COLORTERM` 변수를 `truecolor` 혹은
503−`24bit`으로 설정 되어있는지 확인하세요. 만약 아니라면, `bat`은 24-bit escape sequence를 지원되는지 여부를 판단 할 수 없습니다. (그리고 8-bit 색상으로 돌아갑니다.)
753+`24bit`로 설정되어 있는지 확인하세요.
754+그렇지 않을 경우, `bat`은 24비트 확장열(escape sequence)이 지원되는지 여부를
755+판단할 수 없습니다 (그리고 8비트 색상을 사용합니다).
504
756
505−### 라인 숫자와 눈금이 잘 보이지 않는 경우
757+### 줄 번호와 격자가 잘 보이지 않는 경우
506
758
507−다른 테마를 사용해 보세요. (`bat --list-themes`에서 테마들을 확인해 볼 수 있습니다.) `OneHalfDark` 과 `OneHalfLight` 테마는 눈금과 선의 색을 밝게 합니다.
759+다른 테마를 사용해 보세요 (`bat --list-themes`에서 목록을 볼 수 있습니다).
760+`OneHalfDark`와 `OneHalfLight` 테마는 더 밝은 눈금과 선의 색상을 사용합니다.
508
761
509### 파일 인코딩
762### 파일 인코딩
510
763
511−`bat`은 기본적으로 UTF-8과 UTF-8을 제공합니다. 다른 파일 인코딩의 경우, 자동 감지 되지 않으므로 UTF-8로 먼저 변환해 주어야 합니다. 이렇게 할 때, `iconv`를 사용 할 수 있습니다. 예를 들어, Latin-1 (ISO-8859-1)로 인코딩된 PHP파일이라면 다음과 같이 사용할 수 있습니다.:
764+`bat`은 기본적으로 UTF-8과 UTF-16을 지원합니다.
765+다른 모든 종류의 파일 인코딩에 대해서는, 일반적으로 인코딩을 자동으로 판별하는
766+방법이 없기 때문에 먼저 UTF-8으로 변환해야 할 수 있습니다.
767+이를 위해 `iconv`를 사용할 수 있습니다.
768+예시: Latin-1(ISO-8859-1)로 인코딩된 PHP 파일은 다음과 같이 처리할 수 있습니다:
512``` bash
769``` bash
513iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
770iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
514```
771```
515−참고: `bat`으로 자동 감지가 되지 않는 경우에는 `-l`/`--language` 옵션을 사용할 수도 있습니다.
772+참고: `bat`으로 문법 자동 감지가 되지 않는 경우에는 `-l`/`--language` 옵션을
773+사용할 수 있습니다.
516
774
517−## 배포
775+## 개발
518
776
519```bash
777```bash
520−# Recursive clone to retrieve all submodules
778+# 모든 서브모듈을 받기 위해 재귀적으로 복제하기
521git clone --recursive https://github.com/sharkdp/bat
779git clone --recursive https://github.com/sharkdp/bat
522
780
523−# Build (debug version)
781+# (디버그 버전) 빌드
524cd bat
782cd bat
525cargo build --bins
783cargo build --bins
526
784
527−# Run unit tests and integration tests
785+# 단위 테스트와 통합 테스트 실행
528cargo test
786cargo test
529
787
530−# Install (release version)
788+# (배포 버전) 설치
531cargo install --locked
789cargo install --locked
532
790
533−# Build a bat binary with modified syntaxes and themes
791+# 수정된 문법과 테마가 적용된 bat 바이너리 빌드
534bash assets/create.sh
792bash assets/create.sh
535cargo install --locked --force
793cargo install --locked --force
536```
794```
537
795
796+`bat`의 pretty-printing 기능을 라이브러리로 사용하는 애플리케이션을 만들고
797+싶다면, [API 문서](https://docs.rs/bat/)를 살펴보세요.
798+참고로 `bat`에 라이브러리로써 의존한다면, `regex-onig`나 `regex-fancy`를
799+기능으로 사용해야 합니다.
800+
801+## 기여하기
802+
803+[`CONTRIBUTING.md`](../CONTRIBUTING.md) 가이드를 살펴보세요.
804+
538## 메인테이너들
805## 메인테이너들
539
806
540- [sharkdp](https://github.com/sharkdp)
807- [sharkdp](https://github.com/sharkdp)
541- [eth-p](https://github.com/eth-p)
808- [eth-p](https://github.com/eth-p)
809+- [keith-hall](https://github.com/keith-hall)
810+- [Enselic](https://github.com/Enselic)
542
811
543−## 프로젝트 목표와 대안들
812+## 보안 취약점
544
813
545−`bat`은 아래와 같은 목표를 달성하려고 합니다:
814+만약 `bat`의 취약점을 발견하였다면, [David Peter](https://david-peter.de/)에게 메일로 연락주시기 바랍니다.
815+
816+## 프로젝트 목표와 대안들
546
817
547−- 아름답고 발전된 문법 강조 기능
818+`bat`은 다음과 같은 목표를 달성하려고 합니다:
548−- Git 연동을 통한 파일 수정 내역 확인
549−- (POSIX)`cat`의 대체제
550−- 사용자 친화적인 CLI 제공
551
819
820+- 아름답고 발전된 문법 강조 기능 제공
821+- Git과의 연동을 통한 파일 변경 내용 확인
822+- (POSIX) `cat`의 대체제
823+- 사용자 친화적인 커맨드 라인 인터페이스 제공
552
824
553−비슷한 프로그램들을 찾고 있다면, 많은 대안들이 있습니다. 비교는 [이 문서]((doc/alternatives.md))를 참조해주세요.
825+비슷한 프로그램들을 찾고 있다면 많은 대안들이 있습니다.
826+비교는 [이 문서](../doc/alternatives.md)를 참조해 주세요.
554
827
555## 라이센스
828## 라이센스
556−Copyright (c) 2018-2020 [bat-developers](https://github.com/sharkdp/bat).
829+Copyright (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat).
557
830
558−`bat`는 MIT 라이센스 및 Apache 라이센스 2.0의 조건에 따라 배포됩니다.
831+`bat`는 여러분의 선택에 따라 MIT 라이센스 또는 Apache 라이센스 2.0의 조건에 따라
832+배포됩니다.
559
833
560−라이센스 세부사항은 [LICENSE-APACHE](LICENSE-APACHE)와 [LICENSE-MIT](LICENSE-MIT)를 참조하세요.
834+라이센스의 세부사항은 [LICENSE-APACHE](../LICENSE-APACHE)와
835+[LICENSE-MIT](../LICENSE-MIT)를 참조하세요.
doc/README-ru.mdnew file+597
@@ -0,0 +1,597 @@
1+<p align="center">
2+ <img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
3+ <a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
4+ <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
5+ <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
6+ Клон утилиты <i>cat(1)</i> с поддержкой выделения синтаксиса и Git
7+</p>
8+
9+<p align="center">
10+ <a href="#выделение-синтаксиса">Ключевые возможности</a> •
11+ <a href="#как-использовать">Использование</a> •
12+ <a href="#установка">Установка</a> •
13+ <a href="#кастомизация">Кастомизация</a> •
14+ <a href="#цели-и-альтернативы">Цели и альтернативы </a><br>
15+ [<a href="../README.md">English]
16+ [<a href="README-zh.md">中文</a>]
17+ [<a href="README-ja.md">日本語</a>]
18+ [<a href="README-ko.md">한국어</a>]
19+ [Русский]
20+</p>
21+
22+### Выделение синтаксиса
23+
24+`bat` поддерживает выделение синтаксиса для огромного количества языков программирования и разметки:
25+
26+![Пример выделения синтаксиса](https://i.imgur.com/3FGy5tW.png)
27+
28+### Интеграция с Git
29+`bat` использует `git`, чтобы показать изменения в коде
30+(смотрите на левый сайдбар):
31+
32+![Пример интеграции с Git](https://i.imgur.com/azUAzdx.png)
33+
34+### Показать непечатаемые символы
35+
36+Вы можете использовать `-A` / `--show-all` флаг, чтобы показать символы, которые невозможно напечатать:
37+
38+![Строка с неотображемыми символами](https://i.imgur.com/X0orYY9.png)
39+
40+### Автоматическое разделение текста
41+
42+`bat` умеет перенаправлять вывод в `less`, если вывод не помещается на экране полностью.
43+
44+### Объединение файлов
45+
46+О... Вы также можете объединять файлы :wink:. Когда
47+`bat` обнаружит неинтерактивный терминал (например, когда вы перенаправляете вывод в файл или процесс), он будет работать как утилита `cat` и выведет содержимое файлов как обычный текст (без подсветки синтаксиса).
48+
49+## Как использовать
50+
51+Вывести единственный файл в терминале
52+
53+```bash
54+> bat README.md
55+```
56+
57+Отобразить сразу несколько файлов в терминале
58+
59+```bash
60+> bat src/*.rs
61+```
62+
63+Читаем из stdin и определяем синтаксис автоматически (внимание: это делается по заглавной строке файла, например, `#!/bin/sh`)
64+
65+```bash
66+> curl -s https://sh.rustup.rs | bat
67+```
68+
69+Прочитать из stdin с явным указанием языка
70+
71+```bash
72+> yaml2json .travis.yml | json_pp | bat -l json
73+```
74+
75+Вывести и выделить неотображаемые символы
76+```bash
77+> bat -A /etc/hosts
78+```
79+
80+Использование в качестве замены `cat`
81+
82+```bash
83+bat > note.md # мгновенно создаем новый файл
84+
85+bat header.md content.md footer.md > document.md
86+
87+bat -n main.rs # показываем только количество строк
88+
89+bat f - g # выводит 'f' в stdin, а потом 'g'.
90+```
91+
92+### Интеграция с другими утилитами
93+
94+#### `find` или `fd`
95+
96+Вы можете использовать флаг `-exec` в `find`, чтобы посмотреть превью всех файлов в `bat`
97+```bash
98+find … -exec bat {} +
99+```
100+
101+Если вы используете [`fd`](https://github.com/sharkdp/fd), применяйте для этого флаг `-X`/`--exec-batch`:
102+```bash
103+fd … -X bat
104+```
105+
106+#### `ripgrep`
107+
108+С помощью [`batgrep`](https://github.com/eth-p/bat-extras/blob/master/doc/batgrep.md), `bat` может быть использован для вывода результата запроса [`ripgrep`](https://github.com/BurntSushi/ripgrep)
109+
110+```bash
111+batgrep needle src/
112+```
113+
114+#### `tail -f`
115+
116+`bat` может быть использован вместе с `tail -f`, чтобы выводить содержимое файла с подсветкой синтаксиса в реальном времени.
117+```bash
118+tail -f /var/log/pacman.log | bat --paging=never -l log
119+```
120+Заметьте, что мы должны отключить пэйджинг, чтобы это заработало. Мы также явно указали синтаксис (`-l log`), так как он не может быть автоматически определен в данном случае.
121+
122+#### `git`
123+
124+Вы можете использовать `bat` с `git show`, чтобы просмотреть старую версию файла с выделением синтаксиса:
125+```bash
126+git show v0.6.0:src/main.rs | bat -l rs
127+```
128+
129+Обратите внимание, что выделение синтаксиса не работает в `git diff` на данный момент. Если вам это нужно, посмотрите [`delta`](https://github.com/dandavison/delta).
130+
131+#### `xclip`
132+
133+Нумерация стро и отображение изменений затрудняет копирование содержимого файлов в буфер обмена.
134+Чтобы спроваиться с этим, используйте флаг `-p`/`--plain` или просто перенаправьте стандартный вывод в `xclip`:
135+```bash
136+bat main.cpp | xclip
137+```
138+`bat` обнаружит перенаправление вывода и выведет обычный текст без выделения синтаксиса.
139+
140+#### `man`
141+
142+`bat` может быть использован в виде выделения цвета для `man`, для этого установите переменную окружения
143+`MANPAGER`:
144+
145+```bash
146+export MANPAGER="sh -c 'col -bx | bat -l man -p'"
147+man 2 select
148+```
149+
150+Возможно вам понадобится также установить `MANROFFOPT="-c"`, если у вас есть проблемы с форматированием.
151+
152+Если вы хотите сделать этой одной командой, вы можете использовать [`batman`](https://github.com/eth-p/bat-extras/blob/master/doc/batman.md).
153+
154+Обратите внимание, что [синтаксис manpage](assets/syntaxes/02_Extra/Manpage.sublime-syntax) разрабатывается в этом репозитории и все еще находится в разработке.
155+
156+#### `prettier` / `shfmt` / `rustfmt`
157+
158+[`Prettybat`](https://github.com/eth-p/bat-extras/blob/master/doc/prettybat.md) — скрипт, который форматирует код и выводит его с помощью `bat`.
159+
160+
161+## Установка
162+
163+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
164+
165+### Ubuntu (с помощью `apt`)
166+*... и другие дистрибутивы основанные на Debian.*
167+
168+`bat` есть в репозиториях [Ubuntu](https://packages.ubuntu.com/eoan/bat) и
169+[Debian](https://packages.debian.org/sid/bat) и доступен начиная с Ubuntu Eoan 19.10. На Debian `bat` пока что доступен только с нестабильной веткой "Sid".
170+
171+Если ваша версия Ubuntu/Debian достаточно новая, вы можете установить `bat` так:
172+
173+```bash
174+apt install bat
175+```
176+
177+Если вы установили `bat` таким образом, то бинарный файл может быть установлен как `batcat` вместо `bat` (из-за [конфликта имени с другим пакетом](https://github.com/sharkdp/bat/issues/982)). Вы можете сделать симлинк или алиас `bat -> batcat`, чтобы предотвратить подобные проблемы и в других дистрибутивах.
178+
179+``` bash
180+mkdir -p ~/.local/bin
181+ln -s /usr/bin/batcat ~/.local/bin/bat
182+```
183+
184+### Ubuntu (С помощью самого нового `.deb` пакета)
185+*... и другие дистрибутивы Linux основанные на Debian*
186+
187+Если пакет еще недоступен в вашем Ubuntu/Debian дистрибутиве или вы хотите установить самую последнюю версию `bat`, то вы можете скачать самый последний `deb`-пакет отсюда:
188+[release page](https://github.com/sharkdp/bat/releases) и установить так:
189+
190+```bash
191+sudo dpkg -i bat_0.18.3_amd64.deb # измените архитектуру и версию
192+```
193+
194+### Alpine Linux
195+
196+Вы можете установить [`bat`](https://pkgs.alpinelinux.org/packages?name=bat) из официальных источников:
197+
198+```bash
199+apk add bat
200+```
201+
202+### Arch Linux
203+
204+Вы можете установить [`bat`](https://www.archlinux.org/packages/community/x86_64/bat/) из официального источника:
205+
206+```bash
207+pacman -S bat
208+```
209+
210+### Fedora
211+
212+Вы можете установить [`bat`](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506) из официального репозитория [Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/).
213+
214+```bash
215+dnf install bat
216+```
217+
218+### Gentoo Linux
219+
220+Вы можете установить [`bat`](https://packages.gentoo.org/packages/sys-apps/bat) из официальных источников:
221+
222+```bash
223+emerge sys-apps/bat
224+```
225+
226+### Void Linux
227+
228+Вы можете установить `bat` с помощью `xbps-install`:
229+```bash
230+xbps-install -S bat
231+```
232+
233+### FreeBSD
234+
235+Вы можете установить [`bat`](https://www.freshports.org/textproc/bat) с помощью `pkg`:
236+
237+```bash
238+pkg install bat
239+```
240+
241+или самому скомпилировать его:
242+
243+```bash
244+cd /usr/ports/textproc/bat
245+make install
246+```
247+
248+### С помощью nix
249+
250+Вы можете установить `bat`, используя [nix package manager](https://nixos.org/nix):
251+
252+```bash
253+nix-env -i bat
254+```
255+
256+### openSUSE
257+
258+Вы можете установить `bat` с помощью `zypper`:
259+
260+```bash
261+zypper install bat
262+```
263+
264+### macOS
265+
266+Вы можете установить `bat` с помощью [Homebrew](http://braumeister.org/formula/bat):
267+
268+```bash
269+brew install bat
270+```
271+
272+Или же установить его с помощью [MacPorts](https://ports.macports.org/port/bat/summary):
273+
274+```bash
275+port install bat
276+```
277+
278+### Windows
279+
280+Есть несколько способов установить `bat`. Как только вы установили его, посмотрите на секцию ["Использование `bat` в Windows"](#using-bat-on-windows).
281+
282+#### С помощью Chocolatey
283+
284+Вы можете установить `bat` с помощью [Chocolatey](https://chocolatey.org/packages/Bat):
285+```bash
286+choco install bat
287+```
288+
289+#### С помощью Scoop
290+
291+Вы можете установить `bat` с помощью [scoop](https://scoop.sh/):
292+```bash
293+scoop install bat
294+```
295+
296+Для этого у вас должен быть установлен [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads).
297+
298+#### Из заранее скомпилированных файлов:
299+
300+Их вы можете скачать на [странице релизов](https://github.com/sharkdp/bat/releases).
301+
302+Для этого у вас должен быть установлен [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads).
303+
304+### С помощью Docker
305+
306+Вы можете использовать [Docker image](https://hub.docker.com/r/danlynn/bat/), чтобы запустить `bat` в контейнере:
307+```bash
308+docker pull danlynn/bat
309+alias bat='docker run -it --rm -e BAT_THEME -e BAT_STYLE -e BAT_TABS -v "$(pwd):/myapp" danlynn/bat'
310+```
311+
312+### С помощью Ansible
313+
314+Вы можете установить `bat` с [Ansible](https://www.ansible.com/):
315+
316+```bash
317+# Устанавливаем роль на устройстве
318+ansible-galaxy install aeimer.install_bat
319+```
320+
321+```yaml
322+---
323+# Playbook для установки bat
324+- host: all
325+ roles:
326+ - aeimer.install_bat
327+```
328+
329+- [Ansible Galaxy](https://galaxy.ansible.com/aeimer/install_bat)
330+- [GitHub](https://github.com/aeimer/ansible-install-bat)
331+
332+Этот способ должен сработать со следующими дистрибутивами:
333+- Debian/Ubuntu
334+- ARM (например Raspberry PI)
335+- Arch Linux
336+- Void Linux
337+- FreeBSD
338+- macOS
339+
340+### Из скомпилированных файлов
341+
342+Перейдите на [страницу релизов](https://github.com/sharkdp/bat/releases) для
343+скомпилированных файлов `bat` для различных платформ. Бинарные файлы со статической связкой так же доступны: выбирайте архив с `musl` в имени.
344+
345+### Из исходников
346+
347+Если вы желаете установить `bat` из исходников, вам понадобится Rust 1.51 или выше. После этого используйте `cargo`, чтобы все скомпилировать:
348+
349+```bash
350+cargo install --locked bat
351+```
352+
353+## Кастомизация
354+
355+### Темы для выделения текста
356+
357+Используйте `bat --list-themes`, чтобы вывести список всех доступных тем. Для выбора темы `TwoDark` используйте `bat` с флагом
358+`--theme=TwoDark` или выставьте переменную окружения `BAT_THEME` в `TwoDark`. Используйте `export BAT_THEME="TwoDark"` в конфигурационном файле вашей оболочки, чтобы изменить ее навсегда. Или же используйте [конфигурационный файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
359+
360+Если вы хотите просто просмотреть темы, используйте следующую команду (для этого вам понадобится [`fzf`](https://github.com/junegunn/fzf)):
361+```bash
362+bat --list-themes | fzf --preview="bat --theme={} --color=always /путь/к/файлу"
363+```
364+
365+`bat` отлично смотрится на темном фоне. Однако если ваш терминал использует светлую тему, то такие темы как `GitHub` или `OneHalfLight` будут смотреться куда лучше!
366+Вы также можете использовать новую тему, для этого перейдите [в раздел добавления тем](https://github.com/sharkdp/bat#добавление-новых-тем).
367+
368+### Изменение внешнего вывода
369+
370+Вы можете использовать флаг `--style`, чтобы изменять внешний вид вывода в `bat`.
371+Например, вы можете использовать `--style=numbers,changes`, чтобы показать только количество строк и изменений в Git. Установите переменную окружения `BAT_STYLE` чтобы изменить это навсегда, или используйте [конфиг файл](https://github.com/sharkdp/bat#configuration-file) `bat`.
372+
373+### Добавление новых синтаксисов
374+
375+`bat` использует [`syntect`](https://github.com/trishume/syntect/) для выделения синтаксиса. `syntect` может читать
376+[файл `.sublime-syntax`](https://www.sublimetext.com/docs/3/syntax.html)
377+и темы. Чтобы добавить новый синтаксис, сделайте следующее:
378+
379+Создайте каталог с синтаксисом:
380+
381+```bash
382+mkdir -p "$(bat --config-dir)/syntaxes"
383+cd "$(bat --config-dir)/syntaxes"
384+
385+# Разместите файлы '.sublime-syntax'
386+# в каталоге (или субкаталогах), например:
387+git clone https://github.com/tellnobody1/sublime-purescript-syntax
388+```
389+
390+Теперь используйте следующую команду, чтобы превратить эти файлы в бинарный кеш:
391+
392+```bash
393+bat cache --build
394+```
395+
396+Теперь вы можете использовать `bat --list-languages`, чтобы проверить, доступны ли новые языки.
397+
398+Если когда-нибудь вы заходите вернуться к настройкам по умолчанию, введите
399+
400+```bash
401+bat cache --clear
402+```
403+
404+### Добавление новых тем
405+
406+Это работает похожим образом, так же как и добавление новых тем выделения синтаксиса
407+
408+Во-первых, создайте каталог с новыми темами для синтаксиса:
409+```bash
410+mkdir -p "$(bat --config-dir)/themes"
411+cd "$(bat --config-dir)/themes"
412+
413+# Загрузите тему в формате '.tmTheme':
414+git clone https://github.com/greggb/sublime-snazzy
415+
416+# Обновите кеш
417+bat cache --build
418+```
419+
420+Теперь используйте `bat --list-themes`, чтобы проверить доступность новых тем.
421+
422+### Использование другого пейджера.
423+
424+`bat` использует пейджер, указанный в переменной окружения `PAGER`. Если она не задана, то используется `less`.
425+Если вы желаете использовать другой пейджер, вы можете либо изменить переменную `PAGER`, либо `BAT_PAGER` чтобы перезаписать то, что указано в `PAGER`.
426+
427+Чтобы передать дополнительные аргументы вашему пейджеру, перечислите их в этой переменной:
428+
429+```bash
430+export BAT_PAGER="less -RF"
431+```
432+
433+Так же вы можете использовать [файл конфигурации](https://github.com/sharkdp/bat#configuration-file) `bat` (флаг `--pager`).
434+
435+**Внимание**: По умолчанию пейджером является`less` (без каких-либо аргументов),
436+`bat` задаст следующие флаги для пейджера:
437+ `-R`/`--RAW-CONTROL-CHARS`,
438+`-F`/`--quit-if-one-screen` и `-X`/`--no-init`. Последний флаг(`-X`) используется только для `less`, чья версия раньше 530.
439+
440+Флаг `-R` нужен чтобы корректно воспроизвести ANSI цвета. Второй флаг (`-F`) говорит
441+`less` чтобы тот сразу же завершился, если размер вывода меньше чем вертикальный размер терминала.
442+Это удобно для небольших файлов, так как вам не надо каждый раз нажимать `q`, чтобы выйти из пейджера. Третий флаг (`-X`) нужен для того, чтобы исправить баг с `--quit-if-one-screen` в старых версиях `less`. К сожалению, это блокирует возможность использования колеса мышки.
443+
444+Если вы хотите все же его включить, вы можете добавить флаг `-R`.
445+Для `less` новее чем 530 оно должно работать из коробки.
446+
447+### Темная тема
448+
449+Если вы используете темный режим в macOS, возможно вы захотите чтобы `bat` использовал другую тему, основанную на теме вашей ОС. Следующий сниппет использует тему `default`, когда у вас включен темный режим, и тему `GitHub`, когда включен светлый.
450+
451+```bash
452+alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
453+```
454+
455+## Файл конфигурации
456+
457+`bat` также может быть кастомизирован с помощью файла конфигурации. Его местоположение зависит от вашей ОС: чтобы посмотреть его путь, введите
458+```
459+bat --config-file
460+```
461+
462+Также вы можете установить переменную окружения `BAT_CONFIG_PATH`, чтобы изменить путь к файлу конфигурации.
463+```bash
464+export BAT_CONFIG_PATH="/path/to/bat.conf"
465+```
466+
467+Файл конфигурации «по умолчанию» может быть создан с помощью флага `--generate-config-file`.
468+```bash
469+bat --generate-config-file
470+```
471+
472+### Формат
473+
474+Файл конфигурации - это всего лишь набор аргументов. Введите `bat --help`, чтобы просмотреть список всех возможных флагов и аргументов. Также вы можете закомментировать строку с помощью `#`.
475+
476+Пример файла конфигурации:
477+```bash
478+# Установить тему "TwoDark"
479+--theme="TwoDark"
480+
481+# Показывать количество строк, изменений в Git и заголовок файла
482+--style="numbers,changes,header"
483+
484+# Использовать курсив (поддерживается не всеми терминалами)
485+--italic-text=always
486+
487+# Использовать синтаксис C++ для всех Arduino .ino файлов
488+--map-syntax "*.ino:C++"
489+
490+# Использовать синтаксик Git Ignore для всех файлов .ignore
491+--map-syntax ".ignore:Git Ignore"
492+```
493+
494+## Использование `bat` в Windows
495+
496+`bat` полностью работоспособен "из коробки", но для некоторых возможностей могут понадобиться дополнительные настройки.
497+
498+### Пейджинг
499+
500+Windows поддерживает только очень простой пейджер `more`. Вы можете скачать установщик для `less` [с его сайта](http://www.greenwoodsoftware.com/less/download.html) или [через Chocolatey](https://chocolatey.org/packages/Less). Чтобы его использовать, скопируйте исполняемый файл в ваш `PATH` или [используйте переменную окружения](#Использование-другого-пейджера). [Пакет из Chocolatey](#windows) установит все автоматически.
501+
502+### Цвета
503+
504+Windows 10 поддерживает цвета и в `conhost.exe` (Command Prompt), и в PowerShell начиная с версии Windows
505+[v1511](https://ru.wikipedia.org/wiki/Windows_10#Обновления и поддержка), так же как и в bash. На ранних версиях Windows вы можете использовать
506+[Cmder](http://cmder.net/), в котором есть [ConEmu](https://conemu.github.io/).
507+
508+**Внимание:** Версия `less` в Git и MSYS2 воспроизводит цвета некорректно. Если у вас нет других пейджеров, мы можете отключить использование пейджеров с помощью флага `--paging=never`
509+или установить `BAT_PAGER` равным пустой строке.
510+
511+### Cygwin
512+
513+Из коробки `bat` не поддерживает пути в стиле Unix (`/cygdrive/*`). Когда указан абсолютный путь cygwin, `bat` выдаст следующую ошибку: `The system cannot find the path specified. (os error 3)`
514+
515+Она может быть решена добавлением следующей функции в `.bash_profile`:
516+
517+```bash
518+bat() {
519+ local index
520+ local args=("$@")
521+ for index in $(seq 0 ${#args[@]}) ; do
522+ case "${args[index]}" in
523+ -*) continue;;
524+ *) [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
525+ esac
526+ done
527+ command bat "${args[@]}"
528+}
529+```
530+
531+## Проблемы и их решение
532+
533+### Терминалы и цвета
534+
535+`bat` поддерживает терминалы *с* и *без* поддержки truecolor. Однако подсветка синтаксиса не оптимизирована для терминалов с 8-битными цветами, и рекомендуется использовать терминалы с поддержкой 24-битных цветов (`terminator`, `konsole`, `iTerm2`, ...).
536+Смотрите [эту статью](https://gist.github.com/XVilka/8346728) для полного списка терминалов.
537+
538+Удостовертесь, что переменная `COLORTERM` равна `truecolor` или
539+`24bit`. Иначе `bat` не сможет определить поддержку 24-битных цветов (и будет использовать 8-битные).
540+
541+### Текст и номера строк плохо видны
542+
543+Используйте другую тему (`bat --list-themes` выведет список всех установленных тем). Темы `OneHalfDark` и
544+`OneHalfLight` имеют более яркие номера строк и тексты.
545+
546+### Кодировки файлов
547+
548+`bat` поддерживает UTF-8 и UTF-16. Файлы в других кодировках, возможно, придётся перекодировать, так как кодировка может быть распознана неверно. Используйте `iconv`.
549+Пример: у вас есть PHP файл в кодировке Latin-1 (ISO-8859-1):
550+``` bash
551+iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
552+```
553+Внимание: вам может понадобится флаг `-l`/`--language`, если `bat` не сможет автоматически определить синтаксис.
554+
555+## Разработка
556+
557+```bash
558+# Рекурсивно клонирует все модули
559+git clone --recursive https://github.com/sharkdp/bat
560+
561+# Компиляции в режиме разработки
562+cd bat
563+cargo build --bins
564+
565+# Запуск тестов
566+cargo test
567+
568+# Установка (релизная версия)
569+cargo install --locked
570+
571+# Компилирование исполняего файла bat с другим синтаксисом и темами
572+bash assets/create.sh
573+cargo install --locked --force
574+```
575+
576+## Разработчики
577+
578+- [sharkdp](https://github.com/sharkdp)
579+- [eth-p](https://github.com/eth-p)
580+
581+## Цели и альтернативы
582+
583+Цели проекта `bat`:
584+
585+- Красивая и продвинутая подсветка синтаксиса.
586+- Интеграция с Git.
587+- Полноценная замена `cat`.
588+- Дружелюбный интерфейс и аргументы.
589+
590+Есть очень много альтернатив `bat`. Смотрите [этот документ](doc/alternatives.md) для сравнения.
591+
592+## Лицензия
593+Copyright (c) 2018-2021 [Разработчики bat](https://github.com/sharkdp/bat).
594+
595+`bat` распостраняется под лицензями MIT License и Apache License 2.0 (на выбор пользователя).
596+
597+Смотрите [LICENSE-APACHE](LICENSE-APACHE) и [LICENSE-MIT](LICENSE-MIT) для более подробного ознакомления.
doc/README-zh.mdnew file+678
@@ -0,0 +1,678 @@
1+<p align="center">
2+ <img src="logo-header.svg" alt="bat - a cat clone with wings"><br>
3+ <a href="https://github.com/sharkdp/bat/actions?query=workflow%3ACICD"><img src="https://github.com/sharkdp/bat/workflows/CICD/badge.svg" alt="Build Status"></a>
4+ <img src="https://img.shields.io/crates/l/bat.svg" alt="license">
5+ <a href="https://crates.io/crates/bat"><img src="https://img.shields.io/crates/v/bat.svg?colorB=319e8c" alt="Version info"></a><br>
6+ 类似 <i>cat(1)</i>,但带有 git 集成和语法高亮.
7+</p>
8+
9+<p align="center">
10+ <a href="#语法高亮">主要功能</a> •
11+ <a href="#如何使用">使用方法</a> •
12+ <a href="#安装">安装</a> •
13+ <a href="#自定义">自定义</a> •
14+ <a href="#project-goals-and-alternatives">项目目标和替代方案</a><br>
15+ [<a href="../README.md">English</a>]
16+ [中文]
17+ [<a href="README-ja.md">日本語</a>]
18+ [<a href="README-ko.md">한국어</a>]
19+ [<a href="README-ru.md">Русский</a>]
20+</p>
21+
22+### 语法高亮
23+
24+`bat` 对大部分编程语言和标记语言提供语法高亮:
25+
26+![Syntax highlighting example](https://imgur.com/rGsdnDe.png)
27+
28+### Git 集成
29+
30+`bat` 能从 git 中获取文件的修改并展示在边栏(见下图):
31+
32+![Git integration example](https://i.imgur.com/2lSW4RE.png)
33+
34+### 不可打印(non-printable)字符可视化
35+
36+添加`-A`/`--show-all`参数可以文件文件中的不可打印字符:
37+
38+![Non-printable character example](https://i.imgur.com/WndGp9H.png)
39+
40+### 自动分页
41+
42+`bat`会在一般情况下将大于屏幕可显示范围的内容输出到分页器(pager, e.g. `less`)。
43+
44+你可以在调用时添加`--paging=never`参数来使`bat`不使用分页器(就像`cat`一样)。如果你想要用为`cat`使用`bat`别名,可以在 shell 配置文件(shell configuration)中添加`alias cat='bat --paging=never'`。
45+
46+#### 智能输出
47+
48+`bat`能够在设置了分页器选项的同时进行管道:wink:。
49+当`bat`检测到当前环境为非可交互终端或管道时(例如使用`bat`并将内容用管道输出到文件),`bat`会像`cat`一样,一次输出文件内容为纯文本且无视`--paging`参数。
50+
51+## 如何使用
52+
53+在终端中查看一个文件
54+
55+```bash
56+> bat README.md
57+```
58+
59+一次性展示多个文件
60+
61+```bash
62+> bat src/*.rs
63+```
64+
65+从`stdin`读入流,自动为内容添加语法高亮(前提是输入内容的语言可以被正确识别,通常根据内容第一行的 shebang 标记,形如`#!bin/sh`)
66+
67+```bash
68+> curl -s https://sh.rustup.rs | bat
69+```
70+
71+显式指定`stdin`输入的语言
72+
73+```bash
74+> yaml2json .travis.yml | json_pp | bat -l json
75+```
76+
77+显示不可打印字符
78+
79+```bash
80+> bat -A /etc/hosts
81+```
82+
83+与`cat`的兼容性
84+
85+```bash
86+bat > note.md # 创建一个空文件
87+
88+bat header.md content.md footer.md > document.md
89+
90+bat -n main.rs # 只显示行号
91+
92+bat f - g # 输出 f,接着是标准输入流,最后 g
93+```
94+
95+### 第三方工具交互
96+
97+#### `fzf`
98+
99+你可以使用`bat`作为`fzf`的预览器。这需要在`bat`后添加`--color=always`选项,以及`--line-range` 选项来限制大文件的加载次数。
100+
101+```bash
102+fzf --preview 'bat --color=always --style=numbers --line-range=:500 {}'
103+```
104+
105+更多信息请参阅[`fzf`的说明](https://github.com/junegunn/fzf#preview-window)。
106+
107+#### `find` 或 `fd`
108+
109+你可以使用`find`的`-exec`选项来用`bat`预览搜索结果:
110+
111+```bash
112+find … -exec bat {} +
113+```
114+
115+亦或者在用`fd`时添加`-X`/`--exec-batch`选项:
116+
117+```bash
118+fd … -X bat
119+```
120+
121+#### `ripgrep`
122+
123+`bat`也能用`batgrep`来显示`ripgrep`的搜索结果。
124+
125+```bash
126+batgrep needle src/
127+```
128+
129+#### `tail -f`
130+
131+当与`tail -f`一起使用,`bat`可以持续监视文件内容并为其添加语法高亮。
132+
133+```bash
134+tail -f /var/log/pacman.log | bat --paging=never -l log
135+```
136+
137+注意:这项功能需要在关闭分页时使用,同时要手动指定输入的内容语法(通过`-l log`)。
138+
139+#### `git`
140+
141+`bat`也能直接接受来自`git show`的输出并为其添加语法高亮(当然也需要手动指定语法):
142+
143+```bash
144+git show v0.6.0:src/main.rs | bat -l rs
145+```
146+
147+#### `git diff`
148+
149+`bat`也可以和`git diff`一起使用:
150+
151+```bash
152+batdiff() {
153+ git diff --name-only --diff-filter=d | xargs bat --diff
154+}
155+```
156+
157+该功能也作为一个独立工具提供,你可以在[`bat-extras`](https://github.com/eth-p/bat-extras)中找到`batdiff`。
158+
159+如果你想了解更多 git 和 diff 的信息,参阅[`delta`](https://github.com/dandavison/delta)。
160+
161+#### `xclip`
162+
163+当需要拷贝文件内容时,行号以及 git 标记会影响输出,此时可以使用`-p`/`--plain`参数来把纯文本传递给`xclip`。
164+
165+```bash
166+bat main.cpp | xclip
167+```
168+
169+`bat`会检测输出是否是管道重定向来决定是否使用纯文本输出。
170+
171+#### `man`
172+
173+`bat`也能给`man`的输出上色。这需要设置`MANPAGER`环境变量:
174+
175+```bash
176+export MANPAGER="sh -c 'col -bx | bat -l man -p'"
177+man 2 select
178+```
179+
180+(如果你使用的是 Debian 或者 Ubuntu,使用`batcat`替换`bat`)
181+
182+如果你遇到格式化问题,设置`MANROFFOPT="-c"`也许会有帮助。
183+
184+`batman`能提供类似功能——作为一个独立的命令。
185+
186+注意:[man page 语法](assets/syntaxes/02_Extra/Manpage.sublime-syntax) 还需要完善。在使用特定的`man`实现时该功能[无法正常工作](https://github.com/sharkdp/bat/issues/1145)。
187+
188+#### `prettier` / `shfmt` / `rustfmt`
189+
190+`prettybat`脚本能够格式化代码并用`bat`输出。
191+
192+## 安装
193+
194+[![Packaging status](https://repology.org/badge/vertical-allrepos/bat-cat.svg)](https://repology.org/project/bat-cat/versions)
195+
196+### Ubuntu (使用 `apt`)
197+
198+*... 以及其他基于 Debian的发行版.*
199+
200+`bat` 要求的版本: [Ubuntu 高于 20.04 ("Focal")](https://packages.ubuntu.com/search?keywords=bat&exact=1) 和 [Debian 高于 August 2021 (Debian 11 - "Bullseye")](https://packages.debian.org/bullseye/bat).
201+
202+当你的发行版满足条件那么直接在终端运执行:
203+
204+```bash
205+sudo apt install bat
206+```
207+
208+重要:如果你通过这种方法安装`bat`,请留意你所安装的可执行文件是否为`batcat`(由[其他包的可执行文件名冲突](https://github.com/sharkdp/bat/issues/982)造成)。你可以创建一个`bat -> batcat`的符号链接(symlink)或别名来避免因为可执行文件不同带来的问题并与其他发行版保持一致性。
209+
210+```bash
211+mkdir -p ~/.local/bin
212+ln -s /usr/bin/batcat ~/.local/bin/bat
213+```
214+
215+### Ubuntu (使用`.deb`包)
216+
217+*... 以及其他基于 Debian的发行版.*
218+
219+如果你无法使用上一种方法安装,或需要用最新版的`bat`,你可以从[release 页面](https://github.com/sharkdp/bat/releases)下载最新的`.deb`包并通过下述方法安装:
220+
221+```bash
222+sudo dpkg -i bat_0.18.3_amd64.deb # adapt version number and architecture
223+```
224+
225+### Alpine Linux
226+
227+你可以用下面下列命令从官方源中安装[`bat 包`](https://pkgs.alpinelinux.org/packages?name=bat):
228+
229+```bash
230+apk add bat
231+```
232+
233+### Arch Linux
234+
235+你可以用下面下列命令从官方源中安装[`bat`包](https://www.archlinux.org/packages/community/x86_64/bat/):
236+
237+```bash
238+pacman -S bat
239+```
240+
241+### Fedora
242+
243+你可以使用下列命令从官方[Fedora Modular](https://docs.fedoraproject.org/en-US/modularity/using-modules/)仓库安装[`bat` 包](https://koji.fedoraproject.org/koji/packageinfo?packageID=27506):
244+
245+```bash
246+dnf install bat
247+```
248+
249+### Funtoo Linux
250+
251+你可以从 dev-kit 中安装[`bat` 包](https://github.com/funtoo/dev-kit/tree/1.4-release/sys-apps/bat):
252+
253+```bash
254+emerge sys-apps/bat
255+```
256+
257+### Gentoo Linux
258+
259+你可以使用下列命令从官方源中安装 [`bat` 包](https://packages.gentoo.org/packages/sys-apps/bat):
260+
261+
262+```bash
263+emerge sys-apps/bat
264+```
265+
266+### Void Linux
267+
268+你可以用 xbps-install 安装`bat`:
269+
270+```bash
271+xbps-install -S bat
272+```
273+
274+### Termux:
275+
276+你可以用 pkg 安装`bat:
277+
278+```bash
279+pkg install bat
280+```
281+
282+### FreeBSD
283+
284+你可以用 pkg 来安装一份预编译的[`bat` 包](https://www.freshports.org/textproc/bat):
285+
286+```bash
287+pkg install bat
288+```
289+
290+或从 FreeBSD ports 自己编译一份:
291+
292+```bash
293+cd /usr/ports/textproc/bat
294+make install
295+```
296+
297+### OpenBSD
298+
299+你可以用`pkg——add`安装`bat`包
300+
301+```bash
302+pkg_add bat
303+```
304+
305+### 通过 nix
306+
307+你可以用[nix 包管理器](https://nixos.org/nix)安装`bat`:
308+
309+```bash
310+nix-env -i bat
311+```
312+
313+### openSUSE
314+
315+你可以用 zypper 安装`bat`:
316+
317+```bash
318+zypper install bat
319+```
320+
321+### 通过 snap
322+
323+目前还没有推荐的 snap 包可用。可以使用其他现存的包但不会受到官方支持且可能会遇到[问题](https://github.com/sharkdp/bat/issues/1519)。
324+
325+### macOS (或 Linux) 通过 Homebrew
326+
327+你可以用 [Homebrew on MacOS](https://formulae.brew.sh/formula/bat) 或者 [Homebrew on Linux](https://formulae.brew.sh/formula-linux/bat) 安装`bat`:
328+
329+```bash
330+brew install bat
331+```
332+
333+### macOS 通过 MacPorts
334+
335+或用 [MacPorts](https://ports.macports.org/port/bat/summary) 安装`bat`:
336+
337+```bash
338+port install bat
339+```
340+
341+### Windows
342+
343+在 Windows 上具有多种安装`bat`的方法。若你已完成安装,记得看看 ["在 Windows 上使用`bat`"](#在-Windows-中使用-bat) 。
344+
345+#### 前置条件
346+
347+你必须已安装 [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) 包。
348+
349+#### 使用 Chocolatey
350+
351+你可以用[Chocolatey](https://chocolatey.org/packages/Bat) 安装`bat`:
352+
353+```bash
354+choco install bat
355+```
356+
357+#### 使用 Scoop
358+
359+你可以用 [scoop](https://scoop.sh/) 安装`bat`:
360+
361+```bash
362+scoop install bat
363+```
364+
365+#### 使用预编译二进制版本
366+
367+直接从 [Release 发布页](https://github.com/sharkdp/bat/releases) 下载已经编译好的二进制包,前提是你安装了 [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) 包。
368+
369+### 使用二进制版本
370+
371+在 [Release 发布页](https://github.com/sharkdp/bat/releases) 中可以找到为多种架构构建的`bat`版本和静态编译的二进制文件(文件名带有`musl`)。
372+
373+### 从源码编译
374+
375+如果你想要自己构建`bat`,那么你需要安装有高于1.51版本的 Rust。
376+
377+使用以下命令编译。
378+
379+```bash
380+cargo install --locked bat
381+```
382+
383+注意:man page或 shell 自动补全所需要的额外文件无法通过该方法安装。但你可以在`cargo`的生成目录找到这些文件(`build`目录下)。
384+
385+## 自定义
386+
387+### 语法高亮主题
388+
389+使用 `bat --list-themes` 一份语法高亮主题的清单,然后用`--theme=TwoDark`来指定主题为`TwoDark`,也可以通过设置`BAT_THEME`环境变量来选定主题。把`export BAT_THEME="TwoDark"`添加到 shell 的启动脚本(shell startup file)来取得永久效果。或者使用`bat`的[配置文件](#c配置文件)
390+
391+若想要查看所有主题在一个文件上的显示效果可以用一下命令(需要安装`fzf`):
392+
393+```bash
394+bat --list-themes | fzf --preview="bat --theme={} --color=always /path/to/file"
395+```
396+
397+`bat`在默认情况下能够在黑色主题背景下获得较好的效果,如果你的终端使用亮色背景,可以试试`GitHub`或`OneHalfLight`。想要添加自定义主题可以参考[添加主题](#添加主题)。
398+
399+### 8-bit 主题
400+
401+`bat` 自带三个 [8-bit 色彩](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 主题:
402+
403+- `ansi` 适应于大部分终端。它使用 3-bit 色彩:黑红绿黄蓝洋红靛青白。
404+- `base16`专为 [base16](https://github.com/chriskempson/base16) 终端设计。它使用 4-bit 色彩(带有亮度的 3-bit 色彩)。根据 [base16 styling guidelines](https://github.com/chriskempson/base16/blob/master/styling.md) 制作。
405+- `base16-25`专为 [base16-shell](https://github.com/chriskempson/base16-shell) 设计。它把部分亮色替换为 8-bit 色彩。请不要直接使用该主题,除非你清楚你的256色终端是否使用 base16-shell。
406+
407+尽管这些主题具有诸多限制,但具有一些 truecolor 主题不具有的三个优点:
408+
409+- 享有最佳兼容性。并不是所有终端工具都支持高于 3-bit 的色彩。
410+- 适应终端主题。
411+- 视觉上和其他的终端工具更协调。
412+
413+### 输出样式
414+
415+你可以用`--style`参数来控制`bat`输出的样式。使用`--style=numbers,chanegs`可以只开启 Git 修改和行号显示而不添加其他内容。`BAT_STYLE`环境变量具有相同功能。
416+
417+### 添加新的语言和语法
418+
419+当现有的`bat`不支持某个语言或语法时你可以自己添加。
420+
421+`bat`使用`syntect`库来支持语法高亮,该库使用 [Sublime Text `.sublime-syntax` 语法文件](https://www.sublimetext.com/docs/3/syntax.html)和主题。而后者中的大部分可以在 [Package Control](https://packagecontrol.io/) 找到。
422+
423+当你找到一份语法文件,按照下列方法:
424+
425+1. 创建包含语法描述文件的目录:
426+
427+ ```bash
428+ mkdir -p "$(bat --config-dir)/syntaxes"
429+ cd "$(bat --config-dir)/syntaxes"
430+
431+ # Put new '.sublime-syntax' language definition files
432+ # in this folder (or its subdirectories), for example:
433+ git clone https://github.com/tellnobody1/sublime-purescript-syntax
434+ ```
435+
436+2. 调用下面指令把文件转换为二进制缓存:
437+
438+ ```bash
439+ bat cache --build
440+ ```
441+
442+3. 最后用`bat --list-languages`来检查新的语法是否被成功导入。如果想要回滚到最初状态,执行:
443+
444+ ```bash
445+ bat cache --clear
446+ ```
447+
448+4. 如果你觉得`bat`有必要自带该语法支持,请在阅读[指导](doc/assets.md)后向仓库提交 [Syntax Request](https://github.com/sharkdp/bat/issues/new?labels=syntax-request&template=syntax_request.md)。
449+
450+### 添加主题
451+
452+类似添加语法支持,第一步也是创建一个带有语法高亮的目录
453+
454+```bash
455+mkdir -p "$(bat --config-dir)/themes"
456+cd "$(bat --config-dir)/themes"
457+
458+# 下载一个主题
459+git clone https://github.com/greggb/sublime-snazzy
460+
461+# 更新二进制缓存
462+bat cache --build
463+```
464+
465+然后用`bat --list-themes`检查添加是否成功。
466+
467+### 添加或修改文件关联
468+
469+你可以用`--map-syntax`参数添加或修改文件名模板。它需要一个类似`pattern:syntax`的参数来指定,其中`pattern`是 glob 文件匹配模板,`syntax`则是支持的语法的完整名(使用`bat --list-languages`来查看获取一份清单)。
470+
471+注意:方便起见,你可能需要把参数添加到配置文件,而不是每次都在命令行中传递该参数。
472+
473+以下展示了把“INI”关联到具有`.conf`扩展名的文件
474+
475+```bash
476+--map-syntax='*.conf:INI'
477+```
478+
479+把`.ignore`文件与“Git Ignore”关联
480+
481+```bash
482+--map-syntax='.ignore:Git Ignore'
483+```
484+
485+把`/etc/apache2`内的`.conf`文件关联到“Apache Conf”语法(`bat`已默认绑定)
486+
487+```bash
488+--map-syntax='/etc/apache2/**/*.conf:Apache Conf'
489+```
490+
491+### 使用自定义分页器
492+
493+`bat`默认使用`PAGER`环境变量定义的分页器,如果没有定义则使用`less`。`bat`提供了`BAT_PAGER`环境变量来专为`bat`选择分页器(优先级高于`PAGER`)。
494+
495+注意:当`PAGER`设置为`more`或`most`时,`bat`会使用`less`来代替以确保能提供色彩支持。
496+
497+```bash
498+export BAT_PAGER="less -RF"
499+```
500+
501+除了使用环境变量来改变`bat`使用的的分页器,也可以在配置文件中提供`--pager`参数。
502+
503+注意:`bat`会把部分命令行参数直接传递给分页器:`-R`/`--RAW-CONTROL-CHARS`,`-F`/`--quit-if-one-screen`以及`-X`/`--no-init`(该参数仅适用于高于530版本的`less`)。其中`-R` 参数需要在解释 ANSI 标准颜色时起作用。`-F`则指示`less`在输出内容的垂直尺寸小于终端尺寸时立即退出。当文件内容可以在一个屏幕里完全显示时,就不需要按`q`键退出阅读模式,很方便就是了。`-X`则能修复`-F`在`less`的老版本中的一些bug(代价是不支持鼠标滚轮,但可以用`-R`来取消`quit-if-one-screen`功能。)。
504+
505+### 缩进
506+
507+`bat` 使用四个空格宽的制表符,而不受分页器影响,同时也可以用`--tabs`参数来自定义。
508+
509+注意:通过其他方法针对分页器的制表符设置不会生效(例如通过`bat`的`--pager`参数传递或`less`使用的`LESS`环境变量)。因为在输出提交给分页器之前,内容中的制表符就已经被`bat`替换为了特定长度的空格以避免由于边栏导致的缩进问题。你可以用给`bat`传递`--tabs=0`参数来取消该设定并让分页器自己处理制表符。
510+
511+### 暗色模式
512+
513+如果你用的 macOS 处于暗色模式,你可以为`bat`启用基于系统主题的主题。如下所示操作会让`bat`在系统处于亮色模式时加载`GitHub`主题和暗色模式时加载`default`主题。
514+
515+```bash
516+alias cat="bat --theme=\$(defaults read -globalDomain AppleInterfaceStyle &> /dev/null && echo default || echo GitHub)"
517+```
518+
519+## 配置文件
520+
521+```bash
522+bat --config-file
523+```
524+
525+你也可以用`BAT_CONFIG_PATH`来为`bat`指定自定义位置的配置文件:
526+
527+```bash
528+export BAT_CONFIG_PATH="/path/to/bat.conf"
529+```
530+
531+使用`--generate-config-file`参数调用`bat`会在指定位置生成一份默认的`bat`配置文件:
532+
533+```bash
534+bat --generate-config-file
535+```
536+
537+### 格式
538+
539+配置文件其实是一份按行分割的命令行参数列表。你可以用`bat --help`来查看所有可用的参数和适用的值。配置文件中`#`打头的行会被视为注释而不生效。
540+
541+以下是一份示例:
542+
543+```bash
544+# 设置主题为 TwoDark
545+--theme="TwoDark"
546+
547+# 显示行号和 Git 修改信息, 但没有边框
548+--style="numbers,changes,header"
549+
550+# 在终端中以斜体输出文本(不是所有终端都支持)
551+--italic-text=always
552+
553+# 使用 C++ 语法来给 Ardiuno 的 .ino 文件提供高亮
554+--map-syntax "*.ino:C++"
555+```
556+
557+## 在 Windows 中使用 `bat`
558+
559+`bat` 在 Windows 上开箱即用,除了部分功能需要额外配置。
560+
561+### 前置条件
562+
563+你需要先安装 [Visual C++ Redistributable](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads) 包。
564+
565+### 分页
566+
567+Windows 只有一个提供有限功能的分页器,你可以从[这里下载](http://www.greenwoodsoftware.com/less/download.html)或用 [Chocolatey 安装](https://chocolatey.org/packages/Less) Windows 版本的`less`。第一种方法需要你把它所在目录加入`PATH`环境变量或[定义分页器变量](#使用自定义分页器)
568+
569+### 色彩
570+
571+Windows 10 从 [v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)) 开始 shell(`conhost.exe`,命令提示符或 Powershell)原生支持色彩。在早些版本的 Windows 中你可以用第三方终端如 [Cmder](http://cmder.net/) (使用[ConEmu](https://conemu.github.io/))。
572+
573+注意:Git 和 MSYS 版本的 `less` 没法正确在 Windows 表达色彩。如果你没有安装其他分页器,你可以直接用`--paging=never`或设置`BAT_PAGER`为空字符串来关闭分页功能。
574+
575+### Cygwin
576+
577+Windows 上的`bat`原生不支持 Cygwin' unix-style 路径(`/cygdrive/*`)。当传递一个绝对 cygwin 路径作为参数值时,`bat`会产生`The system cannot find the path specified. (os error 3)`的错误。你可以`.bash_profile`文件中添加以下函数来解决这个问题。
578+
579+```bash
580+bat() {
581+ local index
582+ local args=("$@")
583+ for index in $(seq 0 ${#args[@]}) ; do
584+ case "${args[index]}" in
585+ -*) continue;;
586+ *) [ -e "${args[index]}" ] && args[index]="$(cygpath --windows "${args[index]}")";;
587+ esac
588+ done
589+ command bat "${args[@]}"
590+}
591+```
592+
593+## 疑难解答
594+
595+### 输出内容含糊不清
596+
597+当输入文件包含颜色代码和其他 ANSI 转义符号时,`bat`会产生错误的语法高亮和文本,导致输出看起来令人无法理解。当你需要输出该文件时,请使用`--color=never --wrap=never`参数来关闭上色和文字包裹。
598+
599+### 终端与色彩
600+
601+`bat`会区分支持 truecolor 和不支持 truecolor 的终端。但是大部分语法高亮主题都是用了没有为 8-bit 色彩支持的颜色,因此强烈推荐使用一个支持 24-bit 色彩的终端(`terminator`,`konsole`,`iTerm2`...),或使用一个 [8-bit 主题](#8-bit-主题)来限制一些颜色。查看[这篇文章使用自定义分页器](https://gist.github.com/XVilka/8346728)了解更多支持 truecolor 的终端。你需要定义`COLORTERM`变量为`truecolor`或`24bit`来确保`bat`能够识别终端的对颜色的支持,否则会使用 8 bit 模式。
602+
603+### 行号和边框很难看清
604+
605+试试其他主题,说不定能有所改善(用`bat --list-themes`查看主题列表)。
606+
607+### 文件编码
608+
609+`bat`原生支持 UTF-8 和 UTF-16。至于其他文件你可能需要在使用`bat`之前先把编码转换到UTF-8。
610+
611+这里展示了使用`iconv`来把 Latin-1(ISO-8859-1) 编码的 PHP 文件转换到 UTF-8:
612+
613+```bash
614+iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
615+```
616+
617+注意: 当`bat`无法识别语言时你可能会需要`-l`/`--language`参数。
618+
619+## Development
620+
621+```bash
622+# Recursive clone to retrieve all submodules
623+git clone --recursive https://github.com/sharkdp/bat
624+
625+# Build (debug version)
626+cd bat
627+cargo build --bins
628+
629+# Run unit tests and integration tests
630+cargo test
631+
632+# Install (release version)
633+cargo install --path . --locked
634+
635+# Build a bat binary with modified syntaxes and themes
636+bash assets/create.sh
637+cargo install --path . --locked --force
638+```
639+
640+If you want to build an application that uses `bat`s pretty-printing
641+features as a library, check out the [the API documentation](https://docs.rs/bat/).
642+Note that you have to use either `regex-onig` or `regex-fancy` as a feature
643+when you depend on `bat` as a library.
644+
645+## Contributing
646+
647+Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
648+
649+## Maintainers
650+
651+- [sharkdp](https://github.com/sharkdp)
652+- [eth-p](https://github.com/eth-p)
653+- [keith-hall](https://github.com/keith-hall)
654+- [Enselic](https://github.com/Enselic)
655+
656+## Security vulnerabilities
657+
658+Please contact [David Peter](https://david-peter.de/) via email if you want to report a vulnerability in `bat`.
659+
660+## Project goals and alternatives
661+
662+`bat` tries to achieve the following goals:
663+
664+- Provide beautiful, advanced syntax highlighting
665+- Integrate with Git to show file modifications
666+- Be a drop-in replacement for (POSIX) `cat`
667+- Offer a user-friendly command-line interface
668+
669+There are a lot of alternatives, if you are looking for similar programs. See
670+[this document](doc/alternatives.md) for a comparison.
671+
672+## License
673+
674+Copyright (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat).
675+
676+`bat` is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
677+
678+See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
doc/alternatives.md+40−1
@@ -9,7 +9,7 @@ if you are not looking for a program like `bat`, this comparison might not be fo
9| Drop-in `cat` replacement | :heavy_check_mark: [*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (:heavy_check_mark:) | :x: | :x: [*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: |
9| Drop-in `cat` replacement | :heavy_check_mark: [*](https://github.com/sharkdp/bat/issues/134) | :x: | :x: | (:heavy_check_mark:) | :x: | :x: [*](https://github.com/rstacruz/hicat/issues/6) | :x: | :x: |
10| Git integration | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
10| Git integration | :heavy_check_mark: | :x: | :x: | :x: | :x: | :x: | :x: | :x: |
11| Automatic paging | :heavy_check_mark: | :x: | :x: | :x: | :x: | :heavy_check_mark: | :x: | :x: |
11| Automatic paging | :heavy_check_mark: | :x: | :x: | :x: | :x: | :heavy_check_mark: | :x: | :x: |
12−| Languages (circa) | 110 | 300 | 200 | 7 | 80 | 130 | 30 | 130 |
12+| Languages (circa) | 150 | 300 | 200 | 7 | 80 | 130 | 30 | 130 |
13| Extensible (languages, themes) | :heavy_check_mark: | (:heavy_check_mark:) | (:heavy_check_mark:) | :x: | (:heavy_check_mark:) | :x: | :x: | :x: |
13| Extensible (languages, themes) | :heavy_check_mark: | (:heavy_check_mark:) | (:heavy_check_mark:) | :x: | (:heavy_check_mark:) | :x: | :x: | :x: |
14| Advanced highlighting (e.g. nested syntaxes) | :heavy_check_mark: | :heavy_check_mark: | (:heavy_check_mark:) ? | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
14| Advanced highlighting (e.g. nested syntaxes) | :heavy_check_mark: | :heavy_check_mark: | (:heavy_check_mark:) ? | :x: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
15| Execution time [ms] (`jquery-3.3.1.js`) | 624 | 789 | 400 | 80 | 300 | 316 | 157 | 695 |
15| Execution time [ms] (`jquery-3.3.1.js`) | 624 | 789 | 400 | 80 | 300 | 316 | 157 | 695 |
@@ -22,3 +22,42 @@ request.
22Some other alternatives that are also related, but not yet included in the table:
22Some other alternatives that are also related, but not yet included in the table:
23- [lesspipe](https://github.com/wofr06/lesspipe)
23- [lesspipe](https://github.com/wofr06/lesspipe)
24- [vimpager](https://github.com/rkitover/vimpager)
24- [vimpager](https://github.com/rkitover/vimpager)
25+
26+## Benchmarks
27+
28+The benchmarks above have been created with this script:
29+```bash
30+#!/usr/bin/env bash
31+
32+cd "$(dirname "${BASH_SOURCE[0]}")" || exit
33+
34+if ! command -v hyperfine > /dev/null 2>&1; then
35+ echo "'hyperfine' does not seem to be installed."
36+ echo "You can get it here: https://github.com/sharkdp/hyperfine"
37+ exit 1
38+fi
39+
40+SRC="test-src/jquery-3.3.1.js"
41+
42+
43+cmd_bat="bat --style=full --color=always --paging=never '$SRC'"
44+cmd_bat_simple="bat --plain --wrap=never --tabs=0 --color=always --paging=never '$SRC'"
45+cmd_pygmentize="pygmentize -g '$SRC'"
46+cmd_highlight="highlight -O truecolor '$SRC'"
47+cmd_ccat="ccat --color=always '$SRC'"
48+cmd_source_highlight="source-highlight --failsafe --infer-lang -f esc -i '$SRC'"
49+cmd_hicat="hicat '$SRC'"
50+cmd_coderay="coderay '$SRC'"
51+cmd_rouge="rougify '$SRC'"
52+
53+hyperfine --warmup 3 \
54+ "$cmd_bat" \
55+ "$cmd_bat_simple" \
56+ "$cmd_pygmentize" \
57+ "$cmd_highlight" \
58+ "$cmd_ccat" \
59+ "$cmd_source_highlight" \
60+ "$cmd_hicat" \
61+ "$cmd_coderay" \
62+ "$cmd_rouge" \
63+```
doc/assets.mdnew file+100
@@ -0,0 +1,100 @@
1+## Adding new builtin languages for syntax highlighting
2+
3+Should you find that a particular syntax is not available within `bat` and think it should be included in `bat` by default, you can follow the instructions outlined below.
4+
5+`bat` uses the excellent [syntect](https://github.com/trishume/syntect) library to highlight source
6+code. As a basis, syntect uses [Sublime Text](https://www.sublimetext.com/) syntax definitions
7+in the `.sublime-syntax` format.
8+
9+**Important:** Before proceeding, verify that the syntax you wish to add meets the [criteria for inclusion](#Criteria-for-inclusion-of-new-syntaxes).
10+
11+1. Find a Sublime Text syntax for the given language, preferably in a separate Git repository
12+ which can be included as a submodule (under `assets/syntaxes`) using
13+ `git submodule add <https github link> ./assets/syntaxes/02_Extra/<repo name>`, replacing
14+ the contents of the angle brackets as appropriate.
15+
16+2. If the Sublime Text syntax is only available as a `.tmLanguage` file, open the file in
17+ Sublime Text and convert it to a `.sublime-syntax` file via *Tools* -> *Developer* ->
18+ *New Syntax from XXX.tmLanguage...*. Save the new file in the `assets/syntaxes` folder.
19+
20+3. Run the `assets/create.sh` script. It calls `bat cache --build` to parse all available
21+ `.sublime-syntax` files and serialize them to a `syntaxes.bin` file.
22+
23+4. Re-compile `bat`. At compilation time, the `syntaxes.bin` file will be stored inside the
24+ `bat` binary.
25+
26+5. Use `bat --list-languages` to check if the new languages are available.
27+
28+6. Add a syntax test for the new language. See [below](#Syntax-tests) for details.
29+
30+7. If you send a pull request with your changes, please do *not* include the changed `syntaxes.bin`
31+ file. A new binary cache file will be created once before every new release of `bat`. This
32+ avoids bloating the repository size unnecessarily.
33+
34+### Syntax tests
35+
36+`bat` has a set of syntax highlighting regression tests in `tests/syntax-tests`. The main idea is
37+make sure that we do not run into issues we had in the past where either (1) syntax highlighting
38+for some language is suddenly not working anymore or (2) `bat` suddenly crashes for some input (due
39+to `regex` incompatibilities between `syntect` and Sublime Text).
40+
41+In order to add a new test file, please follow these steps (let's take "Ruby" as an example):
42+
43+1. Make sure that you are running the **latest version of `bat`** and that `bat` is available on
44+ the path. If you are creating a syntax test for a new builtin syntax (see above), make sure that
45+ your version of `bat` already has the new syntax builtin.
46+2. Find an example Ruby source file or write one yourself. If possible, the file should aim to be
47+ "comprehensive" (i.e. include a lot of the possible syntax), but this is not strictly necessary.
48+ A simple file is better than none at all. Also, the files shouldn't be gigantic.
49+3. Save the file in `tests/syntax-tests/source/Ruby` (adapt for your language). The file name could
50+ be `test.rb` (adapt extension) but can also be adapted if that is necessary in order for `bat` to
51+ highlight it correctly (e.g. `Makefile`).
52+4. If you have copied the file from somewhere else, please make sure that the file *may* be copied
53+ under the respective license and that the license is compatible with `bat`s license. If it
54+ requires attribution, please add a `LICENSE.md` in the same folder with a text like this:
55+ ```
56+ The `test.rb` file has been added from [enter source here] under the following license:
57+
58+ [add license text here]
59+ ```
60+5. Go to `tests/syntax-tests` and run the `update.sh` Bash script. A new file should be generated
61+ in the `highlighted` folder (e.g. `highlighted/Ruby/test.rb`).
62+6. Use `cat` or `bat --language=txt` to display the content of this file and make sure that the
63+ syntax highlighting looks correct.
64+7. `git add` the new files in the `source` folder as well as the autogenerated files in the
65+ `highlighted` folder.
66+
67+### Troubleshooting
68+
69+Make sure that the local cache does not interfere with the internally stored syntaxes and
70+themes (`bat cache --clear`).
71+
72+## Criteria for inclusion of new syntaxes
73+
74+* More than 10,000 downloads at [Package Control](https://packagecontrol.io)
75+
76+### Manual modifications
77+
78+The following files have been manually modified after converting from a `.tmLanguage` file:
79+
80+* `Apache.sublime_syntax`=> removed `.conf` and `.CONF` file types.
81+* `Dart.sublime-syntax` => removed `#regex.dart` include.
82+* `INI.sublime-syntax` => added `.hgrc`, `hgrc`, and `desktop` file types and support for comments after section headers
83+* `Org mode.sublime-syntax` => removed `task` file type.
84+* `SML.sublime_syntax` => removed `ml` file type.
85+* `Robot.sublime_syntax` => changed name to "Robot Framework", added `.resource` extension
86+
87+### Non-submodule additions
88+
89+* `Assembly (x86_64)` has been manually added from https://github.com/13xforever/x86-assembly-textmate-bundle due to `git clone` recursion problems
90+* `Nim.sublime-syntax` has been added manually from https://github.com/getzola/zola/blob/master/sublime_syntaxes/Nim.sublime-syntax as there was no suitable Git repository for it. The original syntax seems to originate from https://github.com/Varriount/NimLime
91+* `Rego.sublime-syntax` has been added manually from https://github.com/open-policy-agent/opa/blob/master/misc/syntax/sublime/rego.sublime-syntax
92+ as it is not kept in a standalone repository. The file is generated from
93+ https://github.com/open-policy-agent/opa/blob/master/misc/syntax/textmate/Rego.tmLanguage
94+* `SML.sublime_syntax` has been added manually from
95+ https://github.com/seanjames777/SML-Language-Definitiona as it is not
96+ kept in a standalone repository. The file generated is from
97+ https://github.com/seanjames777/SML-Language-Definition/blob/master/sml.tmLanguage
98+* `Cabal.sublime_syntax` has been added manually from
99+ https://github.com/SublimeHaskell/SublimeHaskell/ - we don't want to include the whole submodule because it includes other syntaxes ("Haskell improved") as well.
100+* `Lean.sublime-syntax` has been added manually from https://github.com/leanprover/vscode-lean/blob/master/syntaxes/lean.json via conversion.
doc/logo-header.svg+1−1
@@ -45,7 +45,7 @@
45 showguides="true"
45 showguides="true"
46 inkscape:guide-bbox="true" />
46 inkscape:guide-bbox="true" />
47 <rect
47 <rect
48− style="opacity:1;fill:#f2f2f2;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14294769px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
48+ style="opacity:0.5;fill:#e5e5e5;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.14294769px;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none"
49 id="rect1929"
49 id="rect1929"
50 width="1000"
50 width="1000"
51 height="286.64285"
51 height="286.64285"
doc/release-checklist.mdnew file+73
@@ -0,0 +1,73 @@
1+# Release checklist
2+
3+## Version bump
4+
5+- [ ] Update version in `Cargo.toml`. Run `cargo build` to update `Cargo.lock`.
6+ Make sure to `git add` the `Cargo.lock` changes as well.
7+- [ ] Find the current min. supported Rust version by running
8+ `grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
9+- [ ] Update the version and the min. supported Rust version in `README.md` and
10+ `doc/README-*.md`. Check with
11+ `git grep -i -e 'rust.*1\.' -e '1\..*rust' | grep README | grep -v tests/`.
12+- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
13+
14+## Update syntaxes and themes (build assets)
15+
16+- [ ] Install the latest master version (`cargo clean && cargo install --locked -f --path .`) and make
17+ sure that it is available on the `PATH` (`bat --version` should show the
18+ new version).
19+- [ ] Run `assets/create.sh` and check in the binary asset files.
20+
21+## Documentation
22+
23+- [ ] Review `-h`, `--help`, and the `man` page. All of these are shown in
24+ the output of the CI job called *Documentation*, so look there.
25+ The CI workflow corresponding to the tip of the master branch is a good place to look.
26+
27+## Pre-release checks
28+
29+- [ ] Push all changes and wait for CI to succeed (before continuing with the
30+ next section).
31+- [ ] Optional: manually test the new features and command-line options. To do
32+ this, install the latest `bat` version again (to include the new syntaxes
33+ and themes).
34+- [ ] Run `cargo publish --dry-run` to make sure that it will
35+ succeed later (after creating the GitHub release).
36+
37+## Release
38+
39+- [ ] Create a tag and push it: `git tag vX.Y.Z; git push origin tag vX.Y.Z`.
40+ This will trigger the deployment via GitHub Actions.
41+ REMINDER: If your `origin` is a fork, don't forget to push to e.g. `upstream` instead!
42+- [ ] Go to https://github.com/sharkdp/bat/releases/new to create the new
43+ release. Select the new tag and also use it as the release title. For the
44+ release notes, copy the corresponding section from `CHANGELOG.md` and
45+ possibly add additional remarks for package maintainers.
46+ Publish the release.
47+- [ ] Check if the binary deployment works (archives and Debian packages should
48+ appear when the CI run for the Git tag has finished).
49+- [ ] Publish to crates.io by running `cargo publish` in a *clean* repository.
50+ The safest way to do this is to clone a fresh copy.
51+
52+## Post-release
53+
54+- [ ] Prepare a new "unreleased" section at the top of `CHANGELOG.md`.
55+ Put this at the top:
56+
57+```
58+# unreleased
59+
60+## Features
61+
62+## Bugfixes
63+
64+## Other
65+
66+## Syntaxes
67+
68+## Themes
69+
70+## `bat` as a library
71+
72+
73+```
doc/sponsors.mdnew file+14
@@ -0,0 +1,14 @@
1+## Sponsors
2+
3+`bat` development is sponsored by many individuals and companies. Thank you very much!
4+
5+Please note, that being sponsored does not affect the individuality of the `bat`
6+project or affect the maintainers' actions in any way.
7+We remain impartial and continue to assess pull requests solely on merit - the
8+features added, bugs solved, and effect on the overall complexity of the code.
9+No issue will have a different priority based on sponsorship status of the
10+reporter.
11+
12+Contributions from anybody are most welcomed, please see our [`CONTRIBUTING.md`](../CONTRIBUTING.md) guide.
13+
14+If you want to see our biggest sponsors, check the top of [`README.md`](../README.md#sponsors).
doc/sponsors/workos-logo-white-bg.svgnew file+11
@@ -0,0 +1,11 @@
1+<svg width="1354" height="420" viewBox="0 0 1354 420" fill="none" xmlns="http://www.w3.org/2000/svg">
2+<rect width="1354" height="420" rx="20" fill="white"/>
3+<path d="M434.751 133.122H466.637L489.595 227.729C493.852 245.585 494.697 256.219 494.697 256.219H495.128C495.128 256.219 496.61 245.808 500.867 227.729L522.757 133.122H558.9L582.066 227.729C586.53 246.223 587.598 256.219 587.598 256.219H588.236C588.236 256.219 588.666 246.223 592.907 227.729L615.02 133.122H646.907L606.523 288.313H571.017L546.576 194.344C541.474 173.936 541.044 164.801 541.044 164.801H540.614C540.614 164.801 540.183 173.936 535.512 194.344L512.553 288.313H475.996L434.751 133.122Z" fill="black"/>
4+<path d="M641.583 231.934C641.583 196.428 664.541 173.47 699.202 173.47C733.639 173.47 756.597 196.428 756.597 231.934C756.597 267.647 733.639 290.828 699.202 290.828C664.557 290.812 641.583 267.647 641.583 231.934ZM726.832 231.934C726.832 208.976 715.783 195.998 699.202 195.998C681.346 195.998 671.349 210.458 671.349 231.934C671.349 255.323 682.398 268.284 699.202 268.284C717.058 268.284 726.832 253.824 726.832 231.934Z" fill="black"/>
5+<path d="M770.836 175.21H799.103V196.048H799.741C804.635 185.207 816.322 174.365 836.299 174.365C839.695 174.365 841.831 174.796 843.314 175.21V203.478H842.469C842.469 203.478 839.918 202.633 832.903 202.633C811.013 202.633 799.103 215.594 799.103 239.828V288.295H770.836V175.21Z" fill="black"/>
6+<path d="M856.5 133.122H884.767V182.865C884.767 212.2 884.336 217.509 884.336 217.509H884.767L926.857 175.212H962.139L912.843 224.11L970.031 288.313H936.646L895.401 241.536L884.767 251.946V288.297H856.5V133.122Z" fill="black"/>
7+<path d="M970.444 211.285C970.444 163.455 1000.21 131.569 1044.85 131.569C1089.49 131.569 1119.26 163.455 1119.26 211.285C1119.26 259.114 1089.49 291.001 1044.85 291.001C1000.21 291.001 970.444 259.114 970.444 211.285ZM1088.42 211.285C1088.42 178.761 1071 156.855 1044.84 156.855C1018.67 156.855 1001.26 178.761 1001.26 211.285C1001.26 243.809 1018.69 265.715 1044.84 265.715C1070.98 265.715 1088.42 243.809 1088.42 211.285Z" fill="black"/>
8+<path d="M1130.08 236.656H1162.4C1162.4 254.943 1174.95 265.146 1194.08 265.146C1210.23 265.146 1221.29 257.063 1221.29 245.584C1221.29 232.622 1212.79 229.21 1185.79 223.901C1161.12 219.007 1134.98 210.716 1134.98 178.399C1134.98 151.408 1157.93 131 1193.01 131C1229.57 131 1252.11 150.132 1252.11 179.037H1219.79C1219.79 165.007 1208.95 156.286 1193.01 156.286C1176.86 156.286 1166.86 164.146 1166.86 175.625C1166.86 187.742 1173.88 192.413 1195.56 196.878C1227.65 203.685 1254.02 207.288 1254.02 243.001C1254.02 271.3 1229.36 290.432 1193.01 290.432C1156.02 290.432 1130.08 268.957 1130.08 236.656Z" fill="black"/>
9+<path d="M100 210C100 214.824 101.269 219.647 103.723 223.793L148.231 300.878C152.8 308.747 159.739 315.178 168.369 318.055C185.377 323.724 202.977 316.447 211.354 301.893L222.1 283.278L179.708 210L224.47 132.408L235.216 113.792C238.431 108.208 242.747 103.638 247.824 100H243.17H178.777C166.677 100 155.508 106.431 149.5 116.923L103.723 196.208C101.269 200.354 100 205.177 100 210Z" fill="#6363F1"/>
10+<path d="M353.847 210C353.847 205.177 352.578 200.353 350.124 196.207L305.024 118.107C296.647 103.638 279.047 96.3608 262.039 101.945C253.409 104.822 246.47 111.253 241.901 119.122L231.747 136.638L274.139 210L229.378 287.592L218.632 306.208C215.416 311.708 211.101 316.362 206.024 320H210.678H275.07C287.17 320 298.34 313.569 304.347 303.077L350.124 223.792C352.578 219.646 353.847 214.823 353.847 210Z" fill="#6363F1"/>
11+</svg>
examples/inputs.rsnew file+19
@@ -0,0 +1,19 @@
1+/// A small demonstration of the Input API.
2+/// This prints embedded bytes with a custom header and then reads from STDIN.
3+use bat::{Input, PrettyPrinter};
4+
5+fn main() {
6+ PrettyPrinter::new()
7+ .header(true)
8+ .grid(true)
9+ .line_numbers(true)
10+ .inputs(vec![
11+ Input::from_bytes(b"echo 'Hello World!'")
12+ .name("embedded.sh") // Dummy name provided to detect the syntax.
13+ .kind("Embedded")
14+ .title("An embedded shell script."),
15+ Input::from_stdin().title("Standard Input").kind("FD"),
16+ ])
17+ .print()
18+ .unwrap();
19+}
examples/yaml.rs+2−2
@@ -1,5 +1,5 @@
1/// A program that serializes a Rust structure to YAML and pretty-prints the result
1/// A program that serializes a Rust structure to YAML and pretty-prints the result
2−use bat::PrettyPrinter;
2+use bat::{Input, PrettyPrinter};
3use serde::Serialize;
3use serde::Serialize;
4
4
5#[derive(Serialize)]
5#[derive(Serialize)]
@@ -29,7 +29,7 @@ fn main() {
29 .line_numbers(true)
29 .line_numbers(true)
30 .grid(true)
30 .grid(true)
31 .header(true)
31 .header(true)
32− .input_from_bytes_with_name(&bytes, "person.yaml")
32+ .input(Input::from_bytes(&bytes).name("person.yaml").kind("File"))
33 .print()
33 .print()
34 .unwrap();
34 .unwrap();
35}
35}
rustfmt.tomlnew file+1
@@ -0,0 +1 @@
1+# Defaults are used
src/assets.rs+447−220
@@ -1,186 +1,255 @@
1−use std::collections::BTreeMap;
2use std::ffi::OsStr;
1use std::ffi::OsStr;
3−use std::fs::{self, File};
2+use std::fs;
4−use std::io::BufReader;
5use std::path::Path;
3use std::path::Path;
6
4
7−use syntect::dumps::{dump_to_file, from_binary, from_reader};
5+use once_cell::unsync::OnceCell;
8−use syntect::highlighting::{Theme, ThemeSet};
6+
9−use syntect::parsing::{SyntaxReference, SyntaxSet, SyntaxSetBuilder};
7+use syntect::highlighting::Theme;
8+use syntect::parsing::{SyntaxReference, SyntaxSet};
9+
10+use path_abs::PathAbs;
10
11
11−use crate::assets_metadata::AssetsMetadata;
12use crate::error::*;
12use crate::error::*;
13−use crate::input::{InputReader, OpenedInput, OpenedInputKind};
13+use crate::input::{InputReader, OpenedInput};
14−use crate::syntax_mapping::{MappingTarget, SyntaxMapping};
14+use crate::syntax_mapping::ignored_suffixes::IgnoredSuffixes;
15+use crate::syntax_mapping::MappingTarget;
16+use crate::{bat_warning, SyntaxMapping};
17+
18+use lazy_theme_set::LazyThemeSet;
19+
20+use serialized_syntax_set::*;
21+
22+#[cfg(feature = "build-assets")]
23+pub use crate::assets::build_assets::*;
24+
25+pub(crate) mod assets_metadata;
26+#[cfg(feature = "build-assets")]
27+mod build_assets;
28+mod lazy_theme_set;
29+mod serialized_syntax_set;
15
30
16#[derive(Debug)]
31#[derive(Debug)]
17pub struct HighlightingAssets {
32pub struct HighlightingAssets {
18− pub(crate) syntax_set: SyntaxSet,
33+ syntax_set_cell: OnceCell<SyntaxSet>,
19− pub(crate) theme_set: ThemeSet,
34+ serialized_syntax_set: SerializedSyntaxSet,
35+
36+ theme_set: LazyThemeSet,
20 fallback_theme: Option<&'static str>,
37 fallback_theme: Option<&'static str>,
21}
38}
22
39
23−impl HighlightingAssets {
40+#[derive(Debug)]
24− pub fn default_theme() -> &'static str {
41+pub struct SyntaxReferenceInSet<'a> {
25− "Monokai Extended"
42+ pub syntax: &'a SyntaxReference,
26− }
43+ pub syntax_set: &'a SyntaxSet,
27−
44+}
28− pub fn from_files(source_dir: &Path, include_integrated_assets: bool) -> Result<Self> {
29− let mut theme_set = if include_integrated_assets {
30− Self::get_integrated_themeset()
31− } else {
32− ThemeSet {
33− themes: BTreeMap::new(),
34− }
35− };
36
45
37− let theme_dir = source_dir.join("themes");
46+/// Lazy-loaded syntaxes are already compressed, and we don't want to compress
47+/// already compressed data.
48+pub(crate) const COMPRESS_SYNTAXES: bool = false;
38
49
39− let res = theme_set.add_from_folder(&theme_dir);
50+/// We don't want to compress our [LazyThemeSet] since the lazy-loaded themes
40− if res.is_err() {
51+/// within it are already compressed, and compressing another time just makes
41− println!(
52+/// performance suffer
42− "No themes were found in '{}', using the default set",
53+pub(crate) const COMPRESS_THEMES: bool = false;
43− theme_dir.to_string_lossy()
44− );
45− }
46
54
47− let mut syntax_set_builder = if !include_integrated_assets {
55+/// Compress for size of ~40 kB instead of ~200 kB without much difference in
48− let mut builder = SyntaxSetBuilder::new();
56+/// performance due to lazy-loading
49− builder.add_plain_text_syntax();
57+pub(crate) const COMPRESS_LAZY_THEMES: bool = true;
50− builder
51− } else {
52− Self::get_integrated_syntaxset().into_builder()
53− };
54
58
55− let syntax_dir = source_dir.join("syntaxes");
59+/// Compress for size of ~10 kB instead of ~120 kB
56− if syntax_dir.exists() {
60+pub(crate) const COMPRESS_ACKNOWLEDGEMENTS: bool = true;
57− syntax_set_builder.add_from_folder(syntax_dir, true)?;
58− } else {
59− println!(
60− "No syntaxes were found in '{}', using the default set.",
61− syntax_dir.to_string_lossy()
62− );
63− }
64
61
65− Ok(HighlightingAssets {
62+impl HighlightingAssets {
66− syntax_set: syntax_set_builder.build(),
63+ fn new(serialized_syntax_set: SerializedSyntaxSet, theme_set: LazyThemeSet) -> Self {
64+ HighlightingAssets {
65+ syntax_set_cell: OnceCell::new(),
66+ serialized_syntax_set,
67 theme_set,
67 theme_set,
68 fallback_theme: None,
68 fallback_theme: None,
69− })
69+ }
70 }
70 }
71
71
72− pub fn from_cache(cache_path: &Path) -> Result<Self> {
72+ /// The default theme.
73− let syntax_set_path = cache_path.join("syntaxes.bin");
73+ ///
74− let theme_set_path = cache_path.join("themes.bin");
74+ /// ### Windows and Linux
75−
75+ ///
76− let syntax_set_file = File::open(&syntax_set_path).chain_err(|| {
76+ /// Windows and most Linux distributions has a dark terminal theme by
77− format!(
77+ /// default. On these platforms, this function always returns a theme that
78− "Could not load cached syntax set '{}'",
78+ /// looks good on a dark background.
79− syntax_set_path.to_string_lossy()
79+ ///
80− )
80+ /// ### macOS
81− })?;
81+ ///
82− let syntax_set: SyntaxSet = from_reader(BufReader::new(syntax_set_file))
82+ /// On macOS the default terminal background is light, but it is common that
83− .chain_err(|| "Could not parse cached syntax set")?;
83+ /// Dark Mode is active, which makes the terminal background dark. On this
84−
84+ /// platform, the default theme depends on
85− let theme_set_file = File::open(&theme_set_path).chain_err(|| {
85+ /// ```bash
86− format!(
86+ /// defaults read -globalDomain AppleInterfaceStyle
87− "Could not load cached theme set '{}'",
87+ /// ````
88− theme_set_path.to_string_lossy()
88+ /// To avoid the overhead of the check on macOS, simply specify a theme
89− )
89+ /// explicitly via `--theme`, `BAT_THEME`, or `~/.config/bat`.
90− })?;
90+ ///
91− let theme_set: ThemeSet = from_reader(BufReader::new(theme_set_file))
91+ /// See <https://github.com/sharkdp/bat/issues/1746> and
92− .chain_err(|| "Could not parse cached theme set")?;
92+ /// <https://github.com/sharkdp/bat/issues/1928> for more context.
93+ pub fn default_theme() -> &'static str {
94+ #[cfg(not(target_os = "macos"))]
95+ {
96+ Self::default_dark_theme()
97+ }
98+ #[cfg(target_os = "macos")]
99+ {
100+ if macos_dark_mode_active() {
101+ Self::default_dark_theme()
102+ } else {
103+ Self::default_light_theme()
104+ }
105+ }
106+ }
93
107
94− Ok(HighlightingAssets {
108+ /**
95− syntax_set,
109+ * The default theme that looks good on a dark background.
96− theme_set,
110+ */
97− fallback_theme: None,
111+ fn default_dark_theme() -> &'static str {
98− })
112+ "Monokai Extended"
99 }
113 }
100
114
101− fn get_integrated_syntaxset() -> SyntaxSet {
115+ /**
102− from_binary(include_bytes!("../assets/syntaxes.bin"))
116+ * The default theme that looks good on a light background.
117+ */
118+ #[cfg(target_os = "macos")]
119+ fn default_light_theme() -> &'static str {
120+ "Monokai Extended Light"
103 }
121 }
104
122
105− fn get_integrated_themeset() -> ThemeSet {
123+ pub fn from_cache(cache_path: &Path) -> Result<Self> {
106− from_binary(include_bytes!("../assets/themes.bin"))
124+ Ok(HighlightingAssets::new(
125+ SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
126+ asset_from_cache(&cache_path.join("themes.bin"), "theme set", COMPRESS_THEMES)?,
127+ ))
107 }
128 }
108
129
109 pub fn from_binary() -> Self {
130 pub fn from_binary() -> Self {
110− let syntax_set = Self::get_integrated_syntaxset();
131+ HighlightingAssets::new(
111− let theme_set = Self::get_integrated_themeset();
132+ SerializedSyntaxSet::FromBinary(get_serialized_integrated_syntaxset()),
112−
133+ get_integrated_themeset(),
113− HighlightingAssets {
134+ )
114− syntax_set,
115− theme_set,
116− fallback_theme: None,
117− }
118 }
135 }
119
136
120− pub fn save_to_cache(&self, target_dir: &Path, current_version: &str) -> Result<()> {
137+ pub fn set_fallback_theme(&mut self, theme: &'static str) {
121− let _ = fs::create_dir_all(target_dir);
138+ self.fallback_theme = Some(theme);
122− let theme_set_path = target_dir.join("themes.bin");
139+ }
123− let syntax_set_path = target_dir.join("syntaxes.bin");
124
140
125− print!(
141+ /// Return the collection of syntect syntax definitions.
126− "Writing theme set to {} ... ",
142+ pub fn get_syntax_set(&self) -> Result<&SyntaxSet> {
127− theme_set_path.to_string_lossy()
143+ self.syntax_set_cell
128− );
144+ .get_or_try_init(|| self.serialized_syntax_set.deserialize())
129− dump_to_file(&self.theme_set, &theme_set_path).chain_err(|| {
145+ }
130− format!(
131− "Could not save theme set to {}",
132− theme_set_path.to_string_lossy()
133− )
134− })?;
135− println!("okay");
136
146
137− print!(
147+ /// Use [Self::get_syntaxes] instead
138− "Writing syntax set to {} ... ",
148+ #[deprecated]
139− syntax_set_path.to_string_lossy()
149+ pub fn syntaxes(&self) -> &[SyntaxReference] {
140− );
150+ self.get_syntax_set()
141− dump_to_file(&self.syntax_set, &syntax_set_path).chain_err(|| {
151+ .expect(".syntaxes() is deprecated, use .get_syntaxes() instead")
142− format!(
152+ .syntaxes()
143− "Could not save syntax set to {}",
153+ }
144− syntax_set_path.to_string_lossy()
145− )
146− })?;
147− println!("okay");
148
154
149− print!(
155+ pub fn get_syntaxes(&self) -> Result<&[SyntaxReference]> {
150− "Writing metadata to folder {} ... ",
156+ Ok(self.get_syntax_set()?.syntaxes())
151− target_dir.to_string_lossy()
157+ }
152− );
153− AssetsMetadata::new(current_version).save_to_folder(target_dir)?;
154− println!("okay");
155
158
156− Ok(())
159+ fn get_theme_set(&self) -> &LazyThemeSet {
160+ &self.theme_set
157 }
161 }
158
162
159− pub fn set_fallback_theme(&mut self, theme: &'static str) {
163+ pub fn themes(&self) -> impl Iterator<Item = &str> {
160− self.fallback_theme = Some(theme);
164+ self.get_theme_set().themes()
161 }
165 }
162
166
163− pub fn syntaxes(&self) -> &[SyntaxReference] {
167+ /// Use [Self::get_syntax_for_path] instead
164− self.syntax_set.syntaxes()
168+ #[deprecated]
169+ pub fn syntax_for_file_name(
170+ &self,
171+ file_name: impl AsRef<Path>,
172+ mapping: &SyntaxMapping,
173+ ) -> Option<&SyntaxReference> {
174+ self.get_syntax_for_path(file_name, mapping)
175+ .ok()
176+ .map(|syntax_in_set| syntax_in_set.syntax)
165 }
177 }
166
178
167− pub fn themes(&self) -> impl Iterator<Item = &str> {
179+ /// Detect the syntax based on, in order:
168− self.theme_set.themes.keys().map(|s| s.as_ref())
180+ /// 1. Syntax mappings with [MappingTarget::MapTo] and [MappingTarget::MapToUnknown]
181+ /// (e.g. `/etc/profile` -> `Bourne Again Shell (bash)`)
182+ /// 2. The file name (e.g. `Dockerfile`)
183+ /// 3. Syntax mappings with [MappingTarget::MapExtensionToUnknown]
184+ /// (e.g. `*.conf`)
185+ /// 4. The file name extension (e.g. `.rs`)
186+ ///
187+ /// When detecting syntax based on syntax mappings, the full path is taken
188+ /// into account. When detecting syntax based on file name, no regard is
189+ /// taken to the path of the file. Only the file name itself matters. When
190+ /// detecting syntax based on file name extension, only the file name
191+ /// extension itself matters.
192+ ///
193+ /// Returns [Error::UndetectedSyntax] if it was not possible detect syntax
194+ /// based on path/file name/extension (or if the path was mapped to
195+ /// [MappingTarget::MapToUnknown] or [MappingTarget::MapExtensionToUnknown]).
196+ /// In this case it is appropriate to fall back to other methods to detect
197+ /// syntax. Such as using the contents of the first line of the file.
198+ ///
199+ /// Returns [Error::UnknownSyntax] if a syntax mapping exist, but the mapped
200+ /// syntax does not exist.
201+ pub fn get_syntax_for_path(
202+ &self,
203+ path: impl AsRef<Path>,
204+ mapping: &SyntaxMapping,
205+ ) -> Result<SyntaxReferenceInSet> {
206+ let path = path.as_ref();
207+
208+ let syntax_match = mapping.get_syntax_for(path);
209+
210+ if let Some(MappingTarget::MapToUnknown) = syntax_match {
211+ return Err(Error::UndetectedSyntax(path.to_string_lossy().into()));
212+ }
213+
214+ if let Some(MappingTarget::MapTo(syntax_name)) = syntax_match {
215+ return self
216+ .find_syntax_by_name(syntax_name)?
217+ .ok_or_else(|| Error::UnknownSyntax(syntax_name.to_owned()));
218+ }
219+
220+ let file_name = path.file_name().unwrap_or_default();
221+
222+ match (
223+ self.get_syntax_for_file_name(file_name, &mapping.ignored_suffixes)?,
224+ syntax_match,
225+ ) {
226+ (Some(syntax), _) => Ok(syntax),
227+
228+ (_, Some(MappingTarget::MapExtensionToUnknown)) => {
229+ Err(Error::UndetectedSyntax(path.to_string_lossy().into()))
230+ }
231+
232+ _ => self
233+ .get_syntax_for_file_extension(file_name, &mapping.ignored_suffixes)?
234+ .ok_or_else(|| Error::UndetectedSyntax(path.to_string_lossy().into())),
235+ }
169 }
236 }
170
237
171− pub(crate) fn get_theme(&self, theme: &str) -> &Theme {
238+ /// Look up a syntect theme by name.
172− match self.theme_set.themes.get(theme) {
239+ pub fn get_theme(&self, theme: &str) -> &Theme {
240+ match self.get_theme_set().get(theme) {
173 Some(theme) => theme,
241 Some(theme) => theme,
174 None => {
242 None => {
175− if theme != "" {
243+ if theme == "ansi-light" || theme == "ansi-dark" {
176− use ansi_term::Colour::Yellow;
244+ bat_warning!("Theme '{}' is deprecated, using 'ansi' instead.", theme);
177− eprintln!(
245+ return self.get_theme("ansi");
178− "{}: Unknown theme '{}', using default.",
246+ }
179− Yellow.paint("[bat warning]"),
247+ if !theme.is_empty() {
180− theme
248+ bat_warning!("Unknown theme '{}', using default.", theme)
181− );
182 }
249 }
183− &self.theme_set.themes[self.fallback_theme.unwrap_or_else(|| Self::default_theme())]
250+ self.get_theme_set()
251+ .get(self.fallback_theme.unwrap_or_else(Self::default_theme))
252+ .expect("something is very wrong if the default theme is missing")
184 }
253 }
185 }
254 }
186 }
255 }
@@ -190,70 +259,153 @@ impl HighlightingAssets {
190 language: Option<&str>,
259 language: Option<&str>,
191 input: &mut OpenedInput,
260 input: &mut OpenedInput,
192 mapping: &SyntaxMapping,
261 mapping: &SyntaxMapping,
193− ) -> &SyntaxReference {
262+ ) -> Result<SyntaxReferenceInSet> {
194− let syntax = if input.kind.is_theme_preview_file() {
263+ if let Some(language) = language {
195− self.syntax_set.find_syntax_by_name("Rust")
264+ let syntax_set = self.get_syntax_set()?;
196− } else if let Some(language) = language {
265+ return syntax_set
197− self.syntax_set.find_syntax_by_token(language)
266+ .find_syntax_by_token(language)
267+ .map(|syntax| SyntaxReferenceInSet { syntax, syntax_set })
268+ .ok_or_else(|| Error::UnknownSyntax(language.to_owned()));
269+ }
270+
271+ let path = input.path();
272+ let path_syntax = if let Some(path) = path {
273+ self.get_syntax_for_path(
274+ PathAbs::new(path).map_or_else(|_| path.to_owned(), |p| p.as_path().to_path_buf()),
275+ mapping,
276+ )
198 } else {
277 } else {
199− let line_syntax = self.get_first_line_syntax(&mut input.reader);
278+ Err(Error::UndetectedSyntax("[unknown]".into()))
200−
201− // Get the path of the file:
202− // If this was set by the metadata, that will take priority.
203− // If it wasn't, it will use the real file path (if available).
204− let path_str =
205− input
206− .metadata
207− .user_provided_name
208− .as_ref()
209− .or_else(|| match input.kind {
210− OpenedInputKind::OrdinaryFile(ref path) => Some(path),
211− _ => None,
212− });
213−
214− if let Some(path_str) = path_str {
215− // If a path was provided, we try and detect the syntax based on extension mappings.
216− let path = Path::new(path_str);
217− let absolute_path = path.canonicalize().ok().unwrap_or_else(|| path.to_owned());
218−
219− match mapping.get_syntax_for(absolute_path) {
220− Some(MappingTarget::MapToUnknown) => line_syntax,
221− Some(MappingTarget::MapTo(syntax_name)) => {
222− // TODO: we should probably return an error here if this syntax can not be
223− // found. Currently, we just fall back to 'plain'.
224− self.syntax_set.find_syntax_by_name(syntax_name)
225− }
226− None => {
227− let file_name = path.file_name().unwrap_or_default();
228− self.get_extension_syntax(file_name).or(line_syntax)
229− }
230− }
231− } else {
232− // If a path wasn't provided, we fall back to the detect first-line syntax.
233− line_syntax
234− }
235 };
279 };
236
280
237− syntax.unwrap_or_else(|| self.syntax_set.find_syntax_plain_text())
281+ match path_syntax {
282+ // If a path wasn't provided, or if path based syntax detection
283+ // above failed, we fall back to first-line syntax detection.
284+ Err(Error::UndetectedSyntax(path)) => self
285+ .get_first_line_syntax(&mut input.reader)?
286+ .ok_or(Error::UndetectedSyntax(path)),
287+ _ => path_syntax,
288+ }
238 }
289 }
239
290
240− fn get_extension_syntax(&self, file_name: &OsStr) -> Option<&SyntaxReference> {
291+ pub(crate) fn find_syntax_by_name(
241− self.syntax_set
292+ &self,
242− .find_syntax_by_extension(file_name.to_str().unwrap_or_default())
293+ syntax_name: &str,
243− .or_else(|| {
294+ ) -> Result<Option<SyntaxReferenceInSet>> {
244− self.syntax_set.find_syntax_by_extension(
295+ let syntax_set = self.get_syntax_set()?;
245− Path::new(file_name)
296+ Ok(syntax_set
246− .extension()
297+ .find_syntax_by_name(syntax_name)
247− .and_then(|x| x.to_str())
298+ .map(|syntax| SyntaxReferenceInSet { syntax, syntax_set }))
248− .unwrap_or_default(),
299+ }
249− )
300+
250− })
301+ fn find_syntax_by_extension(&self, e: Option<&OsStr>) -> Result<Option<SyntaxReferenceInSet>> {
302+ let syntax_set = self.get_syntax_set()?;
303+ let extension = e.and_then(|x| x.to_str()).unwrap_or_default();
304+ Ok(syntax_set
305+ .find_syntax_by_extension(extension)
306+ .map(|syntax| SyntaxReferenceInSet { syntax, syntax_set }))
307+ }
308+
309+ fn get_syntax_for_file_name(
310+ &self,
311+ file_name: &OsStr,
312+ ignored_suffixes: &IgnoredSuffixes,
313+ ) -> Result<Option<SyntaxReferenceInSet>> {
314+ let mut syntax = self.find_syntax_by_extension(Some(file_name))?;
315+ if syntax.is_none() {
316+ syntax =
317+ ignored_suffixes.try_with_stripped_suffix(file_name, |stripped_file_name| {
318+ // Note: recursion
319+ self.get_syntax_for_file_name(stripped_file_name, ignored_suffixes)
320+ })?;
321+ }
322+ Ok(syntax)
323+ }
324+
325+ fn get_syntax_for_file_extension(
326+ &self,
327+ file_name: &OsStr,
328+ ignored_suffixes: &IgnoredSuffixes,
329+ ) -> Result<Option<SyntaxReferenceInSet>> {
330+ let mut syntax = self.find_syntax_by_extension(Path::new(file_name).extension())?;
331+ if syntax.is_none() {
332+ syntax =
333+ ignored_suffixes.try_with_stripped_suffix(file_name, |stripped_file_name| {
334+ // Note: recursion
335+ self.get_syntax_for_file_extension(stripped_file_name, ignored_suffixes)
336+ })?;
337+ }
338+ Ok(syntax)
251 }
339 }
252
340
253− fn get_first_line_syntax(&self, reader: &mut InputReader) -> Option<&SyntaxReference> {
341+ fn get_first_line_syntax(
254− String::from_utf8(reader.first_line.clone())
342+ &self,
343+ reader: &mut InputReader,
344+ ) -> Result<Option<SyntaxReferenceInSet>> {
345+ let syntax_set = self.get_syntax_set()?;
346+ Ok(String::from_utf8(reader.first_line.clone())
255 .ok()
347 .ok()
256− .and_then(|l| self.syntax_set.find_syntax_by_first_line(&l))
348+ .and_then(|l| syntax_set.find_syntax_by_first_line(&l))
349+ .map(|syntax| SyntaxReferenceInSet { syntax, syntax_set }))
350+ }
351+}
352+
353+pub(crate) fn get_serialized_integrated_syntaxset() -> &'static [u8] {
354+ include_bytes!("../assets/syntaxes.bin")
355+}
356+
357+pub(crate) fn get_integrated_themeset() -> LazyThemeSet {
358+ from_binary(include_bytes!("../assets/themes.bin"), COMPRESS_THEMES)
359+}
360+
361+pub fn get_acknowledgements() -> String {
362+ from_binary(
363+ include_bytes!("../assets/acknowledgements.bin"),
364+ COMPRESS_ACKNOWLEDGEMENTS,
365+ )
366+}
367+
368+pub(crate) fn from_binary<T: serde::de::DeserializeOwned>(v: &[u8], compressed: bool) -> T {
369+ asset_from_contents(v, "n/a", compressed)
370+ .expect("data integrated in binary is never faulty, but make sure `compressed` is in sync!")
371+}
372+
373+fn asset_from_contents<T: serde::de::DeserializeOwned>(
374+ contents: &[u8],
375+ description: &str,
376+ compressed: bool,
377+) -> Result<T> {
378+ if compressed {
379+ bincode::deserialize_from(flate2::read::ZlibDecoder::new(contents))
380+ } else {
381+ bincode::deserialize_from(contents)
382+ }
383+ .map_err(|_| format!("Could not parse {}", description).into())
384+}
385+
386+fn asset_from_cache<T: serde::de::DeserializeOwned>(
387+ path: &Path,
388+ description: &str,
389+ compressed: bool,
390+) -> Result<T> {
391+ let contents = fs::read(path).map_err(|_| {
392+ format!(
393+ "Could not load cached {} '{}'",
394+ description,
395+ path.to_string_lossy()
396+ )
397+ })?;
398+ asset_from_contents(&contents[..], description, compressed)
399+ .map_err(|_| format!("Could not parse cached {}", description).into())
400+}
401+
402+#[cfg(target_os = "macos")]
403+fn macos_dark_mode_active() -> bool {
404+ let mut defaults_cmd = std::process::Command::new("defaults");
405+ defaults_cmd.args(&["read", "-globalDomain", "AppleInterfaceStyle"]);
406+ match defaults_cmd.output() {
407+ Ok(output) => output.stdout == b"Dark\n",
408+ Err(_) => true,
257 }
409 }
258}
410}
259
411
@@ -264,15 +416,15 @@ mod tests {
264 use std::ffi::OsStr;
416 use std::ffi::OsStr;
265
417
266 use std::fs::File;
418 use std::fs::File;
267− use std::io::Write;
419+ use std::io::{BufReader, Write};
268− use tempdir::TempDir;
420+ use tempfile::TempDir;
269
421
270 use crate::input::Input;
422 use crate::input::Input;
271
423
272 struct SyntaxDetectionTest<'a> {
424 struct SyntaxDetectionTest<'a> {
273 assets: HighlightingAssets,
425 assets: HighlightingAssets,
274 pub syntax_mapping: SyntaxMapping<'a>,
426 pub syntax_mapping: SyntaxMapping<'a>,
275− temp_dir: TempDir,
427+ pub temp_dir: TempDir,
276 }
428 }
277
429
278 impl<'a> SyntaxDetectionTest<'a> {
430 impl<'a> SyntaxDetectionTest<'a> {
@@ -280,11 +432,22 @@ mod tests {
280 SyntaxDetectionTest {
432 SyntaxDetectionTest {
281 assets: HighlightingAssets::from_binary(),
433 assets: HighlightingAssets::from_binary(),
282 syntax_mapping: SyntaxMapping::builtin(),
434 syntax_mapping: SyntaxMapping::builtin(),
283− temp_dir: TempDir::new("bat_syntax_detection_tests")
435+ temp_dir: TempDir::new().expect("creation of temporary directory"),
284− .expect("creation of temporary directory"),
285 }
436 }
286 }
437 }
287
438
439+ fn get_syntax_name(
440+ &self,
441+ language: Option<&str>,
442+ input: &mut OpenedInput,
443+ mapping: &SyntaxMapping,
444+ ) -> String {
445+ self.assets
446+ .get_syntax(language, input, mapping)
447+ .map(|syntax_in_set| syntax_in_set.syntax.name.clone())
448+ .unwrap_or_else(|_| "!no syntax!".to_owned())
449+ }
450+
288 fn syntax_for_real_file_with_content_os(
451 fn syntax_for_real_file_with_content_os(
289 &self,
452 &self,
290 file_name: &OsStr,
453 file_name: &OsStr,
@@ -296,29 +459,24 @@ mod tests {
296 writeln!(temp_file, "{}", first_line).unwrap();
459 writeln!(temp_file, "{}", first_line).unwrap();
297 }
460 }
298
461
299− let input = Input::ordinary_file(file_path.as_os_str());
462+ let input = Input::ordinary_file(&file_path);
300 let dummy_stdin: &[u8] = &[];
463 let dummy_stdin: &[u8] = &[];
301− let mut opened_input = input.open(dummy_stdin).unwrap();
464+ let mut opened_input = input.open(dummy_stdin, None).unwrap();
302− let syntax = self
303− .assets
304− .get_syntax(None, &mut opened_input, &self.syntax_mapping);
305
465
306− syntax.name.clone()
466+ self.get_syntax_name(None, &mut opened_input, &self.syntax_mapping)
307 }
467 }
308
468
309 fn syntax_for_file_with_content_os(&self, file_name: &OsStr, first_line: &str) -> String {
469 fn syntax_for_file_with_content_os(&self, file_name: &OsStr, first_line: &str) -> String {
310 let file_path = self.temp_dir.path().join(file_name);
470 let file_path = self.temp_dir.path().join(file_name);
311 let input = Input::from_reader(Box::new(BufReader::new(first_line.as_bytes())))
471 let input = Input::from_reader(Box::new(BufReader::new(first_line.as_bytes())))
312− .with_name(Some(file_path.as_os_str()));
472+ .with_name(Some(&file_path));
313 let dummy_stdin: &[u8] = &[];
473 let dummy_stdin: &[u8] = &[];
314− let mut opened_input = input.open(dummy_stdin).unwrap();
474+ let mut opened_input = input.open(dummy_stdin, None).unwrap();
315− let syntax = self
316− .assets
317− .get_syntax(None, &mut opened_input, &self.syntax_mapping);
318
475
319− syntax.name.clone()
476+ self.get_syntax_name(None, &mut opened_input, &self.syntax_mapping)
320 }
477 }
321
478
479+ #[cfg(unix)]
322 fn syntax_for_file_os(&self, file_name: &OsStr) -> String {
480 fn syntax_for_file_os(&self, file_name: &OsStr) -> String {
323 self.syntax_for_file_with_content_os(file_name, "")
481 self.syntax_for_file_with_content_os(file_name, "")
324 }
482 }
@@ -332,13 +490,10 @@ mod tests {
332 }
490 }
333
491
334 fn syntax_for_stdin_with_content(&self, file_name: &str, content: &[u8]) -> String {
492 fn syntax_for_stdin_with_content(&self, file_name: &str, content: &[u8]) -> String {
335− let input = Input::stdin().with_name(Some(OsStr::new(file_name)));
493+ let input = Input::stdin().with_name(Some(file_name));
336− let mut opened_input = input.open(content).unwrap();
494+ let mut opened_input = input.open(content, None).unwrap();
337
495
338− let syntax = self
496+ self.get_syntax_name(None, &mut opened_input, &self.syntax_mapping)
339− .assets
340− .get_syntax(None, &mut opened_input, &self.syntax_mapping);
341− syntax.name.clone()
342 }
497 }
343
498
344 fn syntax_is_same_for_inputkinds(&self, file_name: &str, content: &str) -> bool {
499 fn syntax_is_same_for_inputkinds(&self, file_name: &str, content: &str) -> bool {
@@ -413,8 +568,9 @@ mod tests {
413
568
414 assert_eq!(test.syntax_for_file("test.h"), "C++");
569 assert_eq!(test.syntax_for_file("test.h"), "C++");
415 assert_eq!(test.syntax_for_file("test.sass"), "Sass");
570 assert_eq!(test.syntax_for_file("test.sass"), "Sass");
416− assert_eq!(test.syntax_for_file("test.hs"), "Haskell (improved)");
417 assert_eq!(test.syntax_for_file("test.js"), "JavaScript (Babel)");
571 assert_eq!(test.syntax_for_file("test.js"), "JavaScript (Babel)");
572+ assert_eq!(test.syntax_for_file("test.fs"), "F#");
573+ assert_eq!(test.syntax_for_file("test.v"), "Verilog");
418 }
574 }
419
575
420 #[test]
576 #[test]
@@ -447,13 +603,58 @@ mod tests {
447 }
603 }
448
604
449 #[test]
605 #[test]
450− fn syntax_detection_is_case_sensitive() {
606+ fn syntax_detection_with_extension_mapping_to_unknown() {
607+ let mut test = SyntaxDetectionTest::new();
608+
609+ // Normally, a CMakeLists.txt file shall use the CMake syntax, even if it is
610+ // a bash script in disguise
611+ assert_eq!(
612+ test.syntax_for_file_with_content("CMakeLists.txt", "#!/bin/bash"),
613+ "CMake"
614+ );
615+
616+ // Other .txt files shall use the Plain Text syntax
617+ assert_eq!(
618+ test.syntax_for_file_with_content("some-other.txt", "#!/bin/bash"),
619+ "Plain Text"
620+ );
621+
622+ // If we setup MapExtensionToUnknown on *.txt, the match on the full
623+ // file name of "CMakeLists.txt" shall have higher prio, and CMake shall
624+ // still be used for it
625+ test.syntax_mapping
626+ .insert("*.txt", MappingTarget::MapExtensionToUnknown)
627+ .ok();
628+ assert_eq!(
629+ test.syntax_for_file_with_content("CMakeLists.txt", "#!/bin/bash"),
630+ "CMake"
631+ );
632+
633+ // However, for *other* files with a .txt extension, first-line fallback
634+ // shall now be used
635+ assert_eq!(
636+ test.syntax_for_file_with_content("some-other.txt", "#!/bin/bash"),
637+ "Bourne Again Shell (bash)"
638+ );
639+ }
640+
641+ #[test]
642+ fn syntax_detection_is_case_insensitive() {
451 let mut test = SyntaxDetectionTest::new();
643 let mut test = SyntaxDetectionTest::new();
452
644
453− assert_ne!(test.syntax_for_file("README.MD"), "Markdown");
645+ assert_eq!(test.syntax_for_file("README.md"), "Markdown");
646+ assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
647+ assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
648+ assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
649+
650+ // Adding a mapping for "MD" in addition to "md" should not break the mapping
454 test.syntax_mapping
651 test.syntax_mapping
455 .insert("*.MD", MappingTarget::MapTo("Markdown"))
652 .insert("*.MD", MappingTarget::MapTo("Markdown"))
456 .ok();
653 .ok();
654+
655+ assert_eq!(test.syntax_for_file("README.md"), "Markdown");
656+ assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
657+ assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
457 assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
658 assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
458 }
659 }
459
660
@@ -469,4 +670,30 @@ mod tests {
469 "Bourne Again Shell (bash)"
670 "Bourne Again Shell (bash)"
470 );
671 );
471 }
672 }
673+
674+ #[cfg(unix)]
675+ #[test]
676+ fn syntax_detection_for_symlinked_file() {
677+ use std::os::unix::fs::symlink;
678+
679+ let test = SyntaxDetectionTest::new();
680+ let file_path = test.temp_dir.path().join("my_ssh_config_filename");
681+ {
682+ File::create(&file_path).unwrap();
683+ }
684+ let file_path_symlink = test.temp_dir.path().join(".ssh").join("config");
685+
686+ std::fs::create_dir(test.temp_dir.path().join(".ssh"))
687+ .expect("creation of directory succeeds");
688+ symlink(&file_path, &file_path_symlink).expect("creation of symbolic link succeeds");
689+
690+ let input = Input::ordinary_file(&file_path_symlink);
691+ let dummy_stdin: &[u8] = &[];
692+ let mut opened_input = input.open(dummy_stdin, None).unwrap();
693+
694+ assert_eq!(
695+ test.get_syntax_name(None, &mut opened_input, &test.syntax_mapping),
696+ "SSH Config"
697+ );
698+ }
472}
699}
src/assets_metadata.rs → src/assets/assets_metadata.rsrenamed+10−9
@@ -16,6 +16,7 @@ pub struct AssetsMetadata {
16const FILENAME: &str = "metadata.yaml";
16const FILENAME: &str = "metadata.yaml";
17
17
18impl AssetsMetadata {
18impl AssetsMetadata {
19+ #[cfg(feature = "build-assets")]
19 pub(crate) fn new(current_version: &str) -> AssetsMetadata {
20 pub(crate) fn new(current_version: &str) -> AssetsMetadata {
20 AssetsMetadata {
21 AssetsMetadata {
21 bat_version: Some(current_version.to_owned()),
22 bat_version: Some(current_version.to_owned()),
@@ -23,6 +24,7 @@ impl AssetsMetadata {
23 }
24 }
24 }
25 }
25
26
27+ #[cfg(feature = "build-assets")]
26 pub(crate) fn save_to_folder(&self, path: &Path) -> Result<()> {
28 pub(crate) fn save_to_folder(&self, path: &Path) -> Result<()> {
27 let file = File::create(path.join(FILENAME))?;
29 let file = File::create(path.join(FILENAME))?;
28 serde_yaml::to_writer(file, self)?;
30 serde_yaml::to_writer(file, self)?;
@@ -50,16 +52,15 @@ impl AssetsMetadata {
50 pub fn load_from_folder(path: &Path) -> Result<Option<Self>> {
52 pub fn load_from_folder(path: &Path) -> Result<Option<Self>> {
51 match Self::try_load_from_folder(path) {
53 match Self::try_load_from_folder(path) {
52 Ok(metadata) => Ok(Some(metadata)),
54 Ok(metadata) => Ok(Some(metadata)),
53− Err(e) => match e.kind() {
55+ Err(e) => {
54− ErrorKind::SerdeYamlError(_) => Err(e),
56+ if let Error::SerdeYamlError(_) = e {
55− _ => {
57+ Err(e)
56− if path.join("syntaxes.bin").exists() || path.join("themes.bin").exists() {
58+ } else if path.join("syntaxes.bin").exists() || path.join("themes.bin").exists() {
57− Ok(Some(Self::default()))
59+ Ok(Some(Self::default()))
58− } else {
60+ } else {
59− Ok(None)
61+ Ok(None)
60− }
61 }
62 }
62− },
63+ }
63 }
64 }
64 }
65 }
65
66
src/assets/build_assets.rsnew file+176
@@ -0,0 +1,176 @@
1+use std::convert::TryInto;
2+use std::path::Path;
3+
4+use syntect::highlighting::ThemeSet;
5+use syntect::parsing::{SyntaxSet, SyntaxSetBuilder};
6+
7+use crate::assets::*;
8+use acknowledgements::build_acknowledgements;
9+
10+mod acknowledgements;
11+
12+pub fn build(
13+ source_dir: &Path,
14+ include_integrated_assets: bool,
15+ include_acknowledgements: bool,
16+ target_dir: &Path,
17+ current_version: &str,
18+) -> Result<()> {
19+ let theme_set = build_theme_set(source_dir, include_integrated_assets)?;
20+
21+ let syntax_set_builder = build_syntax_set_builder(source_dir, include_integrated_assets)?;
22+
23+ let syntax_set = syntax_set_builder.build();
24+
25+ let acknowledgements = build_acknowledgements(source_dir, include_acknowledgements)?;
26+
27+ print_unlinked_contexts(&syntax_set);
28+
29+ write_assets(
30+ &theme_set,
31+ &syntax_set,
32+ &acknowledgements,
33+ target_dir,
34+ current_version,
35+ )
36+}
37+
38+fn build_theme_set(source_dir: &Path, include_integrated_assets: bool) -> Result<LazyThemeSet> {
39+ let mut theme_set = if include_integrated_assets {
40+ crate::assets::get_integrated_themeset().try_into()?
41+ } else {
42+ ThemeSet::new()
43+ };
44+
45+ let theme_dir = source_dir.join("themes");
46+ if theme_dir.exists() {
47+ let res = theme_set.add_from_folder(&theme_dir);
48+ if let Err(err) = res {
49+ println!(
50+ "Failed to load one or more themes from '{}' (reason: '{}')",
51+ theme_dir.to_string_lossy(),
52+ err,
53+ );
54+ }
55+ } else {
56+ println!(
57+ "No themes were found in '{}', using the default set",
58+ theme_dir.to_string_lossy()
59+ );
60+ }
61+
62+ theme_set.try_into()
63+}
64+
65+fn build_syntax_set_builder(
66+ source_dir: &Path,
67+ include_integrated_assets: bool,
68+) -> Result<SyntaxSetBuilder> {
69+ let mut syntax_set_builder = if !include_integrated_assets {
70+ let mut builder = syntect::parsing::SyntaxSetBuilder::new();
71+ builder.add_plain_text_syntax();
72+ builder
73+ } else {
74+ from_binary::<SyntaxSet>(get_serialized_integrated_syntaxset(), COMPRESS_SYNTAXES)
75+ .into_builder()
76+ };
77+
78+ let syntax_dir = source_dir.join("syntaxes");
79+ if syntax_dir.exists() {
80+ syntax_set_builder.add_from_folder(syntax_dir, true)?;
81+ } else {
82+ println!(
83+ "No syntaxes were found in '{}', using the default set.",
84+ syntax_dir.to_string_lossy()
85+ );
86+ }
87+
88+ Ok(syntax_set_builder)
89+}
90+
91+fn print_unlinked_contexts(syntax_set: &SyntaxSet) {
92+ let missing_contexts = syntax_set.find_unlinked_contexts();
93+ if !missing_contexts.is_empty() {
94+ println!("Some referenced contexts could not be found!");
95+ for context in missing_contexts {
96+ println!("- {}", context);
97+ }
98+ }
99+}
100+
101+fn write_assets(
102+ theme_set: &LazyThemeSet,
103+ syntax_set: &SyntaxSet,
104+ acknowledgements: &Option<String>,
105+ target_dir: &Path,
106+ current_version: &str,
107+) -> Result<()> {
108+ let _ = std::fs::create_dir_all(target_dir);
109+ asset_to_cache(
110+ theme_set,
111+ &target_dir.join("themes.bin"),
112+ "theme set",
113+ COMPRESS_THEMES,
114+ )?;
115+ asset_to_cache(
116+ syntax_set,
117+ &target_dir.join("syntaxes.bin"),
118+ "syntax set",
119+ COMPRESS_SYNTAXES,
120+ )?;
121+
122+ if let Some(acknowledgements) = acknowledgements {
123+ asset_to_cache(
124+ acknowledgements,
125+ &target_dir.join("acknowledgements.bin"),
126+ "acknowledgements",
127+ COMPRESS_ACKNOWLEDGEMENTS,
128+ )?;
129+ }
130+
131+ print!(
132+ "Writing metadata to folder {} ... ",
133+ target_dir.to_string_lossy()
134+ );
135+ crate::assets_metadata::AssetsMetadata::new(current_version).save_to_folder(target_dir)?;
136+ println!("okay");
137+
138+ Ok(())
139+}
140+
141+pub(crate) fn asset_to_contents<T: serde::Serialize>(
142+ asset: &T,
143+ description: &str,
144+ compressed: bool,
145+) -> Result<Vec<u8>> {
146+ let mut contents = vec![];
147+ if compressed {
148+ bincode::serialize_into(
149+ flate2::write::ZlibEncoder::new(&mut contents, flate2::Compression::best()),
150+ asset,
151+ )
152+ } else {
153+ bincode::serialize_into(&mut contents, asset)
154+ }
155+ .map_err(|_| format!("Could not serialize {}", description))?;
156+ Ok(contents)
157+}
158+
159+fn asset_to_cache<T: serde::Serialize>(
160+ asset: &T,
161+ path: &Path,
162+ description: &str,
163+ compressed: bool,
164+) -> Result<()> {
165+ print!("Writing {} to {} ... ", description, path.to_string_lossy());
166+ let contents = asset_to_contents(asset, description, compressed)?;
167+ std::fs::write(path, &contents[..]).map_err(|_| {
168+ format!(
169+ "Could not save {} to {}",
170+ description,
171+ path.to_string_lossy()
172+ )
173+ })?;
174+ println!("okay");
175+ Ok(())
176+}
src/assets/build_assets/acknowledgements.rsnew file+222
@@ -0,0 +1,222 @@
1+use std::fs::read_to_string;
2+use std::path::{Path, PathBuf};
3+
4+use walkdir::DirEntry;
5+
6+use crate::error::*;
7+
8+struct PathAndStem {
9+ path: PathBuf,
10+ stem: String,
11+ relative_path: String,
12+}
13+
14+/// Looks for LICENSE and NOTICE files in `source_dir`, does some rudimentary
15+/// analysis, and compiles them together in a single string that is meant to be
16+/// used in the output to `--acknowledgements`
17+pub fn build_acknowledgements(
18+ source_dir: &Path,
19+ include_acknowledgements: bool,
20+) -> Result<Option<String>> {
21+ if !include_acknowledgements {
22+ return Ok(None);
23+ }
24+
25+ let mut acknowledgements = format!("{}\n\n", include_str!("../../../NOTICE"));
26+
27+ // Sort entries so the order is stable over time
28+ let entries = walkdir::WalkDir::new(source_dir).sort_by(|a, b| a.path().cmp(b.path()));
29+ for path_and_stem in entries
30+ .into_iter()
31+ .flatten()
32+ .flat_map(|entry| to_path_and_stem(source_dir, entry))
33+ {
34+ if let Some(license_text) = handle_file(&path_and_stem)? {
35+ append_to_acknowledgements(
36+ &mut acknowledgements,
37+ &path_and_stem.relative_path,
38+ &license_text,
39+ )
40+ }
41+ }
42+
43+ Ok(Some(acknowledgements))
44+}
45+
46+fn to_path_and_stem(source_dir: &Path, entry: DirEntry) -> Option<PathAndStem> {
47+ let path = entry.path();
48+
49+ Some(PathAndStem {
50+ path: path.to_owned(),
51+ stem: path.file_stem().map(|s| s.to_string_lossy().to_string())?,
52+ relative_path: path
53+ .strip_prefix(source_dir)
54+ .map(|p| p.to_string_lossy().to_string())
55+ .ok()?,
56+ })
57+}
58+
59+fn handle_file(path_and_stem: &PathAndStem) -> Result<Option<String>> {
60+ if path_and_stem.stem == "NOTICE" {
61+ handle_notice(&path_and_stem.path)
62+ } else if path_and_stem.stem.to_ascii_uppercase() == "LICENSE" {
63+ handle_license(&path_and_stem.path)
64+ } else {
65+ Ok(None)
66+ }
67+}
68+
69+fn handle_notice(path: &Path) -> Result<Option<String>> {
70+ // Assume NOTICE as defined by Apache License 2.0. These must be part of acknowledgements.
71+ Ok(Some(read_to_string(path)?))
72+}
73+
74+fn handle_license(path: &Path) -> Result<Option<String>> {
75+ let license_text = read_to_string(path)?;
76+
77+ if include_license_in_acknowledgments(&license_text) {
78+ Ok(Some(license_text))
79+ } else if license_not_needed_in_acknowledgements(&license_text) {
80+ Ok(None)
81+ } else {
82+ Err(format!("ERROR: License is of unknown type: {:?}", path).into())
83+ }
84+}
85+
86+fn include_license_in_acknowledgments(license_text: &str) -> bool {
87+ let markers = vec![
88+ // MIT
89+ "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
90+
91+ // BSD
92+ "Redistributions in binary form must reproduce the above copyright notice,",
93+
94+ // Apache 2.0
95+ "Apache License Version 2.0, January 2004 http://www.apache.org/licenses/",
96+ "Licensed under the Apache License, Version 2.0 (the \"License\");",
97+ ];
98+
99+ license_contains_marker(license_text, &markers)
100+}
101+
102+fn license_not_needed_in_acknowledgements(license_text: &str) -> bool {
103+ let markers = vec![
104+ // Public domain
105+ "This is free and unencumbered software released into the public domain.",
106+
107+ // Public domain with stronger wording than above
108+ "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE",
109+
110+ // Special license of assets/syntaxes/01_Packages/LICENSE
111+ "Permission to copy, use, modify, sell and distribute this software is granted. This software is provided \"as is\" without express or implied warranty, and with no claim as to its suitability for any purpose."
112+ ];
113+
114+ license_contains_marker(license_text, &markers)
115+}
116+
117+fn license_contains_marker(license_text: &str, markers: &[&str]) -> bool {
118+ let normalized_license_text = normalize_license_text(license_text);
119+ markers.iter().any(|m| normalized_license_text.contains(m))
120+}
121+
122+fn append_to_acknowledgements(
123+ acknowledgements: &mut String,
124+ relative_path: &str,
125+ license_text: &str,
126+) {
127+ acknowledgements.push_str(&format!("## {}\n\n{}", relative_path, license_text));
128+
129+ // Make sure the last char is a newline to not mess up formatting later
130+ if acknowledgements
131+ .chars()
132+ .last()
133+ .expect("acknowledgements is not the empty string")
134+ != '\n'
135+ {
136+ acknowledgements.push('\n');
137+ }
138+
139+ // Add two more newlines to make it easy to distinguish where this text ends
140+ // and the next starts
141+ acknowledgements.push_str("\n\n");
142+}
143+
144+/// Replaces newlines with a space character, and replaces multiple spaces with one space.
145+/// This makes the text easier to analyze.
146+fn normalize_license_text(license_text: &str) -> String {
147+ use regex::Regex;
148+
149+ let whitespace_and_newlines = Regex::new(r"\s").unwrap();
150+ let as_single_line = whitespace_and_newlines.replace_all(license_text, " ");
151+
152+ let many_spaces = Regex::new(" +").unwrap();
153+ many_spaces.replace_all(&as_single_line, " ").to_string()
154+}
155+
156+#[cfg(test)]
157+mod tests {
158+ #[cfg(test)]
159+ use super::*;
160+
161+ #[test]
162+ fn test_normalize_license_text() {
163+ let license_text = "This is a license text with these terms:
164+ * Complicated multi-line
165+ term with indentation";
166+
167+ assert_eq!(
168+ "This is a license text with these terms: * Complicated multi-line term with indentation".to_owned(),
169+ normalize_license_text(license_text),
170+ );
171+ }
172+
173+ #[test]
174+ fn test_normalize_license_text_with_windows_line_endings() {
175+ let license_text = "This license text includes windows line endings\r
176+and we need to handle that.";
177+
178+ assert_eq!(
179+ "This license text includes windows line endings and we need to handle that."
180+ .to_owned(),
181+ normalize_license_text(license_text),
182+ );
183+ }
184+
185+ #[test]
186+ fn test_append_to_acknowledgements_adds_newline_if_missing() {
187+ let mut acknowledgements = "preamble\n\n\n".to_owned();
188+
189+ append_to_acknowledgements(&mut acknowledgements, "some/path", "line without newline");
190+ assert_eq!(
191+ "preamble
192+
193+
194+## some/path
195+
196+line without newline
197+
198+
199+",
200+ acknowledgements
201+ );
202+
203+ append_to_acknowledgements(&mut acknowledgements, "another/path", "line with newline\n");
204+ assert_eq!(
205+ "preamble
206+
207+
208+## some/path
209+
210+line without newline
211+
212+
213+## another/path
214+
215+line with newline
216+
217+
218+",
219+ acknowledgements
220+ );
221+ }
222+}
src/assets/lazy_theme_set.rsnew file+104
@@ -0,0 +1,104 @@
1+use super::*;
2+
3+use std::collections::BTreeMap;
4+use std::convert::TryFrom;
5+
6+use serde::Deserialize;
7+use serde::Serialize;
8+
9+use once_cell::unsync::OnceCell;
10+
11+use syntect::highlighting::{Theme, ThemeSet};
12+
13+/// Same structure as a [`syntect::highlighting::ThemeSet`] but with themes
14+/// stored in raw serialized form, and deserialized on demand.
15+#[derive(Debug, Default, Serialize, Deserialize)]
16+pub struct LazyThemeSet {
17+ /// This is a [`BTreeMap`] because that's what [`syntect::highlighting::ThemeSet`] uses
18+ themes: BTreeMap<String, LazyTheme>,
19+}
20+
21+/// Stores raw serialized data for a theme with methods to lazily deserialize
22+/// (load) the theme.
23+#[derive(Debug, Serialize, Deserialize)]
24+struct LazyTheme {
25+ serialized: Vec<u8>,
26+
27+ #[serde(skip, default = "OnceCell::new")]
28+ deserialized: OnceCell<syntect::highlighting::Theme>,
29+}
30+
31+impl LazyThemeSet {
32+ /// Lazily load the given theme
33+ pub fn get(&self, name: &str) -> Option<&Theme> {
34+ self.themes.get(name).and_then(|lazy_theme| {
35+ lazy_theme
36+ .deserialized
37+ .get_or_try_init(|| lazy_theme.deserialize())
38+ .ok()
39+ })
40+ }
41+
42+ /// Returns the name of all themes.
43+ pub fn themes(&self) -> impl Iterator<Item = &str> {
44+ self.themes.keys().map(|name| name.as_ref())
45+ }
46+}
47+
48+impl LazyTheme {
49+ fn deserialize(&self) -> Result<Theme> {
50+ asset_from_contents(
51+ &self.serialized[..],
52+ "lazy-loaded theme",
53+ COMPRESS_LAZY_THEMES,
54+ )
55+ }
56+}
57+
58+impl TryFrom<LazyThemeSet> for ThemeSet {
59+ type Error = Error;
60+
61+ /// Since the user might want to add custom themes to bat, we need a way to
62+ /// convert from a `LazyThemeSet` to a regular [`ThemeSet`] so that more
63+ /// themes can be added. This function does that pretty straight-forward
64+ /// conversion.
65+ fn try_from(lazy_theme_set: LazyThemeSet) -> Result<Self> {
66+ let mut theme_set = ThemeSet::default();
67+
68+ for (name, lazy_theme) in lazy_theme_set.themes {
69+ theme_set.themes.insert(name, lazy_theme.deserialize()?);
70+ }
71+
72+ Ok(theme_set)
73+ }
74+}
75+
76+#[cfg(feature = "build-assets")]
77+impl TryFrom<ThemeSet> for LazyThemeSet {
78+ type Error = Error;
79+
80+ /// To collect themes, a [`ThemeSet`] is needed. Once all desired themes
81+ /// have been added, we need a way to convert that into [`LazyThemeSet`] so
82+ /// that themes can be lazy-loaded later. This function does that
83+ /// conversion.
84+ fn try_from(theme_set: ThemeSet) -> Result<Self> {
85+ let mut lazy_theme_set = LazyThemeSet::default();
86+
87+ for (name, theme) in theme_set.themes {
88+ // All we have to do is to serialize the theme
89+ let lazy_theme = LazyTheme {
90+ serialized: crate::assets::build_assets::asset_to_contents(
91+ &theme,
92+ &format!("theme {}", name),
93+ COMPRESS_LAZY_THEMES,
94+ )?,
95+ deserialized: OnceCell::new(),
96+ };
97+
98+ // Ok done, now we can add it
99+ lazy_theme_set.themes.insert(name, lazy_theme);
100+ }
101+
102+ Ok(lazy_theme_set)
103+ }
104+}
src/assets/serialized_syntax_set.rsnew file+27
@@ -0,0 +1,27 @@
1+use std::path::PathBuf;
2+
3+use syntect::parsing::SyntaxSet;
4+
5+use super::*;
6+
7+/// A SyntaxSet in serialized form, i.e. bincoded and flate2 compressed.
8+/// We keep it in this format since we want to load it lazily.
9+#[derive(Debug)]
10+pub enum SerializedSyntaxSet {
11+ /// The data comes from a user-generated cache file.
12+ FromFile(PathBuf),
13+
14+ /// The data to use is embedded into the bat binary.
15+ FromBinary(&'static [u8]),
16+}
17+
18+impl SerializedSyntaxSet {
19+ pub fn deserialize(&self) -> Result<SyntaxSet> {
20+ match self {
21+ SerializedSyntaxSet::FromBinary(data) => Ok(from_binary(data, COMPRESS_SYNTAXES)),
22+ SerializedSyntaxSet::FromFile(ref path) => {
23+ asset_from_cache(path, "syntax set", COMPRESS_SYNTAXES)
24+ }
25+ }
26+ }
27+}
src/bin/bat/app.rs+62−41
@@ -1,6 +1,6 @@
1use std::collections::HashSet;
1use std::collections::HashSet;
2use std::env;
2use std::env;
3−use std::ffi::OsStr;
3+use std::path::Path;
4use std::str::FromStr;
4use std::str::FromStr;
5
5
6use atty::{self, Stream};
6use atty::{self, Stream};
@@ -13,8 +13,10 @@ use clap::ArgMatches;
13
13
14use console::Term;
14use console::Term;
15
15
16+use crate::input::{new_file_input, new_stdin_input};
16use bat::{
17use bat::{
17 assets::HighlightingAssets,
18 assets::HighlightingAssets,
19+ bat_warning,
18 config::{Config, VisibleLines},
20 config::{Config, VisibleLines},
19 error::*,
21 error::*,
20 input::Input,
22 input::Input,
@@ -60,7 +62,7 @@ impl App {
60 // Read arguments from bats config file
62 // Read arguments from bats config file
61 let mut args = get_args_from_env_var()
63 let mut args = get_args_from_env_var()
62 .unwrap_or_else(get_args_from_config_file)
64 .unwrap_or_else(get_args_from_config_file)
63− .chain_err(|| "Could not parse configuration file")?;
65+ .map_err(|_| "Could not parse configuration file")?;
64
66
65 // Put the zero-th CLI argument (program name) first
67 // Put the zero-th CLI argument (program name) first
66 args.insert(0, cli_args.next().unwrap());
68 args.insert(0, cli_args.next().unwrap());
@@ -81,8 +83,9 @@ impl App {
81 Some("always") => PagingMode::Always,
83 Some("always") => PagingMode::Always,
82 Some("never") => PagingMode::Never,
84 Some("never") => PagingMode::Never,
83 Some("auto") | None => {
85 Some("auto") | None => {
84− if self.matches.occurrences_of("plain") > 1 {
86+ // If we have -pp as an option when in auto mode, the pager should be disabled.
85− // If we have -pp as an option when in auto mode, the pager should be disabled.
87+ let extra_plain = self.matches.occurrences_of("plain") > 1;
88+ if extra_plain || self.matches.is_present("no-paging") {
86 PagingMode::Never
89 PagingMode::Never
87 } else if inputs.iter().any(Input::is_stdin) {
90 } else if inputs.iter().any(Input::is_stdin) {
88 // If we are reading from stdin, only enable paging if we write to an
91 // If we are reading from stdin, only enable paging if we write to an
@@ -104,6 +107,12 @@ impl App {
104
107
105 let mut syntax_mapping = SyntaxMapping::builtin();
108 let mut syntax_mapping = SyntaxMapping::builtin();
106
109
110+ if let Some(values) = self.matches.values_of("ignored-suffix") {
111+ for suffix in values {
112+ syntax_mapping.insert_ignored_suffix(suffix);
113+ }
114+ }
115+
107 if let Some(values) = self.matches.values_of("map-syntax") {
116 if let Some(values) = self.matches.values_of("map-syntax") {
108 for from_to in values {
117 for from_to in values {
109 let parts: Vec<_> = from_to.split(':').collect();
118 let parts: Vec<_> = from_to.split(':').collect();
@@ -147,31 +156,34 @@ impl App {
147 wrapping_mode: if self.interactive_output || maybe_term_width.is_some() {
156 wrapping_mode: if self.interactive_output || maybe_term_width.is_some() {
148 match self.matches.value_of("wrap") {
157 match self.matches.value_of("wrap") {
149 Some("character") => WrappingMode::Character,
158 Some("character") => WrappingMode::Character,
150− Some("never") => WrappingMode::NoWrapping,
159+ Some("never") => WrappingMode::NoWrapping(true),
151 Some("auto") | None => {
160 Some("auto") | None => {
152 if style_components.plain() {
161 if style_components.plain() {
153− WrappingMode::NoWrapping
162+ WrappingMode::NoWrapping(false)
154 } else {
163 } else {
155 WrappingMode::Character
164 WrappingMode::Character
156 }
165 }
157 }
166 }
158− _ => unreachable!("other values for --paging are not allowed"),
167+ _ => unreachable!("other values for --wrap are not allowed"),
159 }
168 }
160 } else {
169 } else {
161 // We don't have the tty width when piping to another program.
170 // We don't have the tty width when piping to another program.
162 // There's no point in wrapping when this is the case.
171 // There's no point in wrapping when this is the case.
163− WrappingMode::NoWrapping
172+ WrappingMode::NoWrapping(false)
164− },
165− colored_output: match self.matches.value_of("color") {
166− Some("always") => true,
167− Some("never") => false,
168− Some("auto") | _ => self.interactive_output,
169 },
173 },
174+ colored_output: self.matches.is_present("force-colorization")
175+ || match self.matches.value_of("color") {
176+ Some("always") => true,
177+ Some("never") => false,
178+ Some("auto") => env::var_os("NO_COLOR").is_none() && self.interactive_output,
179+ _ => unreachable!("other values for --color are not allowed"),
180+ },
170 paging_mode,
181 paging_mode,
171 term_width: maybe_term_width.unwrap_or(Term::stdout().size().1 as usize),
182 term_width: maybe_term_width.unwrap_or(Term::stdout().size().1 as usize),
172 loop_through: !(self.interactive_output
183 loop_through: !(self.interactive_output
173 || self.matches.value_of("color") == Some("always")
184 || self.matches.value_of("color") == Some("always")
174− || self.matches.value_of("decorations") == Some("always")),
185+ || self.matches.value_of("decorations") == Some("always")
186+ || self.matches.is_present("force-colorization")),
175 tab_width: self
187 tab_width: self
176 .matches
188 .matches
177 .value_of("tabs")
189 .value_of("tabs")
@@ -198,38 +210,37 @@ impl App {
198 }
210 }
199 })
211 })
200 .unwrap_or_else(|| String::from(HighlightingAssets::default_theme())),
212 .unwrap_or_else(|| String::from(HighlightingAssets::default_theme())),
201− visible_lines: if self.matches.is_present("diff") {
213+ visible_lines: match self.matches.is_present("diff") {
202− VisibleLines::DiffContext(
214+ #[cfg(feature = "git")]
215+ true => VisibleLines::DiffContext(
203 self.matches
216 self.matches
204 .value_of("diff-context")
217 .value_of("diff-context")
205 .and_then(|t| t.parse().ok())
218 .and_then(|t| t.parse().ok())
206 .unwrap_or(2),
219 .unwrap_or(2),
207− )
220+ ),
208− } else {
221+
209− VisibleLines::Ranges(
222+ _ => VisibleLines::Ranges(
210 self.matches
223 self.matches
211 .values_of("line-range")
224 .values_of("line-range")
212 .map(|vs| vs.map(LineRange::from).collect())
225 .map(|vs| vs.map(LineRange::from).collect())
213 .transpose()?
226 .transpose()?
214 .map(LineRanges::from)
227 .map(LineRanges::from)
215 .unwrap_or_default(),
228 .unwrap_or_default(),
216− )
229+ ),
217 },
230 },
218 style_components,
231 style_components,
219 syntax_mapping,
232 syntax_mapping,
220 pager: self.matches.value_of("pager"),
233 pager: self.matches.value_of("pager"),
221− use_italic_text: match self.matches.value_of("italic-text") {
234+ use_italic_text: self.matches.value_of("italic-text") == Some("always"),
222− Some("always") => true,
223− _ => false,
224− },
225 highlighted_lines: self
235 highlighted_lines: self
226 .matches
236 .matches
227 .values_of("highlight-line")
237 .values_of("highlight-line")
228 .map(|ws| ws.map(LineRange::from).collect())
238 .map(|ws| ws.map(LineRange::from).collect())
229 .transpose()?
239 .transpose()?
230 .map(LineRanges::from)
240 .map(LineRanges::from)
231− .map(|lr| HighlightedLineRanges(lr))
241+ .map(HighlightedLineRanges)
232 .unwrap_or_default(),
242 .unwrap_or_default(),
243+ use_custom_assets: !self.matches.is_present("no-custom-assets"),
233 })
244 })
234 }
245 }
235
246
@@ -244,20 +255,24 @@ impl App {
244 }
255 }
245 _ => {}
256 _ => {}
246 }
257 }
247− let filenames: Option<Vec<&str>> = self
258+ let filenames: Option<Vec<&Path>> = self
248 .matches
259 .matches
249− .values_of("file-name")
260+ .values_of_os("file-name")
250− .map(|values| values.collect());
261+ .map(|values| values.map(Path::new).collect());
251
262
252− let mut filenames_or_none: Box<dyn Iterator<Item = _>> = match filenames {
263+ let mut filenames_or_none: Box<dyn Iterator<Item = Option<&Path>>> = match filenames {
253− Some(ref filenames) => Box::new(filenames.iter().map(|name| Some(OsStr::new(*name)))),
264+ Some(filenames) => Box::new(filenames.into_iter().map(Some)),
254 None => Box::new(std::iter::repeat(None)),
265 None => Box::new(std::iter::repeat(None)),
255 };
266 };
256− let files: Option<Vec<&OsStr>> = self.matches.values_of_os("FILE").map(|vs| vs.collect());
267+ let files: Option<Vec<&Path>> = self
268+ .matches
269+ .values_of_os("FILE")
270+ .map(|vs| vs.map(Path::new).collect());
257
271
258 if files.is_none() {
272 if files.is_none() {
259− let input = Input::stdin().with_name(filenames_or_none.next().unwrap_or(None));
273+ return Ok(vec![new_stdin_input(
260− return Ok(vec![input]);
274+ filenames_or_none.next().unwrap_or(None),
275+ )]);
261 }
276 }
262 let files_or_none: Box<dyn Iterator<Item = _>> = match files {
277 let files_or_none: Box<dyn Iterator<Item = _>> = match files {
263 Some(ref files) => Box::new(files.iter().map(|name| Some(*name))),
278 Some(ref files) => Box::new(files.iter().map(|name| Some(*name))),
@@ -268,9 +283,9 @@ impl App {
268 for (filepath, provided_name) in files_or_none.zip(filenames_or_none) {
283 for (filepath, provided_name) in files_or_none.zip(filenames_or_none) {
269 if let Some(filepath) = filepath {
284 if let Some(filepath) = filepath {
270 if filepath.to_str().unwrap_or_default() == "-" {
285 if filepath.to_str().unwrap_or_default() == "-" {
271− file_input.push(Input::stdin().with_name(provided_name));
286+ file_input.push(new_stdin_input(provided_name));
272 } else {
287 } else {
273− file_input.push(Input::ordinary_file(filepath).with_name(provided_name));
288+ file_input.push(new_file_input(filepath, provided_name));
274 }
289 }
275 }
290 }
276 }
291 }
@@ -279,8 +294,8 @@ impl App {
279
294
280 fn style_components(&self) -> Result<StyleComponents> {
295 fn style_components(&self) -> Result<StyleComponents> {
281 let matches = &self.matches;
296 let matches = &self.matches;
282− Ok(StyleComponents(
297+ let mut styled_components =
283− if matches.value_of("decorations") == Some("never") {
298+ StyleComponents(if matches.value_of("decorations") == Some("never") {
284 HashSet::new()
299 HashSet::new()
285 } else if matches.is_present("number") {
300 } else if matches.is_present("number") {
286 [StyleComponent::LineNumbers].iter().cloned().collect()
301 [StyleComponent::LineNumbers].iter().cloned().collect()
@@ -292,7 +307,7 @@ impl App {
292 .map(|style_str| {
307 .map(|style_str| {
293 style_str
308 style_str
294 .split(',')
309 .split(',')
295− .map(|x| StyleComponent::from_str(&x))
310+ .map(StyleComponent::from_str)
296 .collect::<Result<Vec<StyleComponent>>>()
311 .collect::<Result<Vec<StyleComponent>>>()
297 })
312 })
298 .transpose()?;
313 .transpose()?;
@@ -307,14 +322,20 @@ impl App {
307 .collect::<Vec<_>>()
322 .collect::<Vec<_>>()
308 })
323 })
309 .or(env_style_components)
324 .or(env_style_components)
310− .unwrap_or_else(|| vec![StyleComponent::Full])
325+ .unwrap_or_else(|| vec![StyleComponent::Default])
311 .into_iter()
326 .into_iter()
312 .map(|style| style.components(self.interactive_output))
327 .map(|style| style.components(self.interactive_output))
313 .fold(HashSet::new(), |mut acc, components| {
328 .fold(HashSet::new(), |mut acc, components| {
314 acc.extend(components.iter().cloned());
329 acc.extend(components.iter().cloned());
315 acc
330 acc
316 })
331 })
317− },
332+ });
318− ))
333+
334+ // If `grid` is set, remove `rule` as it is a subset of `grid`, and print a warning.
335+ if styled_components.grid() && styled_components.0.remove(&StyleComponent::Rule) {
336+ bat_warning!("Style 'rule' is a subset of style 'grid', 'rule' will not be visible.");
337+ }
338+
339+ Ok(styled_components)
319 }
340 }
320}
341}
src/bin/bat/assets.rs+26−19
@@ -1,5 +1,6 @@
1use std::borrow::Cow;
1use std::borrow::Cow;
2use std::fs;
2use std::fs;
3+use std::io;
3
4
4use clap::crate_version;
5use clap::crate_version;
5
6
@@ -18,26 +19,14 @@ pub fn cache_dir() -> Cow<'static, str> {
18}
19}
19
20
20pub fn clear_assets() {
21pub fn clear_assets() {
21− let theme_set_path = PROJECT_DIRS.cache_dir().join("themes.bin");
22+ clear_asset("themes.bin", "theme set cache");
22− let syntax_set_path = PROJECT_DIRS.cache_dir().join("syntaxes.bin");
23+ clear_asset("syntaxes.bin", "syntax set cache");
23− let metadata_file = PROJECT_DIRS.cache_dir().join("metadata.yaml");
24+ clear_asset("metadata.yaml", "metadata file");
24−
25− print!("Clearing theme set cache ... ");
26− fs::remove_file(theme_set_path).ok();
27− println!("okay");
28−
29− print!("Clearing syntax set cache ... ");
30− fs::remove_file(syntax_set_path).ok();
31− println!("okay");
32−
33− print!("Clearing metadata file ... ");
34− fs::remove_file(metadata_file).ok();
35− println!("okay");
36}
25}
37
26
38−pub fn assets_from_cache_or_binary() -> Result<HighlightingAssets> {
27+pub fn assets_from_cache_or_binary(use_custom_assets: bool) -> Result<HighlightingAssets> {
39 let cache_dir = PROJECT_DIRS.cache_dir();
28 let cache_dir = PROJECT_DIRS.cache_dir();
40− if let Some(metadata) = AssetsMetadata::load_from_folder(&cache_dir)? {
29+ if let Some(metadata) = AssetsMetadata::load_from_folder(cache_dir)? {
41 if !metadata.is_compatible_with(crate_version!()) {
30 if !metadata.is_compatible_with(crate_version!()) {
42 return Err(format!(
31 return Err(format!(
43 "The binary caches for the user-customized syntaxes and themes \
32 "The binary caches for the user-customized syntaxes and themes \
@@ -53,6 +42,24 @@ pub fn assets_from_cache_or_binary() -> Result<HighlightingAssets> {
53 }
42 }
54 }
43 }
55
44
56− Ok(HighlightingAssets::from_cache(&cache_dir)
45+ let custom_assets = if use_custom_assets {
57− .unwrap_or_else(|_| HighlightingAssets::from_binary()))
46+ HighlightingAssets::from_cache(cache_dir).ok()
47+ } else {
48+ None
49+ };
50+ Ok(custom_assets.unwrap_or_else(HighlightingAssets::from_binary))
51+}
52+
53+fn clear_asset(filename: &str, description: &str) {
54+ print!("Clearing {} ... ", description);
55+ let path = PROJECT_DIRS.cache_dir().join(filename);
56+ match fs::remove_file(&path) {
57+ Err(err) if err.kind() == io::ErrorKind::NotFound => {
58+ println!("skipped (not present)");
59+ }
60+ Err(err) => {
61+ println!("could not remove the cache file {:?}: {}", &path, err);
62+ }
63+ Ok(_) => println!("okay"),
64+ }
58}
65}
src/bin/bat/clap_app.rs+187−75
@@ -1,15 +1,30 @@
1use clap::{crate_name, crate_version, App as ClapApp, AppSettings, Arg, ArgGroup, SubCommand};
1use clap::{crate_name, crate_version, App as ClapApp, AppSettings, Arg, ArgGroup, SubCommand};
2+use once_cell::sync::Lazy;
3+use std::env;
2use std::path::Path;
4use std::path::Path;
3
5
6+static VERSION: Lazy<String> = Lazy::new(|| {
7+ #[cfg(feature = "bugreport")]
8+ let git_version = bugreport::git_version!(fallback = "");
9+ #[cfg(not(feature = "bugreport"))]
10+ let git_version = "";
11+
12+ if git_version.is_empty() {
13+ crate_version!().to_string()
14+ } else {
15+ format!("{} ({})", crate_version!(), git_version)
16+ }
17+});
18+
4pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
19pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
5− let clap_color_setting = if interactive_output {
20+ let clap_color_setting = if interactive_output && env::var_os("NO_COLOR").is_none() {
6 AppSettings::ColoredHelp
21 AppSettings::ColoredHelp
7 } else {
22 } else {
8 AppSettings::ColorNever
23 AppSettings::ColorNever
9 };
24 };
10
25
11− let app = ClapApp::new(crate_name!())
26+ let mut app = ClapApp::new(crate_name!())
12− .version(crate_version!())
27+ .version(VERSION.as_str())
13 .global_setting(clap_color_setting)
28 .global_setting(clap_color_setting)
14 .global_setting(AppSettings::DeriveDisplayOrder)
29 .global_setting(AppSettings::DeriveDisplayOrder)
15 .global_setting(AppSettings::UnifiedHelpMessage)
30 .global_setting(AppSettings::UnifiedHelpMessage)
@@ -23,6 +38,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
23 "A cat(1) clone with wings.\n\n\
38 "A cat(1) clone with wings.\n\n\
24 Use '--help' instead of '-h' to see a more detailed version of the help text.",
39 Use '--help' instead of '-h' to see a more detailed version of the help text.",
25 )
40 )
41+ .after_help(
42+ "Note: `bat -h` prints a short and concise overview while `bat --help` gives all \
43+ details.",
44+ )
26 .long_about("A cat(1) clone with syntax highlighting and Git integration.")
45 .long_about("A cat(1) clone with syntax highlighting and Git integration.")
27 .arg(
46 .arg(
28 Arg::with_name("FILE")
47 Arg::with_name("FILE")
@@ -44,7 +63,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
44 .long_help(
63 .long_help(
45 "Show non-printable characters like space, tab or newline. \
64 "Show non-printable characters like space, tab or newline. \
46 This option can also be used to print binary files. \
65 This option can also be used to print binary files. \
47− Use '--tabs' to control the width of the tab-placeholders."
66+ Use '--tabs' to control the width of the tab-placeholders.",
48 ),
67 ),
49 )
68 )
50 .arg(
69 .arg(
@@ -90,7 +109,8 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
90 '--highlight-line 40' highlights line 40\n \
109 '--highlight-line 40' highlights line 40\n \
91 '--highlight-line 30:40' highlights lines 30 to 40\n \
110 '--highlight-line 30:40' highlights lines 30 to 40\n \
92 '--highlight-line :40' highlights lines 1 to 40\n \
111 '--highlight-line :40' highlights lines 1 to 40\n \
93− '--highlight-line 40:' highlights lines 40 to the end of the file"
112+ '--highlight-line 40:' highlights lines 40 to the end of the file\n \
113+ '--highlight-line 30:+10' highlights lines 30 to 40",
94 ),
114 ),
95 )
115 )
96 .arg(
116 .arg(
@@ -101,59 +121,68 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
101 .multiple(true)
121 .multiple(true)
102 .value_name("name")
122 .value_name("name")
103 .help("Specify the name to display for a file.")
123 .help("Specify the name to display for a file.")
104− .long_help("Specify the name to display for a file. Useful when piping \
105− data to bat from STDIN when bat does not otherwise know \
106− the filename."),
107− )
108− .arg(
109− Arg::with_name("diff")
110− .long("diff")
111− .short("d")
112− .help("Only show lines that have been added/removed/modified.")
113 .long_help(
124 .long_help(
114− "Only show lines that have been added/removed/modified with respect \
125+ "Specify the name to display for a file. Useful when piping \
115− to the Git index. Use --diff-context=N to control how much context you want to see.",
126+ data to bat from STDIN when bat does not otherwise know \
127+ the filename. Note that the provided file name is also \
128+ used for syntax detection.",
116 ),
129 ),
117− )
130+ );
118− .arg(
131+
119− Arg::with_name("diff-context")
132+ #[cfg(feature = "git")]
120− .long("diff-context")
133+ {
121− .overrides_with("diff-context")
134+ app = app
122− .takes_value(true)
135+ .arg(
123− .value_name("N")
136+ Arg::with_name("diff")
124− .validator(
137+ .long("diff")
125− |n| {
138+ .short("d")
126− n.parse::<usize>()
139+ .help("Only show lines that have been added/removed/modified.")
127− .map_err(|_| "must be a number")
140+ .long_help(
128− .map(|_| ()) // Convert to Result<(), &str>
141+ "Only show lines that have been added/removed/modified with respect \
129− .map_err(|e| e.to_string())
142+ to the Git index. Use --diff-context=N to control how much context you want to see.",
130− }, // Convert to Result<(), String>
143+ ),
131 )
144 )
132− .hidden_short_help(true)
145+ .arg(
133− .long_help(
146+ Arg::with_name("diff-context")
134− "Include N lines of context around added/removed/modified lines when using '--diff'.",
147+ .long("diff-context")
135− ),
148+ .overrides_with("diff-context")
136− )
149+ .takes_value(true)
137− .arg(
150+ .value_name("N")
138− Arg::with_name("tabs")
151+ .validator(
139− .long("tabs")
152+ |n| {
140− .overrides_with("tabs")
153+ n.parse::<usize>()
141− .takes_value(true)
154+ .map_err(|_| "must be a number")
142− .value_name("T")
155+ .map(|_| ()) // Convert to Result<(), &str>
143− .validator(
156+ .map_err(|e| e.to_string())
144− |t| {
157+ }, // Convert to Result<(), String>
145− t.parse::<u32>()
158+ )
146− .map_err(|_t| "must be a number")
159+ .hidden_short_help(true)
147− .map(|_t| ()) // Convert to Result<(), &str>
160+ .long_help(
148− .map_err(|e| e.to_string())
161+ "Include N lines of context around added/removed/modified lines when using '--diff'.",
149− }, // Convert to Result<(), String>
162+ ),
150 )
163 )
151− .help("Set the tab width to T spaces.")
164+ }
152− .long_help(
165+
153− "Set the tab width to T spaces. Use a width of 0 to pass tabs through \
166+ app = app.arg(
167+ Arg::with_name("tabs")
168+ .long("tabs")
169+ .overrides_with("tabs")
170+ .takes_value(true)
171+ .value_name("T")
172+ .validator(
173+ |t| {
174+ t.parse::<u32>()
175+ .map_err(|_t| "must be a number")
176+ .map(|_t| ()) // Convert to Result<(), &str>
177+ .map_err(|e| e.to_string())
178+ }, // Convert to Result<(), String>
179+ )
180+ .help("Set the tab width to T spaces.")
181+ .long_help(
182+ "Set the tab width to T spaces. Use a width of 0 to pass tabs through \
154 directly",
183 directly",
155− ),
184+ ),
156− )
185+ )
157 .arg(
186 .arg(
158 Arg::with_name("wrap")
187 Arg::with_name("wrap")
159 .long("wrap")
188 .long("wrap")
@@ -216,7 +245,8 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
216 .help("When to use colors (*auto*, never, always).")
245 .help("When to use colors (*auto*, never, always).")
217 .long_help(
246 .long_help(
218 "Specify when to use colored output. The automatic mode \
247 "Specify when to use colored output. The automatic mode \
219− only enables colors if an interactive terminal is detected. \
248+ only enables colors if an interactive terminal is detected - \
249+ colors are automatically disabled if the output goes to a pipe.\n\
220 Possible values: *auto*, never, always.",
250 Possible values: *auto*, never, always.",
221 ),
251 ),
222 )
252 )
@@ -247,6 +277,18 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
247 an interactive terminal is detected. Possible values: *auto*, never, always.",
277 an interactive terminal is detected. Possible values: *auto*, never, always.",
248 ),
278 ),
249 )
279 )
280+ .arg(
281+ Arg::with_name("force-colorization")
282+ .long("force-colorization")
283+ .short("f")
284+ .conflicts_with("color")
285+ .conflicts_with("decorations")
286+ .overrides_with("force-colorization")
287+ .hidden_short_help(true)
288+ .long_help("Alias for '--decorations=always --color=always'. This is useful \
289+ if the output of bat is piped to another program, but you want \
290+ to keep the colorization/decorations.")
291+ )
250 .arg(
292 .arg(
251 Arg::with_name("paging")
293 Arg::with_name("paging")
252 .long("paging")
294 .long("paging")
@@ -256,16 +298,24 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
256 .possible_values(&["auto", "never", "always"])
298 .possible_values(&["auto", "never", "always"])
257 .default_value("auto")
299 .default_value("auto")
258 .hide_default_value(true)
300 .hide_default_value(true)
259− .help("Specify when to use the pager (*auto*, never, always).")
301+ .help("Specify when to use the pager, or use `-P` to disable (*auto*, never, always).")
260 .long_help(
302 .long_help(
261− "Specify when to use the pager. To control which pager \
303+ "Specify when to use the pager. To disable the pager, use \
262− is used, set the PAGER or BAT_PAGER environment \
304+ --paging=never' or its alias,'-P'. To disable the pager permanently, \
263− variables (the latter takes precedence) or use the '--pager' option. \
305+ set BAT_PAGER to an empty string. To control which pager is used, see the \
264− To disable the pager permanently, set BAT_PAGER to an empty string \
306+ '--pager' option. Possible values: *auto*, never, always."
265− or set '--paging=never' in the configuration file. \
266− Possible values: *auto*, never, always.",
267 ),
307 ),
268 )
308 )
309+ .arg(
310+ Arg::with_name("no-paging")
311+ .short("P")
312+ .long("no-paging")
313+ .alias("no-pager")
314+ .overrides_with("no-paging")
315+ .hidden(true)
316+ .hidden_short_help(true)
317+ .help("Alias for '--paging=never'")
318+ )
269 .arg(
319 .arg(
270 Arg::with_name("pager")
320 Arg::with_name("pager")
271 .long("pager")
321 .long("pager")
@@ -275,11 +325,10 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
275 .hidden_short_help(true)
325 .hidden_short_help(true)
276 .help("Determine which pager to use.")
326 .help("Determine which pager to use.")
277 .long_help(
327 .long_help(
278− "Determine which pager is used. This option will overwrite \
328+ "Determine which pager is used. This option will override the \
279− the PAGER and BAT_PAGER environment variables. The default \
329+ PAGER and BAT_PAGER environment variables. The default pager is 'less'. \
280− pager is 'less'. To disable the pager completely, use the \
330+ To control when the pager is used, see the '--paging' option. \
281− '--paging' option. \
331+ Example: '--pager \"less -RF\"'."
282− Example: '--pager \"less -RF\"'.",
283 ),
332 ),
284 )
333 )
285 .arg(
334 .arg(
@@ -295,10 +344,23 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
295 "Map a glob pattern to an existing syntax name. The glob pattern is matched \
344 "Map a glob pattern to an existing syntax name. The glob pattern is matched \
296 on the full path and the filename. For example, to highlight *.build files \
345 on the full path and the filename. For example, to highlight *.build files \
297 with the Python syntax, use -m '*.build:Python'. To highlight files named \
346 with the Python syntax, use -m '*.build:Python'. To highlight files named \
298− '.myignore' with the Git Ignore syntax, use -m '.myignore:Git Ignore'.",
347+ '.myignore' with the Git Ignore syntax, use -m '.myignore:Git Ignore'. Note \
348+ that the right-hand side is the *name* of the syntax, not a file extension.",
299 )
349 )
300 .takes_value(true),
350 .takes_value(true),
301 )
351 )
352+ .arg(
353+ Arg::with_name("ignored-suffix")
354+ .number_of_values(1)
355+ .multiple(true)
356+ .takes_value(true)
357+ .long("ignored-suffix")
358+ .hidden_short_help(true)
359+ .help(
360+ "Ignore extension. For example:\n \
361+ 'bat --ignored-suffix \".dev\" my_file.json.dev' will use JSON syntax, and ignore '.dev'"
362+ )
363+ )
302 .arg(
364 .arg(
303 Arg::with_name("theme")
365 Arg::with_name("theme")
304 .long("theme")
366 .long("theme")
@@ -330,13 +392,24 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
330 .overrides_with("style")
392 .overrides_with("style")
331 .overrides_with("plain")
393 .overrides_with("plain")
332 .overrides_with("number")
394 .overrides_with("number")
333− // Cannot use clap's built in validation because we have to turn off clap's delimiters
395+ // Cannot use claps built in validation because we have to turn off clap's delimiters
334 .validator(|val| {
396 .validator(|val| {
335 let mut invalid_vals = val.split(',').filter(|style| {
397 let mut invalid_vals = val.split(',').filter(|style| {
336 !&[
398 !&[
337− "auto", "full", "plain", "changes", "header", "grid", "numbers", "snip"
399+ "auto",
338− ]
400+ "full",
339− .contains(style)
401+ "default",
402+ "plain",
403+ "header",
404+ "header-filename",
405+ "header-filesize",
406+ "grid",
407+ "rule",
408+ "numbers",
409+ "snip",
410+ #[cfg(feature = "git")]
411+ "changes",
412+ ].contains(style)
340 });
413 });
341
414
342 if let Some(invalid) = invalid_vals.next() {
415 if let Some(invalid) = invalid_vals.next() {
@@ -347,7 +420,7 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
347 })
420 })
348 .help(
421 .help(
349 "Comma-separated list of style elements to display \
422 "Comma-separated list of style elements to display \
350− (*auto*, full, plain, changes, header, grid, numbers, snip).",
423+ (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).",
351 )
424 )
352 .long_help(
425 .long_help(
353 "Configure which elements (line numbers, file headers, grid \
426 "Configure which elements (line numbers, file headers, grid \
@@ -356,8 +429,21 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
356 components to display (e.g. 'numbers,changes,grid') or a \
429 components to display (e.g. 'numbers,changes,grid') or a \
357 pre-defined style ('full'). To set a default style, add the \
430 pre-defined style ('full'). To set a default style, add the \
358 '--style=\"..\"' option to the configuration file or export the \
431 '--style=\"..\"' option to the configuration file or export the \
359− BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\"). \
432+ BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
360− Possible values: *auto*, full, plain, changes, header, grid, numbers, snip.",
433+ Possible values:\n\n \
434+ * default: enables recommended style components (default).\n \
435+ * full: enables all available components.\n \
436+ * auto: same as 'default', unless the output is piped.\n \
437+ * plain: disables all available components.\n \
438+ * changes: show Git modification markers.\n \
439+ * header: alias for 'header-filename'.\n \
440+ * header-filename: show filenames before the content.\n \
441+ * header-filesize: show file sizes before the content.\n \
442+ * grid: vertical/horizontal lines to separate side bar\n \
443+ and the header from the content.\n \
444+ * rule: horizontal lines to delimit files.\n \
445+ * numbers: show line numbers in the side bar.\n \
446+ * snip: draw separation lines between distinct line ranges.",
361 ),
447 ),
362 )
448 )
363 .arg(
449 .arg(
@@ -376,7 +462,8 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
376 '--line-range 30:40' prints lines 30 to 40\n \
462 '--line-range 30:40' prints lines 30 to 40\n \
377 '--line-range :40' prints lines 1 to 40\n \
463 '--line-range :40' prints lines 1 to 40\n \
378 '--line-range 40:' prints lines 40 to the end of the file\n \
464 '--line-range 40:' prints lines 40 to the end of the file\n \
379− '--line-range 40' only prints line 40",
465+ '--line-range 40' only prints line 40\n \
466+ '--line-range 30:+10' prints lines 30 to 40",
380 ),
467 ),
381 )
468 )
382 .arg(
469 .arg(
@@ -404,6 +491,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
404 .hidden(true)
491 .hidden(true)
405 .help("Do not use the configuration file"),
492 .help("Do not use the configuration file"),
406 )
493 )
494+ .arg(
495+ Arg::with_name("no-custom-assets")
496+ .long("no-custom-assets")
497+ .hidden(true)
498+ .help("Do not load custom assets"),
499+ )
407 .arg(
500 .arg(
408 Arg::with_name("config-file")
501 Arg::with_name("config-file")
409 .long("config-file")
502 .long("config-file")
@@ -432,6 +525,19 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
432 .hidden(true)
525 .hidden(true)
433 .help("Show bat's cache directory."),
526 .help("Show bat's cache directory."),
434 )
527 )
528+ .arg(
529+ Arg::with_name("diagnostic")
530+ .long("diagnostic")
531+ .alias("diagnostics")
532+ .hidden_short_help(true)
533+ .help("Show diagnostic information for bug reports.")
534+ )
535+ .arg(
536+ Arg::with_name("acknowledgements")
537+ .long("acknowledgements")
538+ .hidden_short_help(true)
539+ .help("Show acknowledgements."),
540+ )
435 .help_message("Print this help message.")
541 .help_message("Print this help message.")
436 .version_message("Show version information.");
542 .version_message("Show version information.");
437
543
@@ -490,6 +596,12 @@ pub fn build_app(interactive_output: bool) -> ClapApp<'static, 'static> {
490 "Create completely new syntax and theme sets \
596 "Create completely new syntax and theme sets \
491 (instead of appending to the default sets).",
597 (instead of appending to the default sets).",
492 ),
598 ),
599+ )
600+ .arg(
601+ Arg::with_name("acknowledgements")
602+ .long("acknowledgements")
603+ .requires("build")
604+ .help("Build acknowledgements.bin."),
493 ),
605 ),
494 )
606 )
495 }
607 }
src/bin/bat/config.rs+14−9
@@ -10,13 +10,12 @@ pub fn config_file() -> PathBuf {
10 env::var("BAT_CONFIG_PATH")
10 env::var("BAT_CONFIG_PATH")
11 .ok()
11 .ok()
12 .map(PathBuf::from)
12 .map(PathBuf::from)
13− .filter(|config_path| config_path.is_file())
14 .unwrap_or_else(|| PROJECT_DIRS.config_dir().join("config"))
13 .unwrap_or_else(|| PROJECT_DIRS.config_dir().join("config"))
15}
14}
16
15
17pub fn generate_config_file() -> bat::error::Result<()> {
16pub fn generate_config_file() -> bat::error::Result<()> {
18 let config_file = config_file();
17 let config_file = config_file();
19− if config_file.exists() {
18+ if config_file.is_file() {
20 println!(
19 println!(
21 "A config file already exists at: {}",
20 "A config file already exists at: {}",
22 config_file.to_string_lossy()
21 config_file.to_string_lossy()
@@ -44,8 +43,7 @@ pub fn generate_config_file() -> bat::error::Result<()> {
44 }
43 }
45 }
44 }
46
45
47− let default_config =
46+ let default_config = r#"# This is `bat`s configuration file. Each line either contains a comment or
48− r#"# This is `bat`s configuration file. Each line either contains a comment or
49# a command-line option that you want to pass to `bat` by default. You can
47# a command-line option that you want to pass to `bat` by default. You can
50# run `bat --help` to get a list of all possible configuration options.
48# run `bat --help` to get a list of all possible configuration options.
51
49
@@ -63,16 +61,23 @@ pub fn generate_config_file() -> bat::error::Result<()> {
63# Uncomment the following line if you are using less version >= 551 and want to
61# Uncomment the following line if you are using less version >= 551 and want to
64# enable mouse scrolling support in `bat` when running inside tmux. This might
62# enable mouse scrolling support in `bat` when running inside tmux. This might
65# disable text selection, unless you press shift.
63# disable text selection, unless you press shift.
66−#--pager="--RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
64+#--pager="less --RAW-CONTROL-CHARS --quit-if-one-screen --mouse"
67
65
68# Syntax mappings: map a certain filename pattern to a language.
66# Syntax mappings: map a certain filename pattern to a language.
69−# Example 1: use the C++ syntax for .ino files
67+# Example 1: use the C++ syntax for Arduino .ino files
70# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
68# Example 2: Use ".gitignore"-style highlighting for ".ignore" files
71#--map-syntax "*.ino:C++"
69#--map-syntax "*.ino:C++"
72#--map-syntax ".ignore:Git Ignore"
70#--map-syntax ".ignore:Git Ignore"
73"#;
71"#;
74
72
75− fs::write(&config_file, default_config)?;
73+ fs::write(&config_file, default_config).map_err(|e| {
74+ format!(
75+ "Failed to create config file at '{}': {}",
76+ config_file.to_string_lossy(),
77+ e
78+ )
79+ })?;
80+
76 println!(
81 println!(
77 "Success! Config file written to {}",
82 "Success! Config file written to {}",
78 config_file.to_string_lossy()
83 config_file.to_string_lossy()
@@ -86,7 +91,7 @@ pub fn get_args_from_config_file() -> Result<Vec<OsString>, shell_words::ParseEr
86 .ok()
91 .ok()
87 .map(|content| get_args_from_str(&content))
92 .map(|content| get_args_from_str(&content))
88 .transpose()?
93 .transpose()?
89− .unwrap_or_else(|| vec![]))
94+ .unwrap_or_default())
90}
95}
91
96
92pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
97pub fn get_args_from_env_var() -> Option<Result<Vec<OsString>, shell_words::ParseError>> {
@@ -99,7 +104,7 @@ fn get_args_from_str(content: &str) -> Result<Vec<OsString>, shell_words::ParseE
99 .map(|line| line.trim())
104 .map(|line| line.trim())
100 .filter(|line| !line.is_empty())
105 .filter(|line| !line.is_empty())
101 .filter(|line| !line.starts_with('#'))
106 .filter(|line| !line.starts_with('#'))
102− .map(|line| shell_words::split(line))
107+ .map(shell_words::split)
103 .collect::<Result<Vec<_>, _>>()?;
108 .collect::<Result<Vec<_>, _>>()?;
104
109
105 Ok(args_per_line
110 Ok(args_per_line
src/bin/bat/directories.rs+23−17
@@ -1,11 +1,12 @@
1use std::env;
1use std::env;
2use std::path::{Path, PathBuf};
2use std::path::{Path, PathBuf};
3
3
4−use lazy_static::lazy_static;
4+use once_cell::sync::Lazy;
5
5
6/// Wrapper for 'dirs' that treats MacOS more like Linux, by following the XDG specification.
6/// Wrapper for 'dirs' that treats MacOS more like Linux, by following the XDG specification.
7−/// This means that the `XDG_CACHE_HOME` and `XDG_CONFIG_HOME` environment variables are
7+/// The `XDG_CACHE_HOME` environment variable is checked first. `BAT_CONFIG_DIR`
8−/// checked first. The fallback directories are `~/.cache/bat` and `~/.config/bat`, respectively.
8+/// is then checked before the `XDG_CONFIG_HOME` environment variable.
9+/// The fallback directories are `~/.cache/bat` and `~/.config/bat`, respectively.
9pub struct BatProjectDirs {
10pub struct BatProjectDirs {
10 cache_dir: PathBuf,
11 cache_dir: PathBuf,
11 config_dir: PathBuf,
12 config_dir: PathBuf,
@@ -15,16 +16,23 @@ impl BatProjectDirs {
15 fn new() -> Option<BatProjectDirs> {
16 fn new() -> Option<BatProjectDirs> {
16 let cache_dir = BatProjectDirs::get_cache_dir()?;
17 let cache_dir = BatProjectDirs::get_cache_dir()?;
17
18
18− #[cfg(target_os = "macos")]
19+ // Checks whether or not $BAT_CONFIG_DIR exists. If it doesn't, set our config dir
19− let config_dir_op = env::var_os("XDG_CONFIG_HOME")
20+ // to our system's default configuration home.
20− .map(PathBuf::from)
21+ let config_dir =
21− .filter(|p| p.is_absolute())
22+ if let Some(config_dir_op) = env::var_os("BAT_CONFIG_DIR").map(PathBuf::from) {
22− .or_else(|| dirs::home_dir().map(|d| d.join(".config")));
23+ config_dir_op
24+ } else {
25+ #[cfg(target_os = "macos")]
26+ let config_dir_op = env::var_os("XDG_CONFIG_HOME")
27+ .map(PathBuf::from)
28+ .filter(|p| p.is_absolute())
29+ .or_else(|| dirs_next::home_dir().map(|d| d.join(".config")));
23
30
24− #[cfg(not(target_os = "macos"))]
31+ #[cfg(not(target_os = "macos"))]
25− let config_dir_op = dirs::config_dir();
32+ let config_dir_op = dirs_next::config_dir();
26
33
27− let config_dir = config_dir_op.map(|d| d.join("bat"))?;
34+ config_dir_op.map(|d| d.join("bat"))?
35+ };
28
36
29 Some(BatProjectDirs {
37 Some(BatProjectDirs {
30 cache_dir,
38 cache_dir,
@@ -43,10 +51,10 @@ impl BatProjectDirs {
43 let cache_dir_op = env::var_os("XDG_CACHE_HOME")
51 let cache_dir_op = env::var_os("XDG_CACHE_HOME")
44 .map(PathBuf::from)
52 .map(PathBuf::from)
45 .filter(|p| p.is_absolute())
53 .filter(|p| p.is_absolute())
46− .or_else(|| dirs::home_dir().map(|d| d.join(".cache")));
54+ .or_else(|| dirs_next::home_dir().map(|d| d.join(".cache")));
47
55
48 #[cfg(not(target_os = "macos"))]
56 #[cfg(not(target_os = "macos"))]
49− let cache_dir_op = dirs::cache_dir();
57+ let cache_dir_op = dirs_next::cache_dir();
50
58
51 cache_dir_op.map(|d| d.join("bat"))
59 cache_dir_op.map(|d| d.join("bat"))
52 }
60 }
@@ -60,7 +68,5 @@ impl BatProjectDirs {
60 }
68 }
61}
69}
62
70
63−lazy_static! {
71+pub static PROJECT_DIRS: Lazy<BatProjectDirs> =
64− pub static ref PROJECT_DIRS: BatProjectDirs =
72+ Lazy::new(|| BatProjectDirs::new().expect("Could not get home directory"));
65− BatProjectDirs::new().expect("Could not get home directory");
66−}
src/bin/bat/input.rsnew file+20
@@ -0,0 +1,20 @@
1+use bat::input::Input;
2+use std::path::Path;
3+
4+pub fn new_file_input<'a>(file: &'a Path, name: Option<&'a Path>) -> Input<'a> {
5+ named(Input::ordinary_file(file), name.or(Some(file)))
6+}
7+
8+pub fn new_stdin_input(name: Option<&Path>) -> Input {
9+ named(Input::stdin(), name)
10+}
11+
12+fn named<'a>(input: Input<'a>, name: Option<&Path>) -> Input<'a> {
13+ if let Some(provided_name) = name {
14+ let mut input = input.with_name(Some(provided_name));
15+ input.description_mut().set_kind(Some("File".to_owned()));
16+ input
17+ } else {
18+ input
19+ }
20+}
src/bin/bat/main.rs+179−39
@@ -1,16 +1,15 @@
1−// `error_chain!` can recurse deeply
1+#![deny(unsafe_code)]
2−#![recursion_limit = "1024"]
3
2
4mod app;
3mod app;
5mod assets;
4mod assets;
6mod clap_app;
5mod clap_app;
7mod config;
6mod config;
8mod directories;
7mod directories;
8+mod input;
9
9
10−use std::collections::HashSet;
10+use std::collections::{HashMap, HashSet};
11−use std::ffi::OsStr;
12use std::io;
11use std::io;
13−use std::io::Write;
12+use std::io::{BufReader, Write};
14use std::path::Path;
13use std::path::Path;
15use std::process;
14use std::process;
16
15
@@ -21,34 +20,48 @@ use crate::{
21 app::App,
20 app::App,
22 config::{config_file, generate_config_file},
21 config::{config_file, generate_config_file},
23};
22};
23+
24use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir};
24use assets::{assets_from_cache_or_binary, cache_dir, clear_assets, config_dir};
25−use clap::crate_version;
26use directories::PROJECT_DIRS;
25use directories::PROJECT_DIRS;
26+use globset::GlobMatcher;
27
27
28use bat::{
28use bat::{
29− assets::HighlightingAssets,
30 config::Config,
29 config::Config,
31 controller::Controller,
30 controller::Controller,
32 error::*,
31 error::*,
33 input::Input,
32 input::Input,
34 style::{StyleComponent, StyleComponents},
33 style::{StyleComponent, StyleComponents},
34+ MappingTarget, PagingMode,
35};
35};
36
36
37+const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
38+
39+#[cfg(feature = "build-assets")]
40+fn build_assets(matches: &clap::ArgMatches) -> Result<()> {
41+ let source_dir = matches
42+ .value_of("source")
43+ .map(Path::new)
44+ .unwrap_or_else(|| PROJECT_DIRS.config_dir());
45+ let target_dir = matches
46+ .value_of("target")
47+ .map(Path::new)
48+ .unwrap_or_else(|| PROJECT_DIRS.cache_dir());
49+
50+ bat::assets::build(
51+ source_dir,
52+ !matches.is_present("blank"),
53+ matches.is_present("acknowledgements"),
54+ target_dir,
55+ clap::crate_version!(),
56+ )
57+}
58+
37fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
59fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
38 if matches.is_present("build") {
60 if matches.is_present("build") {
39− let source_dir = matches
61+ #[cfg(feature = "build-assets")]
40− .value_of("source")
62+ build_assets(matches)?;
41− .map(Path::new)
63+ #[cfg(not(feature = "build-assets"))]
42− .unwrap_or_else(|| PROJECT_DIRS.config_dir());
64+ println!("bat has been built without the 'build-assets' feature. The 'cache --build' option is not available.");
43− let target_dir = matches
44− .value_of("target")
45− .map(Path::new)
46− .unwrap_or_else(|| PROJECT_DIRS.cache_dir());
47−
48− let blank = matches.is_present("blank");
49−
50− let assets = HighlightingAssets::from_files(source_dir, !blank)?;
51− assets.save_to_cache(target_dir, crate_version!())?;
52 } else if matches.is_present("clear") {
65 } else if matches.is_present("clear") {
53 clear_assets();
66 clear_assets();
54 }
67 }
@@ -56,21 +69,63 @@ fn run_cache_subcommand(matches: &clap::ArgMatches) -> Result<()> {
56 Ok(())
69 Ok(())
57}
70}
58
71
59−pub fn list_languages(config: &Config) -> Result<()> {
72+fn get_syntax_mapping_to_paths<'a>(
60− let assets = assets_from_cache_or_binary()?;
73+ mappings: &[(GlobMatcher, MappingTarget<'a>)],
74+) -> HashMap<&'a str, Vec<String>> {
75+ let mut map = HashMap::new();
76+ for mapping in mappings {
77+ if let (matcher, MappingTarget::MapTo(s)) = mapping {
78+ let globs = map.entry(*s).or_insert_with(Vec::new);
79+ globs.push(matcher.glob().glob().into());
80+ }
81+ }
82+ map
83+}
84+
85+pub fn get_languages(config: &Config) -> Result<String> {
86+ let mut result: String = String::new();
87+
88+ let assets = assets_from_cache_or_binary(config.use_custom_assets)?;
61 let mut languages = assets
89 let mut languages = assets
62− .syntaxes()
90+ .get_syntaxes()?
63 .iter()
91 .iter()
64 .filter(|syntax| !syntax.hidden && !syntax.file_extensions.is_empty())
92 .filter(|syntax| !syntax.hidden && !syntax.file_extensions.is_empty())
93+ .cloned()
65 .collect::<Vec<_>>();
94 .collect::<Vec<_>>();
95+
96+ // Handling of file-extension conflicts, see issue #1076
97+ for lang in &mut languages {
98+ let lang_name = lang.name.clone();
99+ lang.file_extensions.retain(|extension| {
100+ // The 'extension' variable is not certainly a real extension.
101+ //
102+ // Skip if 'extension' starts with '.', likely a hidden file like '.vimrc'
103+ // Also skip if the 'extension' contains another real extension, likely
104+ // that is a full match file name like 'CMakeLists.txt' and 'Cargo.lock'
105+ if extension.starts_with('.') || Path::new(extension).extension().is_some() {
106+ return true;
107+ }
108+
109+ let test_file = Path::new("test").with_extension(extension);
110+ let syntax_in_set = assets.get_syntax_for_path(test_file, &config.syntax_mapping);
111+ matches!(syntax_in_set, Ok(syntax_in_set) if syntax_in_set.syntax.name == lang_name)
112+ });
113+ }
114+
66 languages.sort_by_key(|lang| lang.name.to_uppercase());
115 languages.sort_by_key(|lang| lang.name.to_uppercase());
67
116
68− let stdout = io::stdout();
117+ let configured_languages = get_syntax_mapping_to_paths(config.syntax_mapping.mappings());
69− let mut stdout = stdout.lock();
118+
119+ for lang in &mut languages {
120+ if let Some(additional_paths) = configured_languages.get(lang.name.as_str()) {
121+ lang.file_extensions
122+ .extend(additional_paths.iter().cloned());
123+ }
124+ }
70
125
71 if config.loop_through {
126 if config.loop_through {
72 for lang in languages {
127 for lang in languages {
73− writeln!(stdout, "{}:{}", lang.name, lang.file_extensions.join(","))?;
128+ result += &format!("{}:{}\n", lang.name, lang.file_extensions.join(","));
74 }
129 }
75 } else {
130 } else {
76 let longest = languages
131 let longest = languages
@@ -91,7 +146,7 @@ pub fn list_languages(config: &Config) -> Result<()> {
91 };
146 };
92
147
93 for lang in languages {
148 for lang in languages {
94− write!(stdout, "{:width$}{}", lang.name, separator, width = longest)?;
149+ result += &format!("{:width$}{}", lang.name, separator, width = longest);
95
150
96 // Number of characters on this line so far, wrap before `desired_width`
151 // Number of characters on this line so far, wrap before `desired_width`
97 let mut num_chars = 0;
152 let mut num_chars = 0;
@@ -102,27 +157,32 @@ pub fn list_languages(config: &Config) -> Result<()> {
102 let new_chars = word.len() + comma_separator.len();
157 let new_chars = word.len() + comma_separator.len();
103 if num_chars + new_chars >= desired_width {
158 if num_chars + new_chars >= desired_width {
104 num_chars = 0;
159 num_chars = 0;
105− write!(stdout, "\n{:width$}{}", "", separator, width = longest)?;
160+ result += &format!("\n{:width$}{}", "", separator, width = longest);
106 }
161 }
107
162
108 num_chars += new_chars;
163 num_chars += new_chars;
109− write!(stdout, "{}", style.paint(&word[..]))?;
164+ result += &format!("{}", style.paint(&word[..]));
110 if extension.peek().is_some() {
165 if extension.peek().is_some() {
111− write!(stdout, "{}", comma_separator)?;
166+ result += comma_separator;
112 }
167 }
113 }
168 }
114− writeln!(stdout)?;
169+ result += "\n";
115 }
170 }
116 }
171 }
117
172
118− Ok(())
173+ Ok(result)
174+}
175+
176+fn theme_preview_file<'a>() -> Input<'a> {
177+ Input::from_reader(Box::new(BufReader::new(THEME_PREVIEW_DATA)))
119}
178}
120
179
121pub fn list_themes(cfg: &Config) -> Result<()> {
180pub fn list_themes(cfg: &Config) -> Result<()> {
122− let assets = assets_from_cache_or_binary()?;
181+ let assets = assets_from_cache_or_binary(cfg.use_custom_assets)?;
123 let mut config = cfg.clone();
182 let mut config = cfg.clone();
124 let mut style = HashSet::new();
183 let mut style = HashSet::new();
125 style.insert(StyleComponent::Plain);
184 style.insert(StyleComponent::Plain);
185+ config.language = Some("Rust");
126 config.style_components = StyleComponents(style);
186 config.style_components = StyleComponents(style);
127
187
128 let stdout = io::stdout();
188 let stdout = io::stdout();
@@ -137,10 +197,18 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
137 )?;
197 )?;
138 config.theme = theme.to_string();
198 config.theme = theme.to_string();
139 Controller::new(&config, &assets)
199 Controller::new(&config, &assets)
140− .run(vec![Input::theme_preview_file()])
200+ .run(vec![theme_preview_file()])
141 .ok();
201 .ok();
142 writeln!(stdout)?;
202 writeln!(stdout)?;
143 }
203 }
204+ writeln!(
205+ stdout,
206+ "Further themes can be installed to '{}', \
207+ and are added to the cache with `bat cache --build`. \
208+ For more information, see:\n\n \
209+ https://github.com/sharkdp/bat#adding-new-themes",
210+ PROJECT_DIRS.config_dir().join("themes").to_string_lossy()
211+ )?;
144 } else {
212 } else {
145 for theme in assets.themes() {
213 for theme in assets.themes() {
146 writeln!(stdout, "{}", theme)?;
214 writeln!(stdout, "{}", theme)?;
@@ -151,16 +219,79 @@ pub fn list_themes(cfg: &Config) -> Result<()> {
151}
219}
152
220
153fn run_controller(inputs: Vec<Input>, config: &Config) -> Result<bool> {
221fn run_controller(inputs: Vec<Input>, config: &Config) -> Result<bool> {
154− let assets = assets_from_cache_or_binary()?;
222+ let assets = assets_from_cache_or_binary(config.use_custom_assets)?;
155− let controller = Controller::new(&config, &assets);
223+ let controller = Controller::new(config, &assets);
156 controller.run(inputs)
224 controller.run(inputs)
157}
225}
158
226
227+#[cfg(feature = "bugreport")]
228+fn invoke_bugreport(app: &App) {
229+ use bugreport::{bugreport, collector::*, format::Markdown};
230+ let pager = bat::config::get_pager_executable(app.matches.value_of("pager"))
231+ .unwrap_or_else(|| "less".to_owned()); // FIXME: Avoid non-canonical path to "less".
232+
233+ let mut custom_assets_metadata = PROJECT_DIRS.cache_dir().to_path_buf();
234+ custom_assets_metadata.push("metadata.yaml");
235+
236+ let mut report = bugreport!()
237+ .info(SoftwareVersion::default())
238+ .info(OperatingSystem::default())
239+ .info(CommandLine::default())
240+ .info(EnvironmentVariables::list(&[
241+ "SHELL",
242+ "PAGER",
243+ "LESS",
244+ "LANG",
245+ "LC_ALL",
246+ "BAT_PAGER",
247+ "BAT_CACHE_PATH",
248+ "BAT_CONFIG_PATH",
249+ "BAT_OPTS",
250+ "BAT_STYLE",
251+ "BAT_TABS",
252+ "BAT_THEME",
253+ "XDG_CONFIG_HOME",
254+ "XDG_CACHE_HOME",
255+ "COLORTERM",
256+ "NO_COLOR",
257+ "MANPAGER",
258+ ]))
259+ .info(FileContent::new("Config file", config_file()))
260+ .info(FileContent::new(
261+ "Custom assets metadata",
262+ custom_assets_metadata,
263+ ))
264+ .info(DirectoryEntries::new(
265+ "Custom assets",
266+ PROJECT_DIRS.cache_dir(),
267+ ))
268+ .info(CompileTimeInformation::default());
269+
270+ #[cfg(feature = "paging")]
271+ if let Ok(resolved_path) = grep_cli::resolve_binary(pager) {
272+ report = report.info(CommandOutput::new(
273+ "Less version",
274+ resolved_path,
275+ &["--version"],
276+ ))
277+ };
278+
279+ report.print::<Markdown>();
280+}
281+
159/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Ok(true)` on full success and
282/// Returns `Err(..)` upon fatal errors. Otherwise, returns `Ok(true)` on full success and
160/// `Ok(false)` if any intermediate errors occurred (were printed).
283/// `Ok(false)` if any intermediate errors occurred (were printed).
161fn run() -> Result<bool> {
284fn run() -> Result<bool> {
162 let app = App::new()?;
285 let app = App::new()?;
163
286
287+ if app.matches.is_present("diagnostic") {
288+ #[cfg(feature = "bugreport")]
289+ invoke_bugreport(&app);
290+ #[cfg(not(feature = "bugreport"))]
291+ println!("bat has been built without the 'bugreport' feature. The '--diagnostic' option is not available.");
292+ return Ok(true);
293+ }
294+
164 match app.matches.subcommand() {
295 match app.matches.subcommand() {
165 ("cache", Some(cache_matches)) => {
296 ("cache", Some(cache_matches)) => {
166 // If there is a file named 'cache' in the current working directory,
297 // If there is a file named 'cache' in the current working directory,
@@ -170,7 +301,7 @@ fn run() -> Result<bool> {
170 run_cache_subcommand(cache_matches)?;
301 run_cache_subcommand(cache_matches)?;
171 Ok(true)
302 Ok(true)
172 } else {
303 } else {
173− let inputs = vec![Input::ordinary_file(OsStr::new("cache"))];
304+ let inputs = vec![Input::ordinary_file("cache")];
174 let config = app.config(&inputs)?;
305 let config = app.config(&inputs)?;
175
306
176 run_controller(inputs, &config)
307 run_controller(inputs, &config)
@@ -181,8 +312,14 @@ fn run() -> Result<bool> {
181 let config = app.config(&inputs)?;
312 let config = app.config(&inputs)?;
182
313
183 if app.matches.is_present("list-languages") {
314 if app.matches.is_present("list-languages") {
184− list_languages(&config)?;
315+ let languages: String = get_languages(&config)?;
185− Ok(true)
316+ let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
317+ let plain_config = Config {
318+ style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
319+ paging_mode: PagingMode::QuitIfOneScreen,
320+ ..Default::default()
321+ };
322+ run_controller(inputs, &plain_config)
186 } else if app.matches.is_present("list-themes") {
323 } else if app.matches.is_present("list-themes") {
187 list_themes(&config)?;
324 list_themes(&config)?;
188 Ok(true)
325 Ok(true)
@@ -198,6 +335,9 @@ fn run() -> Result<bool> {
198 } else if app.matches.is_present("cache-dir") {
335 } else if app.matches.is_present("cache-dir") {
199 writeln!(io::stdout(), "{}", cache_dir())?;
336 writeln!(io::stdout(), "{}", cache_dir())?;
200 Ok(true)
337 Ok(true)
338+ } else if app.matches.is_present("acknowledgements") {
339+ writeln!(io::stdout(), "{}", bat::assets::get_acknowledgements())?;
340+ Ok(true)
201 } else {
341 } else {
202 run_controller(inputs, &config)
342 run_controller(inputs, &config)
203 }
343 }
src/config.rs+12
@@ -82,6 +82,18 @@ pub struct Config<'a> {
82
82
83 /// Ranges of lines which should be highlighted with a special background color
83 /// Ranges of lines which should be highlighted with a special background color
84 pub highlighted_lines: HighlightedLineRanges,
84 pub highlighted_lines: HighlightedLineRanges,
85+
86+ /// Whether or not to allow custom assets. If this is false or if custom assets (a.k.a.
87+ /// cached assets) are not available, assets from the binary will be used instead.
88+ pub use_custom_assets: bool,
89+}
90+
91+#[cfg(all(feature = "minimal-application", feature = "paging"))]
92+pub fn get_pager_executable(config_pager: Option<&str>) -> Option<String> {
93+ crate::pager::get_pager(config_pager)
94+ .ok()
95+ .flatten()
96+ .map(|pager| pager.bin)
85}
97}
86
98
87#[test]
99#[test]
src/controller.rs+96−76
@@ -1,4 +1,4 @@
1−use std::io::{self, Write};
1+use std::io::{self, BufRead, Write};
2
2
3use crate::assets::HighlightingAssets;
3use crate::assets::HighlightingAssets;
4use crate::config::{Config, VisibleLines};
4use crate::config::{Config, VisibleLines};
@@ -14,6 +14,8 @@ use crate::output::OutputType;
14use crate::paging::PagingMode;
14use crate::paging::PagingMode;
15use crate::printer::{InteractivePrinter, Printer, SimplePrinter};
15use crate::printer::{InteractivePrinter, Printer, SimplePrinter};
16
16
17+use clircle::{Clircle, Identifier};
18+
17pub struct Controller<'a> {
19pub struct Controller<'a> {
18 config: &'a Config<'a>,
20 config: &'a Config<'a>,
19 assets: &'a HighlightingAssets,
21 assets: &'a HighlightingAssets,
@@ -43,7 +45,7 @@ impl<'b> Controller<'b> {
43 // Do not launch the pager if NONE of the input files exist
45 // Do not launch the pager if NONE of the input files exist
44 let mut paging_mode = self.config.paging_mode;
46 let mut paging_mode = self.config.paging_mode;
45 if self.config.paging_mode != PagingMode::Never {
47 if self.config.paging_mode != PagingMode::Never {
46− let call_pager = inputs.iter().any(|ref input| {
48+ let call_pager = inputs.iter().any(|input| {
47 if let InputKind::OrdinaryFile(ref path) = input.kind {
49 if let InputKind::OrdinaryFile(ref path) = input.kind {
48 Path::new(path).exists()
50 Path::new(path).exists()
49 } else {
51 } else {
@@ -54,7 +56,10 @@ impl<'b> Controller<'b> {
54 paging_mode = PagingMode::Never;
56 paging_mode = PagingMode::Never;
55 }
57 }
56 }
58 }
57− output_type = OutputType::from_mode(paging_mode, self.config.pager)?;
59+
60+ let wrapping_mode = self.config.wrapping_mode;
61+
62+ output_type = OutputType::from_mode(paging_mode, wrapping_mode, self.config.pager)?;
58 }
63 }
59
64
60 #[cfg(not(feature = "paging"))]
65 #[cfg(not(feature = "paging"))]
@@ -63,88 +68,100 @@ impl<'b> Controller<'b> {
63 }
68 }
64
69
65 let attached_to_pager = output_type.is_pager();
70 let attached_to_pager = output_type.is_pager();
71+ let stdout_identifier = if cfg!(windows) || attached_to_pager {
72+ None
73+ } else {
74+ clircle::Identifier::stdout()
75+ };
76+
66 let writer = output_type.handle()?;
77 let writer = output_type.handle()?;
67 let mut no_errors: bool = true;
78 let mut no_errors: bool = true;
68−
69 let stderr = io::stderr();
79 let stderr = io::stderr();
70− let print_error = |error: &Error, write: &mut dyn Write| {
71− if attached_to_pager {
72− handle_error(error, write);
73− } else {
74− handle_error(error, &mut stderr.lock());
75− }
76− };
77
80
78 for (index, input) in inputs.into_iter().enumerate() {
81 for (index, input) in inputs.into_iter().enumerate() {
79− match input.open(io::stdin().lock()) {
82+ let identifier = stdout_identifier.as_ref();
80− Err(error) => {
83+ let is_first = index == 0;
81− print_error(&error, writer);
84+ let result = if input.is_stdin() {
82− no_errors = false;
85+ self.print_input(input, writer, io::stdin().lock(), identifier, is_first)
86+ } else {
87+ // Use dummy stdin since stdin is actually not used (#1902)
88+ self.print_input(input, writer, io::empty(), identifier, is_first)
89+ };
90+ if let Err(error) = result {
91+ if attached_to_pager {
92+ handle_error(&error, writer);
93+ } else {
94+ handle_error(&error, &mut stderr.lock());
83 }
95 }
84− Ok(mut opened_input) => {
96+ no_errors = false;
85− #[cfg(feature = "git")]
97+ }
86− let line_changes = if self.config.visible_lines.diff_mode()
98+ }
87− || (!self.config.loop_through && self.config.style_components.changes())
88− {
89− match opened_input.kind {
90− crate::input::OpenedInputKind::OrdinaryFile(ref path) => {
91− let diff = get_git_diff(path);
92−
93− // Skip files without Git modifications
94− if self.config.visible_lines.diff_mode()
95− && diff
96− .as_ref()
97− .map(|changes| changes.is_empty())
98− .unwrap_or(false)
99− {
100− continue;
101− }
102−
103− diff
104− }
105− _ if self.config.visible_lines.diff_mode() => {
106− // Skip non-file inputs in diff mode
107− continue;
108− }
109− _ => None,
110− }
111− } else {
112− None
113− };
114
99
115− let mut printer: Box<dyn Printer> = if self.config.loop_through {
100+ Ok(no_errors)
116− Box::new(SimplePrinter::new())
101+ }
117− } else {
102+
118− Box::new(InteractivePrinter::new(
103+ fn print_input<R: BufRead>(
119− &self.config,
104+ &self,
120− &self.assets,
105+ input: Input,
121− &mut opened_input,
106+ writer: &mut dyn Write,
122− #[cfg(feature = "git")]
107+ stdin: R,
123− &line_changes,
108+ stdout_identifier: Option<&Identifier>,
124− ))
109+ is_first: bool,
125− };
110+ ) -> Result<()> {
126−
111+ let mut opened_input = input.open(stdin, stdout_identifier)?;
127− let result = self.print_file(
112+ #[cfg(feature = "git")]
128− &mut *printer,
113+ let line_changes = if self.config.visible_lines.diff_mode()
129− writer,
114+ || (!self.config.loop_through && self.config.style_components.changes())
130− &mut opened_input,
115+ {
131− index != 0,
116+ match opened_input.kind {
132− #[cfg(feature = "git")]
117+ crate::input::OpenedInputKind::OrdinaryFile(ref path) => {
133− &line_changes,
118+ let diff = get_git_diff(path);
134− );
119+
135−
120+ // Skip files without Git modifications
136− if let Err(error) = result {
121+ if self.config.visible_lines.diff_mode()
137− print_error(&error, writer);
122+ && diff
138− no_errors = false;
123+ .as_ref()
124+ .map(|changes| changes.is_empty())
125+ .unwrap_or(false)
126+ {
127+ return Ok(());
139 }
128 }
129+
130+ diff
140 }
131 }
132+ _ if self.config.visible_lines.diff_mode() => {
133+ // Skip non-file inputs in diff mode
134+ return Ok(());
135+ }
136+ _ => None,
141 }
137 }
142− }
138+ } else {
139+ None
140+ };
143
141
144− Ok(no_errors)
142+ let mut printer: Box<dyn Printer> = if self.config.loop_through {
143+ Box::new(SimplePrinter::new(self.config))
144+ } else {
145+ Box::new(InteractivePrinter::new(
146+ self.config,
147+ self.assets,
148+ &mut opened_input,
149+ #[cfg(feature = "git")]
150+ &line_changes,
151+ )?)
152+ };
153+
154+ self.print_file(
155+ &mut *printer,
156+ writer,
157+ &mut opened_input,
158+ !is_first,
159+ #[cfg(feature = "git")]
160+ &line_changes,
161+ )
145 }
162 }
146
163
147− fn print_file<'a>(
164+ fn print_file(
148 &self,
165 &self,
149 printer: &mut dyn Printer,
166 printer: &mut dyn Printer,
150 writer: &mut dyn Write,
167 writer: &mut dyn Write,
@@ -164,9 +181,10 @@ impl<'b> Controller<'b> {
164 let mut line_ranges: Vec<LineRange> = vec![];
181 let mut line_ranges: Vec<LineRange> = vec![];
165
182
166 if let Some(line_changes) = line_changes {
183 if let Some(line_changes) = line_changes {
167− for line in line_changes.keys() {
184+ for &line in line_changes.keys() {
168− let line = *line as usize;
185+ let line = line as usize;
169− line_ranges.push(LineRange::new(line - context, line + context));
186+ line_ranges
187+ .push(LineRange::new(line.saturating_sub(context), line + context));
170 }
188 }
171 }
189 }
172
190
@@ -194,6 +212,8 @@ impl<'b> Controller<'b> {
194 let mut first_range: bool = true;
212 let mut first_range: bool = true;
195 let mut mid_range: bool = false;
213 let mut mid_range: bool = false;
196
214
215+ let style_snip = self.config.style_components.snip();
216+
197 while reader.read_line(&mut line_buffer)? {
217 while reader.read_line(&mut line_buffer)? {
198 match line_ranges.check(line_number) {
218 match line_ranges.check(line_number) {
199 RangeCheckResult::BeforeOrBetweenRanges => {
219 RangeCheckResult::BeforeOrBetweenRanges => {
@@ -204,7 +224,7 @@ impl<'b> Controller<'b> {
204 }
224 }
205
225
206 RangeCheckResult::InRange => {
226 RangeCheckResult::InRange => {
207− if self.config.style_components.snip() {
227+ if style_snip {
208 if first_range {
228 if first_range {
209 first_range = false;
229 first_range = false;
210 mid_range = true;
230 mid_range = true;
src/diff.rs+1−2
@@ -1,7 +1,6 @@
1#![cfg(feature = "git")]
1#![cfg(feature = "git")]
2
2
3use std::collections::HashMap;
3use std::collections::HashMap;
4−use std::ffi::OsStr;
5use std::fs;
4use std::fs;
6use std::path::Path;
5use std::path::Path;
7
6
@@ -17,7 +16,7 @@ pub enum LineChange {
17
16
18pub type LineChanges = HashMap<u32, LineChange>;
17pub type LineChanges = HashMap<u32, LineChange>;
19
18
20−pub fn get_git_diff(filename: &OsStr) -> Option<LineChanges> {
19+pub fn get_git_diff(filename: &Path) -> Option<LineChanges> {
21 let repo = Repository::discover(&filename).ok()?;
20 let repo = Repository::discover(&filename).ok()?;
22
21
23 let repo_path_absolute = fs::canonicalize(repo.workdir()?).ok()?;
22 let repo_path_absolute = fs::canonicalize(repo.workdir()?).ok()?;
src/error.rs+41−13
@@ -1,27 +1,55 @@
1−use error_chain::error_chain;
2use std::io::Write;
1use std::io::Write;
2+use thiserror::Error;
3
3
4−error_chain! {
4+#[derive(Error, Debug)]
5− foreign_links {
5+#[non_exhaustive]
6− Clap(::clap::Error) #[cfg(feature = "application")];
6+pub enum Error {
7− Io(::std::io::Error);
7+ #[error(transparent)]
8− SyntectError(::syntect::LoadingError);
8+ Io(#[from] ::std::io::Error),
9− ParseIntError(::std::num::ParseIntError);
9+ #[error(transparent)]
10− GlobParsingError(::globset::Error);
10+ SyntectError(#[from] ::syntect::Error),
11− SerdeYamlError(::serde_yaml::Error);
11+ #[error(transparent)]
12+ SyntectLoadingError(#[from] ::syntect::LoadingError),
13+ #[error(transparent)]
14+ ParseIntError(#[from] ::std::num::ParseIntError),
15+ #[error(transparent)]
16+ GlobParsingError(#[from] ::globset::Error),
17+ #[error(transparent)]
18+ SerdeYamlError(#[from] ::serde_yaml::Error),
19+ #[error("unable to detect syntax for {0}")]
20+ UndetectedSyntax(String),
21+ #[error("unknown syntax: '{0}'")]
22+ UnknownSyntax(String),
23+ #[error("Unknown style '{0}'")]
24+ UnknownStyle(String),
25+ #[error("Use of bat as a pager is disallowed in order to avoid infinite recursion problems")]
26+ InvalidPagerValueBat,
27+ #[error("{0}")]
28+ Msg(String),
29+}
30+
31+impl From<&'static str> for Error {
32+ fn from(s: &'static str) -> Self {
33+ Error::Msg(s.to_owned())
34+ }
35+}
36+
37+impl From<String> for Error {
38+ fn from(s: String) -> Self {
39+ Error::Msg(s)
12 }
40 }
13}
41}
14
42
43+pub type Result<T> = std::result::Result<T, Error>;
44+
15pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
45pub fn default_error_handler(error: &Error, output: &mut dyn Write) {
16 use ansi_term::Colour::Red;
46 use ansi_term::Colour::Red;
17
47
18 match error {
48 match error {
19− Error(ErrorKind::Io(ref io_error), _)
49+ Error::Io(ref io_error) if io_error.kind() == ::std::io::ErrorKind::BrokenPipe => {
20− if io_error.kind() == ::std::io::ErrorKind::BrokenPipe =>
21− {
22 ::std::process::exit(0);
50 ::std::process::exit(0);
23 }
51 }
24− Error(ErrorKind::SerdeYamlError(_), _) => {
52+ Error::SerdeYamlError(_) => {
25 writeln!(
53 writeln!(
26 output,
54 output,
27 "{}: Error while parsing metadata.yaml file: {}",
55 "{}: Error while parsing metadata.yaml file: {}",
src/input.rs+185−100
@@ -1,126 +1,246 @@
1−use std::ffi::{OsStr, OsString};
1+use std::convert::TryFrom;
2+use std::fs;
2use std::fs::File;
3use std::fs::File;
3use std::io::{self, BufRead, BufReader, Read};
4use std::io::{self, BufRead, BufReader, Read};
5+use std::path::{Path, PathBuf};
4
6
7+use clircle::{Clircle, Identifier};
5use content_inspector::{self, ContentType};
8use content_inspector::{self, ContentType};
6
9
7use crate::error::*;
10use crate::error::*;
8
11
9−const THEME_PREVIEW_FILE: &[u8] = include_bytes!("../assets/theme_preview.rs");
12+/// A description of an Input source.
13+/// This tells bat how to refer to the input.
14+#[derive(Clone)]
15+pub struct InputDescription {
16+ pub(crate) name: String,
10
17
11−#[derive(Debug, Clone)]
18+ /// The input title.
12−pub(crate) struct InputDescription {
19+ /// This replaces the name if provided.
13− pub full: String,
20+ title: Option<String>,
14− pub prefix: String,
21+
15− pub name: String,
22+ /// The input kind.
23+ kind: Option<String>,
24+
25+ /// A summary description of the input.
26+ /// Defaults to "{kind} '{name}'"
27+ summary: Option<String>,
28+}
29+
30+impl InputDescription {
31+ /// Creates a description for an input.
32+ pub fn new(name: impl Into<String>) -> Self {
33+ InputDescription {
34+ name: name.into(),
35+ title: None,
36+ kind: None,
37+ summary: None,
38+ }
39+ }
40+
41+ pub fn set_kind(&mut self, kind: Option<String>) {
42+ self.kind = kind;
43+ }
44+
45+ pub fn set_summary(&mut self, summary: Option<String>) {
46+ self.summary = summary;
47+ }
48+
49+ pub fn set_title(&mut self, title: Option<String>) {
50+ self.title = title;
51+ }
52+
53+ pub fn title(&self) -> &String {
54+ match &self.title {
55+ Some(title) => title,
56+ None => &self.name,
57+ }
58+ }
59+
60+ pub fn kind(&self) -> Option<&String> {
61+ self.kind.as_ref()
62+ }
63+
64+ pub fn summary(&self) -> String {
65+ self.summary.clone().unwrap_or_else(|| match &self.kind {
66+ None => self.name.clone(),
67+ Some(kind) => format!("{} '{}'", kind.to_lowercase(), self.name),
68+ })
69+ }
16}
70}
17
71
18pub(crate) enum InputKind<'a> {
72pub(crate) enum InputKind<'a> {
19− OrdinaryFile(OsString),
73+ OrdinaryFile(PathBuf),
20 StdIn,
74 StdIn,
21− ThemePreviewFile,
22 CustomReader(Box<dyn Read + 'a>),
75 CustomReader(Box<dyn Read + 'a>),
23}
76}
24
77
78+impl<'a> InputKind<'a> {
79+ pub fn description(&self) -> InputDescription {
80+ match self {
81+ InputKind::OrdinaryFile(ref path) => InputDescription::new(path.to_string_lossy()),
82+ InputKind::StdIn => InputDescription::new("STDIN"),
83+ InputKind::CustomReader(_) => InputDescription::new("READER"),
84+ }
85+ }
86+}
87+
25#[derive(Clone, Default)]
88#[derive(Clone, Default)]
26pub(crate) struct InputMetadata {
89pub(crate) struct InputMetadata {
27− pub(crate) user_provided_name: Option<OsString>,
90+ pub(crate) user_provided_name: Option<PathBuf>,
91+ pub(crate) size: Option<u64>,
28}
92}
29
93
30pub struct Input<'a> {
94pub struct Input<'a> {
31 pub(crate) kind: InputKind<'a>,
95 pub(crate) kind: InputKind<'a>,
32 pub(crate) metadata: InputMetadata,
96 pub(crate) metadata: InputMetadata,
97+ pub(crate) description: InputDescription,
33}
98}
34
99
35pub(crate) enum OpenedInputKind {
100pub(crate) enum OpenedInputKind {
36− OrdinaryFile(OsString),
101+ OrdinaryFile(PathBuf),
37 StdIn,
102 StdIn,
38− ThemePreviewFile,
39 CustomReader,
103 CustomReader,
40}
104}
41
105
42−impl OpenedInputKind {
43− pub(crate) fn is_theme_preview_file(&self) -> bool {
44− match self {
45− OpenedInputKind::ThemePreviewFile => true,
46− _ => false,
47− }
48− }
49−}
50−
51pub(crate) struct OpenedInput<'a> {
106pub(crate) struct OpenedInput<'a> {
52 pub(crate) kind: OpenedInputKind,
107 pub(crate) kind: OpenedInputKind,
53 pub(crate) metadata: InputMetadata,
108 pub(crate) metadata: InputMetadata,
54 pub(crate) reader: InputReader<'a>,
109 pub(crate) reader: InputReader<'a>,
110+ pub(crate) description: InputDescription,
111+}
112+
113+impl OpenedInput<'_> {
114+ /// Get the path of the file:
115+ /// If this was set by the metadata, that will take priority.
116+ /// If it wasn't, it will use the real file path (if available).
117+ pub(crate) fn path(&self) -> Option<&PathBuf> {
118+ self.metadata
119+ .user_provided_name
120+ .as_ref()
121+ .or(match self.kind {
122+ OpenedInputKind::OrdinaryFile(ref path) => Some(path),
123+ _ => None,
124+ })
125+ }
55}
126}
56
127
57impl<'a> Input<'a> {
128impl<'a> Input<'a> {
58− pub fn ordinary_file(path: &OsStr) -> Self {
129+ pub fn ordinary_file(path: impl AsRef<Path>) -> Self {
59− Input {
130+ Self::_ordinary_file(path.as_ref())
60− kind: InputKind::OrdinaryFile(path.to_os_string()),
61− metadata: InputMetadata::default(),
62− }
63 }
131 }
64
132
65− pub fn stdin() -> Self {
133+ fn _ordinary_file(path: &Path) -> Self {
134+ let kind = InputKind::OrdinaryFile(path.to_path_buf());
135+ let metadata = InputMetadata {
136+ size: fs::metadata(path).map(|m| m.len()).ok(),
137+ ..InputMetadata::default()
138+ };
139+
66 Input {
140 Input {
67− kind: InputKind::StdIn,
141+ description: kind.description(),
68− metadata: InputMetadata::default(),
142+ metadata,
143+ kind,
69 }
144 }
70 }
145 }
71
146
72− pub fn theme_preview_file() -> Self {
147+ pub fn stdin() -> Self {
148+ let kind = InputKind::StdIn;
73 Input {
149 Input {
74− kind: InputKind::ThemePreviewFile,
150+ description: kind.description(),
75 metadata: InputMetadata::default(),
151 metadata: InputMetadata::default(),
152+ kind,
76 }
153 }
77 }
154 }
78
155
79 pub fn from_reader(reader: Box<dyn Read + 'a>) -> Self {
156 pub fn from_reader(reader: Box<dyn Read + 'a>) -> Self {
157+ let kind = InputKind::CustomReader(reader);
80 Input {
158 Input {
81− kind: InputKind::CustomReader(reader),
159+ description: kind.description(),
82 metadata: InputMetadata::default(),
160 metadata: InputMetadata::default(),
161+ kind,
83 }
162 }
84 }
163 }
85
164
86 pub fn is_stdin(&self) -> bool {
165 pub fn is_stdin(&self) -> bool {
87− if let InputKind::StdIn = self.kind {
166+ matches!(self.kind, InputKind::StdIn)
88− true
167+ }
89− } else {
168+
90− false
169+ pub fn with_name(self, provided_name: Option<impl AsRef<Path>>) -> Self {
91− }
170+ self._with_name(provided_name.as_ref().map(|it| it.as_ref()))
92 }
171 }
93
172
94− pub fn with_name(mut self, provided_name: Option<&OsStr>) -> Self {
173+ fn _with_name(mut self, provided_name: Option<&Path>) -> Self {
174+ if let Some(name) = provided_name {
175+ self.description.name = name.to_string_lossy().to_string()
176+ }
177+
95 self.metadata.user_provided_name = provided_name.map(|n| n.to_owned());
178 self.metadata.user_provided_name = provided_name.map(|n| n.to_owned());
96 self
179 self
97 }
180 }
98
181
99− pub(crate) fn open<R: BufRead + 'a>(self, stdin: R) -> Result<OpenedInput<'a>> {
182+ pub fn description(&self) -> &InputDescription {
183+ &self.description
184+ }
185+
186+ pub fn description_mut(&mut self) -> &mut InputDescription {
187+ &mut self.description
188+ }
189+
190+ pub(crate) fn open<R: BufRead + 'a>(
191+ self,
192+ stdin: R,
193+ stdout_identifier: Option<&Identifier>,
194+ ) -> Result<OpenedInput<'a>> {
195+ let description = self.description().clone();
100 match self.kind {
196 match self.kind {
101− InputKind::StdIn => Ok(OpenedInput {
197+ InputKind::StdIn => {
102− kind: OpenedInputKind::StdIn,
198+ if let Some(stdout) = stdout_identifier {
103− metadata: self.metadata,
199+ let input_identifier = Identifier::try_from(clircle::Stdio::Stdin)
104− reader: InputReader::new(stdin),
200+ .map_err(|e| format!("Stdin: Error identifying file: {}", e))?;
105− }),
201+ if stdout.surely_conflicts_with(&input_identifier) {
202+ return Err("IO circle detected. The input from stdin is also an output. Aborting to avoid infinite loop.".into());
203+ }
204+ }
205+
206+ Ok(OpenedInput {
207+ kind: OpenedInputKind::StdIn,
208+ description,
209+ metadata: self.metadata,
210+ reader: InputReader::new(stdin),
211+ })
212+ }
213+
106 InputKind::OrdinaryFile(path) => Ok(OpenedInput {
214 InputKind::OrdinaryFile(path) => Ok(OpenedInput {
107 kind: OpenedInputKind::OrdinaryFile(path.clone()),
215 kind: OpenedInputKind::OrdinaryFile(path.clone()),
216+ description,
108 metadata: self.metadata,
217 metadata: self.metadata,
109 reader: {
218 reader: {
110− let file = File::open(&path)
219+ let mut file = File::open(&path)
111 .map_err(|e| format!("'{}': {}", path.to_string_lossy(), e))?;
220 .map_err(|e| format!("'{}': {}", path.to_string_lossy(), e))?;
112 if file.metadata()?.is_dir() {
221 if file.metadata()?.is_dir() {
113 return Err(format!("'{}' is a directory.", path.to_string_lossy()).into());
222 return Err(format!("'{}' is a directory.", path.to_string_lossy()).into());
114 }
223 }
224+
225+ if let Some(stdout) = stdout_identifier {
226+ let input_identifier = Identifier::try_from(file).map_err(|e| {
227+ format!("{}: Error identifying file: {}", path.to_string_lossy(), e)
228+ })?;
229+ if stdout.surely_conflicts_with(&input_identifier) {
230+ return Err(format!(
231+ "IO circle detected. The input from '{}' is also an output. Aborting to avoid infinite loop.",
232+ path.to_string_lossy()
233+ )
234+ .into());
235+ }
236+ file = input_identifier.into_inner().expect("The file was lost in the clircle::Identifier, this should not have happened...");
237+ }
238+
115 InputReader::new(BufReader::new(file))
239 InputReader::new(BufReader::new(file))
116 },
240 },
117 }),
241 }),
118− InputKind::ThemePreviewFile => Ok(OpenedInput {
119− kind: OpenedInputKind::ThemePreviewFile,
120− metadata: self.metadata,
121− reader: InputReader::new(THEME_PREVIEW_FILE),
122− }),
123 InputKind::CustomReader(reader) => Ok(OpenedInput {
242 InputKind::CustomReader(reader) => Ok(OpenedInput {
243+ description,
124 kind: OpenedInputKind::CustomReader,
244 kind: OpenedInputKind::CustomReader,
125 metadata: self.metadata,
245 metadata: self.metadata,
126 reader: InputReader::new(BufReader::new(reader)),
246 reader: InputReader::new(BufReader::new(reader)),
@@ -129,41 +249,6 @@ impl<'a> Input<'a> {
129 }
249 }
130}
250}
131
251
132−impl<'a> OpenedInput<'a> {
133− pub fn description(&self) -> InputDescription {
134− if let Some(ref name) = self.metadata.user_provided_name {
135− InputDescription {
136− full: format!("file '{}'", name.to_string_lossy()),
137− prefix: "File: ".to_owned(),
138− name: name.to_string_lossy().into_owned(),
139− }
140− } else {
141− match self.kind {
142− OpenedInputKind::OrdinaryFile(ref path) => InputDescription {
143− full: format!("file '{}'", path.to_string_lossy()),
144− prefix: "File: ".to_owned(),
145− name: path.to_string_lossy().into_owned(),
146− },
147− OpenedInputKind::StdIn => InputDescription {
148− full: "STDIN".to_owned(),
149− prefix: "".to_owned(),
150− name: "STDIN".to_owned(),
151− },
152− OpenedInputKind::ThemePreviewFile => InputDescription {
153− full: "".to_owned(),
154− prefix: "".to_owned(),
155− name: "".to_owned(),
156− },
157− OpenedInputKind::CustomReader => InputDescription {
158− full: "reader".to_owned(),
159− prefix: "".to_owned(),
160− name: "READER".into(),
161− },
162− }
163− }
164− }
165−}
166−
167pub(crate) struct InputReader<'a> {
252pub(crate) struct InputReader<'a> {
168 inner: Box<dyn BufRead + 'a>,
253 inner: Box<dyn BufRead + 'a>,
169 pub(crate) first_line: Vec<u8>,
254 pub(crate) first_line: Vec<u8>,
@@ -193,18 +278,18 @@ impl<'a> InputReader<'a> {
193 }
278 }
194
279
195 pub(crate) fn read_line(&mut self, buf: &mut Vec<u8>) -> io::Result<bool> {
280 pub(crate) fn read_line(&mut self, buf: &mut Vec<u8>) -> io::Result<bool> {
196− if self.first_line.is_empty() {
281+ if !self.first_line.is_empty() {
197− let res = self.inner.read_until(b'\n', buf).map(|size| size > 0)?;
282+ buf.append(&mut self.first_line);
283+ return Ok(true);
284+ }
198
285
199− if self.content_type == Some(ContentType::UTF_16LE) {
286+ let res = self.inner.read_until(b'\n', buf).map(|size| size > 0)?;
200− self.inner.read_until(0x00, buf).ok();
201− }
202
287
203− Ok(res)
288+ if self.content_type == Some(ContentType::UTF_16LE) {
204− } else {
289+ let _ = self.inner.read_until(0x00, buf);
205− buf.append(&mut self.first_line);
206− Ok(true)
207 }
290 }
291+
292+ Ok(res)
208 }
293 }
209}
294}
210
295
@@ -219,21 +304,21 @@ fn basic() {
219
304
220 let res = reader.read_line(&mut buffer);
305 let res = reader.read_line(&mut buffer);
221 assert!(res.is_ok());
306 assert!(res.is_ok());
222− assert_eq!(true, res.unwrap());
307+ assert!(res.unwrap());
223 assert_eq!(b"#!/bin/bash\n", &buffer[..]);
308 assert_eq!(b"#!/bin/bash\n", &buffer[..]);
224
309
225 buffer.clear();
310 buffer.clear();
226
311
227 let res = reader.read_line(&mut buffer);
312 let res = reader.read_line(&mut buffer);
228 assert!(res.is_ok());
313 assert!(res.is_ok());
229− assert_eq!(true, res.unwrap());
314+ assert!(res.unwrap());
230 assert_eq!(b"echo hello", &buffer[..]);
315 assert_eq!(b"echo hello", &buffer[..]);
231
316
232 buffer.clear();
317 buffer.clear();
233
318
234 let res = reader.read_line(&mut buffer);
319 let res = reader.read_line(&mut buffer);
235 assert!(res.is_ok());
320 assert!(res.is_ok());
236− assert_eq!(false, res.unwrap());
321+ assert!(!res.unwrap());
237 assert!(buffer.is_empty());
322 assert!(buffer.is_empty());
238}
323}
239
324
@@ -248,20 +333,20 @@ fn utf16le() {
248
333
249 let res = reader.read_line(&mut buffer);
334 let res = reader.read_line(&mut buffer);
250 assert!(res.is_ok());
335 assert!(res.is_ok());
251− assert_eq!(true, res.unwrap());
336+ assert!(res.unwrap());
252 assert_eq!(b"\xFF\xFE\x73\x00\x0A\x00", &buffer[..]);
337 assert_eq!(b"\xFF\xFE\x73\x00\x0A\x00", &buffer[..]);
253
338
254 buffer.clear();
339 buffer.clear();
255
340
256 let res = reader.read_line(&mut buffer);
341 let res = reader.read_line(&mut buffer);
257 assert!(res.is_ok());
342 assert!(res.is_ok());
258− assert_eq!(true, res.unwrap());
343+ assert!(res.unwrap());
259 assert_eq!(b"\x64\x00", &buffer[..]);
344 assert_eq!(b"\x64\x00", &buffer[..]);
260
345
261 buffer.clear();
346 buffer.clear();
262
347
263 let res = reader.read_line(&mut buffer);
348 let res = reader.read_line(&mut buffer);
264 assert!(res.is_ok());
349 assert!(res.is_ok());
265− assert_eq!(false, res.unwrap());
350+ assert!(!res.unwrap());
266 assert!(buffer.is_empty());
351 assert!(buffer.is_empty());
267}
352}
src/less.rs+79−12
@@ -1,19 +1,39 @@
1#![cfg(feature = "paging")]
1#![cfg(feature = "paging")]
2
2
3+use std::ffi::OsStr;
3use std::process::Command;
4use std::process::Command;
4
5
5−pub fn retrieve_less_version() -> Option<usize> {
6+#[derive(Debug, PartialEq)]
6− let cmd = Command::new("less").arg("--version").output().ok()?;
7+pub enum LessVersion {
7− parse_less_version(&cmd.stdout)
8+ Less(usize),
9+ BusyBox,
8}
10}
9
11
10−fn parse_less_version(output: &[u8]) -> Option<usize> {
12+pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<LessVersion> {
11− if output.starts_with(b"less ") {
13+ let resolved_path = grep_cli::resolve_binary(less_path.as_ref()).ok()?;
12− let version = std::str::from_utf8(&output[5..]).ok()?;
14+
13− let end = version.find(' ')?;
15+ let cmd = Command::new(resolved_path).arg("--version").output().ok()?;
14− version[..end].parse::<usize>().ok()
16+ if cmd.status.success() {
17+ parse_less_version(&cmd.stdout)
15 } else {
18 } else {
16− None
19+ parse_less_version_busybox(&cmd.stderr)
20+ }
21+}
22+
23+fn parse_less_version(output: &[u8]) -> Option<LessVersion> {
24+ if !output.starts_with(b"less ") {
25+ return None;
26+ }
27+
28+ let version = std::str::from_utf8(&output[5..]).ok()?;
29+ let end = version.find(|c: char| !c.is_ascii_digit())?;
30+ Some(LessVersion::Less(version[..end].parse::<usize>().ok()?))
31+}
32+
33+fn parse_less_version_busybox(output: &[u8]) -> Option<LessVersion> {
34+ match std::str::from_utf8(output) {
35+ Ok(version) if version.contains("BusyBox ") => Some(LessVersion::BusyBox),
36+ _ => None,
17 }
37 }
18}
38}
19
39
@@ -27,7 +47,7 @@ For information about the terms of redistribution,
27see the file named README in the less distribution.
47see the file named README in the less distribution.
28Homepage: http://www.greenwoodsoftware.com/less";
48Homepage: http://www.greenwoodsoftware.com/less";
29
49
30− assert_eq!(Some(487), parse_less_version(output));
50+ assert_eq!(Some(LessVersion::Less(487)), parse_less_version(output));
31}
51}
32
52
33#[test]
53#[test]
@@ -40,7 +60,7 @@ For information about the terms of redistribution,
40see the file named README in the less distribution.
60see the file named README in the less distribution.
41Homepage: http://www.greenwoodsoftware.com/less";
61Homepage: http://www.greenwoodsoftware.com/less";
42
62
43− assert_eq!(Some(529), parse_less_version(output));
63+ assert_eq!(Some(LessVersion::Less(529)), parse_less_version(output));
44}
64}
45
65
46#[test]
66#[test]
@@ -53,7 +73,20 @@ For information about the terms of redistribution,
53see the file named README in the less distribution.
73see the file named README in the less distribution.
54Home page: http://www.greenwoodsoftware.com/less";
74Home page: http://www.greenwoodsoftware.com/less";
55
75
56− assert_eq!(Some(551), parse_less_version(output));
76+ assert_eq!(Some(LessVersion::Less(551)), parse_less_version(output));
77+}
78+
79+#[test]
80+fn test_parse_less_version_581_2() {
81+ let output = b"less 581.2 (PCRE2 regular expressions)
82+Copyright (C) 1984-2021 Mark Nudelman
83+
84+less comes with NO WARRANTY, to the extent permitted by law.
85+For information about the terms of redistribution,
86+see the file named README in the less distribution.
87+Home page: https://greenwoodsoftware.com/less";
88+
89+ assert_eq!(Some(LessVersion::Less(581)), parse_less_version(output));
57}
90}
58
91
59#[test]
92#[test]
@@ -61,4 +94,38 @@ fn test_parse_less_version_wrong_program() {
61 let output = b"more from util-linux 2.34";
94 let output = b"more from util-linux 2.34";
62
95
63 assert_eq!(None, parse_less_version(output));
96 assert_eq!(None, parse_less_version(output));
97+ assert_eq!(None, parse_less_version_busybox(output));
98+}
99+
100+#[test]
101+fn test_parse_less_version_busybox() {
102+ let output = b"pkg/less: unrecognized option '--version'
103+BusyBox v1.35.0 (2022-04-21 10:38:11 EDT) multi-call binary.
104+
105+Usage: less [-EFIMmNSRh~] [FILE]...
106+
107+View FILE (or stdin) one screenful at a time
108+
109+ -E Quit once the end of a file is reached
110+ -F Quit if entire file fits on first screen
111+ -I Ignore case in all searches
112+ -M,-m Display status line with line numbers
113+ and percentage through the file
114+ -N Prefix line number to each line
115+ -S Truncate long lines
116+ -R Remove color escape codes in input
117+ -~ Suppress ~s displayed past EOF";
118+
119+ assert_eq!(
120+ Some(LessVersion::BusyBox),
121+ parse_less_version_busybox(output)
122+ );
123+}
124+
125+#[test]
126+fn test_parse_less_version_invalid_utf_8() {
127+ let output = b"\xff";
128+
129+ assert_eq!(None, parse_less_version(output));
130+ assert_eq!(None, parse_less_version_busybox(output));
64}
131}
src/lib.rs+11−2
@@ -19,8 +19,14 @@
19//! .unwrap();
19//! .unwrap();
20//! ```
20//! ```
21
21
22+#![deny(unsafe_code)]
23+
24+mod macros;
25+
22pub mod assets;
26pub mod assets;
23−pub mod assets_metadata;
27+pub mod assets_metadata {
28+ pub use super::assets::assets_metadata::*;
29+}
24pub mod config;
30pub mod config;
25pub mod controller;
31pub mod controller;
26mod decorations;
32mod decorations;
@@ -31,6 +37,8 @@ mod less;
31pub mod line_range;
37pub mod line_range;
32mod output;
38mod output;
33#[cfg(feature = "paging")]
39#[cfg(feature = "paging")]
40+mod pager;
41+#[cfg(feature = "paging")]
34pub(crate) mod paging;
42pub(crate) mod paging;
35mod preprocessor;
43mod preprocessor;
36mod pretty_printer;
44mod pretty_printer;
@@ -38,9 +46,10 @@ pub(crate) mod printer;
38pub mod style;
46pub mod style;
39pub(crate) mod syntax_mapping;
47pub(crate) mod syntax_mapping;
40mod terminal;
48mod terminal;
49+mod vscreen;
41pub(crate) mod wrapping;
50pub(crate) mod wrapping;
42
51
43−pub use pretty_printer::PrettyPrinter;
52+pub use pretty_printer::{Input, PrettyPrinter};
44pub use syntax_mapping::{MappingTarget, SyntaxMapping};
53pub use syntax_mapping::{MappingTarget, SyntaxMapping};
45pub use wrapping::WrappingMode;
54pub use wrapping::WrappingMode;
46
55
src/line_range.rs+69−1
@@ -47,7 +47,28 @@ impl LineRange {
47 }
47 }
48 2 => {
48 2 => {
49 new_range.lower = line_numbers[0].parse()?;
49 new_range.lower = line_numbers[0].parse()?;
50− new_range.upper = line_numbers[1].parse()?;
50+ let first_byte = line_numbers[1].bytes().next();
51+
52+ new_range.upper = if first_byte == Some(b'+') {
53+ let more_lines = &line_numbers[1][1..]
54+ .parse()
55+ .map_err(|_| "Invalid character after +")?;
56+ new_range.lower + more_lines
57+ } else if first_byte == Some(b'-') {
58+ // this will prevent values like "-+5" even though "+5" is valid integer
59+ if line_numbers[1][1..].bytes().next() == Some(b'+') {
60+ return Err("Invalid character after -".into());
61+ }
62+ let prior_lines = &line_numbers[1][1..]
63+ .parse()
64+ .map_err(|_| "Invalid character after -")?;
65+ let prev_lower = new_range.lower;
66+ new_range.lower = new_range.lower.saturating_sub(*prior_lines);
67+ prev_lower
68+ } else {
69+ line_numbers[1].parse()?
70+ };
71+
51 Ok(new_range)
72 Ok(new_range)
52 }
73 }
53 _ => Err(
74 _ => Err(
@@ -100,6 +121,53 @@ fn test_parse_fail() {
100 assert!(range.is_err());
121 assert!(range.is_err());
101}
122}
102
123
124+#[test]
125+fn test_parse_plus() {
126+ let range = LineRange::from("40:+10").expect("Shouldn't fail on test!");
127+ assert_eq!(40, range.lower);
128+ assert_eq!(50, range.upper);
129+}
130+
131+#[test]
132+fn test_parse_plus_fail() {
133+ let range = LineRange::from("40:+z");
134+ assert!(range.is_err());
135+ let range = LineRange::from("40:+-10");
136+ assert!(range.is_err());
137+ let range = LineRange::from("40:+");
138+ assert!(range.is_err());
139+}
140+
141+#[test]
142+fn test_parse_minus_success() {
143+ let range = LineRange::from("40:-10").expect("Shouldn't fail on test!");
144+ assert_eq!(30, range.lower);
145+ assert_eq!(40, range.upper);
146+}
147+
148+#[test]
149+fn test_parse_minus_edge_cases_success() {
150+ let range = LineRange::from("5:-4").expect("Shouldn't fail on test!");
151+ assert_eq!(1, range.lower);
152+ assert_eq!(5, range.upper);
153+ let range = LineRange::from("5:-5").expect("Shouldn't fail on test!");
154+ assert_eq!(0, range.lower);
155+ assert_eq!(5, range.upper);
156+ let range = LineRange::from("5:-100").expect("Shouldn't fail on test!");
157+ assert_eq!(0, range.lower);
158+ assert_eq!(5, range.upper);
159+}
160+
161+#[test]
162+fn test_parse_minus_fail() {
163+ let range = LineRange::from("40:-z");
164+ assert!(range.is_err());
165+ let range = LineRange::from("40:-+10");
166+ assert!(range.is_err());
167+ let range = LineRange::from("40:-");
168+ assert!(range.is_err());
169+}
170+
103#[derive(Copy, Clone, Debug, PartialEq)]
171#[derive(Copy, Clone, Debug, PartialEq)]
104pub enum RangeCheckResult {
172pub enum RangeCheckResult {
105 // Within one of the given ranges
173 // Within one of the given ranges
src/macros.rsnew file+7
@@ -0,0 +1,7 @@
1+#[macro_export]
2+macro_rules! bat_warning {
3+ ($($arg:tt)*) => ({
4+ use ansi_term::Colour::Yellow;
5+ eprintln!("{}: {}", Yellow.paint("[bat warning]"), format!($($arg)*));
6+ })
7+}
src/output.rs+88−89
@@ -4,9 +4,18 @@ use std::process::Child;
4
4
5use crate::error::*;
5use crate::error::*;
6#[cfg(feature = "paging")]
6#[cfg(feature = "paging")]
7−use crate::less::retrieve_less_version;
7+use crate::less::{retrieve_less_version, LessVersion};
8#[cfg(feature = "paging")]
8#[cfg(feature = "paging")]
9use crate::paging::PagingMode;
9use crate::paging::PagingMode;
10+#[cfg(feature = "paging")]
11+use crate::wrapping::WrappingMode;
12+
13+#[cfg(feature = "paging")]
14+#[derive(Debug, PartialEq)]
15+enum SingleScreenAction {
16+ Quit,
17+ Nothing,
18+}
10
19
11#[derive(Debug)]
20#[derive(Debug)]
12pub enum OutputType {
21pub enum OutputType {
@@ -17,108 +26,102 @@ pub enum OutputType {
17
26
18impl OutputType {
27impl OutputType {
19 #[cfg(feature = "paging")]
28 #[cfg(feature = "paging")]
20− pub fn from_mode(mode: PagingMode, pager: Option<&str>) -> Result<Self> {
29+ pub fn from_mode(
30+ paging_mode: PagingMode,
31+ wrapping_mode: WrappingMode,
32+ pager: Option<&str>,
33+ ) -> Result<Self> {
21 use self::PagingMode::*;
34 use self::PagingMode::*;
22− Ok(match mode {
35+ Ok(match paging_mode {
23− Always => OutputType::try_pager(false, pager)?,
36+ Always => OutputType::try_pager(SingleScreenAction::Nothing, wrapping_mode, pager)?,
24− QuitIfOneScreen => OutputType::try_pager(true, pager)?,
37+ QuitIfOneScreen => {
38+ OutputType::try_pager(SingleScreenAction::Quit, wrapping_mode, pager)?
39+ }
25 _ => OutputType::stdout(),
40 _ => OutputType::stdout(),
26 })
41 })
27 }
42 }
28
43
29 /// Try to launch the pager. Fall back to stdout in case of errors.
44 /// Try to launch the pager. Fall back to stdout in case of errors.
30 #[cfg(feature = "paging")]
45 #[cfg(feature = "paging")]
31− fn try_pager(quit_if_one_screen: bool, pager_from_config: Option<&str>) -> Result<Self> {
46+ fn try_pager(
32− use std::env;
47+ single_screen_action: SingleScreenAction,
33− use std::ffi::OsString;
48+ wrapping_mode: WrappingMode,
34− use std::path::PathBuf;
49+ pager_from_config: Option<&str>,
50+ ) -> Result<Self> {
51+ use crate::pager::{self, PagerKind, PagerSource};
35 use std::process::{Command, Stdio};
52 use std::process::{Command, Stdio};
36
53
37− let mut replace_arguments_to_less = false;
54+ let pager_opt =
55+ pager::get_pager(pager_from_config).map_err(|_| "Could not parse pager command.")?;
38
56
39− let pager_from_env = match (env::var("BAT_PAGER"), env::var("PAGER")) {
57+ let pager = match pager_opt {
40− (Ok(bat_pager), _) => Some(bat_pager),
58+ Some(pager) => pager,
41− (_, Ok(pager)) => {
59+ None => return Ok(OutputType::stdout()),
42− // less needs to be called with the '-R' option in order to properly interpret the
43− // ANSI color sequences printed by bat. If someone has set PAGER="less -F", we
44− // therefore need to overwrite the arguments and add '-R'.
45− //
46− // We only do this for PAGER (as it is not specific to 'bat'), not for BAT_PAGER
47− // or bats '--pager' command line option.
48− replace_arguments_to_less = true;
49− Some(pager)
50− }
51− _ => None,
52 };
60 };
53
61
54− let pager_from_config = pager_from_config.map(|p| p.to_string());
62+ if pager.kind == PagerKind::Bat {
55−
63+ return Err(Error::InvalidPagerValueBat);
56− if pager_from_config.is_some() {
57− replace_arguments_to_less = false;
58 }
64 }
59
65
60− let pager = pager_from_config
66+ let resolved_path = match grep_cli::resolve_binary(&pager.bin) {
61− .or(pager_from_env)
67+ Ok(path) => path,
62− .unwrap_or_else(|| String::from("less"));
68+ Err(_) => {
63−
69+ return Ok(OutputType::stdout());
64− let pagerflags =
70+ }
65− shell_words::split(&pager).chain_err(|| "Could not parse pager command.")?;
71+ };
66
72
67− match pagerflags.split_first() {
73+ let mut p = Command::new(resolved_path);
68− Some((pager_name, args)) => {
74+ let args = pager.args;
69− let mut pager_path = PathBuf::from(pager_name);
75+
76+ if pager.kind == PagerKind::Less {
77+ // less needs to be called with the '-R' option in order to properly interpret the
78+ // ANSI color sequences printed by bat. If someone has set PAGER="less -F", we
79+ // therefore need to overwrite the arguments and add '-R'.
80+ //
81+ // We only do this for PAGER (as it is not specific to 'bat'), not for BAT_PAGER
82+ // or bats '--pager' command line option.
83+ let replace_arguments_to_less = pager.source == PagerSource::EnvVarPager;
84+
85+ if args.is_empty() || replace_arguments_to_less {
86+ p.arg("-R"); // Short version of --RAW-CONTROL-CHARS for maximum compatibility
87+ if single_screen_action == SingleScreenAction::Quit {
88+ p.arg("-F"); // Short version of --quit-if-one-screen for compatibility
89+ }
70
90
71− if pager_path.file_stem() == Some(&OsString::from("bat")) {
91+ if wrapping_mode == WrappingMode::NoWrapping(true) {
72− pager_path = PathBuf::from("less");
92+ p.arg("-S"); // Short version of --chop-long-lines for compatibility
73 }
93 }
74
94
75− let is_less = pager_path.file_stem() == Some(&OsString::from("less"));
95+ // Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
76−
96+ // versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
77− let mut process = if is_less {
97+ //
78− let mut p = Command::new(&pager_path);
98+ // See: http://www.greenwoodsoftware.com/less/news.530.html
79− if args.is_empty() || replace_arguments_to_less {
99+ //
80− p.arg("--RAW-CONTROL-CHARS");
100+ // For newer versions (530 or 558 on Windows), we omit '--no-init' as it
81− if quit_if_one_screen {
101+ // is not needed anymore.
82− p.arg("--quit-if-one-screen");
102+ match retrieve_less_version(&pager.bin) {
83− }
103+ None => {
84−
104+ p.arg("--no-init");
85− // Passing '--no-init' fixes a bug with '--quit-if-one-screen' in older
86− // versions of 'less'. Unfortunately, it also breaks mouse-wheel support.
87− //
88− // See: http://www.greenwoodsoftware.com/less/news.530.html
89− //
90− // For newer versions (530 or 558 on Windows), we omit '--no-init' as it
91− // is not needed anymore.
92− match retrieve_less_version() {
93− None => {
94− p.arg("--no-init");
95− }
96− Some(version)
97− if (version < 530 || (cfg!(windows) && version < 558)) =>
98− {
99− p.arg("--no-init");
100− }
101− _ => {}
102− }
103− } else {
104− p.args(args);
105 }
105 }
106− p.env("LESSCHARSET", "UTF-8");
106+ Some(LessVersion::Less(version))
107− p
107+ if (version < 530 || (cfg!(windows) && version < 558)) =>
108− } else {
108+ {
109− let mut p = Command::new(&pager_path);
109+ p.arg("--no-init");
110− p.args(args);
110+ }
111− p
111+ _ => {}
112− };
112+ }
113−
113+ } else {
114− Ok(process
114+ p.args(args);
115− .stdin(Stdio::piped())
116− .spawn()
117− .map(OutputType::Pager)
118− .unwrap_or_else(|_| OutputType::stdout()))
119 }
115 }
120− None => Ok(OutputType::stdout()),
116+ p.env("LESSCHARSET", "UTF-8");
121− }
117+ } else {
118+ p.args(args);
119+ };
120+
121+ Ok(p.stdin(Stdio::piped())
122+ .spawn()
123+ .map(OutputType::Pager)
124+ .unwrap_or_else(|_| OutputType::stdout()))
122 }
125 }
123
126
124 pub(crate) fn stdout() -> Self {
127 pub(crate) fn stdout() -> Self {
@@ -127,11 +130,7 @@ impl OutputType {
127
130
128 #[cfg(feature = "paging")]
131 #[cfg(feature = "paging")]
129 pub(crate) fn is_pager(&self) -> bool {
132 pub(crate) fn is_pager(&self) -> bool {
130− if let OutputType::Pager(_) = self {
133+ matches!(self, OutputType::Pager(_))
131− true
132− } else {
133− false
134− }
135 }
134 }
136
135
137 #[cfg(not(feature = "paging"))]
136 #[cfg(not(feature = "paging"))]
@@ -145,7 +144,7 @@ impl OutputType {
145 OutputType::Pager(ref mut command) => command
144 OutputType::Pager(ref mut command) => command
146 .stdin
145 .stdin
147 .as_mut()
146 .as_mut()
148− .chain_err(|| "Could not open stdin for pager")?,
147+ .ok_or("Could not open stdin for pager")?,
149 OutputType::Stdout(ref mut handle) => handle,
148 OutputType::Stdout(ref mut handle) => handle,
150 })
149 })
151 }
150 }
src/pager.rsnew file+123

This diff is too big to show here.

src/preprocessor.rs+11−4

This diff is too big to show here.

src/pretty_printer.rs+121−46

This diff is too big to show here.

src/printer.rs+256−152

This diff is too big to show here.

src/style.rs+41−4

This diff is too big to show here.

src/syntax_mapping.rs+138−3

This diff is too big to show here.

src/syntax_mapping/ignored_suffixes.rsnew file+107

This diff is too big to show here.

src/terminal.rs+19−9

This diff is too big to show here.

src/vscreen.rsnew file+212

This diff is too big to show here.

src/wrapping.rs+3−2

This diff is too big to show here.

tests/.gitattributes+12−4

This diff is too big to show here.

tests/assets.rsnew file+42

This diff is too big to show here.

tests/benchmarks/.gitignorenew file+1

This diff is too big to show here.

tests/benchmarks/comparison.shdeleted−31

This diff is too big to show here.

tests/benchmarks/highlighting-speed-src/grep-output-ansi-sequences.txtnew file+2272

This diff is too big to show here.

tests/benchmarks/test-src/jquery-3.3.1.js → tests/benchmarks/highlighting-speed-src/jquery.jsrenamed

The content is the same.

tests/benchmarks/test-src/miniz.c → tests/benchmarks/highlighting-speed-src/miniz.crenamed

The content is the same.

tests/benchmarks/highlighting-speed-src/numpy_test_multiarray.pynew file+8471

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-0.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-1.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-10.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-100.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-11.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-12.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-13.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-14.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-15.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-16.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-17.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-18.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-19.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-2.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-20.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-21.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-22.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-23.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-24.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-25.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-26.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-27.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-28.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-29.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-3.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-30.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-31.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-32.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-33.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-34.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-35.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-36.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-37.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-38.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-39.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-4.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-40.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-41.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-42.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-43.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-44.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-45.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-46.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-47.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-48.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-49.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-5.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-50.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-51.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-52.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-53.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-54.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-55.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-56.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-57.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-58.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-59.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-6.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-60.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-61.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-62.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-63.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-64.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-65.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-66.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-67.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-68.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-69.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-7.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-70.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-71.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-72.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-73.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-74.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-75.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-76.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-77.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-78.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-79.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-8.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-80.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-81.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-82.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-83.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-84.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-85.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-86.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-87.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-88.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-89.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-9.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-90.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-91.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-92.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-93.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-94.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-95.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-96.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-97.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-98.txtnew file+1

This diff is too big to show here.

tests/benchmarks/many-small-files/small-file-99.txtnew file+1

This diff is too big to show here.

tests/benchmarks/run-benchmarks.shmode 100644 → 100755+139−17

This diff is too big to show here.

tests/benchmarks/startup-time-src/small-CpuInfo-file.cpuinfonew file+1

This diff is too big to show here.

tests/benchmarks/startup-time-src/small-Markdown-file.mdnew file+3

This diff is too big to show here.

tests/benchmarks/test-src/jquery-3.3.1.min.jsdeleted−2

This diff is too big to show here.

tests/examples/git/.config/git/confignew file+3

This diff is too big to show here.

tests/examples/git/.gitconfignew file+3

This diff is too big to show here.

tests/examples/longline.jsonnew file+3

This diff is too big to show here.

tests/examples/nonprintable.txtnew file

Binary file not shown.

tests/examples/regression_tests/first_line_fallback.invalid-syntaxnew file+2

This diff is too big to show here.

tests/examples/test.json.suffixnew file+1

This diff is too big to show here.

tests/examples/test.json~new file+1

This diff is too big to show here.

tests/integration_tests.rs+860−16

This diff is too big to show here.

tests/mocked-pagers/morenew file+2

This diff is too big to show here.

tests/mocked-pagers/more.batnew file+1

This diff is too big to show here.

tests/mocked-pagers/mostnew file+2

This diff is too big to show here.

tests/mocked-pagers/most.batnew file+1

This diff is too big to show here.

tests/no_duplicate_extensions.rs+7−4

This diff is too big to show here.

tests/scripts/find-slow-to-highlight-files.py+2−2

This diff is too big to show here.

tests/scripts/license-checks.shnew file+24

This diff is too big to show here.

tests/snapshot_tests.rs+11−1

This diff is too big to show here.

tests/snapshots/generate_snapshots.py+1−1

This diff is too big to show here.

tests/snapshots/output/changes.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/changes_grid.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/changes_grid_header.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/changes_grid_header_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/changes_grid_header_numbers_rule.snapshot.txtnew file+27

This diff is too big to show here.

tests/snapshots/output/changes_grid_header_rule.snapshot.txtnew file+27

This diff is too big to show here.

tests/snapshots/output/changes_grid_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/changes_grid_numbers_rule.snapshot.txtnew file+25

This diff is too big to show here.

tests/snapshots/output/changes_grid_rule.snapshot.txtnew file+25

This diff is too big to show here.

tests/snapshots/output/changes_header.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/changes_header_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/changes_header_numbers_rule.snapshot.txtnew file+24

This diff is too big to show here.

tests/snapshots/output/changes_header_rule.snapshot.txtnew file+24

This diff is too big to show here.

tests/snapshots/output/changes_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/changes_numbers_rule.snapshot.txtnew file+23

This diff is too big to show here.

tests/snapshots/output/changes_rule.snapshot.txtnew file+23

This diff is too big to show here.

tests/snapshots/output/full.snapshot.txt+24−22

This diff is too big to show here.

tests/snapshots/output/grid.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/grid_header.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/grid_header_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/grid_header_numbers_rule.snapshot.txtnew file+27

This diff is too big to show here.

tests/snapshots/output/grid_header_rule.snapshot.txtnew file+27

This diff is too big to show here.

tests/snapshots/output/grid_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/grid_numbers_rule.snapshot.txtnew file+25

This diff is too big to show here.

tests/snapshots/output/grid_rule.snapshot.txtnew file+25

This diff is too big to show here.

tests/snapshots/output/header.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/header_numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/header_numbers_rule.snapshot.txtnew file+24

This diff is too big to show here.

tests/snapshots/output/header_rule.snapshot.txtnew file+24

This diff is too big to show here.

tests/snapshots/output/numbers.snapshot.txt+23−22

This diff is too big to show here.

tests/snapshots/output/numbers_rule.snapshot.txtnew file+23

This diff is too big to show here.

tests/snapshots/output/plain.snapshot.txt+1

This diff is too big to show here.

tests/snapshots/output/rule.snapshot.txtnew file+23

This diff is too big to show here.

tests/snapshots/sample.modified.rs+1

This diff is too big to show here.

tests/syntax-tests/BatTestCustomAssets.sublime-syntaxnew file+21

This diff is too big to show here.

tests/syntax-tests/compare_highlighted_versions.pynew file+65

This diff is too big to show here.

tests/syntax-tests/create_highlighted_versions.pynew file+133

This diff is too big to show here.

tests/syntax-tests/highlighted/ARM Assembly/test.Snew file+55

This diff is too big to show here.

tests/syntax-tests/highlighted/ASP/test.aspnew file+36

This diff is too big to show here.

tests/syntax-tests/highlighted/AWK/quicksort.awknew file+35

This diff is too big to show here.

tests/syntax-tests/highlighted/ActionScript/test.asnew file+75

This diff is too big to show here.

tests/syntax-tests/highlighted/Apache/httpd.confnew file+42

This diff is too big to show here.

tests/syntax-tests/highlighted/AppleScript/test.applescriptnew file+25

This diff is too big to show here.

tests/syntax-tests/highlighted/AsciiDoc/test.adocnew file+173

This diff is too big to show here.

tests/syntax-tests/highlighted/Assembly (x86_64)/test.nasmnew file+86

This diff is too big to show here.

tests/syntax-tests/highlighted/Bash/batgrep.shnew file+511

This diff is too big to show here.

tests/syntax-tests/highlighted/Bash/simple.shnew file+72

This diff is too big to show here.

tests/syntax-tests/highlighted/BatTestCustomAssets/NoColorsUnlessCustomAssetsAreUsed.battestcustomassetsnew file+2

This diff is too big to show here.

tests/syntax-tests/highlighted/Batch/build.batnew file+59

This diff is too big to show here.

tests/syntax-tests/highlighted/BibTeX/test.bibnew file+18

This diff is too big to show here.

tests/syntax-tests/highlighted/C-Sharp/Stack.csnew file+64

This diff is too big to show here.

tests/syntax-tests/highlighted/C/test.cnew file+62

This diff is too big to show here.

tests/syntax-tests/highlighted/CMake/CMakeLists.txtnew file+16

This diff is too big to show here.

tests/syntax-tests/highlighted/CSS/style.cssnew file+115

This diff is too big to show here.

tests/syntax-tests/highlighted/CSV/comma_in_quotes.csvnew file+7

This diff is too big to show here.

tests/syntax-tests/highlighted/Cabal/semantic.cabalnew file+247

This diff is too big to show here.

tests/syntax-tests/highlighted/Clojure/test.cljnew file+58

This diff is too big to show here.

tests/syntax-tests/highlighted/CoffeeScript/coffeescript.coffeenew file+391

This diff is too big to show here.

tests/syntax-tests/highlighted/Cpp/test.cppnew file+79

This diff is too big to show here.

tests/syntax-tests/highlighted/CpuInfo/test.cpuinfonew file+45

This diff is too big to show here.

tests/syntax-tests/highlighted/Crystal/test.crnew file+117

This diff is too big to show here.

tests/syntax-tests/highlighted/D/test.dnew file+44

This diff is too big to show here.

tests/syntax-tests/highlighted/Dart/inner_comment.dartnew file+5

This diff is too big to show here.

tests/syntax-tests/highlighted/Dart/test.dartnew file+133

This diff is too big to show here.

tests/syntax-tests/highlighted/Diff/82e7786e747b1fcfac1f963ae6415a22ec9caae1.diffnew file+353

This diff is too big to show here.

tests/syntax-tests/highlighted/Dockerfile/Dockerfilenew file+19

This diff is too big to show here.

tests/syntax-tests/highlighted/DotENV/.envnew file+57

This diff is too big to show here.

tests/syntax-tests/highlighted/Elixir/command.exnew file+31

This diff is too big to show here.

tests/syntax-tests/highlighted/Elm/test.elmnew file+137

This diff is too big to show here.

tests/syntax-tests/highlighted/Email/test.emlnew file+16

This diff is too big to show here.

tests/syntax-tests/highlighted/Erlang/bat_erlang.erlnew file+72

This diff is too big to show here.

tests/syntax-tests/highlighted/EtcGroup/test.groupnew file+67

This diff is too big to show here.

tests/syntax-tests/highlighted/F#/string.fsnew file+182

This diff is too big to show here.

tests/syntax-tests/highlighted/Fish/test.fishnew file+77

This diff is too big to show here.

tests/syntax-tests/highlighted/Fortran (Fixed Form)/quicksort_real_F77.Fnew file+323

This diff is too big to show here.

tests/syntax-tests/highlighted/Fortran (Modern)/test_savetxt.f90new file+119

This diff is too big to show here.

tests/syntax-tests/highlighted/Fortran Namelist/test.namelistnew file+5

This diff is too big to show here.

tests/syntax-tests/highlighted/Fstab/fstabnew file+7

This diff is too big to show here.

tests/syntax-tests/highlighted/GLSL/test.glslnew file+42

This diff is too big to show here.

tests/syntax-tests/highlighted/Git Attributes/example.gitattributesnew file+16

This diff is too big to show here.

tests/syntax-tests/highlighted/Git Config/text.gitconfignew file+107

This diff is too big to show here.

tests/syntax-tests/highlighted/Git Ignore/test.gitignorenew file+43

This diff is too big to show here.

tests/syntax-tests/highlighted/Go/main.gonew file+81

This diff is too big to show here.

tests/syntax-tests/highlighted/GraphQL/test.graphqlnew file+145

This diff is too big to show here.

tests/syntax-tests/highlighted/Graphviz DOT/test_digraph.dotnew file+41

This diff is too big to show here.

tests/syntax-tests/highlighted/Graphviz DOT/test_graph.dotnew file+3

This diff is too big to show here.

tests/syntax-tests/highlighted/Groff/rustdoc.1new file+126

This diff is too big to show here.

tests/syntax-tests/highlighted/Groovy/test.groovynew file+77

This diff is too big to show here.

tests/syntax-tests/highlighted/HTML/test.htmlnew file+115

This diff is too big to show here.

tests/syntax-tests/highlighted/Haskell/test.hsnew file+86

This diff is too big to show here.

tests/syntax-tests/highlighted/Hosts/hostsnew file+8

This diff is too big to show here.

tests/syntax-tests/highlighted/INI/test.infnew file+5

This diff is too big to show here.

tests/syntax-tests/highlighted/INI/test.ininew file+18

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.baknew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.dpkg-distnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.dpkg-oldnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.innew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.in.innew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.oldnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.orignew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.orig~new file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.rpmnewnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.rpmorignew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.rpmsavenew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-distnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-newnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs.ucf-oldnew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.rs~new file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Ignored suffixes/test.unknown~new file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/JQ/sample.jqnew file+60

This diff is too big to show here.

tests/syntax-tests/highlighted/JSON/test.jsonnew file+29

This diff is too big to show here.

tests/syntax-tests/highlighted/Java Server Page (JSP)/sessionDetail.jspnew file+197

This diff is too big to show here.

tests/syntax-tests/highlighted/Java/test.javanew file+39

This diff is too big to show here.

tests/syntax-tests/highlighted/JavaScript/test.jsnew file+114

This diff is too big to show here.

tests/syntax-tests/highlighted/Jinja2/template.jinja2new file+30

This diff is too big to show here.

tests/syntax-tests/highlighted/Julia/test.jlnew file+71

This diff is too big to show here.

tests/syntax-tests/highlighted/Kotlin/test.ktnew file+85

This diff is too big to show here.

tests/syntax-tests/highlighted/LLVM/test.llnew file+29

This diff is too big to show here.

tests/syntax-tests/highlighted/Lean/test.leannew file+68

This diff is too big to show here.

tests/syntax-tests/highlighted/Less/example.lessnew file+43

This diff is too big to show here.

tests/syntax-tests/highlighted/Lisp/utils.lispnew file+80

This diff is too big to show here.

tests/syntax-tests/highlighted/Literate Haskell/Main.lhsnew file+47

This diff is too big to show here.

tests/syntax-tests/highlighted/LiveScript/livescript-demo.lsnew file+83

This diff is too big to show here.

tests/syntax-tests/highlighted/Log/example.lognew file+3

This diff is too big to show here.

tests/syntax-tests/highlighted/Lua/test.luanew file+34

This diff is too big to show here.

tests/syntax-tests/highlighted/MATLAB/test.matlabnew file+34

This diff is too big to show here.

tests/syntax-tests/highlighted/Makefile/Makefilenew file+385

This diff is too big to show here.

tests/syntax-tests/highlighted/Manpage/bat-0.16.mannew file+243

This diff is too big to show here.

tests/syntax-tests/highlighted/Manpage/select-2.mannew file+330

This diff is too big to show here.

tests/syntax-tests/highlighted/Markdown/example.mdnew file+39

This diff is too big to show here.

tests/syntax-tests/highlighted/MediaWiki/test.mediawikinew file+37

This diff is too big to show here.

tests/syntax-tests/highlighted/MemInfo/test.meminfonew file+53

This diff is too big to show here.

tests/syntax-tests/highlighted/NAnt Build File/Default.buildnew file+167

This diff is too big to show here.

tests/syntax-tests/highlighted/Ninja/test.ninjanew file+6

This diff is too big to show here.

tests/syntax-tests/highlighted/OCaml/syntax-test.mlnew file+83

This diff is too big to show here.

tests/syntax-tests/highlighted/Objective-C++/test.mmnew file+68

This diff is too big to show here.

tests/syntax-tests/highlighted/Objective-C/test.mnew file+32

This diff is too big to show here.

tests/syntax-tests/highlighted/PHP/test.phpnew file+111

This diff is too big to show here.

tests/syntax-tests/highlighted/Pascal/test.pasnew file+42

This diff is too big to show here.

tests/syntax-tests/highlighted/Passwd/passwdnew file+7

This diff is too big to show here.

tests/syntax-tests/highlighted/Perl/test.plnew file+157

This diff is too big to show here.

tests/syntax-tests/highlighted/Plaintext/plaintext.txtnew file+178

This diff is too big to show here.

tests/syntax-tests/highlighted/PowerShell/test.ps1new file+25

This diff is too big to show here.

tests/syntax-tests/highlighted/Protocol Buffer/vyconf.protonew file+158

This diff is too big to show here.

tests/syntax-tests/highlighted/Puppet/manifest_large_exported_classes_node.ppnew file+65

This diff is too big to show here.

tests/syntax-tests/highlighted/PureScript/test.pursnew file+89

This diff is too big to show here.

tests/syntax-tests/highlighted/Python/battest.pynew file+100

This diff is too big to show here.

tests/syntax-tests/highlighted/QML/BatSyntaxTest.qmlnew file+219

This diff is too big to show here.

tests/syntax-tests/highlighted/R/test.rnew file+170

This diff is too big to show here.

tests/syntax-tests/highlighted/Racket/test.rktnew file+56

This diff is too big to show here.

tests/syntax-tests/highlighted/Rego/src_test.regonew file+181

This diff is too big to show here.

tests/syntax-tests/highlighted/Regular Expression/test.renew file+1

This diff is too big to show here.

tests/syntax-tests/highlighted/Robot Framework/recipe141_aws_simple_storage_service.robotnew file+31

This diff is too big to show here.

tests/syntax-tests/highlighted/Ruby Haml/test.html.hamlnew file+15

This diff is too big to show here.

tests/syntax-tests/highlighted/Ruby On Rails/test.rbnew file+22

This diff is too big to show here.

tests/syntax-tests/highlighted/Ruby/output.rbnew file+56

This diff is too big to show here.

tests/syntax-tests/highlighted/Rust/output.rsnew file+161

This diff is too big to show here.

tests/syntax-tests/highlighted/SCSS/example.scssnew file+82

This diff is too big to show here.

tests/syntax-tests/highlighted/SLS/test.slsnew file+57

This diff is too big to show here.

tests/syntax-tests/highlighted/SML/sample.smlnew file+47

This diff is too big to show here.

tests/syntax-tests/highlighted/SQL/ims.sqlnew file+266

This diff is too big to show here.

tests/syntax-tests/highlighted/SSH Config/ssh_confignew file+9

This diff is too big to show here.

tests/syntax-tests/highlighted/SSHD Config/sshd_confignew file+36

This diff is too big to show here.

tests/syntax-tests/highlighted/Sass/example.sassnew file+76

This diff is too big to show here.

tests/syntax-tests/highlighted/Scala/ConcurrentEffectLaws.scalanew file+98

This diff is too big to show here.

tests/syntax-tests/highlighted/Slim/test.slimnew file+20

This diff is too big to show here.

tests/syntax-tests/highlighted/Solidity/ERC721.solnew file+376

This diff is too big to show here.

tests/syntax-tests/highlighted/Strace/ls.stracenew file+94

This diff is too big to show here.

tests/syntax-tests/highlighted/Stylus/gradients.stylnew file+90

This diff is too big to show here.

tests/syntax-tests/highlighted/Svelte/App.sveltenew file+65

This diff is too big to show here.

tests/syntax-tests/highlighted/Swift/test.swiftnew file+268

This diff is too big to show here.

tests/syntax-tests/highlighted/Syslog/example.syslognew file+16

This diff is too big to show here.

tests/syntax-tests/highlighted/SystemVerilog/output.svnew file+103

This diff is too big to show here.

tests/syntax-tests/highlighted/TOML/Cargo.tomlnew file+87

This diff is too big to show here.

tests/syntax-tests/highlighted/Tcl/test.tclnew file+22

This diff is too big to show here.

tests/syntax-tests/highlighted/TeX/main.texnew file+84

This diff is too big to show here.

tests/syntax-tests/highlighted/Terraform/main.tfnew file+48

This diff is too big to show here.

tests/syntax-tests/highlighted/Textile/test.textilenew file+40

This diff is too big to show here.

tests/syntax-tests/highlighted/TypeScript/example.tsnew file+110

This diff is too big to show here.

tests/syntax-tests/highlighted/TypeScriptReact/app.tsxnew file+35

This diff is too big to show here.

tests/syntax-tests/highlighted/Verilog/div_pipelined.vnew file+172

This diff is too big to show here.

tests/syntax-tests/highlighted/VimL/source.vimnew file+92

This diff is too big to show here.

tests/syntax-tests/highlighted/Vue/example.vuenew file+60

This diff is too big to show here.

tests/syntax-tests/highlighted/Vyper/crowdsale.vynew file+89

This diff is too big to show here.

tests/syntax-tests/highlighted/XAML/ItemPage.xamlnew file+264

This diff is too big to show here.

tests/syntax-tests/highlighted/XML/example.xmlnew file+22

This diff is too big to show here.

tests/syntax-tests/highlighted/YAML/example.yamlnew file+34

This diff is too big to show here.

tests/syntax-tests/highlighted/Zig/example.zignew file+107

This diff is too big to show here.

tests/syntax-tests/highlighted/cmd-help/test.cmd-helpnew file+54

This diff is too big to show here.

tests/syntax-tests/highlighted/dash/shfmnew file+425

This diff is too big to show here.

tests/syntax-tests/highlighted/gnuplot/test.gpnew file+19

This diff is too big to show here.

tests/syntax-tests/highlighted/http-request-response/example.httpnew file+44

This diff is too big to show here.

tests/syntax-tests/highlighted/jsonnet/stdlib.jsonnetnew file+88

This diff is too big to show here.

tests/syntax-tests/highlighted/nginx/nginx.confnew file+140

This diff is too big to show here.

tests/syntax-tests/highlighted/nim/main.nimnew file+41

This diff is too big to show here.

tests/syntax-tests/highlighted/nim/test.nimblenew file+23

This diff is too big to show here.

tests/syntax-tests/highlighted/nix/test.nixnew file+15

This diff is too big to show here.

tests/syntax-tests/highlighted/orgmode/test.orgnew file+38

This diff is too big to show here.

tests/syntax-tests/highlighted/reStructuredText/reference.rstnew file+320

This diff is too big to show here.

tests/syntax-tests/highlighted/resolv.conf/resolv.confnew file+4

This diff is too big to show here.

tests/syntax-tests/highlighted/varlink/org.varlink.certification.varlinknew file+86

This diff is too big to show here.

tests/syntax-tests/regression_test.shnew file+15

This diff is too big to show here.

tests/syntax-tests/source/ARM Assembly/test.Snew file+55

This diff is too big to show here.

tests/syntax-tests/source/ASP/test.aspnew file+36

This diff is too big to show here.

tests/syntax-tests/source/AWK/quicksort.awknew file+35

This diff is too big to show here.

tests/syntax-tests/source/ActionScript/test.asnew file+75

This diff is too big to show here.

tests/syntax-tests/source/Apache/httpd.confnew file+42

This diff is too big to show here.

tests/syntax-tests/source/AppleScript/test.applescriptnew file+25

This diff is too big to show here.

tests/syntax-tests/source/AsciiDoc/test.adocnew file+173

This diff is too big to show here.

tests/syntax-tests/source/Assembly (x86_64)/test.nasmnew file+86

This diff is too big to show here.

tests/syntax-tests/source/Bash/batgrep.shnew file+511

This diff is too big to show here.

tests/syntax-tests/source/Bash/simple.shnew file+72

This diff is too big to show here.

tests/syntax-tests/source/BatTestCustomAssets/NoColorsUnlessCustomAssetsAreUsed.battestcustomassetsnew file+2

This diff is too big to show here.

tests/syntax-tests/source/Batch/LICENSE.mdnew file+26

This diff is too big to show here.

tests/syntax-tests/source/Batch/build.batnew file+59

This diff is too big to show here.

tests/syntax-tests/source/BibTeX/test.bibnew file+18

This diff is too big to show here.

tests/syntax-tests/source/C-Sharp/Stack.csnew file+64

This diff is too big to show here.

tests/syntax-tests/source/C/test.cnew file+62

This diff is too big to show here.

tests/syntax-tests/source/CMake/CMakeLists.txtnew file+16

This diff is too big to show here.

tests/syntax-tests/source/CSS/style.cssnew file+115

This diff is too big to show here.

tests/syntax-tests/source/CSV/LICENSE.mdnew file+27

This diff is too big to show here.

tests/syntax-tests/source/CSV/comma_in_quotes.csvnew file+7

This diff is too big to show here.

tests/syntax-tests/source/Cabal/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Cabal/semantic.cabalnew file+247

This diff is too big to show here.

tests/syntax-tests/source/Clojure/test.cljnew file+58

This diff is too big to show here.

tests/syntax-tests/source/CoffeeScript/LICENSE.mdnew file+26

This diff is too big to show here.

tests/syntax-tests/source/CoffeeScript/coffeescript.coffeenew file+391

This diff is too big to show here.

tests/syntax-tests/source/Cpp/test.cppnew file+79

This diff is too big to show here.

tests/syntax-tests/source/CpuInfo/test.cpuinfonew file+45

This diff is too big to show here.

tests/syntax-tests/source/Crystal/test.crnew file+117

This diff is too big to show here.

tests/syntax-tests/source/D/test.dnew file+44

This diff is too big to show here.

tests/syntax-tests/source/Dart/inner_comment.dartnew file+5

This diff is too big to show here.

tests/syntax-tests/source/Dart/test.dartnew file+133

This diff is too big to show here.

tests/syntax-tests/source/Diff/82e7786e747b1fcfac1f963ae6415a22ec9caae1.diffnew file+353

This diff is too big to show here.

tests/syntax-tests/source/Dockerfile/Dockerfilenew file+19

This diff is too big to show here.

tests/syntax-tests/source/DotENV/.envnew file+57

This diff is too big to show here.

tests/syntax-tests/source/DotENV/LICENSE.mdnew file+23

This diff is too big to show here.

tests/syntax-tests/source/Elixir/LICENSE.mdnew file+21

This diff is too big to show here.

tests/syntax-tests/source/Elixir/command.exnew file+31

This diff is too big to show here.

tests/syntax-tests/source/Elm/LICENSE.mdnew file+32

This diff is too big to show here.

tests/syntax-tests/source/Elm/test.elmnew file+137

This diff is too big to show here.

tests/syntax-tests/source/Email/test.emlnew file+16

This diff is too big to show here.

tests/syntax-tests/source/Erlang/bat_erlang.erlnew file+72

This diff is too big to show here.

tests/syntax-tests/source/EtcGroup/test.groupnew file+67

This diff is too big to show here.

tests/syntax-tests/source/F#/LICENSE.mdnew file+27

This diff is too big to show here.

tests/syntax-tests/source/F#/string.fsnew file+182

This diff is too big to show here.

tests/syntax-tests/source/Fish/test.fishnew file+77

This diff is too big to show here.

tests/syntax-tests/source/Fortran (Fixed Form)/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Fortran (Fixed Form)/quicksort_real_F77.Fnew file+323

This diff is too big to show here.

tests/syntax-tests/source/Fortran (Modern)/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Fortran (Modern)/test_savetxt.f90new file+119

This diff is too big to show here.

tests/syntax-tests/source/Fortran Namelist/test.namelistnew file+5

This diff is too big to show here.

tests/syntax-tests/source/Fstab/fstabnew file+7

This diff is too big to show here.

tests/syntax-tests/source/GLSL/test.glslnew file+42

This diff is too big to show here.

tests/syntax-tests/source/Git Attributes/example.gitattributesnew file+16

This diff is too big to show here.

tests/syntax-tests/source/Git Config/LICENSE.mdnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Git Config/text.gitconfignew file+107

This diff is too big to show here.

tests/syntax-tests/source/Git Ignore/LICENSE.mdnew file+234

This diff is too big to show here.

tests/syntax-tests/source/Git Ignore/test.gitignorenew file+43

This diff is too big to show here.

tests/syntax-tests/source/Go/LICENSE.mdnew file+205

This diff is too big to show here.

tests/syntax-tests/source/Go/main.gonew file+81

This diff is too big to show here.

tests/syntax-tests/source/GraphQL/test.graphqlnew file+145

This diff is too big to show here.

tests/syntax-tests/source/Graphviz DOT/LICENSE.mdnew file+22

This diff is too big to show here.

tests/syntax-tests/source/Graphviz DOT/test_digraph.dotnew file+41

This diff is too big to show here.

tests/syntax-tests/source/Graphviz DOT/test_graph.dotnew file+3

This diff is too big to show here.

tests/syntax-tests/source/Groff/LICENSE.mdnew file+235

This diff is too big to show here.

tests/syntax-tests/source/Groff/rustdoc.1new file+126

This diff is too big to show here.

tests/syntax-tests/source/Groovy/test.groovynew file+77

This diff is too big to show here.

tests/syntax-tests/source/HTML/test.htmlnew file+115

This diff is too big to show here.

tests/syntax-tests/source/Haskell/test.hsnew file+86

This diff is too big to show here.

tests/syntax-tests/source/Hosts/hostsnew file+8

This diff is too big to show here.

tests/syntax-tests/source/INI/test.infnew file+5

This diff is too big to show here.

tests/syntax-tests/source/INI/test.ininew file+18

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.baknew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.dpkg-distnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.dpkg-oldnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.innew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.in.innew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.oldnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.orignew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.orig~new file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.rpmnewnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.rpmorignew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.rpmsavenew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-distnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-newnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs.ucf-oldnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.rs~new file+1

This diff is too big to show here.

tests/syntax-tests/source/Ignored suffixes/test.unknown~new file+1

This diff is too big to show here.

tests/syntax-tests/source/JQ/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/JQ/sample.jqnew file+60

This diff is too big to show here.

tests/syntax-tests/source/JSON/test.jsonnew file+29

This diff is too big to show here.

tests/syntax-tests/source/Java Server Page (JSP)/LICENSE.mdnew file+1141

This diff is too big to show here.

tests/syntax-tests/source/Java Server Page (JSP)/NOTICEnew file+68

This diff is too big to show here.

tests/syntax-tests/source/Java Server Page (JSP)/sessionDetail.jspnew file+197

This diff is too big to show here.

tests/syntax-tests/source/Java/test.javanew file+39

This diff is too big to show here.

tests/syntax-tests/source/JavaScript/test.jsnew file+114

This diff is too big to show here.

tests/syntax-tests/source/Jinja2/template.jinja2new file+30

This diff is too big to show here.

tests/syntax-tests/source/Julia/test.jlnew file+71

This diff is too big to show here.

tests/syntax-tests/source/Kotlin/test.ktnew file+85

This diff is too big to show here.

tests/syntax-tests/source/LLVM/test.llnew file+29

This diff is too big to show here.

tests/syntax-tests/source/Lean/test.leannew file+68

This diff is too big to show here.

tests/syntax-tests/source/Less/example.lessnew file+43

This diff is too big to show here.

tests/syntax-tests/source/Lisp/LICENSE.mdnew file+24

This diff is too big to show here.

tests/syntax-tests/source/Lisp/utils.lispnew file+80

This diff is too big to show here.

tests/syntax-tests/source/Literate Haskell/Main.lhsnew file+47

This diff is too big to show here.

tests/syntax-tests/source/LiveScript/LICENSE.mdnew file+23

This diff is too big to show here.

tests/syntax-tests/source/LiveScript/livescript-demo.lsnew file+83

This diff is too big to show here.

tests/syntax-tests/source/Log/example.lognew file+3

This diff is too big to show here.

tests/syntax-tests/source/Lua/test.luanew file+34

This diff is too big to show here.

tests/syntax-tests/source/MATLAB/LICENSE.mdnew file+27

This diff is too big to show here.

tests/syntax-tests/source/MATLAB/test.matlabnew file+34

This diff is too big to show here.

tests/syntax-tests/source/Makefile/LICENSE.mdnew file+12

This diff is too big to show here.

tests/syntax-tests/source/Makefile/Makefilenew file+385

This diff is too big to show here.

tests/syntax-tests/source/Manpage/bat-0.16.mannew file+243

This diff is too big to show here.

tests/syntax-tests/source/Manpage/select-2.mannew file+330

This diff is too big to show here.

tests/syntax-tests/source/Markdown/example.mdnew file+39

This diff is too big to show here.

tests/syntax-tests/source/MediaWiki/test.mediawikinew file+37

This diff is too big to show here.

tests/syntax-tests/source/MemInfo/test.meminfonew file+53

This diff is too big to show here.

tests/syntax-tests/source/NAnt Build File/Default.buildnew file+167

This diff is too big to show here.

tests/syntax-tests/source/NAnt Build File/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Ninja/LICENSE.mdnew file+204

This diff is too big to show here.

tests/syntax-tests/source/Ninja/test.ninjanew file+6

This diff is too big to show here.

tests/syntax-tests/source/OCaml/syntax-test.mlnew file+83

This diff is too big to show here.

tests/syntax-tests/source/Objective-C++/test.mmnew file+68

This diff is too big to show here.

tests/syntax-tests/source/Objective-C/test.mnew file+32

This diff is too big to show here.

tests/syntax-tests/source/PHP/test.phpnew file+111

This diff is too big to show here.

tests/syntax-tests/source/Pascal/test.pasnew file+42

This diff is too big to show here.

tests/syntax-tests/source/Passwd/passwdnew file+7

This diff is too big to show here.

tests/syntax-tests/source/Perl/test.plnew file+157

This diff is too big to show here.

tests/syntax-tests/source/Plaintext/README.mdnew file+12

This diff is too big to show here.

tests/syntax-tests/source/Plaintext/bat_optionsnew file+1

This diff is too big to show here.

tests/syntax-tests/source/Plaintext/plaintext.txtnew file

Binary file not shown.

tests/syntax-tests/source/PowerShell/test.ps1new file

Binary file not shown.

tests/syntax-tests/source/Protocol Buffer/vyconf.protonew file+158

This diff is too big to show here.

tests/syntax-tests/source/Puppet/LICENSE.mdnew file+206

This diff is too big to show here.

tests/syntax-tests/source/Puppet/manifest_large_exported_classes_node.ppnew file+65

This diff is too big to show here.

tests/syntax-tests/source/PureScript/test.pursnew file+89

This diff is too big to show here.

tests/syntax-tests/source/Python/battest.pynew file+100

This diff is too big to show here.

tests/syntax-tests/source/QML/BatSyntaxTest.qmlnew file+219

This diff is too big to show here.

tests/syntax-tests/source/R/test.rnew file+170

This diff is too big to show here.

tests/syntax-tests/source/Racket/test.rktnew file+56

This diff is too big to show here.

tests/syntax-tests/source/Rego/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Rego/src_test.regonew file+181

This diff is too big to show here.

tests/syntax-tests/source/Regular Expression/test.renew file+1

This diff is too big to show here.

tests/syntax-tests/source/Robot Framework/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/Robot Framework/recipe141_aws_simple_storage_service.robotnew file+31

This diff is too big to show here.

tests/syntax-tests/source/Ruby Haml/test.html.hamlnew file+15

This diff is too big to show here.

tests/syntax-tests/source/Ruby On Rails/test.rbnew file+22

This diff is too big to show here.

tests/syntax-tests/source/Ruby/output.rbnew file+56

This diff is too big to show here.

tests/syntax-tests/source/Rust/output.rsnew file+161

This diff is too big to show here.

tests/syntax-tests/source/SCSS/example.scssnew file+82

This diff is too big to show here.

tests/syntax-tests/source/SLS/test.slsnew file+57

This diff is too big to show here.

tests/syntax-tests/source/SML/sample.smlnew file+47

This diff is too big to show here.

tests/syntax-tests/source/SQL/ims.sqlnew file+266

This diff is too big to show here.

tests/syntax-tests/source/SSH Config/ssh_confignew file+9

This diff is too big to show here.

tests/syntax-tests/source/SSHD Config/sshd_confignew file+36

This diff is too big to show here.

tests/syntax-tests/source/Sass/example.sassnew file+76

This diff is too big to show here.

tests/syntax-tests/source/Scala/ConcurrentEffectLaws.scalanew file+98

This diff is too big to show here.

tests/syntax-tests/source/Scala/LICENSE.mdnew file+179

This diff is too big to show here.

tests/syntax-tests/source/Slim/test.slimnew file+20

This diff is too big to show here.

tests/syntax-tests/source/Solidity/ERC721.solnew file+376

This diff is too big to show here.

tests/syntax-tests/source/Solidity/LICENSE.mdnew file+27

This diff is too big to show here.

tests/syntax-tests/source/Strace/ls.stracenew file+94

This diff is too big to show here.

tests/syntax-tests/source/Stylus/LICENSE.mdnew file+24

This diff is too big to show here.

tests/syntax-tests/source/Stylus/gradients.stylnew file+90

This diff is too big to show here.

tests/syntax-tests/source/Svelte/App.sveltenew file+65

This diff is too big to show here.

tests/syntax-tests/source/Svelte/LICENSE.mdnew file+14

This diff is too big to show here.

tests/syntax-tests/source/Swift/test.swiftnew file+268

This diff is too big to show here.

tests/syntax-tests/source/Syslog/example.syslognew file+16

This diff is too big to show here.

tests/syntax-tests/source/SystemVerilog/output.svnew file+103

This diff is too big to show here.

tests/syntax-tests/source/TOML/Cargo.tomlnew file+87

This diff is too big to show here.

tests/syntax-tests/source/Tcl/test.tclnew file+22

This diff is too big to show here.

tests/syntax-tests/source/TeX/main.texnew file+84

This diff is too big to show here.

tests/syntax-tests/source/Terraform/main.tfnew file+48

This diff is too big to show here.

tests/syntax-tests/source/Textile/test.textilenew file+40

This diff is too big to show here.

tests/syntax-tests/source/TypeScript/LICENSE.mdnew file+19

This diff is too big to show here.

tests/syntax-tests/source/TypeScript/example.tsnew file+110

This diff is too big to show here.

tests/syntax-tests/source/TypeScriptReact/LICENSE.mdnew file+25

This diff is too big to show here.

tests/syntax-tests/source/TypeScriptReact/app.tsxnew file+35

This diff is too big to show here.

tests/syntax-tests/source/Verilog/LICENSE.mdnew file+205

This diff is too big to show here.

tests/syntax-tests/source/Verilog/div_pipelined.vnew file+172

This diff is too big to show here.

tests/syntax-tests/source/VimL/source.vimnew file+92

This diff is too big to show here.

tests/syntax-tests/source/Vue/example.vuenew file+60

This diff is too big to show here.

tests/syntax-tests/source/Vyper/LICENSE.mdnew file+205

This diff is too big to show here.

tests/syntax-tests/source/Vyper/crowdsale.vynew file+89

This diff is too big to show here.

tests/syntax-tests/source/XAML/ItemPage.xamlnew file+264

This diff is too big to show here.

tests/syntax-tests/source/XAML/LICENSE.mdnew file+23

This diff is too big to show here.

tests/syntax-tests/source/XML/example.xmlnew file+22

This diff is too big to show here.

tests/syntax-tests/source/YAML/example.yamlnew file+34

This diff is too big to show here.

tests/syntax-tests/source/Zig/example.zignew file+107

This diff is too big to show here.

tests/syntax-tests/source/cmd-help/test.cmd-helpnew file+54

This diff is too big to show here.

tests/syntax-tests/source/dash/LICENSE.mdnew file+23

This diff is too big to show here.

tests/syntax-tests/source/dash/shfmnew file+425

This diff is too big to show here.

tests/syntax-tests/source/gnuplot/test.gpnew file+19

This diff is too big to show here.

tests/syntax-tests/source/http-request-response/example.httpnew file+44

This diff is too big to show here.

tests/syntax-tests/source/jsonnet/LICENSE.mdnew file+206

This diff is too big to show here.

tests/syntax-tests/source/jsonnet/stdlib.jsonnetnew file+88

This diff is too big to show here.

tests/syntax-tests/source/nginx/nginx.confnew file+140

This diff is too big to show here.

tests/syntax-tests/source/nim/main.nimnew file+41

This diff is too big to show here.

tests/syntax-tests/source/nim/test.nimblenew file+23

This diff is too big to show here.

tests/syntax-tests/source/nix/test.nixnew file+15

This diff is too big to show here.

tests/syntax-tests/source/orgmode/test.orgnew file+38

This diff is too big to show here.

tests/syntax-tests/source/reStructuredText/reference.rstnew file+320

This diff is too big to show here.

tests/syntax-tests/source/resolv.conf/resolv.confnew file+4

This diff is too big to show here.

tests/syntax-tests/source/varlink/LICENSE.mdnew file+229

This diff is too big to show here.

tests/syntax-tests/source/varlink/org.varlink.certification.varlinknew file+86

This diff is too big to show here.

tests/syntax-tests/test_custom_assets.shnew file+74

This diff is too big to show here.

tests/syntax-tests/update.shnew file+7

This diff is too big to show here.

tests/tester.rs+21−19

This diff is too big to show here.

tests/utils/mocked_pagers.rsnew file+69

This diff is too big to show here.

tests/utils/mod.rsnew file+1

This diff is too big to show here.