mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-01 19:02:22 +01:00
Merge remote-tracking branch 'origin/master' into feature/668/add-systemwide-config
This commit is contained in:
3
tests/examples/longline.json
vendored
Normal file
3
tests/examples/longline.json
vendored
Normal file
File diff suppressed because one or more lines are too long
1
tests/examples/test.demo.foo.suffix
vendored
Normal file
1
tests/examples/test.demo.foo.suffix
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"test": "value"}
|
1
tests/examples/test.demo.suffix
vendored
Normal file
1
tests/examples/test.demo.suffix
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"test": "value"}
|
File diff suppressed because one or more lines are too long
@@ -18,7 +18,7 @@ gpl_occurances=$(git grep --recurse-submodules "${gpl_term}" -- "${gpl_excludes[
|
||||
if [ -z "${gpl_occurances}" ]; then
|
||||
echo "PASS: No files under GPL were found"
|
||||
else
|
||||
echo "FAIL: GPL:ed code is not compatible with bat, but occurances of '${gpl_term}' were found:"
|
||||
echo "FAIL: GPL:ed code is not compatible with bat, but occurrences of '${gpl_term}' were found:"
|
||||
echo "${gpl_occurances}"
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -1,13 +1,13 @@
|
||||
#[cfg(feature = "git")]
|
||||
mod tester;
|
||||
|
||||
use crate::tester::BatTester;
|
||||
|
||||
macro_rules! snapshot_tests {
|
||||
($($test_name: ident: $style: expr,)*) => {
|
||||
$(
|
||||
#[test]
|
||||
#[cfg(feature = "git")]
|
||||
fn $test_name() {
|
||||
let bat_tester = BatTester::default();
|
||||
let bat_tester = tester::BatTester::default();
|
||||
bat_tester.test_snapshot(stringify!($test_name), $style);
|
||||
}
|
||||
)*
|
||||
|
5
tests/syntax-tests/highlighted/Fstab/fstab
vendored
5
tests/syntax-tests/highlighted/Fstab/fstab
vendored
@@ -3,5 +3,6 @@
|
||||
|
||||
[38;2;117;113;94m# <file system> <dir> <type> <options> <dump> <pass>[0m
|
||||
|
||||
[38;2;248;248;242mUUID=[0m[38;2;249;38;114m9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b[0m[38;2;248;248;242m [0m[38;2;230;219;116m/ [0m[3;38;2;253;151;31mext4 [0m[38;2;166;226;46mrw[0m[38;2;248;248;242m,[0m[38;2;166;226;46mrelatime[0m[38;2;248;248;242m,[0m[38;2;166;226;46mdata[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mordered[0m[38;2;248;248;242m [0m[38;2;190;132;255m0 [0m[38;2;190;132;255m1[0m
|
||||
[38;2;248;248;242mUUID=[0m[38;2;249;38;114m62F8-2047[0m[38;2;248;248;242m [0m[38;2;230;219;116m/boot [0m[3;38;2;253;151;31mvfat [0m[38;2;166;226;46mrw[0m[38;2;248;248;242m,[0m[38;2;166;226;46mrelatime[0m[38;2;248;248;242m,[0m[38;2;166;226;46mfmask[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m0022[0m[38;2;248;248;242m,[0m[38;2;166;226;46mdmask[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m0022[0m[38;2;248;248;242m,[0m[38;2;166;226;46mcodepage[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m437[0m[38;2;248;248;242m,[0m[38;2;166;226;46miocharset[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31miso8859-1[0m[38;2;248;248;242m,[0m[38;2;166;226;46mshortname[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mmixed[0m[38;2;248;248;242m,[0m[38;2;166;226;46merrors[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mremount-ro[0m[38;2;248;248;242m [0m[38;2;190;132;255m0 [0m[38;2;248;248;240m2[0m
|
||||
[38;2;248;248;242mUUID=[0m[38;2;249;38;114m9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b[0m[38;2;248;248;242m [0m[38;2;230;219;116m/ [0m[3;38;2;253;151;31mext4 [0m[38;2;166;226;46mrw[0m[38;2;248;248;242m,[0m[38;2;166;226;46mrelatime[0m[38;2;248;248;242m,[0m[38;2;166;226;46mdata[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mordered[0m[38;2;248;248;242m [0m[38;2;190;132;255m0 [0m[38;2;190;132;255m0[0m
|
||||
[38;2;248;248;242mUUID=[0m[38;2;249;38;114m9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b[0m[38;2;248;248;242m [0m[38;2;230;219;116m/ [0m[3;38;2;253;151;31mext4 [0m[38;2;166;226;46mrw[0m[38;2;248;248;242m,[0m[38;2;166;226;46mrelatime[0m[38;2;248;248;242m,[0m[38;2;166;226;46mdata[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mordered[0m[38;2;248;248;242m [0m[38;2;190;132;255m1 [0m[38;2;190;132;255m1[0m
|
||||
[38;2;248;248;242mUUID=[0m[38;2;249;38;114m62F8-2047[0m[38;2;248;248;242m [0m[38;2;230;219;116m/boot [0m[3;38;2;253;151;31mvfat [0m[38;2;166;226;46mrw[0m[38;2;248;248;242m,[0m[38;2;166;226;46mrelatime[0m[38;2;248;248;242m,[0m[38;2;166;226;46mfmask[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m0022[0m[38;2;248;248;242m,[0m[38;2;166;226;46mdmask[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m0022[0m[38;2;248;248;242m,[0m[38;2;166;226;46mcodepage[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31m437[0m[38;2;248;248;242m,[0m[38;2;166;226;46miocharset[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31miso8859-1[0m[38;2;248;248;242m,[0m[38;2;166;226;46mshortname[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mmixed[0m[38;2;248;248;242m,[0m[38;2;166;226;46merrors[0m[38;2;166;226;46m=[0m[3;38;2;253;151;31mremount-ro[0m[38;2;248;248;242m [0m[38;2;190;132;255m2 [0m[38;2;190;132;255m2[0m
|
||||
|
5
tests/syntax-tests/highlighted/INI/test.inf
vendored
Normal file
5
tests/syntax-tests/highlighted/INI/test.inf
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
[38;2;248;248;242m[[0m[38;2;166;226;46msection[0m[38;2;248;248;242m][0m
|
||||
[38;2;249;38;114mkey[0m[38;2;248;248;242m=[0m[38;2;230;219;116mvalue[0m
|
||||
[38;2;117;113;94m#[0m[38;2;117;113;94m This file is just for testing that the INI syntax is registered to handle[0m
|
||||
[38;2;117;113;94m#[0m[38;2;117;113;94m the .inf file extension, it is not testing the syntax highlighting capabilities[0m
|
||||
[38;2;117;113;94m#[0m[38;2;117;113;94m of the INI syntax itself[0m
|
@@ -1,2 +1,3 @@
|
||||
[38;2;190;132;255m2021-03-06[0m[38;2;248;248;242m [0m[38;2;190;132;255m23:22:21[0m[38;2;190;132;255m.[0m[38;2;190;132;255m392[0m[38;2;248;248;242m [0m[4;38;2;166;226;46mhttps://[0m[4;38;2;166;226;46m[[0m[4;38;2;190;132;255m2001[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255mdb8[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m4006[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m812[0m[4;38;2;166;226;46m:[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m200e[0m[4;38;2;166;226;46m][0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m8080[0m[4;38;2;166;226;46m/path/the[0m[4;38;2;190;132;255m%[0m[4;38;2;190;132;255m20[0m[4;38;2;166;226;46mpage[0m[4;38;2;166;226;46m.[0m[4;38;2;166;226;46mhtml[0m
|
||||
[38;2;190;132;255m2021-03-06[0m[38;2;248;248;242m [0m[38;2;190;132;255m23:22:21[0m[38;2;248;248;242m [0m[4;38;2;166;226;46mhttps://[0m[4;38;2;166;226;46mexample.com[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m8080[0m[4;38;2;166;226;46m/path/the[0m[4;38;2;190;132;255m%[0m[4;38;2;190;132;255m20[0m[4;38;2;166;226;46mpage[0m[4;38;2;166;226;46m(with_parens)[0m[4;38;2;166;226;46m.[0m[4;38;2;166;226;46mhtml[0m
|
||||
[38;2;190;132;255m2022-03-16[0m[38;2;249;38;114mT[0m[38;2;190;132;255m17:41:02[0m[38;2;190;132;255m.[0m[38;2;190;132;255m519[0m[38;2;248;248;242m helix_term::application [[0m[38;2;248;248;240mWARN[0m[38;2;248;248;242m] unhandled window/showMessage: ShowMessageParams { typ: [0m[38;2;248;248;240mError[0m[38;2;248;248;242m, message: [0m[38;2;230;219;116m"rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `[0m[38;2;190;132;255m\"[0m[38;2;230;219;116mcargo[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116mmetadata[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--format-version[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m1[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--manifest-path[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m/home/zeta/dev/raytracer/Cargo.toml[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--filter-platform[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116mwasm32-unknown-unknown[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m`: `cargo metadata` exited with an error: Updating crates.io index[0m[38;2;190;132;255m\n[0m[38;2;230;219;116merror: failed to select a version for `parking_lot`.[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mversions that meet the requirements `^0.12.0` are: 0.12.0[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mfailed to select a version for `parking_lot` which could resolve this conflict[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m }[0m
|
||||
|
34
tests/syntax-tests/highlighted/NSE/test.nse
vendored
Normal file
34
tests/syntax-tests/highlighted/NSE/test.nse
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m- Finds factorial of a number.[0m
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m @param value Number to find factorial.[0m
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m @return Factorial of number.[0m
|
||||
[38;2;249;38;114mlocal[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mfactorial[0m[38;2;248;248;242m([0m[3;38;2;253;151;31mvalue[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;255mvalue[0m[38;2;248;248;242m [0m[38;2;249;38;114m<=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;190;132;255m1[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m [0m[38;2;255;255;255mvalue[0m[38;2;248;248;242m [0m[38;2;249;38;114m*[0m[38;2;248;248;242m [0m[38;2;248;248;242mfactorial[0m[38;2;248;248;242m([0m[38;2;255;255;255mvalue[0m[38;2;248;248;242m [0m[38;2;249;38;114m-[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;114mend[0m
|
||||
[38;2;249;38;114mend[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m- Joins a table of strings into a new string.[0m
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m @param table Table of strings.[0m
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m @param separator Separator character.[0m
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m @return Joined string.[0m
|
||||
[38;2;249;38;114mlocal[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mjoin[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[3;38;2;253;151;31mseparator[0m[38;2;248;248;242m)[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mlocal[0m[38;2;248;248;242m [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m"[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;255;255;255mindex[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;255;255;255mvalue[0m[38;2;248;248;242m [0m[38;2;249;38;114min[0m[38;2;248;248;242m [0m[38;2;102;217;239mipairs[0m[38;2;248;248;242m([0m[38;2;102;217;239mtable[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mdo[0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m [0m[38;2;249;38;114m..[0m[38;2;248;248;242m [0m[38;2;255;255;255mvalue[0m[38;2;248;248;242m [0m[38;2;249;38;114m..[0m[38;2;248;248;242m [0m[38;2;255;255;255mseparator[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m
|
||||
[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;255;255;255mdata[0m[38;2;248;248;242m:[0m[38;2;248;248;242msub[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;255;255;255mdata[0m[38;2;248;248;242m:[0m[38;2;248;248;242mlen[0m[38;2;248;248;242m([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;190;132;255m1[0m[38;2;248;248;242m)[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;255mdata[0m
|
||||
[38;2;249;38;114mend[0m
|
||||
|
||||
[38;2;249;38;114mlocal[0m[38;2;248;248;242m [0m[38;2;255;255;255ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mfactorial[0m[38;2;248;248;242m([0m[38;2;190;132;255m5[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239mprint[0m[38;2;248;248;242m([0m[38;2;255;255;255ma[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;249;38;114mlocal[0m[38;2;248;248;242m [0m[38;2;255;255;255mb[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mjoin[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;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116mu[0m[38;2;230;219;116m"[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116ma[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;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m,[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m
|
||||
|
||||
[38;2;102;217;239mprint[0m[38;2;248;248;242m([0m[38;2;255;255;255mb[0m[38;2;248;248;242m)[0m
|
@@ -27,9 +27,13 @@
|
||||
[38;2;255;255;255m</[0m[3;38;2;249;38;114mscript[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[3;38;2;249;38;114mscript[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/livescript[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;246;170;17m// This block is a regression test for a bat panic when a LiveScript syntax definition is missing[0m
|
||||
[38;2;248;248;242m [0m[38;2;246;170;17m// This block is a regression test for a bat panic when a LiveScript syntax definition is missing[0m
|
||||
[38;2;255;255;255m</[0m[3;38;2;249;38;114mscript[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mstyle[0m[38;2;248;248;242m [0m[38;2;166;226;46mlang[0m[38;2;166;226;46m=[0m[38;2;255;255;255m"[0m[38;2;230;219;116mtext/postcss[0m[38;2;255;255;255m"[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m This block is a regression test for a bat panic when a PostCSS syntax definition is missing [0m[38;2;117;113;94m*/[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mstyle[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mstyle[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mmain[0m[38;2;248;248;242m [0m[38;2;255;255;255m{[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;102;217;239mposition[0m[38;2;255;255;255m:[0m[38;2;248;248;242m [0m[38;2;102;217;239mrelative[0m[38;2;255;255;255m;[0m
|
||||
|
@@ -1,7 +1,7 @@
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:01[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239msystemd[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 logrotate.service: Succeeded.[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:01[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239msystemd[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 Finished Rotate log files.[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:01[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mcolord[0m[38;2;248;248;242m[[0m[38;2;190;132;255m920[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;240mfailed[0m[38;2;248;248;242m to get session [pid [0m[38;2;190;132;255m137485[0m[38;2;248;248;242m]: No data available[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:21[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mkernel[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[3;38;2;253;151;31m55604[0m[38;2;248;248;242m.[0m[3;38;2;253;151;31m908232[0m[38;2;248;248;242m][0m[38;2;248;248;242m audit: [0m[3;38;2;253;151;31mtype[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1400[0m[38;2;248;248;242m audit([0m[38;2;190;132;255m1617483621[0m[38;2;190;132;255m.[0m[38;2;190;132;255m094[0m[38;2;248;248;242m:[0m[38;2;190;132;255m28[0m[38;2;248;248;242m): [0m[3;38;2;253;151;31mapparmor[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mDENIED[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31moperation[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mcapable[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mprofile[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116m/usr/sbin/cups-browsed[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mpid[0m[38;2;249;38;114m=[0m[38;2;190;132;255m59311[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcomm[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116mcups-browsed[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcapability[0m[38;2;249;38;114m=[0m[38;2;190;132;255m23[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcapname[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"[0m[38;2;230;219;116msys_nice[0m[38;2;230;219;116m"[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:21[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mkernel[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;242m[[0m[3;38;2;253;151;31m55604[0m[38;2;248;248;242m.[0m[3;38;2;253;151;31m908232[0m[38;2;248;248;242m][0m[38;2;248;248;242m audit: [0m[3;38;2;253;151;31mtype[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1400[0m[38;2;248;248;242m audit([0m[38;2;190;132;255m1617483621[0m[38;2;190;132;255m.[0m[38;2;190;132;255m094[0m[38;2;248;248;242m:[0m[38;2;190;132;255m28[0m[38;2;248;248;242m): [0m[3;38;2;253;151;31mapparmor[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"DENIED[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31moperation[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"capable[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mprofile[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"/usr/sbin/cups-browsed[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mpid[0m[38;2;249;38;114m=[0m[38;2;190;132;255m59311[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcomm[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"cups-browsed[0m[38;2;230;219;116m"[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcapability[0m[38;2;249;38;114m=[0m[38;2;190;132;255m23[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mcapname[0m[38;2;249;38;114m=[0m[38;2;230;219;116m"sys_nice[0m[38;2;230;219;116m"[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:01:38[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239msystemd-resolved[0m[38;2;248;248;242m[[0m[38;2;190;132;255m721[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m Server returned [0m[38;2;248;248;240merror[0m[38;2;248;248;242m NXDOMAIN, mitigating potential DNS violation DVE-[0m[38;2;190;132;255m2018[0m[38;2;248;248;242m-[0m[38;2;190;132;255m0001[0m[38;2;248;248;242m, retrying transaction with reduced feature level UDP.[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:04:46[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mntpd[0m[38;2;248;248;242m[[0m[38;2;190;132;255m952[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m Soliciting pool server [0m[38;2;190;132;255m255[0m[38;2;248;248;242m.[0m[38;2;190;132;255m76[0m[38;2;248;248;242m.[0m[38;2;190;132;255m59[0m[38;2;248;248;242m.[0m[38;2;190;132;255m37[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:05:21[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mntpd[0m[38;2;248;248;242m[[0m[38;2;190;132;255m952[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;190;132;255m1[0m[38;2;248;248;242m local addr [0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m:[0m[38;2;190;132;255m1[0m[38;2;248;248;242m -> [0m[38;2;190;132;255m<null>[0m
|
||||
@@ -10,7 +10,7 @@
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m16:32:07[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mNetworkManager[0m[38;2;248;248;242m[[0m[38;2;190;132;255m740[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m<info>[0m[38;2;248;248;242m [[0m[38;2;190;132;255m1617629527[0m[38;2;190;132;255m.[0m[38;2;190;132;255m1101[0m[38;2;248;248;242m] manager: NetworkManager state is now CONNECTED_GLOBAL[0m
|
||||
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m22:00:45[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mdbus-daemon[0m[38;2;248;248;242m[[0m[38;2;190;132;255m1094[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[3;38;2;253;151;31msession[0m[38;2;248;248;242m [0m[3;38;2;253;151;31muid[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1000[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mpid[0m[38;2;249;38;114m=[0m[38;2;190;132;255m1094[0m[38;2;248;248;242m][0m[38;2;248;248;242m Successfully activated service [0m[38;2;230;219;116m'[0m[38;2;230;219;116mio.github.celluloid_player.Celluloid[0m[38;2;230;219;116m'[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m13:29:06[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239minsomnia_insomnia.desktop[0m[38;2;248;248;242m[[0m[38;2;190;132;255m142666[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m13:29:06[0m[38;2;190;132;255m.[0m[38;2;190;132;255m316[0m[38;2;248;248;242m › [updater] Updater not running [0m[3;38;2;253;151;31mplatform[0m[38;2;249;38;114m=[0m[38;2;248;248;242mlinux [0m[3;38;2;253;151;31mdev[0m[38;2;249;38;114m=[0m[38;2;248;248;242mfalse[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m13:36:34[0m[38;2;248;248;242m [0m[38;2;166;226;46m192.168.220.5[0m[38;2;248;248;242m [0m[38;2;102;217;239mnginx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m2021/08/11[0m[38;2;248;248;242m [0m[38;2;190;132;255m13:36:34[0m[38;2;248;248;242m [debug] [0m[38;2;190;132;255m2031[0m[38;2;248;248;242m#[0m[38;2;190;132;255m2031[0m[38;2;248;248;242m: epoll add event: fd:[0m[38;2;190;132;255m6[0m[38;2;248;248;242m op:[0m[38;2;190;132;255m1[0m[38;2;248;248;242m ev:[0m[38;2;190;132;255m00002001[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m21:31:08[0m[38;2;248;248;242m [0m[38;2;166;226;46m::1[0m[38;2;248;248;242m [0m[38;2;102;217;239mnginx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m2021/08/11[0m[38;2;248;248;242m [0m[38;2;190;132;255m21:31:08[0m[38;2;248;248;242m [debug] [0m[38;2;190;132;255m760831[0m[38;2;248;248;242m#[0m[38;2;190;132;255m760831[0m[38;2;248;248;242m: epoll add event: fd:[0m[38;2;190;132;255m6[0m[38;2;248;248;242m op:[0m[38;2;190;132;255m1[0m[38;2;248;248;242m ev:[0m[38;2;190;132;255m10000001[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m13:36:34[0m[38;2;248;248;242m [0m[38;2;166;226;46m192.168.220.5[0m[38;2;248;248;242m [0m[38;2;102;217;239mnginx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m2021/08/11[0m[38;2;248;248;242m [0m[38;2;190;132;255m13:36:34[0m[38;2;248;248;242m [[0m[38;2;248;248;242mdebug[0m[38;2;248;248;242m] [0m[38;2;190;132;255m2031[0m[38;2;248;248;242m#[0m[38;2;190;132;255m2031[0m[38;2;248;248;242m: epoll add event: fd:[0m[38;2;190;132;255m6[0m[38;2;248;248;242m op:[0m[38;2;190;132;255m1[0m[38;2;248;248;242m ev:[0m[38;2;190;132;255m00002001[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m21:31:08[0m[38;2;248;248;242m [0m[38;2;166;226;46m::1[0m[38;2;248;248;242m [0m[38;2;102;217;239mnginx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m2021/08/11[0m[38;2;248;248;242m [0m[38;2;190;132;255m21:31:08[0m[38;2;248;248;242m [[0m[38;2;248;248;242mdebug[0m[38;2;248;248;242m] [0m[38;2;190;132;255m760831[0m[38;2;248;248;242m#[0m[38;2;190;132;255m760831[0m[38;2;248;248;242m: epoll add event: fd:[0m[38;2;190;132;255m6[0m[38;2;248;248;242m op:[0m[38;2;190;132;255m1[0m[38;2;248;248;242m ev:[0m[38;2;190;132;255m10000001[0m
|
||||
[38;2;190;132;255mAug 11[0m[38;2;190;132;255m [0m[38;2;190;132;255m21:40:31[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mscop[0m[38;2;248;248;242m [0m[38;2;248;248;242mhello[0m
|
||||
[38;2;190;132;255mAug 16[0m[38;2;190;132;255m [0m[38;2;190;132;255m21:38:21[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239msystemd[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 Finished Cleanup of Temporary Directories.[0m
|
||||
|
@@ -8,6 +8,11 @@
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255m</[0m[38;2;249;38;114mdiv[0m[38;2;255;255;255m>[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mtemplate[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[38;2;249;38;114mtemplate [0m[38;2;166;226;46mlang[0m[38;2;166;226;46m=[0m[38;2;255;255;255m'[0m[38;2;230;219;116mpug[0m[38;2;255;255;255m'[0m[38;2;255;255;255m>[0m
|
||||
[38;2;248;248;242m #container.col[0m
|
||||
[38;2;248;248;242m p This shall be formatted as Plain Text as long as a Pug syntax definition is missing[0m
|
||||
[38;2;255;255;255m</[0m[38;2;249;38;114mtemplate[0m[38;2;255;255;255m>[0m
|
||||
|
||||
[38;2;255;255;255m<[0m[3;38;2;249;38;114mscript[0m[38;2;255;255;255m>[0m
|
||||
[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;255;255;255mAppHeader[0m[38;2;248;248;242m [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m@/components/AppHeader[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;255;255;255mAppLoadingIndicator[0m[38;2;248;248;242m [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m@/components/AppLoadingIndicator[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m
|
||||
|
78
tests/syntax-tests/highlighted/Zig/example.zig
vendored
78
tests/syntax-tests/highlighted/Zig/example.zig
vendored
@@ -1,18 +1,18 @@
|
||||
[38;2;117;113;94m//! this is a top level doc, starts with "//!"[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m std [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m@import[0m[38;2;248;248;242m([0m[38;2;230;219;116m"std"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m@import[0m[38;2;248;248;242m([0m[38;2;230;219;116m"std"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mpub[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46mmain[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239manyerror[0m[38;2;249;38;114m![0m[3;38;2;102;217;239mvoid[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m stdout [0m[38;2;249;38;114m=[0m[38;2;248;248;242m std.io.[0m[38;2;248;248;242mgetStdOut[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m.[0m[38;2;248;248;242mwriter[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;249;38;114mtry[0m[38;2;248;248;242m stdout.[0m[38;2;248;248;242mprint[0m[38;2;248;248;242m([0m[38;2;230;219;116m"Hello, {}![0m[38;2;190;132;255m\n[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;230;219;116m"world"[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;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mstdout[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;248;248;242mio[0m[38;2;248;248;242m.[0m[38;2;248;248;242mgetStdOut[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m.[0m[38;2;248;248;242mwriter[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;249;38;114mtry[0m[38;2;248;248;242m [0m[38;2;248;248;242mstdout[0m[38;2;248;248;242m.[0m[38;2;248;248;242mprint[0m[38;2;248;248;242m([0m[38;2;230;219;116m"Hello, {}![0m[38;2;190;132;255m\n[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;230;219;116m"world"[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;249;38;114mconst[0m[38;2;248;248;242m expect [0m[38;2;249;38;114m=[0m[38;2;248;248;242m std.testing.expect[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;248;248;242mtesting[0m[38;2;248;248;242m.[0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mtest[0m[38;2;248;248;242m [0m[38;2;230;219;116m"comments"[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// comments start with "//" until newline[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// foo bar baz[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m x [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m// another comment[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mx[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mtrue[0m[38;2;248;248;242m;[0m[38;2;248;248;242m [0m[38;2;117;113;94m// another comment[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242mx[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
@@ -25,26 +25,26 @@
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m/// number of nanoseconds past the second[0m
|
||||
[38;2;248;248;242m [0m[38;2;255;255;255mnano[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mu32[0m[38;2;248;248;242m,[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m Self [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;102;217;239m@This[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;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mSelf[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;102;217;239m@This[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;249;38;114mpub[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46munixEpoch[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mSelf[0m[38;2;248;248;242m [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[3;38;2;102;217;239mSelf[0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m .seconds [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .nanos [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .[0m[38;2;248;248;242mseconds[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m .[0m[38;2;248;248;242mnanos[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0[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;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m my_val [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mstd.Target.current.os.tag[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;190;132;255m.linux[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mmy_val[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114mswitch[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242mstd[0m[38;2;248;248;242m.[0m[38;2;166;226;46mTarget[0m[38;2;248;248;242m.[0m[38;2;248;248;242mcurrent[0m[38;2;248;248;242m.[0m[38;2;248;248;242mos[0m[38;2;248;248;242m.[0m[38;2;248;248;242mtag[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;190;132;255m .linux[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;230;219;116m"not Linux"[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mBook[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239menum[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m paperback[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m hardcover[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m ebook[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m pdf[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mpaperback[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mhardcover[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mebook[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mpdf[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;166;226;46mTokenType[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[3;38;2;102;217;239munion[0m[38;2;248;248;242m([0m[3;38;2;102;217;239menum[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
@@ -54,54 +54,54 @@
|
||||
[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;255;255;255marray_lit[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [[0m[38;2;190;132;255m4[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m .[0m[38;2;248;248;242m{[0m[38;2;248;248;242m [0m[38;2;190;132;255m11[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m22[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m33[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m44[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m sentinal_lit [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [[0m[38;2;190;132;255m_[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m{[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;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242msentinal_lit[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [[0m[38;2;190;132;255m_[0m[38;2;248;248;242m:[0m[38;2;190;132;255m0[0m[38;2;248;248;242m][0m[3;38;2;102;217;239mu8[0m[38;2;248;248;242m{[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;190;132;255m2[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m3[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[38;2;190;132;255m4[0m[38;2;248;248;242m [0m[38;2;248;248;242m}[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mtest[0m[38;2;248;248;242m [0m[38;2;230;219;116m"address of syntax"[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// Get the address of a variable:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;255;255;255mx[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1234[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m x_ptr [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mx[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mx_ptr[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242mx[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// Dereference a pointer:[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;190;132;255m1234[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// When you get the address of a const variable, you get a const pointer to a single item.[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[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;249;38;114m*[0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242mx_ptr[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;249;38;114m*[0m[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;117;113;94m// If you want to mutate the value, you'd need an address of a mutable variable:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mvar[0m[38;2;248;248;242m [0m[38;2;255;255;255my[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m5678[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mconst[0m[38;2;248;248;242m y_ptr [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242my[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[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;249;38;114m*[0m[3;38;2;102;217;239mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m y_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m+=[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;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242my_ptr[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;249;38;114m&[0m[38;2;248;248;242my[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242mexpect[0m[38;2;248;248;242m([0m[38;2;102;217;239m@TypeOf[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[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;249;38;114m*[0m[38;2;248;248;242mi32[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m [0m[38;2;248;248;242my_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m+=[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;242mexpect[0m[38;2;248;248;242m([0m[38;2;248;248;242my_ptr[0m[38;2;249;38;114m.*[0m[38;2;248;248;242m [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;190;132;255m5679[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
||||
[38;2;117;113;94m// integer literals[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m decimal_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m98222[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m hex_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xff[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_hex_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m octal_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o755[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m binary_int [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b11110000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mdecimal_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m98222[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mhex_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xff[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_hex_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242moctal_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o755[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbinary_int[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b11110000[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// underscores may be placed between two digits as a visual separator[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m one_billion [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1_000_000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m binary_mask [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b1_1111_1111[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m permissions [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o7_5_5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m big_address [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF80_0000_0000_0000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mone_billion[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m1_000_000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbinary_mask[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0b1_1111_1111[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mpermissions[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0o7_5_5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mbig_address[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0xFF80_0000_0000_0000[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// float literals[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m floating_point [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0E+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m yet_another [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0e+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mfloating_point[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0E+77[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242myet_another[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m123.0e+77[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m hex_floating_point [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70p-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m another_hex_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m yet_another_hex_float [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70P-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mhex_floating_point[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70p-5[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242manother_hex_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242myet_another_hex_float[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x103.70P-5[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m// underscores may be placed between two digits as a visual separator[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m lightspeed [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m299_792_458.000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m nanosecond [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0.000_000_001[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m more_hex [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x1234_5678.9ABC_CDEFp-10[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mlightspeed[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m299_792_458.000_000[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mnanosecond[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0.000_000_001[0m[38;2;248;248;242m;[0m
|
||||
[38;2;249;38;114mconst[0m[38;2;248;248;242m [0m[38;2;248;248;242mmore_hex[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255m0x1234_5678.9ABC_CDEFp-10[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[3;38;2;102;217;239mfn[0m[38;2;248;248;242m [0m[38;2;166;226;46mmax[0m[38;2;248;248;242m([0m[3;38;2;102;217;239mcomptime[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mT[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mtype[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;253;151;31ma[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mb[0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mT[0m[38;2;248;248;242m [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;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242ma [0m[38;2;249;38;114m>[0m[38;2;248;248;242m b[0m[38;2;248;248;242m)[0m[38;2;248;248;242m a [0m[38;2;249;38;114melse[0m[38;2;248;248;242m b[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;249;38;114mif[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;249;38;114m>[0m[38;2;248;248;242m [0m[38;2;248;248;242mb[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242ma[0m[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;248;248;242mb[0m[38;2;248;248;242m;[0m
|
||||
[38;2;248;248;242m}[0m
|
||||
|
54
tests/syntax-tests/highlighted/cmd-help/test.cmd-help
vendored
Normal file
54
tests/syntax-tests/highlighted/cmd-help/test.cmd-help
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
[38;2;248;248;242mbat 0.20.0 (e735562-modified)[0m
|
||||
[38;2;248;248;242mA cat(1) clone with syntax highlighting and Git integration.[0m
|
||||
|
||||
[38;2;253;151;31mUSAGE:[0m
|
||||
[38;2;248;248;242m bat [OPTIONS] [FILE]...[0m
|
||||
[38;2;248;248;242m bat <SUBCOMMAND>[0m
|
||||
|
||||
[38;2;253;151;31mOPTIONS:[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-A[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--show-all[0m
|
||||
[38;2;248;248;242m Show non-printable characters (space, tab, newline, ..).[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-p[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--plain[0m[38;2;248;248;242m Show plain style (alias for '--style=plain').[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-l[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--language[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<language>[0m[38;2;248;248;242m Set the language for syntax highlighting.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-H[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--highlight-line[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<N:M>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Highlight lines N through M.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--file-name[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<name>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Specify the name to display for a file.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-d[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--diff[0m
|
||||
[38;2;248;248;242m Only show lines that have been added/removed/modified.[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--tabs[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<T>[0m[38;2;248;248;242m Set the tab width to T spaces.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--wrap[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<mode>[0m
|
||||
[38;2;248;248;242m Specify the text-wrapping mode (*auto*, never, character).[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-n[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--number[0m
|
||||
[38;2;248;248;242m Show line numbers (alias for '--style=numbers').[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m[38;2;248;248;242m When to use colors (*auto*, never, always).[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--italic-text[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m[38;2;248;248;242m Use italics in output (always, *never*)[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--decorations[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m
|
||||
[38;2;248;248;242m When to show the decorations (*auto*, never, always).[0m
|
||||
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--paging[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m
|
||||
[38;2;248;248;242m Specify when to use the pager, or use `-P` to disable (*auto*, never,[0m
|
||||
[38;2;248;248;242m always).[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-m[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--map-syntax[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<glob:syntax>[0m[3;38;2;253;151;31m...[0m
|
||||
[38;2;248;248;242m Use the specified syntax for files matching the glob pattern[0m
|
||||
[38;2;248;248;242m ('*.cpp:C++').[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--theme[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<theme>[0m[38;2;248;248;242m Set the color theme for syntax highlighting.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--list-themes[0m[38;2;248;248;242m Display all supported highlighting themes.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m--style[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<components>[0m
|
||||
[38;2;248;248;242m Comma-separated list of style elements to display (*auto*, full, plain,[0m
|
||||
[38;2;248;248;242m changes, header, grid, rule, numbers, snip).[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-r[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--line-range[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<N:M>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Only print the lines from N to M.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-L[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--list-languages[0m[38;2;248;248;242m Display all supported languages.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-h[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--help[0m[38;2;248;248;242m Print this help message.[0m
|
||||
[38;2;248;248;242m [0m[38;2;166;226;46m-V[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--version[0m[38;2;248;248;242m Show version information.[0m
|
||||
|
||||
[38;2;253;151;31mARGS:[0m
|
||||
[38;2;248;248;242m [0m[3;38;2;253;151;31m<FILE>...[0m[38;2;248;248;242m File(s) to print / concatenate. Use '-' for standard input.[0m
|
||||
|
||||
[38;2;253;151;31mSUBCOMMANDS:[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mcache[0m[38;2;248;248;242m Modify the syntax-definition and theme cache[0m
|
||||
|
||||
[38;2;248;248;242mNote: `bat -h` prints a short and concise overview while `bat --help` gives all[0m
|
||||
[38;2;248;248;242mdetails.[0m
|
5
tests/syntax-tests/source/Fstab/fstab
vendored
5
tests/syntax-tests/source/Fstab/fstab
vendored
@@ -3,5 +3,6 @@
|
||||
|
||||
# <file system> <dir> <type> <options> <dump> <pass>
|
||||
|
||||
UUID=9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b / ext4 rw,relatime,data=ordered 0 1
|
||||
UUID=62F8-2047 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 0 2
|
||||
UUID=9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b / ext4 rw,relatime,data=ordered 0 0
|
||||
UUID=9e6faddf-31ab-3f3e-9b50-2ad4fbc2ea8b / ext4 rw,relatime,data=ordered 1 1
|
||||
UUID=62F8-2047 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro 2 2
|
||||
|
5
tests/syntax-tests/source/INI/test.inf
vendored
Normal file
5
tests/syntax-tests/source/INI/test.inf
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
[section]
|
||||
key=value
|
||||
# This file is just for testing that the INI syntax is registered to handle
|
||||
# the .inf file extension, it is not testing the syntax highlighting capabilities
|
||||
# of the INI syntax itself
|
1
tests/syntax-tests/source/Log/example.log
vendored
1
tests/syntax-tests/source/Log/example.log
vendored
@@ -1,2 +1,3 @@
|
||||
2021-03-06 23:22:21.392 https://[2001:db8:4006:812::200e]:8080/path/the%20page.html
|
||||
2021-03-06 23:22:21 https://example.com:8080/path/the%20page(with_parens).html
|
||||
2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }
|
||||
|
34
tests/syntax-tests/source/NSE/test.nse
vendored
Normal file
34
tests/syntax-tests/source/NSE/test.nse
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
--- Finds factorial of a number.
|
||||
-- @param value Number to find factorial.
|
||||
-- @return Factorial of number.
|
||||
local function factorial(value)
|
||||
if value <= 1 then
|
||||
return 1
|
||||
else
|
||||
return value * factorial(value - 1)
|
||||
end
|
||||
end
|
||||
|
||||
--- Joins a table of strings into a new string.
|
||||
-- @param table Table of strings.
|
||||
-- @param separator Separator character.
|
||||
-- @return Joined string.
|
||||
local function join(table, separator)
|
||||
local data = ""
|
||||
|
||||
for index, value in ipairs(table) do
|
||||
data = data .. value .. separator
|
||||
end
|
||||
|
||||
data = data:sub(1, data:len() - 1)
|
||||
|
||||
return data
|
||||
end
|
||||
|
||||
local a = factorial(5)
|
||||
|
||||
print(a)
|
||||
|
||||
local b = join({ "l", "u", "a" }, ",")
|
||||
|
||||
print(b)
|
6
tests/syntax-tests/source/Svelte/App.svelte
vendored
6
tests/syntax-tests/source/Svelte/App.svelte
vendored
@@ -27,9 +27,13 @@
|
||||
</script>
|
||||
|
||||
<script type="text/livescript">
|
||||
// This block is a regression test for a bat panic when a LiveScript syntax definition is missing
|
||||
// This block is a regression test for a bat panic when a LiveScript syntax definition is missing
|
||||
</script>
|
||||
|
||||
<style lang="text/postcss">
|
||||
/* This block is a regression test for a bat panic when a PostCSS syntax definition is missing */
|
||||
</style>
|
||||
|
||||
<style>
|
||||
main {
|
||||
position: relative;
|
||||
|
5
tests/syntax-tests/source/Vue/example.vue
vendored
5
tests/syntax-tests/source/Vue/example.vue
vendored
@@ -8,6 +8,11 @@
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template lang='pug'>
|
||||
#container.col
|
||||
p This shall be formatted as Plain Text as long as a Pug syntax definition is missing
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import AppHeader from "@/components/AppHeader";
|
||||
import AppLoadingIndicator from "@/components/AppLoadingIndicator";
|
||||
|
54
tests/syntax-tests/source/cmd-help/test.cmd-help
vendored
Normal file
54
tests/syntax-tests/source/cmd-help/test.cmd-help
vendored
Normal file
@@ -0,0 +1,54 @@
|
||||
bat 0.20.0 (e735562-modified)
|
||||
A cat(1) clone with syntax highlighting and Git integration.
|
||||
|
||||
USAGE:
|
||||
bat [OPTIONS] [FILE]...
|
||||
bat <SUBCOMMAND>
|
||||
|
||||
OPTIONS:
|
||||
-A, --show-all
|
||||
Show non-printable characters (space, tab, newline, ..).
|
||||
|
||||
-p, --plain Show plain style (alias for '--style=plain').
|
||||
-l, --language <language> Set the language for syntax highlighting.
|
||||
-H, --highlight-line <N:M>... Highlight lines N through M.
|
||||
--file-name <name>... Specify the name to display for a file.
|
||||
-d, --diff
|
||||
Only show lines that have been added/removed/modified.
|
||||
|
||||
--tabs <T> Set the tab width to T spaces.
|
||||
--wrap <mode>
|
||||
Specify the text-wrapping mode (*auto*, never, character).
|
||||
|
||||
-n, --number
|
||||
Show line numbers (alias for '--style=numbers').
|
||||
|
||||
--color <when> When to use colors (*auto*, never, always).
|
||||
--italic-text <when> Use italics in output (always, *never*)
|
||||
--decorations <when>
|
||||
When to show the decorations (*auto*, never, always).
|
||||
|
||||
--paging <when>
|
||||
Specify when to use the pager, or use `-P` to disable (*auto*, never,
|
||||
always).
|
||||
-m, --map-syntax <glob:syntax>...
|
||||
Use the specified syntax for files matching the glob pattern
|
||||
('*.cpp:C++').
|
||||
--theme <theme> Set the color theme for syntax highlighting.
|
||||
--list-themes Display all supported highlighting themes.
|
||||
--style <components>
|
||||
Comma-separated list of style elements to display (*auto*, full, plain,
|
||||
changes, header, grid, rule, numbers, snip).
|
||||
-r, --line-range <N:M>... Only print the lines from N to M.
|
||||
-L, --list-languages Display all supported languages.
|
||||
-h, --help Print this help message.
|
||||
-V, --version Show version information.
|
||||
|
||||
ARGS:
|
||||
<FILE>... File(s) to print / concatenate. Use '-' for standard input.
|
||||
|
||||
SUBCOMMANDS:
|
||||
cache Modify the syntax-definition and theme cache
|
||||
|
||||
Note: `bat -h` prints a short and concise overview while `bat --help` gives all
|
||||
details.
|
16
tests/test_pretty_printer.rs
Normal file
16
tests/test_pretty_printer.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
use bat::PrettyPrinter;
|
||||
|
||||
#[test]
|
||||
fn syntaxes() {
|
||||
let printer = PrettyPrinter::new();
|
||||
let syntaxes: Vec<String> = printer.syntaxes().map(|s| s.name).collect();
|
||||
|
||||
// Just do some sanity checking
|
||||
assert!(syntaxes.contains(&"Rust".to_string()));
|
||||
assert!(syntaxes.contains(&"Java".to_string()));
|
||||
assert!(!syntaxes.contains(&"this-language-does-not-exist".to_string()));
|
||||
|
||||
// This language exists but is hidden, so we should not see it; it shall
|
||||
// have been filtered out before getting to us
|
||||
assert!(!syntaxes.contains(&"Git Common".to_string()));
|
||||
}
|
Reference in New Issue
Block a user