def process path, name
begin
$stderr.print " #{path}: "
rp = RubyParser.new
r2r = Ruby2Ruby.new
old_ruby = File.read(path)
begin
old_sexp = rp.process old_ruby
rescue Racc::ParseError => e
self.data[name][path] = :unparsable
self.dirty = true
return
end
new_ruby = r2r.process old_sexp.deep_clone
begin
new_sexp = rp.process new_ruby
rescue Racc::ParseError => e
broke name, path, "couldn't parse new_ruby: #{e.message.strip}"
return
end
if old_sexp != new_sexp then
broke name, path, diff_pp(old_sexp, new_sexp)
return
end
self.data[name][path] = true
self.dirty = true
warn "good"
rescue Interrupt
puts "User cancelled"
exit 1
rescue Exception => e
broke name, path, " UNKNOWN ERROR: #{e}: #{e.message.strip}"
end
end