Add type argument field to expr_path

This way, you can explicitly provide type parameters when calling a
generic method.

Issue #1227
This commit is contained in:
Marijn Haverbeke
2011-12-19 10:21:31 +01:00
parent 4d524b957f
commit 60acae4df7
13 changed files with 60 additions and 16 deletions

View File

@@ -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); }
}