<commit_before>
$" << "compiler/mri_shim"
$" << "compiler/compiler"

$:.unshift File.dirname(__FILE__) + "/.."

require 'compiler/compiler'
require 'compiler/text'
require 'compiler/marshal'
require 'compiler/compiled_file'


class SendSite
  def initialize(name)
    @name = name
  end

  attr_reader :name
  attr_accessor :sender

  def ==(other)
    other.kind_of?(SendSite) and @name == other.name
  end
end

class Tuple < Array
end

class LookupTable < Hash
end

class Exception
  def awesome_backtrace
    ary = backtrace()
    def ary.show
      join("\n")
    end
    return ary
  end
end

require File.dirname(__FILE__) + '/../../kernel/core/iseq'
require File.dirname(__FILE__) + '/../../kernel/core/compiled_method'
require File.dirname(__FILE__) + '/../../vm/gen/simple_field'

def File.to_sexp(file, opt=nil)
  $: << File.expand_path "~/Work/p4/zss/src/ruby_parser/dev/lib/" # HACK
  require 'ruby_parser'

  top = RubyParser.new(true).process(File.read(file), file)
  raise "huh?" if top.size != 1
  top
end
<commit_msg>more hacks as I figger out compiler breakage<commit_after>
$" << "compiler/mri_shim"
$" << "compiler/compiler"

$:.unshift File.dirname(__FILE__) + "/.."

require 'compiler/compiler'
require 'compiler/text'
require 'compiler/marshal'
require 'compiler/compiled_file'


class SendSite
  def initialize(name)
    @name = name
  end

  attr_reader :name
  attr_accessor :sender

  def ==(other)
    other.kind_of?(SendSite) and @name == other.name
  end
end

class Tuple < Array
end

class LookupTable < Hash
end

class Exception
  def awesome_backtrace
    ary = backtrace()
    def ary.show
      join("\n")
    end
    return ary
  end
end

require File.dirname(__FILE__) + '/../../kernel/core/iseq'
require File.dirname(__FILE__) + '/../../kernel/core/compiled_method'
require File.dirname(__FILE__) + '/../../vm/gen/simple_field'

class String
  def to_sexp(file = "(string)")
    $: << File.expand_path("~/Work/p4/zss/src/ruby_parser/dev/lib/") # HACK
    require 'ruby_parser'

    sexp = RubyParser.new.process(self, file)
    p sexp
    sexp
  end
end

def File.to_sexp(file, opt=nil)
  File.read(file).to_sexp(file)
end

{'fraction_non_alphanumeric': 0.14622859787135586, 'fraction_numerical': 0.0013882461823229986, 'mean_word_length': 3.4761904761904763, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5252507', 'n_tokens_mistral': 781, 'n_tokens_neox': 755, 'n_words': 173}