def validate_states(lexer)
      if !lexer.state_info.respond_to?(:each_pair)
        complain("States must be defined as a hash")
      end

      lexer.state_info.each do |state_name, state_type|
        if ![:inclusive, :exclusive].include?(state_type)
          complain("State type for state #{state_name}" \
                   " must be :inclusive or :exclusive")
        end

        if state_type == :exclusive
          if !lexer.state_error.key?(state_name)
            lexer.logger.warn("No error rule is defined " \
                              "for exclusive state '#{state_name}'")
          end
          if !lexer.state_ignore.key?(state_name)
            lexer.logger.warn("No ignore rule is defined " \
                              "for exclusive state '#{state_name}'")
          end
        end
      end
    end
def validate_states(lexer)
      if !lexer.state_info.respond_to?(:each_pair)
        complain("States must be defined as a hash")
      end

      lexer.state_info.each do |state_name, state_type|
        if ![:inclusive, :exclusive].include?(state_type)
          complain("State type for state #{state_name}" \
                   " must be :inclusive or :exclusive")
        end

        if state_type == :exclusive
          if !lexer.state_error.key?(state_name)
            lexer.logger.warn("No error rule is defined " \
                              "for exclusive state '#{state_name}'")
          end
          if !lexer.state_ignore.key?(state_name)
            lexer.logger.warn("No ignore rule is defined " \
                              "for exclusive state '#{state_name}'")
          end
        end
      end
    end
Validate provided state names

 @api private