comment.js 472 B

123456789101112131415161718192021
  1. import { Command } from "./command";
  2. export class Comment extends Command {
  3. constructor (text, isInline = false, parentCommand = null) {
  4. super();
  5. this.type = "comment";
  6. this.comment_text = text;
  7. this.comment = text;
  8. this.value = text;
  9. this._text = text;
  10. this.isInline = isInline;
  11. this.parentCommand = parentCommand;
  12. }
  13. static isInlineComment (comment) {
  14. return comment && comment.isInline === true;
  15. }
  16. }