mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
Rename many
-> repeat
This commit is contained in:
parent
08f7c69f90
commit
91fb7e2088
4 changed files with 6 additions and 6 deletions
|
@ -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))
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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| {
|
||||
|
|
Loading…
Reference in a new issue