File: connects.cc

package info (click to toggle)
simrisc 16.05.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,568 kB
  • sloc: cpp: 6,877; fortran: 665; makefile: 112; ansic: 112; sh: 107
file content (27 lines) | stat: -rw-r--r-- 558 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//#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;
}