Rename many -> repeat

This commit is contained in:
Aleksey Kladov 2018-01-15 21:44:30 +03:00
parent 08f7c69f90
commit 91fb7e2088
4 changed files with 6 additions and 6 deletions

View file

@ -5,11 +5,11 @@ enum AttrKind {
}
pub(super) fn inner_attributes(p: &mut Parser) {
many(p, |p| attribute(p, AttrKind::Inner))
repeat(p, |p| attribute(p, AttrKind::Inner))
}
pub(super) fn outer_attributes(p: &mut Parser) {
many(p, |p| attribute(p, AttrKind::Outer))
repeat(p, |p| attribute(p, AttrKind::Outer))
}

View file

@ -2,7 +2,7 @@ use super::*;
pub(super) fn mod_contents(p: &mut Parser) {
attributes::inner_attributes(p);
many(p, |p| {
repeat(p, |p| {
skip_to_first(
p, item_first, mod_contents_item,
"expected item",

View file

@ -59,7 +59,7 @@ fn node<F: FnOnce(&mut Parser)>(p: &mut Parser, node_kind: SyntaxKind, rest: F)
p.finish();
}
fn many<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) {
fn repeat<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) {
loop {
let pos = p.pos();
if !f(p) {
@ -72,7 +72,7 @@ fn many<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) {
}
fn comma_list<F: Fn(&mut Parser) -> bool>(p: &mut Parser, end: SyntaxKind, f: F) {
many(p, |p| {
repeat(p, |p| {
if p.current() == end {
return false
}

View file

@ -12,7 +12,7 @@ pub(crate) fn use_path(p: &mut Parser) {
node(p, PATH, |p| {
path_segment(p, true);
});
many(p, |p| {
repeat(p, |p| {
let curr = p.mark();
if p.current() == COLONCOLON && !items::is_use_tree_start(p.raw_lookahead(1)) {
node(p, PATH, |p| {