mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
parse.y: removed redundant number_arg parser event
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fa66569afa
commit
afa1505ca8
2 changed files with 3 additions and 10 deletions
5
parse.y
5
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);
|
||||
%*/
|
||||
}
|
||||
;
|
||||
|
|
|
@ -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}
|
||||
|
|
Loading…
Add table
Reference in a new issue