Parse swap.
This commit is contained in:
parent
e8d2d27a88
commit
066599104a
@ -245,11 +245,13 @@ tag expr_ {
|
||||
expr_alt(@expr, vec[arm], ann);
|
||||
expr_fn(_fn, ann);
|
||||
expr_block(block, ann);
|
||||
expr_move(@expr, /* TODO: @expr|is_lval */@expr, ann);
|
||||
expr_assign(@expr, /* TODO: @expr|is_lval */@expr, ann);
|
||||
expr_assign_op(binop, @expr, /* TODO: @expr|is_lval */@expr, ann);
|
||||
expr_send(@expr, /* TODO: @expr|is_lval */@expr, ann);
|
||||
expr_recv(@expr, /* TODO: @expr|is_lval */@expr, ann);
|
||||
expr_move(@expr /* TODO: @expr|is_lval */, @expr, ann);
|
||||
expr_assign(@expr /* TODO: @expr|is_lval */, @expr, ann);
|
||||
expr_swap(@expr /* TODO: @expr|is_lval */,
|
||||
@expr /* TODO: @expr|is_lval */, ann);
|
||||
expr_assign_op(binop, @expr /* TODO: @expr|is_lval */, @expr, ann);
|
||||
expr_send(@expr /* TODO: @expr|is_lval */, @expr, ann);
|
||||
expr_recv(@expr /* TODO: @expr|is_lval */, @expr, ann);
|
||||
expr_field(@expr, ident, ann);
|
||||
expr_index(@expr, @expr, ann);
|
||||
expr_path(path, ann);
|
||||
|
@ -1176,6 +1176,12 @@ fn parse_assign_expr(&parser p) -> @ast::expr {
|
||||
ret @spanned(lo, rhs.span.hi,
|
||||
ast::expr_recv(rhs, lhs, p.get_ann()));
|
||||
}
|
||||
case (token::DARROW) {
|
||||
p.bump();
|
||||
auto rhs = parse_expr(p);
|
||||
ret @spanned(lo, rhs.span.hi,
|
||||
ast::expr_swap(lhs, rhs, p.get_ann()));
|
||||
}
|
||||
case (_) {/* fall through */ }
|
||||
}
|
||||
ret lhs;
|
||||
@ -1536,7 +1542,9 @@ fn stmt_ends_with_semi(&ast::stmt stmt) -> bool {
|
||||
case (ast::expr_alt(_, _, _)) { ret false; }
|
||||
case (ast::expr_fn(_, _)) { ret false; }
|
||||
case (ast::expr_block(_, _)) { ret false; }
|
||||
case (ast::expr_move(_, _, _)) { ret true; }
|
||||
case (ast::expr_assign(_, _, _)) { ret true; }
|
||||
case (ast::expr_swap(_, _, _)) { ret true; }
|
||||
case (ast::expr_assign_op(_, _, _, _)) { ret true; }
|
||||
case (ast::expr_send(_, _, _)) { ret true; }
|
||||
case (ast::expr_recv(_, _, _)) { ret true; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user