on master help sign in
23 files changed+229−78
since splitsnapshots
unifiedsplit
.github/ISSUE_TEMPLATE/question.md+2 .github/workflows/CICD.yml+13−1 CHANGELOG.md+36−6 Cargo.lock+5−10 Cargo.toml+3−4 README.md+1−1 assets/acknowledgements.bin assets/syntaxes.bin assets/syntaxes/02_Extra/INI.sublime-syntax+2−2 assets/syntaxes/02_Extra/Zig+1−1 assets/themes.bin doc/release-checklist.md+7−6 src/assets.rs+71−4 src/error.rs+4−1 src/printer.rs+1−1 tests/integration_tests.rs+14 tests/syntax-tests/highlighted/INI/test.inf+5 tests/syntax-tests/highlighted/Svelte/App.svelte+5−1 tests/syntax-tests/highlighted/Vue/example.vue+5 tests/syntax-tests/highlighted/Zig/example.zig+39−39 tests/syntax-tests/source/INI/test.inf+5 tests/syntax-tests/source/Svelte/App.svelte+5−1 tests/syntax-tests/source/Vue/example.vue+5
.github/ISSUE_TEMPLATE/question.md+2
@@ -7,3 +7,5 @@ assignees: ''
77
88---
99
10+<!-- Using a normal ticket is still fine, but feel free to ask your
11+questions about bat on https://github.com/sharkdp/bat/discussions instead. -->
.github/workflows/CICD.yml+13−1
@@ -118,6 +118,18 @@ jobs:
118118 toolchain: stable
119119 default: true
120120 profile: minimal
121+ - name: Print -h
122+ uses: actions-rs/cargo@v1
123+ with:
124+ command: run
125+ args: --locked -- -h
126+ - name: Print --help
127+ uses: actions-rs/cargo@v1
128+ with:
129+ command: run
130+ args: --locked -- --help
131+ - name: Show man page
132+ run: man $(find . -name bat.1)
121133 - name: Check documentation
122134 env:
123135 RUSTDOCFLAGS: -D warnings
@@ -142,7 +154,7 @@ jobs:
142154 - { target: x86_64-apple-darwin , os: macos-10.15 }
143155 - { target: x86_64-pc-windows-gnu , os: windows-2019 }
144156 - { target: x86_64-pc-windows-msvc , os: windows-2019 }
145− - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04 }
157+ - { target: x86_64-unknown-linux-gnu , os: ubuntu-20.04, use-cross: true }
146158 - { target: x86_64-unknown-linux-musl , os: ubuntu-20.04, use-cross: true }
147159 steps:
148160 - name: Checkout source code
CHANGELOG.md+36−6
@@ -2,18 +2,43 @@
22
33## Features
44
5−- Correctly render tab stops in --show-all, see #2038 (@Synthetica9)
6−- Add a `--style=default` option, less verbose than `full`, see #2061 (@IsaacHorvath)
7−- Enable BusyBox less as pager, see #2162 (@nfisher1226)
5+- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic)
6+
7+## Bugfixes
8+
9+## Other
10+
11+- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
12+
13+## Syntaxes
14+
15+## Themes
16+
17+## `bat` as a library
18+
19+
20+# v0.21.0
21+
22+## Features
23+
24+- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
25+- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
26+- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
27+- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic)
828
929## Bugfixes
1030
1131- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic)
32+- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic)
33+
34+## Performance
35+
36+- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
37+- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)
1238
1339## Other
1440
1541- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic)
16−- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
1742
1843## Syntaxes
1944
@@ -21,12 +46,17 @@
2146- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
2247- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
2348- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
24−
25−## Themes
49+- Slightly adjust Zig syntax. See #2136 (@Enselic)
50+- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
2651
2752## `bat` as a library
2853
2954- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142
55+- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
56+- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic)
57+- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic)
58+- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic)
59+
3060
3161# v0.20.0
3262
Cargo.lock+5−10
@@ -74,7 +74,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd"
7474
7575[[package]]
7676name = "bat"
77−version = "0.20.0"
77+version = "0.21.0"
7878dependencies = [
7979 "ansi_colours",
8080 "ansi_term",
@@ -580,12 +580,6 @@ version = "1.4.0"
580580source = "registry+https://github.com/rust-lang/crates.io-index"
581581checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
582582
583−[[package]]
584−name = "lazycell"
585−version = "1.3.0"
586−source = "registry+https://github.com/rust-lang/crates.io-index"
587−checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55"
588−
589583[[package]]
590584name = "libc"
591585version = "0.2.125"
@@ -1071,9 +1065,9 @@ dependencies = [
10711065
10721066[[package]]
10731067name = "syntect"
1074−version = "4.6.0"
1068+version = "5.0.0"
10751069source = "registry+https://github.com/rust-lang/crates.io-index"
1076−checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031"
1070+checksum = "c6c454c27d9d7d9a84c7803aaa3c50cd088d2906fe3c6e42da3209aa623576a8"
10771071dependencies = [
10781072 "bincode",
10791073 "bitflags",
@@ -1081,13 +1075,14 @@ dependencies = [
10811075 "flate2",
10821076 "fnv",
10831077 "lazy_static",
1084− "lazycell",
1078+ "once_cell",
10851079 "onig",
10861080 "plist",
10871081 "regex-syntax",
10881082 "serde",
10891083 "serde_derive",
10901084 "serde_json",
1085+ "thiserror",
10911086 "walkdir",
10921087 "yaml-rust",
10931088]
Cargo.toml+3−4
@@ -6,7 +6,7 @@ homepage = "https://github.com/sharkdp/bat"
66license = "MIT/Apache-2.0"
77name = "bat"
88repository = "https://github.com/sharkdp/bat"
9−version = "0.20.0"
9+version = "0.21.0"
1010exclude = ["assets/syntaxes/*", "assets/themes/*"]
1111build = "build.rs"
1212edition = '2018'
@@ -33,8 +33,7 @@ minimal-application = [
3333]
3434git = ["git2"] # Support indicating git modifications
3535paging = ["shell-words", "grep-cli"] # Support applying a pager on the output
36−# Add "syntect/plist-load" when https://github.com/trishume/syntect/pull/345 reaches us
37−build-assets = ["syntect/yaml-load", "syntect/dump-create", "regex", "walkdir"]
36+build-assets = ["syntect/yaml-load", "syntect/plist-load", "regex", "walkdir"]
3837
3938# You need to use one of these if you depend on bat as a library:
4039regex-onig = ["syntect/regex-onig"] # Use the "oniguruma" regex engine
@@ -73,7 +72,7 @@ optional = true
7372default-features = false
7473
7574[dependencies.syntect]
76−version = "4.6.0"
75+version = "5.0.0"
7776default-features = false
7877features = ["parsing"]
7978
README.md+1−1
@@ -171,7 +171,7 @@ You can combine `bat` with `git diff` to view lines around code changes with pro
171171highlighting:
172172```bash
173173batdiff() {
174− git diff --name-only --diff-filter=d | xargs bat --diff
174+ git diff --name-only --relative --diff-filter=d | xargs bat --diff
175175}
176176```
177177If you prefer to use this as a separate tool, check out `batdiff` in [`bat-extras`](https://github.com/eth-p/bat-extras).
assets/acknowledgements.bin

Binary file not shown.

assets/syntaxes.bin

Binary file not shown.

assets/syntaxes/02_Extra/INI.sublime-syntax+2−2
@@ -5,8 +5,8 @@ name: INI
55file_extensions:
66 - ini
77 - INI
8− - inf
9− - INF
8+ - "inf"
9+ - "INF"
1010 - reg
1111 - REG
1212 - lng
assets/syntaxes/02_Extra/Zig+1−1

Submodule changed.

assets/themes.bin

Binary file not shown.

doc/release-checklist.md+7−6
@@ -7,21 +7,22 @@
77- [ ] Find the current min. supported Rust version by running
88 `grep '^\s*MIN_SUPPORTED_RUST_VERSION' .github/workflows/CICD.yml`.
99- [ ] Update the version and the min. supported Rust version in `README.md` and
10− `doc/README-*.md`. Check with `git grep -i 'rust.*1\.'` and
11− `git grep -i '1\..*rust'`.
10+ `doc/README-*.md`. Check with
11+ `git grep -i -e 'rust.*1\.' -e '1\..*rust' | grep README | grep -v tests/`.
1212- [ ] Update `CHANGELOG.md`. Introduce a section for the new release.
1313
1414## Update syntaxes and themes (build assets)
1515
16−- [ ] Install the latest master version (`cargo clean && cargo install -f --path .`) and make
16+- [ ] Install the latest master version (`cargo clean && cargo install --locked -f --path .`) and make
1717 sure that it is available on the `PATH` (`bat --version` should show the
1818 new version).
1919- [ ] Run `assets/create.sh` and check in the binary asset files.
2020
2121## Documentation
2222
23−- [ ] Review the `-h` and `--help` texts
24−- [ ] Review the `man` page (`man $(fd -HIp target/release/build.*out/assets/manual/bat.1) | tee`)
23+- [ ] Review `-h`, `--help`, and the `man` page. All of these are shown in
24+ the output of the CI job called *Documentation*, so look there.
25+ The CI workflow corresponding to the tip of the master branch is a good place to look.
2526
2627## Pre-release checks
2728
@@ -30,7 +31,7 @@
3031- [ ] Optional: manually test the new features and command-line options. To do
3132 this, install the latest `bat` version again (to include the new syntaxes
3233 and themes).
33−- [ ] Run `cargo publish --dry-run --allow-dirty` to make sure that it will
34+- [ ] Run `cargo publish --dry-run` to make sure that it will
3435 succeed later (after creating the GitHub release).
3536
3637## Release
src/assets.rs+71−4
@@ -43,8 +43,9 @@ pub struct SyntaxReferenceInSet<'a> {
4343 pub syntax_set: &'a SyntaxSet,
4444}
4545
46−/// Compress for size of ~700 kB instead of ~4600 kB at the cost of ~30% longer deserialization time
47−pub(crate) const COMPRESS_SYNTAXES: bool = true;
46+/// Lazy-loaded syntaxes are already compressed, and we don't want to compress
47+/// already compressed data.
48+pub(crate) const COMPRESS_SYNTAXES: bool = false;
4849
4950/// We don't want to compress our [LazyThemeSet] since the lazy-loaded themes
5051/// within it are already compressed, and compressing another time just makes
@@ -68,10 +69,57 @@ impl HighlightingAssets {
6869 }
6970 }
7071
72+ /// The default theme.
73+ ///
74+ /// ### Windows and Linux
75+ ///
76+ /// Windows and most Linux distributions has a dark terminal theme by
77+ /// default. On these platforms, this function always returns a theme that
78+ /// looks good on a dark background.
79+ ///
80+ /// ### macOS
81+ ///
82+ /// On macOS the default terminal background is light, but it is common that
83+ /// Dark Mode is active, which makes the terminal background dark. On this
84+ /// platform, the default theme depends on
85+ /// ```bash
86+ /// defaults read -globalDomain AppleInterfaceStyle
87+ /// ````
88+ /// To avoid the overhead of the check on macOS, simply specify a theme
89+ /// explicitly via `--theme`, `BAT_THEME`, or `~/.config/bat`.
90+ ///
91+ /// See <https://github.com/sharkdp/bat/issues/1746> and
92+ /// <https://github.com/sharkdp/bat/issues/1928> for more context.
7193 pub fn default_theme() -> &'static str {
94+ #[cfg(not(target_os = "macos"))]
95+ {
96+ Self::default_dark_theme()
97+ }
98+ #[cfg(target_os = "macos")]
99+ {
100+ if macos_dark_mode_active() {
101+ Self::default_dark_theme()
102+ } else {
103+ Self::default_light_theme()
104+ }
105+ }
106+ }
107+
108+ /**
109+ * The default theme that looks good on a dark background.
110+ */
111+ fn default_dark_theme() -> &'static str {
72112 "Monokai Extended"
73113 }
74114
115+ /**
116+ * The default theme that looks good on a light background.
117+ */
118+ #[cfg(target_os = "macos")]
119+ fn default_light_theme() -> &'static str {
120+ "Monokai Extended Light"
121+ }
122+
75123 pub fn from_cache(cache_path: &Path) -> Result<Self> {
76124 Ok(HighlightingAssets::new(
77125 SerializedSyntaxSet::FromFile(cache_path.join("syntaxes.bin")),
@@ -351,6 +399,16 @@ fn asset_from_cache<T: serde::de::DeserializeOwned>(
351399 .map_err(|_| format!("Could not parse cached {}", description).into())
352400}
353401
402+#[cfg(target_os = "macos")]
403+fn macos_dark_mode_active() -> bool {
404+ let mut defaults_cmd = std::process::Command::new("defaults");
405+ defaults_cmd.args(&["read", "-globalDomain", "AppleInterfaceStyle"]);
406+ match defaults_cmd.output() {
407+ Ok(output) => output.stdout == b"Dark\n",
408+ Err(_) => true,
409+ }
410+}
411+
354412#[cfg(test)]
355413mod tests {
356414 use super::*;
@@ -581,13 +639,22 @@ mod tests {
581639 }
582640
583641 #[test]
584− fn syntax_detection_is_case_sensitive() {
642+ fn syntax_detection_is_case_insensitive() {
585643 let mut test = SyntaxDetectionTest::new();
586644
587− assert_ne!(test.syntax_for_file("README.MD"), "Markdown");
645+ assert_eq!(test.syntax_for_file("README.md"), "Markdown");
646+ assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
647+ assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
648+ assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
649+
650+ // Adding a mapping for "MD" in addition to "md" should not break the mapping
588651 test.syntax_mapping
589652 .insert("*.MD", MappingTarget::MapTo("Markdown"))
590653 .ok();
654+
655+ assert_eq!(test.syntax_for_file("README.md"), "Markdown");
656+ assert_eq!(test.syntax_for_file("README.mD"), "Markdown");
657+ assert_eq!(test.syntax_for_file("README.Md"), "Markdown");
591658 assert_eq!(test.syntax_for_file("README.MD"), "Markdown");
592659 }
593660
src/error.rs+4−1
@@ -2,11 +2,14 @@ use std::io::Write;
22use thiserror::Error;
33
44#[derive(Error, Debug)]
5+#[non_exhaustive]
56pub enum Error {
67 #[error(transparent)]
78 Io(#[from] ::std::io::Error),
89 #[error(transparent)]
9− SyntectError(#[from] ::syntect::LoadingError),
10+ SyntectError(#[from] ::syntect::Error),
11+ #[error(transparent)]
12+ SyntectLoadingError(#[from] ::syntect::LoadingError),
1013 #[error(transparent)]
1114 ParseIntError(#[from] ::std::num::ParseIntError),
1215 #[error(transparent)]
src/printer.rs+1−1
@@ -453,7 +453,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
453453
454454 let mut highlighted_line = highlighter_from_set
455455 .highlighter
456− .highlight(for_highlighting, highlighter_from_set.syntax_set);
456+ .highlight_line(for_highlighting, highlighter_from_set.syntax_set)?;
457457
458458 if too_long {
459459 highlighted_line[0].1 = &line;
tests/integration_tests.rs+14
@@ -1427,6 +1427,8 @@ fn ansi_passthrough_emit() {
14271427fn ignored_suffix_arg() {
14281428 bat()
14291429 .arg("-f")
1430+ .arg("--theme")
1431+ .arg("Monokai Extended")
14301432 .arg("-p")
14311433 .arg("test.json~")
14321434 .assert()
@@ -1436,6 +1438,8 @@ fn ignored_suffix_arg() {
14361438
14371439 bat()
14381440 .arg("-f")
1441+ .arg("--theme")
1442+ .arg("Monokai Extended")
14391443 .arg("-p")
14401444 .arg("--ignored-suffix=.suffix")
14411445 .arg("test.json.suffix")
@@ -1446,6 +1450,8 @@ fn ignored_suffix_arg() {
14461450
14471451 bat()
14481452 .arg("-f")
1453+ .arg("--theme")
1454+ .arg("Monokai Extended")
14491455 .arg("-p")
14501456 .arg("test.json.suffix")
14511457 .assert()
@@ -1463,6 +1469,8 @@ fn highlighting_is_skipped_on_long_lines() {
14631469
14641470 bat()
14651471 .arg("-f")
1472+ .arg("--theme")
1473+ .arg("Monokai Extended")
14661474 .arg("-p")
14671475 .arg("longline.json")
14681476 .assert()
@@ -1482,6 +1490,8 @@ fn all_global_git_config_locations_syntax_mapping_work() {
14821490 bat()
14831491 .env("XDG_CONFIG_HOME", fake_home.join(".config").as_os_str())
14841492 .arg("-f")
1493+ .arg("--theme")
1494+ .arg("Monokai Extended")
14851495 .arg("-p")
14861496 .arg("git/.config/git/config")
14871497 .assert()
@@ -1492,6 +1502,8 @@ fn all_global_git_config_locations_syntax_mapping_work() {
14921502 bat()
14931503 .env("HOME", fake_home.as_os_str())
14941504 .arg("-f")
1505+ .arg("--theme")
1506+ .arg("Monokai Extended")
14951507 .arg("-p")
14961508 .arg("git/.config/git/config")
14971509 .assert()
@@ -1502,6 +1514,8 @@ fn all_global_git_config_locations_syntax_mapping_work() {
15021514 bat()
15031515 .env("HOME", fake_home.as_os_str())
15041516 .arg("-f")
1517+ .arg("--theme")
1518+ .arg("Monokai Extended")
15051519 .arg("-p")
15061520 .arg("git/.gitconfig")
15071521 .assert()
tests/syntax-tests/highlighted/INI/test.infnew file+5
@@ -0,0 +1,5 @@
1+[section]
2+key=value
3+# This file is just for testing that the INI syntax is registered to handle
4+# the .inf file extension, it is not testing the syntax highlighting capabilities
5+# of the INI syntax itself
tests/syntax-tests/highlighted/Svelte/App.svelte+5−1
@@ -27,9 +27,13 @@
2727</script>
2828
2929<script type="text/livescript">
30− // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
30+ // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
3131</script>
3232
33+<style lang="text/postcss">
34+ /* This block is a regression test for a bat panic when a PostCSS syntax definition is missing */
35+</style>
36+
3337<style>
3438 main {
3539 position: relative;
tests/syntax-tests/highlighted/Vue/example.vue+5
@@ -8,6 +8,11 @@
88 </div>
99</template>
1010
11+<template lang='pug'>
12+ #container.col
13+ p This shall be formatted as Plain Text as long as a Pug syntax definition is missing
14+</template>
15+
1116<script>
1217import AppHeader from "@/components/AppHeader";
1318import AppLoadingIndicator from "@/components/AppLoadingIndicator";
tests/syntax-tests/highlighted/Zig/example.zig+39−39
@@ -1,18 +1,18 @@
11//! this is a top level doc, starts with "//!"
22
3−const std = @import("std");
3+const std = @import("std");
44
55pub fn main() anyerror!void {
6− const stdout = std.io.getStdOut().writer();
7− try stdout.print("Hello, {}!\n", .{"world"});
6+ const stdout = std.io.getStdOut().writer();
7+ try stdout.print("Hello, {}!\n", .{"world"});
88}
99
10−const expect = std.testing.expect;
10+const expect = std.testing.expect;
1111
1212test "comments" {
1313 // comments start with "//" until newline
1414 // foo bar baz
15− const x = true; // another comment
15+ const x = true; // another comment
1616 expect(x);
1717}
1818
@@ -25,26 +25,26 @@
2525 /// number of nanoseconds past the second
2626 nano: u32,
2727
28− const Self = @This();
28+ const Self = @This();
2929
3030 pub fn unixEpoch() Self {
3131 return Self{
32− .seconds = 0,
33− .nanos = 0,
32+ .seconds = 0,
33+ .nanos = 0,
3434 };
3535 }
3636};
3737
38−const my_val = switch (std.Target.current.os.tag) {
39− .linux => "Linux",
38+const my_val = switch (std.Target.current.os.tag) {
39+ .linux => "Linux",
4040 else => "not Linux",
4141};
4242
4343const Book = enum {
44− paperback,
45− hardcover,
46− ebook,
47− pdf,
44+ paperback,
45+ hardcover,
46+ ebook,
47+ pdf,
4848};
4949
5050const TokenType = union(enum) {
@@ -54,54 +54,54 @@
5454};
5555
5656const array_lit: [4]u8 = .{ 11, 22, 33, 44 };
57−const sentinal_lit = [_:0]u8{ 1, 2, 3, 4 };
57+const sentinal_lit = [_:0]u8{ 1, 2, 3, 4 };
5858
5959test "address of syntax" {
6060 // Get the address of a variable:
6161 const x: i32 = 1234;
62− const x_ptr = &x;
62+ const x_ptr = &x;
6363
6464 // Dereference a pointer:
6565 expect(x_ptr.* == 1234);
6666
6767 // When you get the address of a const variable, you get a const pointer to a single item.
68− expect(@TypeOf(x_ptr) == *const i32);
68+ expect(@TypeOf(x_ptr) == *const i32);
6969
7070 // If you want to mutate the value, you'd need an address of a mutable variable:
7171 var y: i32 = 5678;
72− const y_ptr = &y;
73− expect(@TypeOf(y_ptr) == *i32);
74− y_ptr.* += 1;
72+ const y_ptr = &y;
73+ expect(@TypeOf(y_ptr) == *i32);
74+ y_ptr.* += 1;
7575 expect(y_ptr.* == 5679);
7676}
7777
7878// integer literals
79−const decimal_int = 98222;
80−const hex_int = 0xff;
81−const another_hex_int = 0xFF;
82−const octal_int = 0o755;
83−const binary_int = 0b11110000;
79+const decimal_int = 98222;
80+const hex_int = 0xff;
81+const another_hex_int = 0xFF;
82+const octal_int = 0o755;
83+const binary_int = 0b11110000;
8484
8585// underscores may be placed between two digits as a visual separator
86−const one_billion = 1_000_000_000;
87−const binary_mask = 0b1_1111_1111;
88−const permissions = 0o7_5_5;
89−const big_address = 0xFF80_0000_0000_0000;
86+const one_billion = 1_000_000_000;
87+const binary_mask = 0b1_1111_1111;
88+const permissions = 0o7_5_5;
89+const big_address = 0xFF80_0000_0000_0000;
9090
9191// float literals
92−const floating_point = 123.0E+77;
93−const another_float = 123.0;
94−const yet_another = 123.0e+77;
92+const floating_point = 123.0E+77;
93+const another_float = 123.0;
94+const yet_another = 123.0e+77;
9595
96−const hex_floating_point = 0x103.70p-5;
97−const another_hex_float = 0x103.70;
98−const yet_another_hex_float = 0x103.70P-5;
96+const hex_floating_point = 0x103.70p-5;
97+const another_hex_float = 0x103.70;
98+const yet_another_hex_float = 0x103.70P-5;
9999
100100// underscores may be placed between two digits as a visual separator
101−const lightspeed = 299_792_458.000_000;
102−const nanosecond = 0.000_000_001;
103−const more_hex = 0x1234_5678.9ABC_CDEFp-10;
101+const lightspeed = 299_792_458.000_000;
102+const nanosecond = 0.000_000_001;
103+const more_hex = 0x1234_5678.9ABC_CDEFp-10;
104104
105105fn max(comptime T: type, a: T, b: T) T {
106− return if (a > b) a else b;
106+ return if (a > b) a else b;
107107}
tests/syntax-tests/source/INI/test.infnew file+5
@@ -0,0 +1,5 @@
1+[section]
2+key=value
3+# This file is just for testing that the INI syntax is registered to handle
4+# the .inf file extension, it is not testing the syntax highlighting capabilities
5+# of the INI syntax itself
tests/syntax-tests/source/Svelte/App.svelte+5−1
@@ -27,9 +27,13 @@
2727</script>
2828
2929<script type="text/livescript">
30− // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
30+ // This block is a regression test for a bat panic when a LiveScript syntax definition is missing
3131</script>
3232
33+<style lang="text/postcss">
34+ /* This block is a regression test for a bat panic when a PostCSS syntax definition is missing */
35+</style>
36+
3337<style>
3438 main {
3539 position: relative;
tests/syntax-tests/source/Vue/example.vue+5
@@ -8,6 +8,11 @@
88 </div>
99</template>
1010
11+<template lang='pug'>
12+ #container.col
13+ p This shall be formatted as Plain Text as long as a Pug syntax definition is missing
14+</template>
15+
1116<script>
1217import AppHeader from "@/components/AppHeader";
1318import AppLoadingIndicator from "@/components/AppLoadingIndicator";