diff options
author | Aleksey Kladov <[email protected]> | 2018-08-08 12:43:14 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-08 12:43:14 +0100 |
commit | bfb90dc4f1e9d86a24207b252c5f3405037928b1 (patch) | |
tree | 9a847ec2b56fcf1f303e28d87e063aa6c55033ed /src/grammar | |
parent | 678882d4f844135cc5df33de1f6da326ec96a78b (diff) |
Fn-style type params
Diffstat (limited to 'src/grammar')
-rw-r--r-- | src/grammar/paths.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/grammar/paths.rs b/src/grammar/paths.rs index fe69db096..6d406645f 100644 --- a/src/grammar/paths.rs +++ b/src/grammar/paths.rs | |||
@@ -71,7 +71,16 @@ fn path_segment(p: &mut Parser, mode: Mode, first: bool) { | |||
71 | fn path_generic_args(p: &mut Parser, mode: Mode) { | 71 | fn path_generic_args(p: &mut Parser, mode: Mode) { |
72 | match mode { | 72 | match mode { |
73 | Mode::Use => return, | 73 | Mode::Use => return, |
74 | Mode::Type => type_args::type_arg_list(p, false), | 74 | Mode::Type => { |
75 | // test path_fn_trait_args | ||
76 | // type F = Box<Fn(x: i32) -> ()>; | ||
77 | if p.at(L_PAREN) { | ||
78 | params::param_list(p); | ||
79 | fn_ret_type(p); | ||
80 | } else { | ||
81 | type_args::type_arg_list(p, false) | ||
82 | } | ||
83 | }, | ||
75 | Mode::Expr => type_args::type_arg_list(p, true), | 84 | Mode::Expr => type_args::type_arg_list(p, true), |
76 | } | 85 | } |
77 | } | 86 | } |