<commit_before>class Typhon
  class AST

    def self.build(ary)

    end

  end
end<commit_msg>Typhon::AST.build used to construct the AST tree from sexp.<commit_after>class Typhon
  class AST

    Nodes = Hash.new

    # Converts a ruby sexp (array literals) into Typhon AST
    def self.build(sexp)
      return nil if sexp.nil? || sexp.empty?
      name = sexp.first
      rest = sexp[1..-1]
      type = Nodes[name]
      raise "Unknown sexp type: #{name}" unless type
      body = rest.map { |e| if e.kind_of?(Array) then from_sexp(e) else e end }
      line = 0
      ast = type.new(line, *body)
      ast
    end

    class Node < Rubinius::AST::Node
      def self.name(name)
        Nodes[name] = self
      end
    end

  end
end
{'fraction_non_alphanumeric': 0.1, 'fraction_numerical': 0.004054054054054054, 'mean_word_length': 2.25, 'pattern_counts': {'":': 0, '<': 4, '<?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': '1597013', 'n_tokens_mistral': 271, 'n_tokens_neox': 252, 'n_words': 79}