12738aa8461e4775d7f380a5d1953893.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. ace.define("ace/mode/alda_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/* This file was autogenerated from ../../src/alda.JSON-tmLanguage (uuid: ) */
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var AldaHighlightRules = function () {
  6. this.$rules = {
  7. pitch: [{
  8. token: "variable.parameter.operator.pitch.alda",
  9. regex: /(?:[+\-]+|\=)/
  10. }, {
  11. token: "",
  12. regex: "",
  13. next: "timing"
  14. }],
  15. timing: [{
  16. token: "string.quoted.operator.timing.alda",
  17. regex: /\d+(?:s|ms)?/
  18. }, {
  19. token: "",
  20. regex: "",
  21. next: "start"
  22. }],
  23. start: [{
  24. token: [
  25. "constant.language.instrument.alda",
  26. "constant.language.instrument.alda",
  27. "meta.part.call.alda",
  28. "storage.type.nickname.alda",
  29. "meta.part.call.alda"
  30. ],
  31. regex: /^([a-zA-Z]{2}[\w\-+\'()]*)((?:\s*\/\s*[a-zA-Z]{2}[\w\-+\'()]*)*)(?:(\s*)(\"[a-zA-Z]{2}[\w\-+\'()]*\"))?(\s*:)/
  32. }, {
  33. token: [
  34. "text",
  35. "entity.other.inherited-class.voice.alda",
  36. "text"
  37. ],
  38. regex: /^(\s*)(V\d+)(:)/
  39. }, {
  40. token: "comment.line.number-sign.alda",
  41. regex: /#.*$/
  42. }, {
  43. token: "entity.name.function.pipe.measure.alda",
  44. regex: /\|/
  45. }, {
  46. token: "comment.block.inline.alda",
  47. regex: /\(comment\b/,
  48. push: [{
  49. token: "comment.block.inline.alda",
  50. regex: /\)/,
  51. next: "pop"
  52. }, {
  53. defaultToken: "comment.block.inline.alda"
  54. }]
  55. }, {
  56. token: "entity.name.function.marker.alda",
  57. regex: /%[a-zA-Z]{2}[\w\-+\'()]*/
  58. }, {
  59. token: "entity.name.function.at-marker.alda",
  60. regex: /@[a-zA-Z]{2}[\w\-+\'()]*/
  61. }, {
  62. token: "keyword.operator.octave-change.alda",
  63. regex: /\bo\d+\b/
  64. }, {
  65. token: "keyword.operator.octave-shift.alda",
  66. regex: /[><]/
  67. }, {
  68. token: "keyword.operator.repeat.alda",
  69. regex: /\*\s*\d+/
  70. }, {
  71. token: "string.quoted.operator.timing.alda",
  72. regex: /[.]|r\d*(?:s|ms)?/
  73. }, {
  74. token: "text",
  75. regex: /([cdefgab])/,
  76. next: "pitch"
  77. }, {
  78. token: "string.quoted.operator.timing.alda",
  79. regex: /~/,
  80. next: "timing"
  81. }, {
  82. token: "punctuation.section.embedded.cram.alda",
  83. regex: /\}/,
  84. next: "timing"
  85. }, {
  86. token: "constant.numeric.subchord.alda",
  87. regex: /\//
  88. }, {
  89. todo: {
  90. token: "punctuation.section.embedded.cram.alda",
  91. regex: /\{/,
  92. push: [{
  93. token: "punctuation.section.embedded.cram.alda",
  94. regex: /\}/,
  95. next: "pop"
  96. }, {
  97. include: "$self"
  98. }]
  99. }
  100. }, {
  101. todo: {
  102. token: "keyword.control.sequence.alda",
  103. regex: /\[/,
  104. push: [{
  105. token: "keyword.control.sequence.alda",
  106. regex: /\]/,
  107. next: "pop"
  108. }, {
  109. include: "$self"
  110. }]
  111. }
  112. }, {
  113. token: "meta.inline.clojure.alda",
  114. regex: /\(/,
  115. push: [{
  116. token: "meta.inline.clojure.alda",
  117. regex: /\)/,
  118. next: "pop"
  119. }, {
  120. include: "source.clojure"
  121. }, {
  122. defaultToken: "meta.inline.clojure.alda"
  123. }]
  124. }]
  125. };
  126. this.normalizeRules();
  127. };
  128. AldaHighlightRules.metaData = {
  129. scopeName: "source.alda",
  130. fileTypes: ["alda"],
  131. name: "Alda"
  132. };
  133. oop.inherits(AldaHighlightRules, TextHighlightRules);
  134. exports.AldaHighlightRules = AldaHighlightRules;
  135. });
  136. 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";
  137. var oop = require("../../lib/oop");
  138. var Range = require("../../range").Range;
  139. var BaseFoldMode = require("./fold_mode").FoldMode;
  140. var FoldMode = exports.FoldMode = function (commentRegex) {
  141. if (commentRegex) {
  142. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  143. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  144. }
  145. };
  146. oop.inherits(FoldMode, BaseFoldMode);
  147. (function () {
  148. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  149. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  150. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  151. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  152. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  153. this._getFoldWidgetBase = this.getFoldWidget;
  154. this.getFoldWidget = function (session, foldStyle, row) {
  155. var line = session.getLine(row);
  156. if (this.singleLineBlockCommentRe.test(line)) {
  157. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  158. return "";
  159. }
  160. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  161. if (!fw && this.startRegionRe.test(line))
  162. return "start"; // lineCommentRegionStart
  163. return fw;
  164. };
  165. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  166. var line = session.getLine(row);
  167. if (this.startRegionRe.test(line))
  168. return this.getCommentRegionBlock(session, line, row);
  169. var match = line.match(this.foldingStartMarker);
  170. if (match) {
  171. var i = match.index;
  172. if (match[1])
  173. return this.openingBracketBlock(session, match[1], row, i);
  174. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  175. if (range && !range.isMultiLine()) {
  176. if (forceMultiline) {
  177. range = this.getSectionRange(session, row);
  178. }
  179. else if (foldStyle != "all")
  180. range = null;
  181. }
  182. return range;
  183. }
  184. if (foldStyle === "markbegin")
  185. return;
  186. var match = line.match(this.foldingStopMarker);
  187. if (match) {
  188. var i = match.index + match[0].length;
  189. if (match[1])
  190. return this.closingBracketBlock(session, match[1], row, i);
  191. return session.getCommentFoldRange(row, i, -1);
  192. }
  193. };
  194. this.getSectionRange = function (session, row) {
  195. var line = session.getLine(row);
  196. var startIndent = line.search(/\S/);
  197. var startRow = row;
  198. var startColumn = line.length;
  199. row = row + 1;
  200. var endRow = row;
  201. var maxRow = session.getLength();
  202. while (++row < maxRow) {
  203. line = session.getLine(row);
  204. var indent = line.search(/\S/);
  205. if (indent === -1)
  206. continue;
  207. if (startIndent > indent)
  208. break;
  209. var subRange = this.getFoldWidgetRange(session, "all", row);
  210. if (subRange) {
  211. if (subRange.start.row <= startRow) {
  212. break;
  213. }
  214. else if (subRange.isMultiLine()) {
  215. row = subRange.end.row;
  216. }
  217. else if (startIndent == indent) {
  218. break;
  219. }
  220. }
  221. endRow = row;
  222. }
  223. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  224. };
  225. this.getCommentRegionBlock = function (session, line, row) {
  226. var startColumn = line.search(/\s*$/);
  227. var maxRow = session.getLength();
  228. var startRow = row;
  229. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  230. var depth = 1;
  231. while (++row < maxRow) {
  232. line = session.getLine(row);
  233. var m = re.exec(line);
  234. if (!m)
  235. continue;
  236. if (m[1])
  237. depth--;
  238. else
  239. depth++;
  240. if (!depth)
  241. break;
  242. }
  243. var endRow = row;
  244. if (endRow > startRow) {
  245. return new Range(startRow, startColumn, endRow, line.length);
  246. }
  247. };
  248. }).call(FoldMode.prototype);
  249. });
  250. ace.define("ace/mode/alda",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/alda_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module){/*
  251. THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
  252. */
  253. "use strict";
  254. var oop = require("../lib/oop");
  255. var TextMode = require("./text").Mode;
  256. var AldaHighlightRules = require("./alda_highlight_rules").AldaHighlightRules;
  257. var FoldMode = require("./folding/cstyle").FoldMode;
  258. var Mode = function () {
  259. this.HighlightRules = AldaHighlightRules;
  260. this.foldingRules = new FoldMode();
  261. };
  262. oop.inherits(Mode, TextMode);
  263. (function () {
  264. this.$id = "ace/mode/alda";
  265. }).call(Mode.prototype);
  266. exports.Mode = Mode;
  267. }); (function() {
  268. ace.require(["ace/mode/alda"], function(m) {
  269. if (typeof module == "object" && typeof exports == "object" && module) {
  270. module.exports = m;
  271. }
  272. });
  273. })();