<commit_before>module Bashcov
  # Simple lexer which analyzes Bash files in order to get information for
  # coverage
  class Lexer
    # Lines starting with one of these tokens are irrelevant for coverage
    IGNORE_START_WITH = %w|# function|

    # Lines ending with one of these tokens are irrelevant for coverage
    IGNORE_END_WITH = %w|(|

    # Lines containing only one of these keywords are irrelevant for coverage
    IGNORE_IS = %w|esac fi then do done else { } ;;|

    # @param [String] filename File to analyze
    # @param [Hash] coverage Coverage with executed lines marked
    # @raise [ArgumentError] if the given +filename+ is invalid.
    def initialize filename, coverage
      @filename = File.expand_path(filename)
      @coverage = coverage

      unless File.file?(@filename)
        raise ArgumentError, "#{@filename} is not a file"
      end
    end<commit_msg>Ignore 'if' and 'while' keywords as well<commit_after>module Bashcov
  # Simple lexer which analyzes Bash files in order to get information for
  # coverage
  class Lexer
    # Lines starting with one of these tokens are irrelevant for coverage
    IGNORE_START_WITH = %w|# function|

    # Lines ending with one of these tokens are irrelevant for coverage
    IGNORE_END_WITH = %w|(|

    # Lines containing only one of these keywords are irrelevant for coverage
    IGNORE_IS = %w|esac if then fi while do done else { } ;;|

    # @param [String] filename File to analyze
    # @param [Hash] coverage Coverage with executed lines marked
    # @raise [ArgumentError] if the given +filename+ is invalid.
    def initialize filename, coverage
      @filename = File.expand_path(filename)
      @coverage = coverage

      unless File.file?(@filename)
        raise ArgumentError, "#{@filename} is not a file"
      end
    end
{'fraction_non_alphanumeric': 0.06945975744211687, 'fraction_numerical': 0.0, 'mean_word_length': 3.2907801418439715, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3472910', 'n_tokens_mistral': 511, 'n_tokens_neox': 476, 'n_words': 213}