mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 01:03:46 +01:00
Merge branch 'master' into pacman-conf
This commit is contained in:
commit
a80d5ea9f7
2
.github/workflows/CICD.yml
vendored
2
.github/workflows/CICD.yml
vendored
@ -163,6 +163,7 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
job:
|
job:
|
||||||
|
- { target: aarch64-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: arm64, use-cross: true }
|
||||||
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: arm64, use-cross: true }
|
- { target: aarch64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: arm64, use-cross: true }
|
||||||
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, dpkg_arch: armhf, use-cross: true }
|
- { target: arm-unknown-linux-gnueabihf , os: ubuntu-20.04, dpkg_arch: armhf, use-cross: true }
|
||||||
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, dpkg_arch: musl-linux-armhf, use-cross: true }
|
- { target: arm-unknown-linux-musleabihf, os: ubuntu-20.04, dpkg_arch: musl-linux-armhf, use-cross: true }
|
||||||
@ -170,6 +171,7 @@ jobs:
|
|||||||
- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: i686, use-cross: true }
|
- { target: i686-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: i686, use-cross: true }
|
||||||
- { target: i686-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: musl-linux-i686, use-cross: true }
|
- { target: i686-unknown-linux-musl , os: ubuntu-20.04, dpkg_arch: musl-linux-i686, use-cross: true }
|
||||||
- { target: x86_64-apple-darwin , os: macos-12, }
|
- { target: x86_64-apple-darwin , os: macos-12, }
|
||||||
|
- { target: aarch64-apple-darwin , os: macos-14, }
|
||||||
- { target: x86_64-pc-windows-gnu , os: windows-2019, }
|
- { target: x86_64-pc-windows-gnu , os: windows-2019, }
|
||||||
- { target: x86_64-pc-windows-msvc , os: windows-2019, }
|
- { target: x86_64-pc-windows-msvc , os: windows-2019, }
|
||||||
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: amd64, use-cross: true }
|
- { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, dpkg_arch: amd64, use-cross: true }
|
||||||
|
3
.gitmodules
vendored
3
.gitmodules
vendored
@ -260,3 +260,6 @@
|
|||||||
[submodule "assets/syntaxes/02_Extra/vscode-wgsl"]
|
[submodule "assets/syntaxes/02_Extra/vscode-wgsl"]
|
||||||
path = assets/syntaxes/02_Extra/vscode-wgsl
|
path = assets/syntaxes/02_Extra/vscode-wgsl
|
||||||
url = https://github.com/PolyMeilex/vscode-wgsl.git
|
url = https://github.com/PolyMeilex/vscode-wgsl.git
|
||||||
|
[submodule "assets/syntaxes/02_Extra/CFML"]
|
||||||
|
path = assets/syntaxes/02_Extra/CFML
|
||||||
|
url = https://github.com/jcberquist/sublimetext-cfml.git
|
||||||
|
21
CHANGELOG.md
21
CHANGELOG.md
@ -7,6 +7,8 @@
|
|||||||
- `bat --squeeze-limit` to set the maximum number of empty consecutive when using `--squeeze-blank`, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
- `bat --squeeze-limit` to set the maximum number of empty consecutive when using `--squeeze-blank`, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
||||||
- `PrettyPrinter::squeeze_empty_lines` to support line squeezing for bat as a library, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
- `PrettyPrinter::squeeze_empty_lines` to support line squeezing for bat as a library, see #1441 (@eth-p) and #2665 (@einfachIrgendwer0815)
|
||||||
- Syntax highlighting for JavaScript files that start with `#!/usr/bin/env bun` #2913 (@sharunkumar)
|
- Syntax highlighting for JavaScript files that start with `#!/usr/bin/env bun` #2913 (@sharunkumar)
|
||||||
|
- `bat --strip-ansi={never,always,auto}` to remove ANSI escape sequences from bat's input, see #2999 (@eth-p)
|
||||||
|
- Add or remove individual style components without replacing all styles #2929 (@eth-p)
|
||||||
|
|
||||||
## Bugfixes
|
## Bugfixes
|
||||||
|
|
||||||
@ -15,6 +17,7 @@
|
|||||||
- Fix handling of inputs with OSC ANSI escape sequences, see #2541 and #2544 (@eth-p)
|
- Fix handling of inputs with OSC ANSI escape sequences, see #2541 and #2544 (@eth-p)
|
||||||
- Fix handling of inputs with combined ANSI color and attribute sequences, see #2185 and #2856 (@eth-p)
|
- Fix handling of inputs with combined ANSI color and attribute sequences, see #2185 and #2856 (@eth-p)
|
||||||
- Fix panel width when line 10000 wraps, see #2854 (@eth-p)
|
- Fix panel width when line 10000 wraps, see #2854 (@eth-p)
|
||||||
|
- Fix compile issue of `time` dependency caused by standard library regression #3045 (@cyqsimon)
|
||||||
|
|
||||||
## Other
|
## Other
|
||||||
|
|
||||||
@ -36,6 +39,11 @@
|
|||||||
- Faster startup by offloading glob matcher building to a worker thread #2868 (@cyqsimon)
|
- Faster startup by offloading glob matcher building to a worker thread #2868 (@cyqsimon)
|
||||||
- Display which theme is the default one in basic output (no colors), see #2937 (@sblondon)
|
- Display which theme is the default one in basic output (no colors), see #2937 (@sblondon)
|
||||||
- Display which theme is the default one in colored output, see #2838 (@sblondon)
|
- Display which theme is the default one in colored output, see #2838 (@sblondon)
|
||||||
|
- Add aarch64-apple-darwin ("Apple Silicon") binary tarballs to releases, see #2967 (@someposer)
|
||||||
|
- Update the Lisp syntax, see #2970 (@ccqpein)
|
||||||
|
- Use bat's ANSI iterator during tab expansion, see #2998 (@eth-p)
|
||||||
|
- Support 'statically linked binary' for aarch64 in 'Release' page, see #2992 (@tzq0301)
|
||||||
|
- Update options in shell completions and the man page of `bat`, see #2995 (@akinomyoga)
|
||||||
|
|
||||||
## Syntaxes
|
## Syntaxes
|
||||||
|
|
||||||
@ -43,10 +51,15 @@
|
|||||||
- Upgrade JQ syntax, see #2820 (@dependabot[bot])
|
- Upgrade JQ syntax, see #2820 (@dependabot[bot])
|
||||||
- Add syntax mapping for quadman quadlets #2866 (@cyqsimon)
|
- Add syntax mapping for quadman quadlets #2866 (@cyqsimon)
|
||||||
- Map containers .conf files to TOML syntax #2867 (@cyqsimon)
|
- Map containers .conf files to TOML syntax #2867 (@cyqsimon)
|
||||||
- Associate `xsh` files with `xonsh` syntax that is Python, see #2840 (@anki-code).
|
- Associate `.xsh` files with `xonsh` syntax that is Python, see #2840 (@anki-code)
|
||||||
- Added auto detect syntax for `.jsonc` #2795 (@mxaddict)
|
- Associate JSON with Comments `.jsonc` with `json` syntax, see #2795 (@mxaddict)
|
||||||
- Added auto detect syntax for `.aws/{config,credentials}` #2795 (@mxaddict)
|
- Associate JSON-LD `.jsonld` files with `json` syntax, see #3037 (@vorburger)
|
||||||
- Add syntax mapping for Wireguard config #2874 (@cyqsimon)
|
- Associate `.textproto` files with `ProtoBuf` syntax, see #3038 (@vorburger)
|
||||||
|
- Associate GeoJSON `.geojson` files with `json` syntax, see #3084 (@mvaaltola)
|
||||||
|
- Associate `.aws/{config,credentials}`, see #2795 (@mxaddict)
|
||||||
|
- Associate Wireguard config `/etc/wireguard/*.conf`, see #2874 (@cyqsimon)
|
||||||
|
- Add support for [CFML](https://www.adobe.com/products/coldfusion-family.html), see #3031 (@brenton-at-pieces)
|
||||||
|
- Map `*.mkd` files to `Markdown` syntax, see issue #3060 and PR #3061 (@einfachIrgendwer0815)
|
||||||
- Add syntax mapping for `/etc/pacman.conf` #2961 (@cyqsimon)
|
- Add syntax mapping for `/etc/pacman.conf` #2961 (@cyqsimon)
|
||||||
|
|
||||||
## Themes
|
## Themes
|
||||||
|
129
Cargo.lock
generated
129
Cargo.lock
generated
@ -3,10 +3,10 @@
|
|||||||
version = 3
|
version = 3
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "adler"
|
name = "adler2"
|
||||||
version = "1.0.2"
|
version = "2.0.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
|
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "aho-corasick"
|
name = "aho-corasick"
|
||||||
@ -19,9 +19,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ansi_colours"
|
name = "ansi_colours"
|
||||||
version = "1.2.2"
|
version = "1.2.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "6a1558bd2075d341b9ca698ec8eb6fcc55a746b1fc4255585aad5b141d918a80"
|
checksum = "14eec43e0298190790f41679fe69ef7a829d2a2ddd78c8c00339e84710e435fe"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"rgb",
|
"rgb",
|
||||||
]
|
]
|
||||||
@ -76,9 +76,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anyhow"
|
name = "anyhow"
|
||||||
version = "1.0.78"
|
version = "1.0.86"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ca87830a3e3fb156dc96cfbd31cb620265dd053be734723f22b760d6cc3c3051"
|
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "assert_cmd"
|
name = "assert_cmd"
|
||||||
@ -103,9 +103,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "base64"
|
name = "base64"
|
||||||
version = "0.21.0"
|
version = "0.22.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a"
|
checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bat"
|
name = "bat"
|
||||||
@ -416,9 +416,9 @@ checksum = "a357d28ed41a50f9c765dbfe56cbc04a64e53e5fc58ba79fbc34c10ef3df831f"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "encoding_rs"
|
name = "encoding_rs"
|
||||||
version = "0.8.33"
|
version = "0.8.34"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1"
|
checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
]
|
]
|
||||||
@ -463,9 +463,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "expect-test"
|
name = "expect-test"
|
||||||
version = "1.4.1"
|
version = "1.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "30d9eafeadd538e68fb28016364c9732d78e420b9ff8853fa5e4058861e9f8d3"
|
checksum = "9e0be0a561335815e06dab7c62e50353134c796e7a6155402a64bcff66b6a5e0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"dissimilar",
|
"dissimilar",
|
||||||
"once_cell",
|
"once_cell",
|
||||||
@ -489,9 +489,9 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "flate2"
|
name = "flate2"
|
||||||
version = "1.0.28"
|
version = "1.0.34"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e"
|
checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"crc32fast",
|
"crc32fast",
|
||||||
"miniz_oxide",
|
"miniz_oxide",
|
||||||
@ -564,9 +564,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "git2"
|
name = "git2"
|
||||||
version = "0.18.2"
|
version = "0.19.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd"
|
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags 2.4.0",
|
"bitflags 2.4.0",
|
||||||
"libc",
|
"libc",
|
||||||
@ -583,9 +583,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "globset"
|
name = "globset"
|
||||||
version = "0.4.14"
|
version = "0.4.15"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "57da3b9b5b85bd66f31093f8c408b90a74431672542466497dcbdfdc02034be1"
|
checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"aho-corasick",
|
"aho-corasick",
|
||||||
"bstr",
|
"bstr",
|
||||||
@ -647,9 +647,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "indexmap"
|
name = "indexmap"
|
||||||
version = "2.2.6"
|
version = "2.3.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26"
|
checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"equivalent",
|
"equivalent",
|
||||||
"hashbrown 0.14.1",
|
"hashbrown 0.14.1",
|
||||||
@ -658,9 +658,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "itertools"
|
name = "itertools"
|
||||||
version = "0.12.1"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569"
|
checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"either",
|
"either",
|
||||||
]
|
]
|
||||||
@ -694,9 +694,9 @@ checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libgit2-sys"
|
name = "libgit2-sys"
|
||||||
version = "0.16.2+1.7.2"
|
version = "0.17.0+1.8.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
|
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cc",
|
"cc",
|
||||||
"libc",
|
"libc",
|
||||||
@ -716,15 +716,6 @@ dependencies = [
|
|||||||
"vcpkg",
|
"vcpkg",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "line-wrap"
|
|
||||||
version = "0.1.1"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f30344350a2a51da54c1d53be93fade8a237e545dbcc4bdbe635413f2117cab9"
|
|
||||||
dependencies = [
|
|
||||||
"safemem",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "linked-hash-map"
|
name = "linked-hash-map"
|
||||||
version = "0.5.6"
|
version = "0.5.6"
|
||||||
@ -761,11 +752,11 @@ checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.7.1"
|
version = "0.8.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7"
|
checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"adler",
|
"adler2",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
@ -811,9 +802,12 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "once_cell"
|
name = "once_cell"
|
||||||
version = "1.19.0"
|
version = "1.20.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
|
checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1"
|
||||||
|
dependencies = [
|
||||||
|
"portable-atomic",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "onig"
|
name = "onig"
|
||||||
@ -892,18 +886,23 @@ checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "plist"
|
name = "plist"
|
||||||
version = "1.6.0"
|
version = "1.7.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e5699cc8a63d1aa2b1ee8e12b9ad70ac790d65788cd36101fa37f87ea46c4cef"
|
checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"base64",
|
"base64",
|
||||||
"indexmap",
|
"indexmap",
|
||||||
"line-wrap",
|
|
||||||
"quick-xml",
|
"quick-xml",
|
||||||
"serde",
|
"serde",
|
||||||
"time",
|
"time",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "portable-atomic"
|
||||||
|
version = "1.9.0"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "powerfmt"
|
name = "powerfmt"
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
@ -957,9 +956,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "quick-xml"
|
name = "quick-xml"
|
||||||
version = "0.31.0"
|
version = "0.32.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1004a344b30a54e2ee58d66a71b32d2db2feb0a31f9a2d302bf0536f15de2a33"
|
checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"memchr",
|
"memchr",
|
||||||
]
|
]
|
||||||
@ -1087,12 +1086,6 @@ version = "1.0.11"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
|
checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "safemem"
|
|
||||||
version = "0.3.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072"
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "same-file"
|
name = "same-file"
|
||||||
version = "1.0.6"
|
version = "1.0.6"
|
||||||
@ -1110,24 +1103,24 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "semver"
|
name = "semver"
|
||||||
version = "1.0.21"
|
version = "1.0.23"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
|
checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde"
|
name = "serde"
|
||||||
version = "1.0.199"
|
version = "1.0.209"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "0c9f6e76df036c77cd94996771fb40db98187f096dd0b9af39c6c6e452ba966a"
|
checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serde_derive"
|
name = "serde_derive"
|
||||||
version = "1.0.199"
|
version = "1.0.209"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "11bd257a6541e141e42ca6d24ae26f7714887b47e89aa739099104c7e4d3b7fc"
|
checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1327,18 +1320,18 @@ checksum = "507e9898683b6c43a9aa55b64259b721b52ba226e0f3779137e50ad114a4c90b"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror"
|
name = "thiserror"
|
||||||
version = "1.0.53"
|
version = "1.0.61"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "b2cd5904763bad08ad5513ddbb12cf2ae273ca53fa9f68e843e236ec6dfccc09"
|
checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"thiserror-impl",
|
"thiserror-impl",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "thiserror-impl"
|
name = "thiserror-impl"
|
||||||
version = "1.0.53"
|
version = "1.0.61"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "3dcf4a824cce0aeacd6f38ae6f24234c8e80d68632338ebaa1443b5df9e29e19"
|
checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
@ -1347,9 +1340,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time"
|
name = "time"
|
||||||
version = "0.3.34"
|
version = "0.3.36"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749"
|
checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"deranged",
|
"deranged",
|
||||||
"itoa",
|
"itoa",
|
||||||
@ -1368,9 +1361,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "time-macros"
|
name = "time-macros"
|
||||||
version = "0.2.17"
|
version = "0.2.18"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774"
|
checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"num-conv",
|
"num-conv",
|
||||||
"time-core",
|
"time-core",
|
||||||
@ -1449,9 +1442,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unicode-width"
|
name = "unicode-width"
|
||||||
version = "0.1.11"
|
version = "0.1.13"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "unsafe-libyaml"
|
name = "unsafe-libyaml"
|
||||||
@ -1493,9 +1486,9 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "walkdir"
|
name = "walkdir"
|
||||||
version = "2.4.0"
|
version = "2.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee"
|
checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"same-file",
|
"same-file",
|
||||||
"winapi-util",
|
"winapi-util",
|
||||||
|
24
Cargo.toml
24
Cargo.toml
@ -46,12 +46,12 @@ ansi_colours = "^1.2"
|
|||||||
bincode = "1.0"
|
bincode = "1.0"
|
||||||
console = "0.15.8"
|
console = "0.15.8"
|
||||||
flate2 = "1.0"
|
flate2 = "1.0"
|
||||||
once_cell = "1.19"
|
once_cell = "1.20"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
wild = { version = "2.2", optional = true }
|
wild = { version = "2.2", optional = true }
|
||||||
content_inspector = "0.2.4"
|
content_inspector = "0.2.4"
|
||||||
shell-words = { version = "1.1.0", optional = true }
|
shell-words = { version = "1.1.0", optional = true }
|
||||||
unicode-width = "0.1.11"
|
unicode-width = "0.1.13"
|
||||||
globset = "0.4"
|
globset = "0.4"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
@ -63,14 +63,14 @@ bugreport = { version = "0.5.0", optional = true }
|
|||||||
etcetera = { version = "0.8.0", optional = true }
|
etcetera = { version = "0.8.0", optional = true }
|
||||||
grep-cli = { version = "0.1.10", optional = true }
|
grep-cli = { version = "0.1.10", optional = true }
|
||||||
regex = { version = "1.10.2", optional = true }
|
regex = { version = "1.10.2", optional = true }
|
||||||
walkdir = { version = "2.4", optional = true }
|
walkdir = { version = "2.5", optional = true }
|
||||||
bytesize = { version = "1.3.0" }
|
bytesize = { version = "1.3.0" }
|
||||||
encoding_rs = "0.8.33"
|
encoding_rs = "0.8.34"
|
||||||
os_str_bytes = { version = "~7.0", optional = true }
|
os_str_bytes = { version = "~7.0", optional = true }
|
||||||
run_script = { version = "^0.10.1", optional = true}
|
run_script = { version = "^0.10.1", optional = true}
|
||||||
|
|
||||||
[dependencies.git2]
|
[dependencies.git2]
|
||||||
version = "0.18"
|
version = "0.19"
|
||||||
optional = true
|
optional = true
|
||||||
default-features = false
|
default-features = false
|
||||||
|
|
||||||
@ -86,11 +86,11 @@ features = ["wrap_help", "cargo"]
|
|||||||
|
|
||||||
[target.'cfg(target_os = "macos")'.dependencies]
|
[target.'cfg(target_os = "macos")'.dependencies]
|
||||||
home = "0.5.9"
|
home = "0.5.9"
|
||||||
plist = "1.6.0"
|
plist = "1.7.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
assert_cmd = "2.0.12"
|
assert_cmd = "2.0.12"
|
||||||
expect-test = "1.4.1"
|
expect-test = "1.5.0"
|
||||||
serial_test = { version = "2.0.0", default-features = false }
|
serial_test = { version = "2.0.0", default-features = false }
|
||||||
predicates = "3.1.0"
|
predicates = "3.1.0"
|
||||||
wait-timeout = "0.2.0"
|
wait-timeout = "0.2.0"
|
||||||
@ -101,16 +101,16 @@ serde = { version = "1.0", features = ["derive"] }
|
|||||||
nix = { version = "0.26.4", default-features = false, features = ["term"] }
|
nix = { version = "0.26.4", default-features = false, features = ["term"] }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
anyhow = "1.0.78"
|
anyhow = "1.0.86"
|
||||||
indexmap = { version = "2.2.6", features = ["serde"] }
|
indexmap = { version = "2.3.0", features = ["serde"] }
|
||||||
itertools = "0.12.1"
|
itertools = "0.13.0"
|
||||||
once_cell = "1.18"
|
once_cell = "1.20"
|
||||||
regex = "1.10.2"
|
regex = "1.10.2"
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_derive = "1.0"
|
serde_derive = "1.0"
|
||||||
serde_with = { version = "3.8.1", default-features = false, features = ["macros"] }
|
serde_with = { version = "3.8.1", default-features = false, features = ["macros"] }
|
||||||
toml = { version = "0.8.9", features = ["preserve_order"] }
|
toml = { version = "0.8.9", features = ["preserve_order"] }
|
||||||
walkdir = "2.4"
|
walkdir = "2.5"
|
||||||
|
|
||||||
[build-dependencies.clap]
|
[build-dependencies.clap]
|
||||||
version = "4.4.12"
|
version = "4.4.12"
|
||||||
|
27
README.md
27
README.md
@ -373,6 +373,14 @@ You can install `bat` using the [nix package manager](https://nixos.org/nix):
|
|||||||
nix-env -i bat
|
nix-env -i bat
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Via flox
|
||||||
|
|
||||||
|
You can install `bat` using [Flox](https://flox.dev)
|
||||||
|
|
||||||
|
```bash
|
||||||
|
flox install bat
|
||||||
|
```
|
||||||
|
|
||||||
### On openSUSE
|
### On openSUSE
|
||||||
|
|
||||||
You can install `bat` with zypper:
|
You can install `bat` with zypper:
|
||||||
@ -507,6 +515,16 @@ and line numbers but no grid and no file header. Set the `BAT_STYLE` environment
|
|||||||
variable to make these changes permanent or use `bat`s
|
variable to make these changes permanent or use `bat`s
|
||||||
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
[configuration file](https://github.com/sharkdp/bat#configuration-file).
|
||||||
|
|
||||||
|
>[!tip]
|
||||||
|
> If you specify a default style in `bat`'s config file, you can change which components
|
||||||
|
> are displayed during a single run of `bat` using the `--style` command-line argument.
|
||||||
|
> By prefixing a component with `+` or `-`, it can be added or removed from the current style.
|
||||||
|
>
|
||||||
|
> For example, if your config contains `--style=full,-snip`, you can run bat with
|
||||||
|
> `--style=-grid,+snip` to remove the grid and add back the `snip` component.
|
||||||
|
> Or, if you want to override the styles completely, you use `--style=numbers` to
|
||||||
|
> only show the line numbers.
|
||||||
|
|
||||||
### Adding new syntaxes / language definitions
|
### Adding new syntaxes / language definitions
|
||||||
|
|
||||||
Should you find that a particular syntax is not available within `bat`, you can follow these
|
Should you find that a particular syntax is not available within `bat`, you can follow these
|
||||||
@ -729,7 +747,7 @@ your `PATH` or [define an environment variable](#using-a-different-pager). The [
|
|||||||
Windows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since
|
Windows 10 natively supports colors in both `conhost.exe` (Command Prompt) and PowerShell since
|
||||||
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
[v1511](https://en.wikipedia.org/wiki/Windows_10_version_history#Version_1511_(November_Update)), as
|
||||||
well as in newer versions of bash. On earlier versions of Windows, you can use
|
well as in newer versions of bash. On earlier versions of Windows, you can use
|
||||||
[Cmder](http://cmder.net/), which includes [ConEmu](https://conemu.github.io/).
|
[Cmder](http://cmder.app/), which includes [ConEmu](https://conemu.github.io/).
|
||||||
|
|
||||||
**Note:** Old versions of `less` do not correctly interpret colors on Windows. To fix this, you can add the optional Unix tools to your PATH when installing Git. If you don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never` or by setting `BAT_PAGER` to an empty string.
|
**Note:** Old versions of `less` do not correctly interpret colors on Windows. To fix this, you can add the optional Unix tools to your PATH when installing Git. If you don’t have any other pagers installed, you can disable paging entirely by passing `--paging=never` or by setting `BAT_PAGER` to an empty string.
|
||||||
|
|
||||||
@ -759,9 +777,14 @@ bat() {
|
|||||||
|
|
||||||
If an input file contains color codes or other ANSI escape sequences or control characters, `bat` will have problems
|
If an input file contains color codes or other ANSI escape sequences or control characters, `bat` will have problems
|
||||||
performing syntax highlighting and text wrapping, and thus the output can become garbled.
|
performing syntax highlighting and text wrapping, and thus the output can become garbled.
|
||||||
When displaying such files it is recommended to disable both syntax highlighting and wrapping by
|
|
||||||
|
If your version of `bat` supports the `--strip-ansi=auto` option, it can be used to remove such sequences
|
||||||
|
before syntax highlighting. Alternatively, you may disable both syntax highlighting and wrapping by
|
||||||
passing the `--color=never --wrap=never` options to `bat`.
|
passing the `--color=never --wrap=never` options to `bat`.
|
||||||
|
|
||||||
|
> [!NOTE]
|
||||||
|
> The `auto` option of `--strip-ansi` avoids removing escape sequences when the syntax is plain text.
|
||||||
|
|
||||||
### Terminals & colors
|
### Terminals & colors
|
||||||
|
|
||||||
`bat` handles terminals *with* and *without* truecolor support. However, the colors in most syntax
|
`bat` handles terminals *with* and *without* truecolor support. However, the colors in most syntax
|
||||||
|
8
assets/completions/bat.bash.in
vendored
8
assets/completions/bat.bash.in
vendored
@ -76,6 +76,7 @@ _bat() {
|
|||||||
-m | --map-syntax | \
|
-m | --map-syntax | \
|
||||||
--ignored-suffix | \
|
--ignored-suffix | \
|
||||||
--list-themes | \
|
--list-themes | \
|
||||||
|
--squeeze-limit | \
|
||||||
--line-range | \
|
--line-range | \
|
||||||
-L | --list-languages | \
|
-L | --list-languages | \
|
||||||
--lessopen | \
|
--lessopen | \
|
||||||
@ -157,6 +158,7 @@ _bat() {
|
|||||||
--diff-context
|
--diff-context
|
||||||
--tabs
|
--tabs
|
||||||
--wrap
|
--wrap
|
||||||
|
--chop-long-lines
|
||||||
--terminal-width
|
--terminal-width
|
||||||
--number
|
--number
|
||||||
--color
|
--color
|
||||||
@ -169,18 +171,24 @@ _bat() {
|
|||||||
--ignored-suffix
|
--ignored-suffix
|
||||||
--theme
|
--theme
|
||||||
--list-themes
|
--list-themes
|
||||||
|
--squeeze-blank
|
||||||
|
--squeeze-limit
|
||||||
--style
|
--style
|
||||||
--line-range
|
--line-range
|
||||||
--list-languages
|
--list-languages
|
||||||
--lessopen
|
--lessopen
|
||||||
--diagnostic
|
--diagnostic
|
||||||
--acknowledgements
|
--acknowledgements
|
||||||
|
--set-terminal-title
|
||||||
--help
|
--help
|
||||||
--version
|
--version
|
||||||
--cache-dir
|
--cache-dir
|
||||||
--config-dir
|
--config-dir
|
||||||
--config-file
|
--config-file
|
||||||
--generate-config-file
|
--generate-config-file
|
||||||
|
--no-config
|
||||||
|
--no-custom-assets
|
||||||
|
--no-lessopen
|
||||||
" -- "$cur"))
|
" -- "$cur"))
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
2
assets/completions/bat.fish.in
vendored
2
assets/completions/bat.fish.in
vendored
@ -133,6 +133,8 @@ set -l tabs_opts '
|
|||||||
|
|
||||||
complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg
|
complete -c $bat -l acknowledgements -d "Print acknowledgements" -n __fish_is_first_arg
|
||||||
|
|
||||||
|
complete -c $bat -l cache-dir -f -d "Show bat's cache directory" -n __fish_is_first_arg
|
||||||
|
|
||||||
complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args
|
complete -c $bat -l color -x -a "$color_opts" -d "When to use colored output" -n __bat_no_excl_args
|
||||||
|
|
||||||
complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg
|
complete -c $bat -l config-dir -f -d "Display location of configuration directory" -n __fish_is_first_arg
|
||||||
|
1
assets/completions/bat.zsh.in
vendored
1
assets/completions/bat.zsh.in
vendored
@ -48,6 +48,7 @@ _{{PROJECT_EXECUTABLE}}_main() {
|
|||||||
default auto full plain changes header header-filename header-filesize grid rule numbers snip'
|
default auto full plain changes header header-filename header-filesize grid rule numbers snip'
|
||||||
\*{-r+,--line-range=}'[only print the specified line range]:start\:end'
|
\*{-r+,--line-range=}'[only print the specified line range]:start\:end'
|
||||||
'(* -)'{-L,--list-languages}'[display all supported languages]'
|
'(* -)'{-L,--list-languages}'[display all supported languages]'
|
||||||
|
-P'[disable paging]'
|
||||||
"--no-config[don't use the configuration file]"
|
"--no-config[don't use the configuration file]"
|
||||||
"--no-custom-assets[don't load custom assets]"
|
"--no-custom-assets[don't load custom assets]"
|
||||||
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'
|
'(--no-lessopen)'--lessopen'[enable the $LESSOPEN preprocessor]'
|
||||||
|
65
assets/manual/bat.1.in
vendored
65
assets/manual/bat.1.in
vendored
@ -87,6 +87,10 @@ Set the tab width to T spaces. Use a width of 0 to pass tabs through directly
|
|||||||
Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option
|
Specify the text\-wrapping mode (*auto*, never, character). The '\-\-terminal\-width' option
|
||||||
can be used in addition to control the output width.
|
can be used in addition to control the output width.
|
||||||
.HP
|
.HP
|
||||||
|
\fB\-S\fR, \fB\-\-chop\-long\-lines\fR
|
||||||
|
.IP
|
||||||
|
Truncate all lines longer than screen width. Alias for '\-\-wrap=never'.
|
||||||
|
.HP
|
||||||
\fB\-\-terminal\-width\fR <width>
|
\fB\-\-terminal\-width\fR <width>
|
||||||
.IP
|
.IP
|
||||||
Explicitly set the width of the terminal instead of determining it automatically. If
|
Explicitly set the width of the terminal instead of determining it automatically. If
|
||||||
@ -141,6 +145,11 @@ use -m '*.build:Python'. To highlight files named '.myignore' with the Git Ignor
|
|||||||
syntax, use -m '.myignore:Git Ignore'.
|
syntax, use -m '.myignore:Git Ignore'.
|
||||||
Note that the right-hand side is the *name* of the syntax, not a file extension.
|
Note that the right-hand side is the *name* of the syntax, not a file extension.
|
||||||
.HP
|
.HP
|
||||||
|
\fB\-\-ignored\-suffix\fR <ignored-suffix>
|
||||||
|
.IP
|
||||||
|
Ignore extension. For example: 'bat \-\-ignored-suffix ".dev" my_file.json.dev'
|
||||||
|
will use JSON syntax, and ignore '.dev'
|
||||||
|
.HP
|
||||||
\fB\-\-theme\fR <theme>
|
\fB\-\-theme\fR <theme>
|
||||||
.IP
|
.IP
|
||||||
Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes.
|
Set the theme for syntax highlighting. Use '\-\-list\-themes' to see all available themes.
|
||||||
@ -151,6 +160,14 @@ export the BAT_THEME environment variable (e.g.: export BAT_THEME="...").
|
|||||||
.IP
|
.IP
|
||||||
Display a list of supported themes for syntax highlighting.
|
Display a list of supported themes for syntax highlighting.
|
||||||
.HP
|
.HP
|
||||||
|
\fB\-s\fR, \fB\-\-squeeze\-blank\fR
|
||||||
|
.IP
|
||||||
|
Squeeze consecutive empty lines into a single empty line.
|
||||||
|
.HP
|
||||||
|
\fB\-\-squeeze\-limit\fR <squeeze-limit>
|
||||||
|
.IP
|
||||||
|
Set the maximum number of consecutive empty lines to be printed.
|
||||||
|
.HP
|
||||||
\fB\-\-style\fR <style\-components>
|
\fB\-\-style\fR <style\-components>
|
||||||
.IP
|
.IP
|
||||||
Configure which elements (line numbers, file headers, grid borders, Git modifications,
|
Configure which elements (line numbers, file headers, grid borders, Git modifications,
|
||||||
@ -184,6 +201,30 @@ Display a list of supported languages for syntax highlighting.
|
|||||||
This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is
|
This option exists for POSIX\-compliance reasons ('u' is for 'unbuffered'). The output is
|
||||||
always unbuffered \- this option is simply ignored.
|
always unbuffered \- this option is simply ignored.
|
||||||
.HP
|
.HP
|
||||||
|
\fB\-\-no\-custom\-assets\fR
|
||||||
|
.IP
|
||||||
|
Do not load custom assets.
|
||||||
|
.HP
|
||||||
|
\fB\-\-config\-dir\fR
|
||||||
|
.IP
|
||||||
|
Show bat's configuration directory.
|
||||||
|
.HP
|
||||||
|
\fB\-\-cache\-dir\fR
|
||||||
|
.IP
|
||||||
|
Show bat's cache directory.
|
||||||
|
.HP
|
||||||
|
\fB\-\-diagnostic\fR
|
||||||
|
.IP
|
||||||
|
Show diagnostic information for bug reports.
|
||||||
|
.HP
|
||||||
|
\fB\-\-acknowledgements\fR
|
||||||
|
.IP
|
||||||
|
Show acknowledgements.
|
||||||
|
.HP
|
||||||
|
\fB\-\-set\-terminal\-title\fR
|
||||||
|
.IP
|
||||||
|
Sets terminal title to filenames when using a pager.
|
||||||
|
.HP
|
||||||
\fB\-h\fR, \fB\-\-help\fR
|
\fB\-h\fR, \fB\-\-help\fR
|
||||||
.IP
|
.IP
|
||||||
Print this help message.
|
Print this help message.
|
||||||
@ -212,6 +253,20 @@ location of the configuration file.
|
|||||||
To generate a default configuration file, call:
|
To generate a default configuration file, call:
|
||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR
|
\fB{{PROJECT_EXECUTABLE}} --generate-config-file\fR
|
||||||
|
|
||||||
|
These are related options:
|
||||||
|
.HP
|
||||||
|
\fB\-\-config\-file\fR
|
||||||
|
.IP
|
||||||
|
Show path to the configuration file.
|
||||||
|
.HP
|
||||||
|
\fB\-\-generate-config\-file\fR
|
||||||
|
.IP
|
||||||
|
Generates a default configuration file.
|
||||||
|
.HP
|
||||||
|
\fB\-\-no\-config\fR
|
||||||
|
.IP
|
||||||
|
Do not use the configuration file.
|
||||||
.SH "ADDING CUSTOM LANGUAGES"
|
.SH "ADDING CUSTOM LANGUAGES"
|
||||||
{{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be
|
{{PROJECT_EXECUTABLE}} supports Sublime Text \fB.sublime-syntax\fR language files, and can be
|
||||||
customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language
|
customized to add additional languages to your local installation. To do this, add the \fB.sublime-syntax\fR language
|
||||||
@ -258,6 +313,16 @@ To temporarily disable the preprocessor if it is enabled by default, call:
|
|||||||
|
|
||||||
\fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR
|
\fB{{PROJECT_EXECUTABLE}} --no-lessopen\fR
|
||||||
|
|
||||||
|
These are related options:
|
||||||
|
.HP
|
||||||
|
\fB\-\-lessopen\fR
|
||||||
|
.IP
|
||||||
|
Enable the $LESSOPEN preprocessor.
|
||||||
|
.HP
|
||||||
|
\fB\-\-no\-lessopen\fR
|
||||||
|
.IP
|
||||||
|
Disable the $LESSOPEN preprocessor if enabled (overrides --lessopen)
|
||||||
|
.PP
|
||||||
For more information, see the "INPUT PREPROCESSOR" section of less(1).
|
For more information, see the "INPUT PREPROCESSOR" section of less(1).
|
||||||
|
|
||||||
.SH "MORE INFORMATION"
|
.SH "MORE INFORMATION"
|
||||||
|
2365
assets/patches/Lisp.sublime-syntax.patch
vendored
Normal file
2365
assets/patches/Lisp.sublime-syntax.patch
vendored
Normal file
File diff suppressed because one or more lines are too long
1
assets/syntaxes/02_Extra/CFML
vendored
Submodule
1
assets/syntaxes/02_Extra/CFML
vendored
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b91c44a32e251c20c6359a8d9232287e1b408e6c
|
2
assets/syntaxes/02_Extra/Protobuf
vendored
2
assets/syntaxes/02_Extra/Protobuf
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 726e21d74dac23cbb036f2fbbd626decdc954060
|
Subproject commit 1365331580b0e4bb86f74d0c599dccc87e7bdacb
|
@ -616,63 +616,59 @@ iconv -f ISO-8859-1 -t UTF-8 my-file.php | bat
|
|||||||
|
|
||||||
注意: 当`bat`无法识别语言时你可能会需要`-l`/`--language`参数。
|
注意: 当`bat`无法识别语言时你可能会需要`-l`/`--language`参数。
|
||||||
|
|
||||||
## Development
|
## 开发
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Recursive clone to retrieve all submodules
|
# 递归 clone 以获取所有子模块
|
||||||
git clone --recursive https://github.com/sharkdp/bat
|
git clone --recursive https://github.com/sharkdp/bat
|
||||||
|
|
||||||
# Build (debug version)
|
# 构建(调试版本)
|
||||||
cd bat
|
cd bat
|
||||||
cargo build --bins
|
cargo build --bins
|
||||||
|
|
||||||
# Run unit tests and integration tests
|
# 运行单元测试和集成测试
|
||||||
cargo test
|
cargo test
|
||||||
|
|
||||||
# Install (release version)
|
# 安装(发布版本)
|
||||||
cargo install --path . --locked
|
cargo install --path . --locked
|
||||||
|
|
||||||
# Build a bat binary with modified syntaxes and themes
|
# 使用修改后的语法和主题构建一个 bat 二进制文件
|
||||||
bash assets/create.sh
|
bash assets/create.sh
|
||||||
cargo install --path . --locked --force
|
cargo install --path . --locked --force
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want to build an application that uses `bat`s pretty-printing
|
如果你想构建一个使用 `bat` 美化打印功能的应用程序,请查看 [API 文档](https://docs.rs/bat/)。请注意,当你依赖 `bat` 作为库时,必须使用 `regex-onig` 或 `regex-fancy` 作为特性。
|
||||||
features as a library, check out the [the API documentation](https://docs.rs/bat/).
|
|
||||||
Note that you have to use either `regex-onig` or `regex-fancy` as a feature
|
|
||||||
when you depend on `bat` as a library.
|
|
||||||
|
|
||||||
## Contributing
|
## 贡献指南
|
||||||
|
|
||||||
Take a look at the [`CONTRIBUTING.md`](CONTRIBUTING.md) guide.
|
请查看 [`CONTRIBUTING.md`](CONTRIBUTING.md) 指南。
|
||||||
|
|
||||||
## Maintainers
|
## 维护者
|
||||||
|
|
||||||
- [sharkdp](https://github.com/sharkdp)
|
- [sharkdp](https://github.com/sharkdp)
|
||||||
- [eth-p](https://github.com/eth-p)
|
- [eth-p](https://github.com/eth-p)
|
||||||
- [keith-hall](https://github.com/keith-hall)
|
- [keith-hall](https://github.com/keith-hall)
|
||||||
- [Enselic](https://github.com/Enselic)
|
- [Enselic](https://github.com/Enselic)
|
||||||
|
|
||||||
## Security vulnerabilities
|
## 安全漏洞
|
||||||
|
|
||||||
Please contact [David Peter](https://david-peter.de/) via email if you want to report a vulnerability in `bat`.
|
如果你想报告 `bat` 中的漏洞,请通过邮件联系 [David Peter](https://david-peter.de/)。
|
||||||
|
|
||||||
## Project goals and alternatives
|
## 项目目标和替代方案
|
||||||
|
|
||||||
`bat` tries to achieve the following goals:
|
`bat` 试图实现以下目标:
|
||||||
|
|
||||||
- Provide beautiful, advanced syntax highlighting
|
- 提供美观的高级语法高亮
|
||||||
- Integrate with Git to show file modifications
|
- 与 Git 集成以显示文件修改
|
||||||
- Be a drop-in replacement for (POSIX) `cat`
|
- 成为 (POSIX) `cat` 的替代品
|
||||||
- Offer a user-friendly command-line interface
|
- 提供用户友好的命令行界面
|
||||||
|
|
||||||
There are a lot of alternatives, if you are looking for similar programs. See
|
如果你在寻找类似的程序,有很多替代方案。请参阅[本文档](doc/alternatives.md)进行比较。
|
||||||
[this document](doc/alternatives.md) for a comparison.
|
|
||||||
|
|
||||||
## License
|
## 许可证
|
||||||
|
|
||||||
Copyright (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat).
|
版权所有 (c) 2018-2021 [bat-developers](https://github.com/sharkdp/bat)。
|
||||||
|
|
||||||
`bat` is made available under the terms of either the MIT License or the Apache License 2.0, at your option.
|
`bat` 可根据 MIT 许可证或 Apache 许可证 2.0 的条款使用,任选其一。
|
||||||
|
|
||||||
See the [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) files for license details.
|
有关许可证的详细信息,请参阅 [LICENSE-APACHE](LICENSE-APACHE) 和 [LICENSE-MIT](LICENSE-MIT) 文件。
|
||||||
|
@ -122,6 +122,11 @@ Options:
|
|||||||
--squeeze-limit <squeeze-limit>
|
--squeeze-limit <squeeze-limit>
|
||||||
Set the maximum number of consecutive empty lines to be printed.
|
Set the maximum number of consecutive empty lines to be printed.
|
||||||
|
|
||||||
|
--strip-ansi <when>
|
||||||
|
Specify when to strip ANSI escape sequences from the input. The automatic mode will remove
|
||||||
|
escape sequences unless the syntax highlighting language is plain text. Possible values:
|
||||||
|
auto, always, *never*.
|
||||||
|
|
||||||
--style <components>
|
--style <components>
|
||||||
Configure which elements (line numbers, file headers, grid borders, Git modifications, ..)
|
Configure which elements (line numbers, file headers, grid borders, Git modifications, ..)
|
||||||
to display in addition to the file contents. The argument is a comma-separated list of
|
to display in addition to the file contents. The argument is a comma-separated list of
|
||||||
@ -129,6 +134,12 @@ Options:
|
|||||||
set a default style, add the '--style=".."' option to the configuration file or export the
|
set a default style, add the '--style=".."' option to the configuration file or export the
|
||||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE="..").
|
BAT_STYLE environment variable (e.g.: export BAT_STYLE="..").
|
||||||
|
|
||||||
|
When styles are specified in multiple places, the "nearest" set of styles take precedence.
|
||||||
|
The command-line arguments are the highest priority, followed by the BAT_STYLE environment
|
||||||
|
variable, and then the configuration file. If any set of styles consists entirely of
|
||||||
|
components prefixed with "+" or "-", it will modify the previous set of styles instead of
|
||||||
|
replacing them.
|
||||||
|
|
||||||
By default, the following components are enabled:
|
By default, the following components are enabled:
|
||||||
changes, grid, header-filename, numbers, snip
|
changes, grid, header-filename, numbers, snip
|
||||||
|
|
||||||
|
@ -2,11 +2,14 @@ use std::collections::HashSet;
|
|||||||
use std::env;
|
use std::env;
|
||||||
use std::io::IsTerminal;
|
use std::io::IsTerminal;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
clap_app,
|
clap_app,
|
||||||
config::{get_args_from_config_file, get_args_from_env_opts_var, get_args_from_env_vars},
|
config::{get_args_from_config_file, get_args_from_env_opts_var, get_args_from_env_vars},
|
||||||
};
|
};
|
||||||
|
use bat::style::StyleComponentList;
|
||||||
|
use bat::StripAnsiMode;
|
||||||
use clap::ArgMatches;
|
use clap::ArgMatches;
|
||||||
|
|
||||||
use console::Term;
|
use console::Term;
|
||||||
@ -85,7 +88,6 @@ impl App {
|
|||||||
|
|
||||||
// .. and the rest at the end
|
// .. and the rest at the end
|
||||||
cli_args.for_each(|a| args.push(a));
|
cli_args.for_each(|a| args.push(a));
|
||||||
|
|
||||||
args
|
args
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -242,6 +244,16 @@ impl App {
|
|||||||
4
|
4
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
strip_ansi: match self
|
||||||
|
.matches
|
||||||
|
.get_one::<String>("strip-ansi")
|
||||||
|
.map(|s| s.as_str())
|
||||||
|
{
|
||||||
|
Some("never") => StripAnsiMode::Never,
|
||||||
|
Some("always") => StripAnsiMode::Always,
|
||||||
|
Some("auto") => StripAnsiMode::Auto,
|
||||||
|
_ => unreachable!("other values for --strip-ansi are not allowed"),
|
||||||
|
},
|
||||||
theme: self
|
theme: self
|
||||||
.matches
|
.matches
|
||||||
.get_one::<String>("theme")
|
.get_one::<String>("theme")
|
||||||
@ -353,34 +365,57 @@ impl App {
|
|||||||
Ok(file_input)
|
Ok(file_input)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn forced_style_components(&self) -> Option<StyleComponents> {
|
||||||
|
// No components if `--decorations=never``.
|
||||||
|
if self
|
||||||
|
.matches
|
||||||
|
.get_one::<String>("decorations")
|
||||||
|
.map(|s| s.as_str())
|
||||||
|
== Some("never")
|
||||||
|
{
|
||||||
|
return Some(StyleComponents(HashSet::new()));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only line numbers if `--number`.
|
||||||
|
if self.matches.get_flag("number") {
|
||||||
|
return Some(StyleComponents(HashSet::from([
|
||||||
|
StyleComponent::LineNumbers,
|
||||||
|
])));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Plain if `--plain` is specified at least once.
|
||||||
|
if self.matches.get_count("plain") > 0 {
|
||||||
|
return Some(StyleComponents(HashSet::from([StyleComponent::Plain])));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Default behavior.
|
||||||
|
None
|
||||||
|
}
|
||||||
|
|
||||||
fn style_components(&self) -> Result<StyleComponents> {
|
fn style_components(&self) -> Result<StyleComponents> {
|
||||||
let matches = &self.matches;
|
let matches = &self.matches;
|
||||||
let mut styled_components = StyleComponents(
|
let mut styled_components = match self.forced_style_components() {
|
||||||
if matches.get_one::<String>("decorations").map(|s| s.as_str()) == Some("never") {
|
Some(forced_components) => forced_components,
|
||||||
HashSet::new()
|
|
||||||
} else if matches.get_flag("number") {
|
// Parse the `--style` arguments and merge them.
|
||||||
[StyleComponent::LineNumbers].iter().cloned().collect()
|
None if matches.contains_id("style") => {
|
||||||
} else if 0 < matches.get_count("plain") {
|
let lists = matches
|
||||||
[StyleComponent::Plain].iter().cloned().collect()
|
.get_many::<String>("style")
|
||||||
} else {
|
.expect("styles present")
|
||||||
matches
|
.map(|v| StyleComponentList::from_str(v))
|
||||||
.get_one::<String>("style")
|
.collect::<Result<Vec<StyleComponentList>>>()?;
|
||||||
.map(|styles| {
|
|
||||||
styles
|
StyleComponentList::to_components(lists, self.interactive_output, true)
|
||||||
.split(',')
|
}
|
||||||
.map(|style| style.parse::<StyleComponent>())
|
|
||||||
.filter_map(|style| style.ok())
|
// Use the default.
|
||||||
.collect::<Vec<_>>()
|
None => StyleComponents(HashSet::from_iter(
|
||||||
})
|
StyleComponent::Default
|
||||||
.unwrap_or_else(|| vec![StyleComponent::Default])
|
.components(self.interactive_output)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|style| style.components(self.interactive_output))
|
.cloned(),
|
||||||
.fold(HashSet::new(), |mut acc, components| {
|
)),
|
||||||
acc.extend(components.iter().cloned());
|
};
|
||||||
acc
|
|
||||||
})
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
// If `grid` is set, remove `rule` as it is a subset of `grid`, and print a warning.
|
// If `grid` is set, remove `rule` as it is a subset of `grid`, and print a warning.
|
||||||
if styled_components.grid() && styled_components.0.remove(&StyleComponent::Rule) {
|
if styled_components.grid() && styled_components.0.remove(&StyleComponent::Rule) {
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
|
use bat::style::StyleComponentList;
|
||||||
use clap::{
|
use clap::{
|
||||||
crate_name, crate_version, value_parser, Arg, ArgAction, ArgGroup, ColorChoice, Command,
|
crate_name, crate_version, value_parser, Arg, ArgAction, ArgGroup, ColorChoice, Command,
|
||||||
};
|
};
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use std::env;
|
use std::env;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
static VERSION: Lazy<String> = Lazy::new(|| {
|
static VERSION: Lazy<String> = Lazy::new(|| {
|
||||||
#[cfg(feature = "bugreport")]
|
#[cfg(feature = "bugreport")]
|
||||||
@ -402,37 +404,30 @@ pub fn build_app(interactive_output: bool) -> Command {
|
|||||||
.long_help("Set the maximum number of consecutive empty lines to be printed.")
|
.long_help("Set the maximum number of consecutive empty lines to be printed.")
|
||||||
.hide_short_help(true)
|
.hide_short_help(true)
|
||||||
)
|
)
|
||||||
|
.arg(
|
||||||
|
Arg::new("strip-ansi")
|
||||||
|
.long("strip-ansi")
|
||||||
|
.overrides_with("strip-ansi")
|
||||||
|
.value_name("when")
|
||||||
|
.value_parser(["auto", "always", "never"])
|
||||||
|
.default_value("never")
|
||||||
|
.hide_default_value(true)
|
||||||
|
.help("Strip colors from the input (auto, always, *never*)")
|
||||||
|
.long_help("Specify when to strip ANSI escape sequences from the input. \
|
||||||
|
The automatic mode will remove escape sequences unless the syntax highlighting \
|
||||||
|
language is plain text. Possible values: auto, always, *never*.")
|
||||||
|
.hide_short_help(true)
|
||||||
|
)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::new("style")
|
Arg::new("style")
|
||||||
.long("style")
|
.long("style")
|
||||||
|
.action(ArgAction::Append)
|
||||||
.value_name("components")
|
.value_name("components")
|
||||||
.overrides_with("style")
|
|
||||||
.overrides_with("plain")
|
|
||||||
.overrides_with("number")
|
|
||||||
// Cannot use claps built in validation because we have to turn off clap's delimiters
|
// Cannot use claps built in validation because we have to turn off clap's delimiters
|
||||||
.value_parser(|val: &str| {
|
.value_parser(|val: &str| {
|
||||||
let mut invalid_vals = val.split(',').filter(|style| {
|
match StyleComponentList::from_str(val) {
|
||||||
!&[
|
Err(err) => Err(err),
|
||||||
"auto",
|
Ok(_) => Ok(val.to_owned()),
|
||||||
"full",
|
|
||||||
"default",
|
|
||||||
"plain",
|
|
||||||
"header",
|
|
||||||
"header-filename",
|
|
||||||
"header-filesize",
|
|
||||||
"grid",
|
|
||||||
"rule",
|
|
||||||
"numbers",
|
|
||||||
"snip",
|
|
||||||
#[cfg(feature = "git")]
|
|
||||||
"changes",
|
|
||||||
].contains(style)
|
|
||||||
});
|
|
||||||
|
|
||||||
if let Some(invalid) = invalid_vals.next() {
|
|
||||||
Err(format!("Unknown style, '{invalid}'"))
|
|
||||||
} else {
|
|
||||||
Ok(val.to_owned())
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.help(
|
.help(
|
||||||
@ -447,6 +442,12 @@ pub fn build_app(interactive_output: bool) -> Command {
|
|||||||
pre-defined style ('full'). To set a default style, add the \
|
pre-defined style ('full'). To set a default style, add the \
|
||||||
'--style=\"..\"' option to the configuration file or export the \
|
'--style=\"..\"' option to the configuration file or export the \
|
||||||
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
|
BAT_STYLE environment variable (e.g.: export BAT_STYLE=\"..\").\n\n\
|
||||||
|
When styles are specified in multiple places, the \"nearest\" set \
|
||||||
|
of styles take precedence. The command-line arguments are the highest \
|
||||||
|
priority, followed by the BAT_STYLE environment variable, and then \
|
||||||
|
the configuration file. If any set of styles consists entirely of \
|
||||||
|
components prefixed with \"+\" or \"-\", it will modify the \
|
||||||
|
previous set of styles instead of replacing them.\n\n\
|
||||||
By default, the following components are enabled:\n \
|
By default, the following components are enabled:\n \
|
||||||
changes, grid, header-filename, numbers, snip\n\n\
|
changes, grid, header-filename, numbers, snip\n\n\
|
||||||
Possible values:\n\n \
|
Possible values:\n\n \
|
||||||
|
@ -146,8 +146,11 @@ pub fn get_args_from_env_vars() -> Vec<OsString> {
|
|||||||
("--style", "BAT_STYLE"),
|
("--style", "BAT_STYLE"),
|
||||||
]
|
]
|
||||||
.iter()
|
.iter()
|
||||||
.filter_map(|(flag, key)| env::var(key).ok().map(|var| [flag.to_string(), var]))
|
.filter_map(|(flag, key)| {
|
||||||
.flatten()
|
env::var(key)
|
||||||
|
.ok()
|
||||||
|
.map(|var| [flag.to_string(), var].join("="))
|
||||||
|
})
|
||||||
.map(|a| a.into())
|
.map(|a| a.into())
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
@ -202,7 +202,7 @@ pub fn list_themes(cfg: &Config, config_dir: &Path, cache_dir: &Path) -> Result<
|
|||||||
|
|
||||||
let default_theme = HighlightingAssets::default_theme();
|
let default_theme = HighlightingAssets::default_theme();
|
||||||
for theme in assets.themes() {
|
for theme in assets.themes() {
|
||||||
let default_theme_info = if default_theme == theme {
|
let default_theme_info = if !config.loop_through && default_theme == theme {
|
||||||
" (default)"
|
" (default)"
|
||||||
} else {
|
} else {
|
||||||
""
|
""
|
||||||
|
@ -5,6 +5,7 @@ use crate::paging::PagingMode;
|
|||||||
use crate::style::StyleComponents;
|
use crate::style::StyleComponents;
|
||||||
use crate::syntax_mapping::SyntaxMapping;
|
use crate::syntax_mapping::SyntaxMapping;
|
||||||
use crate::wrapping::WrappingMode;
|
use crate::wrapping::WrappingMode;
|
||||||
|
use crate::StripAnsiMode;
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub enum VisibleLines {
|
pub enum VisibleLines {
|
||||||
@ -100,6 +101,9 @@ pub struct Config<'a> {
|
|||||||
|
|
||||||
/// The maximum number of consecutive empty lines to display
|
/// The maximum number of consecutive empty lines to display
|
||||||
pub squeeze_lines: Option<usize>,
|
pub squeeze_lines: Option<usize>,
|
||||||
|
|
||||||
|
// Weather or not to set terminal title when using a pager
|
||||||
|
pub strip_ansi: StripAnsiMode,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(all(feature = "minimal-application", feature = "paging"))]
|
#[cfg(all(feature = "minimal-application", feature = "paging"))]
|
||||||
|
@ -53,6 +53,7 @@ mod vscreen;
|
|||||||
pub(crate) mod wrapping;
|
pub(crate) mod wrapping;
|
||||||
|
|
||||||
pub use nonprintable_notation::NonprintableNotation;
|
pub use nonprintable_notation::NonprintableNotation;
|
||||||
|
pub use preprocessor::StripAnsiMode;
|
||||||
pub use pretty_printer::{Input, PrettyPrinter, Syntax};
|
pub use pretty_printer::{Input, PrettyPrinter, Syntax};
|
||||||
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
pub use syntax_mapping::{MappingTarget, SyntaxMapping};
|
||||||
pub use wrapping::WrappingMode;
|
pub use wrapping::WrappingMode;
|
||||||
|
@ -1,17 +1,18 @@
|
|||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
|
|
||||||
use console::AnsiCodeIterator;
|
use crate::{
|
||||||
|
nonprintable_notation::NonprintableNotation,
|
||||||
use crate::nonprintable_notation::NonprintableNotation;
|
vscreen::{EscapeSequenceOffsets, EscapeSequenceOffsetsIterator},
|
||||||
|
};
|
||||||
|
|
||||||
/// Expand tabs like an ANSI-enabled expand(1).
|
/// Expand tabs like an ANSI-enabled expand(1).
|
||||||
pub fn expand_tabs(line: &str, width: usize, cursor: &mut usize) -> String {
|
pub fn expand_tabs(line: &str, width: usize, cursor: &mut usize) -> String {
|
||||||
let mut buffer = String::with_capacity(line.len() * 2);
|
let mut buffer = String::with_capacity(line.len() * 2);
|
||||||
|
|
||||||
for chunk in AnsiCodeIterator::new(line) {
|
for seq in EscapeSequenceOffsetsIterator::new(line) {
|
||||||
match chunk {
|
match seq {
|
||||||
(text, true) => buffer.push_str(text),
|
EscapeSequenceOffsets::Text { .. } => {
|
||||||
(mut text, false) => {
|
let mut text = &line[seq.index_of_start()..seq.index_past_end()];
|
||||||
while let Some(index) = text.find('\t') {
|
while let Some(index) = text.find('\t') {
|
||||||
// Add previous text.
|
// Add previous text.
|
||||||
if index > 0 {
|
if index > 0 {
|
||||||
@ -31,6 +32,10 @@ pub fn expand_tabs(line: &str, width: usize, cursor: &mut usize) -> String {
|
|||||||
*cursor += text.len();
|
*cursor += text.len();
|
||||||
buffer.push_str(text);
|
buffer.push_str(text);
|
||||||
}
|
}
|
||||||
|
_ => {
|
||||||
|
// Copy the ANSI escape sequence.
|
||||||
|
buffer.push_str(&line[seq.index_of_start()..seq.index_past_end()])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,6 +136,27 @@ pub fn replace_nonprintable(
|
|||||||
output
|
output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Strips ANSI escape sequences from the input.
|
||||||
|
pub fn strip_ansi(line: &str) -> String {
|
||||||
|
let mut buffer = String::with_capacity(line.len());
|
||||||
|
|
||||||
|
for seq in EscapeSequenceOffsetsIterator::new(line) {
|
||||||
|
if let EscapeSequenceOffsets::Text { .. } = seq {
|
||||||
|
buffer.push_str(&line[seq.index_of_start()..seq.index_past_end()]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
buffer
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq, Clone, Copy, Default)]
|
||||||
|
pub enum StripAnsiMode {
|
||||||
|
#[default]
|
||||||
|
Never,
|
||||||
|
Always,
|
||||||
|
Auto,
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_try_parse_utf8_char() {
|
fn test_try_parse_utf8_char() {
|
||||||
assert_eq!(try_parse_utf8_char(&[0x20]), Some((' ', 1)));
|
assert_eq!(try_parse_utf8_char(&[0x20]), Some((' ', 1)));
|
||||||
@ -174,3 +200,14 @@ fn test_try_parse_utf8_char() {
|
|||||||
assert_eq!(try_parse_utf8_char(&[0xef, 0x20]), None);
|
assert_eq!(try_parse_utf8_char(&[0xef, 0x20]), None);
|
||||||
assert_eq!(try_parse_utf8_char(&[0xf0, 0xf0]), None);
|
assert_eq!(try_parse_utf8_char(&[0xf0, 0xf0]), None);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_strip_ansi() {
|
||||||
|
// The sequence detection is covered by the tests in the vscreen module.
|
||||||
|
assert_eq!(strip_ansi("no ansi"), "no ansi");
|
||||||
|
assert_eq!(strip_ansi("\x1B[33mone"), "one");
|
||||||
|
assert_eq!(
|
||||||
|
strip_ansi("\x1B]1\x07multiple\x1B[J sequences"),
|
||||||
|
"multiple sequences"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
@ -11,7 +11,7 @@ use crate::{
|
|||||||
input,
|
input,
|
||||||
line_range::{HighlightedLineRanges, LineRange, LineRanges},
|
line_range::{HighlightedLineRanges, LineRange, LineRanges},
|
||||||
style::StyleComponent,
|
style::StyleComponent,
|
||||||
SyntaxMapping, WrappingMode,
|
StripAnsiMode, SyntaxMapping, WrappingMode,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[cfg(feature = "paging")]
|
#[cfg(feature = "paging")]
|
||||||
@ -182,6 +182,15 @@ impl<'a> PrettyPrinter<'a> {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether to remove ANSI escape sequences from the input (default: never)
|
||||||
|
///
|
||||||
|
/// If `Auto` is used, escape sequences will only be removed when the input
|
||||||
|
/// is not plain text.
|
||||||
|
pub fn strip_ansi(&mut self, mode: StripAnsiMode) -> &mut Self {
|
||||||
|
self.config.strip_ansi = mode;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
/// Text wrapping mode (default: do not wrap)
|
/// Text wrapping mode (default: do not wrap)
|
||||||
pub fn wrapping_mode(&mut self, mode: WrappingMode) -> &mut Self {
|
pub fn wrapping_mode(&mut self, mode: WrappingMode) -> &mut Self {
|
||||||
self.config.wrapping_mode = mode;
|
self.config.wrapping_mode = mode;
|
||||||
|
@ -29,11 +29,13 @@ use crate::diff::LineChanges;
|
|||||||
use crate::error::*;
|
use crate::error::*;
|
||||||
use crate::input::OpenedInput;
|
use crate::input::OpenedInput;
|
||||||
use crate::line_range::RangeCheckResult;
|
use crate::line_range::RangeCheckResult;
|
||||||
|
use crate::preprocessor::strip_ansi;
|
||||||
use crate::preprocessor::{expand_tabs, replace_nonprintable};
|
use crate::preprocessor::{expand_tabs, replace_nonprintable};
|
||||||
use crate::style::StyleComponent;
|
use crate::style::StyleComponent;
|
||||||
use crate::terminal::{as_terminal_escaped, to_ansi_color};
|
use crate::terminal::{as_terminal_escaped, to_ansi_color};
|
||||||
use crate::vscreen::{AnsiStyle, EscapeSequence, EscapeSequenceIterator};
|
use crate::vscreen::{AnsiStyle, EscapeSequence, EscapeSequenceIterator};
|
||||||
use crate::wrapping::WrappingMode;
|
use crate::wrapping::WrappingMode;
|
||||||
|
use crate::StripAnsiMode;
|
||||||
|
|
||||||
const ANSI_UNDERLINE_ENABLE: EscapeSequence = EscapeSequence::CSI {
|
const ANSI_UNDERLINE_ENABLE: EscapeSequence = EscapeSequence::CSI {
|
||||||
raw_sequence: "\x1B[4m",
|
raw_sequence: "\x1B[4m",
|
||||||
@ -207,6 +209,7 @@ pub(crate) struct InteractivePrinter<'a> {
|
|||||||
highlighter_from_set: Option<HighlighterFromSet<'a>>,
|
highlighter_from_set: Option<HighlighterFromSet<'a>>,
|
||||||
background_color_highlight: Option<Color>,
|
background_color_highlight: Option<Color>,
|
||||||
consecutive_empty_lines: usize,
|
consecutive_empty_lines: usize,
|
||||||
|
strip_ansi: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a> InteractivePrinter<'a> {
|
impl<'a> InteractivePrinter<'a> {
|
||||||
@ -265,20 +268,41 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
.content_type
|
.content_type
|
||||||
.map_or(false, |c| c.is_binary() && !config.show_nonprintable);
|
.map_or(false, |c| c.is_binary() && !config.show_nonprintable);
|
||||||
|
|
||||||
let highlighter_from_set = if is_printing_binary || !config.colored_output {
|
let needs_to_match_syntax = !is_printing_binary
|
||||||
None
|
&& (config.colored_output || config.strip_ansi == StripAnsiMode::Auto);
|
||||||
} else {
|
|
||||||
// Determine the type of syntax for highlighting
|
|
||||||
let syntax_in_set =
|
|
||||||
match assets.get_syntax(config.language, input, &config.syntax_mapping) {
|
|
||||||
Ok(syntax_in_set) => syntax_in_set,
|
|
||||||
Err(Error::UndetectedSyntax(_)) => assets
|
|
||||||
.find_syntax_by_name("Plain Text")?
|
|
||||||
.expect("A plain text syntax is available"),
|
|
||||||
Err(e) => return Err(e),
|
|
||||||
};
|
|
||||||
|
|
||||||
Some(HighlighterFromSet::new(syntax_in_set, theme))
|
let (is_plain_text, highlighter_from_set) = if needs_to_match_syntax {
|
||||||
|
// Determine the type of syntax for highlighting
|
||||||
|
const PLAIN_TEXT_SYNTAX: &str = "Plain Text";
|
||||||
|
match assets.get_syntax(config.language, input, &config.syntax_mapping) {
|
||||||
|
Ok(syntax_in_set) => (
|
||||||
|
syntax_in_set.syntax.name == PLAIN_TEXT_SYNTAX,
|
||||||
|
Some(HighlighterFromSet::new(syntax_in_set, theme)),
|
||||||
|
),
|
||||||
|
|
||||||
|
Err(Error::UndetectedSyntax(_)) => (
|
||||||
|
true,
|
||||||
|
Some(
|
||||||
|
assets
|
||||||
|
.find_syntax_by_name(PLAIN_TEXT_SYNTAX)?
|
||||||
|
.map(|s| HighlighterFromSet::new(s, theme))
|
||||||
|
.expect("A plain text syntax is available"),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Err(e) => return Err(e),
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
(false, None)
|
||||||
|
};
|
||||||
|
|
||||||
|
// Determine when to strip ANSI sequences
|
||||||
|
let strip_ansi = match config.strip_ansi {
|
||||||
|
_ if config.show_nonprintable => false,
|
||||||
|
StripAnsiMode::Always => true,
|
||||||
|
StripAnsiMode::Auto if is_plain_text => false, // Plain text may already contain escape sequences.
|
||||||
|
StripAnsiMode::Auto => true,
|
||||||
|
_ => false,
|
||||||
};
|
};
|
||||||
|
|
||||||
Ok(InteractivePrinter {
|
Ok(InteractivePrinter {
|
||||||
@ -293,6 +317,7 @@ impl<'a> InteractivePrinter<'a> {
|
|||||||
highlighter_from_set,
|
highlighter_from_set,
|
||||||
background_color_highlight,
|
background_color_highlight,
|
||||||
consecutive_empty_lines: 0,
|
consecutive_empty_lines: 0,
|
||||||
|
strip_ansi,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,7 +598,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
)
|
)
|
||||||
.into()
|
.into()
|
||||||
} else {
|
} else {
|
||||||
match self.content_type {
|
let mut line = match self.content_type {
|
||||||
Some(ContentType::BINARY) | None => {
|
Some(ContentType::BINARY) | None => {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
@ -590,7 +615,14 @@ impl<'a> Printer for InteractivePrinter<'a> {
|
|||||||
line
|
line
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// If ANSI escape sequences are supposed to be stripped, do it before syntax highlighting.
|
||||||
|
if self.strip_ansi {
|
||||||
|
line = strip_ansi(&line).into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
line
|
||||||
};
|
};
|
||||||
|
|
||||||
let regions = self.highlight_regions_for_line(&line)?;
|
let regions = self.highlight_regions_for_line(&line)?;
|
||||||
|
224
src/style.rs
224
src/style.rs
@ -138,3 +138,227 @@ impl StyleComponents {
|
|||||||
self.0.clear();
|
self.0.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, PartialEq)]
|
||||||
|
enum ComponentAction {
|
||||||
|
Override,
|
||||||
|
Add,
|
||||||
|
Remove,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl ComponentAction {
|
||||||
|
fn extract_from_str(string: &str) -> (ComponentAction, &str) {
|
||||||
|
match string.chars().next() {
|
||||||
|
Some('-') => (ComponentAction::Remove, string.strip_prefix('-').unwrap()),
|
||||||
|
Some('+') => (ComponentAction::Add, string.strip_prefix('+').unwrap()),
|
||||||
|
_ => (ComponentAction::Override, string),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// A list of [StyleComponent] that can be parsed from a string.
|
||||||
|
pub struct StyleComponentList(Vec<(ComponentAction, StyleComponent)>);
|
||||||
|
|
||||||
|
impl StyleComponentList {
|
||||||
|
fn expand_into(&self, components: &mut HashSet<StyleComponent>, interactive_terminal: bool) {
|
||||||
|
for (action, component) in self.0.iter() {
|
||||||
|
let subcomponents = component.components(interactive_terminal);
|
||||||
|
|
||||||
|
use ComponentAction::*;
|
||||||
|
match action {
|
||||||
|
Override | Add => components.extend(subcomponents),
|
||||||
|
Remove => components.retain(|c| !subcomponents.contains(c)),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns `true` if any component in the list was not prefixed with `+` or `-`.
|
||||||
|
fn contains_override(&self) -> bool {
|
||||||
|
self.0.iter().any(|(a, _)| *a == ComponentAction::Override)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Combines multiple [StyleComponentList]s into a single [StyleComponents] set.
|
||||||
|
///
|
||||||
|
/// ## Precedence
|
||||||
|
/// The most recent list will take precedence and override all previous lists
|
||||||
|
/// unless it only contains components prefixed with `-` or `+`. When this
|
||||||
|
/// happens, the list's components will be merged into the previous list.
|
||||||
|
///
|
||||||
|
/// ## Example
|
||||||
|
/// ```text
|
||||||
|
/// [numbers,grid] + [header,changes] -> [header,changes]
|
||||||
|
/// [numbers,grid] + [+header,-grid] -> [numbers,header]
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// ## Parameters
|
||||||
|
/// - `with_default`: If true, the styles lists will build upon the StyleComponent::Auto style.
|
||||||
|
pub fn to_components(
|
||||||
|
lists: impl IntoIterator<Item = StyleComponentList>,
|
||||||
|
interactive_terminal: bool,
|
||||||
|
with_default: bool,
|
||||||
|
) -> StyleComponents {
|
||||||
|
let mut components: HashSet<StyleComponent> = HashSet::new();
|
||||||
|
if with_default {
|
||||||
|
components.extend(StyleComponent::Auto.components(interactive_terminal))
|
||||||
|
}
|
||||||
|
|
||||||
|
StyleComponents(lists.into_iter().fold(components, |mut components, list| {
|
||||||
|
if list.contains_override() {
|
||||||
|
components.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
list.expand_into(&mut components, interactive_terminal);
|
||||||
|
components
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for StyleComponentList {
|
||||||
|
fn default() -> Self {
|
||||||
|
StyleComponentList(vec![(ComponentAction::Override, StyleComponent::Default)])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl FromStr for StyleComponentList {
|
||||||
|
type Err = Error;
|
||||||
|
|
||||||
|
fn from_str(s: &str) -> Result<Self> {
|
||||||
|
Ok(StyleComponentList(
|
||||||
|
s.split(",")
|
||||||
|
.map(|s| ComponentAction::extract_from_str(s)) // If the component starts with "-", it's meant to be removed
|
||||||
|
.map(|(a, s)| Ok((a, StyleComponent::from_str(s)?)))
|
||||||
|
.collect::<Result<Vec<(ComponentAction, StyleComponent)>>>()?,
|
||||||
|
))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod test {
|
||||||
|
use std::collections::HashSet;
|
||||||
|
use std::str::FromStr;
|
||||||
|
|
||||||
|
use super::ComponentAction::*;
|
||||||
|
use super::StyleComponent;
|
||||||
|
use super::StyleComponent::*;
|
||||||
|
use super::StyleComponentList;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_parse() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::from_str("grid,+numbers,snip,-snip,header")
|
||||||
|
.expect("no error")
|
||||||
|
.0,
|
||||||
|
vec![
|
||||||
|
(Override, Grid),
|
||||||
|
(Add, LineNumbers),
|
||||||
|
(Override, Snip),
|
||||||
|
(Remove, Snip),
|
||||||
|
(Override, Header),
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
assert!(StyleComponentList::from_str("not-a-component").is_err());
|
||||||
|
assert!(StyleComponentList::from_str("grid,not-a-component").is_err());
|
||||||
|
assert!(StyleComponentList::from_str("numbers,-not-a-component").is_err());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_to_components() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![StyleComponentList::from_str("grid,numbers").expect("no error")],
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
HashSet::from([Grid, LineNumbers])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_to_components_removes_negated() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![StyleComponentList::from_str("grid,numbers,-grid").expect("no error")],
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
HashSet::from([LineNumbers])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_to_components_expands_subcomponents() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![StyleComponentList::from_str("full").expect("no error")],
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
HashSet::from_iter(Full.components(true).to_owned())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_expand_negates_subcomponents() {
|
||||||
|
assert!(!StyleComponentList::to_components(
|
||||||
|
vec![StyleComponentList::from_str("full,-numbers").expect("no error")],
|
||||||
|
true,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.numbers());
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_to_components_precedence_overrides_previous_lists() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![
|
||||||
|
StyleComponentList::from_str("grid").expect("no error"),
|
||||||
|
StyleComponentList::from_str("numbers").expect("no error"),
|
||||||
|
],
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
HashSet::from([LineNumbers])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_to_components_precedence_merges_previous_lists() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![
|
||||||
|
StyleComponentList::from_str("grid,header").expect("no error"),
|
||||||
|
StyleComponentList::from_str("-grid").expect("no error"),
|
||||||
|
StyleComponentList::from_str("+numbers").expect("no error"),
|
||||||
|
],
|
||||||
|
false,
|
||||||
|
false
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
HashSet::from([HeaderFilename, LineNumbers])
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
pub fn style_component_list_default_builds_on_auto() {
|
||||||
|
assert_eq!(
|
||||||
|
StyleComponentList::to_components(
|
||||||
|
vec![StyleComponentList::from_str("-numbers").expect("no error"),],
|
||||||
|
true,
|
||||||
|
true
|
||||||
|
)
|
||||||
|
.0,
|
||||||
|
{
|
||||||
|
let mut expected: HashSet<StyleComponent> = HashSet::new();
|
||||||
|
expected.extend(Auto.components(true));
|
||||||
|
expected.remove(&LineNumbers);
|
||||||
|
expected
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
# JSON Lines is a simple variation of JSON #2535
|
# JSON Lines is a simple variation of JSON #2535
|
||||||
[mappings]
|
[mappings]
|
||||||
"JSON" = ["*.jsonl", "*.jsonc"]
|
"JSON" = ["*.jsonl", "*.jsonc", "*.jsonld", "*.geojson"]
|
||||||
|
2
src/syntax_mapping/builtins/common/50-markdown.toml
Normal file
2
src/syntax_mapping/builtins/common/50-markdown.toml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
[mappings]
|
||||||
|
"Markdown" = ["*.mkd"]
|
@ -285,7 +285,7 @@ fn join(
|
|||||||
|
|
||||||
/// A range of indices for a raw ANSI escape sequence.
|
/// A range of indices for a raw ANSI escape sequence.
|
||||||
#[derive(Debug, PartialEq)]
|
#[derive(Debug, PartialEq)]
|
||||||
enum EscapeSequenceOffsets {
|
pub enum EscapeSequenceOffsets {
|
||||||
Text {
|
Text {
|
||||||
start: usize,
|
start: usize,
|
||||||
end: usize,
|
end: usize,
|
||||||
@ -320,6 +320,32 @@ enum EscapeSequenceOffsets {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl EscapeSequenceOffsets {
|
||||||
|
/// Returns the byte-index of the first character in the escape sequence.
|
||||||
|
pub fn index_of_start(&self) -> usize {
|
||||||
|
use EscapeSequenceOffsets::*;
|
||||||
|
match self {
|
||||||
|
Text { start, .. } => *start,
|
||||||
|
Unknown { start, .. } => *start,
|
||||||
|
NF { start_sequence, .. } => *start_sequence,
|
||||||
|
OSC { start_sequence, .. } => *start_sequence,
|
||||||
|
CSI { start_sequence, .. } => *start_sequence,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Returns the byte-index past the last character in the escape sequence.
|
||||||
|
pub fn index_past_end(&self) -> usize {
|
||||||
|
use EscapeSequenceOffsets::*;
|
||||||
|
match self {
|
||||||
|
Text { end, .. } => *end,
|
||||||
|
Unknown { end, .. } => *end,
|
||||||
|
NF { end, .. } => *end,
|
||||||
|
OSC { end, .. } => *end,
|
||||||
|
CSI { end, .. } => *end,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// An iterator over the offests of ANSI/VT escape sequences within a string.
|
/// An iterator over the offests of ANSI/VT escape sequences within a string.
|
||||||
///
|
///
|
||||||
/// ## Example
|
/// ## Example
|
||||||
@ -327,7 +353,7 @@ enum EscapeSequenceOffsets {
|
|||||||
/// ```ignore
|
/// ```ignore
|
||||||
/// let iter = EscapeSequenceOffsetsIterator::new("\x1B[33mThis is yellow text.\x1B[m");
|
/// let iter = EscapeSequenceOffsetsIterator::new("\x1B[33mThis is yellow text.\x1B[m");
|
||||||
/// ```
|
/// ```
|
||||||
struct EscapeSequenceOffsetsIterator<'a> {
|
pub struct EscapeSequenceOffsetsIterator<'a> {
|
||||||
text: &'a str,
|
text: &'a str,
|
||||||
chars: Peekable<CharIndices<'a>>,
|
chars: Peekable<CharIndices<'a>>,
|
||||||
}
|
}
|
||||||
|
@ -300,6 +300,7 @@ fn list_themes_without_colors() {
|
|||||||
|
|
||||||
bat()
|
bat()
|
||||||
.arg("--color=never")
|
.arg("--color=never")
|
||||||
|
.arg("--decorations=always") // trick bat into setting `Config::loop_through` to false
|
||||||
.arg("--list-themes")
|
.arg("--list-themes")
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
@ -307,6 +308,15 @@ fn list_themes_without_colors() {
|
|||||||
.stdout(predicate::str::contains(default_theme_chunk).normalize());
|
.stdout(predicate::str::contains(default_theme_chunk).normalize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn list_themes_to_piped_output() {
|
||||||
|
bat()
|
||||||
|
.arg("--list-themes")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(predicate::str::contains("(default)").not());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
#[cfg_attr(any(not(feature = "git"), target_os = "windows"), ignore)]
|
#[cfg_attr(any(not(feature = "git"), target_os = "windows"), ignore)]
|
||||||
fn short_help() {
|
fn short_help() {
|
||||||
@ -2666,3 +2676,215 @@ fn highlighting_independant_from_map_syntax_case() {
|
|||||||
.stdout(expected)
|
.stdout(expected)
|
||||||
.stderr("");
|
.stderr("");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_always_strips_ansi() {
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=always")
|
||||||
|
.write_stdin("\x1B[33mYellow\x1B[m")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("Yellow");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_never_does_not_strip_ansi() {
|
||||||
|
let output = String::from_utf8(
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=never")
|
||||||
|
.write_stdin("\x1B[33mYellow\x1B[m")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.get_output()
|
||||||
|
.stdout
|
||||||
|
.clone(),
|
||||||
|
)
|
||||||
|
.expect("valid utf8");
|
||||||
|
|
||||||
|
assert!(output.contains("\x1B[33mYellow"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_does_not_affect_simple_printer() {
|
||||||
|
let output = String::from_utf8(
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=never")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=always")
|
||||||
|
.write_stdin("\x1B[33mYellow\x1B[m")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.get_output()
|
||||||
|
.stdout
|
||||||
|
.clone(),
|
||||||
|
)
|
||||||
|
.expect("valid utf8");
|
||||||
|
|
||||||
|
assert!(output.contains("\x1B[33mYellow"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_does_not_strip_when_show_nonprintable() {
|
||||||
|
let output = String::from_utf8(
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=never")
|
||||||
|
.arg("--color=always")
|
||||||
|
.arg("--strip-ansi=always")
|
||||||
|
.arg("--show-nonprintable")
|
||||||
|
.write_stdin("\x1B[33mY")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.get_output()
|
||||||
|
.stdout
|
||||||
|
.clone(),
|
||||||
|
)
|
||||||
|
.expect("valid utf8");
|
||||||
|
|
||||||
|
assert!(output.contains("␛"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_auto_strips_ansi_when_detected_syntax_by_filename() {
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=auto")
|
||||||
|
.arg("--file-name=test.rs")
|
||||||
|
.write_stdin("fn \x1B[33mYellow\x1B[m() -> () {}")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("fn Yellow() -> () {}");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_auto_strips_ansi_when_provided_syntax_by_option() {
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=auto")
|
||||||
|
.arg("--language=rust")
|
||||||
|
.write_stdin("fn \x1B[33mYellow\x1B[m() -> () {}")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout("fn Yellow() -> () {}");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_auto_does_not_strip_when_plain_text_by_filename() {
|
||||||
|
let output = String::from_utf8(
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=auto")
|
||||||
|
.arg("--file-name=ansi.txt")
|
||||||
|
.write_stdin("\x1B[33mYellow\x1B[m")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.get_output()
|
||||||
|
.stdout
|
||||||
|
.clone(),
|
||||||
|
)
|
||||||
|
.expect("valid utf8");
|
||||||
|
|
||||||
|
assert!(output.contains("\x1B[33mYellow"))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn strip_ansi_auto_does_not_strip_ansi_when_plain_text_by_option() {
|
||||||
|
let output = String::from_utf8(
|
||||||
|
bat()
|
||||||
|
.arg("--style=plain")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.arg("--strip-ansi=auto")
|
||||||
|
.arg("--language=txt")
|
||||||
|
.write_stdin("\x1B[33mYellow\x1B[m")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.get_output()
|
||||||
|
.stdout
|
||||||
|
.clone(),
|
||||||
|
)
|
||||||
|
.expect("valid utf8");
|
||||||
|
|
||||||
|
assert!(output.contains("\x1B[33mYellow"))
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests that style components can be removed with `-component`.
|
||||||
|
#[test]
|
||||||
|
fn style_components_can_be_removed() {
|
||||||
|
bat()
|
||||||
|
.arg({
|
||||||
|
#[cfg(not(feature = "git"))]
|
||||||
|
{
|
||||||
|
"--style=full,-grid"
|
||||||
|
}
|
||||||
|
#[cfg(feature = "git")]
|
||||||
|
{
|
||||||
|
"--style=full,-grid,-changes"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.write_stdin("test")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" STDIN\n Size: -\n 1 test\n")
|
||||||
|
.stderr("");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests that style components are chosen based on the rightmost `--style` argument.
|
||||||
|
#[test]
|
||||||
|
fn style_components_can_be_overidden() {
|
||||||
|
bat()
|
||||||
|
.arg("--style=full")
|
||||||
|
.arg("--style=header,numbers")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.write_stdin("test")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" STDIN\n 1 test\n")
|
||||||
|
.stderr("");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests that style components can be merged across multiple `--style` arguments.
|
||||||
|
#[test]
|
||||||
|
fn style_components_will_merge() {
|
||||||
|
bat()
|
||||||
|
.arg("--style=header,grid")
|
||||||
|
.arg("--style=-grid,+numbers")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.write_stdin("test")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" STDIN\n 1 test\n")
|
||||||
|
.stderr("");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tests that style components can be merged with the `BAT_STYLE` environment variable.
|
||||||
|
#[test]
|
||||||
|
fn style_components_will_merge_with_env_var() {
|
||||||
|
bat()
|
||||||
|
.env("BAT_STYLE", "header,grid")
|
||||||
|
.arg("--style=-grid,+numbers")
|
||||||
|
.arg("--decorations=always")
|
||||||
|
.arg("--color=never")
|
||||||
|
.write_stdin("test")
|
||||||
|
.assert()
|
||||||
|
.success()
|
||||||
|
.stdout(" STDIN\n 1 test\n")
|
||||||
|
.stderr("");
|
||||||
|
}
|
||||||
|
54
tests/syntax-tests/highlighted/CFML/test.cfml
vendored
Normal file
54
tests/syntax-tests/highlighted/CFML/test.cfml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m[38;2;248;248;242mAdd New Employees[0m[38;2;255;255;255m</[0m[38;2;249;38;114mtitle[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mhead[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mh1[0m[38;2;255;255;255m>[0m[38;2;248;248;242mAdd New Employees[0m[38;2;255;255;255m</[0m[38;2;249;38;114mh1[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m Action page code for the form at the bottom of this page. [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m Establish parameters for first time through [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfparam[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mForm.firstname[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mdefault[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfparam[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mForm.lastname[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mdefault[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfparam[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mForm.email[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mdefault[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfparam[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mForm.phone[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mdefault[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfparam[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mForm.department[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mdefault[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m If at least the firstname form field is passed, create [0m
|
||||||
|
[38;2;117;113;94ma structure named employee and add values. [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfif[0m[38;2;248;248;242m [0m[38;2;248;248;242m#[0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242mfirstname[0m[38;2;248;248;242m#[0m[38;2;248;248;242m [0m[38;2;255;255;255meq[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mp[0m[38;2;255;255;255m>[0m[38;2;248;248;242mPlease fill out the form.[0m[38;2;255;255;255m</[0m[38;2;249;38;114mp[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfelse[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfoutput[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcfscript[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;249;38;114m=[0m[38;2;102;217;239mStructNew[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;248;248;242m.[0m[38;2;248;248;242mfirstname[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242mfirstname[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;248;248;242m.[0m[38;2;248;248;242mlastname[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242mlastname[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;248;248;242m.[0m[38;2;248;248;242memail[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242memail[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;248;248;242m.[0m[38;2;248;248;242mphone[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242mphone[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255memployee[0m[38;2;248;248;242m.[0m[38;2;248;248;242mdepartment[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mForm[0m[38;2;248;248;242m.[0m[38;2;248;248;242mdepartment[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mcfscript[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m Display results of creating the structure. [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mFirst name is [0m[38;2;248;248;242m#[0m[38;2;102;217;239mStructFind[0m[38;2;248;248;242m([0m[38;2;255;255;255memployee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mfirstname[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m#[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mLast name is [0m[38;2;248;248;242m#[0m[38;2;102;217;239mStructFind[0m[38;2;248;248;242m([0m[38;2;255;255;255memployee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mlastname[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m#[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mEMail is [0m[38;2;248;248;242m#[0m[38;2;102;217;239mStructFind[0m[38;2;248;248;242m([0m[38;2;255;255;255memployee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116memail[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m#[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mPhone is [0m[38;2;248;248;242m#[0m[38;2;102;217;239mStructFind[0m[38;2;248;248;242m([0m[38;2;255;255;255memployee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mphone[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m#[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mDepartment is [0m[38;2;248;248;242m#[0m[38;2;102;217;239mStructFind[0m[38;2;248;248;242m([0m[38;2;255;255;255memployee[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mdepartment[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m#[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mcfoutput[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m Call the custom tag that adds employees. [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mcf_addemployee[0m[38;2;248;248;242m [0m[38;2;166;226;46mempinfo[0m[38;2;248;248;242m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m#[0m[38;2;255;255;255memployee[0m[38;2;230;219;116m#[0m[38;2;230;219;116m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mcfif[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;117;113;94m<!---[0m[38;2;117;113;94m The form for adding the new employee information [0m[38;2;117;113;94m--->[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mhr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mform[0m[38;2;248;248;242m [0m[38;2;166;226;46maction[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mnewemployee.cfm[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmethod[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mPost[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mFirst Name:[0m[38;2;190;132;255m&[0m[38;2;190;132;255mnbsp[0m[38;2;190;132;255m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mfirstname[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mhspace[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmaxlength[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mLast Name:[0m[38;2;190;132;255m&[0m[38;2;190;132;255mnbsp[0m[38;2;190;132;255m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mlastname[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mhspace[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmaxlength[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mEMail:[0m[38;2;190;132;255m&[0m[38;2;190;132;255mnbsp[0m[38;2;190;132;255m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116memail[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mhspace[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmaxlength[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mPhone:[0m[38;2;190;132;255m&[0m[38;2;190;132;255mnbsp[0m[38;2;190;132;255m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mphone[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mhspace[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m20[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmaxlength[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m20[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;248;248;242mDepartment:[0m[38;2;190;132;255m&[0m[38;2;190;132;255mnbsp[0m[38;2;190;132;255m;[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mdepartment[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mhspace[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mmaxlength[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116m30[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114minput[0m[38;2;248;248;242m [0m[38;2;166;226;46mtype[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mSubmit[0m[38;2;255;255;255m"[0m[38;2;248;248;242m [0m[38;2;166;226;46mvalue[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mOK[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mform[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m<[0m[38;2;249;38;114mbr[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mbody[0m[38;2;255;255;255m>[0m[38;2;248;248;242m [0m
|
||||||
|
[38;2;255;255;255m</[0m[38;2;249;38;114mhtml[0m[38;2;255;255;255m>[0m
|
126
tests/syntax-tests/highlighted/Lisp/utils.lisp
vendored
126
tests/syntax-tests/highlighted/Lisp/utils.lisp
vendored
@ -1,80 +1,80 @@
|
|||||||
[38;2;255;255;255m([0m[38;2;248;248;242mcl:[0m[38;2;102;217;239mdefpackage[0m[38;2;248;248;242m :chillax.utils[0m
|
[38;2;248;248;242m([0m[38;2;248;248;242mcl[0m[38;2;248;248;242m:[0m[38;2;249;38;114mdefpackage[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mchillax.utils[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242m:use :cl :alexandria[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m:[0m[38;2;249;38;114muse[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mcl[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114malexandria[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242m:[0m[38;2;102;217;239mexport[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m:[0m[38;2;249;38;114mexport[0m
|
||||||
[38;2;248;248;242m :fun :mkhash :hashget :strcat :dequote :at[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mfun[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mmkhash[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mhashget[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mstrcat[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mdequote[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mat[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;255;255;255m([0m[38;2;102;217;239min-package[0m[38;2;248;248;242m :chillax.utils[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;102;217;239min-package[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mchillax.utils[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;; Functions[0m
|
[38;2;117;113;94m;;;[0m[38;2;117;113;94m Functions[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefmacro[0m[38;2;248;248;242m [0m[38;2;166;226;46mfun[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242m&body body[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefmacro[0m[38;2;248;248;242m [0m[38;2;166;226;46mfun[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m&[0m[38;2;248;248;242mbody[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mbody[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mThis macro puts the FUN back in FUNCTION.[0m[38;2;230;219;116m"[0m
|
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mThis macro puts the FUN back in FUNCTION.[0m[38;2;230;219;116m"[0m
|
||||||
[38;2;248;248;242m `[0m[38;2;255;255;255m([0m[38;2;102;217;239mlambda[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242m&optional _[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mdeclare [0m[38;2;255;255;255m([0m[38;2;248;248;242mignorable _[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;248;248;242m ,@body[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m`[0m[38;2;248;248;242m([0m[38;2;249;38;114mlambda[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m&[0m[38;2;248;248;242moptional[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mdeclare[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mignorable[0m[38;2;248;248;242m [0m[38;2;255;255;255m_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m,@[0m[38;2;255;255;255mbody[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;; Hash tables[0m
|
[38;2;117;113;94m;;;[0m[38;2;117;113;94m Hash tables[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mmkhash[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242m&[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;249;38;114m-[0m[38;2;249;38;114mand[0m[38;2;249;38;114m-[0m[38;2;102;217;239mvalues[0m[38;2;248;248;242m &aux [0m[38;2;255;255;255m([0m[38;2;248;248;242mtable [0m[38;2;255;255;255m([0m[38;2;102;217;239mmake-hash-table[0m[38;2;248;248;242m :test [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'equal[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mmkhash[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys-and-values[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242maux[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mtable[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mmake-hash-table[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mtest[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;249;38;114mequal[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mConvenience function for `literal' hash table definition.[0m[38;2;230;219;116m"[0m
|
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mConvenience function for `literal' hash table definition.[0m[38;2;230;219;116m"[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mkey val[0m[38;2;255;255;255m)[0m[38;2;248;248;242m on keys[0m[38;2;249;38;114m-[0m[38;2;249;38;114mand[0m[38;2;249;38;114m-[0m[38;2;102;217;239mvalues[0m[38;2;248;248;242m by [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'cddr[0m[38;2;248;248;242m [0m[38;2;249;38;114mdo[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m key table[0m[38;2;255;255;255m)[0m[38;2;248;248;242m val[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mval[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mon[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys-and-values[0m[38;2;248;248;242m [0m[38;2;249;38;114mby[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;102;217;239mcddr[0m[38;2;248;248;242m [0m[38;2;249;38;114mdo[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mtable[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mval[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;249;38;114mfinally[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m table[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;249;38;114mfinally[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;255;255;255mtable[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mhashget[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mhash &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mhashget[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mhash[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mConvenience function for recursively accessing hash tables.[0m[38;2;230;219;116m"[0m
|
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mConvenience function for recursively accessing hash tables.[0m[38;2;230;219;116m"[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mlambda[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mh k[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m k h[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;248;248;242m keys :initial[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue hash[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mlambda[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mh[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mk[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;255;255;255mk[0m[38;2;248;248;242m [0m[38;2;255;255;255mh[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114minitial-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[38;2;102;217;239mdefine-compiler-macro[0m[38;2;248;248;242m hashget [0m[38;2;255;255;255m([0m[38;2;248;248;242mhash &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefine-compiler-macro[0m[38;2;248;248;242m [0m[38;2;255;255;255mhashget[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mhash[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;190;132;255mnull[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m[38;2;248;248;242m hash[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255mnull[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;248;248;242mhash[0m[38;2;249;38;114m-[0m[38;2;248;248;242msym [0m[38;2;255;255;255m([0m[38;2;102;217;239mmake-symbol[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mHASH[0m[38;2;230;219;116m"[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m([0m[38;2;255;255;255mhash-sym[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mmake-symbol[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mHASH[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mkey[0m[38;2;249;38;114m-[0m[38;2;248;248;242msyms [0m[38;2;255;255;255m([0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m i below [0m[38;2;255;255;255m([0m[38;2;102;217;239mlength[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;255;255;255mkey-syms[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255mi[0m[38;2;248;248;242m [0m[38;2;249;38;114mbelow[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mlength[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;102;217;239mcollect[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mmake-symbol[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mformat[0m[38;2;248;248;242m [0m[38;2;190;132;255mnil[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m~:@(~:R~)-KEY[0m[38;2;230;219;116m"[0m[38;2;248;248;242m i[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;102;217;239mcollect[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mmake-symbol[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mformat[0m[38;2;248;248;242m [0m[38;2;190;132;255mnil[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m~:@([0m[38;2;190;132;255m~[0m[38;2;190;132;255m:R[0m[38;2;230;219;116m~)-KEY[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[38;2;255;255;255mi[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m `[0m[38;2;255;255;255m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;248;248;242m,hash[0m[38;2;249;38;114m-[0m[38;2;248;248;242msym ,hash[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m`[0m[38;2;248;248;242m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m([0m[38;2;255;255;255m,[0m[38;2;255;255;255mhash-sym[0m[38;2;248;248;242m [0m[38;2;255;255;255m,[0m[38;2;255;255;255mhash[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m ,@[0m[38;2;255;255;255m([0m[38;2;249;38;114mloop[0m[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m key in keys [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m sym in key[0m[38;2;249;38;114m-[0m[38;2;248;248;242msyms[0m
|
[38;2;248;248;242m ,[0m[38;2;255;255;255m@[0m[38;2;248;248;242m([0m[38;2;255;255;255mloop[0m[38;2;248;248;242m [0m[38;2;255;255;255mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255min[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m [0m[38;2;255;255;255mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255msym[0m[38;2;248;248;242m [0m[38;2;255;255;255min[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey-syms[0m
|
||||||
[38;2;248;248;242m [0m[38;2;102;217;239mcollect[0m[38;2;248;248;242m `[0m[38;2;255;255;255m([0m[38;2;248;248;242m,sym ,key[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255mcollect[0m[38;2;248;248;242m [0m[38;2;248;248;242m`[0m[38;2;248;248;242m([0m[38;2;255;255;255m,[0m[38;2;255;255;255msym[0m[38;2;248;248;242m [0m[38;2;255;255;255m,[0m[38;2;255;255;255mkey[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m ,[0m[38;2;255;255;255m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mlambda[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mhash key[0m[38;2;255;255;255m)[0m[38;2;248;248;242m `[0m[38;2;255;255;255m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m ,key ,hash[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255m,[0m[38;2;248;248;242m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mlambda[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mhash[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkey[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m`[0m[38;2;248;248;242m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;255;255;255m,[0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255m,[0m[38;2;255;255;255mhash[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m key[0m[38;2;249;38;114m-[0m[38;2;248;248;242msyms :initial[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue hash[0m[38;2;249;38;114m-[0m[38;2;248;248;242msym[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255mkey-syms[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114minitial-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash-sym[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m hashget[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mnew[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue hash key &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31msetf[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mhashget[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnew-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mUses the last key given to hashget to insert NEW-VALUE into the hash table[0m
|
[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mUses the last key given to hashget to insert NEW-VALUE into the hash table[0m
|
||||||
[38;2;230;219;116mreturned by the second-to-last key.[0m
|
[38;2;230;219;116mreturned by the second-to-last key.[0m
|
||||||
[38;2;230;219;116mtl;dr: DWIM SETF function for HASHGET.[0m[38;2;230;219;116m"[0m
|
[38;2;230;219;116mtl;dr: DWIM SETF function for HASHGET.[0m[38;2;230;219;116m"[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mcar[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mlast[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mcar[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mlast[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'hashget[0m[38;2;248;248;242m hash key [0m[38;2;255;255;255m([0m[38;2;102;217;239mbutlast[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242mhashget[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mbutlast[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m key hash[0m[38;2;255;255;255m)[0m[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mgethash[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mhash[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;; Strings[0m
|
[38;2;117;113;94m;;;[0m[38;2;117;113;94m Strings[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mstrcat[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mstring[0m[38;2;248;248;242m &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mstrings[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mstrcat[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mstring[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mmore-strings[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'concatenate[0m[38;2;248;248;242m '[0m[38;2;102;217;239mstring[0m[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mstrings[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;102;217;239mconcatenate[0m[38;2;248;248;242m [0m[38;2;248;248;242m'[0m[38;2;190;132;255mstring[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-strings[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mdequote[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mstring[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46mdequote[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mstring[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;248;248;242mlen [0m[38;2;255;255;255m([0m[38;2;102;217;239mlength[0m[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mlet[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m([0m[38;2;255;255;255mlen[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mlength[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114m>[0m[38;2;248;248;242m len [0m[38;2;190;132;255m1[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mstarts[0m[38;2;249;38;114m-[0m[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m\"[0m[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mends[0m[38;2;249;38;114m-[0m[38;2;249;38;114mwith[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m\"[0m[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;255;255;255mlen[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mstarts-with[0m[38;2;248;248;242m [0m[38;2;190;132;255m#\[0m[38;2;190;132;255m"[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mends-with[0m[38;2;248;248;242m [0m[38;2;190;132;255m#\[0m[38;2;190;132;255m"[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msubseq[0m[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114m-[0m[38;2;248;248;242m len [0m[38;2;190;132;255m1[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msubseq[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114m-[0m[38;2;248;248;242m [0m[38;2;255;255;255mlen[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;102;217;239mstring[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[3;38;2;102;217;239mstring[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;;[0m
|
[38;2;117;113;94m;;;[0m
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;; At[0m
|
[38;2;117;113;94m;;;[0m[38;2;117;113;94m At[0m
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m;;[0m
|
[38;2;117;113;94m;;;[0m
|
||||||
[38;2;255;255;255m([0m[38;2;102;217;239mdefgeneric[0m[38;2;248;248;242m at [0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefgeneric[0m[38;2;248;248;242m [0m[38;2;166;226;46mat[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mdoc[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;255;255;255m([0m[38;2;102;217;239mdefgeneric[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m at[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mnew[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue doc key &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefgeneric[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31msetf[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mat[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnew-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefmethod[0m[38;2;248;248;242m [0m[38;2;166;226;46mat[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc hash[0m[38;2;249;38;114m-[0m[38;2;248;248;242mtable[0m[38;2;255;255;255m)[0m[38;2;248;248;242m &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefmethod[0m[38;2;248;248;242m [0m[38;2;166;226;46mat[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m([0m[3;38;2;253;151;31mdoc[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mhash-table[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'hashget[0m[38;2;248;248;242m doc keys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242mhashget[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefmethod[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m at[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mnew[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue [0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc hash[0m[38;2;249;38;114m-[0m[38;2;248;248;242mtable[0m[38;2;255;255;255m)[0m[38;2;248;248;242m key &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefmethod[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31msetf[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mat[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnew-value[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mdoc[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mhash-table[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'[0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m hashget[0m[38;2;255;255;255m)[0m[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue doc key more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255mhashget[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefmethod[0m[38;2;248;248;242m [0m[38;2;166;226;46mat[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc [0m[38;2;102;217;239mlist[0m[38;2;255;255;255m)[0m[38;2;248;248;242m &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefmethod[0m[38;2;248;248;242m [0m[38;2;166;226;46mat[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242m([0m[3;38;2;253;151;31mdoc[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mlist[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mlambda[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242malist key[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mreduce[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mlambda[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31malist[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkey[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m key alist :test [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'equal[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255malist[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mtest[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;249;38;114mequal[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m keys :initial[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue doc[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114minitial-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefmethod[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m at[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mnew[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue [0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc [0m[38;2;102;217;239mlist[0m[38;2;255;255;255m)[0m[38;2;248;248;242m key &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefmethod[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31msetf[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mat[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnew-value[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mdoc[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mlist[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mcar[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mlast[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mcar[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mlast[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'at[0m[38;2;248;248;242m doc key [0m[38;2;255;255;255m([0m[38;2;102;217;239mbutlast[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242mat[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mbutlast[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m :test [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'equal[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mtest[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;249;38;114mequal[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m key doc :test [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'equal[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mcdr[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239massoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;248;248;242m:[0m[38;2;249;38;114mtest[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;249;38;114mequal[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
|
||||||
[38;2;117;113;94m;[0m[38;2;117;113;94m; A playful alias.[0m
|
[38;2;117;113;94m;;[0m[38;2;117;113;94m A playful alias.[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;248;248;242m@ [0m[38;2;255;255;255m([0m[38;2;248;248;242mdoc &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m keys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;166;226;46m@[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31mdoc[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mkeys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'at[0m[38;2;248;248;242m doc keys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242mat[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkeys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;255;255;255m([0m[3;38;2;102;217;239mdefun[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m @[0m[38;2;255;255;255m)[0m[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;248;248;242mnew[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue doc key &[0m[38;2;102;217;239mrest[0m[38;2;248;248;242m more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m([0m[38;2;249;38;114mdefun[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[3;38;2;253;151;31msetf[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m@[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mnew-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;248;248;242m&[0m[38;2;248;248;242mrest[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m
|
||||||
[38;2;248;248;242m [0m[38;2;255;255;255m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;190;132;255m#[0m[38;2;190;132;255m'[0m[38;2;255;255;255m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m at[0m[38;2;255;255;255m)[0m[38;2;248;248;242m new[0m[38;2;249;38;114m-[0m[38;2;248;248;242mvalue doc key more[0m[38;2;249;38;114m-[0m[38;2;248;248;242mkeys[0m[38;2;255;255;255m)[0m[38;2;255;255;255m)[0m
|
[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;102;217;239mapply[0m[38;2;248;248;242m [0m[38;2;248;248;242m#'[0m[38;2;248;248;242m([0m[38;2;102;217;239msetf[0m[38;2;248;248;242m [0m[38;2;255;255;255mat[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;255;255;255mnew-value[0m[38;2;248;248;242m [0m[38;2;255;255;255mdoc[0m[38;2;248;248;242m [0m[38;2;255;255;255mkey[0m[38;2;248;248;242m [0m[38;2;255;255;255mmore-keys[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m
|
||||||
|
54
tests/syntax-tests/source/CFML/test.cfml
vendored
Normal file
54
tests/syntax-tests/source/CFML/test.cfml
vendored
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<head>
|
||||||
|
<title>Add New Employees</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Add New Employees</h1>
|
||||||
|
<!--- Action page code for the form at the bottom of this page. --->
|
||||||
|
<!--- Establish parameters for first time through --->
|
||||||
|
<cfparam name="Form.firstname" default="">
|
||||||
|
<cfparam name="Form.lastname" default="">
|
||||||
|
<cfparam name="Form.email" default="">
|
||||||
|
<cfparam name="Form.phone" default="">
|
||||||
|
<cfparam name="Form.department" default="">
|
||||||
|
<!--- If at least the firstname form field is passed, create
|
||||||
|
a structure named employee and add values. --->
|
||||||
|
<cfif #Form.firstname# eq "">
|
||||||
|
<p>Please fill out the form.</p>
|
||||||
|
<cfelse>
|
||||||
|
<cfoutput>
|
||||||
|
<cfscript>
|
||||||
|
employee=StructNew();
|
||||||
|
employee.firstname = Form.firstname;
|
||||||
|
employee.lastname = Form.lastname;
|
||||||
|
employee.email = Form.email;
|
||||||
|
employee.phone = Form.phone;
|
||||||
|
employee.department = Form.department;
|
||||||
|
</cfscript>
|
||||||
|
<!--- Display results of creating the structure. --->
|
||||||
|
First name is #StructFind(employee, "firstname")#<br>
|
||||||
|
Last name is #StructFind(employee, "lastname")#<br>
|
||||||
|
EMail is #StructFind(employee, "email")#<br>
|
||||||
|
Phone is #StructFind(employee, "phone")#<br>
|
||||||
|
Department is #StructFind(employee, "department")#<br>
|
||||||
|
</cfoutput>
|
||||||
|
<!--- Call the custom tag that adds employees. --->
|
||||||
|
<cf_addemployee empinfo="#employee#">
|
||||||
|
</cfif>
|
||||||
|
<!--- The form for adding the new employee information --->
|
||||||
|
<hr>
|
||||||
|
<form action="newemployee.cfm" method="Post">
|
||||||
|
First Name:
|
||||||
|
<input name="firstname" type="text" hspace="30" maxlength="30"><br>
|
||||||
|
Last Name:
|
||||||
|
<input name="lastname" type="text" hspace="30" maxlength="30"><br>
|
||||||
|
EMail:
|
||||||
|
<input name="email" type="text" hspace="30" maxlength="30"><br>
|
||||||
|
Phone:
|
||||||
|
<input name="phone" type="text" hspace="20" maxlength="20"><br>
|
||||||
|
Department:
|
||||||
|
<input name="department" type="text" hspace="30" maxlength="30"><br>
|
||||||
|
<input type="Submit" value="OK">
|
||||||
|
</form>
|
||||||
|
<br>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in New Issue
Block a user