mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
30 lines
773 B
JavaScript
30 lines
773 B
JavaScript
import Node from './node';
|
|
import getDebugInfo from './debug-info';
|
|
|
|
class Comment extends Node {
|
|
constructor(value, isLineComment, index, currentFileInfo) {
|
|
super();
|
|
|
|
this.value = value;
|
|
this.isLineComment = isLineComment;
|
|
this._index = index;
|
|
this._fileInfo = currentFileInfo;
|
|
this.allowRoot = true;
|
|
}
|
|
|
|
genCSS(context, output) {
|
|
if (this.debugInfo) {
|
|
output.add(getDebugInfo(context, this), this.fileInfo(), this.getIndex());
|
|
}
|
|
output.add(this.value);
|
|
}
|
|
|
|
isSilent(context) {
|
|
const isCompressed = context.compress && this.value[2] !== '!';
|
|
return this.isLineComment || isCompressed;
|
|
}
|
|
}
|
|
|
|
Comment.prototype.type = 'Comment';
|
|
export default Comment;
|