Permalink
Browse files

parse.y: `else` indent

* parse.y (keyword_else): warn less-indented `else` than `case`.
  [ruby-core:86492] [Bug #14674]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
nobu committed Apr 16, 2018
1 parent cea438b commit 3b93a8bcad1048a46befe1dbaae38c0e74a11be0
Showing with 3 additions and 1 deletion.
  1. +3 −1 parse.y
@@ -2749,7 +2749,9 @@ k_when : keyword_when
k_else : keyword_else
{
token_info_warn(p, "else", p->token_info, 1, &@$);
token_info *ptinfo_beg = p->token_info;
int same = ptinfo_beg && strcmp(ptinfo_beg->token, "case") != 0;
token_info_warn(p, "else", p->token_info, same, &@$);
}
;

0 comments on commit 3b93a8b

Please sign in to comment.