summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-21 15:35:30 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2021-05-21 18:28:24 +0900
commit50a534a1526e2b9f4ea41e44b802bd73f9cebbeb (patch)
tree2d57265e65c180c6edb0401edcfa0cf206192b22 /parse.y
parent050bb06e66d8c08c43bf0cc74271f35c3edce25d (diff)
ripper: wrap endless method in bodystmt [Bug #17869]
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4516
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y16
1 files changed, 12 insertions, 4 deletions
diff --git a/parse.y b/parse.y
index 3a03a3e030d..e669adbcd5d 100644
--- a/parse.y
+++ b/parse.y
@@ -1636,6 +1636,7 @@ command_asgn : lhs '=' lex_ctxt command_rhs
/*%%%*/
$$ = set_defun_body(p, $1, $2, $4, &@$);
/*% %*/
+ /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
/*% ripper: def!(get_value($1), $2, $4) %*/
local_pop(p);
}
@@ -1647,7 +1648,8 @@ command_asgn : lhs '=' lex_ctxt command_rhs
$4 = rescued_expr(p, $4, $6, &@4, &@5, &@6);
$$ = set_defun_body(p, $1, $2, $4, &@$);
/*% %*/
- /*% ripper: def!(get_value($1), $2, rescue_mod!($4, $6)) %*/
+ /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
+ /*% ripper: def!(get_value($1), $2, $4) %*/
local_pop(p);
}
| defs_head f_opt_paren_args '=' command
@@ -1659,6 +1661,7 @@ command_asgn : lhs '=' lex_ctxt command_rhs
/*%
$1 = get_value($1);
%*/
+ /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
/*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
local_pop(p);
}
@@ -1672,7 +1675,8 @@ command_asgn : lhs '=' lex_ctxt command_rhs
/*%
$1 = get_value($1);
%*/
- /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, rescue_mod!($4, $6)) %*/
+ /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
+ /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
local_pop(p);
}
| backref tOP_ASGN lex_ctxt command_rhs
@@ -2557,6 +2561,7 @@ arg : lhs '=' lex_ctxt arg_rhs
/*%%%*/
$$ = set_defun_body(p, $1, $2, $4, &@$);
/*% %*/
+ /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
/*% ripper: def!(get_value($1), $2, $4) %*/
local_pop(p);
}
@@ -2568,7 +2573,8 @@ arg : lhs '=' lex_ctxt arg_rhs
$4 = rescued_expr(p, $4, $6, &@4, &@5, &@6);
$$ = set_defun_body(p, $1, $2, $4, &@$);
/*% %*/
- /*% ripper: def!(get_value($1), $2, rescue_mod!($4, $6)) %*/
+ /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
+ /*% ripper: def!(get_value($1), $2, $4) %*/
local_pop(p);
}
| defs_head f_opt_paren_args '=' arg
@@ -2580,6 +2586,7 @@ arg : lhs '=' lex_ctxt arg_rhs
/*%
$1 = get_value($1);
%*/
+ /*% ripper[$4]: bodystmt!($4, Qnil, Qnil, Qnil) %*/
/*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
local_pop(p);
}
@@ -2593,7 +2600,8 @@ arg : lhs '=' lex_ctxt arg_rhs
/*%
$1 = get_value($1);
%*/
- /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, rescue_mod!($4, $6)) %*/
+ /*% ripper[$4]: bodystmt!(rescue_mod!($4, $6), Qnil, Qnil, Qnil) %*/
+ /*% ripper: defs!(AREF($1, 0), AREF($1, 1), AREF($1, 2), $2, $4) %*/
local_pop(p);
}
| primary