Skip to content

Commit d7d8e75

Browse files
Merge pull request #3 from ridiculousfish/utf32-update
Incorporate UTF-32 changes
2 parents 813a426 + 85b7afb commit d7d8e75

File tree

94 files changed

+114539
-625
lines changed

Some content is hidden

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

94 files changed

+114539
-625
lines changed

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: ci
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- master
7+
schedule:
8+
- cron: '00 01 * * *'
9+
jobs:
10+
test:
11+
name: test
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
matrix:
15+
build:
16+
- pinned
17+
- stable
18+
- beta
19+
- nightly
20+
- macos
21+
- win-msvc
22+
- win-gnu
23+
include:
24+
- build: pinned
25+
os: ubuntu-latest
26+
rust: 1.70.0
27+
- build: stable
28+
os: ubuntu-latest
29+
rust: stable
30+
- build: beta
31+
os: ubuntu-latest
32+
rust: beta
33+
- build: nightly
34+
os: ubuntu-latest
35+
rust: nightly
36+
- build: macos
37+
os: macos-latest
38+
rust: stable
39+
- build: win-msvc
40+
os: windows-latest
41+
rust: stable
42+
- build: win-gnu
43+
os: windows-latest
44+
rust: stable-x86_64-gnu
45+
steps:
46+
- name: Checkout repository
47+
uses: actions/checkout@v3
48+
- name: Install Rust
49+
uses: dtolnay/rust-toolchain@master
50+
with:
51+
toolchain: ${{ matrix.rust }}
52+
- name: Build
53+
run: cargo build --verbose --all --features utf32
54+
- name: Build docs
55+
run: cargo doc --verbose --all --features utf32
56+
- name: Run tests
57+
run: cargo test --verbose --all --features utf32
58+
- name: Run tests with static build
59+
shell: bash
60+
run: PCRE2_SYS_STATIC=1 cargo test --verbose --all --features utf32
61+
62+
rustfmt:
63+
name: rustfmt
64+
runs-on: ubuntu-latest
65+
steps:
66+
- name: Checkout repository
67+
uses: actions/checkout@v3
68+
- name: Install Rust
69+
uses: dtolnay/rust-toolchain@master
70+
with:
71+
toolchain: stable
72+
components: rustfmt
73+
- name: Check formatting
74+
run: |
75+
cargo fmt --all -- --check

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
[submodule "pcre2-sys/pcre2"]
2-
path = pcre2-sys/pcre2
3-
url = https://github.com/BurntSushi/pcre2-mirror
4-
branch = release/10.32

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

Cargo.toml

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
[package]
22
name = "pcre2"
3-
version = "0.2.3" #:version
4-
authors = ["Andrew Gallant <jamslam@gmail.com>"]
5-
description = "High level wrapper library for PCRE2."
3+
version = "0.2.9" #:version
4+
authors = ["Andrew Gallant <jamslam@gmail.com>", "fish-shell contributors"]
5+
description = "High level wrapper library for PCRE2, with UTF-32 support."
66
documentation = "https://docs.rs/pcre2"
7-
homepage = "https://github.com/BurntSushi/rust-pcre2"
8-
repository = "https://github.com/BurntSushi/rust-pcre2"
7+
homepage = "https://github.com/fish-shell/rust-pcre2"
8+
repository = "https://github.com/fish-shell/rust-pcre2"
99
readme = "README.md"
1010
keywords = ["pcre", "pcre2", "regex", "jit", "perl"]
11-
license = "Unlicense/MIT"
11+
license = "Unlicense OR MIT"
1212
categories = ["text-processing"]
1313
edition = "2021"
1414

1515
[workspace]
1616
members = ["pcre2-sys"]
1717

18+
[dependencies]
19+
libc = "0.2.146"
20+
log = "0.4.19"
21+
pcre2-sys = { version = "0.2.9", path = "pcre2-sys" }
22+
1823
[features]
19-
default = ["utf8"]
20-
utf8 = ["pcre2-sys/utf8"]
24+
default = ["jit"]
25+
26+
# Enable matching on UTF-32 strings
2127
utf32 = ["pcre2-sys/utf32"]
22-
static-pcre2 = []
2328

24-
[dependencies]
25-
libc = "0.2.46"
26-
log = "0.4.5"
27-
pcre2-sys = { version = "0.2.0", path = "pcre2-sys" }
28-
thread_local = "1"
29+
# Enable the PCRE2 JIT
30+
jit = ["pcre2-sys/jit"]

README.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,27 @@
1-
# pcre2
2-
1+
pcre2
2+
=====
33
A high level Rust wrapper library for [PCRE2](https://www.pcre.org/).
44

5+
[![Build status](https://github.com/BurntSushi/rust-pcre2/workflows/ci/badge.svg)](https://github.com/BurntSushi/rust-pcre2/actions)
6+
[![crates.io](https://img.shields.io/crates/v/pcre2.svg)](https://crates.io/crates/pcre2)
7+
58
Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).
69

7-
This has been forked to support UTF-32 matching, for use in fish-shell.
10+
11+
### Documentation
12+
13+
https://docs.rs/pcre2
14+
15+
16+
### Usage
17+
18+
Run `cargo add pcre2` to add this crate to your `Cargo.toml` file.
19+
20+
21+
### Notes
22+
23+
Currently, this is a fairly light layer around PCRE2 itself and does not even
24+
come close to covering all of its functionality. There are no specific plans
25+
in place to build out the wrapper further, but PRs for making more of PCRE2
26+
available are welcome, although my bandwidth for maintenance is limited. If
27+
you're interested in sharing this maintenance burden, please reach out.

appveyor.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

ci/script.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

pcre2-sys/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tmp

pcre2-sys/Cargo.toml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
[package]
22
name = "pcre2-sys"
3-
version = "0.2.4" #:version
4-
authors = ["Andrew Gallant <jamslam@gmail.com>"]
3+
version = "0.2.9" #:version
4+
authors = ["Andrew Gallant <jamslam@gmail.com>", "fish-shell contributors"]
55
description = "Low level bindings to PCRE2."
66
documentation = "https://docs.rs/pcre2-sys"
7-
homepage = "https://github.com/BurntSushi/rust-pcre2"
8-
repository = "https://github.com/BurntSushi/rust-pcre2"
7+
homepage = "https://github.com/fish-shell/rust-pcre2"
8+
repository = "https://github.com/fish-shell/rust-pcre2"
99
readme = "README.md"
1010
keywords = ["pcre", "pcre2", "regex", "jit"]
11-
license = "Unlicense/MIT"
11+
license = "Unlicense OR MIT"
1212
categories = ["external-ffi-bindings"]
13-
edition = "2018"
14-
15-
[features]
16-
default = ["utf8"]
17-
utf8 = []
18-
utf32 = []
19-
13+
edition = "2021"
2014

2115
[dependencies]
22-
libc = "0.2"
16+
libc = "0.2.146"
2317

2418
[build-dependencies]
25-
cc = { version = "1", features = ["parallel"] }
26-
pkg-config = "0.3.13"
19+
cc = { version = "1.0.73", features = ["parallel"] }
20+
pkg-config = "0.3.27"
21+
22+
[features]
23+
utf32 = []
24+
jit = []

pcre2-sys/README.md

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,8 @@ pcre2-sys
22
=========
33
Bindings for [PCRE2](https://www.pcre.org/).
44

5-
[![Linux build status](https://api.travis-ci.org/BurntSushi/rust-pcre2.png)](https://travis-ci.org/BurntSushi/rust-pcre2)
6-
[![Windows build status](https://ci.appveyor.com/api/projects/status/github/BurntSushi/rust-pcre2?svg=true)](https://ci.appveyor.com/project/BurntSushi/rust-pcre2)
7-
[![](https://meritbadge.herokuapp.com/pcre2-sys)](https://crates.io/crates/pcre2-sys)
5+
[![Build status](https://github.com/BurntSushi/rust-pcre2/workflows/ci/badge.svg)](https://github.com/BurntSushi/rust-pcre2/actions)
6+
[![crates.io](https://img.shields.io/crates/v/pcre2-sys.svg)](https://crates.io/crates/pcre2-sys)
87

98
Dual-licensed under MIT or the [UNLICENSE](https://unlicense.org/).
109

@@ -16,18 +15,7 @@ https://docs.rs/pcre2-sys
1615

1716
### Usage
1817

19-
Add this to your `Cargo.toml`:
20-
21-
```toml
22-
[dependencies]
23-
pcre2-sys = "0.2"
24-
```
25-
26-
and this to your crate root:
27-
28-
```rust
29-
extern crate pcre2_sys;
30-
```
18+
Run `cargo add pcre2-sys` to add this crate to your `Cargo.toml` file.
3119

3220

3321
### Notes
@@ -36,7 +24,7 @@ As a `-sys` crate, this exposes only the bindings to PCRE2 based on the header
3624
file. The PCRE2 documentation itself should be consulted in order to use this
3725
crate.
3826

39-
The bindings for this crate were generated for PCRE **10.31**. This crate
27+
The bindings for this crate were generated for PCRE **10.42**. This crate
4028
intends to track the current release of PCRE2.
4129

4230
The build script for this crate prefers dynamically linking with the host's
@@ -56,7 +44,7 @@ may work, and PRs to support them are welcome.
5644

5745
If you're compiling this crate on Windows with the GNU toolchain, then you'll
5846
need to make sure you have a compatible C compiler installed, such as the one
59-
provided by the [mingw-w64](http://mingw-w64.org) project.
47+
provided by the [MinGW-w64](https://www.mingw-w64.org/) project.
6048

6149
Set the `PCRE2_SYS_DEBUG` flag to forcefully enable debug symbols when doing a
6250
static build, even when compiling in release mode.

0 commit comments

Comments
 (0)