]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
PR go/61253
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Dec 2014 17:12:26 +0000 (17:12 +0000)
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 15 Dec 2014 17:12:26 +0000 (17:12 +0000)
compiler: Support RecvStmt = ExpressionList "=" RecvExpr.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@218753 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/go/gofrontend/parse.cc

index 8e3aa3ba0fb6a59e28197346889d422a49e7bc93..3b5ede542a5dd97bd91e0593bfd8d42921603c6a 100644 (file)
@@ -5031,6 +5031,16 @@ Parse::send_or_recv_stmt(bool* is_send, Expression** channel, Expression** val,
       e = Expression::make_receive(*channel, (*channel)->location());
     }
 
+  if (!saw_comma && this->peek_token()->is_op(OPERATOR_COMMA))
+    {
+      this->advance_token();
+      // case v, e = <-c:
+      if (!e->is_sink_expression())
+       *val = e;
+      e = this->expression(PRECEDENCE_NORMAL, true, true, NULL, NULL);
+      saw_comma = true;
+    }
+
   if (this->peek_token()->is_op(OPERATOR_EQ))
     {
       if (!this->advance_token()->is_op(OPERATOR_CHANOP))