Skip to content

Commit c72a30a

Browse files
bors[bot]matklad
andauthored
Merge #10268
10268: intenral: simplify parser r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
2 parents 4badd2f + 4d2956e commit c72a30a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

crates/parser/src/grammar.rs

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -166,22 +166,16 @@ fn opt_visibility(p: &mut Parser) -> bool {
166166
// struct B(pub (super::A));
167167
// struct B(pub (crate::A,));
168168
T![crate] | T![self] | T![super] | T![ident] if p.nth(2) != T![:] => {
169-
p.bump_any();
170-
let path_m = p.start();
171-
let path_segment_m = p.start();
172-
let name_ref_m = p.start();
173-
p.bump_any();
174-
name_ref_m.complete(p, NAME_REF);
175-
path_segment_m.complete(p, PATH_SEGMENT);
176-
path_m.complete(p, PATH);
169+
p.bump(T!['(']);
170+
paths::use_path(p);
177171
p.expect(T![')']);
178172
}
179173
// test crate_visibility_in
180174
// pub(in super::A) struct S;
181175
// pub(in crate) struct S;
182176
T![in] => {
183-
p.bump_any();
184-
p.bump_any();
177+
p.bump(T!['(']);
178+
p.bump(T![in]);
185179
paths::use_path(p);
186180
p.expect(T![')']);
187181
}

0 commit comments

Comments
 (0)