diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib.rs | 22 |
1 files changed, 5 insertions, 17 deletions
@@ -995,15 +995,12 @@ where Eof } -pub fn alpha<I>() -> impl Parser<I, Output = I> +pub fn alpha<I>() -> impl Parser<I, Output = I::Item> where I: Input, I::Item: Character, { r#if(|c: &I::Item| c.is_alphabetic()) - .repeated() - .many() - .recognize() } pub fn alpha1<I>() -> impl Parser<I, Output = I> @@ -1017,15 +1014,12 @@ where .recognize() } -pub fn numeric<I>() -> impl Parser<I, Output = I> +pub fn numeric<I>() -> impl Parser<I, Output = I::Item> where I: Input, I::Item: Character, { r#if(|c: &I::Item| c.is_numeric()) - .repeated() - .many() - .recognize() } pub fn numeric1<I>() -> impl Parser<I, Output = I> @@ -1039,15 +1033,12 @@ where .recognize() } -pub fn alphanumeric<I>() -> impl Parser<I, Output = I> +pub fn alphanumeric<I>() -> impl Parser<I, Output = I::Item> where I: Input, I::Item: Character, { r#if(|c: &I::Item| c.is_alphanumeric()) - .repeated() - .many() - .recognize() } pub fn alphanumeric1<I>() -> impl Parser<I, Output = I> @@ -1061,15 +1052,12 @@ where .recognize() } -pub fn whitespace<I>() -> impl Parser<I, Output = I> +pub fn whitespace<I>() -> impl Parser<I, Output = I::Item> where I: Input, I::Item: Character, { r#if(|c: &I::Item| c.is_whitespace()) - .repeated() - .many() - .recognize() } pub fn whitespace1<I>() -> impl Parser<I, Output = I> @@ -1129,7 +1117,7 @@ mod test { let input = "a b c"; let it = InputIter::new(input); - alpha1() + alpha() .separated_by(whitespace()) .at_least(1) .check_finished(it) |
