Team Ai
Datasetpublic

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.

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes3.1kdownloads
index.js202 linesDownload Raw Back to compiler
1/** @import { LegacyRoot } from './types/legacy-nodes.js' */2/** @import { CompileOptions, CompileResult, ValidatedCompileOptions, ModuleCompileOptions } from '#compiler' */3/** @import { AST } from './public.js' */4import { walk as zimmerframe_walk } from 'zimmerframe';5import { convert } from './legacy.js';6import { parse as _parse, Parser } from './phases/1-parse/index.js';7import { remove_typescript_nodes } from './phases/1-parse/remove_typescript_nodes.js';8import { parse_stylesheet } from './phases/1-parse/read/style.js';9import { analyze_component, analyze_module } from './phases/2-analyze/index.js';10import { transform_component, transform_module } from './phases/3-transform/index.js';11import { validate_component_options, validate_module_options } from './validate-options.js';12import * as state from './state.js';13export { default as preprocess } from './preprocess/index.js';14export { print } from './print/index.js';15 16/**17 * `compile` converts your `.svelte` source code into a JavaScript module that exports a component18 *19 * @param {string} source The component source code20 * @param {CompileOptions} options The compiler options21 * @returns {CompileResult}22 */23export function compile(source, options) {24	source = remove_bom(source);25	state.reset({ warning: options.warningFilter, filename: options.filename });26 27	const validated = validate_component_options(options, '');28 29	let parsed = _parse(source);30 31	const { customElement: customElementOptions, ...parsed_options } = parsed.options || {};32 33	/** @type {ValidatedCompileOptions} */34	const combined_options = {35		...validated,36		...parsed_options,37		customElementOptions,38		css: 'css' in parsed_options ? () => parsed_options.css ?? 'external' : validated.css,39		runes: 'runes' in parsed_options ? () => parsed_options.runes : validated.runes40	};41 42	if (parsed.metadata.ts) {43		parsed = {44			...parsed,45			fragment: parsed.fragment && remove_typescript_nodes(parsed.fragment),46			instance: parsed.instance && remove_typescript_nodes(parsed.instance),47			module: parsed.module && remove_typescript_nodes(parsed.module)48		};49		if (combined_options.customElementOptions?.extend) {50			combined_options.customElementOptions.extend = remove_typescript_nodes(51				combined_options.customElementOptions?.extend52			);53		}54	}55 56	const analysis = analyze_component(parsed, source, combined_options);57	const result = transform_component(analysis, source, combined_options);58	result.ast = to_public_ast(source, parsed, options.modernAst);59	return result;60}61 62/**63 * `compileModule` takes your JavaScript source code containing runes, and turns it into a JavaScript module.64 *65 * @param {string} source The component source code66 * @param {ModuleCompileOptions} options67 * @returns {CompileResult}68 */69export function compileModule(source, options) {70	source = remove_bom(source);71	state.reset({ warning: options.warningFilter, filename: options.filename });72	const validated = validate_module_options(options, '');73 74	const analysis = analyze_module(source, validated);75	return transform_module(analysis, source, validated);76}77 78/**79 * The parse function parses a component, returning only its abstract syntax tree.80 *81 * The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.82 * `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.83 *84 * @overload85 * @param {string} source86 * @param {{ filename?: string; modern: true; loose?: boolean }} options87 * @returns {AST.Root}88 */89 90/**91 * The parse function parses a component, returning only its abstract syntax tree.92 *93 * The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.94 * `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.95 *96 * @overload97 * @param {string} source98 * @param {{ filename?: string; modern?: false; loose?: boolean }} [options]99 * @returns {Record<string, any>}100 */101 102// TODO 6.0 remove unused `filename`103/**104 * The parse function parses a component, returning only its abstract syntax tree.105 *106 * The `modern` option (`false` by default in Svelte 5) makes the parser return a modern AST instead of the legacy AST.107 * `modern` will become `true` by default in Svelte 6, and the option will be removed in Svelte 7.108 *109 * The `loose` option, available since 5.13.0, tries to always return an AST even if the input will not successfully compile.110 *111 * The `filename` option is unused and will be removed in Svelte 6.0.112 *113 * @param {string} source114 * @param {{ filename?: string; rootDir?: string; modern?: boolean; loose?: boolean }} [options]115 * @returns {AST.Root | LegacyRoot}116 */117export function parse(source, { modern, loose } = {}) {118	source = remove_bom(source);119	state.reset({ warning: () => false, filename: undefined });120 121	const ast = _parse(source, loose);122	return to_public_ast(source, ast, modern);123}124 125/**126 * The parseCss function parses a CSS stylesheet, returning its abstract syntax tree.127 *128 * @param {string} source The CSS source code129 * @returns {AST.CSS.StyleSheetFile}130 */131export function parseCss(source) {132	source = remove_bom(source);133	state.reset({ warning: () => false, filename: undefined });134 135	state.set_source(source);136 137	const parser = Parser.forCss(source);138	const children = parse_stylesheet(parser);139 140	return {141		type: 'StyleSheetFile',142		start: 0,143		end: source.length,144		children145	};146}147 148/**149 * @param {string} source150 * @param {AST.Root} ast151 * @param {boolean | undefined} modern152 */153function to_public_ast(source, ast, modern) {154	if (modern) {155		const clean = (/** @type {any} */ node) => {156			delete node.metadata;157		};158 159		ast.options?.attributes.forEach((attribute) => {160			clean(attribute);161			clean(attribute.value);162			if (Array.isArray(attribute.value)) {163				attribute.value.forEach(clean);164			}165		});166 167		// remove things that we don't want to treat as public API168		return zimmerframe_walk(ast, null, {169			_(node, { next }) {170				clean(node);171				next();172			}173		});174	}175 176	return convert(source, ast);177}178 179/**180 * Remove the byte order mark from a string if it's present since it would mess with our template generation logic181 * @param {string} source182 */183function remove_bom(source) {184	if (source.charCodeAt(0) === 0xfeff) {185		return source.slice(1);186	}187	return source;188}189 190/**191 * @deprecated Replace this with `import { walk } from 'estree-walker'`192 * @returns {never}193 */194export function walk() {195	throw new Error(196		`'svelte/compiler' no longer exports a \`walk\` utility — please import it directly from 'estree-walker' instead`197	);198}199 200export { VERSION } from '../version.js';201export { migrate } from './migrate/index.js';202 
Brunobkr/llama.cpp_AlgMor24_github · Team Ai