Commit a80f7a71 by Ian Lance Taylor

compiler: Better error for missing comma in composite literal.

From-SVN: r191795
parent e75d8ec9
...@@ -2723,6 +2723,10 @@ Parse::composite_lit(Type* type, int depth, Location location) ...@@ -2723,6 +2723,10 @@ Parse::composite_lit(Type* type, int depth, Location location)
} }
else else
{ {
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 %<}%>"); error_at(this->location(), "expected %<,%> or %<}%>");
this->gogo_->mark_locals_used(); this->gogo_->mark_locals_used();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment