private function parseEndTerm(string $endTerm)
    {
        if ('' === $endTerm) {
            throw new \ErrorException('Parse interval expression');
        }

        $endInclusion = \substr($endTerm, -1);

        if (!\in_array($endInclusion, [self::LEFT, self::RIGHT], true)) {
            throw new \ErrorException('Parse interval expression');
        }

        $isOpen       = $endInclusion === self::RIGHT;
        $endValue     = \substr($endTerm, 0, -1);
        return $this->parseValue($endValue, false, $isOpen);
    }