Repository: Geal/nom
Pull request #923 (2019-04-26 13:09:21)

[nom5] reimplement complete combinator


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index dae77f8..e73fa61 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,20 @@
 
 ### Fixed
 
+## 5.0.0 - ?
+
+### Thanks
+
+### Added
+
+### Fixed
+
+### Removed
+
+- character parsers that were aliases to their `*1` version: eol, alpha, digit, hex_digit, oct_digit, alphanumeric, space, multispace
+- `count_fixed` macro
+- `whitespace::sp` can be replaced by `character::complete::multispace0`
+
 ## 4.2.3 - 2019-03-23
 
 ### Fixed
diff --git a/Cargo.toml b/Cargo.toml
index 4e8ef40..23a9e18 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,9 +26,10 @@ include = [
 [features]
 alloc = []
 std = ["alloc", "memchr/use_std"]
-default = ["std"]
+default = ["std", "lexical"]
 regexp = ["regex"]
 regexp_macros = ["regexp", "lazy_static"]
+lexical = ["lexical-core"]
 
 [dependencies.regex]
 version = "^1.0"
@@ -42,9 +43,9 @@ optional = true
 version = "^2.0"
 default-features = false
 
-#[dev-dependencies.bytes]
-#git = "https://github.com/carllerche/bytes"
-#rev = "a7d38e29"
+[dependencies.lexical-core]
+version = "^0.4.0"
+optional = true
 
 [dev-dependencies]
 criterion = "0.2"
@@ -54,7 +55,7 @@ jemallocator = "^0.1"
 version_check = "^0.1"
 
 [package.metadata.docs.rs]
-features = [ "alloc", "std", "regexp", "regexp_macros"]
+features = [ "alloc", "std", "regexp", "regexp_macros", "lexical"]
 all-features = true
 
 [profile.bench]
diff --git a/benches/arithmetic.rs b/benches/arithmetic.rs
index 8eba436..0db5456 100644
--- a/benches/arithmetic.rs
+++ b/benches/arithmetic.rs
@@ -8,7 +8,7 @@ extern crate jemallocator;
 static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
 
 use criterion::Criterion;
-use nom::character::complete::digit;
+use nom::character::complete::digit1 as digit;
 
 // Parser definition
 
diff --git a/benches/ini.rs b/benches/ini.rs
index 794e5a4..7d4115a 100644
--- a/benches/ini.rs
+++ b/benches/ini.rs
@@ -8,14 +8,13 @@ extern crate jemallocator;
 static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
 
 use criterion::*;
-//use nom::character::streaming::{alphanumeric, multispace, space};
 
 use nom::{
   IResult,
   combinator::map_res,
   sequence::delimited,
   bytes::complete::take_while,
-  character::complete::{alphanumeric, multispace, space, char}
+  character::complete::{alphanumeric1 as alphanumeric, multispace1 as multispace, space1 as space, char}
 };
 use std::str;
 use std::collections::HashMap;
diff --git a/benches/ini_complete.rs b/benches/ini_complete.rs
index ad9ca6e..c8630aa 100644
--- a/benches/ini_complete.rs
+++ b/benches/ini_complete.rs
@@ -13,7 +13,7 @@ use nom::{
   combinator::map_res,
   sequence::delimited,
   bytes::complete::take_while,
-  character::complete::{alphanumeric, multispace, space, char}
+  character::complete::{alphanumeric1 as alphanumeric, multispace1 as multispace, space1 as space, char}
 };
 use std::str;
 use std::collections::HashMap;
diff --git a/benches/ini_str.rs b/benches/ini_str.rs
index 563bcb1..6b40262 100644
--- a/benches/ini_str.rs
+++ b/benches/ini_str.rs
@@ -14,7 +14,7 @@ use nom::{
   combinator::{map_res, opt},
   bytes::complete::{take_while, is_a},
   sequence::{delimited, terminated},
-  character::complete::{char, alphanumeric, space0 as space, not_line_ending}
+  character::complete::{char, alphanumeric1 as  alphanumeric, space0 as space, not_line_ending}
 };
 
 
diff --git a/benches/json.rs b/benches/json.rs
index abb42ee..80bd181 100644
--- a/benches/json.rs
+++ b/benches/json.rs
@@ -8,7 +8,8 @@ extern crate jemallocator;
 static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
 
 use criterion::Criterion;
-use nom::{error::ErrorKind, character::complete::alphanumeric, number::complete::recognize_float};
+use nom::{error::ErrorKind, character::complete::alphanumeric1 as alphanumeric, number::complete::recognize_float};
+use nom::number::complete::float;
 
 
 use std::str;
@@ -23,8 +24,6 @@ pub enum JsonValue {
   Object(HashMap<String, JsonValue>),
 }
 
-named!(float<f32>, flat_map!(recognize_float, parse_to!(f32)));
-
 //FIXME: verify how json strings are formatted
 named!(
   string<&str>,
@@ -98,7 +97,6 @@ fn json_bench(c: &mut Criterion) {
 }
 
 fn recognize_float_bytes(c: &mut Criterion) {
-  use nom::number::complete::recognize_float;
   println!("recognize_float_bytes result: {:?}", recognize_float::<_, (_,ErrorKind)>(&b"-1.234E-12"[..]));
   c.bench_function("recognize float bytes", |b| {
     b.iter(|| recognize_float::<_, (_,ErrorKind)>(&b"-1.234E-12"[..]));
@@ -106,7 +104,6 @@ fn recognize_float_bytes(c: &mut Criterion) {
 }
 
 fn recognize_float_str(c: &mut Criterion) {
-  use nom::number::complete::recognize_float;
   println!("recognize_float_str result: {:?}", recognize_float::<_, (_,ErrorKind)>("-1.234E-12"));
   c.bench_function("recognize float str", |b| {
     b.iter(|| recognize_float::<_, (_,ErrorKind)>("-1.234E-12"));
diff --git a/examples/json.rs b/examples/json.rs
index 3e431ab..78e4abe 100644
--- a/examples/json.rs
+++ b/examples/json.rs
@@ -9,7 +9,7 @@ static ALLOC: jemallocator::Jemalloc = jemallocator::Jemalloc;
 
 use nom::{Err, IResult, Offset, error::{VerboseError, VerboseErrorKind}};
 use nom::{
-  character::complete::alphanumeric,
+  character::complete::alphanumeric1 as alphanumeric,
   bytes::complete::{take_while, tag},
   multi::separated_listc,
   branch::alt,
diff --git a/src/bytes/macros.rs b/src/bytes/macros.rs
index 2a0be66..436860b 100644
--- a/src/bytes/macros.rs
+++ b/src/bytes/macros.rs
@@ -99,9 +99,9 @@ macro_rules! is_a (
 /// # Example
 /// ```
 /// # #[macro_use] extern crate nom;
-/// # use nom::character::complete::digit;
+/// # use nom::character::complete::digit1;
 /// # fn main() {
-///  named!(esc, escaped!(call!(digit), '\\', one_of!("\"n\\")));
+///  named!(esc, escaped!(call!(digit1), '\\', one_of!("\"n\\")));
 ///  assert_eq!(esc(&b"123;"[..]), Ok((&b";"[..], &b"123"[..])));
 ///  assert_eq!(esc(&b"12\\\"34;"[..]), Ok((&b";"[..], &b"12\\\"34"[..])));
 /// # }
@@ -934,7 +934,7 @@ mod tests {
   use lib::std::string::String;
   #[cfg(feature = "alloc")]
   use lib::std::vec::Vec;
-  use character::streaming::{alpha, alphanumeric, digit, hex_digit, multispace, oct_digit, space};
+  use character::streaming::{alpha1 as alpha, alphanumeric1 as alphanumeric, digit1 as digit, hex_digit1 as hex_digit, multispace1 as multispace, oct_digit1 as oct_digit, space1 as space};
   use error::ErrorKind;
   use character::is_alphabetic;
 
diff --git a/src/character/complete.rs b/src/character/complete.rs
index cf5a41a..4b2bd6d 100644
--- a/src/character/complete.rs
+++ b/src/character/complete.rs
@@ -127,7 +127,6 @@ where
   }
 }
 
-//FIXME: remove?
 //FIXME: there's still an incomplete
 /// Recognizes a string of any char except '\r' or '\n'.
 ///
@@ -226,35 +225,6 @@ where
   }
 }
 
-//FIXME: remove
-/// Alias for [`line_ending`].
-///
-/// *complete version*: Will return an error if there's not enough input data.
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::eol;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     eol(input)
-/// }
-///
-/// assert_eq!(parser("\r\nc"), Ok(("c", "\r\n")));
-/// assert_eq!(parser("ab\r\nc"), Err(Err::Error(("ab\r\nc", ErrorKind::CrLf))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::CrLf))));
-/// # }
-/// ```
-pub fn eol<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
-  T: InputIter + InputLength,
-  T: Compare<&'static str>,
-{
-  line_ending(input)
-}
-
 /// Matches a newline character '\n'.
 ///
 /// *complete version*: Will return an error if there's not enough input data.
@@ -342,38 +312,6 @@ where
   }
 }
 
-//FIXME: remove?
-/// Recognizes one or more lowercase and uppercase alphabetic characters.
-///
-/// * For ASCII strings: a-zA-Z
-/// * For UTF8 strings, any alphabetic code point (ie, not only the ASCII ones)
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non alphabetic character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::alpha;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     alpha(input)
-/// }
-///
-/// assert_eq!(parser("ab1c"), Ok(("1c", "ab")));
-/// assert_eq!(parser("1c"), Err(Err::Error(("1c", ErrorKind::Alpha))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::Alpha))));
-/// # }
-/// ```
-pub fn alpha<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  alpha1(input)
-}
-
 /// Recognizes zero or more lowercase and uppercase alphabetic characters.
 ///
 /// * For ASCII strings: a-zA-Z
@@ -436,35 +374,6 @@ where
   input.split_at_position1_complete(|item| !item.is_alpha(), ErrorKind::Alpha)
 }
 
-//FIXME: remove?
-/// Recognizes one or more numerical characters: 0-9
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non digit character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::digit;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     digit(input)
-/// }
-///
-/// assert_eq!(parser("21c"), Ok(("c", "21")));
-/// assert_eq!(parser("c1"), Err(Err::Error(("c1", ErrorKind::Digit))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::Digit))));
-/// # }
-/// ```
-pub fn digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  digit1(input)
-}
-
 /// Recognizes zero or more numerical characters: 0-9
 ///
 /// *complete version*: Will return the whole input if no terminating token is found (a non digit
@@ -521,35 +430,6 @@ where
   input.split_at_position1_complete(|item| !item.is_dec_digit(), ErrorKind::Digit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more hexadecimal numerical characters: 0-9, A-F, a-f
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non hexadecimal digit character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::hex_digit;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     hex_digit(input)
-/// }
-///
-/// assert_eq!(parser("21cZ"), Ok(("Z", "21c")));
-/// assert_eq!(parser("H2"), Err(Err::Error(("H2", ErrorKind::HexDigit))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::HexDigit))));
-/// # }
-/// ```
-pub fn hex_digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  hex_digit1(input)
-}
-
 /// Recognizes zero or more hexadecimal numerical characters: 0-9, A-F, a-f
 ///
 /// *complete version*: Will return the whole input if no terminating token is found (a non hexadecimal digit character).
@@ -604,35 +484,6 @@ where
   input.split_at_position1_complete(|item| !item.is_hex_digit(), ErrorKind::HexDigit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more octal characters: 0-7
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non octal digit character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::oct_digit;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     oct_digit(input)
-/// }
-///
-/// assert_eq!(parser("21cZ"), Ok(("cZ", "21")));
-/// assert_eq!(parser("H2"), Err(Err::Error(("H2", ErrorKind::OctDigit))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::OctDigit))));
-/// # }
-/// ```
-pub fn oct_digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  oct_digit1(input)
-}
-
 /// Recognizes zero or more octal characters: 0-7
 ///
 /// *complete version*: Will return the whole input if no terminating token is found (a non octal
@@ -689,38 +540,6 @@ where
   input.split_at_position1_complete(|item| !item.is_oct_digit(), ErrorKind::OctDigit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more numerical and alphabetic characters.
-///
-/// * For ASCII strings: 0-9a-zA-Z
-/// * For UTF8 strings, 0-9 and any alphabetic code point (ie, not only the ASCII ones)
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non alphanumerical character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::alphanumeric;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     alphanumeric(input)
-/// }
-///
-/// assert_eq!(parser("21cZ%1"), Ok(("%1", "21cZ")));
-/// assert_eq!(parser("&H2"), Err(Err::Error(("&H2", ErrorKind::AlphaNumeric))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::AlphaNumeric))));
-/// # }
-/// ```
-pub fn alphanumeric<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  alphanumeric1(input)
-}
-
 /// Recognizes zero or more numerical and alphabetic characters.
 ///
 /// * For ASCII strings: 0-9a-zA-Z
@@ -783,35 +602,6 @@ where
   input.split_at_position1_complete(|item| !item.is_alphanum(), ErrorKind::AlphaNumeric)
 }
 
-//FIXME: remove?
-/// Recognizes one or more spaces and tabs.
-///
-/// *complete version*: Will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non space character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::space;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     space(input)
-/// }
-///
-/// assert_eq!(parser(" \t21c"), Ok(("21c", " \t")));
-/// assert_eq!(parser("H2"), Err(Err::Error(("H2", ErrorKind::Space))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::Space))));
-/// # }
-/// ```
-pub fn space<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar + Clone,
-{
-  space1(input)
-}
-
 /// Recognizes zero or more spaces and tabs.
 ///
 /// *complete version*: Will return the whole input if no terminating token is found (a non space
@@ -877,35 +667,6 @@ where
   )
 }
 
-//FIXME: remove?
-/// Recognizes one or more spaces, tabs, carriage returns and line feeds.
-///
-/// *complete version*: will return an error if there's not enough input data,
-/// or the whole input if no terminating token is found (a non space character).
-///
-/// # Example
-///
-/// ```
-/// # use nom::{Err, error::ErrorKind, IResult, Needed};
-/// # use nom::character::complete::multispace;
-/// # fn main() {
-/// fn parser(input: &str) -> IResult<&str, &str> {
-///     multispace(input)
-/// }
-///
-/// assert_eq!(parser(" \t\n\r21c"), Ok(("21c", " \t\n\r")));
-/// assert_eq!(parser("H2"), Err(Err::Error(("H2", ErrorKind::MultiSpace))));
-/// assert_eq!(parser(""), Err(Err::Error(("", ErrorKind::MultiSpace))));
-/// # }
-/// ```
-pub fn multispace<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar + Clone,
-{
-  multispace1(input)
-}
-
 /// Recognizes zero or more spaces, tabs, carriage returns and line feeds.
 ///
 /// *complete version*: will return the whole input if no terminating token is found (a non space
@@ -936,6 +697,7 @@ where
     !(c == ' ' || c == '\t' || c == '\r' || c == '\n')
   })
 }
+
 /// Recognizes one or more spaces, tabs, carriage returns and line feeds.
 ///
 /// *complete version*: will return an error if there's not enough input data,
@@ -992,54 +754,54 @@ mod tests {
     let d: &[u8] = "azé12".as_bytes();
     let e: &[u8] = b" ";
     let f: &[u8] = b" ;";
-    //assert_eq!(alpha::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    assert_parse!(alpha(a), Ok((empty, a)));
+    //assert_eq!(alpha1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    assert_parse!(alpha1(a), Ok((empty, a)));
     assert_eq!(
-      alpha(b),
+      alpha1(b),
       Err(Err::Error((b, ErrorKind::Alpha)))
     );
-    assert_eq!(alpha::<_, (_, ErrorKind)>(c), Ok((&c[1..], &b"a"[..])));
-    assert_eq!(alpha::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &b"a"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
     assert_eq!(
-      digit(a),
+      digit1(a),
       Err(Err::Error((a, ErrorKind::Digit)))
     );
-    assert_eq!(digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
     assert_eq!(
-      digit(c),
+      digit1(c),
       Err(Err::Error((c, ErrorKind::Digit)))
     );
     assert_eq!(
-      digit(d),
+      digit1(d),
       Err(Err::Error((d, ErrorKind::Digit)))
     );
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(a), Ok((empty, a)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(c), Ok((empty, c)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(d), Ok(("zé12".as_bytes(), &b"a"[..])));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(d), Ok(("zé12".as_bytes(), &b"a"[..])));
     assert_eq!(
-      hex_digit(e),
+      hex_digit1(e),
       Err(Err::Error((e, ErrorKind::HexDigit)))
     );
     assert_eq!(
-      oct_digit(a),
+      oct_digit1(a),
       Err(Err::Error((a, ErrorKind::OctDigit)))
     );
-    assert_eq!(oct_digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
     assert_eq!(
-      oct_digit(c),
+      oct_digit1(c),
       Err(Err::Error((c, ErrorKind::OctDigit)))
     );
     assert_eq!(
-      oct_digit(d),
+      oct_digit1(d),
       Err(Err::Error((d, ErrorKind::OctDigit)))
     );
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(a), Ok((empty, a)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
     //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(c), Ok((empty, c)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
-    assert_eq!(space::<_, (_, ErrorKind)>(e), Ok((empty, e)));
-    assert_eq!(space::<_, (_, ErrorKind)>(f), Ok((&b";"[..], &b" "[..])));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
+    assert_eq!(space1::<_, (_, ErrorKind)>(e), Ok((empty, e)));
+    assert_eq!(space1::<_, (_, ErrorKind)>(f), Ok((&b";"[..], &b" "[..])));
   }
 
   #[cfg(feature = "alloc")]
@@ -1051,52 +813,52 @@ mod tests {
     let c = "a123";
     let d = "azé12";
     let e = " ";
-    assert_eq!(alpha::<_, (_, ErrorKind)>(a), Ok((empty, a)));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
     assert_eq!(
-      alpha(b),
+      alpha1(b),
       Err(Err::Error((b, ErrorKind::Alpha)))
     );
-    assert_eq!(alpha::<_, (_, ErrorKind)>(c), Ok((&c[1..], &"a"[..])));
-    assert_eq!(alpha::<_, (_, ErrorKind)>(d), Ok(("12", &"azé"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &"a"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(d), Ok(("12", &"azé"[..])));
     assert_eq!(
-      digit(a),
+      digit1(a),
       Err(Err::Error((a, ErrorKind::Digit)))
     );
-    assert_eq!(digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
     assert_eq!(
-      digit(c),
+      digit1(c),
       Err(Err::Error((c, ErrorKind::Digit)))
     );
     assert_eq!(
-      digit(d),
+      digit1(d),
       Err(Err::Error((d, ErrorKind::Digit)))
     );
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(a), Ok((empty, a)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(c), Ok((empty, c)));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(d), Ok(("zé12", &"a"[..])));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(d), Ok(("zé12", &"a"[..])));
     assert_eq!(
-      hex_digit(e),
+      hex_digit1(e),
       Err(Err::Error((e, ErrorKind::HexDigit)))
     );
     assert_eq!(
-      oct_digit(a),
+      oct_digit1(a),
       Err(Err::Error((a, ErrorKind::OctDigit)))
     );
-    assert_eq!(oct_digit::<_, (_, ErrorKind)>(b), Ok((empty, b)));
+    assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Ok((empty, b)));
     assert_eq!(
-      oct_digit(c),
+      oct_digit1(c),
       Err(Err::Error((c, ErrorKind::OctDigit)))
     );
     assert_eq!(
-      oct_digit(d),
+      oct_digit1(d),
       Err(Err::Error((d, ErrorKind::OctDigit)))
     );
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(a), Ok((empty, a)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Ok((empty, a)));
     //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(c), Ok((empty, c)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(d), Ok((empty, d)));
-    assert_eq!(space::<_, (_, ErrorKind)>(e), Ok((empty, e)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Ok((empty, c)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(d), Ok((empty, d)));
+    assert_eq!(space1::<_, (_, ErrorKind)>(e), Ok((empty, e)));
   }
 
   use traits::Offset;
@@ -1109,43 +871,43 @@ mod tests {
     let e = &b" \t\r\n;"[..];
     let f = &b"123abcDEF;"[..];
 
-    match alpha::<_, (_, ErrorKind)>(a) {
+    match alpha1::<_, (_, ErrorKind)>(a) {
       Ok((i, _)) => {
         assert_eq!(a.offset(i) + i.len(), a.len());
       }
       _ => panic!("wrong return type in offset test for alpha"),
     }
-    match digit::<_, (_, ErrorKind)>(b) {
+    match digit1::<_, (_, ErrorKind)>(b) {
       Ok((i, _)) => {
         assert_eq!(b.offset(i) + i.len(), b.len());
       }
       _ => panic!("wrong return type in offset test for digit"),
     }
-    match alphanumeric::<_, (_, ErrorKind)>(c) {
+    match alphanumeric1::<_, (_, ErrorKind)>(c) {
       Ok((i, _)) => {
         assert_eq!(c.offset(i) + i.len(), c.len());
       }
       _ => panic!("wrong return type in offset test for alphanumeric"),
     }
-    match space::<_, (_, ErrorKind)>(d) {
+    match space1::<_, (_, ErrorKind)>(d) {
       Ok((i, _)) => {
         assert_eq!(d.offset(i) + i.len(), d.len());
       }
       _ => panic!("wrong return type in offset test for space"),
     }
-    match multispace::<_, (_, ErrorKind)>(e) {
+    match multispace1::<_, (_, ErrorKind)>(e) {
       Ok((i, _)) => {
         assert_eq!(e.offset(i) + i.len(), e.len());
       }
       _ => panic!("wrong return type in offset test for multispace"),
     }
-    match hex_digit::<_, (_, ErrorKind)>(f) {
+    match hex_digit1::<_, (_, ErrorKind)>(f) {
       Ok((i, _)) => {
         assert_eq!(f.offset(i) + i.len(), f.len());
       }
       _ => panic!("wrong return type in offset test for hex_digit"),
     }
-    match oct_digit::<_, (_, ErrorKind)>(f) {
+    match oct_digit1::<_, (_, ErrorKind)>(f) {
       Ok((i, _)) => {
         assert_eq!(f.offset(i) + i.len(), f.len());
       }
@@ -1176,6 +938,7 @@ mod tests {
 
   #[test]
   fn is_not_line_ending_str() {
+
     /*
     let a: &str = "ab12cd\nefgh";
     assert_eq!(not_line_ending(a), Ok((&"\nefgh"[..], &"ab12cd"[..])));
@@ -1206,17 +969,17 @@ mod tests {
   #[test]
   fn hex_digit_test() {
     let i = &b"0123456789abcdefABCDEF;"[..];
-    assert_parse!(hex_digit(i), Ok((&b";"[..], &i[..i.len() - 1])));
+    assert_parse!(hex_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
 
     let i = &b"g"[..];
     assert_parse!(
-      hex_digit(i),
+      hex_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::HexDigit)))
     );
 
     let i = &b"G"[..];
     assert_parse!(
-      hex_digit(i),
+      hex_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::HexDigit)))
     );
 
@@ -1237,11 +1000,11 @@ mod tests {
   #[test]
   fn oct_digit_test() {
     let i = &b"01234567;"[..];
-    assert_parse!(oct_digit(i), Ok((&b";"[..], &i[..i.len() - 1])));
+    assert_parse!(oct_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
 
     let i = &b"8"[..];
     assert_parse!(
-      oct_digit(i),
+      oct_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::OctDigit)))
     );
 
@@ -1259,6 +1022,8 @@ mod tests {
 
   #[test]
   fn full_line_windows() {
+    //let not_line_ending = |i:&[u8]| take_while(|c| c != b'\r' && c != b'\n')(i);
+
     named!(
       take_full_line<(&[u8], &[u8])>,
       tuple!(not_line_ending, line_ending)
@@ -1270,6 +1035,7 @@ mod tests {
 
   #[test]
   fn full_line_unix() {
+    //let not_line_ending = |i:&[u8]| take_while(|c| c != b'\n')(i);
     named!(
       take_full_line<(&[u8], &[u8])>,
       tuple!(not_line_ending, line_ending)
@@ -1312,19 +1078,19 @@ mod tests {
 
   #[test]
   fn end_of_line() {
-    assert_parse!(eol(&b"\na"[..]), Ok((&b"a"[..], &b"\n"[..])));
-    assert_parse!(eol(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
-    assert_parse!(eol(&b"\r"[..]), Err(Err::Error(error_position!(&b"\r"[..], ErrorKind::CrLf))));
+    assert_parse!(line_ending(&b"\na"[..]), Ok((&b"a"[..], &b"\n"[..])));
+    assert_parse!(line_ending(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
+    assert_parse!(line_ending(&b"\r"[..]), Err(Err::Error(error_position!(&b"\r"[..], ErrorKind::CrLf))));
     assert_parse!(
-      eol(&b"\ra"[..]),
+      line_ending(&b"\ra"[..]),
       Err(Err::Error(error_position!(&b"\ra"[..], ErrorKind::CrLf)))
     );
 
-    assert_parse!(eol("\na"), Ok(("a", "\n")));
-    assert_parse!(eol("\r\na"), Ok(("a", "\r\n")));
-    assert_parse!(eol("\r"), Err(Err::Error(error_position!(&"\r"[..], ErrorKind::CrLf))));
+    assert_parse!(line_ending("\na"), Ok(("a", "\n")));
+    assert_parse!(line_ending("\r\na"), Ok(("a", "\r\n")));
+    assert_parse!(line_ending("\r"), Err(Err::Error(error_position!(&"\r"[..], ErrorKind::CrLf))));
     assert_parse!(
-      eol("\ra"),
+      line_ending("\ra"),
       Err(Err::Error(error_position!("\ra", ErrorKind::CrLf)))
     );
   }
diff --git a/src/character/streaming.rs b/src/character/streaming.rs
index 926e1b6..556b96c 100644
--- a/src/character/streaming.rs
+++ b/src/character/streaming.rs
@@ -82,7 +82,6 @@ where
   }
 }
 
-//FIXME: remove?
 /// recognizes a string of any char except '\r' or '\n'
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data
@@ -146,17 +145,6 @@ where
   }
 }
 
-//FIXME: remove
-/// alias for line_ending
-pub fn eol<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
-  T: InputIter + InputLength,
-  T: Compare<&'static str>,
-{
-  line_ending(input)
-}
-
 /// matches a newline character '\\n'
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data
@@ -207,21 +195,6 @@ where
   }
 }
 
-//FIXME: remove?
-/// Recognizes one or more lowercase and uppercase alphabetic characters.
-/// For ASCII strings: a-zA-Z
-/// For UTF8 strings, any alphabetic code point (ie, not only the ASCII ones)
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non alphabetic character)
-pub fn alpha<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  alpha1(input)
-}
-
 /// Recognizes zero or more lowercase and uppercase alphabetic characters.
 /// For ASCII strings: a-zA-Z
 /// For UTF8 strings, any alphabetic code point (ie, not only the ASCII ones)
@@ -250,19 +223,6 @@ where
   input.split_at_position1(|item| !item.is_alpha(), ErrorKind::Alpha)
 }
 
-//FIXME: remove?
-/// Recognizes one or more numerical characters: 0-9
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non digit character)
-pub fn digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  digit1(input)
-}
-
 /// Recognizes zero or more numerical characters: 0-9
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
@@ -287,19 +247,6 @@ where
   input.split_at_position1(|item| !item.is_dec_digit(), ErrorKind::Digit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more hexadecimal numerical characters: 0-9, A-F, a-f
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non hexadecimal digit character)
-pub fn hex_digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  hex_digit1(input)
-}
-
 /// Recognizes zero or more hexadecimal numerical characters: 0-9, A-F, a-f
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
@@ -324,19 +271,6 @@ where
   input.split_at_position1(|item| !item.is_hex_digit(), ErrorKind::HexDigit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more octal characters: 0-7
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non octal digit character)
-pub fn oct_digit<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  oct_digit1(input)
-}
-
 /// Recognizes zero or more octal characters: 0-7
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
@@ -361,21 +295,6 @@ where
   input.split_at_position1(|item| !item.is_oct_digit(), ErrorKind::OctDigit)
 }
 
-//FIXME: remove?
-/// Recognizes one or more numerical and alphabetic characters
-/// For ASCII strings: 0-9a-zA-Z
-/// For UTF8 strings, 0-9 and any alphabetic code point (ie, not only the ASCII ones)
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non alphanumerical character)
-pub fn alphanumeric<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar,
-{
-  alphanumeric1(input)
-}
-
 /// Recognizes zero or more numerical and alphabetic characters.
 /// For ASCII strings: 0-9a-zA-Z
 /// For UTF8 strings, 0-9 and any alphabetic code point (ie, not only the ASCII ones)
@@ -389,6 +308,7 @@ where
 {
   input.split_at_position(|item| !item.is_alphanum())
 }
+
 /// Recognizes one or more numerical and alphabetic characters.
 /// For ASCII strings: 0-9a-zA-Z
 /// For UTF8 strings, 0-9 and any alphabetic code point (ie, not only the ASCII ones)
@@ -403,19 +323,6 @@ where
   input.split_at_position1(|item| !item.is_alphanum(), ErrorKind::AlphaNumeric)
 }
 
-//FIXME: remove?
-/// Recognizes one or more spaces and tabs
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non space character)
-pub fn space<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar + Clone,
-{
-  space1(input)
-}
-
 /// Recognizes zero or more spaces and tabs
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
@@ -448,19 +355,6 @@ where
   )
 }
 
-//FIXME: remove?
-/// Recognizes one or more spaces, tabs, carriage returns and line feeds
-///
-/// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
-/// or if no terminating token is found (a non space character)
-pub fn multispace<T, E: ParseError<T>>(input: T) -> IResult<T, T, E>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar + Clone,
-{
-  multispace1(input)
-}
-
 /// Recognizes zero or more spaces, tabs, carriage returns and line feeds
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if there's not enough input data,
@@ -521,54 +415,54 @@ mod tests {
     let d: &[u8] = "azé12".as_bytes();
     let e: &[u8] = b" ";
     let f: &[u8] = b" ;";
-    //assert_eq!(alpha::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    assert_parse!(alpha(a), Err(Err::Incomplete(Needed::Size(1))));
+    //assert_eq!(alpha1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    assert_parse!(alpha1(a), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      alpha(b),
+      alpha1(b),
       Err(Err::Error((b, ErrorKind::Alpha)))
     );
-    assert_eq!(alpha::<_, (_, ErrorKind)>(c), Ok((&c[1..], &b"a"[..])));
-    assert_eq!(alpha::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &b"a"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
     assert_eq!(
-      digit(a),
+      digit1(a),
       Err(Err::Error((a, ErrorKind::Digit)))
     );
-    assert_eq!(digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      digit(c),
+      digit1(c),
       Err(Err::Error((c, ErrorKind::Digit)))
     );
     assert_eq!(
-      digit(d),
+      digit1(d),
       Err(Err::Error((d, ErrorKind::Digit)))
     );
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(d), Ok(("zé12".as_bytes(), &b"a"[..])));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(d), Ok(("zé12".as_bytes(), &b"a"[..])));
     assert_eq!(
-      hex_digit(e),
+      hex_digit1(e),
       Err(Err::Error((e, ErrorKind::HexDigit)))
     );
     assert_eq!(
-      oct_digit(a),
+      oct_digit1(a),
       Err(Err::Error((a, ErrorKind::OctDigit)))
     );
-    assert_eq!(oct_digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      oct_digit(c),
+      oct_digit1(c),
       Err(Err::Error((c, ErrorKind::OctDigit)))
     );
     assert_eq!(
-      oct_digit(d),
+      oct_digit1(d),
       Err(Err::Error((d, ErrorKind::OctDigit)))
     );
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
-    assert_eq!(space::<_, (_, ErrorKind)>(e), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(space::<_, (_, ErrorKind)>(f), Ok((&b";"[..], &b" "[..])));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    //assert_eq!(fix_error!(b,(), alphanumeric1), Ok((empty, b)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(d), Ok(("é12".as_bytes(), &b"az"[..])));
+    assert_eq!(space1::<_, (_, ErrorKind)>(e), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(space1::<_, (_, ErrorKind)>(f), Ok((&b";"[..], &b" "[..])));
   }
 
   #[cfg(feature = "alloc")]
@@ -579,52 +473,52 @@ mod tests {
     let c = "a123";
     let d = "azé12";
     let e = " ";
-    assert_eq!(alpha::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      alpha(b),
+      alpha1(b),
       Err(Err::Error((b, ErrorKind::Alpha)))
     );
-    assert_eq!(alpha::<_, (_, ErrorKind)>(c), Ok((&c[1..], &"a"[..])));
-    assert_eq!(alpha::<_, (_, ErrorKind)>(d), Ok(("12", &"azé"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(c), Ok((&c[1..], &"a"[..])));
+    assert_eq!(alpha1::<_, (_, ErrorKind)>(d), Ok(("12", &"azé"[..])));
     assert_eq!(
-      digit(a),
+      digit1(a),
       Err(Err::Error((a, ErrorKind::Digit)))
     );
-    assert_eq!(digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      digit(c),
+      digit1(c),
       Err(Err::Error((c, ErrorKind::Digit)))
     );
     assert_eq!(
-      digit(d),
+      digit1(d),
       Err(Err::Error((d, ErrorKind::Digit)))
     );
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(hex_digit::<_, (_, ErrorKind)>(d), Ok(("zé12", &"a"[..])));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(hex_digit1::<_, (_, ErrorKind)>(d), Ok(("zé12", &"a"[..])));
     assert_eq!(
-      hex_digit(e),
+      hex_digit1(e),
       Err(Err::Error((e, ErrorKind::HexDigit)))
     );
     assert_eq!(
-      oct_digit(a),
+      oct_digit1(a),
       Err(Err::Error((a, ErrorKind::OctDigit)))
     );
-    assert_eq!(oct_digit::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(oct_digit1::<_, (_, ErrorKind)>(b), Err(Err::Incomplete(Needed::Size(1))));
     assert_eq!(
-      oct_digit(c),
+      oct_digit1(c),
       Err(Err::Error((c, ErrorKind::OctDigit)))
     );
     assert_eq!(
-      oct_digit(d),
+      oct_digit1(d),
       Err(Err::Error((d, ErrorKind::OctDigit)))
     );
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
-    //assert_eq!(fix_error!(b,(), alphanumeric), Ok((empty, b)));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(alphanumeric::<_, (_, ErrorKind)>(d), Err(Err::Incomplete(Needed::Size(1))));
-    assert_eq!(space::<_, (_, ErrorKind)>(e), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(a), Err(Err::Incomplete(Needed::Size(1))));
+    //assert_eq!(fix_error!(b,(), alphanumeric1), Ok((empty, b)));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(c), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(alphanumeric1::<_, (_, ErrorKind)>(d), Err(Err::Incomplete(Needed::Size(1))));
+    assert_eq!(space1::<_, (_, ErrorKind)>(e), Err(Err::Incomplete(Needed::Size(1))));
   }
 
   use traits::Offset;
@@ -637,43 +531,43 @@ mod tests {
     let e = &b" \t\r\n;"[..];
     let f = &b"123abcDEF;"[..];
 
-    match alpha::<_, (_, ErrorKind)>(a) {
+    match alpha1::<_, (_, ErrorKind)>(a) {
       Ok((i, _)) => {
         assert_eq!(a.offset(i) + i.len(), a.len());
       }
       _ => panic!("wrong return type in offset test for alpha"),
     }
-    match digit::<_, (_, ErrorKind)>(b) {
+    match digit1::<_, (_, ErrorKind)>(b) {
       Ok((i, _)) => {
         assert_eq!(b.offset(i) + i.len(), b.len());
       }
       _ => panic!("wrong return type in offset test for digit"),
     }
-    match alphanumeric::<_, (_, ErrorKind)>(c) {
+    match alphanumeric1::<_, (_, ErrorKind)>(c) {
       Ok((i, _)) => {
         assert_eq!(c.offset(i) + i.len(), c.len());
       }
       _ => panic!("wrong return type in offset test for alphanumeric"),
     }
-    match space::<_, (_, ErrorKind)>(d) {
+    match space1::<_, (_, ErrorKind)>(d) {
       Ok((i, _)) => {
         assert_eq!(d.offset(i) + i.len(), d.len());
       }
       _ => panic!("wrong return type in offset test for space"),
     }
-    match multispace::<_, (_, ErrorKind)>(e) {
+    match multispace1::<_, (_, ErrorKind)>(e) {
       Ok((i, _)) => {
         assert_eq!(e.offset(i) + i.len(), e.len());
       }
       _ => panic!("wrong return type in offset test for multispace"),
     }
-    match hex_digit::<_, (_, ErrorKind)>(f) {
+    match hex_digit1::<_, (_, ErrorKind)>(f) {
       Ok((i, _)) => {
         assert_eq!(f.offset(i) + i.len(), f.len());
       }
       _ => panic!("wrong return type in offset test for hex_digit"),
     }
-    match oct_digit::<_, (_, ErrorKind)>(f) {
+    match oct_digit1::<_, (_, ErrorKind)>(f) {
       Ok((i, _)) => {
         assert_eq!(f.offset(i) + i.len(), f.len());
       }
@@ -734,17 +628,17 @@ mod tests {
   #[test]
   fn hex_digit_test() {
     let i = &b"0123456789abcdefABCDEF;"[..];
-    assert_parse!(hex_digit(i), Ok((&b";"[..], &i[..i.len() - 1])));
+    assert_parse!(hex_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
 
     let i = &b"g"[..];
     assert_parse!(
-      hex_digit(i),
+      hex_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::HexDigit)))
     );
 
     let i = &b"G"[..];
     assert_parse!(
-      hex_digit(i),
+      hex_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::HexDigit)))
     );
 
@@ -765,11 +659,11 @@ mod tests {
   #[test]
   fn oct_digit_test() {
     let i = &b"01234567;"[..];
-    assert_parse!(oct_digit(i), Ok((&b";"[..], &i[..i.len() - 1])));
+    assert_parse!(oct_digit1(i), Ok((&b";"[..], &i[..i.len() - 1])));
 
     let i = &b"8"[..];
     assert_parse!(
-      oct_digit(i),
+      oct_digit1(i),
       Err(Err::Error(error_position!(i, ErrorKind::OctDigit)))
     );
 
@@ -840,19 +734,19 @@ mod tests {
 
   #[test]
   fn end_of_line() {
-    assert_parse!(eol(&b"\na"[..]), Ok((&b"a"[..], &b"\n"[..])));
-    assert_parse!(eol(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
-    assert_parse!(eol(&b"\r"[..]), Err(Err::Incomplete(Needed::Size(2))));
+    assert_parse!(line_ending(&b"\na"[..]), Ok((&b"a"[..], &b"\n"[..])));
+    assert_parse!(line_ending(&b"\r\na"[..]), Ok((&b"a"[..], &b"\r\n"[..])));
+    assert_parse!(line_ending(&b"\r"[..]), Err(Err::Incomplete(Needed::Size(2))));
     assert_parse!(
-      eol(&b"\ra"[..]),
+      line_ending(&b"\ra"[..]),
       Err(Err::Error(error_position!(&b"\ra"[..], ErrorKind::CrLf)))
     );
 
-    assert_parse!(eol("\na"), Ok(("a", "\n")));
-    assert_parse!(eol("\r\na"), Ok(("a", "\r\n")));
-    assert_parse!(eol("\r"), Err(Err::Incomplete(Needed::Size(2))));
+    assert_parse!(line_ending("\na"), Ok(("a", "\n")));
+    assert_parse!(line_ending("\r\na"), Ok(("a", "\r\n")));
+    assert_parse!(line_ending("\r"), Err(Err::Incomplete(Needed::Size(2))));
     assert_parse!(
-      eol("\ra"),
+      line_ending("\ra"),
       Err(Err::Error(error_position!("\ra", ErrorKind::CrLf)))
     );
   }
diff --git a/src/combinator/macros.rs b/src/combinator/macros.rs
index ac0bc66..a99e0ef 100644
--- a/src/combinator/macros.rs
+++ b/src/combinator/macros.rs
@@ -580,18 +580,7 @@ macro_rules! add_return_error (
 #[macro_export(local_inner_macros)]
 macro_rules! complete (
   ($i:expr, $submac:ident!( $($args:tt)* )) => (
-    {
-      use $crate::lib::std::result::Result::*;
-      use $crate::{Err,error::ErrorKind};
-
-      let i_ = $i.clone();
-      match $submac!(i_, $($args)*) {
-        Err(Err::Incomplete(_)) =>  {
-          Err(Err::Error(error_position!($i, ErrorKind::Complete)))
-        },
-        rest => rest
-      }
-    }
+    $crate::combinator::completec($i, move |i| { $submac!(i, $($args)*) })
   );
   ($i:expr, $f:expr) => (
     complete!($i, call!($f));
diff --git a/src/combinator/mod.rs b/src/combinator/mod.rs
index e0be577..562a2ea 100644
--- a/src/combinator/mod.rs
+++ b/src/combinator/mod.rs
@@ -175,9 +175,8 @@ where
   O1: InputLength,
 {
   move |input: I| {
-    let i = input.clone();
     let (input, o1) = first(input)?;
-    let (o1, o2) = second(o1)?;
+    let (_, o2) = second(o1)?;
     Ok((input, o2))
   }
 }
@@ -218,6 +217,29 @@ where
   }
 }
 
+pub fn complete<I: Clone, O, E: ParseError<I>, F>(f: F) -> impl Fn(I) -> IResult<I, O, E>
+where
+  F: Fn(I) -> IResult<I, O, E>,
+{
+  move |input: I| {
+    let i = input.clone();
+    match f(input) {
+      Err(Err::Incomplete(_)) => {
+        Err(Err::Error(E::from_error_kind(i, ErrorKind::Complete)))
+      },
+      rest => rest
+    }
+  }
+}
+
+#[doc(hidden)]
+pub fn completec<I: Clone, O, E: ParseError<I>, F>(input: I, f: F) -> IResult<I, O, E>
+where
+  F: Fn(I) -> IResult<I, O, E>,
+{
+    complete(f)(input)
+}
+
 #[cfg(test)]
 mod tests {
   use super::*;
@@ -328,7 +350,7 @@ mod tests {
   #[allow(dead_code)]
   fn custom_error(input: &[u8]) -> IResult<&[u8], &[u8], CustomError> {
     //fix_error!(input, CustomError, alphanumeric)
-    ::character::streaming::alphanumeric(input)
+    ::character::streaming::alphanumeric1(input)
   }
 
   #[test]
diff --git a/src/error.rs b/src/error.rs
index ef1de97..f462996 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -183,6 +183,7 @@ pub enum ErrorKind {
   TooLarge,
   Many0Count,
   Many1Count,
+  Float,
 }
 
 #[cfg_attr(rustfmt, rustfmt_skip)]
@@ -254,6 +255,7 @@ pub fn error_to_u32(e: &ErrorKind) -> u32 {
     ErrorKind::TooLarge                  => 71,
     ErrorKind::Many0Count                => 72,
     ErrorKind::Many1Count                => 73,
+    ErrorKind::Float                     => 74,
   }
 }
 
@@ -327,6 +329,7 @@ impl ErrorKind {
       ErrorKind::TooLarge                  => "Needed data size is too large",
       ErrorKind::Many0Count                => "Count occurrence of >=0 patterns",
       ErrorKind::Many1Count                => "Count occurrence of >=1 patterns",
+      ErrorKind::Float                     => "Float",
     }
   }
 }
diff --git a/src/lib.rs b/src/lib.rs
index 79e146b..d80d25e 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -366,6 +366,8 @@ extern crate lazy_static;
 extern crate memchr;
 #[cfg(feature = "regexp")]
 pub extern crate regex;
+#[cfg(feature = "lexical")]
+extern crate lexical_core;
 #[cfg(nightly)]
 extern crate test;
 
diff --git a/src/multi/macros.rs b/src/multi/macros.rs
index 9a23711..8d1033c 100644
--- a/src/multi/macros.rs
+++ b/src/multi/macros.rs
@@ -235,9 +235,9 @@ macro_rules! many_m_n(
 ///
 /// ```
 /// #[macro_use] extern crate nom;
-/// use nom::character::streaming::digit;
+/// use nom::character::streaming::digit1;
 ///
-/// named!(number<&[u8], usize>, many0_count!(pair!(digit, tag!(","))));
+/// named!(number<&[u8], usize>, many0_count!(pair!(digit1, tag!(","))));
 ///
 /// fn main() {
 ///     assert_eq!(number(&b"123,45,abc"[..]), Ok((&b"abc"[..], 2)));
@@ -260,9 +260,9 @@ macro_rules! many0_count {
 ///
 /// ```
 /// #[macro_use] extern crate nom;
-/// use nom::character::streaming::digit;
+/// use nom::character::streaming::digit1;
 ///
-/// named!(number<&[u8], usize>, many1_count!(pair!(digit, tag!(","))));
+/// named!(number<&[u8], usize>, many1_count!(pair!(digit1, tag!(","))));
 ///
 /// fn main() {
 ///     assert_eq!(number(&b"123,45,abc"[..]), Ok((&b"abc"[..], 2)));
@@ -310,74 +310,6 @@ macro_rules! count(
   );
 );
 
-/// `count_fixed!(O, I -> IResult<I,O>, nb) => I -> IResult<I, [O; nb]>`
-/// Applies the child parser a fixed number of times and returns a fixed size array
-/// The type must be specified and it must be `Copy`
-///
-/// ```
-/// # #[macro_use] extern crate nom;
-/// # use nom::Err;
-/// # use nom::error::ErrorKind;
-/// # fn main() {
-///  named!(counter< [&[u8]; 2] >, count_fixed!( &[u8], tag!( "abcd" ), 2 ) );
-///  // can omit the type specifier if returning slices
-///  // named!(counter< [&[u8]; 2] >, count_fixed!( tag!( "abcd" ), 2 ) );
-///
-///  let a = b"abcdabcdabcdef";
-///  let b = b"abcdefgh";
-///  let res = [&b"abcd"[..], &b"abcd"[..]];
-///
-///  assert_eq!(counter(&a[..]),Ok((&b"abcdef"[..], res)));
-///  assert_eq!(counter(&b[..]), Err(Err::Error(error_position!(&b[..], ErrorKind::Count))));
-/// # }
-/// ```
-///
-#[macro_export(local_inner_macros)]
-macro_rules! count_fixed (
-  ($i:expr, $typ:ty, $submac:ident!( $($args:tt)* ), $count: expr) => (
-    {
-      use $crate::lib::std::result::Result::*;
-      use $crate::Err;
-
-      let ret;
-      let mut input = $i.clone();
-      // `$typ` must be Copy, and thus having no destructor, this is panic safe
-      let mut res: [$typ; $count] = unsafe{[$crate::lib::std::mem::uninitialized(); $count as usize]};
-      let mut cnt: usize = 0;
-
-      loop {
-        if cnt == $count {
-          ret = Ok((input, res)); break;
-        }
-
-        match $submac!(input, $($args)*) {
-          Ok((i,o)) => {
-            res[cnt] = o;
-            cnt += 1;
-            input = i;
-          },
-          Err(Err::Error(e))  => {
-            fn unify_types<T>(_: &T, _: &T) {}
-            let e2 = error_position!($i, $crate::error::ErrorKind::Count);
-            unify_types(&e, &e2);
-            ret = Err(Err::Error(e2));
-            break;
-          },
-          Err(e) => {
-            ret = Err(e);
-            break;
-          },
-        }
-      }
-
-      ret
-    }
-);
-  ($i:expr, $typ: ty, $f:expr, $count: expr) => (
-    count_fixed!($i, $typ, call!($f), $count);
-  );
-);
-
 /// `length_count!(I -> IResult<I, nb>, I -> IResult<I,O>) => I -> IResult<I, Vec<O>>`
 /// gets a number from the first parser, then applies the second parser that many times
 #[macro_export(local_inner_macros)]
@@ -576,7 +508,7 @@ mod tests {
   use lib::std::str::{self, FromStr};
   #[cfg(feature = "alloc")]
   use lib::std::vec::Vec;
-  use character::streaming::digit;
+  use character::streaming::digit1 as digit;
   use number::streaming::{be_u16, be_u8, le_u16};
   use error::ErrorKind;
 
@@ -670,7 +602,7 @@ mod tests {
   #[test]
   #[cfg(feature = "alloc")]
   fn separated_list_complete() {
-    use character::complete::alpha;
+    use character::complete::alpha1 as alpha;
 
     named!(multi<&[u8],Vec<&[u8]> >, separated_list_complete!(tag!(","), alpha));
     let a = &b"abcdef;"[..];
@@ -719,7 +651,7 @@ mod tests {
   #[test]
   #[cfg(feature = "alloc")]
   fn separated_nonempty_list_complete() {
-    use character::complete::alpha;
+    use character::complete::alpha1 as alpha;
 
     named!(multi<&[u8],Vec<&[u8]> >, separated_nonempty_list_complete!(tag!(","), alpha));
     let a = &b"abcdef;"[..];
@@ -900,31 +832,6 @@ mod tests {
     assert_eq!(counter_2(error_2), Ok((error_2_remain, parsed_err_2)));
   }
 
-  #[test]
-  fn count_fixed() {
-    const TIMES: usize = 2;
-    named!(tag_abc, tag!("abc"));
-    named!( cnt_2<&[u8], [&[u8]; TIMES] >, count_fixed!(&[u8], tag_abc, TIMES ) );
-
-    assert_eq!(cnt_2(&b"abcabcabcdef"[..]), Ok((&b"abcdef"[..], [&b"abc"[..], &b"abc"[..]])));
-    assert_eq!(cnt_2(&b"ab"[..]), Err(Err::Incomplete(Needed::Size(3))));
-    assert_eq!(cnt_2(&b"abcab"[..]), Err(Err::Incomplete(Needed::Size(3))));
-    assert_eq!(cnt_2(&b"xxx"[..]), Err(Err::Error(error_position!(&b"xxx"[..], ErrorKind::Count))));
-    assert_eq!(
-      cnt_2(&b"xxxabcabcdef"[..]),
-      Err(Err::Error(error_position!(&b"xxxabcabcdef"[..], ErrorKind::Count)))
-    );
-    assert_eq!(
-      cnt_2(&b"abcxxxabcdef"[..]),
-      Err(Err::Error(error_position!(&b"abcxxxabcdef"[..], ErrorKind::Count)))
-    );
-  }
-
-  #[allow(dead_code)]
-  pub fn compile_count_fixed(input: &[u8]) -> IResult<&[u8], ()> {
-    do_parse!(input, tag!("abcd") >> count_fixed!(u16, le_u16, 4) >> eof!() >> ())
-  }
-
   #[derive(Debug, Clone, PartialEq)]
   pub struct NilError;
 
@@ -943,38 +850,6 @@ mod tests {
     }
   }
 
-  #[allow(unused_variables)]
-  #[test]
-  fn count_fixed_no_type() {
-    const TIMES: usize = 2;
-    named!(tag_abc, tag!("abc"));
-    named!( counter_2<&[u8], [&[u8]; TIMES], NilError >, count_fixed!(&[u8], fix_error!(NilError, tag_abc), TIMES ) );
-
-    let done = &b"abcabcabcdef"[..];
-    let parsed_main = [&b"abc"[..], &b"abc"[..]];
-    let rest = &b"abcdef"[..];
-    let incomplete_1 = &b"ab"[..];
-    let incomplete_2 = &b"abcab"[..];
-    let error = &b"xxx"[..];
-    let error_1 = &b"xxxabcabcdef"[..];
-    let error_1_remain = &b"xxxabcabcdef"[..];
-    let error_2 = &b"abcxxxabcdef"[..];
-    let error_2_remain = &b"abcxxxabcdef"[..];
-
-    assert_eq!(counter_2(done), Ok((rest, parsed_main)));
-    assert_eq!(counter_2(incomplete_1), Err(Err::Incomplete(Needed::Size(3))));
-    assert_eq!(counter_2(incomplete_2), Err(Err::Incomplete(Needed::Size(3))));
-    assert_eq!(counter_2(error), Err(Err::Error(error_position!(error, ErrorKind::Count))));
-    assert_eq!(
-      counter_2(error_1),
-      Err(Err::Error(error_position!(error_1_remain, ErrorKind::Count)))
-    );
-    assert_eq!(
-      counter_2(error_2),
-      Err(Err::Error(error_position!(error_2_remain, ErrorKind::Count)))
-    );
-  }
-
   named!(pub number<u32>, map_res!(
     map_res!(
       digit,
diff --git a/src/multi/mod.rs b/src/multi/mod.rs
index 2a5ce0e..d06d736 100644
--- a/src/multi/mod.rs
+++ b/src/multi/mod.rs
@@ -516,15 +516,16 @@ where
 /// * `g` The function that combines a result of `f` with
 ///       the current accumulator.
 //FIXME: streaming
-pub fn fold_many0<I, O, E, F, G, R>(f: F, init: R, g: G) -> impl FnOnce(I) -> IResult<I, R, E>
+pub fn fold_many0<I, O, E, F, G, R>(f: F, init: R, g: G) -> impl Fn(I) -> IResult<I, R, E>
 where
   I: Clone + PartialEq,
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   move |i: I| {
-    let mut res = init;
+    let mut res = init.clone();
     let mut input = i.clone();
 
     loop {
@@ -557,6 +558,7 @@ where
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   fold_many0(f, init, g)(i)
 }
@@ -571,15 +573,17 @@ where
 /// * `g` The function that combines a result of `f` with
 ///       the current accumulator.
 //FIXME: streaming
-pub fn fold_many1<I, O, E, F, G, R>(f: F, init: R, g: G) -> impl FnOnce(I) -> IResult<I, R, E>
+pub fn fold_many1<I, O, E, F, G, R>(f: F, init: R, g: G) -> impl Fn(I) -> IResult<I, R, E>
 where
   I: Clone + PartialEq,
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   move |i: I| {
     let _i = i.clone();
+    let init = init.clone();
     match f(_i) {
       Err(Err::Error(_)) => Err(Err::Error(E::from_error_kind(i, ErrorKind::Many1))),
       Err(e) => return Err(e),
@@ -618,6 +622,7 @@ where
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   fold_many1(f, init, g)(i)
 }
@@ -634,15 +639,16 @@ where
 /// * `g` The function that combines a result of `f` with
 ///       the current accumulator.
 //FIXME: streaming
-pub fn fold_many_m_n<I, O, E, F, G, R>(m: usize, n: usize, f: F, init: R, g: G) -> impl FnOnce(I) ->IResult<I, R, E>
+pub fn fold_many_m_n<I, O, E, F, G, R>(m: usize, n: usize, f: F, init: R, g: G) -> impl Fn(I) ->IResult<I, R, E>
 where
   I: Clone + PartialEq,
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   move |i: I| {
-    let mut acc = init;
+    let mut acc = init.clone();
     let mut input = i.clone();
     for count in 0..n {
       let _input = input.clone();
@@ -677,6 +683,7 @@ where
   F: Fn(I) -> IResult<I, O, E>,
   G: Fn(R, O) -> R,
   E: ParseError<I>,
+  R: Clone,
 {
   fold_many_m_n(m, n, f, init, g)(i)
 }
diff --git a/src/number/complete.rs b/src/number/complete.rs
index 1b9604e..840f569 100644
--- a/src/number/complete.rs
+++ b/src/number/complete.rs
@@ -3,11 +3,10 @@
 use internal::*;
 use error::ParseError;
 use traits::{AsChar, InputIter, InputLength, InputTakeAtPosition};
-use traits::{AtEof, ParseTo};
-use lib::std::ops::{Range, RangeFrom, RangeTo};
+use lib::std::ops::{RangeFrom, RangeTo};
 use traits::{Offset, Slice};
 use error::{ErrorKind, make_error};
-use character::complete::{digit, digit1};
+use character::complete::digit1;
 
 /// Recognizes an unsigned 1 byte integer (equivalent to take!(1))
 ///
@@ -383,10 +382,10 @@ pub fn hex_u32<'a, E: ParseError<&'a [u8]>>(input: &'a[u8]) -> IResult<&'a[u8],
 #[cfg_attr(rustfmt, rustfmt_skip)]
 pub fn recognize_float<T, E:ParseError<T>>(input: T) -> IResult<T, T, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -394,8 +393,8 @@ where
     tuple!(
       opt!(alt!(char!('+') | char!('-'))),
       alt!(
-        value!((), tuple!(digit, opt!(pair!(char!('.'), opt!(digit)))))
-      | value!((), tuple!(char!('.'), digit))
+        value!((), tuple!(digit1, opt!(pair!(char!('.'), opt!(digit1)))))
+      | value!((), tuple!(char!('.'), digit1))
       ),
       opt!(tuple!(
         alt!(char!('e') | char!('E')),
@@ -412,13 +411,13 @@ where
 /// Recognizes floating point number in a byte string and returns a f32
 ///
 /// *complete version*: can parse until the end of input
-#[cfg(feature = "alloc")]
+#[cfg(not(feature = "lexical"))]
 pub fn float<T, E:ParseError<T>>(input: T) -> IResult<T, f32, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + InputLength + ParseTo<f32> + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter + InputLength + ::traits::ParseTo<f32>,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -426,21 +425,41 @@ where
     Err(e) => Err(e),
     Ok((i, s)) => match s.parse_to() {
       Some(n) => Ok((i, n)),
-      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::ParseTo)))
+      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::Float)))
     }
   }
 }
 
+/// Recognizes floating point number in a byte string and returns a f32
+///
+/// *complete version*: can parse until the end of input
+///
+/// this function uses the lexical-core crate for float parsing by default, you
+/// can deactivate it by removing the "lexical" feature
+#[cfg(feature = "lexical")]
+pub fn float<T, E:ParseError<T>>(input: T) -> IResult<T, f32, E>
+where
+  T: ::traits::AsBytes + InputLength + Slice<RangeFrom<usize>>,
+{
+  let res = ::lexical_core::try_atof32_slice(input.as_bytes());
+
+  match res.error.code {
+    ::lexical_core::ErrorCode::Success => Ok((input.slice(input.input_len()..), res.value)),
+    ::lexical_core::ErrorCode::InvalidDigit => Ok((input.slice(res.error.index..), res.value)),
+    _ => Err(Err::Error(E::from_error_kind(input, ErrorKind::Float))),
+  }
+}
+
 /// Recognizes floating point number in a byte string and returns a f64
 ///
 /// *complete version*: can parse until the end of input
-#[cfg(feature = "alloc")]
+#[cfg(not(feature = "lexical"))]
 pub fn double<T, E:ParseError<T>>(input: T) -> IResult<T, f64, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + InputLength + ParseTo<f64> + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter + InputLength + ::traits::ParseTo<f64>,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -448,11 +467,31 @@ where
     Err(e) => Err(e),
     Ok((i, s)) => match s.parse_to() {
       Some(n) => Ok((i, n)),
-      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::ParseTo)))
+      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::Float)))
     }
   }
 }
 
+/// Recognizes floating point number in a byte string and returns a f64
+///
+/// *complete version*: can parse until the end of input
+///
+/// this function uses the lexical-core crate for float parsing by default, you
+/// can deactivate it by removing the "lexical" feature
+#[cfg(feature = "lexical")]
+pub fn double<T, E:ParseError<T>>(input: T) -> IResult<T, f64, E>
+where
+  T: ::traits::AsBytes + InputLength + Slice<RangeFrom<usize>>,
+{
+  let res = ::lexical_core::try_atof64_slice(input.as_bytes());
+
+  match res.error.code {
+    ::lexical_core::ErrorCode::Success => Ok((input.slice(input.input_len()..), res.value)),
+    ::lexical_core::ErrorCode::InvalidDigit => Ok((input.slice(res.error.index..), res.value)),
+    _ => Err(Err::Error(E::from_error_kind(input, ErrorKind::Float))),
+  }
+}
+
 #[cfg(test)]
 mod tests {
   use super::*;
diff --git a/src/number/streaming.rs b/src/number/streaming.rs
index 877076b..3c0ebdc 100644
--- a/src/number/streaming.rs
+++ b/src/number/streaming.rs
@@ -3,10 +3,9 @@
 use internal::*;
 use error::{ErrorKind, ParseError};
 use traits::{AsChar, InputIter, InputLength, InputTakeAtPosition};
-use traits::{AtEof, ParseTo};
-use lib::std::ops::{Range, RangeFrom, RangeTo};
+use lib::std::ops::{RangeFrom, RangeTo};
 use traits::{Offset, Slice};
-use character::streaming::digit;
+use character::streaming::digit1;
 
 /// Recognizes an unsigned 1 byte integer (equivalent to take!(1))
 ///
@@ -382,10 +381,10 @@ pub fn hex_u32<'a, E: ParseError<&'a [u8]>>(input: &'a[u8]) -> IResult<&'a[u8],
 #[cfg_attr(rustfmt, rustfmt_skip)]
 pub fn recognize_float<T, E:ParseError<T>>(input: T) -> IResult<T, T, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -393,13 +392,13 @@ where
     tuple!(
       opt!(alt!(char!('+') | char!('-'))),
       alt!(
-        value!((), tuple!(digit, opt!(pair!(char!('.'), opt!(digit)))))
-      | value!((), tuple!(char!('.'), digit))
+        value!((), tuple!(digit1, opt!(pair!(char!('.'), opt!(digit1)))))
+      | value!((), tuple!(char!('.'), digit1))
       ),
       opt!(tuple!(
         alt!(char!('e') | char!('E')),
         opt!(alt!(char!('+') | char!('-'))),
-        digit
+        digit1
         )
       )
     )
@@ -409,13 +408,13 @@ where
 /// Recognizes floating point number in a byte string and returns a f32
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if it reaches the end of input
-#[cfg(feature = "alloc")]
+#[cfg(not(feature = "lexical"))]
 pub fn float<T, E:ParseError<T>>(input: T) -> IResult<T, f32, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + InputLength + ParseTo<f32> + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter + InputLength + ::traits::ParseTo<f32>,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -423,21 +422,41 @@ where
     Err(e) => Err(e),
     Ok((i, s)) => match s.parse_to() {
       Some(n) => Ok((i, n)),
-      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::ParseTo)))
+      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::Float)))
     }
   }
 }
 
+/// Recognizes floating point number in a byte string and returns a f32
+///
+/// *complete version*: can parse until the end of input
+///
+/// this function uses the lexical-core crate for float parsing by default, you
+/// can deactivate it by removing the "lexical" feature
+#[cfg(feature = "lexical")]
+pub fn float<T, E:ParseError<T>>(input: T) -> IResult<T, f32, E>
+where
+  T: ::traits::AsBytes + InputLength + Slice<RangeFrom<usize>>,
+{
+  let res = ::lexical_core::try_atof32_slice(input.as_bytes());
+
+  match res.error.code {
+    ::lexical_core::ErrorCode::Success => Err(Err::Incomplete(Needed::Unknown)),
+    ::lexical_core::ErrorCode::InvalidDigit => Ok((input.slice(res.error.index..), res.value)),
+    _ => Err(Err::Error(E::from_error_kind(input, ErrorKind::Float))),
+  }
+}
+
 /// Recognizes floating point number in a byte string and returns a f64
 ///
 /// *streaming version*: will return `Err(nom::Err::Incomplete(_))` if it reaches the end of input
-#[cfg(feature = "alloc")]
+#[cfg(not(feature = "lexical"))]
 pub fn double<T, E:ParseError<T>>(input: T) -> IResult<T, f64, E>
 where
-  T: Slice<Range<usize>> + Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
+  T: Slice<RangeFrom<usize>> + Slice<RangeTo<usize>>,
   T: Clone + Offset,
-  T: InputIter + InputLength + ParseTo<f64> + AtEof,
-  <T as InputIter>::Item: AsChar+Copy,
+  T: InputIter + InputLength + ::traits::ParseTo<f64>,
+  <T as InputIter>::Item: AsChar,
   T: InputTakeAtPosition,
   <T as InputTakeAtPosition>::Item: AsChar
 {
@@ -445,11 +464,32 @@ where
     Err(e) => Err(e),
     Ok((i, s)) => match s.parse_to() {
       Some(n) => Ok((i, n)),
-      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::ParseTo)))
+      None =>  Err(Err::Error(E::from_error_kind(i, ErrorKind::Float)))
     }
   }
 }
 
+/// Recognizes floating point number in a byte string and returns a f64
+///
+/// *complete version*: can parse until the end of input
+///
+/// this function uses the lexical-core crate for float parsing by default, you
+/// can deactivate it by removing the "lexical" feature
+#[cfg(feature = "lexical")]
+pub fn double<T, E:ParseError<T>>(input: T) -> IResult<T, f64, E>
+where
+  T: ::traits::AsBytes + InputLength + Slice<RangeFrom<usize>>,
+{
+  let res = ::lexical_core::try_atof64_slice(input.as_bytes());
+
+  match res.error.code {
+    ::lexical_core::ErrorCode::Success => Err(Err::Incomplete(Needed::Unknown)),
+    ::lexical_core::ErrorCode::InvalidDigit => Ok((input.slice(res.error.index..), res.value)),
+    _ => Err(Err::Error(E::from_error_kind(input, ErrorKind::Float))),
+  }
+}
+
+
 #[cfg(test)]
 mod tests {
   use super::*;
diff --git a/src/whitespace.rs b/src/whitespace.rs
index 075ffa2..7fb0a84 100644
--- a/src/whitespace.rs
+++ b/src/whitespace.rs
@@ -829,23 +829,6 @@ macro_rules! sep (
   };
 );
 
-use internal::IResult;
-use traits::{AsChar, FindToken, InputTakeAtPosition};
-#[allow(unused_imports)]
-pub fn sp<'a, T>(input: T) -> IResult<T, T>
-where
-  T: InputTakeAtPosition,
-  <T as InputTakeAtPosition>::Item: AsChar + Clone,
-  &'a str: FindToken<<T as InputTakeAtPosition>::Item>,
-{
-  input.split_at_position(|item| {
-    let c = item.clone().as_char();
-    !(c == ' ' || c == '\t' || c == '\r' || c == '\n')
-  })
-  //this could be written as followed, but not using FindToken is faster
-  //eat_separator!(input, " \t\r\n")
-}
-
 /// `ws!(I -> IResult<I,O>) => I -> IResult<I, O>`
 ///
 /// transforms a parser to automatically consume
@@ -876,15 +859,15 @@ where
 macro_rules! ws (
   ($i:expr, $($args:tt)*) => (
     {
-      use $crate::sp;
       use $crate::Convert;
       use $crate::Err;
       use $crate::lib::std::result::Result::*;
+      use $crate::character::complete::multispace0;
 
-      match sep!($i, sp, $($args)*) {
+      match sep!($i, multispace0, $($args)*) {
         Err(e) => Err(e),
         Ok((i1,o))    => {
-          match (sp)(i1) {
+          match (multispace0)(i1) {
             Err(e) => Err(Err::convert(e)),
             Ok((i2,_))    => Ok((i2, o))
           }
@@ -902,12 +885,12 @@ mod tests {
   use lib::std::fmt::Debug;
   use internal::{Err, IResult, Needed};
   use error::ParseError;
-  use super::sp;
+  use character::complete::multispace0 as sp;
   use error::ErrorKind;
 
   #[test]
   fn spaaaaace() {
-    assert_eq!(sp(&b" \t abc "[..]), Ok((&b"abc "[..], &b" \t "[..])));
+    assert_eq!(sp::<_,(_,ErrorKind)>(&b" \t abc "[..]), Ok((&b"abc "[..], &b" \t "[..])));
   }
 
   #[test]


Test patch:
diff --git a/tests/arithmetic.rs b/tests/arithmetic.rs
index 5f1aac5..d446537 100644
--- a/tests/arithmetic.rs
+++ b/tests/arithmetic.rs
@@ -9,7 +9,7 @@ use nom::{
   combinator::map_res,
   character::complete::char,
   bytes::complete::tag,
-  character::complete::{digit, space0 as space},
+  character::complete::{digit1 as digit, space0 as space},
   multi::fold_many0,
   sequence::{delimited, pair}
 };
diff --git a/tests/arithmetic_ast.rs b/tests/arithmetic_ast.rs
index 61a627f..1973edd 100644
--- a/tests/arithmetic_ast.rs
+++ b/tests/arithmetic_ast.rs
@@ -8,7 +8,7 @@ use std::str::FromStr;
 
 use nom::{
   IResult,
-  character::complete::{digit, multispace0 as multispace},
+  character::complete::{digit1 as digit, multispace0 as multispace},
   sequence::{preceded, delimited},
   combinator::{map, map_res},
   multi::many0,
diff --git a/tests/custom_errors.rs b/tests/custom_errors.rs
index fed9b32..89366dc 100644
--- a/tests/custom_errors.rs
+++ b/tests/custom_errors.rs
@@ -6,7 +6,7 @@ extern crate nom;
 
 use nom::IResult;
 use nom::error::{ErrorKind,ParseError};
-use nom::character::streaming::digit;
+use nom::character::streaming::digit1 as digit;
 
 use std::convert::From;
 
diff --git a/tests/float.rs b/tests/float.rs
index 52768ca..eb82804 100644
--- a/tests/float.rs
+++ b/tests/float.rs
@@ -1,7 +1,7 @@
 #[macro_use]
 extern crate nom;
 
-use nom::character::streaming::digit;
+use nom::character::streaming::digit1 as digit;
 
 use std::str;
 use std::str::FromStr;
diff --git a/tests/inference.rs b/tests/inference.rs
index 286585e..a2453e6 100644
--- a/tests/inference.rs
+++ b/tests/inference.rs
@@ -9,7 +9,7 @@
 extern crate nom;
 
 use std::str;
-use nom::character::{streaming::alpha, is_digit};
+use nom::character::{streaming::alpha1 as alpha, is_digit};
 
 // issue #617
 named!(multi<&[u8], () >, fold_many0!( take_while1!( is_digit ), (), |_, _| {}));
diff --git a/tests/ini.rs b/tests/ini.rs
index 388c76b..c3f9b75 100644
--- a/tests/ini.rs
+++ b/tests/ini.rs
@@ -6,7 +6,7 @@ use nom::{
   bytes::complete::take_while,
   sequence::delimited,
   combinator::map_res,
-  character::complete::{char, alphanumeric, multispace0 as multispace, space0 as space}
+  character::complete::{char, alphanumeric1 as alphanumeric, multispace0 as multispace, space0 as space}
 };
 
 use std::str;
diff --git a/tests/ini_str.rs b/tests/ini_str.rs
index 4dd319b..8b8bded 100644
--- a/tests/ini_str.rs
+++ b/tests/ini_str.rs
@@ -6,7 +6,7 @@ use nom::{
   combinator::{map_res, opt},
   bytes::complete::{take_while, is_a},
   sequence::{delimited, terminated},
-  character::complete::{char, alphanumeric, space0 as space, not_line_ending}
+  character::complete::{char, alphanumeric1 as alphanumeric, space0 as space}
 };
 
 use std::collections::HashMap;
@@ -31,6 +31,10 @@ fn is_line_ending_or_comment(chr: char) -> bool {
   chr == ';' || chr == '\n'
 }
 
+fn not_line_ending(i: &str) -> IResult<&str, &str> {
+  take_while(|c| c != '\r' && c != '\n')(i)
+}
+
 fn space_or_line_ending(i: &str) -> IResult<&str, &str> {
   is_a(" \r\n")(i)
 }
diff --git a/tests/issues.rs b/tests/issues.rs
index cc852ac..31ec205 100644
--- a/tests/issues.rs
+++ b/tests/issues.rs
@@ -5,7 +5,7 @@
 #[macro_use]
 extern crate nom;
 
-use nom::{character::{is_digit, streaming::space}, Err, IResult, Needed, error::ErrorKind, number::streaming::le_u64};
+use nom::{character::{is_digit, streaming::space1 as space}, Err, IResult, Needed, error::ErrorKind, number::streaming::le_u64};
 
 #[allow(dead_code)]
 struct Range {
@@ -68,7 +68,7 @@ fn issue_58() {
 #[cfg(feature = "std")]
 mod parse_int {
   use nom::HexDisplay;
-  use nom::{IResult, character::streaming::{digit, space}};
+  use nom::{IResult, character::streaming::{digit1 as digit, space1 as space}};
   use std::str;
 
   named!(parse_ints<Vec<i32>>, many0!(spaces_or_int));
@@ -232,7 +232,7 @@ named_args!(issue_771(count: usize)<Vec<u32>>,
 /// mask the error ('"Use of undeclared type or module `Needed`" in escaped_transform!').
 mod issue_780 {
   named!(issue_780<&str, String>,
-    escaped_transform!(call!(::nom::character::streaming::alpha), '\\', tag!("n"))
+    escaped_transform!(call!(::nom::character::streaming::alpha1), '\\', tag!("n"))
   );
 }
 
diff --git a/tests/multiline.rs b/tests/multiline.rs
index 03a0383..06c2ece 100644
--- a/tests/multiline.rs
+++ b/tests/multiline.rs
@@ -5,7 +5,7 @@ use nom::{
   IResult,
   multi::many0,
   sequence::terminated,
-  character::complete::{alphanumeric, eol}
+  character::complete::{alphanumeric1 as alphanumeric, line_ending as eol}
 };
 
 pub fn end_of_line(input: &str) -> IResult<&str, &str> {
diff --git a/tests/named_args.rs b/tests/named_args.rs
index c1d54b3..811b0a0 100644
--- a/tests/named_args.rs
+++ b/tests/named_args.rs
@@ -4,7 +4,7 @@ extern crate nom;
 use nom::{
   branch::alt,
   sequence::{delimited, pair, preceded},
-  character::complete::{digit, space0 as space},
+  character::complete::{digit1 as digit, space0 as space},
   bytes::complete::tag
 };
 
diff --git a/tests/overflow.rs b/tests/overflow.rs
index 232a343..a7236fd 100644
--- a/tests/overflow.rs
+++ b/tests/overflow.rs
@@ -112,19 +112,6 @@ fn overflow_incomplete_count() {
   );
 }
 
-#[test]
-fn overflow_incomplete_count_fixed() {
-  named!(
-    counter<[&[u8]; 2]>,
-    count_fixed!(&[u8], length_bytes!(be_u64), 2)
-  );
-
-  assert_eq!(
-    counter(&b"\x00\x00\x00\x00\x00\x00\x00\x01\xaa\xff\xff\xff\xff\xff\xff\xff\xef\xaa"[..]),
-    Err(Err::Incomplete(Needed::Size(18446744073709551599)))
-  );
-}
-
 #[test]
 #[cfg(feature = "alloc")]
 fn overflow_incomplete_length_count() {