diff options
| author | Marijn Haverbeke <marijnh@gmail.com> | 2011-12-19 10:21:31 +0100 |
|---|---|---|
| committer | Marijn Haverbeke <marijnh@gmail.com> | 2011-12-19 10:43:23 +0100 |
| commit | 60acae4df725f2e275e01d7b59cc7ecacefb5f2c (patch) | |
| tree | 3bc5fef7ff7a8fd22ae3d94e18c7c662af789121 /src/comp/syntax/parse/parser.rs | |
| parent | 4d524b957ffbaadfee0491e740c78187c240cad0 (diff) | |
| download | rust-60acae4df725f2e275e01d7b59cc7ecacefb5f2c.tar.gz rust-60acae4df725f2e275e01d7b59cc7ecacefb5f2c.zip | |
Add type argument field to expr_path
This way, you can explicitly provide type parameters when calling a generic method. Issue #1227
Diffstat (limited to 'src/comp/syntax/parse/parser.rs')
| -rw-r--r-- | src/comp/syntax/parse/parser.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs index 752a433e953..f1db62e24e2 100644 --- a/src/comp/syntax/parse/parser.rs +++ b/src/comp/syntax/parse/parser.rs @@ -1025,7 +1025,12 @@ fn parse_dot_or_call_expr_with(p: parser, e: @ast::expr) -> @ast::expr { token::IDENT(i, _) { hi = p.get_hi_pos(); p.bump(); - e = mk_expr(p, lo, hi, ast::expr_field(e, p.get_str(i))); + let tys = if eat(p, token::MOD_SEP) { + expect(p, token::LT); + parse_seq_to_gt(some(token::COMMA), + {|p| parse_ty(p, false)}, p) + } else { [] }; + e = mk_expr(p, lo, hi, ast::expr_field(e, p.get_str(i), tys)); } t { unexpected(p, t); } } |
