Skip to content

Commit

Permalink
fix: Rename character to ascii
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 27, 2023
1 parent be70314 commit ab22c1e
Show file tree
Hide file tree
Showing 37 changed files with 486 additions and 143 deletions.
2 changes: 1 addition & 1 deletion benches/number.rs
Expand Up @@ -3,8 +3,8 @@ extern crate criterion;

use criterion::Criterion;

use winnow::ascii::float;
use winnow::binary::be_u64;
use winnow::character::float;
use winnow::error::ErrMode;
use winnow::error::Error;
use winnow::error::ErrorKind;
Expand Down
2 changes: 1 addition & 1 deletion examples/arithmetic/parser.rs
Expand Up @@ -2,7 +2,7 @@ use std::str::FromStr;

use winnow::prelude::*;
use winnow::{
character::{digit1 as digits, space0 as spaces},
ascii::{digit1 as digits, space0 as spaces},
combinator::alt,
combinator::delimited,
combinator::fold_many0,
Expand Down
2 changes: 1 addition & 1 deletion examples/arithmetic/parser_ast.rs
Expand Up @@ -5,7 +5,7 @@ use std::str::FromStr;

use winnow::prelude::*;
use winnow::{
character::{digit1 as digit, multispace0 as multispace},
ascii::{digit1 as digit, multispace0 as multispace},
combinator::alt,
combinator::many0,
combinator::{delimited, preceded},
Expand Down
2 changes: 1 addition & 1 deletion examples/http/parser.rs
@@ -1,4 +1,4 @@
use winnow::{character::line_ending, combinator::many1, token::take_while1, IResult, Parser};
use winnow::{ascii::line_ending, combinator::many1, token::take_while1, IResult, Parser};

pub type Stream<'i> = &'i [u8];

Expand Down
2 changes: 1 addition & 1 deletion examples/http/parser_streaming.rs
@@ -1,5 +1,5 @@
use winnow::{
character::line_ending, combinator::many1, stream::Partial, token::take_while1, IResult, Parser,
ascii::line_ending, combinator::many1, stream::Partial, token::take_while1, IResult, Parser,
};

pub type Stream<'i> = Partial<&'i [u8]>;
Expand Down
2 changes: 1 addition & 1 deletion examples/ini/parser.rs
Expand Up @@ -3,7 +3,7 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::{alphanumeric1 as alphanumeric, multispace0 as multispace, space0 as space},
ascii::{alphanumeric1 as alphanumeric, multispace0 as multispace, space0 as space},
combinator::many0,
combinator::opt,
combinator::{delimited, separated_pair, terminated},
Expand Down
2 changes: 1 addition & 1 deletion examples/ini/parser_str.rs
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use winnow::prelude::*;
use winnow::{
character::{alphanumeric1 as alphanumeric, space0 as space},
ascii::{alphanumeric1 as alphanumeric, space0 as space},
combinator::many0,
combinator::opt,
combinator::{delimited, terminated},
Expand Down
2 changes: 1 addition & 1 deletion examples/iterator.rs
@@ -1,7 +1,7 @@
use std::collections::HashMap;
use std::iter::Iterator;

use winnow::character::alphanumeric1;
use winnow::ascii::alphanumeric1;
use winnow::combinator::iterator;
use winnow::combinator::{separated_pair, terminated};
use winnow::prelude::*;
Expand Down
2 changes: 1 addition & 1 deletion examples/json/parser.rs
Expand Up @@ -3,7 +3,7 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::float,
ascii::float,
combinator::alt,
combinator::cut_err,
combinator::{delimited, preceded, separated_pair, terminated},
Expand Down
2 changes: 1 addition & 1 deletion examples/json/parser_dispatch.rs
Expand Up @@ -3,7 +3,7 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::float,
ascii::float,
combinator::cut_err,
combinator::fail,
combinator::peek,
Expand Down
2 changes: 1 addition & 1 deletion examples/json/parser_partial.rs
Expand Up @@ -3,7 +3,7 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::float,
ascii::float,
combinator::alt,
combinator::{cut_err, rest},
combinator::{delimited, preceded, separated_pair, terminated},
Expand Down
2 changes: 1 addition & 1 deletion examples/json_iterator.rs
Expand Up @@ -2,7 +2,7 @@ use std::collections::HashMap;

use winnow::prelude::*;
use winnow::{
character::{alphanumeric1 as alphanumeric, escaped, float},
ascii::{alphanumeric1 as alphanumeric, escaped, float},
combinator::alt,
combinator::cut_err,
combinator::separated0,
Expand Down
4 changes: 2 additions & 2 deletions examples/ndjson/parser.rs
Expand Up @@ -3,8 +3,8 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::float,
character::line_ending,
ascii::float,
ascii::line_ending,
combinator::alt,
combinator::cut_err,
combinator::{delimited, preceded, separated_pair, terminated},
Expand Down
2 changes: 1 addition & 1 deletion examples/s_expression/parser.rs
Expand Up @@ -3,7 +3,7 @@
//! Lisp is a simple type of language made up of Atoms and Lists, forming easily parsable trees.

use winnow::{
character::{alpha1, digit1, multispace0, multispace1},
ascii::{alpha1, digit1, multispace0, multispace1},
combinator::alt,
combinator::many0,
combinator::{cut_err, opt},
Expand Down
2 changes: 1 addition & 1 deletion examples/string/parser.rs
Expand Up @@ -9,7 +9,7 @@
//! - an escape followed by whitespace consumes all whitespace between the
//! escape and the next non-whitespace character

use winnow::character::multispace1;
use winnow::ascii::multispace1;
use winnow::combinator::alt;
use winnow::combinator::fold_many0;
use winnow::combinator::{delimited, preceded};
Expand Down
2 changes: 1 addition & 1 deletion fuzz/fuzz_targets/fuzz_arithmetic.rs
Expand Up @@ -4,7 +4,7 @@ use std::str;

use winnow::prelude::*;
use winnow::{
character::{digit1 as digit, space0 as space},
ascii::{digit1 as digit, space0 as space},
combinator::alt,
combinator::fold_many0,
combinator::{delimited, terminated},
Expand Down
2 changes: 1 addition & 1 deletion src/_topic/language.rs
Expand Up @@ -29,7 +29,7 @@
//! use winnow::{
//! error::ParseError,
//! combinator::delimited,
//! character::multispace0,
//! ascii::multispace0,
//! };
//!
//! /// A combinator that takes a parser `inner` and produces a parser that also consumes both leading and
Expand Down
10 changes: 5 additions & 5 deletions src/_tutorial/chapter_2.rs
Expand Up @@ -97,9 +97,9 @@
//! > configurable or stateful parsers.
//!
//! Some of character classes are common enough that a named parser is provided, like with:
//! - [`line_ending`][crate::character::line_ending]: Recognizes an end of line (both `\n` and `\r\n`)
//! - [`newline`][crate::character::newline]: Matches a newline character `\n`
//! - [`tab`][crate::character::tab]: Matches a tab character `\t`
//! - [`line_ending`][crate::ascii::line_ending]: Recognizes an end of line (both `\n` and `\r\n`)
//! - [`newline`][crate::ascii::newline]: Matches a newline character `\n`
//! - [`tab`][crate::ascii::tab]: Matches a tab character `\t`
//!
//! You can then capture sequences of these characters with parsers like [`take_while1`].
//! ```rust
Expand All @@ -126,7 +126,7 @@
//! ```rust
//! # use winnow::Parser;
//! # use winnow::IResult;
//! use winnow::character::hex_digit1;
//! use winnow::ascii::hex_digit1;
//!
//! fn parse_digits(input: &str) -> IResult<&str, &str> {
//! hex_digit1.parse_next(input)
Expand All @@ -144,7 +144,7 @@
//! ```

#![allow(unused_imports)]
use crate::character::hex_digit1;
use crate::ascii::hex_digit1;
use crate::stream::ContainsToken;
use crate::token::one_of;
use crate::token::tag;
Expand Down
2 changes: 1 addition & 1 deletion src/_tutorial/chapter_4.rs
Expand Up @@ -22,7 +22,7 @@
//! ```rust
//! # use winnow::Parser;
//! # use winnow::IResult;
//! # use winnow::character::digit1;
//! # use winnow::ascii::digit1;
//! #
//! fn parse_digits(input: &str) -> IResult<&str, usize> {
//! digit1
Expand Down

0 comments on commit ab22c1e

Please sign in to comment.