Skip to content

Commit

Permalink
Merge pull request #293 from Keats/master
Browse files Browse the repository at this point in the history
Update dependencies
  • Loading branch information
trishume authored May 23, 2020
2 parents 064ae75 + 2685482 commit 1c7e27a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ keywords = ["syntax", "highlighting", "highlighter", "colouring", "parsing"]
categories = ["parser-implementations", "parsing", "text-processing"]
readme = "Readme.md"
license = "MIT"
version = "4.1.1" # remember to update html_root_url
version = "4.2.0" # remember to update html_root_url
authors = ["Tristan Hume <[email protected]>"]
edition = "2018"
exclude = [
Expand All @@ -19,14 +19,14 @@ exclude = [

[dependencies]
yaml-rust = { version = "0.4", optional = true }
onig = { version = "5.0", optional = true }
onig = { version = "6.0", optional = true, default-features = false }
fancy-regex = { version = "0.3.2", optional = true }
walkdir = "2.0"
regex-syntax = { version = "0.6", optional = true }
lazy_static = "1.0"
lazycell = "1.0"
bitflags = "1.0.4"
plist = "0.5"
plist = "1"
bincode = { version = "1.0", optional = true }
flate2 = { version = "1.0", optional = true, default-features = false }
fnv = { version = "1.0", optional = true }
Expand Down
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ I consider this project mostly complete, I still maintain it and review PRs, but
`syntect` is [available on crates.io](https://crates.io/crates/syntect). You can install it by adding this line to your `Cargo.toml`:

```toml
syntect = "4.1"
syntect = "4.2"
```

After that take a look at the [documentation](https://docs.rs/syntect) and the [examples](https://github.com/trishume/syntect/tree/master/examples).
Expand Down Expand Up @@ -128,14 +128,14 @@ For more information on available features, see the features section in `Cargo.t

Since 4.0 `syntect` offers an alternative pure-rust regex engine based on the [fancy-regex](https://github.com/fancy-regex/fancy-regex) engine which extends the awesome [regex crate](https://github.com/rust-lang/regex) with support for fancier regex features that Sublime syntaxes need like lookaheads.

The advantage of `fancy-regex` is that it does not require the [onig crate](https://github.com/rust-onig/rust-onig) which requires building and linking the Oniguruma C library. Many users experience difficulty building the `onig` crate, especially on Windows and Webassembly. The `onig` crate also recently added a requirement on `bindgen` which needs Clang/LLVM and thus makes it even harder to build. The `bindgen` dependency [may eventually be removed](https://github.com/rust-onig/rust-onig/pull/126) but even if it is, a pure-Rust build still makes things better for Webassembly and systems without a C compiler.
The advantage of `fancy-regex` is that it does not require the [onig crate](https://github.com/rust-onig/rust-onig) which requires building and linking the Oniguruma C library. Many users experience difficulty building the `onig` crate, especially on Windows and Webassembly.

As far as our tests can tell this new engine is just as correct, but it hasn't been tested as extensively in production. It also currently seems to be about **half the speed** of the default Oniguruma engine, although further testing and optimization (perhaps by you!) may eventually see it surpass Oniguruma's speed and become the default.

To use the fancy-regex engine with syntect, add it to your `Cargo.toml` like so:

```toml
syntect = { version = "4.1", default-features = false, features = ["default-fancy"]}
syntect = { version = "4.2", default-features = false, features = ["default-fancy"]}
```

If you want to run examples with the fancy-regex engine you can use a command line like the following:
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! Some docs have example code but a good place to look is the `syncat` example as well as the source code
//! for the `easy` module in `easy.rs` as that shows how to plug the various parts together for common use cases.
#![doc(html_root_url = "https://docs.rs/syntect/4.1.1")]
#![doc(html_root_url = "https://docs.rs/syntect/4.2.0")]

#[macro_use]
extern crate lazy_static;
Expand Down

0 comments on commit 1c7e27a

Please sign in to comment.