function setNodeRemark(ast, remark, yaml) {
  let index = getNodeEndMark(ast).pointer;
  while (index < yaml.length && yaml[index] !== '#' && yaml[index] !== EOL) {
    ++index;
  }

  if (EOL === yaml[index] || index === yaml.length) {
    return yaml.substr(0, index) + ' # ' + remark +
        yaml.substring(index);
  } else {
    while (index < yaml.length && (yaml[index] === '#' || yaml[index] === ' ')) {
      ++index;
    }
    let end = index;
    while (end < yaml.length && yaml[end] !== EOL) {
      ++end;
    }
    return yaml.substr(0, index) + remark +
        yaml.substring(end);
  }
}
function setNodeRemark(ast, remark, yaml) {
  let index = getNodeEndMark(ast).pointer;
  while (index < yaml.length && yaml[index] !== '#' && yaml[index] !== EOL) {
    ++index;
  }

  if (EOL === yaml[index] || index === yaml.length) {
    return yaml.substr(0, index) + ' # ' + remark +
        yaml.substring(index);
  } else {
    while (index < yaml.length && (yaml[index] === '#' || yaml[index] === ' ')) {
      ++index;
    }
    let end = index;
    while (end < yaml.length && yaml[end] !== EOL) {
      ++end;
    }
    return yaml.substr(0, index) + remark +
        yaml.substring(end);
  }
}
function setNodeRemark ( ast , remark , yaml ) { let index = getNodeEndMark ( ast ) . pointer ; while ( index < yaml . length && yaml [ index ] !== '#' && yaml [ index ] !== EOL ) { ++ index ; } if ( EOL === yaml [ index ] || index === yaml . length ) { return yaml . substr ( 0 , index ) + ' # ' + remark + yaml . substring ( index ) ; } else { while ( index < yaml . length && ( yaml [ index ] === '#' || yaml [ index ] === ' ' ) ) { ++ index ; } let end = index ; while ( end < yaml . length && yaml [ end ] !== EOL ) { ++ end ; } return yaml . substr ( 0 , index ) + remark + yaml . substring ( end ) ; } }
/*
Sets remark of an AST

@param {Node} ast
@param {string} remark
@param {string} yaml

@returns {boolean}
/ * Sets remark of an AST