sbeckeriv / ruby-formatter

A simple indent formatter for ruby
6 stars 2 forks source link

False positives #3

Open nkmathew opened 11 years ago

nkmathew commented 11 years ago

I keep getting negative depth warnings expecially when using eval or interpolated expressions. e.g

"#{def x(s)
puts(s.reverse)
end
(1..3).each {x("hh")}}"

eval( 'def aMethod( x )
return ( x * 2 )
end
num = 100
puts( "This is the result of the calculation:" )
puts( aMethod( num ))' )
sbeckeriv commented 11 years ago

Yep. Im pretty sure the regex i am using removing strings would die with that string. I will try and take a look this weekend.