| { | ||
| "git": { | ||
| "sha1": "50a71afa1c88e8564e0220a6e0625dd16a2302a2" | ||
| "sha1": "cbc33e72627eac452806240d4bdb948465a4cbe1" | ||
| }, | ||
| "path_in_vcs": "" | ||
| } |
@@ -25,5 +25,24 @@ name: Rust | ||
| - uses: actions/checkout@v2 | ||
| - uses: actions-rs/toolchain@v1 | ||
| with: | ||
| profile: minimal | ||
| toolchain: ${{ matrix.rust }} | ||
| override: true | ||
| - name: Build | ||
| run: cargo build | ||
| - name: Check 1.40 | ||
| if: ${{ matrix.rust == '1.40.0' }} | ||
| run: | | ||
| cargo "$@" check | ||
| cargo "$@" check --no-default-features | ||
| - name: Run tests | ||
| if: ${{ matrix.rust != '1.40.0' }} | ||
| run: ./ci.sh | ||
| - name: Check docs | ||
| if: ${{ matrix.rust == 'stable' }} | ||
| run: cargo doc |
+1
-1
@@ -260,3 +260,3 @@ # This file is automatically @generated by Cargo. | ||
| name = "combine" | ||
| version = "4.6.4" | ||
| version = "4.6.6" | ||
| dependencies = [ | ||
@@ -263,0 +263,0 @@ "async-std", |
+4
-3
@@ -15,3 +15,3 @@ # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO | ||
| name = "combine" | ||
| version = "4.6.4" | ||
| version = "4.6.6" | ||
| authors = ["Markus Westerlind <marwes91@gmail.com>"] | ||
@@ -33,2 +33,3 @@ description = "Fast parser combinators on arbitrary streams with zero-copy support." | ||
| repository = "https://github.com/Marwes/combine" | ||
| resolver = "1" | ||
@@ -113,3 +114,3 @@ [package.metadata.docs.rs] | ||
| [dependencies.memchr] | ||
| version = "2.2" | ||
| version = "2.3" | ||
| default-features = false | ||
@@ -227,3 +228,3 @@ | ||
| std = [ | ||
| "memchr/use_std", | ||
| "memchr/std", | ||
| "bytes", | ||
@@ -230,0 +231,0 @@ "alloc", |
+7
-0
@@ -0,1 +1,8 @@ | ||
| <a name="v4.6.5"></a> | ||
| ### v4.6.5 (2022-08-09) | ||
| * memchr: use non deprecated feature `std` instead of `use_std` | ||
| * refactor: Extract less-generic code from sequence's add_errors (-5%) | ||
| <a name="v4.6.4"></a> | ||
@@ -2,0 +9,0 @@ ### v4.6.4 (2022-04-25) |
+11
-20
| #!/bin/bash -x | ||
| set -ex | ||
| if [[ "$TRAVIS_RUST_VERSION" == "1.40.0" ]]; then | ||
| cargo "$@" check | ||
| cargo "$@" check --no-default-features | ||
| else | ||
| cargo "$@" build | ||
| cargo "$@" test --all-features | ||
| cargo "$@" test --all-features --examples | ||
| cargo "$@" build | ||
| cargo "$@" test --all-features | ||
| cargo "$@" test --all-features --examples | ||
| cargo "$@" test --bench json --bench http -- --test | ||
| cargo "$@" check --bench mp4 --features mp4 | ||
| cargo "$@" build --no-default-features --features alloc | ||
| cargo "$@" test --no-default-features --features alloc --examples | ||
| cargo "$@" test --bench json --bench http -- --test | ||
| cargo "$@" check --bench mp4 --features mp4 | ||
| cargo "$@" build --no-default-features | ||
| cargo "$@" test --no-default-features --examples | ||
| cargo "$@" build --no-default-features --features alloc | ||
| cargo "$@" test --no-default-features --features alloc --examples | ||
| cargo "$@" check --no-default-features --features tokio-02 | ||
| cargo "$@" check --no-default-features --features tokio-03 | ||
| fi | ||
| cargo "$@" build --no-default-features | ||
| cargo "$@" test --no-default-features --examples | ||
| if [[ "$TRAVIS_RUST_VERSION" == "stable" ]]; then | ||
| cargo doc | ||
| fi | ||
| cargo "$@" check --no-default-features --features tokio-02 | ||
| cargo "$@" check --no-default-features --features tokio-03 |
+8
-2
@@ -29,4 +29,2 @@ # combine | ||
| A tutorial as well as explanations on what goes on inside combine can be found in [the wiki](https://github.com/Marwes/combine/wiki). | ||
| Larger examples can be found in the [examples][], [tests][] and [benches][] folders. | ||
@@ -38,2 +36,10 @@ | ||
| ## Tutorial | ||
| A tutorial as well as explanations on what goes on inside combine can be found in [the wiki](https://github.com/Marwes/combine/wiki). | ||
| ### Translation | ||
| [Japanese](https://github.com/sadnessOjisan/combine-ja) | ||
| ## Links | ||
@@ -40,0 +46,0 @@ |
@@ -88,3 +88,2 @@ //! Module containing zero-copy parsers. | ||
| /// ``` | ||
| #[inline] | ||
| pub fn recognize[Input, P](parser: P)(Input) -> <Input as StreamOnce>::Range | ||
@@ -91,0 +90,0 @@ where [ |
+43
-30
@@ -17,13 +17,2 @@ //! Combinators which take multiple parsers and applies them one after another. | ||
| macro_rules! dispatch_on { | ||
| ($i: expr, $f: expr;) => { | ||
| }; | ||
| ($i: expr, $f: expr; $first: ident $(, $id: ident)*) => { { | ||
| let b = $f($i, $first); | ||
| if b { | ||
| dispatch_on!($i + 1, $f; $($id),*); | ||
| } | ||
| } } | ||
| } | ||
| macro_rules! count { | ||
@@ -67,2 +56,33 @@ () => { 0 }; | ||
| fn add_sequence_error<Input>( | ||
| i: &mut usize, | ||
| first_empty_parser: usize, | ||
| inner_offset: ErrorOffset, | ||
| err: &mut Tracked<Input::Error>, | ||
| parser: &mut impl Parser<Input>, | ||
| ) -> bool | ||
| where | ||
| Input: Stream, | ||
| { | ||
| if *i + 1 == first_empty_parser { | ||
| Parser::add_committed_expected_error(parser, err); | ||
| } | ||
| if *i >= first_empty_parser { | ||
| if err.offset <= ErrorOffset(1) { | ||
| // We reached the last parser we need to add errors to (and the | ||
| // parser that actually returned the error), use the returned | ||
| // offset for that parser. | ||
| err.offset = inner_offset; | ||
| } | ||
| Parser::add_error(parser, err); | ||
| if err.offset <= ErrorOffset(1) { | ||
| return false; | ||
| } | ||
| } | ||
| err.offset = ErrorOffset(err.offset.0.saturating_sub(Parser::parser_count(parser).0)); | ||
| *i += 1; | ||
| true | ||
| } | ||
| macro_rules! tuple_parser { | ||
@@ -104,23 +124,16 @@ ($partial_state: ident; $h: ident $(, $id: ident)*) => { | ||
| } | ||
| dispatch_on!(0, |i, mut p| { | ||
| if i + 1 == first_empty_parser { | ||
| Parser::add_committed_expected_error(&mut p, &mut err); | ||
| #[allow(unused_assignments)] | ||
| let mut i = 0; | ||
| loop { | ||
| if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $h) { | ||
| break; | ||
| } | ||
| if i >= first_empty_parser { | ||
| if err.offset <= ErrorOffset(1) { | ||
| // We reached the last parser we need to add errors to (and the | ||
| // parser that actually returned the error), use the returned | ||
| // offset for that parser. | ||
| err.offset = inner_offset; | ||
| } | ||
| Parser::add_error(&mut p, &mut err); | ||
| if err.offset <= ErrorOffset(1) { | ||
| return false; | ||
| } | ||
| $( | ||
| if !add_sequence_error(&mut i, first_empty_parser, inner_offset, &mut err, $id) { | ||
| break; | ||
| } | ||
| err.offset = ErrorOffset( | ||
| err.offset.0.saturating_sub(Parser::parser_count(&p).0) | ||
| ); | ||
| true | ||
| }; $h $(, $id)*); | ||
| )* | ||
| break; | ||
| } | ||
| CommitErr(err.error) | ||
@@ -127,0 +140,0 @@ } else { |
@@ -1404,3 +1404,3 @@ // | ||
| /// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from), | ||
| /// Ok(819), | ||
| /// Ok(824), | ||
| /// ); | ||
@@ -1501,3 +1501,3 @@ /// ``` | ||
| /// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from), | ||
| /// Ok(819), | ||
| /// Ok(824), | ||
| /// ); | ||
@@ -1596,3 +1596,3 @@ /// } | ||
| /// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from), | ||
| /// Ok(819), | ||
| /// Ok(824), | ||
| /// ); | ||
@@ -1693,3 +1693,3 @@ /// } | ||
| /// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from), | ||
| /// Ok(819), | ||
| /// Ok(824), | ||
| /// ); | ||
@@ -1790,3 +1790,3 @@ /// } | ||
| /// ).map_err(combine::easy::Errors::<u8, &[u8], _>::from), | ||
| /// Ok(819), | ||
| /// Ok(824), | ||
| /// ); | ||
@@ -1793,0 +1793,0 @@ /// } |
+2
-2
@@ -637,3 +637,3 @@ #![allow(renamed_and_removed_lints)] | ||
| const WORDS_IN_README: usize = 819; | ||
| const WORDS_IN_README: usize = 824; | ||
@@ -854,3 +854,3 @@ #[test] | ||
| } | ||
| assert_eq!(819, count); | ||
| assert_eq!(824, count); | ||
| } |
Sorry, the diff of this file is not supported yet