<commit_before>module Iridium
  class Block < Treetop::Runtime::SyntaxNode
    def content
      elements.map(&:content)
    end
  end
  
  class Statement < Treetop::Runtime::SyntaxNode
    def content
      elements[0].content
    end
  end
  
  class IntegerLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_i
    end
  end
  
  class FloatLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_f
    end
  end
  
  class StringLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value[1...-1]
    end
  end
  
  class Identifier < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_sym
    end
  end
  
  class OperatorExpression < Treetop::Runtime::SyntaxNode
    def content
      [elements[1].content, elements[0].content, elements[2].content]
    end
  end
  
  class Assignment < OperatorExpression
  end
  
  class AttributeAssignment < Treetop::Runtime::SyntaxNode
    def content
      # [:set, receiver, attribute, value]
      [:set, elements[0].content[1], elements[0].content[2], elements[2].content]
    end
  end
  
  class DotExpression < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 3 # Dot chain
        [elements[1].content, elements[2].content(elements[0].content), elements[3].content]
      else
        [elements[1].content, elements[0].content, elements[2].content]        
      end
    end
  end
  
  class DotChain < Treetop::Runtime::SyntaxNode
    def content(root)
      if elements.length == 2 # Last in the chain
        [elements[1].content, root, elements[0].content]
      else # x.y => [<identifier>x, <dot>, <dotchain> [<identifier>y, <dot>]]
        # The first dot in the list is the deepest, pair it with the root, and make it the root of the next in the line
        elements[2].content([elements[1].content, root, elements[0].content])
      end
    end
  end
  
  class ComparativeExpression < OperatorExpression
  end
  
  class AdditiveExpression < OperatorExpression
  end
  
  class MultitiveExpression < OperatorExpression
  end
  
  class Expression < Treetop::Runtime::SyntaxNode
    def content
      elements[0].content
    end
  end
  
  class AssignmentOperator < Treetop::Runtime::SyntaxNode
    def content
      :"="
    end
  end

  class DotOperator < Treetop::Runtime::SyntaxNode
    def content
      :"."
    end
  end
  
  class AdditionOperator < Treetop::Runtime::SyntaxNode
    def content
      :+
    end
  end
  
  class SubtractionOperator < Treetop::Runtime::SyntaxNode
    def content
      :-
    end
  end
  
  class MultiplicationOperator < Treetop::Runtime::SyntaxNode
    def content
      :*
    end
  end
  
  class DivisionOperator < Treetop::Runtime::SyntaxNode
    def content
      :/
    end
  end
  
  class EqualityOperator < Treetop::Runtime::SyntaxNode
    def content
      :==
    end
  end
  
  class InequalityOperator < Treetop::Runtime::SyntaxNode
    def content
      :"!="
    end
  end
  
  class GreaterThanOperator < Treetop::Runtime::SyntaxNode
    def content
      :>
    end
  end
  
  class LessThanOperator < Treetop::Runtime::SyntaxNode
    def content
      :<
    end
  end
  
  class PrivateFunction < Treetop::Runtime::SyntaxNode
    def content
      [:private_function, *self.elements[0].content[1..-1]]
    end
  end
  
  class Function < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 2 # function with argument list
        [:function, *elements.map(&:content)]
      else # function with no argument list (i.e function x ... end)
        [:function, elements[0].content, [], elements[1].content]
      end
    end
  end
  
  class ArgumentList < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 1
        elements[0].content + [elements[1].content]
      else
        elements.map(&:content)
      end
    end
  end
  
  class CommaSeparated < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 1
        [elements[0].content, *elements[1].content]
      else
        elements.map(&:content)
      end
    end
  end
  
  class If < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Only an if
        [:if, [[elements[0].content, elements[1].content]]]
      elsif elements.length == 3 # Elseif or else
        [:if, [[elements[0].content, elements[1].content], *elements[2].content]]
      elsif elements.length == 4 # Elseif and else
        [:if, [[elements[0].content, elements[1].content], *elements[2].content, *elements[3].content]]
      end
    end
  end
  
  class ElseIf < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Only one
        [[elements[0].content, elements[1].content]]
      else # Multiple elseifs
        [[elements[0].content, elements[1].content], *elements[2].content]
      end
    end
  end
  
  class Else < Treetop::Runtime::SyntaxNode
    def content
      [[:else, elements[0].content]]
    end
  end
  
  class Unless < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Just an unless
        [:unless, [[elements[0].content, elements[1].content]]]
      else # with an else
        [:unless, [[elements[0].content, elements[1].content], *elements[2].content]]
      end
    end
  end
  
  class While < Treetop::Runtime::SyntaxNode
    def content
      [:while, *elements.map(&:content)]
    end
  end
  
  # class For < Treetop::Runtime::SyntaxNode
  #   def content
  #     [:for, *elements.map(&:content)]
  #   end
  # end
  
  class Module < Treetop::Runtime::SyntaxNode
    def content
      [:module, *elements.map(&:content)]<commit_msg>removed commented for loop<commit_after>module Iridium
  class Block < Treetop::Runtime::SyntaxNode
    def content
      elements.map(&:content)
    end
  end
  
  class Statement < Treetop::Runtime::SyntaxNode
    def content
      elements[0].content
    end
  end
  
  class IntegerLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_i
    end
  end
  
  class FloatLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_f
    end
  end
  
  class StringLiteral < Treetop::Runtime::SyntaxNode
    def content
      text_value[1...-1]
    end
  end
  
  class Identifier < Treetop::Runtime::SyntaxNode
    def content
      text_value.to_sym
    end
  end
  
  class OperatorExpression < Treetop::Runtime::SyntaxNode
    def content
      [elements[1].content, elements[0].content, elements[2].content]
    end
  end
  
  class Assignment < OperatorExpression
  end
  
  class AttributeAssignment < Treetop::Runtime::SyntaxNode
    def content
      # [:set, receiver, attribute, value]
      [:set, elements[0].content[1], elements[0].content[2], elements[2].content]
    end
  end
  
  class DotExpression < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 3 # Dot chain
        [elements[1].content, elements[2].content(elements[0].content), elements[3].content]
      else
        [elements[1].content, elements[0].content, elements[2].content]        
      end
    end
  end
  
  class DotChain < Treetop::Runtime::SyntaxNode
    def content(root)
      if elements.length == 2 # Last in the chain
        [elements[1].content, root, elements[0].content]
      else # x.y => [<identifier>x, <dot>, <dotchain> [<identifier>y, <dot>]]
        # The first dot in the list is the deepest, pair it with the root, and make it the root of the next in the line
        elements[2].content([elements[1].content, root, elements[0].content])
      end
    end
  end
  
  class ComparativeExpression < OperatorExpression
  end
  
  class AdditiveExpression < OperatorExpression
  end
  
  class MultitiveExpression < OperatorExpression
  end
  
  class Expression < Treetop::Runtime::SyntaxNode
    def content
      elements[0].content
    end
  end
  
  class AssignmentOperator < Treetop::Runtime::SyntaxNode
    def content
      :"="
    end
  end

  class DotOperator < Treetop::Runtime::SyntaxNode
    def content
      :"."
    end
  end
  
  class AdditionOperator < Treetop::Runtime::SyntaxNode
    def content
      :+
    end
  end
  
  class SubtractionOperator < Treetop::Runtime::SyntaxNode
    def content
      :-
    end
  end
  
  class MultiplicationOperator < Treetop::Runtime::SyntaxNode
    def content
      :*
    end
  end
  
  class DivisionOperator < Treetop::Runtime::SyntaxNode
    def content
      :/
    end
  end
  
  class EqualityOperator < Treetop::Runtime::SyntaxNode
    def content
      :==
    end
  end
  
  class InequalityOperator < Treetop::Runtime::SyntaxNode
    def content
      :"!="
    end
  end
  
  class GreaterThanOperator < Treetop::Runtime::SyntaxNode
    def content
      :>
    end
  end
  
  class LessThanOperator < Treetop::Runtime::SyntaxNode
    def content
      :<
    end
  end
  
  class PrivateFunction < Treetop::Runtime::SyntaxNode
    def content
      [:private_function, *self.elements[0].content[1..-1]]
    end
  end
  
  class Function < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 2 # function with argument list
        [:function, *elements.map(&:content)]
      else # function with no argument list (i.e function x ... end)
        [:function, elements[0].content, [], elements[1].content]
      end
    end
  end
  
  class ArgumentList < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 1
        elements[0].content + [elements[1].content]
      else
        elements.map(&:content)
      end
    end
  end
  
  class CommaSeparated < Treetop::Runtime::SyntaxNode
    def content
      if elements.length > 1
        [elements[0].content, *elements[1].content]
      else
        elements.map(&:content)
      end
    end
  end
  
  class If < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Only an if
        [:if, [[elements[0].content, elements[1].content]]]
      elsif elements.length == 3 # Elseif or else
        [:if, [[elements[0].content, elements[1].content], *elements[2].content]]
      elsif elements.length == 4 # Elseif and else
        [:if, [[elements[0].content, elements[1].content], *elements[2].content, *elements[3].content]]
      end
    end
  end
  
  class ElseIf < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Only one
        [[elements[0].content, elements[1].content]]
      else # Multiple elseifs
        [[elements[0].content, elements[1].content], *elements[2].content]
      end
    end
  end
  
  class Else < Treetop::Runtime::SyntaxNode
    def content
      [[:else, elements[0].content]]
    end
  end
  
  class Unless < Treetop::Runtime::SyntaxNode
    def content
      if elements.length == 2 # Just an unless
        [:unless, [[elements[0].content, elements[1].content]]]
      else # with an else
        [:unless, [[elements[0].content, elements[1].content], *elements[2].content]]
      end
    end
  end
  
  class While < Treetop::Runtime::SyntaxNode
    def content
      [:while, *elements.map(&:content)]
    end
  end
  
  class Module < Treetop::Runtime::SyntaxNode
    def content
      [:module, *elements.map(&:content)]
{'fraction_non_alphanumeric': 0.1075, 'fraction_numerical': 0.01125, 'mean_word_length': 2.678489326765189, 'pattern_counts': {'":': 0, '<': 86, '<?xml version=': 0, '>': 25, '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': '4187960', 'n_tokens_mistral': 3455, 'n_tokens_neox': 3356, 'n_words': 851}