summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-15 08:53:15 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-15 08:53:15 +0000
commitbae638ad5b782c44c80efe33834cb9039279af46 (patch)
tree24b40413daece9611aa532bfd04662645a80f783 /parse.y
parent4fb5888a4dbc10b6f6d3f847f680baae60b9f757 (diff)
downloadruby-bae638ad5b782c44c80efe33834cb9039279af46.tar.gz
parse.y: Deprecate flip-flops
Ref #5400 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63667 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 b1ddc1bf1c..51f7d3f2f0 100644
--- a/parse.y
+++ b/parse.y
@@ -9809,8 +9809,10 @@ cond0(struct parser_params *p, NODE *node, int method_op, const YYLTYPE *loc)
case NODE_DOT3:
node->nd_beg = range_op(p, node->nd_beg, loc);
node->nd_end = range_op(p, node->nd_end, loc);
- if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
- else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
+ if (nd_type(node) == NODE_DOT2 || nd_type(node) == NODE_DOT3) {
+ nd_set_type(node, nd_type(node) == NODE_DOT2 ? NODE_FLIP2 : NODE_FLIP3);
+ parser_warn(p, node, "flip-flop is deprecated");
+ }
if (!method_op && !e_option_supplied(p)) {
int b = literal_node(node->nd_beg);
int e = literal_node(node->nd_end);