diff options
author | Aleksey Kladov <[email protected]> | 2018-01-15 18:44:30 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-01-15 18:44:30 +0000 |
commit | 91fb7e208863eb712654367c0793f010e118a918 (patch) | |
tree | 8744797aae9175f4b2954333e54b3dd4097919e2 /src/parser/event_parser | |
parent | 08f7c69f90bac772c69b3bf34877f3d9a845c541 (diff) |
Rename `many` -> `repeat`
Diffstat (limited to 'src/parser/event_parser')
-rw-r--r-- | src/parser/event_parser/grammar/attributes.rs | 4 | ||||
-rw-r--r-- | src/parser/event_parser/grammar/items.rs | 2 | ||||
-rw-r--r-- | src/parser/event_parser/grammar/mod.rs | 4 | ||||
-rw-r--r-- | src/parser/event_parser/grammar/paths.rs | 2 |
4 files changed, 6 insertions, 6 deletions
diff --git a/src/parser/event_parser/grammar/attributes.rs b/src/parser/event_parser/grammar/attributes.rs index d774f8827..a896b4901 100644 --- a/src/parser/event_parser/grammar/attributes.rs +++ b/src/parser/event_parser/grammar/attributes.rs | |||
@@ -5,11 +5,11 @@ enum AttrKind { | |||
5 | } | 5 | } |
6 | 6 | ||
7 | pub(super) fn inner_attributes(p: &mut Parser) { | 7 | pub(super) fn inner_attributes(p: &mut Parser) { |
8 | many(p, |p| attribute(p, AttrKind::Inner)) | 8 | repeat(p, |p| attribute(p, AttrKind::Inner)) |
9 | } | 9 | } |
10 | 10 | ||
11 | pub(super) fn outer_attributes(p: &mut Parser) { | 11 | pub(super) fn outer_attributes(p: &mut Parser) { |
12 | many(p, |p| attribute(p, AttrKind::Outer)) | 12 | repeat(p, |p| attribute(p, AttrKind::Outer)) |
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
diff --git a/src/parser/event_parser/grammar/items.rs b/src/parser/event_parser/grammar/items.rs index a14f6de77..d2bfeac97 100644 --- a/src/parser/event_parser/grammar/items.rs +++ b/src/parser/event_parser/grammar/items.rs | |||
@@ -2,7 +2,7 @@ use super::*; | |||
2 | 2 | ||
3 | pub(super) fn mod_contents(p: &mut Parser) { | 3 | pub(super) fn mod_contents(p: &mut Parser) { |
4 | attributes::inner_attributes(p); | 4 | attributes::inner_attributes(p); |
5 | many(p, |p| { | 5 | repeat(p, |p| { |
6 | skip_to_first( | 6 | skip_to_first( |
7 | p, item_first, mod_contents_item, | 7 | p, item_first, mod_contents_item, |
8 | "expected item", | 8 | "expected item", |
diff --git a/src/parser/event_parser/grammar/mod.rs b/src/parser/event_parser/grammar/mod.rs index 881bb3ef3..1097344c0 100644 --- a/src/parser/event_parser/grammar/mod.rs +++ b/src/parser/event_parser/grammar/mod.rs | |||
@@ -59,7 +59,7 @@ fn node<F: FnOnce(&mut Parser)>(p: &mut Parser, node_kind: SyntaxKind, rest: F) | |||
59 | p.finish(); | 59 | p.finish(); |
60 | } | 60 | } |
61 | 61 | ||
62 | fn many<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) { | 62 | fn repeat<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) { |
63 | loop { | 63 | loop { |
64 | let pos = p.pos(); | 64 | let pos = p.pos(); |
65 | if !f(p) { | 65 | if !f(p) { |
@@ -72,7 +72,7 @@ fn many<F: FnMut(&mut Parser) -> bool>(p: &mut Parser, mut f: F) { | |||
72 | } | 72 | } |
73 | 73 | ||
74 | fn comma_list<F: Fn(&mut Parser) -> bool>(p: &mut Parser, end: SyntaxKind, f: F) { | 74 | fn comma_list<F: Fn(&mut Parser) -> bool>(p: &mut Parser, end: SyntaxKind, f: F) { |
75 | many(p, |p| { | 75 | repeat(p, |p| { |
76 | if p.current() == end { | 76 | if p.current() == end { |
77 | return false | 77 | return false |
78 | } | 78 | } |
diff --git a/src/parser/event_parser/grammar/paths.rs b/src/parser/event_parser/grammar/paths.rs index 62d1a3bb2..45f3cb779 100644 --- a/src/parser/event_parser/grammar/paths.rs +++ b/src/parser/event_parser/grammar/paths.rs | |||
@@ -12,7 +12,7 @@ pub(crate) fn use_path(p: &mut Parser) { | |||
12 | node(p, PATH, |p| { | 12 | node(p, PATH, |p| { |
13 | path_segment(p, true); | 13 | path_segment(p, true); |
14 | }); | 14 | }); |
15 | many(p, |p| { | 15 | repeat(p, |p| { |
16 | let curr = p.mark(); | 16 | let curr = p.mark(); |
17 | if p.current() == COLONCOLON && !items::is_use_tree_start(p.raw_lookahead(1)) { | 17 | if p.current() == COLONCOLON && !items::is_use_tree_start(p.raw_lookahead(1)) { |
18 | node(p, PATH, |p| { | 18 | node(p, PATH, |p| { |