<commit_before>require_relative 'single_char_comparison_constants'
module PortableBridgeNotation
  module Internals
    module StringParserUtil
      include SingleCharComparisonConstants

      # intent: this same functionality will eventually be needed by PlaySubgameParser and AuctionSubgameParser
      # as well as IoParser, for the same reasons
      # intent: hold our nose at the arity-2 method, considering for now it's the easiest way
      # to share the method with the future classes; todo: consider placing in a subclass hierarchy
      def comment_open_after_eol?(line, comment_is_open)
        last_char = nil
        line.each_char do |char|
          # see section 3.8 "Commentary"
          if char == open_curly && (last_char.nil? || last_char == space)
            comment_is_open = true
          end
          if char == close_curly
            comment_is_open = false
          end
          last_char = char
        end
        comment_is_open
      end

    end
  end
end
<commit_msg>Change mind on comment.<commit_after>require_relative 'single_char_comparison_constants'
module PortableBridgeNotation
  module Internals
    module StringParserUtil
      include SingleCharComparisonConstants

      # intent: this same functionality will eventually be needed by PlaySubgameParser and AuctionSubgameParser
      # as well as IoParser, for the same reasons
      # intent: hold our nose at the arity-2 method, considering it's better than the alternatives of
      # duplicating the logic or placing it arbitrarily in the inheritance hierarchy
      def comment_open_after_eol?(line, comment_is_open)
        last_char = nil
        line.each_char do |char|
          # see section 3.8 "Commentary"
          if char == open_curly && (last_char.nil? || last_char == space)
            comment_is_open = true
          end
          if char == close_curly
            comment_is_open = false
          end
          last_char = char
        end
        comment_is_open
      end

    end
  end
end

{'fraction_non_alphanumeric': 0.04498269896193772, 'fraction_numerical': 0.002965892239248641, 'mean_word_length': 2.544658493870403, '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': '3870218', 'n_tokens_mistral': 537, 'n_tokens_neox': 524, 'n_words': 189}