cfbb8ac8b034c4ecdb1d74d5a0aa997e.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. ace.define("ace/mode/io_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from tm bundles\io.tmbundle/Syntaxes/io.plist (uuid: ) */
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var IoHighlightRules = function () {
  6. this.$rules = { start: [{ token: 'keyword.control.io',
  7. regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' },
  8. { token: 'punctuation.definition.comment.io',
  9. regex: '/\\*',
  10. push: [{ token: 'punctuation.definition.comment.io',
  11. regex: '\\*/',
  12. next: 'pop' },
  13. { defaultToken: 'comment.block.io' }] },
  14. { token: 'punctuation.definition.comment.io',
  15. regex: '//',
  16. push: [{ token: 'comment.line.double-slash.io',
  17. regex: '$',
  18. next: 'pop' },
  19. { defaultToken: 'comment.line.double-slash.io' }] },
  20. { token: 'punctuation.definition.comment.io',
  21. regex: '#',
  22. push: [{ token: 'comment.line.number-sign.io', regex: '$', next: 'pop' },
  23. { defaultToken: 'comment.line.number-sign.io' }] },
  24. { token: 'variable.language.io',
  25. regex: '\\b(?:self|sender|target|proto|protos|parent)\\b',
  26. comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' },
  27. { token: 'keyword.operator.io',
  28. regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' },
  29. { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' },
  30. { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' },
  31. { token: 'support.function.io',
  32. regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' },
  33. { token: 'support.function.open-gl.io',
  34. regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' },
  35. { token: 'punctuation.definition.string.begin.io',
  36. regex: '"""',
  37. push: [{ token: 'punctuation.definition.string.end.io',
  38. regex: '"""',
  39. next: 'pop' },
  40. { token: 'constant.character.escape.io', regex: '\\\\.' },
  41. { defaultToken: 'string.quoted.triple.io' }] },
  42. { token: 'punctuation.definition.string.begin.io',
  43. regex: '"',
  44. push: [{ token: 'punctuation.definition.string.end.io',
  45. regex: '"',
  46. next: 'pop' },
  47. { token: 'constant.character.escape.io', regex: '\\\\.' },
  48. { defaultToken: 'string.quoted.double.io' }] },
  49. { token: 'constant.numeric.io',
  50. regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' },
  51. { token: 'variable.other.global.io', regex: 'Lobby\\b' },
  52. { token: 'constant.language.io',
  53. regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' }] };
  54. this.normalizeRules();
  55. };
  56. IoHighlightRules.metaData = { fileTypes: ['io'],
  57. keyEquivalent: '^~I',
  58. name: 'Io',
  59. scopeName: 'source.io' };
  60. oop.inherits(IoHighlightRules, TextHighlightRules);
  61. exports.IoHighlightRules = IoHighlightRules;
  62. });
  63. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  64. var oop = require("../../lib/oop");
  65. var Range = require("../../range").Range;
  66. var BaseFoldMode = require("./fold_mode").FoldMode;
  67. var FoldMode = exports.FoldMode = function (commentRegex) {
  68. if (commentRegex) {
  69. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  70. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  71. }
  72. };
  73. oop.inherits(FoldMode, BaseFoldMode);
  74. (function () {
  75. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  76. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  77. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  78. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  79. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  80. this._getFoldWidgetBase = this.getFoldWidget;
  81. this.getFoldWidget = function (session, foldStyle, row) {
  82. var line = session.getLine(row);
  83. if (this.singleLineBlockCommentRe.test(line)) {
  84. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  85. return "";
  86. }
  87. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  88. if (!fw && this.startRegionRe.test(line))
  89. return "start"; // lineCommentRegionStart
  90. return fw;
  91. };
  92. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  93. var line = session.getLine(row);
  94. if (this.startRegionRe.test(line))
  95. return this.getCommentRegionBlock(session, line, row);
  96. var match = line.match(this.foldingStartMarker);
  97. if (match) {
  98. var i = match.index;
  99. if (match[1])
  100. return this.openingBracketBlock(session, match[1], row, i);
  101. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  102. if (range && !range.isMultiLine()) {
  103. if (forceMultiline) {
  104. range = this.getSectionRange(session, row);
  105. }
  106. else if (foldStyle != "all")
  107. range = null;
  108. }
  109. return range;
  110. }
  111. if (foldStyle === "markbegin")
  112. return;
  113. var match = line.match(this.foldingStopMarker);
  114. if (match) {
  115. var i = match.index + match[0].length;
  116. if (match[1])
  117. return this.closingBracketBlock(session, match[1], row, i);
  118. return session.getCommentFoldRange(row, i, -1);
  119. }
  120. };
  121. this.getSectionRange = function (session, row) {
  122. var line = session.getLine(row);
  123. var startIndent = line.search(/\S/);
  124. var startRow = row;
  125. var startColumn = line.length;
  126. row = row + 1;
  127. var endRow = row;
  128. var maxRow = session.getLength();
  129. while (++row < maxRow) {
  130. line = session.getLine(row);
  131. var indent = line.search(/\S/);
  132. if (indent === -1)
  133. continue;
  134. if (startIndent > indent)
  135. break;
  136. var subRange = this.getFoldWidgetRange(session, "all", row);
  137. if (subRange) {
  138. if (subRange.start.row <= startRow) {
  139. break;
  140. }
  141. else if (subRange.isMultiLine()) {
  142. row = subRange.end.row;
  143. }
  144. else if (startIndent == indent) {
  145. break;
  146. }
  147. }
  148. endRow = row;
  149. }
  150. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  151. };
  152. this.getCommentRegionBlock = function (session, line, row) {
  153. var startColumn = line.search(/\s*$/);
  154. var maxRow = session.getLength();
  155. var startRow = row;
  156. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  157. var depth = 1;
  158. while (++row < maxRow) {
  159. line = session.getLine(row);
  160. var m = re.exec(line);
  161. if (!m)
  162. continue;
  163. if (m[1])
  164. depth--;
  165. else
  166. depth++;
  167. if (!depth)
  168. break;
  169. }
  170. var endRow = row;
  171. if (endRow > startRow) {
  172. return new Range(startRow, startColumn, endRow, line.length);
  173. }
  174. };
  175. }).call(FoldMode.prototype);
  176. });
  177. ace.define("ace/mode/io",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/io_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
  178. THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
  179. */
  180. "use strict";
  181. var oop = require("../lib/oop");
  182. var TextMode = require("./text").Mode;
  183. var IoHighlightRules = require("./io_highlight_rules").IoHighlightRules;
  184. var FoldMode = require("./folding/cstyle").FoldMode;
  185. var Mode = function () {
  186. this.HighlightRules = IoHighlightRules;
  187. this.foldingRules = new FoldMode();
  188. this.$behaviour = this.$defaultBehaviour;
  189. };
  190. oop.inherits(Mode, TextMode);
  191. (function () {
  192. this.lineCommentStart = "//";
  193. this.blockComment = { start: "/*", end: "*/" };
  194. this.$id = "ace/mode/io";
  195. this.snippetFileId = "ace/snippets/io";
  196. }).call(Mode.prototype);
  197. exports.Mode = Mode;
  198. }); (function() {
  199. ace.require(["ace/mode/io"], function(m) {
  200. if (typeof module == "object" && typeof exports == "object" && module) {
  201. module.exports = m;
  202. }
  203. });
  204. })();