Permalink
Browse files

Use "block_index" for block argument indexes.

Instead of using the name "block", which is rather ambiguous, the name
"block_index" should be used.

Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
  • Loading branch information...
1 parent cbee9a2 commit c1b77236cc3e89c6a3c424204a1b4b72df86bd6e @YorickPeterse YorickPeterse committed Mar 25, 2013
Showing with 7 additions and 7 deletions.
  1. +2 −2 kernel/bootstrap/block_environment.rb
  2. +4 −4 kernel/common/compiled_code.rb
  3. +1 −1 lib/compiler/generator.rb
@@ -52,8 +52,8 @@ def splat
@block_env.compiled_code.splat
end
- def block
- @block_env.compiled_code.block
+ def block_index
+ @block_env.compiled_code.block_index
end
def file
@@ -75,7 +75,7 @@ def equivalent_body?(other)
@required_args == other.required_args and
@total_args == other.total_args and
@splat == other.splat and
- @block == other.block and
+ @block_index == other.block_index and
@literals == other.literals and
@file == other.file and
@local_names == other.local_names
@@ -97,7 +97,7 @@ def local_slot(name)
#
# @param [Fixnum] position
#
- def block=(position)
+ def block_index=(position)
if position
add_metadata(:block_index, position)
end
@@ -106,7 +106,7 @@ def block=(position)
##
# @return [Fixnum|NilClass]
#
- def block
+ def block_index
return get_metadata(:block_index)
end
@@ -528,7 +528,7 @@ def parameters
params << [:rest, name]
elsif i < p
params << [:req, name]
- elsif block == i
+ elsif block_index == i
params << [:block, name]
end
end
@@ -322,7 +322,7 @@ def package(klass)
code.post_args = @post_args
code.total_args = @total_args
code.splat = @splat_index
- code.block = @block_index
+ code.block_index = @block_index
code.local_count = @local_count
code.local_names = @local_names.to_tuple if @local_names

0 comments on commit c1b7723

Please sign in to comment.