Skip to content

Commit

Permalink
remove some character parsers
Browse files Browse the repository at this point in the history
list of removed parsers: eol, alpha, digit, hex_digit, oct_digit,
alphanumeric, space, multispace

Those parsers were aliases of other parsers, like alpha being an alias
of alias1. So they are still present, this is just reducing the number
of functions to choose from
  • Loading branch information
Geal committed Apr 26, 2019
1 parent 2ad6509 commit ab7211e
Show file tree
Hide file tree
Showing 18 changed files with 178 additions and 504 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@

### 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

## 4.2.3 - 2019-03-23

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion examples/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
6 changes: 3 additions & 3 deletions src/bytes/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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"[..])));
/// # }
Expand Down Expand Up @@ -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;

Expand Down
Loading

0 comments on commit ab7211e

Please sign in to comment.