private static function makeOptGrp(Variable $var)
    {
        if ($var->required) {
            return;
        }

        list ($next, $nextIsOpt) = self::findNextOpt($var);

        if (!$nextIsOpt) {
            return;
        }

        //$nextOpt = null !== $next ? self::makeOptGrp($next) : null;

        //if (null === $nextOpt && null !== $next) {
        //    return;
        //}

        $optgrp = null !== $next ? self::makeOptGrp($next) : '';
        $p      = $var->prev instanceof Delimiter ? $var->prev : '';

        return sprintf('(?:%s%s%s)?', $p, $var, $optgrp);
    }