compiler: Better error for missing comma in composite literal.

From-SVN: r191796
This commit is contained in:
Ian Lance Taylor 2012-09-27 05:41:46 +00:00
parent 9c25bd1a06
commit 7c28a6b710
1 changed files with 5 additions and 1 deletions

View File

@ -2723,7 +2723,11 @@ Parse::composite_lit(Type* type, int depth, Location location)
}
else
{
error_at(this->location(), "expected %<,%> or %<}%>");
if (token->is_op(OPERATOR_SEMICOLON))
error_at(this->location(),
"need trailing comma before newline in composite literal");
else
error_at(this->location(), "expected %<,%> or %<}%>");
this->gogo_->mark_locals_used();
int depth = 0;