소스 검색

Upload new file 'comment.js' to solve problem to read 'ivph' file with comments (by Edilson Cuambe)

Upload new file 'comment.js' to solve problem to read 'ivph' file with comments (by Edilson Cuambe)
leo 1 주 전
부모
커밋
e32779ac11
1개의 변경된 파일21개의 추가작업 그리고 0개의 파일을 삭제
  1. 21 0
      js/ast/commands/comment.js

+ 21 - 0
js/ast/commands/comment.js

@@ -0,0 +1,21 @@
+import { Command } from "./command";
+
+export class Comment extends Command {
+  constructor (text, isInline = false, parentCommand = null) {
+    super();
+
+    this.type = "comment";
+    this.comment_text = text;
+    this.comment = text;
+    this.value = text;
+    this._text = text;
+
+    this.isInline = isInline;
+    this.parentCommand = parentCommand;
+  }
+
+  static isInlineComment (comment) {
+    return comment && comment.isInline === true;
+  }
+
+}