module Treetop
def self.load(path)
def self.load(path) adjusted_path = path =~ /\.(treetop|tt)\Z/ ? path : path + '.treetop' File.open(adjusted_path) do |source_file| source = source_file.read source.gsub!(/\b__FILE__\b/, %Q{"#{adjusted_path}"}) load_from_string(source) end end