You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/src/compiler/compile/nodes/Comment.ts

17 lines
437 B

import Node from './shared/Node';
const pattern = /^\s*svelte-ignore\s+([\s\S]+)\s*$/m;
export default class Comment extends Node {
type: 'Comment';
data: string;
ignores: string[];
constructor(component, parent, scope, info) {
super(component, parent, scope, info);
this.data = info.data;
const match = pattern.exec(this.data);
this.ignores = match ? match[1].split(/[^\S]/).map(x => x.trim()).filter(Boolean) : [];
}
}