<commit_before>module Gherkin
  module Tools
    class LineFilterListener
      class Sexp < Array
        def initialize(*args)
          super
          self[1] = self[1].to_a if event == :row # Special JRuby handling
        end
        
        def event
          self[0]
        end
        
        def line
          self[-1]
        end
      end

      def initialize(listener, lines)
        @listener, @lines = listener, lines
        @sexps = []
        @filtered_sexps = []

        @next_uncollected_scenario_index = 0
        @current_index = -1
      end

      def method_missing(*args)
        sexp = Sexp.new(args)
        @sexps << sexp

        @current_index += 1
        line_match = @lines.index(sexp.line)

        case(sexp.event)
        when :tag
        when :comment
        when :feature
        when :background
        when :scenario, :scenario_outline
          @scenario_ok = line_match
          @first_scenario_index ||= @current_index
          @next_uncollected_scenario_index = @current_index
        when :examples
          # @examples_ok = line_match
          @included_rows = {}
          @table_state = :examples
        when :step
          @scenario_ok ||= line_match
          @included_rows = nil
          @table_state = :step
        when :row
          case(@table_state)
          when :examples
            row_ok = line_match
            if @included_rows.empty?
              # The header row is always ok<commit_msg>Fix mistake in previous commit<commit_after>module Gherkin
  module Tools
    class LineFilterListener
      class Sexp < Array
        def initialize(*args)
          super
          self[1] = self[1].to_a if event == :row # Special JRuby handling
        end
        
        def event
          self[0]
        end
        
        def line
          self[-1]
        end
      end

      def initialize(listener, lines)
        @listener, @lines = listener, lines
        @sexps = []
        @filtered_sexps = []

        @next_uncollected_scenario_index = 0
        @current_index = -1
      end

      def method_missing(*args)
        sexp = Sexp.new(args)
        @sexps << sexp

        @current_index += 1
        line_match = @lines.index(sexp.line)

        case(sexp.event)
        when :tag
        when :comment
        when :feature
        when :background
        when :scenario, :scenario_outline
          @scenario_ok = line_match
          @first_scenario_index ||= @current_index
          @next_uncollected_scenario_index = @current_index
        when :examples
          @examples_ok = line_match
          @included_rows = {}
          @table_state = :examples
        when :step
          @scenario_ok ||= line_match
          @included_rows = nil
          @table_state = :step
        when :row
          case(@table_state)
          when :examples
            row_ok = line_match
            if @included_rows.empty?
              # The header row is always ok
{'fraction_non_alphanumeric': 0.07588532883642496, 'fraction_numerical': 0.004721753794266442, 'mean_word_length': 1.565743944636678, 'pattern_counts': {'":': 0, '<': 9, '<?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': '2753772', 'n_tokens_mistral': 866, 'n_tokens_neox': 831, 'n_words': 207}