Skip to content

Commit

Permalink
Merge branch 'main' into feature/memmem
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed May 5, 2024
2 parents 3de6704 + 83cfb17 commit 8a9579a
Show file tree
Hide file tree
Showing 80 changed files with 10,398 additions and 4,340 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @Geal
12 changes: 6 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@ Please provide the following information with this pull request:
- related issue number (I need some context to understand a PR with a lot of
code, except for documentation typos)
- a test case reproducing the issue. You can write it in [issues.rs](https://github.com/Geal/nom/blob/master/tests/issues.rs)
- a test case reproducing the issue. You can write it in [issues.rs](https://github.com/rust-bakery/nom/blob/main/tests/issues.rs)
- if adding a new combinator, please add code documentation and some unit tests
in the same file. Also, please update the [combinator list](https://github.com/Geal/nom/blob/master/doc/choosing_a_combinator.md)
in the same file. Also, please update the [combinator list](https://github.com/rust-bakery/nom/blob/main/doc/choosing_a_combinator.md)
## Code style
This project follows a [code style](https://github.com/Geal/nom/blob/master/rustfmt.toml)
checked by [rustfmt][https://github.com/rust-lang-nursery/rustfmt].
This project follows a [code style](https://github.com/rust-bakery/nom/blob/main/rustfmt.toml)
checked by [rustfmt](https://github.com/rust-lang/rustfmt).
Please avoid cosmetic fixes unrelated to the pull request. Keeping the changes
as small as possible increase your chances of getting this merged quickly.
## Rebasing
To make sure the changes will work properly once merged into the master branch
To make sure the changes will work properly once merged into the main branch
(which might have changed while you were working on your PR), please
[rebase your PR on master](https://git-scm.com/book/en/v2/Git-Branching-Rebasing).
[rebase your PR on main](https://git-scm.com/book/en/v2/Git-Branching-Rebasing).
## Squashing the commits
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on: [push, pull_request]

env:
RUST_MINVERSION: 1.41.1
RUST_MINVERSION: 1.65.0
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10

Expand All @@ -18,7 +18,7 @@ jobs:
- stable
- beta
- nightly
- 1.48.0
- 1.65.0

features:
- ''
Expand Down Expand Up @@ -190,9 +190,10 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: tarpaulin
args: --output-dir coverage --out Lcov
args: --output-dir coverage --out xml --workspace --exclude benchmarks

- name: Publish to Coveralls
uses: coverallsapp/github-action@master
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4.0.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }}
slug: rust-bakery/nom
26 changes: 26 additions & 0 deletions .github/workflows/cifuzz.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: CIFuzz
on: [pull_request]
jobs:
Fuzzing:
runs-on: ubuntu-latest
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'nom'
dry-run: false
language: rust
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'nom'
fuzz-seconds: 300
dry-run: false
language: rust
- name: Upload Crash
uses: actions/upload-artifact@v3
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
32 changes: 32 additions & 0 deletions .github/workflows/codspeed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: codspeed-benchmarks

on:
push:
branches:
- "main"
pull_request:
# `workflow_dispatch` allows CodSpeed to trigger backtest
# performance analysis in order to generate initial data.
workflow_dispatch:

jobs:
benchmarks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Setup rust toolchain, cache and cargo-codspeed binary
uses: moonrepo/setup-rust@v0
with:
channel: stable
cache-target: release
bins: cargo-codspeed

- name: Build the benchmark target(s)
run: cargo codspeed build -p benchmarks

- name: Run the benchmarks
uses: CodSpeedHQ/action@v2
with:
run: cargo codspeed run -p benchmarks
token: ${{ secrets.CODSPEED_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ realworld/
src/generator.rs
.DS_Store
private-docs/
.idea/
218 changes: 156 additions & 62 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,99 @@

### Thanks

### Removed

- `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::[...]`.

### Changed

## 7.1.2 - 2023-01-01

### Thanks

- @joubs
- @Fyko
- @LoganDark
- @darnuria
- @jkugelman
- @barower
- @puzzlewolf
- @epage
- @cky
- @wolthom
- @w1ll-i-code

### Changed

- documentation fixes
- tests fixes
- limit the initial capacity of the result vector of `many_m_n` to 64kiB
- bits parser now accept `Parser` implementors instead of only functions

### Added

- implement `Tuple` parsing for the unit type as a special case
- implement `ErrorConvert` on the unit type to make it usable as error type for bits parsers
- bool parser for bits input

## 7.1.1 - 2022-03-14

### Thanks

- @ThomasdenH
- @@SphinxKnight
- @irevoire
- @doehyunbaek
- @pxeger
- @punkeel
- @max-sixty
- @Xiretza
- @5c077m4n
- @erihsu
- @TheNeikos
- @LoganDark
- @nickelc
- @chotchki
- @ctrlcctrlv


### Changed

- documentation fixes
- more examples

## 7.1.0 - 2021-11-04

### Thanks

- @nickelc
- @Stargateur
- @NilsIrl
- @clonejo
- @Strytyp
- @schubart
- @jihchi
- @nipunn1313
- @Gungy2
- @Drumato
- @Alexhuszagh
- @Aehmlo
- @homersimpsons
- @dne
- @epage
- @saiintbrisson
- @pymongo

### Changed

- documentation fixes
- Ci fixes
- the move to minimal-lexical for float parsing introduced bugs that cannot be resolved right now, so this version moves back to using the standard lib' parser. *This is a performance regression**. If you have specific requirements around float parsing, you are strongly encouraged to use [recognize_float](https://docs.rs/nom/latest/nom/number/complete/fn.recognize_float.html) and another library to convert to a f32 or f64

### Added

- alt now works with 1 elment tuples

## 7.0.0 - 2021-08-21

This release fixes dependency compilation issues and strengthen the minimum supported Rust version (MSRV) policy. This is also the first release without the macros that were used since nom's beginning.
Expand Down Expand Up @@ -819,7 +910,7 @@ Bugfix release

The 2.0 release is one of the biggest yet. It was a good opportunity to clean up some badly named combinators and fix invalid behaviours.

Since this version introduces a few breaking changes, an [upgrade documentation](https://github.com/Geal/nom/blob/master/doc/upgrading_to_nom_2.md) is available, detailing the steps to fix the most common migration issues. After testing on a set of 30 crates, most of them will build directly, a large part will just need to activate the "verbose-errors" compilation feature. The remaining fixes are documented.
Since this version introduces a few breaking changes, an [upgrade documentation](https://github.com/rust-bakery/nom/blob/main/doc/archive/upgrading_to_nom_2.md) is available, detailing the steps to fix the most common migration issues. After testing on a set of 30 crates, most of them will build directly, a large part will just need to activate the "verbose-errors" compilation feature. The remaining fixes are documented.

This version also adds a lot of interesting features, like the permutation combinator or whitespace separated formats support.

Expand Down Expand Up @@ -1334,7 +1425,7 @@ Considering the number of changes since the last release, this version can conta
### Added
- `peek!` macro: matches the future input but does not consume it
- `length_value!` macro: the first argument is a parser returning a `n` that can cast to usize, then applies the second parser `n` times. The macro has a variant with a third argument indicating the expected input size for the second parser
- benchmarks are available at https://github.com/Geal/nom_benchmarks
- benchmarks are available at https://github.com/rust-bakery/parser_benchmarks
- more documentation
- **Unnamed parser syntax**: warning, this is a breaking change. With this new syntax, the macro combinators do not generate functions anymore, they create blocks. That way, they can be nested, for better readability. The `named!` macro is provided to create functions from parsers. Please be aware that nesting parsers comes with a small cost of compilation time, negligible in most cases, but can quickly get to the minutes scale if not careful. If this happens, separate your parsers in multiple subfunctions.
- `named!`, `closure!` and `call!` macros used to support the unnamed syntax
Expand Down Expand Up @@ -1388,63 +1479,66 @@ Considering the number of changes since the last release, this version can conta

## Compare code

* [unreleased](https://github.com/Geal/nom/compare/7.0.0...HEAD)
* [7.0.0](https://github.com/Geal/nom/compare/6.2.1...7.0.0)
* [6.2.1](https://github.com/Geal/nom/compare/6.2.0...6.2.1)
* [6.2.0](https://github.com/Geal/nom/compare/6.1.2...6.2.0)
* [6.1.2](https://github.com/Geal/nom/compare/6.1.1...6.1.2)
* [6.1.1](https://github.com/Geal/nom/compare/6.1.0...6.1.1)
* [6.1.0](https://github.com/Geal/nom/compare/6.0.1...6.1.0)
* [6.0.1](https://github.com/Geal/nom/compare/6.0.0...6.0.1)
* [6.0.0](https://github.com/Geal/nom/compare/5.1.1...6.0.0)
* [5.1.1](https://github.com/Geal/nom/compare/5.1.0...5.1.1)
* [5.1.0](https://github.com/Geal/nom/compare/5.0.1...5.1.0)
* [5.0.1](https://github.com/Geal/nom/compare/5.0.0...5.0.1)
* [5.0.0](https://github.com/Geal/nom/compare/4.2.3...5.0.0)
* [4.2.3](https://github.com/Geal/nom/compare/4.2.2...4.2.3)
* [4.2.2](https://github.com/Geal/nom/compare/4.2.1...4.2.2)
* [4.2.1](https://github.com/Geal/nom/compare/4.2.0...4.2.1)
* [4.2.0](https://github.com/Geal/nom/compare/4.1.1...4.2.0)
* [4.1.1](https://github.com/Geal/nom/compare/4.1.0...4.1.1)
* [4.1.0](https://github.com/Geal/nom/compare/4.0.0...4.1.0)
* [4.0.0](https://github.com/Geal/nom/compare/3.2.1...4.0.0)
* [3.2.1](https://github.com/Geal/nom/compare/3.2.0...3.2.1)
* [3.2.0](https://github.com/Geal/nom/compare/3.1.0...3.2.0)
* [3.1.0](https://github.com/Geal/nom/compare/3.0.0...3.1.0)
* [3.0.0](https://github.com/Geal/nom/compare/2.2.1...3.0.0)
* [2.2.1](https://github.com/Geal/nom/compare/2.2.0...2.2.1)
* [2.2.0](https://github.com/Geal/nom/compare/2.1.0...2.2.0)
* [2.1.0](https://github.com/Geal/nom/compare/2.0.1...2.1.0)
* [2.0.1](https://github.com/Geal/nom/compare/2.0.0...2.0.1)
* [2.0.0](https://github.com/Geal/nom/compare/1.2.4...2.0.0)
* [1.2.4](https://github.com/Geal/nom/compare/1.2.3...1.2.4)
* [1.2.3](https://github.com/Geal/nom/compare/1.2.2...1.2.3)
* [1.2.2](https://github.com/Geal/nom/compare/1.2.1...1.2.2)
* [1.2.1](https://github.com/Geal/nom/compare/1.2.0...1.2.1)
* [1.2.0](https://github.com/Geal/nom/compare/1.1.0...1.2.0)
* [1.1.0](https://github.com/Geal/nom/compare/1.0.1...1.1.0)
* [1.0.1](https://github.com/Geal/nom/compare/1.0.0...1.0.1)
* [1.0.0](https://github.com/Geal/nom/compare/0.5.0...1.0.0)
* [0.5.0](https://github.com/geal/nom/compare/0.4.0...0.5.0)
* [0.4.0](https://github.com/geal/nom/compare/0.3.11...0.4.0)
* [0.3.11](https://github.com/geal/nom/compare/0.3.10...0.3.11)
* [0.3.10](https://github.com/geal/nom/compare/0.3.9...0.3.10)
* [0.3.9](https://github.com/geal/nom/compare/0.3.8...0.3.9)
* [0.3.8](https://github.com/Geal/nom/compare/0.3.7...0.3.8)
* [0.3.7](https://github.com/Geal/nom/compare/0.3.6...0.3.7)
* [0.3.6](https://github.com/Geal/nom/compare/0.3.5...0.3.6)
* [0.3.5](https://github.com/Geal/nom/compare/0.3.4...0.3.5)
* [0.3.4](https://github.com/Geal/nom/compare/0.3.3...0.3.4)
* [0.3.3](https://github.com/Geal/nom/compare/0.3.2...0.3.3)
* [0.3.2](https://github.com/Geal/nom/compare/0.3.1...0.3.2)
* [0.3.1](https://github.com/Geal/nom/compare/0.3.0...0.3.1)
* [0.3.0](https://github.com/Geal/nom/compare/0.2.2...0.3.0)
* [0.2.2](https://github.com/Geal/nom/compare/0.2.1...0.2.2)
* [0.2.1](https://github.com/Geal/nom/compare/0.2.0...0.2.1)
* [0.2.0](https://github.com/Geal/nom/compare/0.1.6...0.2.0)
* [0.1.6](https://github.com/Geal/nom/compare/0.1.5...0.1.6)
* [0.1.5](https://github.com/Geal/nom/compare/0.1.4...0.1.5)
* [0.1.4](https://github.com/Geal/nom/compare/0.1.3...0.1.4)
* [0.1.3](https://github.com/Geal/nom/compare/0.1.2...0.1.3)
* [0.1.2](https://github.com/Geal/nom/compare/0.1.1...0.1.2)
* [0.1.1](https://github.com/Geal/nom/compare/0.1.0...0.1.1)
* [unreleased](https://github.com/rust-bakery/nom/compare/7.1.2...HEAD)
* [7.1.2](https://github.com/rust-bakery/nom/compare/7.1.1...7.1.2)
* [7.1.1](https://github.com/rust-bakery/nom/compare/7.1.0...7.1.1)
* [7.1.0](https://github.com/rust-bakery/nom/compare/7.0.0...7.1.0)
* [7.0.0](https://github.com/rust-bakery/nom/compare/6.2.1...7.0.0)
* [6.2.1](https://github.com/rust-bakery/nom/compare/6.2.0...6.2.1)
* [6.2.0](https://github.com/rust-bakery/nom/compare/6.1.2...6.2.0)
* [6.1.2](https://github.com/rust-bakery/nom/compare/6.1.1...6.1.2)
* [6.1.1](https://github.com/rust-bakery/nom/compare/6.1.0...6.1.1)
* [6.1.0](https://github.com/rust-bakery/nom/compare/6.0.1...6.1.0)
* [6.0.1](https://github.com/rust-bakery/nom/compare/6.0.0...6.0.1)
* [6.0.0](https://github.com/rust-bakery/nom/compare/5.1.1...6.0.0)
* [5.1.1](https://github.com/rust-bakery/nom/compare/5.1.0...5.1.1)
* [5.1.0](https://github.com/rust-bakery/nom/compare/5.0.1...5.1.0)
* [5.0.1](https://github.com/rust-bakery/nom/compare/5.0.0...5.0.1)
* [5.0.0](https://github.com/rust-bakery/nom/compare/4.2.3...5.0.0)
* [4.2.3](https://github.com/rust-bakery/nom/compare/4.2.2...4.2.3)
* [4.2.2](https://github.com/rust-bakery/nom/compare/4.2.1...4.2.2)
* [4.2.1](https://github.com/rust-bakery/nom/compare/4.2.0...4.2.1)
* [4.2.0](https://github.com/rust-bakery/nom/compare/4.1.1...4.2.0)
* [4.1.1](https://github.com/rust-bakery/nom/compare/4.1.0...4.1.1)
* [4.1.0](https://github.com/rust-bakery/nom/compare/4.0.0...4.1.0)
* [4.0.0](https://github.com/rust-bakery/nom/compare/3.2.1...4.0.0)
* [3.2.1](https://github.com/rust-bakery/nom/compare/3.2.0...3.2.1)
* [3.2.0](https://github.com/rust-bakery/nom/compare/3.1.0...3.2.0)
* [3.1.0](https://github.com/rust-bakery/nom/compare/3.0.0...3.1.0)
* [3.0.0](https://github.com/rust-bakery/nom/compare/2.2.1...3.0.0)
* [2.2.1](https://github.com/rust-bakery/nom/compare/2.2.0...2.2.1)
* [2.2.0](https://github.com/rust-bakery/nom/compare/2.1.0...2.2.0)
* [2.1.0](https://github.com/rust-bakery/nom/compare/2.0.1...2.1.0)
* [2.0.1](https://github.com/rust-bakery/nom/compare/2.0.0...2.0.1)
* [2.0.0](https://github.com/rust-bakery/nom/compare/1.2.4...2.0.0)
* [1.2.4](https://github.com/rust-bakery/nom/compare/1.2.3...1.2.4)
* [1.2.3](https://github.com/rust-bakery/nom/compare/1.2.2...1.2.3)
* [1.2.2](https://github.com/rust-bakery/nom/compare/1.2.1...1.2.2)
* [1.2.1](https://github.com/rust-bakery/nom/compare/1.2.0...1.2.1)
* [1.2.0](https://github.com/rust-bakery/nom/compare/1.1.0...1.2.0)
* [1.1.0](https://github.com/rust-bakery/nom/compare/1.0.1...1.1.0)
* [1.0.1](https://github.com/rust-bakery/nom/compare/1.0.0...1.0.1)
* [1.0.0](https://github.com/rust-bakery/nom/compare/0.5.0...1.0.0)
* [0.5.0](https://github.com/rust-bakery/nom/compare/0.4.0...0.5.0)
* [0.4.0](https://github.com/rust-bakery/nom/compare/0.3.11...0.4.0)
* [0.3.11](https://github.com/rust-bakery/nom/compare/0.3.10...0.3.11)
* [0.3.10](https://github.com/rust-bakery/nom/compare/0.3.9...0.3.10)
* [0.3.9](https://github.com/rust-bakery/nom/compare/0.3.8...0.3.9)
* [0.3.8](https://github.com/rust-bakery/nom/compare/0.3.7...0.3.8)
* [0.3.7](https://github.com/rust-bakery/nom/compare/0.3.6...0.3.7)
* [0.3.6](https://github.com/rust-bakery/nom/compare/0.3.5...0.3.6)
* [0.3.5](https://github.com/rust-bakery/nom/compare/0.3.4...0.3.5)
* [0.3.4](https://github.com/rust-bakery/nom/compare/0.3.3...0.3.4)
* [0.3.3](https://github.com/rust-bakery/nom/compare/0.3.2...0.3.3)
* [0.3.2](https://github.com/rust-bakery/nom/compare/0.3.1...0.3.2)
* [0.3.1](https://github.com/rust-bakery/nom/compare/0.3.0...0.3.1)
* [0.3.0](https://github.com/rust-bakery/nom/compare/0.2.2...0.3.0)
* [0.2.2](https://github.com/rust-bakery/nom/compare/0.2.1...0.2.2)
* [0.2.1](https://github.com/rust-bakery/nom/compare/0.2.0...0.2.1)
* [0.2.0](https://github.com/rust-bakery/nom/compare/0.1.6...0.2.0)
* [0.1.6](https://github.com/rust-bakery/nom/compare/0.1.5...0.1.6)
* [0.1.5](https://github.com/rust-bakery/nom/compare/0.1.4...0.1.5)
* [0.1.4](https://github.com/rust-bakery/nom/compare/0.1.3...0.1.4)
* [0.1.3](https://github.com/rust-bakery/nom/compare/0.1.2...0.1.3)
* [0.1.2](https://github.com/rust-bakery/nom/compare/0.1.1...0.1.2)
* [0.1.1](https://github.com/rust-bakery/nom/compare/0.1.0...0.1.1)
Loading

0 comments on commit 8a9579a

Please sign in to comment.