code: function appendDirEnd(str, struct) {
  	if (!struct.block) {
  		return str;
  	}
  
  	const [rightSpace] = rightWSRgxp.exec(str);
  	str = str.replace(rightPartRgxp, '');
  
  	const
  		s = alb + lb,
  		e = rb;
  
  	let tmp;
  	if (needSpace) {
  		tmp = `${struct.trim.right ? '' : eol}${endDirInit ? '' : `${s}__&+__${e}`}${struct.trim.right ? eol : ''}`;
  
  	} else {
  		tmp = eol + struct.space.slice(1);
  	}
  
  	endDirInit = true;
  	str += `${tmp}${struct.adv + lb}__end__${e}${s}__cutLine__${e}`;
  
  	if (rightSpace && needSpace) {
  		str += `${s}__&-__${rb}`;
  	}
  
  	return str + rightSpace;
  }
docs: Appends the directive end for a resulting string
  and returns a new string
  
  @param {string} str - resulting string
  @param {!Object} struct - structure object
  @return {string}