Skip to content

Commit

Permalink
Merge branch 'main' into kompass-impl_parser_for_tuples
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Jan 2, 2023
2 parents 8e94fbb + f08b5e2 commit 5ac83e5
Show file tree
Hide file tree
Showing 63 changed files with 1,416 additions and 1,150 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
10 changes: 5 additions & 5 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/Geal/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/Geal/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)
This project follows a [code style](https://github.com/Geal/nom/blob/main/rustfmt.toml)
checked by [rustfmt][https://github.com/rust-lang-nursery/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
22 changes: 12 additions & 10 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.56.0
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10

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

features:
- ''
Expand Down Expand Up @@ -135,10 +135,9 @@ jobs:
override: true

- name: Build
uses: actions-rs/cargo@v1
with:
command: doc
args: --verbose --features "std docsrs"
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --document-private-items --workspace --verbose --features "std docsrs"

fmt:
name: Check formatting
Expand Down Expand Up @@ -185,12 +184,15 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: install
args: cargo-tarpaulin --version 0.18.0-alpha3 # @TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
args: cargo-tarpaulin

- name: Run cargo tarpaulin
uses: actions-rs/cargo@v1
env:
TOKEN: ${{ secrets.COVERALLS_TOKEN }}
with:
command: tarpaulin
args: --coveralls "$TOKEN" --avoid-cfg-tarpaulin # @TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
args: --output-dir coverage --out Lcov

- name: Publish to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
104 changes: 97 additions & 7 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,93 @@

### 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 @@ -84,7 +171,7 @@ This release was done thanks to the hard work of (by order of appearance in the

- lots of documentation fixes
- relax trait bounds
- workarounds for depenency issues with bitvec and memchr
- workarounds for dependency issues with bitvec and memchr

## 6.1.2 - 2021-02-15

Expand Down Expand Up @@ -245,7 +332,7 @@ containing example patterns.
- removed the deprecated `whitespace` module
- the default error type is now a struct (`nom::error::Error`) instead of a tuple
- the `FromExternalError` allows wrapping the error returned by the function in the `map_res` combinator
- renamed the `dbg!` macro to avoid conficts with `std::dbg!`
- renamed the `dbg!` macro to avoid conflicts with `std::dbg!`
- `separated_list` now allows empty elements


Expand All @@ -256,7 +343,7 @@ containing example patterns.
- `success`: returns a value without consuming the input
- `satisfy`: checks a predicate over the next character
- `eof` function combinator
- `consumed`: returnes the produced value and the consumed input
- `consumed`: returns the produced value and the consumed input
- `length_count` function combinator
- `into`: converts a parser's output and error values if `From` implementations are available
- `IResult::finish()`: converts a parser's result to `Result<(I, O), E>` by removing the distinction between `Error` and `Failure` and panicking on `Incomplete`
Expand Down Expand Up @@ -819,7 +906,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/Geal/nom/blob/main/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.

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

Expand Down Expand Up @@ -1124,7 +1211,7 @@ Considering the number of changes since the last release, this version can conta
## 0.3.11 - 2015-08-04

### Thanks
- @bluss for remarking that the crate included random junk lying non commited in my local repository
- @bluss for remarking that the crate included random junk lying non committed in my local repository

### Fixed
- cleanup of my local repository will ship less files in the crates, resulting in a smaller download
Expand Down Expand Up @@ -1187,7 +1274,7 @@ Considering the number of changes since the last release, this version can conta
### Added
- documentation for a few functions
- the consumer trait now requires the `failed(&self, error_code)` method in case of parsing error
- `named!` now handles thge alternative `named!(pub fun_name<OutputType>, ...)`
- `named!` now handles the alternative `named!(pub fun_name<OutputType>, ...)`

### Fixed
- `filter!` now returns the whole input if the filter function never returned false
Expand Down Expand Up @@ -1388,7 +1475,10 @@ 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)
* [unreleased](https://github.com/Geal/nom/compare/7.1.2...HEAD)
* [7.1.2](https://github.com/Geal/nom/compare/7.1.1...7.1.2)
* [7.1.1](https://github.com/Geal/nom/compare/7.1.0...7.1.1)
* [7.1.0](https://github.com/Geal/nom/compare/7.0.0...7.1.0)
* [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)
Expand Down
67 changes: 21 additions & 46 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]

name = "nom"
version = "7.0.0"
version = "7.1.2"
authors = [ "[email protected]" ]
description = "A byte-oriented, zero-copy, parser combinators library"
license = "MIT"
Expand All @@ -10,9 +10,12 @@ readme = "README.md"
documentation = "https://docs.rs/nom"
keywords = ["parser", "parser-combinators", "parsing", "streaming", "bit"]
categories = ["parsing"]
edition = "2018"
edition = "2021"
autoexamples = false

# also update in README.md (badge and "Rust version requirements" section)
rust-version = "1.56"

include = [
"CHANGELOG.md",
"LICENSE",
Expand All @@ -23,12 +26,11 @@ include = [
"src/*/*.rs",
"tests/*.rs",
"doc/nom_recipes.md",
"build.rs"
]

[features]
alloc = []
std = ["alloc", "memchr/use_std", "minimal-lexical/std"]
std = ["alloc", "memchr/std", "minimal-lexical/std"]
default = ["std"]
docsrs = []

Expand All @@ -37,18 +39,13 @@ version = "0.2.0"
default-features = false

[dependencies.memchr]
version = "2.0"
version = "2.3"
default-features = false

[dev-dependencies]
criterion = "0.3"
jemallocator = "^0.3"
doc-comment = "0.3"
proptest = "1.0.0"

[build-dependencies]
version_check = "0.9"

[package.metadata.docs.rs]
features = ["alloc", "std", "docsrs"]
all-features = true
Expand All @@ -58,19 +55,13 @@ debug = true
lto = true
codegen-units = 1

[lib]
bench = false

[[test]]
name = "arithmetic"

[[test]]
name = "arithmetic_ast"
required-features = ["alloc"]

[[test]]
name = "blockbuf-arithmetic"

[[test]]
name = "css"

Expand Down Expand Up @@ -113,43 +104,24 @@ name = "reborrow_fold"
name = "fnmut"
required-features = ["alloc"]

[[bench]]
name = "arithmetic"
path = "benches/arithmetic.rs"
harness = false

[[bench]]
name = "number"
path = "benches/number.rs"
harness = false

[[bench]]
name = "http"
path = "benches/http.rs"
harness = false

[[bench]]
name = "ini"
path = "benches/ini.rs"
harness = false

[[bench]]
name = "ini_str"
path = "benches/ini_str.rs"
harness = false

[[bench]]
name = "json"
path = "benches/json.rs"
harness = false
[[example]]
name = "custom_error"
required-features = ["alloc"]
path = "examples/custom_error.rs"

[[example]]
name = "json"
required-features = ["alloc"]
path = "examples/json.rs"

[[example]]
name = "json_iterator"
required-features = ["alloc"]
path = "examples/json_iterator.rs"

[[example]]
name = "iterator"
path = "examples/iterator.rs"

[[example]]
name = "s_expression"
Expand All @@ -163,5 +135,8 @@ path = "examples/string.rs"

[badges]
travis-ci = { repository = "Geal/nom" }
coveralls = { repository = "Geal/nom", branch = "master", service = "github" }
coveralls = { repository = "Geal/nom", branch = "main", service = "github" }
maintenance = { status = "actively-developed" }

[workspace]
members = [".", "benchmarks/"]
Loading

0 comments on commit 5ac83e5

Please sign in to comment.