mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Removed idNUMPARAM_0
This commit is contained in:
parent
55e1e22b2d
commit
33c5ad3154
3 changed files with 10 additions and 5 deletions
|
@ -60,7 +60,6 @@ firstline, predefined = __LINE__+1, %[\
|
||||||
_ UScore
|
_ UScore
|
||||||
|
|
||||||
# MUST be successive
|
# MUST be successive
|
||||||
_0 NUMPARAM_0
|
|
||||||
_1 NUMPARAM_1
|
_1 NUMPARAM_1
|
||||||
_2 NUMPARAM_2
|
_2 NUMPARAM_2
|
||||||
_3 NUMPARAM_3
|
_3 NUMPARAM_3
|
||||||
|
|
13
parse.y
13
parse.y
|
@ -173,9 +173,16 @@ enum {
|
||||||
NUMPARAM_MAX = 9,
|
NUMPARAM_MAX = 9,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUMPARAM_ID_P(id) (is_local_id(id) && NUMPARAM_ID_TO_IDX(id) <= NUMPARAM_MAX)
|
#define NUMPARAM_ID_P(id) numparam_id_p(id)
|
||||||
#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_0)
|
#define NUMPARAM_ID_TO_IDX(id) (unsigned int)(((id) >> ID_SCOPE_SHIFT) - tNUMPARAM_1 + 1)
|
||||||
#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_0 + (idx)))
|
#define NUMPARAM_IDX_TO_ID(idx) TOKEN2LOCALID((tNUMPARAM_1 + (idx) - 1))
|
||||||
|
static int
|
||||||
|
numparam_id_p(ID id)
|
||||||
|
{
|
||||||
|
if (!is_local_id(id)) return 0;
|
||||||
|
unsigned int idx = NUMPARAM_ID_TO_IDX(id);
|
||||||
|
return idx > 0 && idx <= NUMPARAM_MAX;
|
||||||
|
}
|
||||||
|
|
||||||
#define DVARS_INHERIT ((void*)1)
|
#define DVARS_INHERIT ((void*)1)
|
||||||
#define DVARS_TOPSCOPE NULL
|
#define DVARS_TOPSCOPE NULL
|
||||||
|
|
|
@ -60,7 +60,6 @@ class TestRipper::ParserEvents < Test::Unit::TestCase
|
||||||
assert_equal '[ref(true)]', parse('true')
|
assert_equal '[ref(true)]', parse('true')
|
||||||
assert_equal '[vcall(_0)]', parse('_0')
|
assert_equal '[vcall(_0)]', parse('_0')
|
||||||
assert_equal '[vcall(_1)]', parse('_1')
|
assert_equal '[vcall(_1)]', parse('_1')
|
||||||
assert_include parse('proc{_0}'), '[ref(_0)]'
|
|
||||||
assert_include parse('proc{_1}'), '[ref(_1)]'
|
assert_include parse('proc{_1}'), '[ref(_1)]'
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue