You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/choosing_a_combinator.md
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -50,6 +50,7 @@ Those are used to recognize the lowest level elements of your grammar, like, "he
50
50
|[many_m_n](https://docs.rs/nom/latest/nom/multi/fn.many_m_n.html)|`many_m_n(1, 3, tag("ab"))`|`"ababc"`|`Ok(("c", vec!["ab", "ab"]))`|Applies the parser between m and n times (n included) and returns the list of results in a Vec|
51
51
|[many_till](https://docs.rs/nom/latest/nom/multi/fn.many_till.html)|`many_till(tag( "ab" ), tag( "ef" ))`|`"ababefg"`|`Ok(("g", (vec!["ab", "ab"], "ef")))`|Applies the first parser until the second applies. Returns a tuple containing the list of results from the first in a Vec and the result of the second|
52
52
|[separated_list0](https://docs.rs/nom/latest/nom/multi/fn.separated_list0.html)|`separated_list0(tag(","), tag("ab"))`|`"ab,ab,ab."`|`Ok((".", vec!["ab", "ab", "ab"]))`|`separated_list1` works like `separated_list0` but must returns at least one element|
53
+
|[separated_list_m_n](https://docs.rs/nom/latest/nom/multi/fn.separated_list0.html)|`separated_list_m_n(2, 3, tag(","), tag("ab"))`|`"ab,ab,ab."`|`Ok((".", vec!["ab", "ab", "ab"]))`| Alternately applies the item parser and the separator parser and returns the list of items in a Vec if the number is between m and n (inclusive).|
53
54
|[fold_many0](https://docs.rs/nom/latest/nom/multi/fn.fold_many0.html)|`fold_many0(be_u8, \|\| 0, \|acc, item\| acc + item)`|`[1, 2, 3]`|`Ok(([], 6))`|Applies the parser 0 or more times and folds the list of return values. The `fold_many1` version must apply the child parser at least one time|
54
55
|[fold_many_m_n](https://docs.rs/nom/latest/nom/multi/fn.fold_many_m_n.html)|`fold_many_m_n(1, 2, be_u8, \|\| 0, \|acc, item\| acc + item)`|`[1, 2, 3]`|`Ok(([3], 3))`|Applies the parser between m and n times (n included) and folds the list of return value|
55
56
|[length_count](https://docs.rs/nom/latest/nom/multi/fn.length_count.html)|`length_count(number, tag("ab"))`|`"2ababab"`|`Ok(("ab", vec!["ab", "ab"]))`|Gets a number from the first parser, then applies the second parser that many times|
0 commit comments