Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,18 @@ jobs:
- name: cargo test (no default features)
run: cargo test --no-default-features --locked

- name: cargo test ("assertions")
run: cargo test --no-default-features --features assertions --locked

- name: cargo test ("lookup-ranges")
run: cargo test --no-default-features --features lookup-ranges --locked

- name: cargo test ("test-regex")
run: cargo test --no-default-features --features test-regex --locked

- name: cargo test ("full")
run: cargo test --no-default-features --features full --locked

- name: cargo clippy
run: cargo clippy --all-targets --locked -- -D warnings

Expand Down
12 changes: 11 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
# shwild.Rust - CHANGES <!-- omit in toc -->


## 0.1.6 - 10th July 2026
## 0.2.0 - 10th July 2026

* added `assert_shwild_matches!()` and `assert_shwild_not_matches!()` test assertion macros, available with the `"assertions"` feature (enabled by default);
* added `"flexible-flags-type"` feature — optional [**base-traits**](https://github.com/synesissoftware/base-traits) dependency (`implement-AsI64-for-built_ins`) allowing macro `flags` parameters to be any type implementing `AsI64`; when disabled, `flags` must be `i64`;
* `"assertions"` no longer implies **base-traits**; use `"full"` to enable assertions, flexible flags, and lookup ranges together;
* extended `shwild_matches!()` 3-parameter form with the same flexible-`flags` behaviour;
* crate-level and macro `///` documentation for the assertion macros;
* **README.md** macros and dependencies sections updated;


## 0.1.6 - 9th July 2026

* preparatory changes;
* consistency fixes;
Expand Down
3 changes: 2 additions & 1 deletion Cargo.lock

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

21 changes: 20 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ name = "shwild"
readme = "README.md"
repository = "https://github.com/synesissoftware/shwild.Rust"
rust-version = "1.79"
version = "0.1.6"
version = "0.2.0"


# ##########################################################
Expand Down Expand Up @@ -87,6 +87,13 @@ path = "examples/list-matching-files-compiled/main.rs"
[features]

default = [
"assertions",
"lookup-ranges",
]

full = [
"assertions",
"flexible-flags-type",
"lookup-ranges",
]

Expand All @@ -101,9 +108,18 @@ null-feature = []

# Crate-specific features:
#
# - "assertions" - enable assertions;
# - "flexible-flags-type" - allows flags parameters to be any type for which `base_traits::I64` is implemented;
# - "lookup-ranges" - enable lookup ranges;
# - "test-regex" - enable test regex;

assertions = [
]

flexible-flags-type = [
"dep:base-traits",
]

lookup-ranges = [
"dep:collect-rs",
]
Expand All @@ -118,6 +134,9 @@ test-regex = [

[dependencies]

base-traits = { version = "0", optional = true, default-features = false, features = [
"implement-AsI64-for-built_ins",
]}
collect-rs = { version = "0.2", optional = true, default-features = false, features = [
]}
regex = { version = "1.11", optional = true, default-features = false, features = [
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Date | News Item |
| --------------------- | ----------------------------------------- |
| 10th July 2026 | shwild.Rust 0.2.0 released |
| 9th July 2026 | shwild.Rust 0.1.6 released |
| 9th July 2026 | shwild.Rust 0.1.5 released |
| 7th July 2026 | shwild.Rust 0.1.4 released |
Expand Down
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ The library (and other **shwild** variants) support the following pattern elemen
Reference in **Cargo.toml** in the usual way:

```toml
shwild = { version = "0.1" }
shwild = { version = "0.2" }
```


Expand Down Expand Up @@ -108,6 +108,7 @@ The following crate features are defined:

| Name | Effect | Is `"default"`? | Dependent feature(s) |
| --------------------------- | ------------------------------------- | --------------- | ------------------------------------- |
| `"assertions"` | Provides `assert_shwild_matches!()` and `assert_shwild_not_matches!()` test assertion macros (via **base-traits** `AsI64`) | Yes | |
| `"lookup-ranges"` | Causes match/non-match ranges to be implemented in terms of `UnicodePointMap` (from **collect-rs** crate), resulting in significant performance improvements in parsing and matching | Yes | |
| `"null-feature"` | A feature that has no effect (and, thus, is useful for simplifying driver scripts) | **No** | |
| `"test-regex"` | Introduces a dependency to **regex** crate to support benchmark/example program(s) | **No** | |
Expand All @@ -133,6 +134,20 @@ pub mod shwild {

The `shwild::shwild_matches!()` macro is a shorthand for the `shwild::matches()` function, providing 2-parameter and 3-parameter forms. The 2-parameter form passes 0 for the `flags` parameter.

The `shwild::assert_shwild_matches!()` and `shwild::assert_shwild_not_matches!()` macros are test-oriented counterparts that panic on failure. Each provides 2-parameter and 3-parameter forms; the 2-parameter form passes 0 for the `flags` parameter. A parse error in the pattern panics with a descriptive message rather than returning `Err`. They are provided only when the feature `"assertions"` is enabled, which it is by default.

```Rust
use shwild::{
assert_shwild_matches,
assert_shwild_not_matches,
IGNORE_CASE,
};

assert_shwild_matches!("[a-d]", "b");
assert_shwild_not_matches!("[a-d]", "e");
assert_shwild_matches!("[a-d]", "B", IGNORE_CASE);
```


### Structures

Expand Down Expand Up @@ -190,9 +205,10 @@ Defect reports, feature requests, and pull requests are welcome on https://githu

### Dependencies

**shwild.Rust** has two dependencies, both optional:
**shwild.Rust** has three optional dependencies:

* [**collect-rs**](https://github.com/synesissoftware/collect-rs) - required, for more efficient range matching, if feature `"lookup-ranges"` is specified;
* [**base-traits**](https://github.com/synesissoftware/base-traits) - required if feature `"assertions"` is specified; supports the `flags` parameter type in `assert_shwild_matches!()` and `assert_shwild_not_matches!()` via `AsI64`;
* [**collect-rs**](https://github.com/synesissoftware/collect-rs) - required if feature `"lookup-ranges"` is specified, for more efficient range matching;
* [**regex**](https://github.com/rust-lang/regex) - required, by some benchmark/example programs only, if feature `"test-regex"` is specified;


Expand All @@ -208,6 +224,7 @@ Crates upon which **shwild** has development dependencies:

* [**shwild**](https://github.com/synesissoftware/shwild/);
* [**shwild.Go**](https://github.com/synesissoftware/shwild.Go/);
* [**base-traits**](https://github.com/synesissoftware/base-traits/);
* [**collect-rs**](https://github.com/synesissoftware/collect-rs/);


Expand Down
3 changes: 2 additions & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ Proposed module layout:

```
src/
lib.rs # crate docs, re-exports, matches(), shwild_matches! macro;
lib.rs # crate docs, re-exports, matches(), shwild_matches!,
# assert_shwild_matches!/assert_shwild_not_matches!;
# #[cfg(test)] API unit tests (stay here)
constants.rs # IGNORE_CASE
error.rs # Error + Display/Error trait impls
Expand Down
Loading
Loading