src/main/core.js/attachComments
function attachComments(text, ast, opts) {
  const astComments = ast.comments;
  if (astComments) {
    delete ast.comments;
    comments.attach(astComments, ast, text, opts);
  }
  ast.tokens = [];
  opts.originalText = opts.parser === "yaml" ? text : text.trimEnd();
  return astComments;
}