Skip to content

Commit

Permalink
Merge pull request #2755 from cyqsimon/syntax-mapping-refactor
Browse files Browse the repository at this point in the history
More extensible syntax mapping mechanism
  • Loading branch information
sharkdp authored Jan 21, 2024
2 parents 98a2b6b + 55e02e1 commit db66e44
Show file tree
Hide file tree
Showing 45 changed files with 930 additions and 232 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
- Minor benchmark script improvements #2768 (@cyqsimon)
- Update Arch Linux package URL in README files #2779 (@brunobell)
- Update and improve `zsh` completion, see #2772 (@okapia)
- More extensible syntax mapping mechanism #2755 (@cyqsimon)
- Use proper Architecture for Debian packages built for musl, see #2811 (@Enselic)
- Pull in fix for unsafe-libyaml security advisory, see #2812 (@dtolnay)
- Update git-version dependency to use Syn v2, see #2816 (@dtolnay)
Expand All @@ -28,6 +29,10 @@

## `bat` as a library

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

# v0.24.0
Expand Down
132 changes: 127 additions & 5 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@ nix = { version = "0.26.4", default-features = false, features = ["term"] }

[build-dependencies]
anyhow = "1.0.78"
indexmap = { version = "2.1.0", features = ["serde"] }
itertools = "0.11.0"
once_cell = "1.18"
regex = "1.10.2"
serde = { version = "1.0", features = ["derive"] }
serde_with = { version = "3.4.0", default-features = false, features = ["macros"] }
toml = { version = "0.8.6", features = ["preserve_order"] }
walkdir = "2.4"

[build-dependencies.clap]
version = "4.4.12"
Expand Down
3 changes: 3 additions & 0 deletions build/main.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
#[cfg(feature = "application")]
mod application;
mod syntax_mapping;
mod util;

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

syntax_mapping::build_static_mappings()?;

#[cfg(feature = "application")]
application::gen_man_and_comp()?;

Expand Down
Loading

0 comments on commit db66e44

Please sign in to comment.