0410ca02b96655ac3c08452105cdad32.js 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ace.define("ace/mode/robot_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){'use strict';
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var RobotHighlightRules = function () {
  5. var builtinConstantsRegex = new RegExp(/\$\{CURDIR\}|\$\{TEMPDIR\}|\$\{EXECDIR\}|\$\{\/\}|\$\{\:\}|\$\{\\n\}|\$\{true\}|\$\{false\}|\$\{none\}|\$\{null\}|\$\{space(?:\s*\*\s+[0-9]+)?\}|\$\{empty\}|&\{empty\}|@\{empty\}|\$\{TEST NAME\}|@\{TEST[\s_]TAGS\}|\$\{TEST[\s_]DOCUMENTATION\}|\$\{TEST[\s_]STATUS\}|\$\{TEST[\s_]MESSAGE\}|\$\{PREV[\s_]TEST[\s_]NAME\}|\$\{PREV[\s_]TEST[\s_]STATUS\}|\$\{PREV[\s_]TEST[\s_]MESSAGE\}|\$\{SUITE[\s_]NAME\}|\$\{SUITE[\s_]SOURCE\}|\$\{SUITE[\s_]DOCUMENTATION\}|&\{SUITE[\s_]METADATA\}|\$\{SUITE[\s_]STATUS\}|\$\{SUITE[\s_]MESSAGE\}|\$\{KEYWORD[\s_]STATUS\}|\$\{KEYWORD[\s_]MESSAGE\}|\$\{LOG[\s_]LEVEL\}|\$\{OUTPUT[\s_]FILE\}|\$\{LOG[\s_]FILE\}|\$\{REPORT[\s_]FILE\}|\$\{DEBUG[\s_]FILE\}|\$\{OUTPUT[\s_]DIR\}/);
  6. this.$rules = {
  7. "start": [{
  8. token: "string.robot.header",
  9. regex: /^\*{3}\s+(?:settings?|metadata|(?:user )?keywords?|test ?cases?|tasks?|variables?)/,
  10. caseInsensitive: true,
  11. push: [{
  12. token: "string.robot.header",
  13. regex: /$/,
  14. next: "pop"
  15. }, {
  16. defaultToken: "string.robot.header"
  17. }],
  18. comment: "start of a table"
  19. }, {
  20. token: "comment.robot",
  21. regex: /(?:^|\s{2,}|\t|\|\s{1,})(?=[^\\])#/,
  22. push: [{
  23. token: "comment.robot",
  24. regex: /$/,
  25. next: "pop"
  26. }, {
  27. defaultToken: "comment.robot"
  28. }]
  29. }, {
  30. token: "comment",
  31. regex: /^\s*\[?Documentation\]?/,
  32. caseInsensitive: true,
  33. push: [{
  34. token: "comment",
  35. regex: /^(?!\s*\.\.\.)/,
  36. next: "pop"
  37. }, {
  38. defaultToken: "comment"
  39. }]
  40. }, {
  41. token: "storage.type.method.robot",
  42. regex: /\[(?:Arguments|Setup|Teardown|Precondition|Postcondition|Template|Return|Timeout)\]/,
  43. caseInsensitive: true,
  44. comment: "testcase settings"
  45. }, {
  46. token: "storage.type.method.robot",
  47. regex: /\[Tags\]/,
  48. caseInsensitive: true,
  49. push: [{
  50. token: "storage.type.method.robot",
  51. regex: /^(?!\s*\.\.\.)/,
  52. next: "pop"
  53. }, {
  54. token: "comment",
  55. regex: /^\s*\.\.\./
  56. }, {
  57. defaultToken: "storage.type.method.robot"
  58. }],
  59. comment: "test tags"
  60. }, {
  61. token: "constant.language",
  62. regex: builtinConstantsRegex,
  63. caseInsensitive: true
  64. }, {
  65. token: "entity.name.variable.wrapper",
  66. regex: /[$@&%]\{\{?/,
  67. push: [{
  68. token: "entity.name.variable.wrapper",
  69. regex: /\}\}?(\s?=)?/,
  70. next: "pop"
  71. }, {
  72. include: "$self"
  73. }, {
  74. token: "entity.name.variable",
  75. regex: /./
  76. }, {
  77. defaultToken: "entity.name.variable"
  78. }]
  79. }, {
  80. token: "keyword.control.robot",
  81. regex: /^[^\s\t*$|]+|(?=^\|)\s+[^\s\t*$|]+/,
  82. push: [{
  83. token: "keyword.control.robot",
  84. regex: /(?=\s{2})|\t|$|\s+(?=\|)/,
  85. next: "pop"
  86. }, {
  87. defaultToken: "keyword.control.robot"
  88. }]
  89. }, {
  90. token: "constant.numeric.robot",
  91. regex: /\b[0-9]+(?:\.[0-9]+)?\b/
  92. }, {
  93. token: "keyword",
  94. regex: /\s{2,}(for|in range|in|end|else if|if|else|with name)(\s{2,}|$)/,
  95. caseInsensitive: true
  96. }, {
  97. token: "storage.type.function",
  98. regex: /^(?:\s{2,}\s+)[^ \t*$@&%[.|]+/,
  99. push: [{
  100. token: "storage.type.function",
  101. regex: /(?=\s{2})|\t|$|\s+(?=\|)/,
  102. next: "pop"
  103. }, {
  104. defaultToken: "storage.type.function"
  105. }]
  106. }]
  107. };
  108. this.normalizeRules();
  109. };
  110. RobotHighlightRules.metadata = {
  111. fileTypes: ['robot'],
  112. name: 'Robot',
  113. scopeName: 'source.robot'
  114. };
  115. oop.inherits(RobotHighlightRules, TextHighlightRules);
  116. exports.RobotHighlightRules = RobotHighlightRules;
  117. });
  118. ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  119. var oop = require("../../lib/oop");
  120. var BaseFoldMode = require("./fold_mode").FoldMode;
  121. var FoldMode = exports.FoldMode = function (markers) {
  122. this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
  123. };
  124. oop.inherits(FoldMode, BaseFoldMode);
  125. (function () {
  126. this.getFoldWidgetRange = function (session, foldStyle, row) {
  127. var line = session.getLine(row);
  128. var match = line.match(this.foldingStartMarker);
  129. if (match) {
  130. if (match[1])
  131. return this.openingBracketBlock(session, match[1], row, match.index);
  132. if (match[2])
  133. return this.indentationBlock(session, row, match.index + match[2].length);
  134. return this.indentationBlock(session, row);
  135. }
  136. };
  137. }).call(FoldMode.prototype);
  138. });
  139. ace.define("ace/mode/robot",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/robot_highlight_rules","ace/mode/folding/pythonic"], function(require, exports, module){"use strict";
  140. var oop = require("../lib/oop");
  141. var TextMode = require("./text").Mode;
  142. var RobotHighlightRules = require("./robot_highlight_rules").RobotHighlightRules;
  143. var FoldMode = require("./folding/pythonic").FoldMode;
  144. var Mode = function () {
  145. this.HighlightRules = RobotHighlightRules;
  146. this.foldingRules = new FoldMode();
  147. this.$behaviour = this.$defaultBehaviour;
  148. };
  149. oop.inherits(Mode, TextMode);
  150. (function () {
  151. this.lineCommentStart = "#";
  152. this.$id = "ace/mode/robot";
  153. this.snippetFileId = "ace/snippets/robot";
  154. }).call(Mode.prototype);
  155. exports.Mode = Mode;
  156. }); (function() {
  157. ace.require(["ace/mode/robot"], function(m) {
  158. if (typeof module == "object" && typeof exports == "object" && module) {
  159. module.exports = m;
  160. }
  161. });
  162. })();