index.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Break } from './break';
  2. import { Return } from './return';
  3. import { Assign } from './assign';
  4. import { ArrayIndexAssign } from './arrayAssign';
  5. import { Declaration } from './declaration';
  6. import { ArrayDeclaration } from './arrayDeclaration';
  7. import { While } from './while';
  8. import { For } from './for';
  9. import { Function } from './function';
  10. import { IfThenElse } from './ifThenElse';
  11. import { CommandBlock } from './commandBlock';
  12. import { RepeatUntil } from './repeatUntil';
  13. import { Switch } from './switch';
  14. import { Case } from './case';
  15. import { SysCall } from './sysCall';
  16. import { FormalParameter } from './formalParameter';
  17. import { FunctionCall } from './../expressions/functionCall'; //Proxy to expression since they do exatcly the same thing
  18. import { Command } from './command';
  19. export {
  20. Break,
  21. Return,
  22. Assign,
  23. ArrayIndexAssign,
  24. Declaration,
  25. ArrayDeclaration,
  26. While,
  27. For,
  28. Function,
  29. IfThenElse,
  30. CommandBlock,
  31. RepeatUntil,
  32. Switch,
  33. Case,
  34. SysCall,
  35. FormalParameter,
  36. FunctionCall
  37. };
  38. export class Comment extends Command {
  39. constructor (text, isInline = false, parentCommand = null) {
  40. super();
  41. this.type = "comment";
  42. this.comment_text = text;
  43. this.comment = text;
  44. this.value = text;
  45. this._text = text;
  46. this.isInline = isInline;
  47. this.parentCommand = parentCommand;
  48. }
  49. static isInlineComment (comment) {
  50. return comment && comment.isInline === true;
  51. }
  52. };