summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2021-07-17 11:13:52 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2021-07-17 11:13:52 +0900
commiteed5e8f796ab18e2e0a436dab83e35504ae3ded0 (patch)
treefebfbe44e74849e2198a980451885fc692475fab /parse.y
parentfd0df9c4fb36597e5e3f500670b29dbd77a14eca (diff)
One-line pattern matching is no longer experimental
https://github.com/ruby/dev-meeting-log/blob/master/DevelopersMeeting20210715Japan.md#feature-17724-make-the-pin-operator-support-instanceclassglobal-variables-jeremyevans0
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y14
1 files changed, 0 insertions, 14 deletions
diff --git a/parse.y b/parse.y
index dec4b7dfd9c..0bea8126707 100644
--- a/parse.y
+++ b/parse.y
@@ -523,7 +523,6 @@ static NODE *new_find_pattern(struct parser_params *p, NODE *constant, NODE *fnd
static NODE *new_find_pattern_tail(struct parser_params *p, ID pre_rest_arg, NODE *args, ID post_rest_arg, const YYLTYPE *loc);
static NODE *new_hash_pattern(struct parser_params *p, NODE *constant, NODE *hshptn, const YYLTYPE *loc);
static NODE *new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, const YYLTYPE *loc);
-static void warn_one_line_pattern_matching(struct parser_params *p, NODE *node, NODE *pattern, bool right_assign);
static NODE *new_kw_arg(struct parser_params *p, NODE *k, const YYLTYPE *loc);
static NODE *args_with_numbered(struct parser_params*,NODE*,int);
@@ -1739,7 +1738,6 @@ expr : command_call
p->ctxt.in_kwarg = $<ctxt>3.in_kwarg;
/*%%%*/
$$ = NEW_CASE3($1, NEW_IN($5, 0, 0, &@5), &@$);
- warn_one_line_pattern_matching(p, $$, $5, true);
/*% %*/
/*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
}
@@ -1758,7 +1756,6 @@ expr : command_call
p->ctxt.in_kwarg = $<ctxt>3.in_kwarg;
/*%%%*/
$$ = NEW_CASE3($1, NEW_IN($5, NEW_TRUE(&@5), NEW_FALSE(&@5), &@5), &@$);
- warn_one_line_pattern_matching(p, $$, $5, false);
/*% %*/
/*% ripper: case!($1, in!($5, Qnil, Qnil)) %*/
}
@@ -12152,17 +12149,6 @@ new_hash_pattern_tail(struct parser_params *p, NODE *kw_args, ID kw_rest_arg, co
return node;
}
-static void
-warn_one_line_pattern_matching(struct parser_params *p, NODE *node, NODE *pattern, bool right_assign)
-{
- enum node_type type;
- type = nd_type(pattern);
-
- if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL) &&
- !(right_assign && (type == NODE_LASGN || type == NODE_DASGN || type == NODE_DASGN_CURR)))
- rb_warn0L_experimental(nd_line(node), "One-line pattern matching is experimental, and the behavior may change in future versions of Ruby!");
-}
-
static NODE*
dsym_node(struct parser_params *p, NODE *node, const YYLTYPE *loc)
{