text_exts = %w[
  pas
  dpr
]

def run(src)
  open(src, 'r'){|i|

while line = i.gets
  print "#{i.path}(#{i.lineno}): ", line if /(Obj|real)\.((On|Before|After)\w+)\s*:=\s*Handle.\w+\2/i
end

  }
end

Dir.glob('**/*'){|entry|
  pos = entry.rindex('.')
  next if pos.nil?
  ext = entry[pos+1..-1]
  if text_exts.include? ext
    $stderr.print "run #{entry}\n"
    run entry
  end
}
