Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
comment(token) {
if (token[6] === 'inline') {
let node = new Comment();
this.init(node, token[2], token[3]);
node.raws.inline = true;
node.source.end = {line: token[4], column: token[5]};
let text = token[1].slice(2);
if (/^\s*$/.test(text)) {
node.text = '';
node.raws.left = text;
node.raws.right = '';
}
else {
let match = text.match(/^(\s*)([^]*[^\s])(\s*)$/);
node.text = match[2];
node.raws.left = match[1];
node.raws.right = match[3];
}
comment (part) {
let token = part.tokens[0]
let node = new Comment()
this.init(node, part)
node.source.end = { line: token[4], column: token[5] }
this.commentText(node, token)
}
comment (token) {
const node = new Comment();
const content = token[1];
const text = content.slice(2).replace(blockCommentEndPattern, '');
this.init(node, token[2], token[3]);
node.source.end = {
line: token[4],
column: token[5]
};
node.raws.content = content;
node.raws.begin = content[0] + content[1];
node.inline = token[6] === 'inline';
node.block = !node.inline;
if (/^\s*$/.test(text)) {
node.text = '';
node.prop = prop
let next = this.parts[this.pos + 1]
while (!next.end && !next.atrule && !next.colon &&
next.indent.length > part.indent.length) {
value.push(['space', next.before + next.indent])
value = value.concat(next.tokens)
this.pos += 1
next = this.parts[this.pos + 1]
}
let last = value[value.length - 1]
if (last && last[0] === 'comment') {
value.pop()
let comment = new Comment()
this.current.push(comment)
comment.source = {
input: this.input,
start: { line: last[2], column: last[3] },
end: { line: last[4], column: last[5] }
}
let prev = value[value.length - 1]
if (prev && prev[0] === 'space') {
value.pop()
comment.raws.before = prev[1]
}
this.commentText(comment, last)
}
for (let i = value.length - 1; i > 0; i--) {
let t = value[i][0]