From 60acae4df725f2e275e01d7b59cc7ecacefb5f2c Mon Sep 17 00:00:00 2001 From: Marijn Haverbeke Date: Mon, 19 Dec 2011 10:21:31 +0100 Subject: Add type argument field to expr_path This way, you can explicitly provide type parameters when calling a generic method. Issue #1227 --- src/comp/syntax/parse/parser.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/comp/syntax/parse') 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); } } -- cgit 1.4.1-3-g733a5