summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-19 08:37:12 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-19 08:37:12 +0000
commit5399951b008c51d6077d09de53831f1ef2aabf4d (patch)
treed747c113e9bc9ca5195c1a4d2da23fc97cf62088 /parse.y
parentd34bc779a7f8fc9d8820a8cdeb4a3b5e75958be2 (diff)
parse.y: ignore do indentations
* parse.y (k_rescue, k_ensure): ignore indentations of `do`, it is not at the beginning of line usually. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62838 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y6
1 files changed, 4 insertions, 2 deletions
diff --git a/parse.y b/parse.y
index 6acfb6a5a3..f674e30d61 100644
--- a/parse.y
+++ b/parse.y
@@ -2721,13 +2721,15 @@ k_def : keyword_def
k_rescue : keyword_rescue
{
- token_info_warn(p, "rescue", p->token_info, &@$);
+ if (p->token_info && strcmp(p->token_info->token, "begin") == 0)
+ token_info_warn(p, "rescue", p->token_info, &@$);
}
;
k_ensure : keyword_ensure
{
- token_info_warn(p, "ensure", p->token_info, &@$);
+ if (p->token_info && strcmp(p->token_info->token, "begin") == 0)
+ token_info_warn(p, "ensure", p->token_info, &@$);
}
;