@@ -4011,36 +4011,8 @@
token = this->advance_token();
- if (p_range_clause != NULL && token->is_keyword(KEYWORD_RANGE))
- {
- if (op != OPERATOR_EQ)
- error_at(this->location(), "range clause requires %<=%>");
- this->range_clause_expr(lhs, p_range_clause);
- return;
- }
-
- Expression_list* vals = this->expression_list(NULL, false,
- may_be_composite_lit);
-
- // We've parsed everything; check for errors.
- if (lhs == NULL || vals == NULL)
+ if (lhs == NULL)
return;
- for (Expression_list::const_iterator pe = lhs->begin();
- pe != lhs->end();
- ++pe)
- {
- if ((*pe)->is_error_expression())
- return;
- if (op != OPERATOR_EQ && (*pe)->is_sink_expression())
- error_at((*pe)->location(), "cannot use _ as value");
- }
- for (Expression_list::const_iterator pe = vals->begin();
- pe != vals->end();
- ++pe)
- {
- if ((*pe)->is_error_expression())
- return;
- }
// Map expressions act differently when they are lvalues.
for (Expression_list::iterator plv = lhs->begin();
@@ -4049,6 +4021,37 @@
if ((*plv)->index_expression() != NULL)
(*plv)->index_expression()->set_is_lvalue();
+ if (p_range_clause != NULL && token->is_keyword(KEYWORD_RANGE))
+ {
+ if (op != OPERATOR_EQ)
+ error_at(this->location(), "range clause requires %<=%>");
+ this->range_clause_expr(lhs, p_range_clause);
+ return;
+ }
+
+ Expression_list* vals = this->expression_list(NULL, false,
+ may_be_composite_lit);
+
+ // We've parsed everything; check for errors.
+ if (vals == NULL)
+ return;
+ for (Expression_list::const_iterator pe = lhs->begin();
+ pe != lhs->end();
+ ++pe)
+ {
+ if ((*pe)->is_error_expression())
+ return;
+ if (op != OPERATOR_EQ && (*pe)->is_sink_expression())
+ error_at((*pe)->location(), "cannot use _ as value");
+ }
+ for (Expression_list::const_iterator pe = vals->begin();
+ pe != vals->end();
+ ++pe)
+ {
+ if ((*pe)->is_error_expression())
+ return;
+ }
+
Call_expression* call;
Index_expression* map_index;
Receive_expression* receive;