<commit_before>module Lispy
  # Your code goes here...
end
<commit_msg>first working implementation<commit_after>class Lispy
  class Builder
    def _(&block)
      @output = []
      @scope = [@output]
      instance_exec(&block)
      @output
    end

    def method_missing(sym, *args, &block)
      args = (args.length == 1 ? args.first : args)
      @scope.last << [sym, args]
      if block
        @scope.last << []
        @scope.push(@scope.last.last)
        instance_exec(&block)
        @scope.pop
      end
    end
  end

  def to_data(&block)
    Builder.new._(&block)
  end
end

output = Lispy.new.to_data do 
  setup :workers => 30, :connections => 1024
  http :access_log => :off do
    server :listen => 80 do
      location '/' do
        doc_root '/var/www/website'
      end
      location '~ .php$' do
        fcgi :port => 8877
        script_root '/var/www/website'
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.12200435729847495, 'fraction_numerical': 0.014161220043572984, 'mean_word_length': 2.0735785953177257, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '169911', 'n_tokens_mistral': 319, 'n_tokens_neox': 298, 'n_words': 80}