mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 21:28:51 +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) {
|
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) {
|
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) {
|
pub(super) fn mod_contents(p: &mut Parser) {
|
||||||
attributes::inner_attributes(p);
|
attributes::inner_attributes(p);
|
||||||
many(p, |p| {
|
repeat(p, |p| {
|
||||||
skip_to_first(
|
skip_to_first(
|
||||||
p, item_first, mod_contents_item,
|
p, item_first, mod_contents_item,
|
||||||
"expected item",
|
"expected item",
|
||||||
|
|
|
@ -59,7 +59,7 @@ fn node<F: FnOnce(&mut Parser)>(p: &mut Parser, node_kind: SyntaxKind, rest: F)
|
||||||
p.finish();
|
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 {
|
loop {
|
||||||
let pos = p.pos();
|
let pos = p.pos();
|
||||||
if !f(p) {
|
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) {
|
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 {
|
if p.current() == end {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub(crate) fn use_path(p: &mut Parser) {
|
||||||
node(p, PATH, |p| {
|
node(p, PATH, |p| {
|
||||||
path_segment(p, true);
|
path_segment(p, true);
|
||||||
});
|
});
|
||||||
many(p, |p| {
|
repeat(p, |p| {
|
||||||
let curr = p.mark();
|
let curr = p.mark();
|
||||||
if p.current() == COLONCOLON && !items::is_use_tree_start(p.raw_lookahead(1)) {
|
if p.current() == COLONCOLON && !items::is_use_tree_start(p.raw_lookahead(1)) {
|
||||||
node(p, PATH, |p| {
|
node(p, PATH, |p| {
|
||||||
|
|
Loading…
Reference in a new issue