Permalink
Browse files

- Fixed block_pass when passed a multi-level const (xavier)

[git-p4: depot-paths = "//src/flog/dev/": change = 5929]
  • Loading branch information...
zenspider committed Nov 2, 2010
1 parent 61bedd1 commit c24493b3438dfbe0bebfa7686b16307118c3399b
Showing with 12 additions and 1 deletion.
  1. +1 −1 lib/flog.rb
  2. +11 −0 test/test_flog.rb
View
@@ -512,7 +512,7 @@ def process_block_pass(exp)
add_to_score :block_pass
case arg.first
- when :lvar, :dvar, :ivar, :cvar, :self, :const, :nil then
+ when :lvar, :dvar, :ivar, :cvar, :self, :const, :colon2, :nil then
# do nothing
when :lit, :call then
add_to_score :to_proc_normal
View
@@ -305,6 +305,17 @@ def test_process_block_pass
:to_proc_normal => 6.0)
end
+ def test_process_block_pass_colon2
+ sexp = s(:call, nil, :a,
+ s(:arglist,
+ s(:block_pass,
+ s(:colon2, s(:const, :A), :B))))
+
+ util_process(sexp, 2.2,
+ :a => 1.0,
+ :block_pass => 1.2)
+ end
+
def test_process_block_pass_iter
sexp = s(:block_pass,
s(:iter, s(:call, nil, :lambda, s(:arglist)), nil, s(:lit, 1)))

0 comments on commit c24493b

Please sign in to comment.