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/** @import { Location } from 'locate-character' */2/** @import { CompileOptions } from './types' */3/** @import { AST, Warning } from '#compiler' */4import { getLocator } from 'locate-character';5import { sanitize_location } from '../utils.js';6 7/** @typedef {{ start?: number, end?: number }} NodeLike */8 9/** @type {Warning[]} */10export let warnings = [];11 12/**13 * The filename relative to the rootDir (if specified).14 * This should not be used in the compiler output except in dev mode15 * @type {string}16 */17export let filename;18 19/**20 * This is the fallback used when no filename is specified.21 */22export const UNKNOWN_FILENAME = '(unknown)';23 24/**25 * The name of the component that is used in the `export default function ...` statement.26 */27export let component_name = '<unknown>';28 29/**30 * The original source code31 * @type {string}32 */33export let source;34 35/**36 * The source code split into lines (set by `set_source`)37 * @type {string[]}38 */39export let source_lines = [];40 41/**42 * True if compiling with `dev: true`43 * @type {boolean}44 */45export let dev;46 47export let runes = false;48 49/** @type {(index: number) => Location} */50export let locator;51 52/** @param {string} value */53export function set_source(value) {54 source = value;55 source_lines = source.split('\n');56 57 const l = getLocator(source, { offsetLine: 1 });58 59 locator = (i) => {60 const loc = l(i);61 if (!loc) throw new Error('An impossible situation occurred');62 63 return loc;64 };65}66 67/**68 * @param {AST.SvelteNode & { start?: number | undefined }} node69 */70export function locate_node(node) {71 const loc = locator(/** @type {number} */ (node.start));72 return `${sanitize_location(filename)}:${loc?.line}:${loc.column}`;73}74 75/** @type {NonNullable<CompileOptions['warningFilter']>} */76export let warning_filter;77 78/**79 * The current stack of ignored warnings80 * @type {Set<string>[]}81 */82export let ignore_stack = [];83 84/**85 * For each node the list of warnings that should be ignored for that node.86 * Exists in addition to `ignore_stack` because not all warnings are emitted87 * while the stack is being built.88 * @type {Map<AST.SvelteNode | NodeLike, Set<string>[]>}89 */90export let ignore_map = new Map();91 92/**93 * Cached snapshot of the ignore_stack. Only re-created when the stack changes94 * (i.e. when push_ignore or pop_ignore is called), avoiding a structuredClone95 * on every node visit during analysis.96 * @type {Set<string>[] | null}97 */98let cached_ignore_snapshot = null;99 100/**101 * Returns a snapshot of the current ignore_stack, reusing a cached copy102 * when the stack hasn't changed since the last call.103 * @returns {Set<string>[]}104 */105export function get_ignore_snapshot() {106 if (cached_ignore_snapshot === null) {107 cached_ignore_snapshot = ignore_stack.map((s) => new Set(s));108 }109 return cached_ignore_snapshot;110}111 112/**113 * @param {string[]} ignores114 */115export function push_ignore(ignores) {116 const next = new Set([...(ignore_stack.at(-1) || []), ...ignores]);117 ignore_stack.push(next);118 cached_ignore_snapshot = null;119}120 121export function pop_ignore() {122 ignore_stack.pop();123 cached_ignore_snapshot = null;124}125 126/**127 * @param {AST.SvelteNode | NodeLike} node128 * @param {typeof import('../constants.js').IGNORABLE_RUNTIME_WARNINGS[number]} code129 * @returns130 */131export function is_ignored(node, code) {132 return dev && !!ignore_map.get(node)?.some((codes) => codes.has(code));133}134 135/**136 * Call this to reset the compiler state. Should be called before each compilation.137 * @param {{ warning?: (warning: Warning) => boolean; filename: string | undefined }} state138 */139export function reset(state) {140 dev = false;141 runes = false;142 component_name = UNKNOWN_FILENAME;143 source = '';144 source_lines = [];145 filename = (state.filename ?? UNKNOWN_FILENAME).replace(/\\/g, '/');146 warning_filter = state.warning ?? (() => true);147 warnings = [];148}149 150/**151 * Adjust the compiler state based on the provided state object.152 * Call this after parsing and basic analysis happened.153 * @param {{154 * dev: boolean;155 * component_name?: string;156 * rootDir?: string;157 * runes: boolean;158 * }} state159 */160export function adjust(state) {161 const root_dir = state.rootDir?.replace(/\\/g, '/');162 163 dev = state.dev;164 runes = state.runes;165 component_name = state.component_name ?? UNKNOWN_FILENAME;166 167 if (typeof root_dir === 'string' && filename.startsWith(root_dir)) {168 // make filename relative to rootDir169 filename = filename.replace(root_dir, '').replace(/^[/\\]/, '');170 }171 172 ignore_stack = [];173 ignore_map.clear();174 cached_ignore_snapshot = null;175}176 