Skip to content

Commit

Permalink
Merge branch 'main' into achalmers/bits-take-example
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed May 5, 2024
2 parents 781e36a + 56b6e54 commit ccecfa7
Show file tree
Hide file tree
Showing 80 changed files with 10,245 additions and 4,350 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/
186 changes: 124 additions & 62 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,67 @@

### 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
Expand Down Expand Up @@ -851,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 @@ -1366,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 @@ -1420,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)
15 changes: 8 additions & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The following is a set of guidelines for contributing to [nom][1].

**Since the project is young**: consider those best practices prone to change. Please suggest improvements!

[1]: https://github.com/geal/nom
[1]: https://github.com/rust-bakery/nom

## Basics

Expand All @@ -15,7 +15,7 @@ The following is a set of guidelines for contributing to [nom][1].
The project uses the [MIT][l1] license. By contributing to this project you agree to license
your changes under this license.

[l1]: https://opensource.org/licenses/MIT
[l1]: https://opensource.org/license/mit/


## What to do
Expand All @@ -25,9 +25,9 @@ your changes under this license.
There is plenty of [features missing][i1] and possibly bugs might be already there. Feel free to add new [issues][i2]
and to wrangle over those already [open][i3] and help fixing them.

[i1]: https://github.com/geal/nom/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement
[i2]: https://github.com/geal/nom/issues
[i3]: https://github.com/geal/nom/issues?q=is%3Aopen+is%3Aissue
[i1]: https://github.com/rust-bakery/nom/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement
[i2]: https://github.com/rust-bakery/nom/issues
[i3]: https://github.com/rust-bakery/nom/issues?q=is%3Aopen+is%3Aissue

### Code

Expand Down Expand Up @@ -61,7 +61,7 @@ If possible provide:
- a backtrace, if it is a crash.
- a sample file, if it is a decoding or encoding issue.

[is1]: https://gist.github.com
[is1]: https://gist.github.com/

### Coding style

Expand All @@ -70,5 +70,6 @@ Readable code is the first step on having good and safe libraries.

To avoid slight differences appearing in nightly versions, please
use the following command to run rustfmt: `cargo +stable fmt`
[cs1]: https://github.com/rust-lang-nursery/rustfmt

[cs1]: https://github.com/rust-lang/rustfmt

0 comments on commit ccecfa7

Please sign in to comment.