c8fa7b978e3d1a3d8871518e9cb83968.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  1. ace.define("ace/mode/jssm_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ./jssm.tmLanguage (uuid: ) */
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var JSSMHighlightRules = function () {
  6. this.$rules = {
  7. start: [{
  8. token: "punctuation.definition.comment.mn",
  9. regex: /\/\*/,
  10. push: [{
  11. token: "punctuation.definition.comment.mn",
  12. regex: /\*\//,
  13. next: "pop"
  14. }, {
  15. defaultToken: "comment.block.jssm"
  16. }],
  17. comment: "block comment"
  18. }, {
  19. token: "comment.line.jssm",
  20. regex: /\/\//,
  21. push: [{
  22. token: "comment.line.jssm",
  23. regex: /$/,
  24. next: "pop"
  25. }, {
  26. defaultToken: "comment.line.jssm"
  27. }],
  28. comment: "block comment"
  29. }, {
  30. token: "entity.name.function",
  31. regex: /\${/,
  32. push: [{
  33. token: "entity.name.function",
  34. regex: /}/,
  35. next: "pop"
  36. }, {
  37. defaultToken: "keyword.other"
  38. }],
  39. comment: "js outcalls"
  40. }, {
  41. token: "constant.numeric",
  42. regex: /[0-9]*\.[0-9]*\.[0-9]*/,
  43. comment: "semver"
  44. }, {
  45. token: "constant.language.jssmLanguage",
  46. regex: /graph_layout\s*:/,
  47. comment: "jssm language tokens"
  48. }, {
  49. token: "constant.language.jssmLanguage",
  50. regex: /machine_name\s*:/,
  51. comment: "jssm language tokens"
  52. }, {
  53. token: "constant.language.jssmLanguage",
  54. regex: /machine_version\s*:/,
  55. comment: "jssm language tokens"
  56. }, {
  57. token: "constant.language.jssmLanguage",
  58. regex: /jssm_version\s*:/,
  59. comment: "jssm language tokens"
  60. }, {
  61. token: "keyword.control.transition.jssmArrow.legal_legal",
  62. regex: /<->/,
  63. comment: "transitions"
  64. }, {
  65. token: "keyword.control.transition.jssmArrow.legal_none",
  66. regex: /<-/,
  67. comment: "transitions"
  68. }, {
  69. token: "keyword.control.transition.jssmArrow.none_legal",
  70. regex: /->/,
  71. comment: "transitions"
  72. }, {
  73. token: "keyword.control.transition.jssmArrow.main_main",
  74. regex: /<=>/,
  75. comment: "transitions"
  76. }, {
  77. token: "keyword.control.transition.jssmArrow.none_main",
  78. regex: /=>/,
  79. comment: "transitions"
  80. }, {
  81. token: "keyword.control.transition.jssmArrow.main_none",
  82. regex: /<=/,
  83. comment: "transitions"
  84. }, {
  85. token: "keyword.control.transition.jssmArrow.forced_forced",
  86. regex: /<~>/,
  87. comment: "transitions"
  88. }, {
  89. token: "keyword.control.transition.jssmArrow.none_forced",
  90. regex: /~>/,
  91. comment: "transitions"
  92. }, {
  93. token: "keyword.control.transition.jssmArrow.forced_none",
  94. regex: /<~/,
  95. comment: "transitions"
  96. }, {
  97. token: "keyword.control.transition.jssmArrow.legal_main",
  98. regex: /<-=>/,
  99. comment: "transitions"
  100. }, {
  101. token: "keyword.control.transition.jssmArrow.main_legal",
  102. regex: /<=->/,
  103. comment: "transitions"
  104. }, {
  105. token: "keyword.control.transition.jssmArrow.legal_forced",
  106. regex: /<-~>/,
  107. comment: "transitions"
  108. }, {
  109. token: "keyword.control.transition.jssmArrow.forced_legal",
  110. regex: /<~->/,
  111. comment: "transitions"
  112. }, {
  113. token: "keyword.control.transition.jssmArrow.main_forced",
  114. regex: /<=~>/,
  115. comment: "transitions"
  116. }, {
  117. token: "keyword.control.transition.jssmArrow.forced_main",
  118. regex: /<~=>/,
  119. comment: "transitions"
  120. }, {
  121. token: "constant.numeric.jssmProbability",
  122. regex: /[0-9]+%/,
  123. comment: "edge probability annotation"
  124. }, {
  125. token: "constant.character.jssmAction",
  126. regex: /\'[^']*\'/,
  127. comment: "action annotation"
  128. }, {
  129. token: "entity.name.tag.jssmLabel.doublequoted",
  130. regex: /\"[^"]*\"/,
  131. comment: "jssm label annotation"
  132. }, {
  133. token: "entity.name.tag.jssmLabel.atom",
  134. regex: /[a-zA-Z0-9_.+&()#@!?,]/,
  135. comment: "jssm label annotation"
  136. }]
  137. };
  138. this.normalizeRules();
  139. };
  140. JSSMHighlightRules.metaData = {
  141. fileTypes: ["jssm", "jssm_state"],
  142. name: "JSSM",
  143. scopeName: "source.jssm"
  144. };
  145. oop.inherits(JSSMHighlightRules, TextHighlightRules);
  146. exports.JSSMHighlightRules = JSSMHighlightRules;
  147. });
  148. 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";
  149. var oop = require("../../lib/oop");
  150. var Range = require("../../range").Range;
  151. var BaseFoldMode = require("./fold_mode").FoldMode;
  152. var FoldMode = exports.FoldMode = function (commentRegex) {
  153. if (commentRegex) {
  154. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  155. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  156. }
  157. };
  158. oop.inherits(FoldMode, BaseFoldMode);
  159. (function () {
  160. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  161. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  162. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  163. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  164. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  165. this._getFoldWidgetBase = this.getFoldWidget;
  166. this.getFoldWidget = function (session, foldStyle, row) {
  167. var line = session.getLine(row);
  168. if (this.singleLineBlockCommentRe.test(line)) {
  169. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  170. return "";
  171. }
  172. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  173. if (!fw && this.startRegionRe.test(line))
  174. return "start"; // lineCommentRegionStart
  175. return fw;
  176. };
  177. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  178. var line = session.getLine(row);
  179. if (this.startRegionRe.test(line))
  180. return this.getCommentRegionBlock(session, line, row);
  181. var match = line.match(this.foldingStartMarker);
  182. if (match) {
  183. var i = match.index;
  184. if (match[1])
  185. return this.openingBracketBlock(session, match[1], row, i);
  186. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  187. if (range && !range.isMultiLine()) {
  188. if (forceMultiline) {
  189. range = this.getSectionRange(session, row);
  190. }
  191. else if (foldStyle != "all")
  192. range = null;
  193. }
  194. return range;
  195. }
  196. if (foldStyle === "markbegin")
  197. return;
  198. var match = line.match(this.foldingStopMarker);
  199. if (match) {
  200. var i = match.index + match[0].length;
  201. if (match[1])
  202. return this.closingBracketBlock(session, match[1], row, i);
  203. return session.getCommentFoldRange(row, i, -1);
  204. }
  205. };
  206. this.getSectionRange = function (session, row) {
  207. var line = session.getLine(row);
  208. var startIndent = line.search(/\S/);
  209. var startRow = row;
  210. var startColumn = line.length;
  211. row = row + 1;
  212. var endRow = row;
  213. var maxRow = session.getLength();
  214. while (++row < maxRow) {
  215. line = session.getLine(row);
  216. var indent = line.search(/\S/);
  217. if (indent === -1)
  218. continue;
  219. if (startIndent > indent)
  220. break;
  221. var subRange = this.getFoldWidgetRange(session, "all", row);
  222. if (subRange) {
  223. if (subRange.start.row <= startRow) {
  224. break;
  225. }
  226. else if (subRange.isMultiLine()) {
  227. row = subRange.end.row;
  228. }
  229. else if (startIndent == indent) {
  230. break;
  231. }
  232. }
  233. endRow = row;
  234. }
  235. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  236. };
  237. this.getCommentRegionBlock = function (session, line, row) {
  238. var startColumn = line.search(/\s*$/);
  239. var maxRow = session.getLength();
  240. var startRow = row;
  241. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  242. var depth = 1;
  243. while (++row < maxRow) {
  244. line = session.getLine(row);
  245. var m = re.exec(line);
  246. if (!m)
  247. continue;
  248. if (m[1])
  249. depth--;
  250. else
  251. depth++;
  252. if (!depth)
  253. break;
  254. }
  255. var endRow = row;
  256. if (endRow > startRow) {
  257. return new Range(startRow, startColumn, endRow, line.length);
  258. }
  259. };
  260. }).call(FoldMode.prototype);
  261. });
  262. ace.define("ace/mode/jssm",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jssm_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
  263. THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
  264. */
  265. "use strict";
  266. var oop = require("../lib/oop");
  267. var TextMode = require("./text").Mode;
  268. var JSSMHighlightRules = require("./jssm_highlight_rules").JSSMHighlightRules;
  269. var FoldMode = require("./folding/cstyle").FoldMode;
  270. var Mode = function () {
  271. this.HighlightRules = JSSMHighlightRules;
  272. this.foldingRules = new FoldMode();
  273. };
  274. oop.inherits(Mode, TextMode);
  275. (function () {
  276. this.lineCommentStart = "//";
  277. this.blockComment = { start: "/*", end: "*/" };
  278. this.$id = "ace/mode/jssm";
  279. }).call(Mode.prototype);
  280. exports.Mode = Mode;
  281. }); (function() {
  282. ace.require(["ace/mode/jssm"], function(m) {
  283. if (typeof module == "object" && typeof exports == "object" && module) {
  284. module.exports = m;
  285. }
  286. });
  287. })();