aboutsummaryrefslogtreecommitdiff
path: root/src/parser/grammar
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-07-31 12:00:22 +0100
committerAleksey Kladov <[email protected]>2018-07-31 12:00:22 +0100
commit9dcb79a60225cd127f1bd9f8653ff5da525d9af0 (patch)
tree59be907d879e99a7d74054ca093d6d1b3798efe9 /src/parser/grammar
parent407ebbc552fd9a8e73a9e46873ab834c54cea967 (diff)
Bare & default impls
Diffstat (limited to 'src/parser/grammar')
-rw-r--r--src/parser/grammar/items/mod.rs12
-rw-r--r--src/parser/grammar/items/traits.rs3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/parser/grammar/items/mod.rs b/src/parser/grammar/items/mod.rs
index c88e39596..73fd5235a 100644
--- a/src/parser/grammar/items/mod.rs
+++ b/src/parser/grammar/items/mod.rs
@@ -149,6 +149,18 @@ fn item(p: &mut Parser) {
149 } 149 }
150 } 150 }
151 } 151 }
152 IMPL_KW => {
153 traits::impl_item(p);
154 IMPL_ITEM
155 }
156 // test default_impl
157 // default impl Foo {}
158 IDENT if p.at_contextual_kw("default") && la == IMPL_KW => {
159 p.bump_remap(DEFAULT_KW);
160 traits::impl_item(p);
161 IMPL_ITEM
162 }
163
152 FN_KW => { 164 FN_KW => {
153 fn_item(p); 165 fn_item(p);
154 FN_ITEM 166 FN_ITEM
diff --git a/src/parser/grammar/items/traits.rs b/src/parser/grammar/items/traits.rs
index 9961a88fe..7fd011ffd 100644
--- a/src/parser/grammar/items/traits.rs
+++ b/src/parser/grammar/items/traits.rs
@@ -8,6 +8,9 @@ pub(super) fn trait_item(p: &mut Parser) {
8 p.expect(R_CURLY); 8 p.expect(R_CURLY);
9} 9}
10 10
11
12// test impl_item
13// impl Foo {}
11pub(super) fn impl_item(p: &mut Parser) { 14pub(super) fn impl_item(p: &mut Parser) {
12 assert!(p.at(IMPL_KW)); 15 assert!(p.at(IMPL_KW));
13 p.bump(); 16 p.bump();