seattlerb/ruby2ruby — Issue #4: block causing syntax error
Author: zenspider
Created: 2011-12-22 01:04:33+00:00
State: open

See https://github.com/seattlerb/heckle/issues/1

I've come across a block of code I can't heckle because it always causes a syntax error. Style issues aside, here's the block:

```ruby
def my_awesome_method
begin
if true
puts "cool"
end
{}.delete(:whatever)
rescue
puts "weird"
end
end
```

Heckle tries to replace the block as such:

```ruby
--- original
+++ mutation
def my_awesome_method
begin
(puts("cool") if true
- { }.delete(:whatever)) rescue puts("weird")
+ # do nothing) rescue puts("weird")
end
end
```

Not sure if this is an issue directly with heckle or one of the libraries it uses, e.g. ParseTree.