//#define XERR
#include "group.ih"

    // by group.f (nextRange)

bool Group::connects(Group const &previous) const
{
    switch (d_series)
    {
        case SINGLE:
            if (d_end > previous.d_end)
                return true;
        break;

        case RANGE:
            if (d_begin == -1 or Globals::isZero(d_begin - previous.d_end))
            {
                d_begin = previous.d_end;
                return true;
            }
        break;
    }

    Err::msg(Err::NOT_CONSECUTIVE) << d_begin << " - ..." << endl;

    return false;
}
