@@ -899,10 +899,16 @@ fn parse_bottom_expr(&parser p) -> @ast::expr {
899
899
ex = ast:: expr_be ( e) ;
900
900
} else { p. fatal ( "Non-call expression in tail call" ) ; }
901
901
} else if ( eat_word ( p, "port" ) ) {
902
+ auto ty = none;
903
+ if ( token:: LBRACKET == p. peek ( ) ) {
904
+ expect ( p, token:: LBRACKET ) ;
905
+ ty = some ( parse_ty ( p) ) ;
906
+ expect ( p, token:: RBRACKET ) ;
907
+ }
902
908
expect ( p, token:: LPAREN ) ;
903
909
expect ( p, token:: RPAREN ) ;
904
910
hi = p. get_hi_pos ( ) ;
905
- ex = ast:: expr_port;
911
+ ex = ast:: expr_port ( ty ) ;
906
912
} else if ( eat_word ( p, "chan" ) ) {
907
913
expect ( p, token:: LPAREN ) ;
908
914
auto e = parse_expr ( p) ;
@@ -1592,7 +1598,7 @@ fn stmt_ends_with_semi(&ast::stmt stmt) -> bool {
1592
1598
case ( ast:: expr_log ( _, _) ) { true }
1593
1599
case ( ast:: expr_check ( _) ) { true }
1594
1600
case ( ast:: expr_if_check ( _, _, _) ) { false }
1595
- case ( ast:: expr_port) { true }
1601
+ case ( ast:: expr_port ( _ ) ) { true }
1596
1602
case ( ast:: expr_chan ( _) ) { true }
1597
1603
case ( ast:: expr_anon_obj ( _, _, _) ) { false }
1598
1604
case ( ast:: expr_assert ( _) ) { true }
0 commit comments