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 |
|---|---|---|---|---|---|---|---|
6a0edafe08534e3d7c3976c9bd2c639f08ac7f3e | Markus Westerlind | 2015-01-29T16:44:34 | Moved all char parsers into char.rs and renamed parser.rs to combinator.rs
As there are many possible character parsers that could be implemented and the parser.rs file was already becoming a large module I separated the two so that parsers could be added or perhaps even moved to a separate crate more easily. | diff --git a/src/char.rs b/src/char.rs
new file mode 100644
index 0000000..b287c03
--- /dev/null
+++ b/src/char.rs
@@ -0,0 +1,140 @@
+use primitives::{Consumed, Parser, ParseError, ParseResult, Error, State, Stream};
+use combinator::{FnParser, many, Many, Map, ParserExt};
+
+macro_rules! impl_char_parser {
+ ($name... | 3 | 156 | 148 |
e713d7c7e05b424e69982e7e627537882f7a9482 | Markus Westerlind | 2015-01-29T16:39:43 | Removed unnecessary char constraints for the input of a few parsers | diff --git a/src/parser.rs b/src/parser.rs
index de5eb22..77ffab3 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -126,7 +126,7 @@ pub fn many<F, P>(p: P) -> Many<F, P>
#[derive(Clone)]
pub struct Unexpected<I>(String);
impl <I> Parser for Unexpected<I>
- where I : Stream<Item=char> {
+ where I : Stream {
... | 1 | 8 | 9 |
c08b6ad085ca93cb3eb49e6122ea39e8d9614024 | Markus Westerlind | 2015-01-29T15:17:56 | Updated docs for parsers using FromIterator that type annotations may be required | diff --git a/src/parser.rs b/src/parser.rs
index 3c27f91..de5eb22 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -103,7 +103,10 @@ impl <F, P> Parser for Many<F, P>
}
}
-///Parses `p` zero or more times
+///Parses `p` zero or more times returning a collection with the values from `p`.
+///If the returned col... | 1 | 13 | 3 |
47d990d23ac9c49ee3c78be0179463d0cf776444 | Markus Westerlind | 2015-01-17T22:39:20 | The many and sep_by family of parsers use FromIterator to collect the values
By using FromIterator these kinds of parsers can turn their results into any sort of container instead of only a Vec. Most noticeably the chars and chars1 can be replaced by many and many1 parsers respectively.
The downside of this is that a... | diff --git a/src/lib.rs b/src/lib.rs
index 1878b96..392de13 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -13,18 +13,19 @@
//!
//!```
//! extern crate "parser-combinators" as parser_combinators;
-//! use parser_combinators::{spaces, chars1, sep_by, digit, satisfy, Parser, ParserExt};
+//! use parser_combinators::{spac... | 2 | 125 | 135 |
828068324c117b9b93cbd4fc0e9f3702e46602b1 | Markus Westerlind | 2015-01-28T14:16:47 | Increment cargo version number | diff --git a/Cargo.toml b/Cargo.toml
index f3b7e94..afa0ee8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "parser-combinators"
-version = "0.0.1"
+version = "0.0.2"
authors = ["Markus Westerlind <marwes91@gmail.com>"]
description = "Parser combinators based on the Haskell library par... | 1 | 1 | 1 |
c1b07ba29fead58cadc7ac78dae565b330f107e0 | Markus Westerlind | 2015-01-28T13:56:23 | Changed the interface of the parse function to be easier to use
It no longer exposes the Consumed or State types. If the old function is desired (new interface does not supply position information for example) it can be used as follows:
parser.parse(input) --> parser.parse_state(State::new(input)) | diff --git a/src/lib.rs b/src/lib.rs
index ca2448d..1878b96 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,7 +26,7 @@
//! //Call parse with the input to execute the parser
//! match integer_list.parse(input) {
//! Ok((value, _remaining_input)) => println!("{:?}", value),
-//! Err(err) => pri... | 3 | 25 | 27 |
bc41fb66563cd4cb0b8c47ce1b57b4c0f793c2e9 | Markus Westerlind | 2015-01-28T12:01:18 | Completely redesigned the consumed flag system
Instead of using Consumed as a flag it now has two constructors which hold the same type internally. With this new design parsers return the state or error wrapped in the Consumed enum and they pass the state without any Consume enum when calling other parsers. By using t... | diff --git a/src/lib.rs b/src/lib.rs
index 0988773..ca2448d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -26,7 +26,7 @@
//! //Call parse with the input to execute the parser
//! match integer_list.parse(input) {
//! Ok((value, _remaining_input)) => println!("{:?}", value),
-//! Err(err) => pri... | 3 | 142 | 109 |
20d35d26527e9c7edcb5d3632d21bd2b7782d5a7 | Markus Westerlind | 2015-01-28T12:22:26 | Fix infinite recursion for boxed parsers | diff --git a/src/lib.rs b/src/lib.rs
index 868a0bb..0988773 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -335,4 +335,10 @@ r"(3 * 4) + 2 * 4 * test + 4 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
assert_eq!(error.consumed, Consumed::Consumed);
assert_eq!(error.position, SourcePosition { line: 1, colu... | 2 | 7 | 1 |
02b6a61a20918d467f0e2e7555508e146d123d10 | Adolfo Ochagavía | 2015-01-27T10:28:27 | Fix error in documentation | diff --git a/src/parser.rs b/src/parser.rs
index ab5d41d..a5a87fe 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -251,7 +251,7 @@ impl <P> Parser for Chars1<P>
Ok((result, input))
}
}
-///Parses `p` zero or more times collecting into a string
+///Parses `p` one or more times collecting into a string
... | 1 | 1 | 1 |
48696b3ba90e5b88e6a95cb1fdb1f217a70e131a | Markus Westerlind | 2015-01-26T19:03:45 | Added metadata to the Cargo.toml file for upload to crates.io | diff --git a/Cargo.toml b/Cargo.toml
index 232c4a0..f3b7e94 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -4,6 +4,15 @@ name = "parser-combinators"
version = "0.0.1"
authors = ["Markus Westerlind <marwes91@gmail.com>"]
+description = "Parser combinators based on the Haskell library parsec"
+
+repository = "https://gi... | 1 | 9 | 0 |
8e0944baca22746c3c5489c550d6fc3f7e424394 | Markus Westerlind | 2015-01-26T10:59:15 | Add missing derive(Clone) on macro implemented parsers | diff --git a/src/parser.rs b/src/parser.rs
index 32d0147..ab5d41d 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -3,6 +3,7 @@ use primitives::{Parser, ParseResult, ParseError, Stream, State, Error, Consumed
macro_rules! impl_char_parser {
($name: ident ($($ty_var: ident),*), $inner_type: ty) => {
+ #[deri... | 1 | 2 | 0 |
067c7f07794eea42ad56ac1f97e34d9cc53810b5 | Markus Westerlind | 2015-01-26T10:41:10 | Added examples to the top level of the docs | diff --git a/src/lib.rs b/src/lib.rs
index f275558..83e7f51 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,6 +1,81 @@
#![allow(unstable)]
#![unstable]
+//!This crate contains parser combinators, roughly based on the Haskell library [parsec](http://hackage.haskell.org/package/parsec).
+//!
+//!A parser in this libra... | 1 | 75 | 0 |
1bcf399523b65419fd6fbe2485a1ee7bf9e590ab | Markus Westerlind | 2015-01-25T11:21:23 | Updated to work with newest nightly | diff --git a/src/lib.rs b/src/lib.rs
index 0f5da2d..f275558 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -229,14 +229,18 @@ r"(3 * 4) + 2 * 4 * test + 4 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
#[test]
fn sep_by_error_consume() {
let mut p = sep_by(string("abc"), satisfy(|c| c == ','));
- ... | 3 | 20 | 14 |
0845c401d75e683fef6f2262ebefd414cc6db112 | Markus Westerlind | 2015-01-24T13:21:43 | Fixed errors being reported at the wrong places
Now only messages are reported for the maximum length of consumed item and errors are only merged if they occured at the same place. | diff --git a/src/primitives.rs b/src/primitives.rs
index fee6783..df6c0fc 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -2,7 +2,7 @@ use std::fmt;
///Struct which containing the current position
-#[derive(Clone, Copy, Show, PartialEq)]
+#[derive(Clone, Copy, Show, Eq, PartialEq, Ord, PartialOrd)]
pub ... | 1 | 12 | 4 |
bc16c4606bc275a6f2a9981fa992f5bf1d8956b0 | Markus Westerlind | 2015-01-23T18:42:54 | Added doctests for several parsers | diff --git a/src/lib.rs b/src/lib.rs
index 43aefee..0f5da2d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -204,14 +204,6 @@ r"
}
}
- #[test]
- fn try_parser() {
- let mut p = try(string("let").skip(follow as fn (_) -> _)).map(|x| x.to_string())
- .or(chars1(satisfy(CharExt::is_alph... | 2 | 154 | 8 |
65efc81c155495d20eeccc4b7d148bcdbe3b3378 | Markus Westerlind | 2015-01-23T17:54:46 | Made all the primitive types and specific parser types public
Also documented all types that were made public through this change | diff --git a/src/lib.rs b/src/lib.rs
index e2ae4ad..43aefee 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,7 +4,9 @@
#[cfg(test)]
extern crate test;
+#[doc(inline)]
pub use primitives::{Parser, ParseResult, ParseError};
+#[doc(inline)]
pub use parser::{
any_char,
between,
@@ -28,8 +30,10 @@ pub use pars... | 3 | 43 | 4 |
02a0457101548f5dc693cda11d72210bdff69277 | Markus Westerlind | 2015-01-23T14:17:38 | Added a consume flag to state to always track consumption
Discovered an error where parsers would forget that they had already consumed some input when they reported errors. By tracking this in the state as well we can fix this. The solution is currently quite brittle so a better way of doing this would be good. | diff --git a/src/lib.rs b/src/lib.rs
index 17b6569..e2ae4ad 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -91,7 +91,12 @@ r"
.with(integer as fn(_) -> _)
.skip(many(space()))
.parse(source);
- assert_eq!(result, Ok((123i64, State { position: SourcePosition { line: 3, column: ... | 3 | 58 | 11 |
5dbe40ba5ceb89327bb01e26ea18ab881614b90d | Markus Westerlind | 2015-01-21T20:25:56 | Added 3 more parsers, 'value', 'unexpected' and 'not_followed_by' | diff --git a/src/lib.rs b/src/lib.rs
index 33c0879..17b6569 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -21,6 +21,9 @@ pub use parser::{
spaces,
string,
try,
+ value,
+ unexpected,
+ not_followed_by,
ParserExt
};
diff --git a/src/parser.rs b/src/parser.rs
index a1640e3..82ee8d7 100644
--... | 2 | 75 | 1 |
86e31d58242c2435b921588304c525d427181a7d | Markus Westerlind | 2015-01-21T19:14:59 | Documented the parse function | diff --git a/src/primitives.rs b/src/primitives.rs
index 711e206..68aa8f2 100644
--- a/src/primitives.rs
+++ b/src/primitives.rs
@@ -117,12 +117,12 @@ pub type ParseResult<O, I> = Result<(O, State<I>), ParseError>;
pub trait Stream : Clone {
type Item;
- fn uncons(self) -> Result<(<Self as Stream>::Item, Sel... | 1 | 8 | 6 |
05bfe4cac63af218dad413d46f59fb6d5b09ea96 | Markus Westerlind | 2015-01-21T19:02:49 | Added unstable attribute to the whole crate | diff --git a/src/lib.rs b/src/lib.rs
index 1b9530a..33c0879 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
#![allow(unstable)]
+#![unstable]
#[cfg(test)]
extern crate test; | 1 | 1 | 0 |
6fd98507586b09dd23f6cc9d47f48cda3c106881 | Markus Westerlind | 2015-01-21T18:56:41 | Fixed some warnings in tests + removed some unnecessary lifetimes | diff --git a/src/lib.rs b/src/lib.rs
index a8aabce..1b9530a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -17,6 +17,7 @@ pub use parser::{
satisfy,
sep_by,
space,
+ spaces,
string,
try,
@@ -216,7 +217,7 @@ r"(3 * 4) + 2 * 4 * test + 4 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
be... | 2 | 9 | 7 |
dc42b861b91e9e578f209530c43ce5b72ea44607 | Markus Westerlind | 2015-01-21T14:58:00 | Added macros to help define 'newtypes' around parsers created out of other parsers | diff --git a/src/parser.rs b/src/parser.rs
index c4a4d0e..6f70884 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -1,6 +1,45 @@
use primitives::{Parser, ParseResult, ParseError, Stream, State, Error, Consumed};
+macro_rules! impl_char_parser {
+ ($name: ident ($($ty_var: ident),*), $inner_type: ty) => {
+ ... | 1 | 41 | 2 |
67c1d573c77f0ab47edf6b2e896b4dd26c74d37e | Markus Westerlind | 2015-01-15T23:51:40 | Fixed many, chainl1 and optional parsers not taking into account the consumed flag | diff --git a/src/lib.rs b/src/lib.rs
index 549e28e..a8aabce 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -219,4 +219,23 @@ r"(3 * 4) + 2 * 4 * test + 4 * aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
::test::black_box(result);
})
}
+
+ #[test]
+ fn sep_by_error_consume() {
+ let mut... | 2 | 30 | 3 |
4d4237ed83c9d1e32d41836926a8d4de929cf5a7 | Markus Westerlind | 2015-01-15T23:02:08 | Since Parser can be unsized, change the Box<FnMut> impl into two seperate impls | diff --git a/src/parser.rs b/src/parser.rs
index c749a72..20cd2df 100644
--- a/src/parser.rs
+++ b/src/parser.rs
@@ -141,7 +141,7 @@ pub fn sep_by<P: Parser, S: Parser>(parser: P, separator: S) -> SepBy<P, S> {
}
-impl <'a, I: Stream, O> Parser for Box<FnMut(State<I>) -> ParseResult<O, I> + 'a> {
+impl <'a, I: Str... | 2 | 9 | 1 |
942d423dbee7b8ada6430634e7418dd295df6362 | Markus Westerlind | 2015-01-14T22:04:32 | Renamed the the parse functions to be easier on the user side
Renamed Parser::parse -> Parser::parse_state, Parser::start_parse -> Parser::parse | diff --git a/src/lib.rs b/src/lib.rs
index 0620292..549e28e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -35,7 +35,7 @@ mod tests {
fn integer<'a, I>(input: State<I>) -> ParseResult<i64, I>
where I: Stream<Item=char> {
let (s, input) = try!(chars1(digit())
- .parse(input));
+ ... | 3 | 61 | 61 |
057552fa1c5cac120fb3c80979a38f096b5cf0cd | Markus Westerlind | 2015-01-14T21:27:53 | Changed the digit parser to be a zero argument function returning the parser
While it is simple to write parsers directly as functions they require a cast (digit as fn (_) -> _) to be recognized as parsers. So now all exported parsers need returned through a function for consistency | diff --git a/src/lib.rs b/src/lib.rs
index e7cc955..0620292 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -34,7 +34,7 @@ mod tests {
fn integer<'a, I>(input: State<I>) -> ParseResult<i64, I>
where I: Stream<Item=char> {
- let (s, input) = try!(chars1(digit as fn(_) -> _)
+ let (s, input) = t... | 2 | 16 | 11 |
120abf207b015dcc1f4db59a2d55e695f4b98019 | Markus Westerlind | 2015-01-14T21:01:20 | Separated the primitive types and the parsers in to two modules | diff --git a/src/lib.rs b/src/lib.rs
index f8a9dae..e7cc955 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,650 +3,33 @@
#[cfg(test)]
extern crate test;
-use std::fmt;
-
-
-
-#[derive(Clone, Copy, Show, PartialEq)]
-pub struct SourcePosition {
- line: i32,
- column: i32
-}
-impl SourcePosition {
- fn start(... | 3 | 667 | 645 |
e3f0eb5f8fa8fdaedb53d13658d855b50e79c2b9 | Markus Westerlind | 2015-01-14T20:07:37 | Rename char -> any_char | diff --git a/src/lib.rs b/src/lib.rs
index 8d29ea1..f8a9dae 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -181,7 +181,7 @@ impl <'a, I, O, P> Parser for &'a mut P
}
///Parses any character
-pub fn char<'a, I>(input: State<I>) -> ParseResult<char, I>
+pub fn any_char<'a, I>(input: State<I>) -> ParseResult<char, I>
... | 1 | 1 | 1 |
703be72b42719464f143083523f54663ec2e108f | Markus Westerlind | 2015-01-14T19:41:31 | Added benchmark | diff --git a/src/lib.rs b/src/lib.rs
index 0bc1644..8d29ea1 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,12 @@
#![allow(unstable)]
+
+#[cfg(test)]
+extern crate test;
+
use std::fmt;
+
#[derive(Clone, Copy, Show, PartialEq)]
pub struct SourcePosition {
line: i32,
@@ -707,7 +712,7 @@ r"
Int(... | 1 | 29 | 1 |
8f3fd5c55f96477b4ba40cd57a968e1f2e680f10 | Markus Westerlind | 2015-01-13T21:30:46 | Added Clone for parsers which did not have it | diff --git a/src/lib.rs b/src/lib.rs
index 489c020..0bc1644 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -465,6 +465,7 @@ pub fn between<I, L, R, P>(open: L, close: R, parser: P) -> Between<L, R, P>
open.with(parser).skip(close)
}
+#[derive(Clone)]
pub struct With<P1, P2>(P1, P2) where P1: Parser, P2: Parser;
... | 1 | 11 | 0 |
566a67d29020bd075faf14ac3a378e36a9bb52e1 | Markus Westerlind | 2015-01-13T21:29:12 | Added chars and chars1 parsers which works as many/many1 but collects into a string | diff --git a/src/lib.rs b/src/lib.rs
index a364774..489c020 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -181,18 +181,20 @@ pub fn char<'a, I>(input: State<I>) -> ParseResult<char, I>
input.uncons_char()
}
-pub struct ManyAppend<'a, O: 'a, P: Parser<Output=O> + 'a> {
- parser: P,
- vec: &'a mut Vec<O>
-}
-... | 1 | 62 | 24 |
c56c63222e498ed40b224b6ea2e96703556ea045 | Markus Westerlind | 2015-01-13T20:53:08 | Added the try parser | diff --git a/src/lib.rs b/src/lib.rs
index 1ea8e96..a364774 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -528,6 +528,28 @@ pub fn chainl1<'a, I, O, P, Op>(parser: P, op: Op) -> Chainl1<P, Op>
Chainl1(parser, op)
}
+pub struct Try<P>(P);
+impl <I, O, P> Parser for Try<P>
+ where I: Stream
+ , P: Parser<... | 1 | 44 | 12 |
29d3822128af7ddc05967d9e9ec32fb7d20bef57 | Markus Westerlind | 2015-01-13T12:11:17 | Added a flag to ParseError indicating whether the parser has consumed any input
Without any indication of consumption every parser 'p' was like using 'try p' in Haskells parsec. Now the parsers should be LL(1) which makes sure that error messages actually report the correct position | diff --git a/src/lib.rs b/src/lib.rs
index 6039161..1ea8e96 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -28,15 +28,22 @@ enum Error {
Message(String)
}
+#[derive(Clone, PartialEq, Show)]
+enum Consumed {
+ Consumed,
+ Empty
+}
+
#[derive(Clone, Show, PartialEq)]
pub struct ParseError {
position: So... | 1 | 45 | 9 |
3f3e00204d560187fee82fe9388b49ac23ebb44f | Markus Westerlind | 2015-01-13T10:02:37 | Added chainl1 parser | diff --git a/src/lib.rs b/src/lib.rs
index e6aff20..6039161 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -484,6 +484,37 @@ impl <I, A, B, P, F> Parser for Map<P, F, B>
}
}
}
+pub struct Chainl1<P, Op>(P, Op);
+impl <'a, I, O, P, Op> Parser for Chainl1<P, Op>
+ where I: Stream
+ , P: Parser<Input... | 1 | 68 | 7 |
6b687b271329bd17f2fba33f4333a8f47ca52416 | Markus Westerlind | 2015-01-12T21:40:31 | Add formatting for the error types | diff --git a/src/lib.rs b/src/lib.rs
index 9c2a8ba..e6aff20 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,4 +1,5 @@
#![allow(unstable)]
+use std::fmt;
#[derive(Clone, Copy, Show, PartialEq)]
@@ -30,30 +31,54 @@ enum Error {
#[derive(Clone, Show, PartialEq)]
pub struct ParseError {
position: SourcePosition... | 1 | 31 | 6 |
e2b1f026ebeb0583f969bbda718c07666a82f802 | Markus Westerlind | 2015-01-12T19:13:48 | Removed the Env struct
It was only used once and it was easily removed (and simplified) | diff --git a/src/lib.rs b/src/lib.rs
index f5200d4..9c2a8ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -230,12 +230,8 @@ impl <P, S> Parser for SepBy<P, S>
}
Err(_) => return Ok((result, input))
}
- let rest = FnParser(|input| {
- let mut env = Env::new(input);
- ... | 1 | 2 | 28 |
76222d5e29a82418062b8364c9cfcb843e67aabd | Markus Westerlind | 2015-01-12T17:12:15 | Added Error enum to represent specific errors | diff --git a/src/lib.rs b/src/lib.rs
index 93fece8..f5200d4 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -20,25 +20,35 @@ impl SourcePosition {
}
}
+#[derive(Clone, PartialEq, Show)]
+enum Error {
+ Unexpected(char),
+ Expected(String),
+ Message(String)
+}
+
#[derive(Clone, Show, PartialEq)]
-pub stru... | 1 | 27 | 16 |
9390625a21b68e45ae1112c1dd688d8ce288d3c7 | Markus Westerlind | 2015-01-12T16:30:17 | Errors have the correct line/row and does not store duplicate messages | diff --git a/src/lib.rs b/src/lib.rs
index 8f9f592..93fece8 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,22 +27,23 @@ pub struct Error {
}
impl Error {
+ fn new(position: SourcePosition, message: String) -> Error {
+ Error { position: position, messages: vec![message] }
+ }
pub fn add_message(&... | 1 | 54 | 39 |
2890bf495cc71896a98a54de51fb2ac69da4374b | Markus Westerlind | 2015-01-12T11:17:05 | Require all types implementing Stream to also be Clone
Since Parser already required type Input: Stream + Clone; this allows us to skip an explicit clone bound every time we create a new parser without losing any generality.
Streams that can't be cloned do not make much sense anyway as any interesting parser will req... | diff --git a/src/lib.rs b/src/lib.rs
index ed6feef..8f9f592 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -77,12 +77,12 @@ impl <I: Stream<Item=char>> State<I> {
pub type ParseResult<O, I> = Result<(O, State<I>), Error>;
-pub trait Stream {
+pub trait Stream : Clone {
type Item;
fn uncons(self) -> Result<(... | 1 | 23 | 23 |
b7ff91b400efc2faacc6d1f9f63edb66cec2d6c9 | Markus Westerlind | 2015-01-12T11:02:20 | Added some short documentation on the exported parsers | diff --git a/src/lib.rs b/src/lib.rs
index 6f2453d..ed6feef 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -77,7 +77,6 @@ impl <I: Stream<Item=char>> State<I> {
pub type ParseResult<O, I> = Result<(O, State<I>), Error>;
-
pub trait Stream {
type Item;
fn uncons(self) -> Result<(<Self as Stream>::Item, Self... | 1 | 36 | 10 |
8c5c28331f58f48a6586eebfdb0a401bf63d37b1 | Markus Westerlind | 2015-01-12T10:38:41 | Added between parser
Implemented as a type synonym as a test for now to see if error messages are good enough or if proper newtypes are needed | diff --git a/src/lib.rs b/src/lib.rs
index 8c92724..6f2453d 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -381,6 +381,14 @@ pub fn digit<'a, I>(input: State<I>) -> ParseResult<char, I>
}
}
+pub type Between<L, R, P> = Skip<With<L, P>, R>;
+pub fn between<I, L, R, P>(open: L, close: R, parser: P) -> Between<L, R, ... | 1 | 29 | 10 |
9697ea7e84a5521fb02c3edaa6408d91ed932177 | Markus Westerlind | 2015-01-12T08:33:49 | Renamed and_then to and | diff --git a/src/lib.rs b/src/lib.rs
index 0a5914c..8c92724 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -314,8 +314,8 @@ pub fn string<I>(s: &str) -> StringP<I>
}
#[derive(Clone)]
-pub struct AndThen<P1, P2>(P1, P2);
-impl <I, A, B, P1, P2> Parser for AndThen<P1, P2>
+pub struct And<P1, P2>(P1, P2);
+impl <I, A, B,... | 1 | 7 | 11 |
8b9fbeb3d58ac4fd8851a6ac04ca9d874dbc902f | Markus Westerlind | 2015-01-12T08:31:20 | Added Or combinator
Or implments a choice between two parsers similiar to || | diff --git a/src/lib.rs b/src/lib.rs
index aad888a..0a5914c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -30,6 +30,10 @@ impl Error {
pub fn add_message(&mut self, message: String) {
self.messages.push(message);
}
+ fn merge(mut self, other: Error) -> Error {
+ self.messages.extend(other.mes... | 1 | 62 | 0 |
a122ff6b3c00d303ae7b6a45ef45a4ad84bed020 | Markus Westerlind | 2015-01-12T00:43:44 | Added a State<I> type which keeps track of where in the input the parser is | diff --git a/src/lib.rs b/src/lib.rs
index ac62ae0..aad888a 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,8 +4,22 @@
#[derive(Clone, Copy, Show, PartialEq)]
pub struct SourcePosition {
line: i32,
- row: i32
+ column: i32
}
+impl SourcePosition {
+ fn start() -> SourcePosition {
+ SourcePosition... | 1 | 116 | 45 |
6141787c24e2c4c639c2636f7031e6be1375608f | Markus Westerlind | 2015-01-11T19:02:08 | Added a more informative Error type
Will likely need changes to be more efficient in its size and to avoid allocating everywhere but it can give some informative error messages atleast. | diff --git a/src/lib.rs b/src/lib.rs
index d97c0f9..ac62ae0 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,26 @@
#![allow(unstable)]
+
+#[derive(Clone, Copy, Show, PartialEq)]
+pub struct SourcePosition {
+ line: i32,
+ row: i32
+}
#[derive(Clone, Show, PartialEq)]
-pub struct Error;
+pub struct Error {
... | 1 | 52 | 10 |
dbd46c6e17a071ba5df5d7c9b1103db71702397c | Markus Westerlind | 2015-01-11T23:41:54 | Changd many1 implementation to not used Boz<Parser> which caused ICE | diff --git a/src/lib.rs b/src/lib.rs
index b3ca3ec..d97c0f9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -103,14 +103,20 @@ pub fn many<P: Parser>(p: P) -> Many<P> {
Many { parser: p }
}
-pub fn many1<'a, P: Clone + 'a>(mut p: P) -> Box<Parser<Input=<P as Parser>::Input, Output=Vec<<P as Parser>::Output>> + 'a>
... | 1 | 12 | 6 |
fb9ea2886e5bbbb4441af24b76b2f40b692646c1 | Markus Westerlind | 2015-01-11T17:37:20 | Added ParserExt trait to allow chaining of combinators | diff --git a/src/lib.rs b/src/lib.rs
index 9fe6c75..b3ca3ec 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -298,18 +298,47 @@ pub fn digit<'a, I>(input: I) -> ParseResult<char, I>
}
}
-pub trait ParserExt {
- fn and_then<P>(self, P) -> AndThen<Self, P>
- where P: Parser;
+
+pub struct With<P1, P2>(P1, P2... | 1 | 37 | 9 |
d7a3aa66446148abdbf93ceef17ba8a8c41d86dc | Markus Westerlind | 2015-01-11T16:37:39 | Added Stream trait which abstracts over input
Stream is implemented for iterators, &str and &[T] | diff --git a/src/lib.rs b/src/lib.rs
index 470eeae..9fe6c75 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,18 +1,54 @@
#![allow(unstable)]
-#[derive(Show, PartialEq)]
+#[derive(Clone, Show, PartialEq)]
pub struct Error;
pub type ParseResult<O, I> = Result<(O, I), Error>;
+pub trait Stream {
+ type Item;
+... | 1 | 129 | 53 |
993154c8c2d131868dc6ba4820a7baa6ec426318 | Markus Westerlind | 2015-01-11T15:04:36 | Use ParseResult everywhere | diff --git a/src/lib.rs b/src/lib.rs
index 64188dd..470eeae 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -4,20 +4,18 @@
pub struct Error;
pub type ParseResult<O, I> = Result<(O, I), Error>;
-pub type StrResult<'a, O> = ParseResult<O, &'a str>;
pub trait Parser {
type Input: Clone;
type Output;
- fn... | 1 | 13 | 15 |
b61456ba22ae7d0963483c5d36ea1ba5a1f71ff2 | Markus Westerlind | 2015-01-11T14:52:21 | Added FnParser and ManyAppend
FnParser allows closures to be used as parsers.
ManyAppend is used similiar to Many but appends the output to an already created Vec. Together with ManyAppend it is used to avoid the prepend many1 and eliminiated some duplication from sep_by | diff --git a/src/lib.rs b/src/lib.rs
index 2dd0773..64188dd 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -29,23 +29,40 @@ pub fn char<'a>(input: &'a str) -> ParseResult<char, &'a str> {
}
}
-pub struct Many<P> {
- parser: P
+pub struct ManyAppend<'a, O: 'a, P: Parser<Output=O> + 'a> {
+ parser: P,
+ vec... | 1 | 48 | 28 |
53a7d9d841d36668b468b421b92ad5b58bdb210a | Markus Westerlind | 2015-01-11T14:16:12 | Implemented simple combinators following what exists in parsec
sep_by, many, satisfy, digit, space, char, optional
How they are actually implemented varies a bit as different implementation techniques were tried | diff --git a/src/lib.rs b/src/lib.rs
new file mode 100644
index 0000000..2dd0773
--- /dev/null
+++ b/src/lib.rs
@@ -0,0 +1,264 @@
+#![allow(unstable)]
+
+#[derive(Show, PartialEq)]
+pub struct Error;
+
+pub type ParseResult<O, I> = Result<(O, I), Error>;
+pub type StrResult<'a, O> = ParseResult<O, &'a str>;
+
+
+pub tr... | 1 | 264 | 0 |
817be47528cfce588e326c7e6031f991d8cb61de | Cody Wyatt Neiman | 2026-02-16T16:16:47 | chore: remove SIMD LaneCount, SupportedLaneCount with upstream changes | diff --git a/roaring/src/bitmap/store/array_store/vector.rs b/roaring/src/bitmap/store/array_store/vector.rs
index 94f7ab3b..6fc14a9a 100644
--- a/roaring/src/bitmap/store/array_store/vector.rs
+++ b/roaring/src/bitmap/store/array_store/vector.rs
@@ -12,9 +12,7 @@
use super::scalar;
use core::simd::cmp::{SimdPartia... | 1 | 3 | 15 |
d9ad2778f1857329e49baba35fb5293d28e1ed8a | Clément Renault | 2026-02-24T12:56:59 | Make clippy happy | diff --git a/roaring/src/bitmap/inherent.rs b/roaring/src/bitmap/inherent.rs
index cbaa6b5d..72b4fc2b 100644
--- a/roaring/src/bitmap/inherent.rs
+++ b/roaring/src/bitmap/inherent.rs
@@ -101,7 +101,7 @@ impl RoaringBitmap {
result
}
- if offset % 8 != 0 {
+ if !offset.is_multiple_o... | 1 | 1 | 1 |
ebf36a0f3ad32e753e8458c8df025813a2454725 | Lucas Van Laer | 2026-01-09T09:59:33 | fix: overflow on 32-bit builds | diff --git a/roaring/src/treemap/inherent.rs b/roaring/src/treemap/inherent.rs
index 8f27f9f5..bbc89f0a 100644
--- a/roaring/src/treemap/inherent.rs
+++ b/roaring/src/treemap/inherent.rs
@@ -318,7 +318,8 @@ impl RoaringTreemap {
/// assert!(rb.is_full());
/// ```
pub fn is_full(&self) -> bool {
- ... | 1 | 2 | 1 |
e8a7c6e662576cf3eabba82a54c39c578136f1a2 | Lucas Van Laer | 2025-12-23T11:15:05 | feat: impl Clone on tree_map Iter | diff --git a/roaring/src/treemap/iter.rs b/roaring/src/treemap/iter.rs
index b11f1c3e..36a0bc16 100644
--- a/roaring/src/treemap/iter.rs
+++ b/roaring/src/treemap/iter.rs
@@ -7,6 +7,7 @@ use crate::bitmap::IntoIter as IntoIter32;
use crate::bitmap::Iter as Iter32;
use crate::{NonSortedIntegers, RoaringBitmap, Roaring... | 1 | 4 | 0 |
d28fc9453ff620cfa031fe2894cf5b5fa6a21646 | Kerollmops | 2025-12-15T08:13:07 | Make clippy happy | diff --git a/roaring/src/bitmap/store/array_store/mod.rs b/roaring/src/bitmap/store/array_store/mod.rs
index 173b7def..61967704 100644
--- a/roaring/src/bitmap/store/array_store/mod.rs
+++ b/roaring/src/bitmap/store/array_store/mod.rs
@@ -150,7 +150,7 @@ impl ArrayStore {
}
pub fn push(&mut self, index: u16... | 2 | 3 | 3 |
342e9ffc0e8f09d2fe9a223bb861da6fbd48e51c | Kerollmops | 2025-12-15T08:07:50 | Bump version to v0.11.3 | diff --git a/roaring/Cargo.toml b/roaring/Cargo.toml
index 25557999..0daf46b7 100644
--- a/roaring/Cargo.toml
+++ b/roaring/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "roaring"
-version = "0.11.2"
+version = "0.11.3"
# When changing this value don't forget to change the MSRV test in `.github/workflows/test.yml`!!
... | 1 | 1 | 1 |
1bd8c7466d35ed6c5d152b2e92ba0e37ba62030d | Cormac Relf | 2025-11-27T01:28:48 | Impl Eq for Store, Container, RoaringBitmap, RoaringTreemap | diff --git a/roaring/src/bitmap/container.rs b/roaring/src/bitmap/container.rs
index 49a6564b..b11a6446 100644
--- a/roaring/src/bitmap/container.rs
+++ b/roaring/src/bitmap/container.rs
@@ -13,7 +13,7 @@ pub const RUN_MAX_SIZE: u64 = 2048;
#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
-#[derive(PartialEq, Clon... | 4 | 6 | 3 |
9a363f51832adae641cdaed4ac2f11f0fd606414 | Cormac Relf | 2025-11-27T01:25:02 | Clarify why Array != Bitmap store
This ensures if we ever added another variant, we would have to consider the variants
in PartialEq. | diff --git a/roaring/src/bitmap/store/mod.rs b/roaring/src/bitmap/store/mod.rs
index c57d3afe..13403cd9 100644
--- a/roaring/src/bitmap/store/mod.rs
+++ b/roaring/src/bitmap/store/mod.rs
@@ -846,7 +846,8 @@ impl PartialEq for Store {
run.len() == bitmap.len()
&& run.iter_intervals(... | 1 | 2 | 1 |
d9114be20f23e1721e91dae4133b4c6dad334a5c | Clément Renault | 2025-09-18T13:55:47 | Fix documentation of the last_contiguous_range_len function | diff --git a/roaring/src/bitmap/store/array_store/mod.rs b/roaring/src/bitmap/store/array_store/mod.rs
index eafb90e3..173b7def 100644
--- a/roaring/src/bitmap/store/array_store/mod.rs
+++ b/roaring/src/bitmap/store/array_store/mod.rs
@@ -41,7 +41,7 @@ pub(crate) fn first_contiguous_range_len(slice: &[u16]) -> usize {
... | 1 | 1 | 1 |
7bf690cb82d5f4aa7fb7b9ee5ba037893c0151fb | Zachary Dremann | 2025-07-21T01:34:25 | feat: Iter::next_range and next_range_back
Provide an optimal way to iterate over the ranges of a bitmap | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 34f32ab1..fc33a58f 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -139,7 +139,7 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "roaring"
-version = "0.11.1"
+version = "0.11.2"
dependencies = [
"bytem... | 9 | 1,194 | 38 |
136b8f1e7a4807a0662e07646b8a03c1beb7b06d | Zachary Dremann | 2025-07-30T01:04:44 | fix: bitmap advance_back_to could violate invariants
Bitmap container iterators require the front key <= the back key at all
times, but advance_back_to could violate this. This shouldn't have
really caused any misbehavior, but would trigger a debug assertion. | diff --git a/roaring/src/bitmap/store/bitmap_store.rs b/roaring/src/bitmap/store/bitmap_store.rs
index 0503e655..c1a4acde 100644
--- a/roaring/src/bitmap/store/bitmap_store.rs
+++ b/roaring/src/bitmap/store/bitmap_store.rs
@@ -551,7 +551,11 @@ impl<B: Borrow<[u64; BITMAP_LENGTH]>> BitmapIter<B> {
} els... | 2 | 18 | 1 |
e18216a231f767ca3878dad02b2681610cc49679 | Clément Renault | 2025-07-26T09:24:20 | Bump roaring to v0.11.2 | diff --git a/roaring/Cargo.toml b/roaring/Cargo.toml
index 8fc90709..25557999 100644
--- a/roaring/Cargo.toml
+++ b/roaring/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "roaring"
-version = "0.11.1"
+version = "0.11.2"
# When changing this value don't forget to change the MSRV test in `.github/workflows/test.yml`!!
... | 1 | 1 | 1 |
03b35521df49d31fca3817b51ec8c1ff900e61ed | Zachary Dremann | 2025-07-26T02:10:24 | tests: correct test, after advance_to, don't return anything less | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 37c41f09..185a719e 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -2454,7 +2454,7 @@ mod tests {
iter.advance_to(800);
assert_eq!(iter... | 1 | 1 | 1 |
8becb4e1eba51112b6aba22365fec662e5f09122 | Zachary Dremann | 2025-07-25T02:16:21 | fix: another case where we need to use both offsets when only one interval remains | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index a40767cb..37c41f09 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -829,9 +829,14 @@ impl<I: SliceIterator<Interval>> Iterator for RunIter<I> {
... | 2 | 18 | 3 |
d25797eac9e30f3bb3c962f25a8fa593cdca6588 | Zachary Dremann | 2025-07-25T02:16:21 | fix: change interval iter remaining_size to use saturing subtraction
include a debug assert to still catch the issues, but hopefully do less wrong behavior in release mode | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 461f7446..a40767cb 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -693,9 +693,10 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
}
fn remai... | 1 | 4 | 3 |
527e0946615ba9dfec061a6fd6bea56339efa2a0 | Zachary Dremann | 2025-07-25T01:40:23 | fix: another case where offsets could be non-zero with no intervals | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 50b8b65a..461f7446 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -660,15 +660,15 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
self.for... | 2 | 21 | 6 |
497f5d922496525134a0f5ff88c720bce545d33b | Zachary Dremann | 2025-07-24T20:37:06 | fix: zero out offsets when consuming an iterator | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 50d65ca4..50b8b65a 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -731,6 +731,8 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
if ind... | 2 | 15 | 0 |
c41bab3f0eb50b26b25cef4c066608add6c63f01 | Zachary Dremann | 2025-07-24T02:15:20 | fix: when consuming a full run, reset the current offset | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 0ab42a77..50d65ca4 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -657,6 +657,7 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
self.forwa... | 2 | 27 | 0 |
eaccd090783fae53124c054b88afa953a31a83af | Zachary Dremann | 2025-07-24T01:33:20 | fix: correctly empty bitmap container iter when advancing past the back | diff --git a/roaring/src/bitmap/store/bitmap_store.rs b/roaring/src/bitmap/store/bitmap_store.rs
index dbfdc61f..0503e655 100644
--- a/roaring/src/bitmap/store/bitmap_store.rs
+++ b/roaring/src/bitmap/store/bitmap_store.rs
@@ -515,6 +515,9 @@ impl<B: Borrow<[u64; BITMAP_LENGTH]>> BitmapIter<B> {
} else... | 2 | 14 | 0 |
318366d041d958d59bef3e51569ecb452a1ea893 | Zachary Dremann | 2025-07-24T01:33:20 | fix: nth where n > u16::MAX is now correct | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 372eb264..0ab42a77 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -808,6 +808,13 @@ impl<I: SliceIterator<Interval>> Iterator for RunIter<I> {
}
... | 2 | 16 | 0 |
6555872e27cf7d18a1aac0963109a752d5a8b943 | Zachary Dremann | 2025-07-23T21:53:43 | fix: when advancing a run iter, check if we've reached the other size of the only interval if present | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 76772ad9..372eb264 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -712,7 +712,18 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
if le... | 2 | 34 | 2 |
61a27888b73afe81911fb7bb9bc0c4cf41bb5632 | Zachary Dremann | 2025-07-23T21:28:07 | fix: run iterators need to respect the back_offset when only one interval remains | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 98bd28d8..76772ad9 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -659,9 +659,13 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
self.inte... | 2 | 22 | 6 |
3116bccab187a639238cd50754935400a433a3c5 | Zachary Dremann | 2025-07-23T20:47:56 | fix: when advancing past the begin/end of a range container's iter, consume the whole thing
Before, the iterator would be left alone, rather than consumed when
calling `advance_to`/`advance_back_to` past all values in the container. | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index f4ae015e..98bd28d8 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -712,6 +712,8 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
}
... | 2 | 22 | 0 |
d9c476b55a248a4283e14be4125fa892d1e53fbc | Zachary Dremann | 2025-07-23T20:20:33 | add fuzzing to the iterator | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 06687e27..34f32ab1 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -139,7 +139,7 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "roaring"
-version = "0.11.0"
+version = "0.11.1"
dependencies = [
"bytem... | 3 | 119 | 2 |
f8fe950440047ddd98ca498506b2aae10cd7b89a | Zachary Dremann | 2025-07-23T22:28:01 | fix: clippy findings | diff --git a/roaring/src/bitmap/ops_with_serialized.rs b/roaring/src/bitmap/ops_with_serialized.rs
index e3808803..3bae76c0 100644
--- a/roaring/src/bitmap/ops_with_serialized.rs
+++ b/roaring/src/bitmap/ops_with_serialized.rs
@@ -75,13 +75,13 @@ impl RoaringBitmap {
let size = ((cookie >> 16) + 1) as ... | 4 | 14 | 14 |
1c535b5336ecd516f5ca71a1bf8711b37e67970f | Kerollmops | 2025-07-16T11:32:48 | Bump version to 0.11.1 | diff --git a/roaring/Cargo.toml b/roaring/Cargo.toml
index 41843b64..f64fba18 100644
--- a/roaring/Cargo.toml
+++ b/roaring/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "roaring"
-version = "0.11.0"
+version = "0.11.1"
rust-version = "1.65.0"
authors = ["Wim Looman <wim@nemo157.com>", "Kerollmops <kero@meilisearch.c... | 1 | 1 | 1 |
186f3fda63bb6b7820161bb7460acedb69c12e56 | Zachary Dremann | 2025-07-10T14:49:24 | add an implementation using intrinsics for swizzle_to_front for ssse3 | diff --git a/roaring/src/bitmap/store/array_store/vector.rs b/roaring/src/bitmap/store/array_store/vector.rs
index 89b30d42..ad4bfb1a 100644
--- a/roaring/src/bitmap/store/array_store/vector.rs
+++ b/roaring/src/bitmap/store/array_store/vector.rs
@@ -498,9 +498,6 @@ fn simd_merge_u16(a: Simd<u16, 8>, b: Simd<u16, 8>) -... | 1 | 26 | 3 |
641cdf17cc43fcaaf4d24b4c4956de4613d07fbd | Zachary Dremann | 2025-07-10T00:39:04 | use a dynamic swizzle for `swizzle_to_front` | diff --git a/roaring/src/bitmap/store/array_store/vector.rs b/roaring/src/bitmap/store/array_store/vector.rs
index 2e33b753..89b30d42 100644
--- a/roaring/src/bitmap/store/array_store/vector.rs
+++ b/roaring/src/bitmap/store/array_store/vector.rs
@@ -13,7 +13,7 @@
use super::scalar;
use core::simd::cmp::{SimdPartialE... | 1 | 42 | 278 |
cdb1d5333e3d483ec4e2c9a594f29a66203e189b | Zachary Dremann | 2025-07-09T03:19:48 | fix: do not accidently remove zeros in vector sub
Previously, we filled a partial buffer with the integers to remove, but
the rest of the buffer would be filled with zeros, which could mean we
could end up removing a zero from the bitmap even if zero was not in the
list of values to remove. | diff --git a/roaring/src/bitmap/store/array_store/vector.rs b/roaring/src/bitmap/store/array_store/vector.rs
index 2e33b753..8db8bdf5 100644
--- a/roaring/src/bitmap/store/array_store/vector.rs
+++ b/roaring/src/bitmap/store/array_store/vector.rs
@@ -331,11 +331,20 @@ pub fn sub(lhs: &[u16], rhs: &[u16], visitor: &mut ... | 2 | 31 | 5 |
2e36231e7846b05df7146d4ac37ef4aa0232e474 | Zachary Dremann | 2025-05-01T02:31:17 | add internal validate to the fuzzer | diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml
index 8d9b3465..0ecade04 100644
--- a/fuzz/Cargo.toml
+++ b/fuzz/Cargo.toml
@@ -12,6 +12,9 @@ libfuzzer-sys = { version = "0.4.9", features = ["arbitrary-derive"] }
roaring = { path = "../roaring" }
croaring = "2.0"
+[features]
+simd = ["roaring/simd"]
+
[[bin]]
name... | 2 | 5 | 0 |
54c4f74c6a6fee38a300998f419e1916d06bb3fa | Zachary Dremann | 2025-05-01T01:30:31 | add internal validate function | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index a3e19555..06687e27 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -139,7 +139,7 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5"
[[package]]
name = "roaring"
-version = "0.10.12"
+version = "0.11.0"
dependencies = [
"byte... | 6 | 81 | 1 |
5e2d93efc858524ee773f0727f7d3482fb78d841 | Kerollmops | 2025-06-17T16:50:08 | Fix documentation | diff --git a/roaring/src/lib.rs b/roaring/src/lib.rs
index 32ee31ad..f6c4453b 100644
--- a/roaring/src/lib.rs
+++ b/roaring/src/lib.rs
@@ -33,7 +33,7 @@ pub mod treemap;
pub use bitmap::RoaringBitmap;
pub use treemap::RoaringTreemap;
-/// An error type that is returned when a push in a bitmap did not succeed.
+/// ... | 1 | 1 | 1 |
86a78219fcd8dad48395d07f82549994dcb57879 | Kerollmops | 2025-06-17T15:45:37 | Introduce a new try_push method | diff --git a/roaring/src/bitmap/inherent.rs b/roaring/src/bitmap/inherent.rs
index baaf834c..e34f2b84 100644
--- a/roaring/src/bitmap/inherent.rs
+++ b/roaring/src/bitmap/inherent.rs
@@ -316,7 +316,30 @@ impl RoaringBitmap {
/// assert_eq!(rb.iter().collect::<Vec<u32>>(), vec![1, 3, 5]);
/// ```
#[inline... | 2 | 49 | 3 |
dec5564a7fe2cc24dde131a466096233a4fc9357 | Kerollmops | 2025-06-17T15:31:35 | Change the API of the push method to return a Result | diff --git a/roaring/src/bitmap/inherent.rs b/roaring/src/bitmap/inherent.rs
index f5981a79..baaf834c 100644
--- a/roaring/src/bitmap/inherent.rs
+++ b/roaring/src/bitmap/inherent.rs
@@ -3,7 +3,7 @@ use core::mem::size_of;
use core::ops::{RangeBounds, RangeInclusive};
use crate::bitmap::store::BITMAP_LENGTH;
-use c... | 3 | 23 | 7 |
06230d10f087e1f445c5986bfac708acb26f51a8 | Kerollmops | 2025-06-17T16:17:37 | Make cargo nightly happy | diff --git a/roaring/src/bitmap/iter.rs b/roaring/src/bitmap/iter.rs
index 537acc3a..1c4b09c3 100644
--- a/roaring/src/bitmap/iter.rs
+++ b/roaring/src/bitmap/iter.rs
@@ -152,7 +152,7 @@ fn advance_back_to_impl<'a, It>(
}
impl Iter<'_> {
- fn new(containers: &[Container]) -> Iter {
+ fn new(containers: &'_ [C... | 4 | 8 | 8 |
9e5cee4a4ce7cd1d530fa070ba76d26e486148b7 | Kerollmops | 2025-06-17T16:14:06 | Bump version to 0.11.0 | diff --git a/roaring/Cargo.toml b/roaring/Cargo.toml
index 4c16b8b6..41843b64 100644
--- a/roaring/Cargo.toml
+++ b/roaring/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "roaring"
-version = "0.10.12"
+version = "0.11.0"
rust-version = "1.65.0"
authors = ["Wim Looman <wim@nemo157.com>", "Kerollmops <kero@meilisearch.... | 1 | 1 | 1 |
542789777efa9b13682cedf28c9e13c184f904a9 | Lucas Van Laer | 2025-06-01T17:59:35 | test: remove `dbg!` statement | diff --git a/roaring/tests/serialization.rs b/roaring/tests/serialization.rs
index ac862dcc..f4adc8d7 100644
--- a/roaring/tests/serialization.rs
+++ b/roaring/tests/serialization.rs
@@ -72,7 +72,7 @@ fn test_one() {
fn test_array() {
let original = (1000..3000).collect::<RoaringBitmap>();
let new = serializ... | 1 | 1 | 1 |
5b9372a25d8b42e65b160b51eaa6f879be7c6d65 | Lucas Van Laer | 2025-06-01T17:58:37 | chore: update croaring to 2.3.1 for fuzzing | diff --git a/fuzz/Cargo.lock b/fuzz/Cargo.lock
index 3afac7ac..a3e19555 100644
--- a/fuzz/Cargo.lock
+++ b/fuzz/Cargo.lock
@@ -13,15 +13,15 @@ dependencies = [
[[package]]
name = "bitflags"
-version = "2.9.0"
+version = "2.9.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5c8214115... | 1 | 16 | 16 |
a9614bb449d62917dcebc978756580216013033d | Lucas Van Laer | 2025-05-31T08:28:11 | fix: fuzzing against croaring failure by optimize
Fixes a fuzz failure by ensuring no run containers are present in both
implementations before adding run containers and then removing them
again to check if both remove operations had the same effect. | diff --git a/fuzz/fuzz_targets/arbitrary_ops/mod.rs b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
index 684f45a9..03a00321 100644
--- a/fuzz/fuzz_targets/arbitrary_ops/mod.rs
+++ b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
@@ -158,6 +158,8 @@ impl ReadBitmapOperation {
assert_eq!(x.run_optimize(), y.op... | 1 | 8 | 0 |
c3ebe863e377b58a0732f0ba27da13dc8a1b987f | Lucas Van Laer | 2025-05-11T16:01:42 | feat: remove_run_compression | diff --git a/fuzz/fuzz_targets/arbitrary_ops/mod.rs b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
index 0b14a18b..684f45a9 100644
--- a/fuzz/fuzz_targets/arbitrary_ops/mod.rs
+++ b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
@@ -53,8 +53,7 @@ pub enum MutableBitmapOperation {
Extend(Vec<Num>),
SwapSerialization,
O... | 4 | 74 | 26 |
eff381a7fe833e821c93aa7cfa8e75a7d39495b4 | Lucas Van Laer | 2025-05-11T11:17:49 | feat: run optimized insert range | diff --git a/roaring/src/bitmap/container.rs b/roaring/src/bitmap/container.rs
index bcd4124f..f8ea24ea 100644
--- a/roaring/src/bitmap/container.rs
+++ b/roaring/src/bitmap/container.rs
@@ -3,7 +3,7 @@ use core::ops::{
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, RangeInclusive, Sub, SubAssign,... | 5 | 97 | 20 |
08f3ed132246b9755d2f1151071f144207293fcc | Lucas Van Laer | 2025-05-05T19:03:51 | fix: interval select truncating much needed run_len bits | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 88e347a1..eb4aafa1 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -440,9 +440,10 @@ impl IntervalStore {
pub fn select(&self, mut n: u16) -> Opti... | 1 | 4 | 3 |
869e7802c6c493cb06dce29ef7025be54c540823 | Lucas Van Laer | 2025-05-05T19:01:36 | test: align optimize in croaring to current optimize | diff --git a/fuzz/fuzz_targets/arbitrary_ops/mod.rs b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
index 405216a7..0b14a18b 100644
--- a/fuzz/fuzz_targets/arbitrary_ops/mod.rs
+++ b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
@@ -270,9 +270,13 @@ impl MutableBitmapOperation {
y.clear();
}
... | 1 | 7 | 3 |
a24ff696b6e3cacd13479ab4358bba6f4ad02cdf | Lucas Van Laer | 2025-05-05T17:46:37 | fix: interval store iterator not stopping | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 316f9498..88e347a1 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -629,6 +629,7 @@ impl<I: SliceIterator<Interval>> RunIter<I> {
if let Some(va... | 1 | 2 | 0 |
b88e25824639ff37e20f8e0465a0552f03042be1 | Lucas Van Laer | 2025-05-05T17:30:56 | fix: align container optimize with croaring implementation | diff --git a/roaring/src/bitmap/container.rs b/roaring/src/bitmap/container.rs
index f56c1010..bcd4124f 100644
--- a/roaring/src/bitmap/container.rs
+++ b/roaring/src/bitmap/container.rs
@@ -3,10 +3,11 @@ use core::ops::{
BitAnd, BitAndAssign, BitOr, BitOrAssign, BitXor, BitXorAssign, RangeInclusive, Sub, SubAssig... | 6 | 74 | 18 |
4496602fe9fc198f9c5a0c84b88e86025ce0b124 | Zachary Dremann | 2025-04-27T02:48:13 | add more range-related testing to fuzzing | diff --git a/fuzz/fuzz_targets/arbitrary_ops/mod.rs b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
index fad72f3d..405216a7 100644
--- a/fuzz/fuzz_targets/arbitrary_ops/mod.rs
+++ b/fuzz/fuzz_targets/arbitrary_ops/mod.rs
@@ -51,8 +51,20 @@ pub enum MutableBitmapOperation {
RemoveRange(RangeInclusive<Num>),
Clear,
... | 1 | 76 | 13 |
53c9aa2a28ce9952f35c750d4301199ae05ca063 | Lucas Van Laer | 2025-04-25T20:04:58 | fix: deobfuscate `IntervalStore::insert_range`
Suggestion from @Dr-Emann in #320. | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index d1799926..58bc0adb 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -191,94 +191,51 @@ impl IntervalStore {
return 0;
}
- l... | 1 | 41 | 84 |
b074682e7f2f01973a67e528080499db22f32106 | Lucas Van Laer | 2025-04-25T18:28:55 | fix: deobfuscate `IntervalStore::insert_range`
Suggestion from @Dr-Emann in #320.
Co-authored-by: Zachary Dremann <dremann@gmail.com> | diff --git a/roaring/src/bitmap/store/interval_store.rs b/roaring/src/bitmap/store/interval_store.rs
index 4a67fe5e..d1799926 100644
--- a/roaring/src/bitmap/store/interval_store.rs
+++ b/roaring/src/bitmap/store/interval_store.rs
@@ -99,146 +99,47 @@ impl IntervalStore {
if range.is_empty() {
ret... | 1 | 38 | 137 |
41c7f083ec32c3e31ab0f1e7acb13b9beec2656c | Lucas Van Laer | 2025-04-25T17:50:06 | fix: deobfuscate `IntervalStore::insert`
Suggestion from @Dr-Emann in #320.
Co-authored-by: Zachary Dremann <dremann@gmail.com> | diff --git a/roaring/src/bitmap/serialization.rs b/roaring/src/bitmap/serialization.rs
index 836f04dc..4c060111 100644
--- a/roaring/src/bitmap/serialization.rs
+++ b/roaring/src/bitmap/serialization.rs
@@ -291,16 +291,19 @@ impl RoaringBitmap {
let mut last_end = None::<u16>;
let st... | 2 | 49 | 58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.