function convertAcornCommentToEsprimaComment(block, text, start, end, startLoc, endLoc, code) {
    let type;

    if (block) {
        type = "Block";
    } else if (code.slice(start, start + 2) === "#!") {
        type = "Hashbang";
    } else {
        type = "Line";
    }

    const comment = {
        type,
        value: text
    };

    if (typeof start === "number") {
        comment.start = start;
        comment.end = end;
        comment.range = [start, end];
    }

    if (typeof startLoc === "object") {
        comment.loc = {
            start: startLoc,
            end: endLoc
        };
    }

    return comment;
}
Converts an Acorn comment to a Esprima comment.
@param {boolean} block True if it's a block comment, false if not.
@param {string} text The text of the comment.
@param {int} start The index at which the comment starts.
@param {int} end The index at which the comment ends.
@param {Location} startLoc The location at which the comment starts.
@param {Location} endLoc The location at which the comment ends.
@param {string} code The source code being parsed.
@returns {Object} The comment object.
@private