Sha256: 36ea78b829027865686b9539896d80c3a78cdd8ebab4eb79f4fc6490d4659fe9

Contents?: true

Size: 417 Bytes

Versions: 2

Compression:

Stored size: 417 Bytes

Contents

class SGF::StrictErrorChecker
  def check_for_errors_before_parsing string
    unless string[/\A\s*\(\s*;/]
      msg = "The first two non-whitespace characters of the string should be (;"
      msg << " but they were #{string[0..1]} instead."
      raise(SGF::MalformedDataError, msg)
    end
  end
end

class SGF::LaxErrorChecker
  def check_for_errors_before_parsing string
    # just look the other way
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
SgfParser-3.0.1 lib/sgf/error_checkers.rb
SgfParser-3.0.0 lib/sgf/error_checkers.rb