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.
26 lines
490 B
26 lines
490 B
'use strict';
|
|
|
|
const Container = require('./container');
|
|
const Node = require('./node');
|
|
|
|
class Comment extends Node {
|
|
constructor (opts) {
|
|
super(opts);
|
|
this.type = 'comment';
|
|
this.inline = Object(opts).inline || false;
|
|
}
|
|
|
|
toString () {
|
|
return [
|
|
this.raws.before,
|
|
this.inline ? '//' : '/*',
|
|
String(this.value),
|
|
this.inline ? '' : '*/',
|
|
this.raws.after
|
|
].join('');
|
|
}
|
|
};
|
|
|
|
Container.registerWalker(Comment);
|
|
|
|
module.exports = Comment;
|