aboutsummaryrefslogtreecommitdiff
path: root/src/parser
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-01-12 19:05:46 +0000
committerAleksey Kladov <[email protected]>2018-01-12 19:05:46 +0000
commitf31d85860771b0c4c8d232d79e4a3489a051ba9d (patch)
tree931adff1f926fa41943b726282f20822ade8ee36 /src/parser
parentc111a1f7b8b9da2b4691c792e1658b2888ff5420 (diff)
G: visibility
Diffstat (limited to 'src/parser')
-rw-r--r--src/parser/event_parser/grammar/items.rs2
-rw-r--r--src/parser/event_parser/grammar/mod.rs20
2 files changed, 20 insertions, 2 deletions
diff --git a/src/parser/event_parser/grammar/items.rs b/src/parser/event_parser/grammar/items.rs
index 725f04d1e..f7310c09a 100644
--- a/src/parser/event_parser/grammar/items.rs
+++ b/src/parser/event_parser/grammar/items.rs
@@ -12,7 +12,7 @@ pub(super) fn mod_contents(p: &mut Parser) {
12 12
13fn item_first(p: &Parser) -> bool { 13fn item_first(p: &Parser) -> bool {
14 match p.current() { 14 match p.current() {
15 STRUCT_KW | FN_KW | EXTERN_KW | MOD_KW | USE_KW | POUND => true, 15 STRUCT_KW | FN_KW | EXTERN_KW | MOD_KW | USE_KW | POUND | PUB_KW => true,
16 _ => false, 16 _ => false,
17 } 17 }
18} 18}
diff --git a/src/parser/event_parser/grammar/mod.rs b/src/parser/event_parser/grammar/mod.rs
index 3c4b223a9..1c57e0cb4 100644
--- a/src/parser/event_parser/grammar/mod.rs
+++ b/src/parser/event_parser/grammar/mod.rs
@@ -15,7 +15,25 @@ pub(crate) fn file(p: &mut Parser) {
15 }) 15 })
16} 16}
17 17
18fn visibility(_: &mut Parser) { 18fn visibility(p: &mut Parser) {
19 node_if(p, PUB_KW, VISIBILITY, |p| {
20 if p.current() != L_PAREN {
21 return
22 }
23 match p.raw_lookahead(1) {
24 CRATE_KW | SELF_KW | SUPER_KW => {
25 p.bump();
26 p.bump();
27 }
28 IN_KW => {
29 p.bump();
30 p.bump();
31 paths::use_path(p);
32 }
33 _ => return
34 }
35 p.expect(R_PAREN);
36 });
19} 37}
20 38
21fn alias(p: &mut Parser) -> bool { 39fn alias(p: &mut Parser) -> bool {