diff --git a/parse.y b/parse.y index bb4160194d..f43f40697c 100644 --- a/parse.y +++ b/parse.y @@ -3825,7 +3825,7 @@ string_dvar : tGVAR $$ = NEW_DVAR(id, &@1); /*% %*/ (void)id; - /*% ripper: var_ref!(number_arg!($1)) %*/ + /*% ripper: var_ref!($1) %*/ } | backref ; @@ -3885,11 +3885,10 @@ user_variable : tIDENTIFIER | tNUMPARAM { ID id = numparam_id(p, get_num($1)); - /*% ripper: number_arg!($1) %*/ /*%%%*/ $$ = id; /*% - $$ = ripper_new_yylval(p, id, $$, 0); + $$ = ripper_new_yylval(p, id, get_value($1), 0); %*/ } ; diff --git a/test/ripper/test_parser_events.rb b/test/ripper/test_parser_events.rb index fd01427af5..be46ad917d 100644 --- a/test/ripper/test_parser_events.rb +++ b/test/ripper/test_parser_events.rb @@ -58,7 +58,7 @@ class TestRipper::ParserEvents < Test::Unit::TestCase assert_equal '[assign(var_field(a),ref(a))]', parse('a=a') assert_equal '[ref(nil)]', parse('nil') assert_equal '[ref(true)]', parse('true') - assert_include parse('proc{@1}'), '[ref(number_arg(@1))]' + assert_include parse('proc{@1}'), '[ref(@1)]' end def test_vcall @@ -813,12 +813,6 @@ class TestRipper::ParserEvents < Test::Unit::TestCase assert_equal true, thru_next end - def test_number_arg - thru_number_arg = false - parse('proc {@1}', :on_number_arg) {thru_number_arg = true} - assert_equal true, thru_number_arg - end - def test_opassign thru_opassign = false tree = parse('a += b', :on_opassign) {thru_opassign = true}