-5031f878a761bf83f5f96710d62f83e2dc5ecf04
+d9f33a479f8012f7495d197e4b7417cba4d477fa
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
{
Location fallthrough_loc = this->location();
is_fallthrough = true;
- if (this->advance_token()->is_op(OPERATOR_SEMICOLON))
- this->advance_token();
+ while (this->advance_token()->is_op(OPERATOR_SEMICOLON))
+ ;
if (this->peek_token()->is_op(OPERATOR_RCURLY))
go_error_at(fallthrough_loc,
_("cannot fallthrough final case in switch"));
+ else if (!this->peek_token()->is_keyword(KEYWORD_CASE)
+ && !this->peek_token()->is_keyword(KEYWORD_DEFAULT))
+ {
+ go_error_at(fallthrough_loc, "fallthrough statement out of place");
+ while (!this->peek_token()->is_keyword(KEYWORD_CASE)
+ && !this->peek_token()->is_keyword(KEYWORD_DEFAULT)
+ && !this->peek_token()->is_op(OPERATOR_RCURLY)
+ && !this->peek_token()->is_eof())
+ {
+ if (this->statement_may_start_here())
+ this->statement_list();
+ else
+ this->advance_token();
+ }
+ }
}
if (is_default)