Revert "parse.y: Deprecate flip-flops"
This reverts commit bae638ad5b782c44c80efe33834cb9039279af46. [Feature #5400]
This commit is contained in:
parent
d77b84ca82
commit
4e038a7e64
6
parse.y
6
parse.y
@ -10930,10 +10930,8 @@ cond0(struct parser_params *p, NODE *node, int method_op, const YYLTYPE *loc)
|
|||||||
case NODE_DOT3:
|
case NODE_DOT3:
|
||||||
node->nd_beg = range_op(p, node->nd_beg, loc);
|
node->nd_beg = range_op(p, node->nd_beg, loc);
|
||||||
node->nd_end = range_op(p, node->nd_end, loc);
|
node->nd_end = range_op(p, node->nd_end, loc);
|
||||||
if (nd_type(node) == NODE_DOT2 || nd_type(node) == NODE_DOT3) {
|
if (nd_type(node) == NODE_DOT2) nd_set_type(node,NODE_FLIP2);
|
||||||
nd_set_type(node, nd_type(node) == NODE_DOT2 ? NODE_FLIP2 : NODE_FLIP3);
|
else if (nd_type(node) == NODE_DOT3) nd_set_type(node, NODE_FLIP3);
|
||||||
parser_warn(p, node, "flip-flop is deprecated");
|
|
||||||
}
|
|
||||||
if (!method_op && !e_option_supplied(p)) {
|
if (!method_op && !e_option_supplied(p)) {
|
||||||
int b = literal_node(node->nd_beg);
|
int b = literal_node(node->nd_beg);
|
||||||
int e = literal_node(node->nd_end);
|
int e = literal_node(node->nd_end);
|
||||||
|
@ -308,18 +308,6 @@ describe "The if expression" do
|
|||||||
6.times(&b)
|
6.times(&b)
|
||||||
ScratchPad.recorded.should == [4, 5, 4, 5]
|
ScratchPad.recorded.should == [4, 5, 4, 5]
|
||||||
end
|
end
|
||||||
|
|
||||||
ruby_version_is "2.6" do
|
|
||||||
it 'is deprecated' do
|
|
||||||
i = 4
|
|
||||||
|
|
||||||
-> do
|
|
||||||
eval "ScratchPad << 'it works' if (i == 4)..(i == 7)"
|
|
||||||
end.should complain(/flip-flop is deprecated/)
|
|
||||||
|
|
||||||
ScratchPad.recorded.should == ['it works']
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -1027,9 +1027,7 @@ eom
|
|||||||
eval('1 if !//')
|
eval('1 if !//')
|
||||||
end
|
end
|
||||||
assert_warn('') do
|
assert_warn('') do
|
||||||
verbose_bak, $VERBOSE = $VERBOSE, nil
|
|
||||||
eval('1 if !(true..false)')
|
eval('1 if !(true..false)')
|
||||||
$VERBOSE = verbose_bak
|
|
||||||
end
|
end
|
||||||
assert_warning('') do
|
assert_warning('') do
|
||||||
eval('1 if !1')
|
eval('1 if !1')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user