vendor/bundle/ruby/2.6.0/gems/regexp_parser-2.4.0/lib/regexp_parser/scanner.rb
# Centralizes and unifies the handling of validation related
# errors.
Centralizes and unifies the handling of validation related
errors.
Centralizes and unifies the handling of validation related errors .
def validation_error(type, what, reason = nil)
    error =
      case type
      when :backref      then InvalidBackrefError.new(what, reason)
      when :group        then InvalidGroupError.new(what, reason)
      when :group_option then InvalidGroupOption.new(what, reason)
      when :posix_class  then UnknownPosixClassError.new(what)
      when :property     then UnknownUnicodePropertyError.new(what)
      when :sequence     then InvalidSequenceError.new(what, reason)
      end
    raise error 
  end
def validation_error ( type , what , reason = nil ) error = case type when :backref then InvalidBackrefError . new ( what , reason ) when :group then InvalidGroupError . new ( what , reason ) when :group_option then InvalidGroupOption . new ( what , reason ) when :posix_class then UnknownPosixClassError . new ( what ) when :property then UnknownUnicodePropertyError . new ( what ) when :sequence then InvalidSequenceError . new ( what , reason ) end raise error end
Centralizes and unifies the handling of validation related
errors.
Centralizes and unifies the handling of validation related errors .
# unless @@config.validation_ignore
type
what
reason