* compile.c (compile_array): ignore NODE_ZARRAY.
[ruby-dev:31110] * bootstraptest/test_method.rb: add a test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12686 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
590609f255
commit
43bbe2841d
@ -1,3 +1,10 @@
|
|||||||
|
Wed Jul 4 04:07:00 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* compile.c (compile_array): ignore NODE_ZARRAY.
|
||||||
|
[ruby-dev:31110]
|
||||||
|
|
||||||
|
* bootstraptest/test_method.rb: add a test for above.
|
||||||
|
|
||||||
Wed Jul 4 04:04:02 2007 Koichi Sasada <ko1@atdot.net>
|
Wed Jul 4 04:04:02 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* compile.h: fix debug print level.
|
* compile.h: fix debug print level.
|
||||||
|
@ -336,6 +336,21 @@ assert_equal '[[:ok1, :foo], [:ok2, :foo, :bar]]',
|
|||||||
$ary
|
$ary
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# with
|
||||||
|
assert_equal '[:ok1, [:ok2, 11]]', %q{
|
||||||
|
class C
|
||||||
|
def []
|
||||||
|
$ary << :ok1
|
||||||
|
10
|
||||||
|
end
|
||||||
|
def []=(a)
|
||||||
|
$ary << [:ok2, a]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
$ary = []
|
||||||
|
C.new[]+=1
|
||||||
|
$ary
|
||||||
|
}
|
||||||
|
|
||||||
# splat and block arguments
|
# splat and block arguments
|
||||||
assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{
|
assert_equal %q{[[[:x, :y, :z], NilClass], [[1, :x, :y, :z], NilClass], [[1, 2, :x, :y, :z], NilClass], [[:obj], NilClass], [[1, :obj], NilClass], [[1, 2, :obj], NilClass], [[], Proc], [[1], Proc], [[1, 2], Proc], [[], Proc], [[1], Proc], [[1, 2], Proc], [[:x, :y, :z], Proc], [[1, :x, :y, :z], Proc], [[1, 2, :x, :y, :z], Proc]]}, %q{
|
||||||
|
@ -1831,6 +1831,7 @@ compile_array(rb_iseq_t *iseq,
|
|||||||
int len = node->nd_alen, line = nd_line(node), i=0;
|
int len = node->nd_alen, line = nd_line(node), i=0;
|
||||||
DECL_ANCHOR(anchor);
|
DECL_ANCHOR(anchor);
|
||||||
|
|
||||||
|
if (nd_type(node) != NODE_ZARRAY) {
|
||||||
while (node) {
|
while (node) {
|
||||||
if (nd_type(node) != NODE_ARRAY) {
|
if (nd_type(node) != NODE_ARRAY) {
|
||||||
rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
|
rb_bug("compile_array: This node is not NODE_ARRAY, but %s",
|
||||||
@ -1844,6 +1845,7 @@ compile_array(rb_iseq_t *iseq,
|
|||||||
COMPILE(anchor, "array element", node->nd_head);
|
COMPILE(anchor, "array element", node->nd_head);
|
||||||
node = node->nd_next;
|
node = node->nd_next;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (len != i) {
|
if (len != i) {
|
||||||
if (0) rb_bug("node error: compile_array (%d: %d-%d)",
|
if (0) rb_bug("node error: compile_array (%d: %d-%d)",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user