commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
483d3145abf946b28bb0f9887e3a8e2cdb2abb70 | Markus Westerlind | 2018-03-06T16:27:26 | doc: Hide the root re-exports of combinators, byte, char and range | diff --git a/benches/json.rs b/benches/json.rs
index 02b4665..45e02cc 100644
--- a/benches/json.rs
+++ b/benches/json.rs
@@ -13,9 +13,16 @@ use bencher::{black_box, Bencher};
use combine::stream::buffered::BufferedStream;
use combine::{Parser, Stream, StreamOnce};
use combine::error::{Consumed, ParseError, ParseResu... | 3 | 46 | 21 |
f8ef111abda59f87d24ce683e6bf2e98fc3f3bf4 | Markus Westerlind | 2018-03-06T11:49:34 | doc: Add comments from the blog post to the async example | diff --git a/examples/async.rs b/examples/async.rs
index 4b32bf2..dc9775a 100644
--- a/examples/async.rs
+++ b/examples/async.rs
@@ -47,7 +47,19 @@ impl LanguageServerDecoder {
/// { "some": "data" }
/// ```
parser! {
+ // To avoid writing out the state type we Box it using `AnyPartialState`
+ // and the `any_... | 1 | 27 | 0 |
81e34d2d8d823b9962f4036e7576353252f211b9 | Markus Westerlind | 2018-02-11T15:31:26 | feat: Let single element tuples work as sequence and choice parsers | diff --git a/src/parser/choice.rs b/src/parser/choice.rs
index 7abd219..2e667ae 100644
--- a/src/parser/choice.rs
+++ b/src/parser/choice.rs
@@ -201,6 +201,7 @@ macro_rules! do_choice {
macro_rules! tuple_choice_parser {
($head: ident) => {
+ tuple_choice_parser_inner!($head; $head);
};
($head:... | 2 | 43 | 16 |
3753d98dfe62a63cf9dc8563eece83d763c669db | Markus Westerlind | 2018-02-03T23:32:33 | Delete spurious test.rs file | diff --git a/test.rs b/test.rs
deleted file mode 100644
index be4de52..0000000
--- a/test.rs
+++ /dev/null
@@ -1,36 +0,0 @@
-#[macro_export]
-#[doc(hidden)]
-macro_rules! seq_parser_impl {
- (; $name: ident $($tt: tt)*) => {
- $name { $($tt)* }
- };
- (_ : $first_parser: expr; $name: ident $($tt: tt)*) ... | 1 | 0 | 36 |
408e80a913623d536e191c520a1ff05f25c3aa55 | Markus Westerlind | 2018-02-03T13:05:25 | docs: Document stream::decode and rename the tokio example | diff --git a/Cargo.toml b/Cargo.toml
index 6984ef2..ea99659 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -61,7 +61,7 @@ harness = false
required-features = ["mp4"]
[[example]]
-name = "tokio"
+name = "async"
required-features = ["std"]
[[example]]
diff --git a/examples/tokio.rs b/examples/async.rs
similarity ind... | 3 | 13 | 4 |
66c087ed448e9cfd9943d71b3e6aa631a3120e28 | Markus Westerlind | 2018-02-03T11:03:14 | Only use .parse in the number example so no_std works | diff --git a/examples/number.rs b/examples/number.rs
index 0728e73..bd37291 100644
--- a/examples/number.rs
+++ b/examples/number.rs
@@ -5,6 +5,7 @@ use combine::parser::repeat::{skip_many, skip_many1};
use combine::parser::choice::optional;
use combine::parser::item::item;
use combine::parser::byte::digit;
+use com... | 1 | 3 | 2 |
979e0d7e4ac63c41712352bc87b51001aa067879 | Markus Westerlind | 2018-02-02T23:38:19 | feat: Add the unexpected_any parser
`unexpected_any` makes it possible to use `unexpected` in `choice`
parsers regardless of what type the `choice` parser outputs.
Closes #126 | diff --git a/src/parser/error.rs b/src/parser/error.rs
index c33ecdb..f57955b 100644
--- a/src/parser/error.rs
+++ b/src/parser/error.rs
@@ -9,18 +9,18 @@ use error::{ConsumedResult, Info, ParseError, StreamError, Tracked};
use error::FastResult::*;
#[derive(Clone)]
-pub struct Unexpected<I>(Info<I::Item, I::Range>... | 1 | 40 | 5 |
a37cbd38ecfafcffff7bcdaa85acc2b8e3f1cb57 | Markus Westerlind | 2018-02-02T23:19:57 | docs: Add docs on BufferedStream | diff --git a/src/stream/buffered.rs b/src/stream/buffered.rs
index af7390a..c74dfa5 100644
--- a/src/stream/buffered.rs
+++ b/src/stream/buffered.rs
@@ -3,6 +3,25 @@ use std::collections::VecDeque;
use error::StreamError;
use stream::{Positioned, Resetable, StreamErrorFor, StreamOnce};
+/// `Stream` which buffers i... | 1 | 19 | 0 |
cc8858ea886a4220b716453cfc1bb3896b124ff8 | Markus Westerlind | 2018-02-02T23:09:20 | docs: Improve docs slightly on the error traits | diff --git a/src/error.rs b/src/error.rs
index 3ccc509..865ff3a 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -203,7 +203,9 @@ pub type ParseResult<O, I> = Result<(O, Consumed<()>), Consumed<Tracked<<I as St
pub type ParseResult2<O, E> = Result<(O, Consumed<()>), Consumed<Tracked<E>>>;
/// `StreamError` represent... | 1 | 10 | 2 |
b3dd83b45d162d01d4edcf45dd190a09002745ad | Markus Westerlind | 2018-02-02T23:03:34 | test: Force more optimizations when benchmarking | diff --git a/Cargo.toml b/Cargo.toml
index 96c08c5..48089e8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -64,3 +64,5 @@ required-features = ["mp4"]
features = ["doc"]
[profile.bench]
+lto = true
+codegen-units = 1 | 1 | 2 | 0 |
df3e84f0275352fba44672b2701d452f6bb55596 | Markus Westerlind | 2018-02-02T22:54:16 | feat: Don't have the error type be generic for uncons*
This was intended as a way to let `StreamOnce` instances to be wrapped
and let the wrapping instance decide which error type that were
returned. However this isn't necessary except for rare cases such as
when a `BufferedStream` wraps a stream with poor errors and ... | diff --git a/benches/http.rs b/benches/http.rs
index 8b7ce77..e1c9c09 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -8,7 +8,6 @@ use bencher::{black_box, Bencher};
use std::fmt;
use combine::{many, token, ParseError, Parser, RangeStream, many1};
-use combine::error::UnexpectedParse;
use combine::range::{ra... | 12 | 80 | 138 |
7b358e4638e2cc851e486ede9385b9d0e51c0354 | Markus Westerlind | 2018-02-02T22:15:57 | docs: Add an example on how to parse numbers | diff --git a/examples/float.rs b/examples/number.rs
similarity index 100%
rename from examples/float.rs
rename to examples/number.rs | 1 | 0 | 0 |
afd51ea94094bdfe1dd26cdcd2c2141cdb567df5 | Markus Westerlind | 2018-02-02T22:15:30 | Simplify the tokio example slightly | diff --git a/examples/float.rs b/examples/float.rs
new file mode 100644
index 0000000..0728e73
--- /dev/null
+++ b/examples/float.rs
@@ -0,0 +1,21 @@
+extern crate combine;
+
+use combine::parser::range::recognize;
+use combine::parser::repeat::{skip_many, skip_many1};
+use combine::parser::choice::optional;
+use combi... | 2 | 31 | 10 |
95eb70cb025aec89925e3f1992a6d1b266328eb2 | Markus Westerlind | 2018-01-29T22:08:24 | feat: Add a alias which helps to refer to the StreamError type | diff --git a/src/stream/easy.rs b/src/stream/easy.rs
index 817ee0b..bcfce91 100644
--- a/src/stream/easy.rs
+++ b/src/stream/easy.rs
@@ -11,6 +11,7 @@
//! extern crate combine;
//! use combine::{easy, Parser, Stream, many1};
//! use combine::parser::char::letter;
+//! use combine::stream::StreamErrorFor;
//! use co... | 2 | 40 | 4 |
dcde1680b5be33799c625f890124b1d8d9240cc6 | Markus Westerlind | 2018-01-28T15:43:03 | Small improvements to the tokio example | diff --git a/examples/tokio.rs b/examples/tokio.rs
index c0067ea..3ef11c3 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -39,6 +39,13 @@ impl LanguageServerDecoder {
}
}
+/// Parses blocks of data with length headers
+///
+/// ```
+/// Content-Length: 18
+///
+/// { "some": "data" }
+/// ```
parser!... | 1 | 9 | 2 |
7535103ad5e450cc3eb02d4368c5e4b78b7c6b04 | Markus Westerlind | 2018-01-28T12:43:35 | Remove redundant FromIterator bounds | diff --git a/src/parser/combinator.rs b/src/parser/combinator.rs
index ac6d694..9236a5c 100644
--- a/src/parser/combinator.rs
+++ b/src/parser/combinator.rs
@@ -412,7 +412,7 @@ where
}
/// Constructs a parser which returns the tokens parsed by `parser` accumulated in
-/// `F: FromIterator<P::Input::Item>` instead o... | 3 | 21 | 36 |
30cc7d1d39e754d2c2e8491eb2123dacec5d30f3 | Markus Westerlind | 2018-01-27T23:12:06 | feat: Add memchr optimized take_until_byte parsers | diff --git a/Cargo.toml b/Cargo.toml
index 5c90950..96c08c5 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,6 +27,7 @@ byteorder = "1.1.0"
either = "1"
unreachable = "1.0.0"
regex = { version = "0.2.0", optional = true }
+memchr = { version = "2", default-features = false }
[dev-dependencies]
bencher = "0.1.3"
@... | 3 | 152 | 3 |
1e636fff425ecc1be88b41d4dfff362594cfa6bb | Markus Westerlind | 2018-01-27T21:11:37 | Fix compile errors in examples and benchmarks due to refactoring | diff --git a/benches/http.rs b/benches/http.rs
index dd0a9ea..8b7ce77 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -7,10 +7,10 @@ use bencher::{black_box, Bencher};
use std::fmt;
-use combine::{many, token, ParseError, Parser, many1};
+use combine::{many, token, ParseError, Parser, RangeStream, many1};
u... | 2 | 11 | 9 |
06b1241e43e71c4bf9800ec780398136ad5c6cbe | Markus Westerlind | 2018-01-27T21:04:43 | docs: Add documentation to the stream and parser modules | diff --git a/src/lib.rs b/src/lib.rs
index 6d4e9b9..116fbc9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -655,11 +655,8 @@ pub use stream::easy;
/// Error types and traits which define what kind of errors combine parsers may emit
#[macro_use]
pub mod error;
-/// Module containing the `Stream` trait and its siblings.
... | 13 | 64 | 29 |
65794de6ef0c54aeda2f9463a4b175fb2c968601 | Markus Westerlind | 2018-01-27T20:27:49 | refactor: Move the combinator to the parser module | diff --git a/src/lib.rs b/src/lib.rs
index 44fb328..6d4e9b9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -662,9 +662,24 @@ pub mod stream;
/// All the parsers in combine.
#[macro_use]
pub mod parser;
-/// Module containing all specific parsers.
-#[macro_use]
-pub mod combinator;
+
+/// Re-exported parsers for compati... | 3 | 22 | 16 |
411f1466e262493753d30b657893c9969eae6f10 | Markus Westerlind | 2018-01-27T19:55:52 | refactor: Move function parsers to their own module | diff --git a/src/combinator.rs b/src/combinator.rs
index 5cab19f..66418bd 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2,7 +2,7 @@ use lib::marker::PhantomData;
use lib::mem;
use Parser;
-use error::{Consumed, ConsumedResult, Info, ParseError, ParseResult, Tracked};
+use error::{Consumed, ConsumedResu... | 3 | 165 | 155 |
88e0916f5a11b9a28e925160b9462ed39a088d9a | Markus Westerlind | 2018-01-27T19:26:57 | refactor: Move error parsers to their own module | diff --git a/src/combinator.rs b/src/combinator.rs
index 449dff0..5cab19f 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2,8 +2,7 @@ use lib::marker::PhantomData;
use lib::mem;
use Parser;
-use error::{Consumed, ConsumedResult, Info, ParseError, ParseResult, StreamError, Tracked,
- Unexpected... | 3 | 172 | 162 |
19b8fc11d9688815964787007715f64fc3c0d074 | Markus Westerlind | 2018-01-27T19:15:35 | refactor: Move eof and value to the item module | diff --git a/src/combinator.rs b/src/combinator.rs
index 3efb5ff..449dff0 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -68,43 +68,6 @@ where
Unexpected(message.into(), PhantomData)
}
-#[derive(Copy, Clone)]
-pub struct Value<I, T>(T, PhantomData<fn(I) -> I>);
-impl<I, T> Parser for Value<I, T>
-whe... | 2 | 92 | 92 |
64aec29a7cd20dfc2b3448e81ca14c68a19dcc58 | Markus Westerlind | 2018-01-27T19:10:26 | refactor: Move the tests of combinator.rs to tests/
No reason to have these in the file itself. | diff --git a/src/combinator.rs b/src/combinator.rs
index 13d84da..3efb5ff 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -1085,387 +1085,3 @@ where
{
AnyPartialStateParser(p)
}
-
-#[cfg(test)]
-mod tests {
- use super::*;
- use Parser;
- use parser::char::{digit, letter};
- use parser::ran... | 2 | 382 | 384 |
8bd24338db1a436b57bf54f8fd938ee46ed47c73 | Markus Westerlind | 2018-01-27T19:04:08 | refactor: Move custom streams to submodules of stream | diff --git a/benches/http.rs b/benches/http.rs
index e52cac1..dd0a9ea 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -8,9 +8,9 @@ use bencher::{black_box, Bencher};
use std::fmt;
use combine::{many, token, ParseError, Parser, many1};
-use combine::error::{RangeStream, UnexpectedParse};
+use combine::error::U... | 19 | 80 | 75 |
2e9e713bc55736a381c24ad9157c1c1d1df32610 | Markus Westerlind | 2018-01-27T18:41:41 | docs: Hide some macros and types | diff --git a/src/combinator.rs b/src/combinator.rs
index db6c76b..3269a63 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -168,7 +168,7 @@ where
/// # extern crate combine;
/// # use combine::*;
/// # use combine::easy;
-/// # use combine::state::SourcePosition;
+/// # use combine::state::{State, SourcePos... | 8 | 15 | 14 |
16fce2a93ed2bc618444c8c20e5c989563c4d184 | Markus Westerlind | 2018-01-27T18:38:59 | refactor: Move ParseMode to the parser module | diff --git a/src/combinator.rs b/src/combinator.rs
index f05ba18..db6c76b 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2,9 +2,10 @@ use lib::marker::PhantomData;
use lib::mem;
use Parser;
-use error::{Consumed, ConsumedResult, Info, ParseError, ParseMode, ParseResult, StreamError,
- Tracked... | 8 | 138 | 135 |
c825cc600bc5cff9c38aa5fe3ae9556d5028a6ec | Markus Westerlind | 2018-01-27T18:28:37 | refactor: Rename primitives to error
BREAKING CHANGE
Types from primitives have been split up into the parser, stream and error modules. | diff --git a/benches/http.rs b/benches/http.rs
index 5bec2b4..e52cac1 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -8,7 +8,7 @@ use bencher::{black_box, Bencher};
use std::fmt;
use combine::{many, token, ParseError, Parser, many1};
-use combine::primitives::{RangeStream, UnexpectedParse};
+use combine::err... | 21 | 82 | 83 |
598e029639071de71f2adeef5864c5df4f14892e | Markus Westerlind | 2018-01-27T18:11:09 | Move between, then and then_partial to the sequence module | diff --git a/src/combinator.rs b/src/combinator.rs
index 17b36d8..3c35326 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -302,32 +302,6 @@ where
}
}
-impl_parser! { Between(L, R, P), Skip<With<L, P>, R> }
-/// Parses `open` followed by `parser` followed by `close`.
-/// Returns the value of `parser`.... | 2 | 208 | 208 |
bdce751c7b2beecd3db6e9001087b4a1edca72bf | Markus Westerlind | 2018-01-27T18:08:57 | refactor: Move optional to the choice module | diff --git a/src/combinator.rs b/src/combinator.rs
index 37f5abe..17b36d8 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -302,66 +302,6 @@ where
}
}
-#[derive(Copy, Clone)]
-pub struct Optional<P>(P);
-impl<P> Parser for Optional<P>
-where
- P: Parser,
-{
- type Input = P::Input;
- type Outp... | 2 | 60 | 60 |
8e2a5c8ff641b72af76bdfd8a642d1a4c4604085 | Markus Westerlind | 2018-01-27T17:53:53 | refactor: Move single item parsers to their own module | diff --git a/src/combinator.rs b/src/combinator.rs
index 31ec8f1..b899e9d 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -6,7 +6,7 @@ use lib::borrow::BorrowMut;
use Parser;
use primitives::{Consumed, ConsumedResult, Info, ParseError, ParseMode, ParseResult, StreamError,
Tracked, Unexpect... | 3 | 497 | 483 |
1165de348bfc6194126ac043b2f3eabb5a9b2946 | Markus Westerlind | 2018-01-27T17:32:49 | refactor: Remove the async module | diff --git a/examples/tokio.rs b/examples/tokio.rs
index 37470a6..e389208 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -74,7 +74,7 @@ impl Decoder for LanguageServerDecoder {
fn decode(&mut self, src: &mut BytesMut) -> Result<Option<Self::Item>, Self::Error> {
println!("Decoding `{:?}`", str:... | 5 | 27 | 30 |
5316c27554f7530320875406f9dffca189d4b5c3 | Markus Westerlind | 2018-01-27T16:51:47 | refactor: Move byte, char, range and regex parser under the parser
module | diff --git a/examples/date.rs b/examples/date.rs
index 09e02ab..a9dcce7 100644
--- a/examples/date.rs
+++ b/examples/date.rs
@@ -8,7 +8,7 @@ use std::fmt;
use std::fs::File;
use std::io::{self, Read};
-use combine::char::{char, digit};
+use combine::parser::char::{char, digit};
use combine::{choice, many, optional... | 17 | 136 | 129 |
236200da60b7d648a7f686d2218924505b94aaae | Markus Westerlind | 2018-01-27T14:38:00 | Propagate the mode in Many1 to restore full performance of the http benchmark
Even without `no_partial` wrappers | diff --git a/benches/http.rs b/benches/http.rs
index e36d94c..5bec2b4 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -69,46 +69,40 @@ where
I: RangeStream<Item = u8, Range = &'a [u8]>,
I::Error: ParseError<I::Item, I::Range, I::Position>,
{
- use combine::combinator::no_partial;
-
// Making a ... | 2 | 11 | 17 |
cd0caca10f595a23b8151ae742f95718b20ef55d | Markus Westerlind | 2018-01-27T14:24:51 | docs: Explain the partial parsing functions a bit | diff --git a/src/primitives.rs b/src/primitives.rs
index 1f58787..a77a592 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -1456,8 +1456,12 @@ impl<O, E> From<ParseResult2<O, E>> for FastResult<O, E> {
}
}
+/// Specifies wheter the parser must check for partial state that must be resumed
pub trait Par... | 1 | 25 | 12 |
f5fbc8be77972aa29c89bb8ea79c9062562deb85 | Markus Westerlind | 2018-01-27T14:05:43 | docs: Explain the square brackets of parser | diff --git a/src/lib.rs b/src/lib.rs
index a07494a..185265f 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -235,6 +235,8 @@ macro_rules! impl_token_parser {
/// use combine::primitives::ParseError;
///
/// parser!{
+/// /// `[I]` represents a normal type parametera and lifetime declaration for the function
+/// ... | 1 | 2 | 0 |
916bb824741f054ed2f0686dcce316d0a770d9db | Markus Westerlind | 2018-01-27T13:52:22 | fix: Allow `parser!` to be used within functions
Removes the use of the inner module since it is actually possible to
define `struct abc { .. }` and `fn abc` in the same scope, it is only
`struct abc(..);` which conflicts with functions. | diff --git a/src/combinator.rs b/src/combinator.rs
index 0918675..f953148 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3945,6 +3945,8 @@ where
/// # use combine::char::letter;
/// # use combine::*;
///
+/// # fn main() {
+///
/// parser! {
/// type PartialState = AnyPartialState;
/// fn exam... | 2 | 54 | 95 |
e8e240ddbf48eedd3a0f6e292565455886d05952 | Markus Westerlind | 2018-01-27T13:42:34 | Document any_partial_state | diff --git a/src/combinator.rs b/src/combinator.rs
index 6ce8625..0918675 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3935,6 +3935,34 @@ where
}
}
+/// Returns a parser where `P::PartialState` is boxed. Useful as a way to avoid writing the type
+/// since it can get very large after combining a f... | 1 | 28 | 0 |
45776c3e38de59882efe9ad5a8811cb47eacd82b | Markus Westerlind | 2018-01-27T13:30:51 | Make use of boxed partial state explicit | diff --git a/Cargo.toml b/Cargo.toml
index df76726..5c90950 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,23 +27,23 @@ byteorder = "1.1.0"
either = "1"
unreachable = "1.0.0"
regex = { version = "0.2.0", optional = true }
-bytes = { version = "0.4", optional = true }
[dev-dependencies]
bencher = "0.1.3"
lazy_s... | 5 | 55 | 81 |
69db52a9a319e8f33c7b4205562ebea775b1c319 | Markus Westerlind | 2018-01-23T22:34:56 | partial_parser! | diff --git a/src/combinator.rs b/src/combinator.rs
index 55a649a..c423a9f 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3,8 +3,9 @@ use lib::marker::PhantomData;
use lib::mem;
use lib::borrow::BorrowMut;
-use primitives::{uncons, Consumed, ConsumedResult, Info, ParseError, ParseResult, Parser,
- ... | 3 | 274 | 113 |
c04e2247ab04f098ef0eae887c7a7739d99212fc | Markus Westerlind | 2018-01-24T23:07:08 | fix: Allow multiple unnamed public parsers to be in the same scope | diff --git a/src/lib.rs b/src/lib.rs
index d75098b..e7e1958 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -337,11 +337,13 @@ macro_rules! parser {
where [$($where_clause: tt)*]
$parser: block
) => {
- parser!{
- pub struct __Parser;
+ combine_parser_impl!{
+ ... | 2 | 19 | 5 |
abbbfa08ba0fa5c6bd7a62106b415f8d059e58dd | Markus Westerlind | 2018-01-22T20:24:18 | De-duplicate the tuple parser abt | diff --git a/src/combinator.rs b/src/combinator.rs
index fff1335..55a649a 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2946,7 +2946,45 @@ macro_rules! tuple_parser {
_marker: PhantomData <( $h $(, $id)* )>,
}
- // struct Seq<'a>( $(&'a mut $id ),* );
+
+ #[allow(non_s... | 1 | 41 | 73 |
a72b53b9a2fbfcb6543dd4a7407247952528fa32 | Markus Westerlind | 2018-01-21T22:07:07 | Add partial parsing for range parsers | diff --git a/src/primitives.rs b/src/primitives.rs
index 18c79b6..d718199 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -1630,6 +1630,15 @@ pub trait Parser {
self.parse_lazy(input)
}
+ #[inline(always)]
+ fn parse_resume(
+ &mut self,
+ input: &mut Self::Input,
+ ... | 3 | 184 | 23 |
6b3c661af23fd221d2b28c37ed207d37409c2491 | Markus Westerlind | 2018-01-21T21:59:16 | fix: Return the correct distance for slices with larger than 1 byte items | diff --git a/src/primitives.rs b/src/primitives.rs
index fc520bb..18c79b6 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -660,6 +660,16 @@ where
}
}
+fn input_at_eof<I>(input: &mut I) -> bool
+where
+ I: ?Sized + Stream,
+{
+ let before = input.checkpoint();
+ let x = input.uncons::<Unexpect... | 1 | 44 | 6 |
9310b5d535992bb1c3b3afa353608011000ae386 | Markus Westerlind | 2018-01-21T16:06:21 | Implement partial parsing for `recognize`
BREAKING CHANGE
Changes the bound on `F: FromIterator<I::Item>` to `F: Default +
Extend<I::Item>`. | diff --git a/src/combinator.rs b/src/combinator.rs
index c2f7c55..fff1335 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3385,59 +3385,73 @@ pub struct Recognize<F, P>(P, PhantomData<fn() -> F>);
impl<P, F> Parser for Recognize<F, P>
where
P: Parser,
- F: FromIterator<<P::Input as StreamOnce>::Ite... | 2 | 80 | 40 |
cf8595005cd96ccdc53deea98ae3de99efa9d93e | Markus Westerlind | 2018-01-21T15:48:54 | Simplify one of the async tests a bit | diff --git a/src/combinator.rs b/src/combinator.rs
index 763f274..c2f7c55 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3586,6 +3586,70 @@ where
}
}
+#[cfg(feature = "std")]
+#[doc(hidden)]
+pub struct BoxedPartialState<P>(P);
+
+#[cfg(feature = "std")]
+impl<P> Parser for BoxedPartialState<P>
+whe... | 2 | 73 | 14 |
94fe975629fbd293e3202762cb6e7aeae16c1ef3 | Markus Westerlind | 2018-01-21T12:36:42 | Handle partial parser -> non-partial -> partial calls | diff --git a/src/combinator.rs b/src/combinator.rs
index 3f9ebc8..763f274 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -22,6 +22,12 @@ macro_rules! impl_parser {
type Input = <$first as Parser>::Input;
type Output = <$inner_type as Parser>::Output;
type PartialState = <$inner_typ... | 4 | 97 | 15 |
6df59a490bd5ffd892ae75acd83adce7df8a6cc9 | Markus Westerlind | 2018-01-21T11:15:41 | Partial parsing for choice parsers | diff --git a/src/combinator.rs b/src/combinator.rs
index 46ce6e3..3f9ebc8 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -662,7 +662,7 @@ macro_rules! merge {
}
macro_rules! do_choice {
- ($input: ident $partial_state: ident $state: ident ( ) $($parser: ident $error: ident)+) => { {
+ ($input: iden... | 2 | 62 | 13 |
51ed80fe90c482672b0be4b2564b50352b26c569 | Markus Westerlind | 2018-01-21T09:11:55 | Store state for the choice parsers | diff --git a/examples/tokio.rs b/examples/tokio.rs
index b9679a4..6fcd3fd 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -1,3 +1,5 @@
+#![cfg(feature = "std")]
+
extern crate bytes;
#[macro_use]
extern crate combine;
diff --git a/src/combinator.rs b/src/combinator.rs
index 05ab53c..46ce6e3 100644
--- a/sr... | 4 | 75 | 18 |
718ac65c61a22e2932b1f1fed98cdd3a3b624f5a | Markus Westerlind | 2018-01-21T01:38:54 | Replace directo uses of std | diff --git a/src/combinator.rs b/src/combinator.rs
index 461abc0..05ab53c 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -1,6 +1,7 @@
use lib::iter::FromIterator;
use lib::marker::PhantomData;
use lib::mem;
+use lib::borrow::BorrowMut;
use primitives::{uncons, Consumed, ConsumedResult, Info, ParseError... | 1 | 3 | 3 |
a9e31fe30e7ff90041a50ceee0e226d78fd200d7 | Markus Westerlind | 2018-01-21T00:11:03 | docs: Implement a tokio example utilizing partial parsing | diff --git a/examples/tokio.rs b/examples/tokio.rs
index f7d6f17..b9679a4 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -16,11 +16,10 @@ use bytes::BytesMut;
use tokio_io::codec::Decoder;
-use combine::primitives::{ParseError, PointerOffset, RangeStream, RangeStreamOnce, Resetable,
- ... | 3 | 105 | 49 |
5d402f6be0c1be4d69159d4df1d1d4589f5cd66e | Markus Westerlind | 2018-01-20T22:56:10 | feat: Add the `then_partial` parser
Variant of `then` that can be used in partial parsing | diff --git a/src/combinator.rs b/src/combinator.rs
index 9312c34..880c7a0 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -940,16 +940,16 @@ where
.inspect(|_| *count += 1),
);
if *count < self.min {
- let err = <P::Input as StreamOnce>::Error::from_error(
- ... | 3 | 299 | 83 |
90d7a65b0736edcfd023565574f99f7bcb1c79f0 | Markus Westerlind | 2018-01-20T19:50:47 | Add tests and fix some problems with partial parsing | diff --git a/Cargo.toml b/Cargo.toml
index ee1e9f3..127fed2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -36,6 +36,7 @@ futures = "0.1"
tokio-io = "0.1"
partial-io = { version = "0.3", features = ["tokio", "quickcheck"] }
bytes = "0.4"
+quickcheck = "0.6"
[features]
default = ["std"]
diff --git a/examples/tokio.r... | 9 | 372 | 99 |
8456b29642ee96f721474ff9dece5871949fa9ea | Markus Westerlind | 2018-01-20T15:45:12 | Partial parsing for skip | diff --git a/src/combinator.rs b/src/combinator.rs
index c7c4892..1135b8f 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2273,10 +2273,14 @@ where
{
type Input = I;
type Output = P1::Output;
- type PartialState = ();
+ type PartialState = <(P1, P2) as Parser>::PartialState;
#[inline]
-... | 1 | 7 | 3 |
113c273198c88b82b45b6a06dd26803087439bcf | Markus Westerlind | 2018-01-20T12:00:05 | Allow the parser! macro to take Option<Box<Any>> or () as the state | diff --git a/examples/tokio.rs b/examples/tokio.rs
index e488d9a..71d5317 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -6,6 +6,7 @@ extern crate futures;
extern crate partial_io;
extern crate tokio_io;
+use std::any::Any;
use std::rc::Rc;
use std::cell::Cell;
use std::str;
@@ -23,7 +24,7 @@ use comb... | 4 | 168 | 51 |
90a51179f9512281a88ca664241f4b7e3694bad9 | Markus Westerlind | 2018-01-20T11:04:03 | Implement parse_partial on Either | diff --git a/src/combinator.rs b/src/combinator.rs
index 2429235..c7c4892 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3226,6 +3226,34 @@ where
}
}
+ #[inline]
+ fn parse_partial(
+ &mut self,
+ input: &mut Self::Input,
+ state: &mut Self::PartialState,
+ ) ->... | 1 | 28 | 0 |
7cdfb989e28ce251e3bc6fb1c8541a6407b752b7 | Markus Westerlind | 2018-01-20T09:07:50 | Add a convenience function for decoding partial input | diff --git a/examples/tokio.rs b/examples/tokio.rs
index a2b1479..e488d9a 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -15,55 +15,13 @@ use bytes::BytesMut;
use tokio_io::codec::Decoder;
-use combine::primitives::{ParseError, PointerOffset, StreamOnce};
+use combine::primitives::{ParseError, PointerOf... | 5 | 72 | 51 |
d943c6ba69d43362f4df11be707e7f3d427759f3 | Markus Westerlind | 2018-01-19T22:41:17 | Parse multiple digits in the tokio example | diff --git a/examples/tokio.rs b/examples/tokio.rs
index a83db0e..a2b1479 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -17,7 +17,7 @@ use tokio_io::codec::Decoder;
use combine::primitives::{ParseError, PointerOffset, StreamOnce};
use combine::range::{range, recognize, take};
-use combine::{skip_many, P... | 1 | 2 | 2 |
310396f2f4d2b27da608587ac9814ee575f6f888 | Markus Westerlind | 2018-01-20T19:52:48 | Fix compilation errors of regex parsers | diff --git a/src/regex.rs b/src/regex.rs
index eb50d62..4b71bd1 100644
--- a/src/regex.rs
+++ b/src/regex.rs
@@ -211,11 +211,12 @@ where
{
type Input = I;
type Output = I::Range;
+ type PartialState = ();
#[inline]
fn parse_lazy(&mut self, input: &mut Self::Input) -> ConsumedResult<Self::Outpu... | 1 | 6 | 1 |
a92c2ae25d9442f2c6dfadda69301cefe7834b9b | Markus Westerlind | 2018-01-19T22:40:38 | Setup partial parsing | diff --git a/examples/tokio.rs b/examples/tokio.rs
index d6d3eff..a83db0e 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -6,6 +6,8 @@ extern crate futures;
extern crate partial_io;
extern crate tokio_io;
+use std::rc::Rc;
+use std::cell::Cell;
use std::str;
use std::io::Cursor;
@@ -13,39 +15,23 @@ us... | 2 | 77 | 55 |
ccccaf254b6ed45a894f9ab00a4bebe194d9ee6a | Markus Westerlind | 2018-01-19T22:01:22 | Avoid allocating a string in the tokio example | diff --git a/examples/tokio.rs b/examples/tokio.rs
index 1961eb8..d6d3eff 100644
--- a/examples/tokio.rs
+++ b/examples/tokio.rs
@@ -13,8 +13,8 @@ use bytes::BytesMut;
use tokio_io::codec::Decoder;
-use combine::range::{range, take};
-use combine::{skip_many, Parser, many1};
+use combine::range::{range, recognize,... | 1 | 5 | 5 |
3de662f579678f6433c99b4b7f07763611e4c5c0 | Markus Westerlind | 2018-01-19T21:59:14 | docs: Bring in the LanguageServerDecoder as an example | diff --git a/Cargo.toml b/Cargo.toml
index 6381410..ee1e9f3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -32,6 +32,11 @@ regex = { version = "0.2.0", optional = true }
bencher = "0.1.3"
lazy_static = "0.2.8"
+futures = "0.1"
+tokio-io = "0.1"
+partial-io = { version = "0.3", features = ["tokio", "quickcheck"] }
+byt... | 2 | 149 | 0 |
44eac24d46f265a1b3a94d5587d4f200ebebc18f | Markus Westerlind | 2018-01-19T21:44:43 | fix: Don't add extra expected errors when erroring in the middle of a sequence | diff --git a/src/combinator.rs b/src/combinator.rs
index bd9ead3..2429235 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2632,8 +2632,9 @@ macro_rules! dispatch_on {
($i: expr, $f: expr;) => {
};
($i: expr, $f: expr; $first: ident $(, $id: ident)*) => { {
- $f($i, $first);
- dis... | 1 | 44 | 8 |
3fc0b540521aff959ce62628df1ac7554a9df861 | Markus Westerlind | 2018-01-19T18:44:04 | feat: Don't require `Clone` for `Stream`
Instead we require the `Resetable` which lets `Stream` types potentially
implement a cheaper way to reset themselves to an earlier position. If
they implement `Clone` there is a macro to trivially generate the
implementation
BREAKING CHANGE
If you have implemented a custom `S... | diff --git a/benches/http.rs b/benches/http.rs
index 4d4d488..e36d94c 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -141,7 +141,7 @@ fn http_requests_large_cheap_error(b: &mut Bencher) {
fn http_requests_bench<'a, I>(b: &mut Bencher, buffer: I)
where
- I: RangeStream<Item = u8, Range = &'a [u8]>,
+ I:... | 10 | 262 | 262 |
f87fa03f1cf22754391f71a461942b1393f91338 | Markus Westerlind | 2018-01-19T13:25:15 | Remove invalid unreachable uses | diff --git a/src/combinator.rs b/src/combinator.rs
index a4ba993..c83d1d8 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -110,12 +110,10 @@ where
#[inline]
fn parse_lazy(&mut self, input: &mut Self::Input) -> ConsumedResult<Self::Output, Self::Input> {
- satisfy_impl(input, |c| {
- ... | 1 | 23 | 33 |
9aeaefa95f97bd8b9d186923e16cd8def98d8e81 | Markus Westerlind | 2018-01-18T21:40:57 | perf: Avoid cloning input in satisfy | diff --git a/src/combinator.rs b/src/combinator.rs
index 1e3bdf3..a4ba993 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -89,16 +89,13 @@ where
I: Stream,
P: FnMut(I::Item) -> Option<R>,
{
- let temp = input.clone();
+ let position = input.position();
match input.uncons() {
Ok(... | 1 | 13 | 8 |
84f34100bdc3ee6f4ae5b25dbf7141550bc97eec | Markus Westerlind | 2018-01-18T20:26:31 | Add unreachable dependency | diff --git a/Cargo.toml b/Cargo.toml
index 5ec5618..6381410 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,6 +25,7 @@ path = "src/lib.rs"
ascii = "0.7.0"
byteorder = "1.1.0"
either = "1"
+unreachable = "1.0.0"
regex = { version = "0.2.0", optional = true }
[dev-dependencies]
diff --git a/benches/http.rs b/bench... | 5 | 49 | 22 |
bc50a19b6dc514ddbc41adfeaa393de5495d5af4 | Markus Westerlind | 2018-01-18T20:03:56 | Fix unused variable warnings | diff --git a/src/combinator.rs b/src/combinator.rs
index 29260b0..7aa08ea 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -280,7 +280,7 @@ where
let mut consumed = false;
for c in self.tokens.clone() {
match ::primitives::uncons(input) {
- Ok((other, rest)) => {
+... | 3 | 4 | 5 |
398d52dc5de86837edba2aa4db29e1b5abec8379 | Markus Westerlind | 2018-01-18T19:47:20 | Fix remaining compilation errors in test | diff --git a/benches/http.rs b/benches/http.rs
index dc3df84..e1f270f 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -27,26 +27,26 @@ struct Header<'a> {
fn is_token(c: u8) -> bool {
match c {
- 128...255 |
- 0...31 |
- b'(' |
- b')' |
- b'<' |
- b'>' |
- ... | 4 | 114 | 115 |
b5ca622b4ed81006b3372689f463e24f92764e94 | Markus Westerlind | 2018-01-18T19:13:34 | Fix sequence choice test | diff --git a/src/combinator.rs b/src/combinator.rs
index cb32676..f1946fc 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3230,6 +3230,36 @@ mod tests_std {
use char::{char, digit, letter};
use state::{SourcePosition, State};
+ struct NoPartial<P>(P);
+
+ impl<P> Parser for NoPartial<P>
+ ... | 1 | 31 | 4 |
2b230f167950a827589f4f305cd36c20d21713d1 | Markus Westerlind | 2018-01-18T19:08:38 | Fix count_min_max | diff --git a/src/combinator.rs b/src/combinator.rs
index 87818d8..cb32676 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -938,14 +938,11 @@ where
let max = self.max;
let mut iter = self.parser.by_ref().partial_iter(input, child_state);
- elements.extend(iter.by_ref().take_while(|_|... | 1 | 5 | 8 |
5f070ba59525542ef9be268348dd02dce57ccf75 | Markus Westerlind | 2018-01-18T13:34:26 | Fix compile error | diff --git a/src/combinator.rs b/src/combinator.rs
index 4482c66..d328281 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -3466,6 +3466,7 @@ mod tests_std {
],
})
);
+ */
}
#[test]
@@ -3492,6 +3493,8 @@ mod tests_std {
#[test]
fn sequence_i... | 1 | 3 | 0 |
933149f6bd17c4df86810499929e20b5b93dc463 | Markus Westerlind | 2018-01-18T13:27:00 | Implement partial parsing on tuples | diff --git a/benches/http.rs b/benches/http.rs
index 69acd4d..486307e 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -1,12 +1,13 @@
#[macro_use]
extern crate bencher;
+#[macro_use]
extern crate combine;
use bencher::{black_box, Bencher};
use std::fmt;
-use combine::*;
+use combine::{many, token, Parse... | 2 | 167 | 23 |
19f4896fc30a39c5183a3a19f955b9e64025bfc1 | Markus Westerlind | 2018-01-18T12:28:42 | Make Iter generic over the state storage | diff --git a/src/combinator.rs b/src/combinator.rs
index 1104b5e..1ae5c78 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -539,7 +539,7 @@ where
state: &mut Self::PartialState,
) -> ConsumedResult<F, P::Input> {
let count = &mut state.0;
- let mut iter = self.parser.by_ref().iter... | 2 | 47 | 11 |
8dbc90a351668dd6b8de5d4d90d269df6fefa3a2 | Markus Westerlind | 2018-01-18T12:20:37 | Fix bad search and replace | diff --git a/src/combinator.rs b/src/combinator.rs
index a03f211..1104b5e 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -487,7 +487,7 @@ where
/// # extern crate combine;
/// # use combine::*;
/// # use combine::easy;
-/// # use combine::state::PartialState;
+/// # use combine::state::State;
/// # fn ma... | 2 | 2 | 2 |
327f0a681f4076fa4cbf0d4bdaf31d4f78634cc6 | Markus Westerlind | 2018-01-18T12:19:49 | Don't implement parse_stream methods explicitly | diff --git a/src/combinator.rs b/src/combinator.rs
index 108bef3..a03f211 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -1803,8 +1803,8 @@ impl<'a, I: Stream, O> Parser for FnMut(I) -> ParseResult<O, I> + 'a {
type Input = I;
type Output = O;
type PartialState = ();
- fn parse_stream(&mut ... | 1 | 15 | 8 |
abd607a23201389c084b7dcabb27daf1eec29765 | Markus Westerlind | 2018-01-18T12:13:07 | no_option | diff --git a/src/buffered_stream.rs b/src/buffered_stream.rs
index 19caac5..b063235 100644
--- a/src/buffered_stream.rs
+++ b/src/buffered_stream.rs
@@ -24,7 +24,8 @@ where
write!(
f,
"BufferedStreamRef {{ offset: {:?} buffer_offset: {:?} }}",
- self.offset, buffer_offset
+... | 8 | 156 | 168 |
15e5a803e201b7d0c4406fb7aa2302827149adb0 | Markus Westerlind | 2018-01-16T21:10:08 | Start implementation of partial parsing | diff --git a/src/byte.rs b/src/byte.rs
index 119c664..82c53b1 100644
--- a/src/byte.rs
+++ b/src/byte.rs
@@ -289,6 +289,8 @@ where
{
type Input = I;
type Output = &'static [u8];
+ type PartialState = ();
+
#[inline]
fn parse_lazy(&mut self, input: Self::Input) -> ConsumedResult<Self::Output, Sel... | 6 | 376 | 127 |
30fda587c1b850d734d1026228e06337739aa264 | Markus Westerlind | 2018-01-24T20:53:19 | Version 3.0.0-alpha.5 | diff --git a/Cargo.toml b/Cargo.toml
index d370d09..5ec5618 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "combine"
-version = "3.0.0-alpha.4"
+version = "3.0.0-alpha.5"
authors = ["Markus Westerlind <marwes91@gmail.com>"]
description = "Fast parser combinators on arbitrary streams w... | 1 | 1 | 1 |
13757298dc1658f600d1a492b8c7c7699710bd49 | Markus Westerlind | 2018-01-21T22:03:51 | fix: Don't require SliceStream elements to be Clone | diff --git a/src/primitives.rs b/src/primitives.rs
index 7e5884e..2ee0ea7 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -950,17 +950,17 @@ impl<'a, T> Clone for SliceStream<'a, T> {
impl<'a, T> Positioned for SliceStream<'a, T>
where
- T: PartialEq + Clone + 'a,
+ T: PartialEq + 'a,
{
#[inli... | 1 | 6 | 6 |
73dc45e45e155e08dd121254a3ce7ebb31fe8894 | Markus Westerlind | 2018-01-24T20:52:30 | fix: Implement FullRangeStream for easy::Stream | diff --git a/src/easy.rs b/src/easy.rs
index ddf97e2..590b029 100644
--- a/src/easy.rs
+++ b/src/easy.rs
@@ -2,8 +2,8 @@ use std::any::Any;
use std::error::Error as StdError;
use std::fmt;
-use primitives::{EasyError, Info as PrimitiveInfo, ParseError, Positioned, RangeStream,
- RangeStreamOnce, Str... | 1 | 11 | 7 |
fe479d25b8963974505c84f211afe0cd39e3d012 | Markus Westerlind | 2018-01-23T22:40:09 | doc: Add no-std category | diff --git a/Cargo.toml b/Cargo.toml
index a91f474..d370d09 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -13,7 +13,7 @@ readme = "README.md"
keywords = ["parser", "parsing", "combinators", "ll"]
-categories = ["parsing"]
+categories = ["parsing", "no-std"]
license = "MIT" | 1 | 1 | 1 |
160aa054e69d74b0ba6728db468c5540c0c47e67 | Markus Westerlind | 2018-01-19T18:11:59 | feat: Accept arbitrary blocks in the parser! macro
This allows items to be put into `parser!` and should make error
messages clearer.
BREAKING CHANGE
`parser!` no longer works when the resulting parser contains borrows to
stack allocated values. This was necessary to support the improvements
and is also consistent w... | diff --git a/src/easy.rs b/src/easy.rs
index 448bed9..ddf97e2 100644
--- a/src/easy.rs
+++ b/src/easy.rs
@@ -464,11 +464,8 @@ impl<T, R> Error<T, R> {
}
/// Alias over `ParseError` for `StreamOnce` types
-pub type StreamErrors<S> = Errors<
- <S as StreamOnce>::Position,
- <S as StreamOnce>::Item,
- <S as S... | 3 | 29 | 57 |
afe76e7506d27def90edd8e421f493dcd8f0e6f7 | Markus Westerlind | 2018-01-19T13:58:45 | doc: Update the then example to use either | diff --git a/src/primitives.rs b/src/primitives.rs
index cec47ea..7e5884e 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -1537,6 +1537,8 @@ pub trait Parser {
/// Parses using `self` and then passes the value to `f` which returns a parser used to parse
/// the rest of the input.
///
+ /// S... | 1 | 6 | 11 |
243bad6d931122f0c518877c0b5e13ae1ff130ed | Markus Westerlind | 2018-01-19T13:56:21 | feat: Add the Either parser
This can be used to combine parsers of different types into a single
type so they can be returned | diff --git a/Cargo.toml b/Cargo.toml
index 7aceeba..a91f474 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,6 +24,7 @@ path = "src/lib.rs"
[dependencies]
ascii = "0.7.0"
byteorder = "1.1.0"
+either = "1"
regex = { version = "0.2.0", optional = true }
[dev-dependencies]
diff --git a/src/combinator.rs b/src/combin... | 4 | 118 | 23 |
9441b99b10d9f7eb8ca8b644b545cf08b3317a7a | Markus Westerlind | 2018-01-18T09:54:53 | fix: Don't require the Parser trait to be imported for parser! | diff --git a/src/lib.rs b/src/lib.rs
index b7a0bf3..6689670 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -417,7 +417,7 @@ macro_rules! combine_add_error {
) => { {
let mut parser = $parser;
{
- let _: &mut Parser<Input = $input_type, Output = $output_type> = &mut parser;
+ le... | 2 | 17 | 1 |
645a81473a5e501844ab12d1781c4a81b802c67c | Markus Westerlind | 2017-12-19T17:43:10 | Move more into add_errors | diff --git a/src/combinator.rs b/src/combinator.rs
index b90812c..db1f897 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -2442,24 +2442,35 @@ macro_rules! tuple_parser {
let mut current_parser = 0;
fn add_errors<Input2, $h $(, $id)*>(
+ input: &mut Input... | 1 | 19 | 19 |
e1f244dab489bab79c97c1b164fc5bc5f092dde4 | Markus Westerlind | 2017-12-19T17:29:51 | style: Run rustfmt 0.3.2 | diff --git a/src/buffered_stream.rs b/src/buffered_stream.rs
index b063235..19caac5 100644
--- a/src/buffered_stream.rs
+++ b/src/buffered_stream.rs
@@ -24,8 +24,7 @@ where
write!(
f,
"BufferedStreamRef {{ offset: {:?} buffer_offset: {:?} }}",
- self.offset,
- bu... | 10 | 82 | 90 |
10b20d82ac1d3718f9a4251da98488d2a5e8de6e | Markus Westerlind | 2017-12-19T14:40:21 | refactor: Factor out the slow path of the tuple parser
This should reduce the duplication in the tuple parser a bit though it
is mostly noticeable for tuples of arity greater than 2. | diff --git a/src/combinator.rs b/src/combinator.rs
index 96799a6..f99a8e9 100644
--- a/src/combinator.rs
+++ b/src/combinator.rs
@@ -682,7 +682,7 @@ macro_rules! tuple_choice_parser_inner {
&mut self,
input: Self::Input
) -> ConsumedResult<Self::Output, Self::Input> {
- ... | 1 | 27 | 10 |
0dba46ca7a8682e1a048dee7fc9b63d6a588ea21 | Markus Westerlind | 2017-11-28T21:31:40 | chore: Fix build error in the ini example due to globs | diff --git a/examples/ini.rs b/examples/ini.rs
index 5c2cc1d..bfa3042 100644
--- a/examples/ini.rs
+++ b/examples/ini.rs
@@ -134,6 +134,7 @@ type=LL(1)
assert_eq!(result, Ok(expected));
}
+#[cfg(feature = "std")]
#[test]
fn ini_error() {
let text = "[error";
@@ -143,9 +144,9 @@ fn ini_error() {
... | 1 | 4 | 3 |
a490dcde6335a8b24a1590dcdb5fdcbdb6f43523 | Markus Westerlind | 2017-10-11T22:00:40 | Version 3.0.0-alpha.4 | diff --git a/Cargo.toml b/Cargo.toml
index 7656c27..7aceeba 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "combine"
-version = "3.0.0-alpha.3"
+version = "3.0.0-alpha.4"
authors = ["Markus Westerlind <marwes91@gmail.com>"]
description = "Fast parser combinators on arbitrary streams w... | 1 | 1 | 1 |
e64c206400d1c27931f6310a39cd1bb579b58356 | Markus Westerlind | 2017-10-11T21:43:52 | Rename EasyInfo to Info | diff --git a/src/byte.rs b/src/byte.rs
index 0d29132..2683a40 100644
--- a/src/byte.rs
+++ b/src/byte.rs
@@ -5,7 +5,7 @@ use lib::marker::PhantomData;
use self::ascii::AsciiChar;
use combinator::{satisfy, skip_many, token, tokens, Expected, Satisfy, SkipMany, Token, With};
-use primitives::{ConsumedResult, EasyInfo... | 5 | 61 | 61 |
f9c27ecd506e35eb50bb283847322fdb82bc1fd6 | Markus Westerlind | 2017-10-11T20:25:50 | Fix the mp4 benchmark | diff --git a/benches/mp4.rs b/benches/mp4.rs
index 47bde9a..c28710a 100644
--- a/benches/mp4.rs
+++ b/benches/mp4.rs
@@ -15,6 +15,7 @@ use byteorder::{BigEndian, ByteOrder};
use combine::*;
use combine::range::{range, take};
+use combine::easy::StreamErrors;
#[derive(Clone, PartialEq, Eq, Debug)]
struct FileTyp... | 1 | 2 | 1 |
a58f6096639aa28361ee0fd5a981c3923ef6e722 | Markus Westerlind | 2017-10-11T19:30:57 | docs: Explain the easy module better | diff --git a/src/lib.rs b/src/lib.rs
index ab7acc4..49d6116 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -567,7 +567,7 @@ pub mod byte;
pub mod char;
/// Module containing stateful stream wrappers.
pub mod state;
-/// Module containing easy errors.
+/// Module containing easy to use and descriptive errors.
#[cfg(fea... | 2 | 4 | 1 |
6a23ddedcf7d9e9517eb46307246c3a68b87e7d7 | Markus Westerlind | 2017-10-11T18:23:56 | refactor: Remove the top level easy_parse function | diff --git a/src/char.rs b/src/char.rs
index 99a1912..2c43108 100644
--- a/src/char.rs
+++ b/src/char.rs
@@ -399,13 +399,12 @@ where
#[cfg(all(feature = "std", test))]
mod tests {
use super::*;
- use easy_parse;
use easy::{Error, ParseError};
use state::{SourcePosition, State};
#[test]
f... | 2 | 3 | 14 |
818d8629116fec8eef64494a938f0340c04d6ad6 | Markus Westerlind | 2017-09-19T18:21:39 | feat: Make the RangeStreamOnce function generic over the returned error
Makes them equivalent to `StreamOnce::uncons`
BREAKING CHANGE
Changes the signature of the `uncons` functions to be generic. | diff --git a/src/primitives.rs b/src/primitives.rs
index a2572c6..13aa318 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -532,13 +532,16 @@ where
pub trait RangeStreamOnce: StreamOnce {
/// Takes `size` elements from the stream.
/// Fails if the length of the stream is less than `size`.
- fn un... | 4 | 66 | 34 |
ab4f1cd06ae37dd6342add099337d52a1c3fea7b | Markus Westerlind | 2017-09-19T17:34:43 | Fix compilation of the benchmarks | diff --git a/benches/http.rs b/benches/http.rs
index 76b6f12..ec0a2c1 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -7,8 +7,9 @@ use bencher::{black_box, Bencher};
use std::fmt;
use combine::*;
-use combine::primitives::{RangeStream, SimpleStream, UnexpectedParse};
+use combine::primitives::{RangeStream, Un... | 3 | 25 | 17 |
10f90cf87e505f962fa558887b048d782527a0c9 | Markus Westerlind | 2017-09-19T17:32:00 | Fix compilation of the regex module | diff --git a/src/primitives.rs b/src/primitives.rs
index 8f1baa6..a2572c6 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -559,9 +559,8 @@ where
{
}
-
/// A `RangeStream` which is capable of providing it's entire range.
-pub trait FullRangeStream: RangeStreamOnce {
+pub trait FullRangeStream: RangeStream... | 2 | 21 | 21 |
c8b495b41a21cd71b62782f62bbae77f13f92fb7 | Markus Westerlind | 2017-09-18T19:59:36 | perf: Add inline annotations on error traits
Recovers all performance lost due to this addition | diff --git a/src/primitives.rs b/src/primitives.rs
index aa243a3..12aa154 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -204,54 +204,67 @@ where
Item: PartialEq,
Range: PartialEq,
{
+ #[inline]
fn unexpected_token(token: Item) -> Self {
Error::Unexpected(Info::Token(token))
... | 1 | 73 | 2 |
bee8f9cdb4281587c7c611922ecbe0dea2ab9f13 | Markus Westerlind | 2017-09-12T17:27:13 | Fix the test errors from introducing ParsingError | diff --git a/benches/http.rs b/benches/http.rs
index d0681fc..76b6f12 100644
--- a/benches/http.rs
+++ b/benches/http.rs
@@ -7,7 +7,7 @@ use bencher::{black_box, Bencher};
use std::fmt;
use combine::*;
-use combine::primitives::{RangeStream, SimpleStream};
+use combine::primitives::{RangeStream, SimpleStream, Unexp... | 7 | 185 | 129 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.