Change the syntax for RECV from "var <- port" to "port |> var".
This commit is contained in:
parent
2119e3b5b9
commit
a7a42c24be
33 changed files with 80 additions and 80 deletions
|
|
@ -1256,11 +1256,11 @@ fn parse_assign_expr(&parser p) -> @ast::expr {
|
|||
ret @spanned(lo, rhs.span.hi,
|
||||
ast::expr_send(lhs, rhs, p.get_ann()));
|
||||
}
|
||||
case (token::LARROW) {
|
||||
case (token::RECV) {
|
||||
p.bump();
|
||||
auto rhs = parse_expr(p);
|
||||
ret @spanned(lo, rhs.span.hi,
|
||||
ast::expr_recv(lhs, rhs, p.get_ann()));
|
||||
ast::expr_recv(rhs, lhs, p.get_ann()));
|
||||
}
|
||||
case (_) { /* fall through */ }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -617,10 +617,10 @@ fn print_expr(ps s, &@ast::expr expr) {
|
|||
print_expr(s, rhs);
|
||||
}
|
||||
case (ast::expr_recv(?lhs, ?rhs, _)) {
|
||||
print_expr(s, lhs);
|
||||
space(s.s);
|
||||
wrd1(s, "<-");
|
||||
print_expr(s, rhs);
|
||||
space(s.s);
|
||||
wrd1(s, "|>");
|
||||
print_expr(s, lhs);
|
||||
}
|
||||
case (ast::expr_field(?expr,?id,_)) {
|
||||
print_expr(s, expr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue