From bb877e5b4fe81965af60a0d86daeb8ed477e8e87 Mon Sep 17 00:00:00 2001 From: nagachika Date: Sat, 9 Sep 2023 19:33:29 +0900 Subject: merge revision(s) 382678d4112f4afc6272244c22924d2b004274b1: [Backport #19788] [Bug #19788] Use the result of `tCOLON2` event --- parse.y | 16 ++++++++-------- test/ripper/test_parser_events.rb | 17 +++++++++++++++++ test/ripper/test_scanner_events.rb | 5 +++++ 3 files changed, 30 insertions(+), 8 deletions(-) --- parse.y | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'parse.y') diff --git a/parse.y b/parse.y index 9dd56c0af1..f6cb9d1521 100644 --- a/parse.y +++ b/parse.y @@ -1908,7 +1908,7 @@ command_asgn : lhs '=' lex_ctxt command_rhs /*%%%*/ $$ = new_attr_op_assign(p, $1, ID2VAL(idCOLON2), $3, $4, $6, &@$); /*% %*/ - /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | defn_head f_opt_paren_args '=' command { @@ -2188,14 +2188,14 @@ command : fcall command_args %prec tLOWEST /*%%%*/ $$ = new_command_qcall(p, ID2VAL(idCOLON2), $1, $3, $4, Qnull, &@3, &@$); /*% %*/ - /*% ripper: command_call!($1, ID2VAL(idCOLON2), $3, $4) %*/ + /*% ripper: command_call!($1, $2, $3, $4) %*/ } | primary_value tCOLON2 operation2 command_args cmd_brace_block { /*%%%*/ $$ = new_command_qcall(p, ID2VAL(idCOLON2), $1, $3, $4, $5, &@3, &@$); /*% %*/ - /*% ripper: method_add_block!(command_call!($1, ID2VAL(idCOLON2), $3, $4), $5) %*/ + /*% ripper: method_add_block!(command_call!($1, $2, $3, $4), $5) %*/ } | keyword_super command_args { @@ -2475,7 +2475,7 @@ lhs : user_variable /*%%%*/ $$ = attrset(p, $1, idCOLON2, $3, &@$); /*% %*/ - /*% ripper: field!($1, ID2VAL(idCOLON2), $3) %*/ + /*% ripper: field!($1, $2, $3) %*/ } | primary_value call_op tCONSTANT { @@ -2666,7 +2666,7 @@ arg : lhs '=' lex_ctxt arg_rhs /*%%%*/ $$ = new_attr_op_assign(p, $1, ID2VAL(idCOLON2), $3, $4, $6, &@$); /*% %*/ - /*% ripper: opassign!(field!($1, ID2VAL(idCOLON2), $3), $4, $6) %*/ + /*% ripper: opassign!(field!($1, $2, $3), $4, $6) %*/ } | primary_value tCOLON2 tCONSTANT tOP_ASGN lex_ctxt arg_rhs { @@ -4241,14 +4241,14 @@ method_call : fcall paren_args $$ = new_qcall(p, ID2VAL(idCOLON2), $1, $3, $4, &@3, &@$); nd_set_line($$, @3.end_pos.lineno); /*% %*/ - /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), $3), $4) %*/ + /*% ripper: method_add_arg!(call!($1, $2, $3), $4) %*/ } | primary_value tCOLON2 operation3 { /*%%%*/ $$ = new_qcall(p, ID2VAL(idCOLON2), $1, $3, Qnull, &@3, &@$); /*% %*/ - /*% ripper: call!($1, ID2VAL(idCOLON2), $3) %*/ + /*% ripper: call!($1, $2, $3) %*/ } | primary_value call_op paren_args { @@ -4264,7 +4264,7 @@ method_call : fcall paren_args $$ = new_qcall(p, ID2VAL(idCOLON2), $1, ID2VAL(idCall), $3, &@2, &@$); nd_set_line($$, @2.end_pos.lineno); /*% %*/ - /*% ripper: method_add_arg!(call!($1, ID2VAL(idCOLON2), ID2VAL(idCall)), $3) %*/ + /*% ripper: method_add_arg!(call!($1, $2, ID2VAL(idCall)), $3) %*/ } | keyword_super paren_args { -- cgit v1.2.3