mirror of https://github.com/sveltejs/svelte
create_fragment and disallow_children live in nodes.js, fuzzymatch in utils; no parse imports from analyze
parent
652da2c81b
commit
03ee8b51bf
@ -1,16 +0,0 @@
|
||||
/** @import { AST } from '#compiler' */
|
||||
|
||||
/**
|
||||
* @param {any} transparent
|
||||
* @returns {AST.Fragment}
|
||||
*/
|
||||
export function create_fragment(transparent = false) {
|
||||
return {
|
||||
type: 'Fragment',
|
||||
nodes: [],
|
||||
metadata: {
|
||||
transparent,
|
||||
dynamic: false
|
||||
}
|
||||
};
|
||||
}
|
||||
@ -1,16 +0,0 @@
|
||||
/** @import { AST } from '#compiler' */
|
||||
import * as e from '../../../../errors.js';
|
||||
|
||||
/**
|
||||
* @param {AST.SvelteBody | AST.SvelteDocument | AST.SvelteOptionsRaw | AST.SvelteWindow} node
|
||||
*/
|
||||
export function disallow_children(node) {
|
||||
const { nodes } = node.fragment;
|
||||
|
||||
if (nodes.length > 0) {
|
||||
const first = nodes[0];
|
||||
const last = nodes[nodes.length - 1];
|
||||
|
||||
e.svelte_meta_invalid_content({ start: first.start, end: last.end }, node.name);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue