diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-15 17:12:26 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2014-12-15 17:12:26 +0000 |
commit | cb3eb3dce752b4a3f2cbd457ae10c6b67cd5085e (patch) | |
tree | afc306a883caba91e4cf3488cfc3b07bff108cef | |
parent | 6bfb1253a46494591e0e5073dd08ed30d184e867 (diff) | |
download | gcc-cb3eb3dce752b4a3f2cbd457ae10c6b67cd5085e.zip gcc-cb3eb3dce752b4a3f2cbd457ae10c6b67cd5085e.tar.gz gcc-cb3eb3dce752b4a3f2cbd457ae10c6b67cd5085e.tar.bz2 |
re PR go/61253 (gccgo: spurious "error: expected '<-' or '='" [GoSmith])
PR go/61253
compiler: Support RecvStmt = ExpressionList "=" RecvExpr.
From-SVN: r218753
-rw-r--r-- | gcc/go/gofrontend/parse.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/go/gofrontend/parse.cc b/gcc/go/gofrontend/parse.cc index 8e3aa3b..3b5ede5 100644 --- a/gcc/go/gofrontend/parse.cc +++ b/gcc/go/gofrontend/parse.cc @@ -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)) |