• Home
  • Raw
  • Download

Lines Matching +full:crate +full:- +full:example

5 use crate::branch::alt;
6 use crate::combinator::opt;
7 use crate::error::ErrorKind;
8 use crate::error::ParseError;
9 use crate::internal::{Err, IResult};
10 use crate::lib::std::ops::{Range, RangeFrom, RangeTo};
11 use crate::traits::{
14 use crate::traits::{Compare, CompareResult};
19 /// # Example
24 /// fn parser(i: &str) -> IResult<&str, char> {
32 pub fn char<I, Error: ParseError<I>>(c: char) -> impl Fn(I) -> IResult<I, char, Error> in char()
49 /// # Example
54 /// fn parser(i: &str) -> IResult<&str, char> {
61 pub fn satisfy<F, I, Error: ParseError<I>>(cond: F) -> impl Fn(I) -> IResult<I, char, Error> in satisfy()
65 F: Fn(char) -> bool, in satisfy()
80 /// # Example
89 pub fn one_of<I, T, Error: ParseError<I>>(list: T) -> impl Fn(I) -> IResult<I, char, Error> in one_of()
104 /// # Example
113 pub fn none_of<I, T, Error: ParseError<I>>(list: T) -> impl Fn(I) -> IResult<I, char, Error> in none_of()
128 /// # Example
133 /// fn parser(input: &str) -> IResult<&str, &str> {
141 pub fn crlf<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in crlf()
161 /// # Example
166 /// fn parser(input: &str) -> IResult<&str, &str> {
177 pub fn not_line_ending<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in not_line_ending()
214 /// # Example
219 /// fn parser(input: &str) -> IResult<&str, &str> {
227 pub fn line_ending<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in line_ending()
249 /// # Example
254 /// fn parser(input: &str) -> IResult<&str, char> {
262 pub fn newline<I, Error: ParseError<I>>(input: I) -> IResult<I, char, Error> in newline()
273 /// # Example
278 /// fn parser(input: &str) -> IResult<&str, char> {
286 pub fn tab<I, Error: ParseError<I>>(input: I) -> IResult<I, char, Error> in tab()
298 /// # Example
302 /// fn parser(input: &str) -> IResult<&str, char> {
309 pub fn anychar<T, E: ParseError<T>>(input: T) -> IResult<T, char, E> in anychar()
324 /// Recognizes zero or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z
328 /// # Example
333 /// fn parser(input: &str) -> IResult<&str, &str> {
341 pub fn alpha0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in alpha0()
349 /// Recognizes one or more lowercase and uppercase ASCII alphabetic characters: a-z, A-Z
353 /// # Example
358 /// fn parser(input: &str) -> IResult<&str, &str> {
366 pub fn alpha1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in alpha1()
374 /// Recognizes zero or more ASCII numerical characters: 0-9
378 /// # Example
383 /// fn parser(input: &str) -> IResult<&str, &str> {
392 pub fn digit0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in digit0()
400 /// Recognizes one or more ASCII numerical characters: 0-9
404 /// # Example
409 /// fn parser(input: &str) -> IResult<&str, &str> {
425 /// fn parser(input: &str) -> IResult<&str, u32> {
434 /// [`map_res`]: crate::combinator::map_res
435 pub fn digit1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in digit1()
443 /// Recognizes zero or more ASCII hexadecimal numerical characters: 0-9, A-F, a-f
446 /// # Example
451 /// fn parser(input: &str) -> IResult<&str, &str> {
459 pub fn hex_digit0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in hex_digit0()
466 /// Recognizes one or more ASCII hexadecimal numerical characters: 0-9, A-F, a-f
470 /// # Example
475 /// fn parser(input: &str) -> IResult<&str, &str> {
483 pub fn hex_digit1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in hex_digit1()
491 /// Recognizes zero or more octal characters: 0-7
495 /// # Example
500 /// fn parser(input: &str) -> IResult<&str, &str> {
508 pub fn oct_digit0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in oct_digit0()
516 /// Recognizes one or more octal characters: 0-7
520 /// # Example
525 /// fn parser(input: &str) -> IResult<&str, &str> {
533 pub fn oct_digit1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in oct_digit1()
541 /// Recognizes zero or more ASCII numerical and alphabetic characters: 0-9, a-z, A-Z
545 /// # Example
550 /// fn parser(input: &str) -> IResult<&str, &str> {
558 pub fn alphanumeric0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in alphanumeric0()
566 /// Recognizes one or more ASCII numerical and alphabetic characters: 0-9, a-z, A-Z
570 /// # Example
575 /// fn parser(input: &str) -> IResult<&str, &str> {
583 pub fn alphanumeric1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in alphanumeric1()
595 /// # Example
600 /// fn parser(input: &str) -> IResult<&str, &str> {
608 pub fn space0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in space0()
623 /// # Example
628 /// fn parser(input: &str) -> IResult<&str, &str> {
636 pub fn space1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in space1()
654 /// # Example
659 /// fn parser(input: &str) -> IResult<&str, &str> {
667 pub fn multispace0<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in multispace0()
682 /// # Example
687 /// fn parser(input: &str) -> IResult<&str, &str> {
695 pub fn multispace1<T, E: ParseError<T>>(input: T) -> IResult<T, T, E> in multispace1()
709 pub(crate) fn sign<T, E: ParseError<T>>(input: T) -> IResult<T, bool, E> in sign()
714 use crate::bytes::complete::tag; in sign()
715 use crate::combinator::value; in sign()
718 value(false, tag(&b"-"[..])), in sign()
733 pub fn $t<T, E: ParseError<T>>(input: T) -> IResult<T, $t, E>
795 pub fn $t<T, E: ParseError<T>>(input: T) -> IResult<T, $t, E>
834 use crate::internal::Err;
835 use crate::traits::ParseTo;
840 let res: $crate::IResult<_, _, (_, ErrorKind)> = $left;
922 use crate::traits::Offset;
1032 assert_parse!(hex_digit1(i), Ok((&b";"[..], &i[..i.len() - 1]))); in hex_digit_test()
1046 assert!(crate::character::is_hex_digit(b'0')); in hex_digit_test()
1047 assert!(crate::character::is_hex_digit(b'9')); in hex_digit_test()
1048 assert!(crate::character::is_hex_digit(b'a')); in hex_digit_test()
1049 assert!(crate::character::is_hex_digit(b'f')); in hex_digit_test()
1050 assert!(crate::character::is_hex_digit(b'A')); in hex_digit_test()
1051 assert!(crate::character::is_hex_digit(b'F')); in hex_digit_test()
1052 assert!(!crate::character::is_hex_digit(b'g')); in hex_digit_test()
1053 assert!(!crate::character::is_hex_digit(b'G')); in hex_digit_test()
1054 assert!(!crate::character::is_hex_digit(b'/')); in hex_digit_test()
1055 assert!(!crate::character::is_hex_digit(b':')); in hex_digit_test()
1056 assert!(!crate::character::is_hex_digit(b'@')); in hex_digit_test()
1057 assert!(!crate::character::is_hex_digit(b'\x60')); in hex_digit_test()
1063 assert_parse!(oct_digit1(i), Ok((&b";"[..], &i[..i.len() - 1]))); in oct_digit_test()
1071 assert!(crate::character::is_oct_digit(b'0')); in oct_digit_test()
1072 assert!(crate::character::is_oct_digit(b'7')); in oct_digit_test()
1073 assert!(!crate::character::is_oct_digit(b'8')); in oct_digit_test()
1074 assert!(!crate::character::is_oct_digit(b'9')); in oct_digit_test()
1075 assert!(!crate::character::is_oct_digit(b'a')); in oct_digit_test()
1076 assert!(!crate::character::is_oct_digit(b'A')); in oct_digit_test()
1077 assert!(!crate::character::is_oct_digit(b'/')); in oct_digit_test()
1078 assert!(!crate::character::is_oct_digit(b':')); in oct_digit_test()
1079 assert!(!crate::character::is_oct_digit(b'@')); in oct_digit_test()
1080 assert!(!crate::character::is_oct_digit(b'\x60')); in oct_digit_test()
1085 use crate::sequence::pair; in full_line_windows()
1086 fn take_full_line(i: &[u8]) -> IResult<&[u8], (&[u8], &[u8])> { in full_line_windows()
1096 use crate::sequence::pair; in full_line_unix()
1097 fn take_full_line(i: &[u8]) -> IResult<&[u8], (&[u8], &[u8])> { in full_line_unix()
1167 fn digit_to_i16(input: &str) -> IResult<&str, i16> { in digit_to_i16()
1169 let (i, opt_sign) = opt(alt((char('+'), char('-'))))(i)?; in digit_to_i16()
1172 Some('-') => false, in digit_to_i16()
1176 let (i, s) = match digit1::<_, crate::error::Error<_>>(i) { in digit_to_i16()
1179 return Err(Err::Error(crate::error::Error::from_error_kind( in digit_to_i16()
1191 Ok((i, -n)) in digit_to_i16()
1194 None => Err(Err::Error(crate::error::Error::from_error_kind( in digit_to_i16()
1201 fn digit_to_u32(i: &str) -> IResult<&str, u32> { in digit_to_u32()
1205 None => Err(Err::Error(crate::error::Error::from_error_kind( in digit_to_u32()