src/language-js/parse/acorn.js/parseWithOptions
function parseWithOptions(text, sourceType) {
  const parser = getParser();

  const comments = [];
  const tokens = [];

  /** @type {any} */
  const ast = parser.parse(text, {
    ...parseOptions,
    sourceType,
    onComment: comments,
    onToken: tokens,
  });
  ast.comments = comments;
  ast.tokens = tokens;

  return ast;
}