Skip to content

Commit 2cec1b3

Browse files
authored
v8.0.0 (#1797)
1 parent 7afe3a8 commit 2cec1b3

File tree

5 files changed

+74
-11
lines changed

5 files changed

+74
-11
lines changed

.github/workflows/codspeed.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
run: cargo codspeed build -p benchmarks
2727

2828
- name: Run the benchmarks
29-
uses: CodSpeedHQ/action@v2
29+
uses: CodSpeedHQ/action@v3
3030
with:
3131
run: cargo codspeed run -p benchmarks
3232
token: ${{ secrets.CODSPEED_TOKEN }}

CHANGELOG.md

+65-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,75 @@
11
# Change Log
22

3-
## [Unreleased][unreleased]
3+
## 8.0.0 2025-01-25
4+
5+
This versions represents a significant refactoring of nom to reduce the amount of code generated by prsers, and reduce the API surface. As such, it comes with some breaking changes, mostly around the move from closure based combinators to trait based ones. In practice, it means that instead of writing `combinator(arg)(input)`, we now write `combinator(arg).parse(input)`.
6+
7+
This release also marks th introduction of the [nom-language](https://crates.io/crates/nom-language) crate, which will hold tools more focused on language parsing than the rest of nom, like the `VerboseError` type and the newly added precedence parsing combinators.
48

59
### Thanks
610

11+
- @cky
12+
- @5c077m4n
13+
- @epage
14+
- @Fumon
15+
- @jtracey
16+
- @OliveIsAWord
17+
- @Xiretza
18+
- @flier
19+
- @cenodis
20+
- @Shadow53
21+
- @@jmmaa
22+
- @terror
23+
- @zanedp
24+
- @atouchet
25+
- @CMDJojo
26+
- @ackxolotl
27+
- @xmakro
28+
- @tfpk
29+
- @WhyNotHugo
30+
- @brollb
31+
- @smheidrich
32+
- @glittershark
33+
- @GuillaumeGomez
34+
- @LeoDog896
35+
- @fmiras
36+
- @ttsugriy
37+
- @McDostone
38+
- @superboum
39+
- @rruppy
40+
- @thssuck
41+
- @Chasing1020
42+
- @thatmarkenglishguy
43+
- @ambiso
44+
- @boxdot
45+
- @krtab
46+
- @code10129
47+
- @manunio
48+
- @stuarth
49+
- @mindeng
50+
- @JonathanPlasse
51+
- @nabilwadih
52+
- @phoenixr-codes
53+
- @gdennie
54+
- @art049
55+
- @kstrohbeck
56+
57+
### Added
58+
59+
- `Parser::map_res`
60+
- `Parser::map_opt`
61+
- `many` and `fold` combinators using ranges
62+
- `many` can collect into other types than `Vec`
63+
- `Error` and `VerboseError` can be converted to owned versions
64+
765
### Removed
866

967
- `nom::bits::*` is no longer re-exported at the crate root. This export caused frequent confusion, since e.g. `nom::complete::tag` referred to `nom::bits::complete::tag` instead of the much more commonly used `nom::bytes::complete::tag`. To migrate, change any imports of `nom::{complete::*, streaming::*, bits, bytes}` to `nom::bits::[...]`.
68+
- `parse` combinator
69+
- `InputIter`, `InputTakeAtPosition`, `InputLength`, `InputTake` and `Slice` are now merged in the `Input` trait
1070

1171
### Changed
72+
- `Parser::map` and `Parser::flat_map` now take a `FnMut` as argument
1273

1374
## 7.1.2 - 2023-01-01
1475

@@ -1479,7 +1540,9 @@ Considering the number of changes since the last release, this version can conta
14791540

14801541
## Compare code
14811542

1482-
* [unreleased](https://github.com/rust-bakery/nom/compare/7.1.2...HEAD)
1543+
* [unreleased](https://github.com/rust-bakery/nom/compare/8.0.0...HEAD)
1544+
* [8.0.0](https://github.com/rust-bakery/nom/compare/7.1.3...8.0.0)
1545+
* [7.1.3](https://github.com/rust-bakery/nom/compare/7.1.2...7.1.3)
14831546
* [7.1.2](https://github.com/rust-bakery/nom/compare/7.1.1...7.1.2)
14841547
* [7.1.1](https://github.com/rust-bakery/nom/compare/7.1.0...7.1.1)
14851548
* [7.1.0](https://github.com/rust-bakery/nom/compare/7.0.0...7.1.0)

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "nom"
4-
version = "8.0.0-beta.1"
4+
version = "8.0.0"
55
authors = ["[email protected]"]
66
description = "A byte-oriented, zero-copy, parser combinators library"
77
license = "MIT"

nom-language/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
22
name = "nom-language"
3-
version = "0.1.0-alpha.1"
3+
version = "0.1.0"
44
authors = ["[email protected]"]
55
description = "Language parsing focused combinators for the nom parser library"
66
edition = "2021"
77
license = "MIT"
88
repository = "https://github.com/rust-bakery/nom"
99

1010
[dependencies]
11-
nom = { path = "..", version = "8.0.0-beta.1" }
11+
nom = { path = "..", version = "8.0.0" }

nom-language/src/precedence/mod.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ where
370370

371371
/// Applies a parser multiple times separated by another parser.
372372
///
373-
/// It is similar to [`separated_list1`][crate::multi::separated_list1] but instead of collecting
373+
/// It is similar to [`separated_list1`][nom::multi::separated_list1] but instead of collecting
374374
/// into a vector, you have a callback to build the output.
375375
///
376376
/// In a LALR grammar a left recursive operator is usually built with a rule syntax such as:
377377
/// * A := A op B | B
378378
///
379-
/// If you try to parse that wth [`alt`][crate::branch::alt] it will fail with a stack overflow
379+
/// If you try to parse that wth [`alt`][nom::branch::alt] it will fail with a stack overflow
380380
/// because the recusion is unlimited. This function solves this problem by converting the recusion
381381
/// into an iteration.
382382
///
@@ -387,8 +387,8 @@ where
387387
///
388388
/// That can be written in `nom` trivially.
389389
///
390-
/// This stops when either parser returns [`err::error`] and returns the last built value. to instead chain an error up, see
391-
/// [`cut`][crate::combinator::cut].
390+
/// This stops when either parser returns an error and returns the last built value. to instead chain an error up, see
391+
/// [`cut`][nom::combinator::cut].
392392
///
393393
/// # Arguments
394394
/// * `child` The parser to apply.
@@ -442,7 +442,7 @@ where
442442
}
443443
}
444444

445-
/// Parser implementation for the [separated_list1] combinator
445+
/// Parser implementation for the [`separated_list1`][nom::multi::separated_list1] combinator
446446
pub struct LeftAssoc<F, G, B> {
447447
child: F,
448448
operator: G,

0 commit comments

Comments
 (0)