Skip to content

Commit db66e44

Browse files
authored
Merge pull request #2755 from cyqsimon/syntax-mapping-refactor
More extensible syntax mapping mechanism
2 parents 98a2b6b + 55e02e1 commit db66e44

45 files changed

Lines changed: 930 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
- Minor benchmark script improvements #2768 (@cyqsimon)
1616
- Update Arch Linux package URL in README files #2779 (@brunobell)
1717
- Update and improve `zsh` completion, see #2772 (@okapia)
18+
- More extensible syntax mapping mechanism #2755 (@cyqsimon)
1819
- Use proper Architecture for Debian packages built for musl, see #2811 (@Enselic)
1920
- Pull in fix for unsafe-libyaml security advisory, see #2812 (@dtolnay)
2021
- Update git-version dependency to use Syn v2, see #2816 (@dtolnay)
@@ -28,6 +29,10 @@
2829

2930
## `bat` as a library
3031

32+
- Changes to `syntax_mapping::SyntaxMapping` #2755 (@cyqsimon)
33+
- `SyntaxMapping::get_syntax_for` is now correctly public
34+
- [BREAKING] `SyntaxMapping::{empty,builtin}` are removed; use `SyntaxMapping::new` instead
35+
- [BREAKING] `SyntaxMapping::mappings` is replaced by `SyntaxMapping::{builtin,custom,all}_mappings`
3136
- Make `Controller::run_with_error_handler`'s error handler `FnMut`, see #2831 (@rhysd)
3237

3338
# v0.24.0

Cargo.lock

Lines changed: 127 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ nix = { version = "0.26.4", default-features = false, features = ["term"] }
100100

101101
[build-dependencies]
102102
anyhow = "1.0.78"
103+
indexmap = { version = "2.1.0", features = ["serde"] }
104+
itertools = "0.11.0"
105+
once_cell = "1.18"
106+
regex = "1.10.2"
107+
serde = { version = "1.0", features = ["derive"] }
108+
serde_with = { version = "3.4.0", default-features = false, features = ["macros"] }
109+
toml = { version = "0.8.6", features = ["preserve_order"] }
110+
walkdir = "2.4"
103111

104112
[build-dependencies.clap]
105113
version = "4.4.12"

build/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
#[cfg(feature = "application")]
22
mod application;
3+
mod syntax_mapping;
34
mod util;
45

56
fn main() -> anyhow::Result<()> {
67
// only watch manually-designated files
78
// see: https://doc.rust-lang.org/cargo/reference/build-scripts.html#rerun-if-changed
89
println!("cargo:rerun-if-changed=build/");
910

11+
syntax_mapping::build_static_mappings()?;
12+
1013
#[cfg(feature = "application")]
1114
application::gen_man_and_comp()?;
1215

0 commit comments

Comments
 (0)