* lib/pp.rb (PP::PPMethods::seplist): should have preserved

original reference to the array.  [ruby-dev:28747]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-06-21 08:20:12 +00:00
parent 2ca2a4a43b
commit 7dd70df4b0
2 changed files with 8 additions and 3 deletions

View File

@ -1,3 +1,8 @@
Wed Jun 21 17:18:55 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* lib/pp.rb (PP::PPMethods::seplist): should have preserved
original reference to the array. [ruby-dev:28747]
Wed Jun 21 14:35:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org> Wed Jun 21 14:35:06 2006 Yukihiro Matsumoto <matz@ruby-lang.org>
* parse.y (block_param): do not use multiple assignment for a sole * parse.y (block_param): do not use multiple assignment for a sole

View File

@ -220,13 +220,13 @@ class PP < PrettyPrint
def seplist(list, sep=nil, iter_method=:each) # :yield: element def seplist(list, sep=nil, iter_method=:each) # :yield: element
sep ||= lambda { comma_breakable } sep ||= lambda { comma_breakable }
first = true first = true
list.__send__(iter_method) {|*v| list.__send__(iter_method) {|v|
if first if first
first = false first = false
else else
sep.call sep.call
end end
yield(*v) yield(v)
} }
end end