function tokenize(code, options) {
    const Parser = parsers.get(options);

    // Ensure to collect tokens.
    if (!options || options.tokens !== true) {
        options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
    }

    return new Parser(options, code).tokenize();
}
Tokenizes the given code.
@param {string} code The code to tokenize.
@param {Object} options Options defining how to tokenize.
@returns {Token[]} An array of tokens.
@throws {SyntaxError} If the input code is invalid.
@private