diff options
author | Aleksey Kladov <[email protected]> | 2018-08-07 22:53:03 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-07 22:53:03 +0100 |
commit | 64a65a4ff40e0c9b6d9453af79bba013afde2ffa (patch) | |
tree | 9b8b488b35fae3f5497f86d67c18ed5fd63d5c7f /src/grammar/items/mod.rs | |
parent | 2fb854ccdae6f1f12b60441e5c3b283bdc81fb0a (diff) |
trait items
Diffstat (limited to 'src/grammar/items/mod.rs')
-rw-r--r-- | src/grammar/items/mod.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/grammar/items/mod.rs b/src/grammar/items/mod.rs index 83f1833b5..824f1296c 100644 --- a/src/grammar/items/mod.rs +++ b/src/grammar/items/mod.rs | |||
@@ -240,7 +240,11 @@ fn fn_item(p: &mut Parser) { | |||
240 | // fn foo<T>() where T: Copy {} | 240 | // fn foo<T>() where T: Copy {} |
241 | type_params::where_clause(p); | 241 | type_params::where_clause(p); |
242 | 242 | ||
243 | expressions::block(p); | 243 | // test fn_decl |
244 | // trait T { fn foo(); } | ||
245 | if !p.eat(SEMI) { | ||
246 | expressions::block(p); | ||
247 | } | ||
244 | } | 248 | } |
245 | 249 | ||
246 | // test type_item | 250 | // test type_item |
@@ -255,12 +259,17 @@ fn type_item(p: &mut Parser) { | |||
255 | // type Result<T> = (); | 259 | // type Result<T> = (); |
256 | type_params::type_param_list(p); | 260 | type_params::type_param_list(p); |
257 | 261 | ||
262 | if p.at(COLON) { | ||
263 | type_params::bounds(p); | ||
264 | } | ||
265 | |||
258 | // test type_item_where_clause | 266 | // test type_item_where_clause |
259 | // type Foo where Foo: Copy = (); | 267 | // type Foo where Foo: Copy = (); |
260 | type_params::where_clause(p); | 268 | type_params::where_clause(p); |
261 | 269 | ||
262 | p.expect(EQ); | 270 | if p.eat(EQ) { |
263 | types::type_(p); | 271 | types::type_(p); |
272 | } | ||
264 | p.expect(SEMI); | 273 | p.expect(SEMI); |
265 | } | 274 | } |
266 | 275 | ||