<commit_before>module Atomo
  module AST
    class ForMacro < Node
      Atomo::Parser.register self

      def self.rule_name
        "for_macro"
      end

      def initialize(body)
        @body = body
        @line = 1 # TODO
      end

      def ==(b)
        b.kind_of?(ForMacro) and \
        @body == b.body
      end

      attr_reader :body

      def construct(g, d)
        get(g)
        @body.construct(g, d)
        g.send :new, 2
      end

      def recursively(stop = nil, &f)
        return f.call(self) if stop and stop.call(self)
        f.call ForMacro.new(@body.recursively(&f))
      end

      def self.grammar(g)
        g.for_macro =
          g.seq(
            "for-macro", :sig_sp, g.t(:expression)
          ) do |b|
            ForMacro.new(b)
          end
      end

      def bytecode(g)
        pos(g)
        g.push_nil
      end
    end
  end
end
<commit_msg>corrected ForMacro#construct<commit_after>module Atomo
  module AST
    class ForMacro < Node
      Atomo::Parser.register self

      def self.rule_name
        "for_macro"
      end

      def initialize(body)
        @body = body
        @line = 1 # TODO
      end

      def ==(b)
        b.kind_of?(ForMacro) and \
        @body == b.body
      end

      attr_reader :body

      def construct(g, d)
        get(g)
        @body.construct(g, d)
        g.send :new, 1
      end

      def recursively(stop = nil, &f)
        return f.call(self) if stop and stop.call(self)
        f.call ForMacro.new(@body.recursively(&f))
      end

      def self.grammar(g)
        g.for_macro =
          g.seq(
            "for-macro", :sig_sp, g.t(:expression)
          ) do |b|
            ForMacro.new(b)
          end
      end

      def bytecode(g)
        pos(g)
        g.push_nil
      end
    end
  end
end

{'fraction_non_alphanumeric': 0.10215350635008283, 'fraction_numerical': 0.0022087244616234127, 'mean_word_length': 1.4095744680851063, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2729965', 'n_tokens_mistral': 640, 'n_tokens_neox': 609, 'n_words': 147}