<commit_before>module AVM2::ABC
  class Opcode
    MAP = {}

    def self.define_property(name, options={}, &block)
      define_singleton_method(name) do |value=nil, &value_block|
        if value_block
          define_method(name) do
            instance_exec &value_block
          end
        elsif !value.nil?
          define_method(name) do
            value
          end
        else
          define_method(name) do
            true
          end
        end

        instance_exec(value, &block) if block
      end
    end

    def self.body(&block)
      @body_defined = true

      klass = Class.new(Record) do
        instance_exec &block
      end
      const_set :Body, klass

      attr_accessor :body
    end

    define_property :instruction do |encoding|
      MAP[encoding] = self
    end

    define_property :consume
    define_property :produce

    define_property :type

    attr_reader :sequence

    def initialize(sequence)
      @sequence = sequence
    end

    def root
      @sequence.root
    end

    def read(io)
      if respond_to? :body
        @body = self.class.const_get(:Body).new(:parent => @sequence)
        @body.read(io)
      end<commit_msg>Work around a bug in Rubinius.<commit_after>module AVM2::ABC
  class Opcode
    MAP = {}

    def self.define_property(name, options={}, &block)
      define_singleton_method(name) do |value=nil, &value_block|
        if value_block
          define_method(name) do
            instance_exec &value_block
          end
        elsif !value.nil?
          define_method(name) do
            value
          end
        else
          define_method(name) do
            true
          end
        end

        instance_exec(value, &block) if block
      end
    end

    def self.body(&block)
      @body_defined = true

      klass = Class.new(Record)
      klass.instance_exec &block

      const_set :Body, klass

      attr_accessor :body
    end

    define_property :instruction do |encoding|
      MAP[encoding] = self
    end

    define_property :consume
    define_property :produce

    define_property :type

    attr_reader :sequence

    def initialize(sequence)
      @sequence = sequence
    end

    def root
      @sequence.root
    end

    def read(io)
      if respond_to? :body
        @body = self.class.const_get(:Body).new(:parent => @sequence)
        @body.read(io)
      end
{'fraction_non_alphanumeric': 0.07611877875365956, 'fraction_numerical': 0.000836470096194061, 'mean_word_length': 1.8923821039903266, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5500708', 'n_tokens_mistral': 725, 'n_tokens_neox': 696, 'n_words': 178}