mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-29 03:45:15 +00:00
27 lines
490 B
JavaScript
27 lines
490 B
JavaScript
|
'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;
|