Support for self-calls that take arguments.
Nicer parsing of self-calls (expr_self_method nodes inside expr_call nodes, rather than a separate expr_call_self) makes typechecking tractable. We can now write self-calls that take arguments and return values (see: test/run-pass/obj-self-*.rs).
This commit is contained in:
parent
39774e88b4
commit
1092bbfff0
9 changed files with 120 additions and 41 deletions
|
|
@ -454,12 +454,9 @@ impure fn print_expr(ps s, &@ast.expr expr) {
|
|||
commasep_exprs(s, args);
|
||||
pclose(s);
|
||||
}
|
||||
case (ast.expr_call_self(?ident,?args,_)) {
|
||||
case (ast.expr_self_method(?ident,_)) {
|
||||
wrd(s.s, "self.");
|
||||
print_ident(s, ident);
|
||||
popen(s);
|
||||
commasep_exprs(s, args);
|
||||
pclose(s);
|
||||
}
|
||||
case (ast.expr_bind(?func,?args,_)) {
|
||||
impure fn print_opt(ps s, &option.t[@ast.expr] expr) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue