aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/grammar/items/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser/event_parser/grammar/items/mod.rs')
-rw-r--r--src/parser/event_parser/grammar/items/mod.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/parser/event_parser/grammar/items/mod.rs b/src/parser/event_parser/grammar/items/mod.rs
index 6d6fabbd7..3612802e1 100644
--- a/src/parser/event_parser/grammar/items/mod.rs
+++ b/src/parser/event_parser/grammar/items/mod.rs
@@ -3,6 +3,7 @@ use super::*;
3mod structs; 3mod structs;
4mod use_item; 4mod use_item;
5mod consts; 5mod consts;
6mod traits;
6 7
7pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) { 8pub(super) fn mod_contents(p: &mut Parser, stop_on_r_curly: bool) {
8 attributes::inner_attributes(p); 9 attributes::inner_attributes(p);
@@ -80,6 +81,22 @@ fn item(p: &mut Parser) {
80 CONST_ITEM 81 CONST_ITEM
81 } 82 }
82 }, 83 },
84 // TODO: auto trait
85 // test unsafe_trait
86 // unsafe trait T {}
87 UNSAFE_KW if la == TRAIT_KW => {
88 p.bump();
89 traits::trait_item(p);
90 TRAIT_ITEM
91 }
92 // TODO: default impl
93 // test unsafe_impl
94 // unsafe impl Foo {}
95 UNSAFE_KW if la == IMPL_KW => {
96 p.bump();
97 traits::impl_item(p);
98 IMPL_ITEM
99 }
83 MOD_KW => { 100 MOD_KW => {
84 mod_item(p); 101 mod_item(p);
85 MOD_ITEM 102 MOD_ITEM
@@ -131,6 +148,7 @@ fn extern_block(p: &mut Parser) {
131 p.bump(); 148 p.bump();
132 p.expect(R_CURLY); 149 p.expect(R_CURLY);
133} 150}
151
134fn mod_item(p: &mut Parser) { 152fn mod_item(p: &mut Parser) {
135 assert!(p.at(MOD_KW)); 153 assert!(p.at(MOD_KW));
136 p.bump(); 154 p.bump();