Brunobkr/llama.cpp_AlgMor24_github
ΩFFFΣLLIa • llama.cpp • AlgMor24 ██████╗ ███████╗███████╗███████╗██╗ ██╗ ██╗ █████╗ ██╔═══██╗██╔════╝██╔════╝██╔════╝██║ ██║ ██║██╔══██╗ ██║ ██║█████╗ █████╗ █████╗ ██║ ██║ ██║███████║ ██║ ██║██╔══╝ ██╔══╝ ██╔══╝ ██║ ██║ ██║██╔══██║ ╚██████╔╝██║ ██║ ███████╗███████╗███████╗██║██║ ██║ ╚═════╝ ╚═╝ ╚═╝ ╚══════╝╚══════╝╚══════╝╚═╝╚═╝ ╚═╝ High-Performance LLM / VLM Inference & Autonomous Agentic Ecosystem… See the full description on the dataset page: https://huggingface.co/datasets/Brunobkr/llama.cpp_AlgMor24_github.
03.1k
1/**2 * @fileoverview A collection of methods for processing Espree's options.3 * @author Kai Cataldo4 */5 6//------------------------------------------------------------------------------7// Helpers8//------------------------------------------------------------------------------9 10const SUPPORTED_VERSIONS = [11 3,12 5,13 6, // 201514 7, // 201615 8, // 201716 9, // 201817 10, // 201918 11, // 202019 12, // 202120 13, // 202221 14, // 202322 15, // 202423 16, // 202524 17 // 202625];26 27/**28 * Get the latest ECMAScript version supported by Espree.29 * @returns {number} The latest ECMAScript version.30 */31export function getLatestEcmaVersion() {32 return SUPPORTED_VERSIONS.at(-1);33}34 35/**36 * Get the list of ECMAScript versions supported by Espree.37 * @returns {number[]} An array containing the supported ECMAScript versions.38 */39export function getSupportedEcmaVersions() {40 return [...SUPPORTED_VERSIONS];41}42 43/**44 * Normalize ECMAScript version from the initial config45 * @param {(number|"latest")} ecmaVersion ECMAScript version from the initial config46 * @throws {Error} throws an error if the ecmaVersion is invalid.47 * @returns {number} normalized ECMAScript version48 */49function normalizeEcmaVersion(ecmaVersion = 5) {50 51 let version = ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;52 53 if (typeof version !== "number") {54 throw new Error(`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`);55 }56 57 // Calculate ECMAScript edition number from official year version starting with58 // ES2015, which corresponds with ES6 (or a difference of 2009).59 if (version >= 2015) {60 version -= 2009;61 }62 63 if (!SUPPORTED_VERSIONS.includes(version)) {64 throw new Error("Invalid ecmaVersion.");65 }66 67 return version;68}69 70/**71 * Normalize sourceType from the initial config72 * @param {string} sourceType to normalize73 * @throws {Error} throw an error if sourceType is invalid74 * @returns {string} normalized sourceType75 */76function normalizeSourceType(sourceType = "script") {77 if (sourceType === "script" || sourceType === "module") {78 return sourceType;79 }80 81 if (sourceType === "commonjs") {82 return "script";83 }84 85 throw new Error("Invalid sourceType.");86}87 88/**89 * Normalize parserOptions90 * @param {Object} options the parser options to normalize91 * @throws {Error} throw an error if found invalid option.92 * @returns {Object} normalized options93 */94export function normalizeOptions(options) {95 const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);96 const sourceType = normalizeSourceType(options.sourceType);97 const ranges = options.range === true;98 const locations = options.loc === true;99 100 if (ecmaVersion !== 3 && options.allowReserved) {101 102 // a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed103 throw new Error("`allowReserved` is only supported when ecmaVersion is 3");104 }105 if (typeof options.allowReserved !== "undefined" && typeof options.allowReserved !== "boolean") {106 throw new Error("`allowReserved`, when present, must be `true` or `false`");107 }108 const allowReserved = ecmaVersion === 3 ? (options.allowReserved || "never") : false;109 const ecmaFeatures = options.ecmaFeatures || {};110 const allowReturnOutsideFunction = options.sourceType === "commonjs" ||111 Boolean(ecmaFeatures.globalReturn);112 113 if (sourceType === "module" && ecmaVersion < 6) {114 throw new Error("sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.");115 }116 117 return Object.assign({}, options, {118 ecmaVersion,119 sourceType,120 ranges,121 locations,122 allowReserved,123 allowReturnOutsideFunction124 });125}126 