Skip to content

Commit

Permalink
Use context instead of hacky stack, which allows us to see if we're a
Browse files Browse the repository at this point in the history
direct :iter descendent or not.

[git-p4: depot-paths = "//src/heckle/dev/": change = 3551]
  • Loading branch information
drbrain committed Aug 17, 2007
1 parent e85b4b8 commit c65377e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions Rakefile
Expand Up @@ -14,6 +14,7 @@ Hoe.new('heckle', Heckle::VERSION) do |p|
p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n")

p.extra_deps << ['ParseTree', '~> 2']
p.extra_deps << ['ruby2ruby', '>= 1.1.6']
p.extra_deps << ['ZenTest', '>= 3.5.2']
end
Expand Down
13 changes: 8 additions & 5 deletions lib/heckle.rb
Expand Up @@ -233,9 +233,7 @@ def process_call(exp)

call = s(:call, recv, meth, args)

stack = caller.map { |s| s[/process_\w+/] }.compact

if stack.first != "process_iter" then
if context[1] != :iter then
mutate_node call
else
call
Expand Down Expand Up @@ -592,13 +590,18 @@ def mutations_left

if sum == @last_mutations_left then
puts 'bug!'
puts
require 'pp'
puts 'mutatees left:'
puts 'mutatees:'
pp @mutatees
puts
puts 'original tree:'
pp @original_tree
abort 'Infinite loop detected'
puts
puts "Infinite loop detected!"
puts "Please save this output to an attachment and submit a ticket here:"
puts "http://rubyforge.org/tracker/?func=add&group_id=1513&atid=5921"
exit 1
else
@last_mutations_left = sum
end
Expand Down

0 comments on commit c65377e

Please sign in to comment.