Skip to content

Commit e966f1a

Browse files
brsongraydon
authored andcommitted
---
yaml --- r: 1862 b: refs/heads/master c: 9ca7acb h: refs/heads/master v: v3
1 parent 208a141 commit e966f1a

File tree

3 files changed

+36
-2
lines changed

3 files changed

+36
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: ebc4df3c7add208195e84940f69648be793b328f
2+
refs/heads/master: 9ca7acb1f3455f76a7991ce675a46aaa228aa497

trunk/src/comp/front/parser.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,6 +1621,8 @@ fn stmt_ends_with_semi(@ast.stmt stmt) -> bool {
16211621
case (ast.expr_assign(_,_,_)) { ret true; }
16221622
case (ast.expr_assign_op(_,_,_,_))
16231623
{ ret true; }
1624+
case (ast.expr_send(_,_,_)) { ret true; }
1625+
case (ast.expr_recv(_,_,_)) { ret true; }
16241626
case (ast.expr_field(_,_,_)) { ret true; }
16251627
case (ast.expr_index(_,_,_)) { ret true; }
16261628
case (ast.expr_path(_,_,_)) { ret true; }

trunk/src/comp/pretty/pprust.rs

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ impure fn print_type(ps s, &@ast.ty ty) {
7878
case (ast.ty_str) {wrd(s, "str");}
7979
case (ast.ty_box(?mt)) {wrd(s, "@"); print_mt(s, mt);}
8080
case (ast.ty_vec(?mt)) {wrd(s, "vec["); print_mt(s, mt); wrd(s, "]");}
81+
case (ast.ty_port(?t)) {wrd(s, "port["); print_type(s, t); wrd(s, "]");}
82+
case (ast.ty_chan(?t)) {wrd(s, "chan["); print_type(s, t); wrd(s, "]");}
8183
case (ast.ty_type) {wrd(s, "type");}
8284
case (ast.ty_tup(?elts)) {
8385
wrd(s, "tup");
@@ -481,6 +483,18 @@ impure fn print_expr(ps s, &@ast.expr expr) {
481483
wrd1(s, "=");
482484
print_expr(s, rhs);
483485
}
486+
case (ast.expr_send(?lhs, ?rhs, _)) {
487+
print_expr(s, lhs);
488+
space(s);
489+
wrd1(s, "<|");
490+
print_expr(s, rhs);
491+
}
492+
case (ast.expr_recv(?lhs, ?rhs, _)) {
493+
print_expr(s, lhs);
494+
space(s);
495+
wrd1(s, "<-");
496+
print_expr(s, rhs);
497+
}
484498
case (ast.expr_field(?expr,?id,_)) {
485499
print_expr(s, expr);
486500
wrd(s, ".");
@@ -541,6 +555,17 @@ impure fn print_expr(ps s, &@ast.expr expr) {
541555
}
542556
// TODO: extension 'body'
543557
}
558+
case (ast.expr_port(_)) {
559+
wrd(s, "port");
560+
popen(s);
561+
pclose(s);
562+
}
563+
case (ast.expr_chan(?expr, _)) {
564+
wrd(s, "chan");
565+
popen(s);
566+
print_expr(s, expr);
567+
pclose(s);
568+
}
544569
}
545570
end(s);
546571
}
@@ -563,7 +588,14 @@ impure fn print_decl(ps s, @ast.decl decl) {
563588
alt (loc.init) {
564589
case (option.some[ast.initializer](?init)) {
565590
space(s);
566-
wrd1(s, "=");
591+
alt (init.op) {
592+
case (ast.init_assign) {
593+
wrd1(s, "=");
594+
}
595+
case (ast.init_recv) {
596+
wrd1(s, "<-");
597+
}
598+
}
567599
print_expr(s, init.expr);
568600
}
569601
case (_) {}

0 commit comments

Comments
 (0)