You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3734 lines
113 KiB

12 months ago
  1. ace.define("ace/mode/csound_preprocessor_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2. "use strict";
  3. var oop = acequire("../lib/oop");
  4. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  5. var CsoundPreprocessorHighlightRules = function() {
  6. this.semicolonComments = {
  7. token : "comment.line.semicolon.csound",
  8. regex : ";.*$"
  9. };
  10. this.comments = [
  11. {
  12. token : "punctuation.definition.comment.begin.csound",
  13. regex : "/\\*",
  14. push : [
  15. {
  16. token : "punctuation.definition.comment.end.csound",
  17. regex : "\\*/",
  18. next : "pop"
  19. }, {
  20. defaultToken: "comment.block.csound"
  21. }
  22. ]
  23. }, {
  24. token : "comment.line.double-slash.csound",
  25. regex : "//.*$"
  26. },
  27. this.semicolonComments
  28. ];
  29. this.macroUses = [
  30. {
  31. token : ["entity.name.function.preprocessor.csound", "punctuation.definition.macro-parameter-value-list.begin.csound"],
  32. regex : /(\$[A-Z_a-z]\w*\.?)(\()/,
  33. next : "macro parameter value list"
  34. }, {
  35. token : "entity.name.function.preprocessor.csound",
  36. regex : /\$[A-Z_a-z]\w*(?:\.|\b)/
  37. }
  38. ];
  39. this.numbers = [
  40. {
  41. token : "constant.numeric.float.csound",
  42. regex : /(?:\d+[Ee][+-]?\d+)|(?:\d+\.\d*|\d*\.\d+)(?:[Ee][+-]?\d+)?/
  43. }, {
  44. token : ["storage.type.number.csound", "constant.numeric.integer.hexadecimal.csound"],
  45. regex : /(0[Xx])([0-9A-Fa-f]+)/
  46. }, {
  47. token : "constant.numeric.integer.decimal.csound",
  48. regex : /\d+/
  49. }
  50. ];
  51. this.bracedStringContents = [
  52. {
  53. token : "constant.character.escape.csound",
  54. regex : /\\(?:[\\abnrt"]|[0-7]{1,3})/
  55. },
  56. {
  57. token : "constant.character.placeholder.csound",
  58. regex : /%[#0\- +]*\d*(?:\.\d+)?[diuoxXfFeEgGaAcs]/
  59. }, {
  60. token : "constant.character.escape.csound",
  61. regex : /%%/
  62. }
  63. ];
  64. this.quotedStringContents = [
  65. this.macroUses,
  66. this.bracedStringContents
  67. ];
  68. var start = [
  69. this.comments,
  70. {
  71. token : "keyword.preprocessor.csound",
  72. regex : /#(?:e(?:nd(?:if)?|lse)\b|##)|@@?[ \t]*\d+/
  73. }, {
  74. token : "keyword.preprocessor.csound",
  75. regex : /#include/,
  76. push : [
  77. this.comments,
  78. {
  79. token : "string.csound",
  80. regex : /([^ \t])(?:.*?\1)/,
  81. next : "pop"
  82. }
  83. ]
  84. }, {
  85. token : "keyword.preprocessor.csound",
  86. regex : /#[ \t]*define/,
  87. next : "define directive"
  88. }, {
  89. token : "keyword.preprocessor.csound",
  90. regex : /#(?:ifn?def|undef)\b/,
  91. next : "macro directive"
  92. },
  93. this.macroUses
  94. ];
  95. this.$rules = {
  96. "start": start,
  97. "define directive": [
  98. this.comments,
  99. {
  100. token : "entity.name.function.preprocessor.csound",
  101. regex : /[A-Z_a-z]\w*/
  102. }, {
  103. token : "punctuation.definition.macro-parameter-name-list.begin.csound",
  104. regex : /\(/,
  105. next : "macro parameter name list"
  106. }, {
  107. token : "punctuation.definition.macro.begin.csound",
  108. regex : /#/,
  109. next : "macro body"
  110. }
  111. ],
  112. "macro parameter name list": [
  113. {
  114. token : "variable.parameter.preprocessor.csound",
  115. regex : /[A-Z_a-z]\w*/
  116. }, {
  117. token : "punctuation.definition.macro-parameter-name-list.end.csound",
  118. regex : /\)/,
  119. next : "define directive"
  120. }
  121. ],
  122. "macro body": [
  123. {
  124. token : "constant.character.escape.csound",
  125. regex : /\\#/
  126. }, {
  127. token : "punctuation.definition.macro.end.csound",
  128. regex : /#/,
  129. next : "start"
  130. },
  131. start
  132. ],
  133. "macro directive": [
  134. this.comments,
  135. {
  136. token : "entity.name.function.preprocessor.csound",
  137. regex : /[A-Z_a-z]\w*/,
  138. next : "start"
  139. }
  140. ],
  141. "macro parameter value list": [
  142. {
  143. token : "punctuation.definition.macro-parameter-value-list.end.csound",
  144. regex : /\)/,
  145. next : "start"
  146. }, {
  147. token : "punctuation.definition.string.begin.csound",
  148. regex : /"/,
  149. next : "macro parameter value quoted string"
  150. }, this.pushRule({
  151. token : "punctuation.macro-parameter-value-parenthetical.begin.csound",
  152. regex : /\(/,
  153. next : "macro parameter value parenthetical"
  154. }), {
  155. token : "punctuation.macro-parameter-value-separator.csound",
  156. regex : "[#']"
  157. }
  158. ],
  159. "macro parameter value quoted string": [
  160. {
  161. token : "constant.character.escape.csound",
  162. regex : /\\[#'()]/
  163. }, {
  164. token : "invalid.illegal.csound",
  165. regex : /[#'()]/
  166. }, {
  167. token : "punctuation.definition.string.end.csound",
  168. regex : /"/,
  169. next : "macro parameter value list"
  170. },
  171. this.quotedStringContents,
  172. {
  173. defaultToken: "string.quoted.csound"
  174. }
  175. ],
  176. "macro parameter value parenthetical": [
  177. {
  178. token : "constant.character.escape.csound",
  179. regex : /\\\)/
  180. }, this.popRule({
  181. token : "punctuation.macro-parameter-value-parenthetical.end.csound",
  182. regex : /\)/
  183. }), this.pushRule({
  184. token : "punctuation.macro-parameter-value-parenthetical.begin.csound",
  185. regex : /\(/,
  186. next : "macro parameter value parenthetical"
  187. }),
  188. start
  189. ]
  190. };
  191. };
  192. oop.inherits(CsoundPreprocessorHighlightRules, TextHighlightRules);
  193. (function() {
  194. this.pushRule = function(params) {
  195. return {
  196. regex : params.regex, onMatch: function(value, currentState, stack, line) {
  197. if (stack.length === 0)
  198. stack.push(currentState);
  199. if (Array.isArray(params.next)) {
  200. for (var i = 0; i < params.next.length; i++) {
  201. stack.push(params.next[i]);
  202. }
  203. } else {
  204. stack.push(params.next);
  205. }
  206. this.next = stack[stack.length - 1];
  207. return params.token;
  208. },
  209. get next() { return Array.isArray(params.next) ? params.next[params.next.length - 1] : params.next; },
  210. set next(next) {
  211. if (Array.isArray(params.next)) {
  212. var oldNext = params.next[params.next.length - 1];
  213. var oldNextIndex = oldNext.length - 1;
  214. var newNextIndex = next.length - 1;
  215. if (newNextIndex > oldNextIndex) {
  216. while (oldNextIndex >= 0 && newNextIndex >= 0) {
  217. if (oldNext.charAt(oldNextIndex) !== next.charAt(newNextIndex)) {
  218. var prefix = next.substr(0, newNextIndex);
  219. for (var i = 0; i < params.next.length; i++) {
  220. params.next[i] = prefix + params.next[i];
  221. }
  222. break;
  223. }
  224. oldNextIndex--;
  225. newNextIndex--;
  226. }
  227. }
  228. } else {
  229. params.next = next;
  230. }
  231. },
  232. get token() { return params.token; }
  233. };
  234. };
  235. this.popRule = function(params) {
  236. return {
  237. regex : params.regex, onMatch: function(value, currentState, stack, line) {
  238. stack.pop();
  239. if (params.next) {
  240. stack.push(params.next);
  241. this.next = stack[stack.length - 1];
  242. } else {
  243. this.next = stack.length > 1 ? stack[stack.length - 1] : stack.pop();
  244. }
  245. return params.token;
  246. }
  247. };
  248. };
  249. }).call(CsoundPreprocessorHighlightRules.prototype);
  250. exports.CsoundPreprocessorHighlightRules = CsoundPreprocessorHighlightRules;
  251. });
  252. ace.define("ace/mode/csound_score_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/csound_preprocessor_highlight_rules"], function(acequire, exports, module) {
  253. "use strict";
  254. var oop = acequire("../lib/oop");
  255. var CsoundPreprocessorHighlightRules = acequire("./csound_preprocessor_highlight_rules").CsoundPreprocessorHighlightRules;
  256. var CsoundScoreHighlightRules = function() {
  257. CsoundPreprocessorHighlightRules.call(this);
  258. this.quotedStringContents.push({
  259. token : "invalid.illegal.csound-score",
  260. regex : /[^"]*$/
  261. });
  262. var start = this.$rules.start;
  263. start.push(
  264. {
  265. token : "keyword.control.csound-score",
  266. regex : /[abCdefiqstvxy]/
  267. }, {
  268. token : "invalid.illegal.csound-score",
  269. regex : /w/
  270. }, {
  271. token : "constant.numeric.language.csound-score",
  272. regex : /z/
  273. }, {
  274. token : ["keyword.control.csound-score", "constant.numeric.integer.decimal.csound-score"],
  275. regex : /([nNpP][pP])(\d+)/
  276. }, {
  277. token : "keyword.other.csound-score",
  278. regex : /[mn]/,
  279. push : [
  280. {
  281. token : "empty",
  282. regex : /$/,
  283. next : "pop"
  284. },
  285. this.comments,
  286. {
  287. token : "entity.name.label.csound-score",
  288. regex : /[A-Z_a-z]\w*/
  289. }
  290. ]
  291. }, {
  292. token : "keyword.preprocessor.csound-score",
  293. regex : /r\b/,
  294. next : "repeat section"
  295. },
  296. this.numbers,
  297. {
  298. token : "keyword.operator.csound-score",
  299. regex : "[!+\\-*/^%&|<>#~.]"
  300. },
  301. this.pushRule({
  302. token : "punctuation.definition.string.begin.csound-score",
  303. regex : /"/,
  304. next : "quoted string"
  305. }),
  306. this.pushRule({
  307. token : "punctuation.braced-loop.begin.csound-score",
  308. regex : /{/,
  309. next : "loop after left brace"
  310. })
  311. );
  312. this.addRules({
  313. "repeat section": [
  314. {
  315. token : "empty",
  316. regex : /$/,
  317. next : "start"
  318. },
  319. this.comments,
  320. {
  321. token : "constant.numeric.integer.decimal.csound-score",
  322. regex : /\d+/,
  323. next : "repeat section before label"
  324. }
  325. ],
  326. "repeat section before label": [
  327. {
  328. token : "empty",
  329. regex : /$/,
  330. next : "start"
  331. },
  332. this.comments,
  333. {
  334. token : "entity.name.label.csound-score",
  335. regex : /[A-Z_a-z]\w*/,
  336. next : "start"
  337. }
  338. ],
  339. "quoted string": [
  340. this.popRule({
  341. token : "punctuation.definition.string.end.csound-score",
  342. regex : /"/
  343. }),
  344. this.quotedStringContents,
  345. {
  346. defaultToken: "string.quoted.csound-score"
  347. }
  348. ],
  349. "loop after left brace": [
  350. this.popRule({
  351. token : "constant.numeric.integer.decimal.csound-score",
  352. regex : /\d+/,
  353. next : "loop after repeat count"
  354. }),
  355. this.comments,
  356. {
  357. token : "invalid.illegal.csound",
  358. regex : /\S.*/
  359. }
  360. ],
  361. "loop after repeat count": [
  362. this.popRule({
  363. token : "entity.name.function.preprocessor.csound-score",
  364. regex : /[A-Z_a-z]\w*\b/,
  365. next : "loop after macro name"
  366. }),
  367. this.comments,
  368. {
  369. token : "invalid.illegal.csound",
  370. regex : /\S.*/
  371. }
  372. ],
  373. "loop after macro name": [
  374. start,
  375. this.popRule({
  376. token : "punctuation.braced-loop.end.csound-score",
  377. regex : /}/
  378. })
  379. ]
  380. });
  381. this.normalizeRules();
  382. };
  383. oop.inherits(CsoundScoreHighlightRules, CsoundPreprocessorHighlightRules);
  384. exports.CsoundScoreHighlightRules = CsoundScoreHighlightRules;
  385. });
  386. ace.define("ace/mode/lua_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  387. "use strict";
  388. var oop = acequire("../lib/oop");
  389. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  390. var LuaHighlightRules = function() {
  391. var keywords = (
  392. "break|do|else|elseif|end|for|function|if|in|local|repeat|"+
  393. "return|then|until|while|or|and|not"
  394. );
  395. var builtinConstants = ("true|false|nil|_G|_VERSION");
  396. var functions = (
  397. "string|xpcall|package|tostring|print|os|unpack|acequire|"+
  398. "getfenv|setmetatable|next|assert|tonumber|io|rawequal|"+
  399. "collectgarbage|getmetatable|module|rawset|math|debug|"+
  400. "pcall|table|newproxy|type|coroutine|_G|select|gcinfo|"+
  401. "pairs|rawget|loadstring|ipairs|_VERSION|dofile|setfenv|"+
  402. "load|error|loadfile|"+
  403. "sub|upper|len|gfind|rep|find|match|char|dump|gmatch|"+
  404. "reverse|byte|format|gsub|lower|preload|loadlib|loaded|"+
  405. "loaders|cpath|config|path|seeall|exit|setlocale|date|"+
  406. "getenv|difftime|remove|time|clock|tmpname|rename|execute|"+
  407. "lines|write|close|flush|open|output|type|read|stderr|"+
  408. "stdin|input|stdout|popen|tmpfile|log|max|acos|huge|"+
  409. "ldexp|pi|cos|tanh|pow|deg|tan|cosh|sinh|random|randomseed|"+
  410. "frexp|ceil|floor|rad|abs|sqrt|modf|asin|min|mod|fmod|log10|"+
  411. "atan2|exp|sin|atan|getupvalue|debug|sethook|getmetatable|"+
  412. "gethook|setmetatable|setlocal|traceback|setfenv|getinfo|"+
  413. "setupvalue|getlocal|getregistry|getfenv|setn|insert|getn|"+
  414. "foreachi|maxn|foreach|concat|sort|remove|resume|yield|"+
  415. "status|wrap|create|running|"+
  416. "__add|__sub|__mod|__unm|__concat|__lt|__index|__call|__gc|__metatable|"+
  417. "__mul|__div|__pow|__len|__eq|__le|__newindex|__tostring|__mode|__tonumber"
  418. );
  419. var stdLibaries = ("string|package|os|io|math|debug|table|coroutine");
  420. var deprecatedIn5152 = ("setn|foreach|foreachi|gcinfo|log10|maxn");
  421. var keywordMapper = this.createKeywordMapper({
  422. "keyword": keywords,
  423. "support.function": functions,
  424. "keyword.deprecated": deprecatedIn5152,
  425. "constant.library": stdLibaries,
  426. "constant.language": builtinConstants,
  427. "variable.language": "self"
  428. }, "identifier");
  429. var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
  430. var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
  431. var integer = "(?:" + decimalInteger + "|" + hexInteger + ")";
  432. var fraction = "(?:\\.\\d+)";
  433. var intPart = "(?:\\d+)";
  434. var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
  435. var floatNumber = "(?:" + pointFloat + ")";
  436. this.$rules = {
  437. "start" : [{
  438. stateName: "bracketedComment",
  439. onMatch : function(value, currentState, stack){
  440. stack.unshift(this.next, value.length - 2, currentState);
  441. return "comment";
  442. },
  443. regex : /\-\-\[=*\[/,
  444. next : [
  445. {
  446. onMatch : function(value, currentState, stack) {
  447. if (value.length == stack[1]) {
  448. stack.shift();
  449. stack.shift();
  450. this.next = stack.shift();
  451. } else {
  452. this.next = "";
  453. }
  454. return "comment";
  455. },
  456. regex : /\]=*\]/,
  457. next : "start"
  458. }, {
  459. defaultToken : "comment"
  460. }
  461. ]
  462. },
  463. {
  464. token : "comment",
  465. regex : "\\-\\-.*$"
  466. },
  467. {
  468. stateName: "bracketedString",
  469. onMatch : function(value, currentState, stack){
  470. stack.unshift(this.next, value.length, currentState);
  471. return "string.start";
  472. },
  473. regex : /\[=*\[/,
  474. next : [
  475. {
  476. onMatch : function(value, currentState, stack) {
  477. if (value.length == stack[1]) {
  478. stack.shift();
  479. stack.shift();
  480. this.next = stack.shift();
  481. } else {
  482. this.next = "";
  483. }
  484. return "string.end";
  485. },
  486. regex : /\]=*\]/,
  487. next : "start"
  488. }, {
  489. defaultToken : "string"
  490. }
  491. ]
  492. },
  493. {
  494. token : "string", // " string
  495. regex : '"(?:[^\\\\]|\\\\.)*?"'
  496. }, {
  497. token : "string", // ' string
  498. regex : "'(?:[^\\\\]|\\\\.)*?'"
  499. }, {
  500. token : "constant.numeric", // float
  501. regex : floatNumber
  502. }, {
  503. token : "constant.numeric", // integer
  504. regex : integer + "\\b"
  505. }, {
  506. token : keywordMapper,
  507. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  508. }, {
  509. token : "keyword.operator",
  510. regex : "\\+|\\-|\\*|\\/|%|\\#|\\^|~|<|>|<=|=>|==|~=|=|\\:|\\.\\.\\.|\\.\\."
  511. }, {
  512. token : "paren.lparen",
  513. regex : "[\\[\\(\\{]"
  514. }, {
  515. token : "paren.rparen",
  516. regex : "[\\]\\)\\}]"
  517. }, {
  518. token : "text",
  519. regex : "\\s+|\\w+"
  520. } ]
  521. };
  522. this.normalizeRules();
  523. };
  524. oop.inherits(LuaHighlightRules, TextHighlightRules);
  525. exports.LuaHighlightRules = LuaHighlightRules;
  526. });
  527. ace.define("ace/mode/python_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  528. "use strict";
  529. var oop = acequire("../lib/oop");
  530. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  531. var PythonHighlightRules = function() {
  532. var keywords = (
  533. "and|as|assert|break|class|continue|def|del|elif|else|except|exec|" +
  534. "finally|for|from|global|if|import|in|is|lambda|not|or|pass|print|" +
  535. "raise|return|try|while|with|yield|async|await"
  536. );
  537. var builtinConstants = (
  538. "True|False|None|NotImplemented|Ellipsis|__debug__"
  539. );
  540. var builtinFunctions = (
  541. "abs|divmod|input|open|staticmethod|all|enumerate|int|ord|str|any|" +
  542. "eval|isinstance|pow|sum|basestring|execfile|issubclass|print|super|" +
  543. "binfile|iter|property|tuple|bool|filter|len|range|type|bytearray|" +
  544. "float|list|raw_input|unichr|callable|format|locals|reduce|unicode|" +
  545. "chr|frozenset|long|reload|vars|classmethod|getattr|map|repr|xrange|" +
  546. "cmp|globals|max|reversed|zip|compile|hasattr|memoryview|round|" +
  547. "__import__|complex|hash|min|set|apply|delattr|help|next|setattr|" +
  548. "buffer|dict|hex|object|slice|coerce|dir|id|oct|sorted|intern"
  549. );
  550. var keywordMapper = this.createKeywordMapper({
  551. "invalid.deprecated": "debugger",
  552. "support.function": builtinFunctions,
  553. "constant.language": builtinConstants,
  554. "keyword": keywords
  555. }, "identifier");
  556. var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
  557. var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
  558. var octInteger = "(?:0[oO]?[0-7]+)";
  559. var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
  560. var binInteger = "(?:0[bB][01]+)";
  561. var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
  562. var exponent = "(?:[eE][+-]?\\d+)";
  563. var fraction = "(?:\\.\\d+)";
  564. var intPart = "(?:\\d+)";
  565. var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
  566. var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
  567. var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
  568. var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
  569. this.$rules = {
  570. "start" : [ {
  571. token : "comment",
  572. regex : "#.*$"
  573. }, {
  574. token : "string", // multi line """ string start
  575. regex : strPre + '"{3}',
  576. next : "qqstring3"
  577. }, {
  578. token : "string", // " string
  579. regex : strPre + '"(?=.)',
  580. next : "qqstring"
  581. }, {
  582. token : "string", // multi line ''' string start
  583. regex : strPre + "'{3}",
  584. next : "qstring3"
  585. }, {
  586. token : "string", // ' string
  587. regex : strPre + "'(?=.)",
  588. next : "qstring"
  589. }, {
  590. token : "constant.numeric", // imaginary
  591. regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
  592. }, {
  593. token : "constant.numeric", // float
  594. regex : floatNumber
  595. }, {
  596. token : "constant.numeric", // long integer
  597. regex : integer + "[lL]\\b"
  598. }, {
  599. token : "constant.numeric", // integer
  600. regex : integer + "\\b"
  601. }, {
  602. token : keywordMapper,
  603. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  604. }, {
  605. token : "keyword.operator",
  606. regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
  607. }, {
  608. token : "paren.lparen",
  609. regex : "[\\[\\(\\{]"
  610. }, {
  611. token : "paren.rparen",
  612. regex : "[\\]\\)\\}]"
  613. }, {
  614. token : "text",
  615. regex : "\\s+"
  616. } ],
  617. "qqstring3" : [ {
  618. token : "constant.language.escape",
  619. regex : stringEscape
  620. }, {
  621. token : "string", // multi line """ string end
  622. regex : '"{3}',
  623. next : "start"
  624. }, {
  625. defaultToken : "string"
  626. } ],
  627. "qstring3" : [ {
  628. token : "constant.language.escape",
  629. regex : stringEscape
  630. }, {
  631. token : "string", // multi line ''' string end
  632. regex : "'{3}",
  633. next : "start"
  634. }, {
  635. defaultToken : "string"
  636. } ],
  637. "qqstring" : [{
  638. token : "constant.language.escape",
  639. regex : stringEscape
  640. }, {
  641. token : "string",
  642. regex : "\\\\$",
  643. next : "qqstring"
  644. }, {
  645. token : "string",
  646. regex : '"|$',
  647. next : "start"
  648. }, {
  649. defaultToken: "string"
  650. }],
  651. "qstring" : [{
  652. token : "constant.language.escape",
  653. regex : stringEscape
  654. }, {
  655. token : "string",
  656. regex : "\\\\$",
  657. next : "qstring"
  658. }, {
  659. token : "string",
  660. regex : "'|$",
  661. next : "start"
  662. }, {
  663. defaultToken: "string"
  664. }]
  665. };
  666. };
  667. oop.inherits(PythonHighlightRules, TextHighlightRules);
  668. exports.PythonHighlightRules = PythonHighlightRules;
  669. });
  670. ace.define("ace/mode/csound_orchestra_highlight_rules",["require","exports","module","ace/lib/lang","ace/lib/oop","ace/mode/csound_preprocessor_highlight_rules","ace/mode/csound_score_highlight_rules","ace/mode/lua_highlight_rules","ace/mode/python_highlight_rules"], function(acequire, exports, module) {
  671. "use strict";
  672. var lang = acequire("../lib/lang");
  673. var oop = acequire("../lib/oop");
  674. var CsoundPreprocessorHighlightRules = acequire("./csound_preprocessor_highlight_rules").CsoundPreprocessorHighlightRules;
  675. var CsoundScoreHighlightRules = acequire("./csound_score_highlight_rules").CsoundScoreHighlightRules;
  676. var LuaHighlightRules = acequire("./lua_highlight_rules").LuaHighlightRules;
  677. var PythonHighlightRules = acequire("./python_highlight_rules").PythonHighlightRules;
  678. var CsoundOrchestraHighlightRules = function() {
  679. CsoundPreprocessorHighlightRules.call(this);
  680. var opcodes = [
  681. "ATSadd",
  682. "ATSaddnz",
  683. "ATSbufread",
  684. "ATScross",
  685. "ATSinfo",
  686. "ATSinterpread",
  687. "ATSpartialtap",
  688. "ATSread",
  689. "ATSreadnz",
  690. "ATSsinnoi",
  691. "FLbox",
  692. "FLbutBank",
  693. "FLbutton",
  694. "FLcloseButton",
  695. "FLcolor",
  696. "FLcolor2",
  697. "FLcount",
  698. "FLexecButton",
  699. "FLgetsnap",
  700. "FLgroup",
  701. "FLgroupEnd",
  702. "FLgroup_end",
  703. "FLhide",
  704. "FLhvsBox",
  705. "FLhvsBoxSetValue",
  706. "FLjoy",
  707. "FLkeyIn",
  708. "FLknob",
  709. "FLlabel",
  710. "FLloadsnap",
  711. "FLmouse",
  712. "FLpack",
  713. "FLpackEnd",
  714. "FLpack_end",
  715. "FLpanel",
  716. "FLpanelEnd",
  717. "FLpanel_end",
  718. "FLprintk",
  719. "FLprintk2",
  720. "FLroller",
  721. "FLrun",
  722. "FLsavesnap",
  723. "FLscroll",
  724. "FLscrollEnd",
  725. "FLscroll_end",
  726. "FLsetAlign",
  727. "FLsetBox",
  728. "FLsetColor",
  729. "FLsetColor2",
  730. "FLsetFont",
  731. "FLsetPosition",
  732. "FLsetSize",
  733. "FLsetSnapGroup",
  734. "FLsetText",
  735. "FLsetTextColor",
  736. "FLsetTextSize",
  737. "FLsetTextType",
  738. "FLsetVal",
  739. "FLsetVal_i",
  740. "FLsetVali",
  741. "FLsetsnap",
  742. "FLshow",
  743. "FLslidBnk",
  744. "FLslidBnk2",
  745. "FLslidBnk2Set",
  746. "FLslidBnk2Setk",
  747. "FLslidBnkGetHandle",
  748. "FLslidBnkSet",
  749. "FLslidBnkSetk",
  750. "FLslider",
  751. "FLtabs",
  752. "FLtabsEnd",
  753. "FLtabs_end",
  754. "FLtext",
  755. "FLupdate",
  756. "FLvalue",
  757. "FLvkeybd",
  758. "FLvslidBnk",
  759. "FLvslidBnk2",
  760. "FLxyin",
  761. "JackoAudioIn",
  762. "JackoAudioInConnect",
  763. "JackoAudioOut",
  764. "JackoAudioOutConnect",
  765. "JackoFreewheel",
  766. "JackoInfo",
  767. "JackoInit",
  768. "JackoMidiInConnect",
  769. "JackoMidiOut",
  770. "JackoMidiOutConnect",
  771. "JackoNoteOut",
  772. "JackoOn",
  773. "JackoTransport",
  774. "K35_hpf",
  775. "K35_lpf",
  776. "MixerClear",
  777. "MixerGetLevel",
  778. "MixerReceive",
  779. "MixerSend",
  780. "MixerSetLevel",
  781. "MixerSetLevel_i",
  782. "OSCinit",
  783. "OSCinitM",
  784. "OSClisten",
  785. "OSCraw",
  786. "OSCsend",
  787. "OSCsendA",
  788. "OSCsend_lo",
  789. "S",
  790. "STKBandedWG",
  791. "STKBeeThree",
  792. "STKBlowBotl",
  793. "STKBlowHole",
  794. "STKBowed",
  795. "STKBrass",
  796. "STKClarinet",
  797. "STKDrummer",
  798. "STKFMVoices",
  799. "STKFlute",
  800. "STKHevyMetl",
  801. "STKMandolin",
  802. "STKModalBar",
  803. "STKMoog",
  804. "STKPercFlut",
  805. "STKPlucked",
  806. "STKResonate",
  807. "STKRhodey",
  808. "STKSaxofony",
  809. "STKShakers",
  810. "STKSimple",
  811. "STKSitar",
  812. "STKStifKarp",
  813. "STKTubeBell",
  814. "STKVoicForm",
  815. "STKWhistle",
  816. "STKWurley",
  817. "a",
  818. "abs",
  819. "active",
  820. "adsr",
  821. "adsyn",
  822. "adsynt",
  823. "adsynt2",
  824. "aftouch",
  825. "alpass",
  826. "alwayson",
  827. "ampdb",
  828. "ampdbfs",
  829. "ampmidi",
  830. "ampmidid",
  831. "areson",
  832. "aresonk",
  833. "atone",
  834. "atonek",
  835. "atonex",
  836. "babo",
  837. "balance",
  838. "bamboo",
  839. "barmodel",
  840. "bbcutm",
  841. "bbcuts",
  842. "betarand",
  843. "bexprnd",
  844. "bformdec1",
  845. "bformenc1",
  846. "binit",
  847. "biquad",
  848. "biquada",
  849. "birnd",
  850. "bpf",
  851. "bqrez",
  852. "buchla",
  853. "butbp",
  854. "butbr",
  855. "buthp",
  856. "butlp",
  857. "butterbp",
  858. "butterbr",
  859. "butterhp",
  860. "butterlp",
  861. "button",
  862. "buzz",
  863. "c2r",
  864. "cabasa",
  865. "cauchy",
  866. "cauchyi",
  867. "cbrt",
  868. "ceil",
  869. "cell",
  870. "cent",
  871. "centroid",
  872. "ceps",
  873. "cepsinv",
  874. "chanctrl",
  875. "changed",
  876. "changed2",
  877. "chani",
  878. "chano",
  879. "chebyshevpoly",
  880. "checkbox",
  881. "chn_S",
  882. "chn_a",
  883. "chn_k",
  884. "chnclear",
  885. "chnexport",
  886. "chnget",
  887. "chnmix",
  888. "chnparams",
  889. "chnset",
  890. "chuap",
  891. "clear",
  892. "clfilt",
  893. "clip",
  894. "clockoff",
  895. "clockon",
  896. "cmp",
  897. "cmplxprod",
  898. "comb",
  899. "combinv",
  900. "compilecsd",
  901. "compileorc",
  902. "compilestr",
  903. "compress",
  904. "compress2",
  905. "connect",
  906. "control",
  907. "convle",
  908. "convolve",
  909. "copya2ftab",
  910. "copyf2array",
  911. "cos",
  912. "cosh",
  913. "cosinv",
  914. "cosseg",
  915. "cossegb",
  916. "cossegr",
  917. "cps2pch",
  918. "cpsmidi",
  919. "cpsmidib",
  920. "cpsmidinn",
  921. "cpsoct",
  922. "cpspch",
  923. "cpstmid",
  924. "cpstun",
  925. "cpstuni",
  926. "cpsxpch",
  927. "cpumeter",
  928. "cpuprc",
  929. "cross2",
  930. "crossfm",
  931. "crossfmi",
  932. "crossfmpm",
  933. "crossfmpmi",
  934. "crosspm",
  935. "crosspmi",
  936. "crunch",
  937. "ctlchn",
  938. "ctrl14",
  939. "ctrl21",
  940. "ctrl7",
  941. "ctrlinit",
  942. "cuserrnd",
  943. "dam",
  944. "date",
  945. "dates",
  946. "db",
  947. "dbamp",
  948. "dbfsamp",
  949. "dcblock",
  950. "dcblock2",
  951. "dconv",
  952. "dct",
  953. "dctinv",
  954. "delay",
  955. "delay1",
  956. "delayk",
  957. "delayr",
  958. "delayw",
  959. "deltap",
  960. "deltap3",
  961. "deltapi",
  962. "deltapn",
  963. "deltapx",
  964. "deltapxw",
  965. "denorm",
  966. "diff",
  967. "diode_ladder",
  968. "directory",
  969. "diskgrain",
  970. "diskin",
  971. "diskin2",
  972. "dispfft",
  973. "display",
  974. "distort",
  975. "distort1",
  976. "divz",
  977. "doppler",
  978. "dot",
  979. "downsamp",
  980. "dripwater",
  981. "dssiactivate",
  982. "dssiaudio",
  983. "dssictls",
  984. "dssiinit",
  985. "dssilist",
  986. "dumpk",
  987. "dumpk2",
  988. "dumpk3",
  989. "dumpk4",
  990. "duserrnd",
  991. "dust",
  992. "dust2",
  993. "envlpx",
  994. "envlpxr",
  995. "ephasor",
  996. "eqfil",
  997. "evalstr",
  998. "event",
  999. "event_i",
  1000. "exciter",
  1001. "exitnow",
  1002. "exp",
  1003. "expcurve",
  1004. "expon",
  1005. "exprand",
  1006. "exprandi",
  1007. "expseg",
  1008. "expsega",
  1009. "expsegb",
  1010. "expsegba",
  1011. "expsegr",
  1012. "fareylen",
  1013. "fareyleni",
  1014. "faustaudio",
  1015. "faustcompile",
  1016. "faustctl",
  1017. "faustgen",
  1018. "fft",
  1019. "fftinv",
  1020. "ficlose",
  1021. "filebit",
  1022. "filelen",
  1023. "filenchnls",
  1024. "filepeak",
  1025. "filescal",
  1026. "filesr",
  1027. "filevalid",
  1028. "fillarray",
  1029. "filter2",
  1030. "fin",
  1031. "fini",
  1032. "fink",
  1033. "fiopen",
  1034. "flanger",
  1035. "flashtxt",
  1036. "flooper",
  1037. "flooper2",
  1038. "floor",
  1039. "fluidAllOut",
  1040. "fluidCCi",
  1041. "fluidCCk",
  1042. "fluidControl",
  1043. "fluidEngine",
  1044. "fluidLoad",
  1045. "fluidNote",
  1046. "fluidOut",
  1047. "fluidProgramSelect",
  1048. "fluidSetInterpMethod",
  1049. "fmanal",
  1050. "fmax",
  1051. "fmb3",
  1052. "fmbell",
  1053. "fmin",
  1054. "fmmetal",
  1055. "fmod",
  1056. "fmpercfl",
  1057. "fmrhode",
  1058. "fmvoice",
  1059. "fmwurlie",
  1060. "fof",
  1061. "fof2",
  1062. "fofilter",
  1063. "fog",
  1064. "fold",
  1065. "follow",
  1066. "follow2",
  1067. "foscil",
  1068. "foscili",
  1069. "fout",
  1070. "fouti",
  1071. "foutir",
  1072. "foutk",
  1073. "fprintks",
  1074. "fprints",
  1075. "frac",
  1076. "fractalnoise",
  1077. "framebuffer",
  1078. "freeverb",
  1079. "ftchnls",
  1080. "ftconv",
  1081. "ftcps",
  1082. "ftfree",
  1083. "ftgen",
  1084. "ftgenonce",
  1085. "ftgentmp",
  1086. "ftlen",
  1087. "ftload",
  1088. "ftloadk",
  1089. "ftlptim",
  1090. "ftmorf",
  1091. "ftom",
  1092. "ftresize",
  1093. "ftresizei",
  1094. "ftsamplebank",
  1095. "ftsave",
  1096. "ftsavek",
  1097. "ftsr",
  1098. "gain",
  1099. "gainslider",
  1100. "gauss",
  1101. "gaussi",
  1102. "gausstrig",
  1103. "gbuzz",
  1104. "genarray",
  1105. "genarray_i",
  1106. "gendy",
  1107. "gendyc",
  1108. "gendyx",
  1109. "getcfg",
  1110. "getcol",
  1111. "getftargs",
  1112. "getrow",
  1113. "getseed",
  1114. "gogobel",
  1115. "grain",
  1116. "grain2",
  1117. "grain3",
  1118. "granule",
  1119. "guiro",
  1120. "harmon",
  1121. "harmon2",
  1122. "harmon3",
  1123. "harmon4",
  1124. "hdf5read",
  1125. "hdf5write",
  1126. "hilbert",
  1127. "hilbert2",
  1128. "hrtfearly",
  1129. "hrtfmove",
  1130. "hrtfmove2",
  1131. "hrtfreverb",
  1132. "hrtfstat",
  1133. "hsboscil",
  1134. "hvs1",
  1135. "hvs2",
  1136. "hvs3",
  1137. "hypot",
  1138. "i",
  1139. "ihold",
  1140. "imagecreate",
  1141. "imagefree",
  1142. "imagegetpixel",
  1143. "imageload",
  1144. "imagesave",
  1145. "imagesetpixel",
  1146. "imagesize",
  1147. "in",
  1148. "in32",
  1149. "inch",
  1150. "inh",
  1151. "init",
  1152. "initc14",
  1153. "initc21",
  1154. "initc7",
  1155. "inleta",
  1156. "inletf",
  1157. "inletk",
  1158. "inletkid",
  1159. "inletv",
  1160. "ino",
  1161. "inq",
  1162. "inrg",
  1163. "ins",
  1164. "insglobal",
  1165. "insremot",
  1166. "int",
  1167. "integ",
  1168. "interp",
  1169. "invalue",
  1170. "inx",
  1171. "inz",
  1172. "jacktransport",
  1173. "jitter",
  1174. "jitter2",
  1175. "joystick",
  1176. "jspline",
  1177. "k",
  1178. "la_i_add_mc",
  1179. "la_i_add_mr",
  1180. "la_i_add_vc",
  1181. "la_i_add_vr",
  1182. "la_i_assign_mc",
  1183. "la_i_assign_mr",
  1184. "la_i_assign_t",
  1185. "la_i_assign_vc",
  1186. "la_i_assign_vr",
  1187. "la_i_conjugate_mc",
  1188. "la_i_conjugate_mr",
  1189. "la_i_conjugate_vc",
  1190. "la_i_conjugate_vr",
  1191. "la_i_distance_vc",
  1192. "la_i_distance_vr",
  1193. "la_i_divide_mc",
  1194. "la_i_divide_mr",
  1195. "la_i_divide_vc",
  1196. "la_i_divide_vr",
  1197. "la_i_dot_mc",
  1198. "la_i_dot_mc_vc",
  1199. "la_i_dot_mr",
  1200. "la_i_dot_mr_vr",
  1201. "la_i_dot_vc",
  1202. "la_i_dot_vr",
  1203. "la_i_get_mc",
  1204. "la_i_get_mr",
  1205. "la_i_get_vc",
  1206. "la_i_get_vr",
  1207. "la_i_invert_mc",
  1208. "la_i_invert_mr",
  1209. "la_i_lower_solve_mc",
  1210. "la_i_lower_solve_mr",
  1211. "la_i_lu_det_mc",
  1212. "la_i_lu_det_mr",
  1213. "la_i_lu_factor_mc",
  1214. "la_i_lu_factor_mr",
  1215. "la_i_lu_solve_mc",
  1216. "la_i_lu_solve_mr",
  1217. "la_i_mc_create",
  1218. "la_i_mc_set",
  1219. "la_i_mr_create",
  1220. "la_i_mr_set",
  1221. "la_i_multiply_mc",
  1222. "la_i_multiply_mr",
  1223. "la_i_multiply_vc",
  1224. "la_i_multiply_vr",
  1225. "la_i_norm1_mc",
  1226. "la_i_norm1_mr",
  1227. "la_i_norm1_vc",
  1228. "la_i_norm1_vr",
  1229. "la_i_norm_euclid_mc",
  1230. "la_i_norm_euclid_mr",
  1231. "la_i_norm_euclid_vc",
  1232. "la_i_norm_euclid_vr",
  1233. "la_i_norm_inf_mc",
  1234. "la_i_norm_inf_mr",
  1235. "la_i_norm_inf_vc",
  1236. "la_i_norm_inf_vr",
  1237. "la_i_norm_max_mc",
  1238. "la_i_norm_max_mr",
  1239. "la_i_print_mc",
  1240. "la_i_print_mr",
  1241. "la_i_print_vc",
  1242. "la_i_print_vr",
  1243. "la_i_qr_eigen_mc",
  1244. "la_i_qr_eigen_mr",
  1245. "la_i_qr_factor_mc",
  1246. "la_i_qr_factor_mr",
  1247. "la_i_qr_sym_eigen_mc",
  1248. "la_i_qr_sym_eigen_mr",
  1249. "la_i_random_mc",
  1250. "la_i_random_mr",
  1251. "la_i_random_vc",
  1252. "la_i_random_vr",
  1253. "la_i_size_mc",
  1254. "la_i_size_mr",
  1255. "la_i_size_vc",
  1256. "la_i_size_vr",
  1257. "la_i_subtract_mc",
  1258. "la_i_subtract_mr",
  1259. "la_i_subtract_vc",
  1260. "la_i_subtract_vr",
  1261. "la_i_t_assign",
  1262. "la_i_trace_mc",
  1263. "la_i_trace_mr",
  1264. "la_i_transpose_mc",
  1265. "la_i_transpose_mr",
  1266. "la_i_upper_solve_mc",
  1267. "la_i_upper_solve_mr",
  1268. "la_i_vc_create",
  1269. "la_i_vc_set",
  1270. "la_i_vr_create",
  1271. "la_i_vr_set",
  1272. "la_k_a_assign",
  1273. "la_k_add_mc",
  1274. "la_k_add_mr",
  1275. "la_k_add_vc",
  1276. "la_k_add_vr",
  1277. "la_k_assign_a",
  1278. "la_k_assign_f",
  1279. "la_k_assign_mc",
  1280. "la_k_assign_mr",
  1281. "la_k_assign_t",
  1282. "la_k_assign_vc",
  1283. "la_k_assign_vr",
  1284. "la_k_conjugate_mc",
  1285. "la_k_conjugate_mr",
  1286. "la_k_conjugate_vc",
  1287. "la_k_conjugate_vr",
  1288. "la_k_current_f",
  1289. "la_k_current_vr",
  1290. "la_k_distance_vc",
  1291. "la_k_distance_vr",
  1292. "la_k_divide_mc",
  1293. "la_k_divide_mr",
  1294. "la_k_divide_vc",
  1295. "la_k_divide_vr",
  1296. "la_k_dot_mc",
  1297. "la_k_dot_mc_vc",
  1298. "la_k_dot_mr",
  1299. "la_k_dot_mr_vr",
  1300. "la_k_dot_vc",
  1301. "la_k_dot_vr",
  1302. "la_k_f_assign",
  1303. "la_k_get_mc",
  1304. "la_k_get_mr",
  1305. "la_k_get_vc",
  1306. "la_k_get_vr",
  1307. "la_k_invert_mc",
  1308. "la_k_invert_mr",
  1309. "la_k_lower_solve_mc",
  1310. "la_k_lower_solve_mr",
  1311. "la_k_lu_det_mc",
  1312. "la_k_lu_det_mr",
  1313. "la_k_lu_factor_mc",
  1314. "la_k_lu_factor_mr",
  1315. "la_k_lu_solve_mc",
  1316. "la_k_lu_solve_mr",
  1317. "la_k_mc_set",
  1318. "la_k_mr_set",
  1319. "la_k_multiply_mc",
  1320. "la_k_multiply_mr",
  1321. "la_k_multiply_vc",
  1322. "la_k_multiply_vr",
  1323. "la_k_norm1_mc",
  1324. "la_k_norm1_mr",
  1325. "la_k_norm1_vc",
  1326. "la_k_norm1_vr",
  1327. "la_k_norm_euclid_mc",
  1328. "la_k_norm_euclid_mr",
  1329. "la_k_norm_euclid_vc",
  1330. "la_k_norm_euclid_vr",
  1331. "la_k_norm_inf_mc",
  1332. "la_k_norm_inf_mr",
  1333. "la_k_norm_inf_vc",
  1334. "la_k_norm_inf_vr",
  1335. "la_k_norm_max_mc",
  1336. "la_k_norm_max_mr",
  1337. "la_k_qr_eigen_mc",
  1338. "la_k_qr_eigen_mr",
  1339. "la_k_qr_factor_mc",
  1340. "la_k_qr_factor_mr",
  1341. "la_k_qr_sym_eigen_mc",
  1342. "la_k_qr_sym_eigen_mr",
  1343. "la_k_random_mc",
  1344. "la_k_random_mr",
  1345. "la_k_random_vc",
  1346. "la_k_random_vr",
  1347. "la_k_subtract_mc",
  1348. "la_k_subtract_mr",
  1349. "la_k_subtract_vc",
  1350. "la_k_subtract_vr",
  1351. "la_k_t_assign",
  1352. "la_k_trace_mc",
  1353. "la_k_trace_mr",
  1354. "la_k_upper_solve_mc",
  1355. "la_k_upper_solve_mr",
  1356. "la_k_vc_set",
  1357. "la_k_vr_set",
  1358. "lenarray",
  1359. "lfo",
  1360. "limit",
  1361. "limit1",
  1362. "line",
  1363. "linen",
  1364. "linenr",
  1365. "lineto",
  1366. "link_beat_force",
  1367. "link_beat_get",
  1368. "link_beat_request",
  1369. "link_create",
  1370. "link_enable",
  1371. "link_is_enabled",
  1372. "link_metro",
  1373. "link_peers",
  1374. "link_tempo_get",
  1375. "link_tempo_set",
  1376. "linlin",
  1377. "linrand",
  1378. "linseg",
  1379. "linsegb",
  1380. "linsegr",
  1381. "liveconv",
  1382. "locsend",
  1383. "locsig",
  1384. "log",
  1385. "log10",
  1386. "log2",
  1387. "logbtwo",
  1388. "logcurve",
  1389. "loopseg",
  1390. "loopsegp",
  1391. "looptseg",
  1392. "loopxseg",
  1393. "lorenz",
  1394. "loscil",
  1395. "loscil3",
  1396. "loscilx",
  1397. "lowpass2",
  1398. "lowres",
  1399. "lowresx",
  1400. "lpf18",
  1401. "lpform",
  1402. "lpfreson",
  1403. "lphasor",
  1404. "lpinterp",
  1405. "lposcil",
  1406. "lposcil3",
  1407. "lposcila",
  1408. "lposcilsa",
  1409. "lposcilsa2",
  1410. "lpread",
  1411. "lpreson",
  1412. "lpshold",
  1413. "lpsholdp",
  1414. "lpslot",
  1415. "lua_exec",
  1416. "lua_iaopcall",
  1417. "lua_iaopcall_off",
  1418. "lua_ikopcall",
  1419. "lua_ikopcall_off",
  1420. "lua_iopcall",
  1421. "lua_iopcall_off",
  1422. "lua_opdef",
  1423. "mac",
  1424. "maca",
  1425. "madsr",
  1426. "mags",
  1427. "mandel",
  1428. "mandol",
  1429. "maparray",
  1430. "maparray_i",
  1431. "marimba",
  1432. "massign",
  1433. "max",
  1434. "max_k",
  1435. "maxabs",
  1436. "maxabsaccum",
  1437. "maxaccum",
  1438. "maxalloc",
  1439. "maxarray",
  1440. "mclock",
  1441. "mdelay",
  1442. "median",
  1443. "mediank",
  1444. "metro",
  1445. "mfb",
  1446. "midglobal",
  1447. "midiarp",
  1448. "midic14",
  1449. "midic21",
  1450. "midic7",
  1451. "midichannelaftertouch",
  1452. "midichn",
  1453. "midicontrolchange",
  1454. "midictrl",
  1455. "mididefault",
  1456. "midifilestatus",
  1457. "midiin",
  1458. "midinoteoff",
  1459. "midinoteoncps",
  1460. "midinoteonkey",
  1461. "midinoteonoct",
  1462. "midinoteonpch",
  1463. "midion",
  1464. "midion2",
  1465. "midiout",
  1466. "midipgm",
  1467. "midipitchbend",
  1468. "midipolyaftertouch",
  1469. "midiprogramchange",
  1470. "miditempo",
  1471. "midremot",
  1472. "min",
  1473. "minabs",
  1474. "minabsaccum",
  1475. "minaccum",
  1476. "minarray",
  1477. "mincer",
  1478. "mirror",
  1479. "mode",
  1480. "modmatrix",
  1481. "monitor",
  1482. "moog",
  1483. "moogladder",
  1484. "moogladder2",
  1485. "moogvcf",
  1486. "moogvcf2",
  1487. "moscil",
  1488. "mp3bitrate",
  1489. "mp3in",
  1490. "mp3len",
  1491. "mp3nchnls",
  1492. "mp3scal",
  1493. "mp3scal_check",
  1494. "mp3scal_load",
  1495. "mp3scal_load2",
  1496. "mp3scal_play",
  1497. "mp3scal_play2",
  1498. "mp3sr",
  1499. "mpulse",
  1500. "mrtmsg",
  1501. "mtof",
  1502. "mton",
  1503. "multitap",
  1504. "mute",
  1505. "mvchpf",
  1506. "mvclpf1",
  1507. "mvclpf2",
  1508. "mvclpf3",
  1509. "mvclpf4",
  1510. "mxadsr",
  1511. "nchnls_hw",
  1512. "nestedap",
  1513. "nlalp",
  1514. "nlfilt",
  1515. "nlfilt2",
  1516. "noise",
  1517. "noteoff",
  1518. "noteon",
  1519. "noteondur",
  1520. "noteondur2",
  1521. "notnum",
  1522. "nreverb",
  1523. "nrpn",
  1524. "nsamp",
  1525. "nstance",
  1526. "nstrnum",
  1527. "ntom",
  1528. "ntrpol",
  1529. "nxtpow2",
  1530. "octave",
  1531. "octcps",
  1532. "octmidi",
  1533. "octmidib",
  1534. "octmidinn",
  1535. "octpch",
  1536. "olabuffer",
  1537. "oscbnk",
  1538. "oscil",
  1539. "oscil1",
  1540. "oscil1i",
  1541. "oscil3",
  1542. "oscili",
  1543. "oscilikt",
  1544. "osciliktp",
  1545. "oscilikts",
  1546. "osciln",
  1547. "oscils",
  1548. "oscilx",
  1549. "out",
  1550. "out32",
  1551. "outc",
  1552. "outch",
  1553. "outh",
  1554. "outiat",
  1555. "outic",
  1556. "outic14",
  1557. "outipat",
  1558. "outipb",
  1559. "outipc",
  1560. "outkat",
  1561. "outkc",
  1562. "outkc14",
  1563. "outkpat",
  1564. "outkpb",
  1565. "outkpc",
  1566. "outleta",
  1567. "outletf",
  1568. "outletk",
  1569. "outletkid",
  1570. "outletv",
  1571. "outo",
  1572. "outq",
  1573. "outq1",
  1574. "outq2",
  1575. "outq3",
  1576. "outq4",
  1577. "outrg",
  1578. "outs",
  1579. "outs1",
  1580. "outs2",
  1581. "outvalue",
  1582. "outx",
  1583. "outz",
  1584. "p",
  1585. "p5gconnect",
  1586. "p5gdata",
  1587. "pan",
  1588. "pan2",
  1589. "pareq",
  1590. "part2txt",
  1591. "partials",
  1592. "partikkel",
  1593. "partikkelget",
  1594. "partikkelset",
  1595. "partikkelsync",
  1596. "passign",
  1597. "paulstretch",
  1598. "pcauchy",
  1599. "pchbend",
  1600. "pchmidi",
  1601. "pchmidib",
  1602. "pchmidinn",
  1603. "pchoct",
  1604. "pchtom",
  1605. "pconvolve",
  1606. "pcount",
  1607. "pdclip",
  1608. "pdhalf",
  1609. "pdhalfy",
  1610. "peak",
  1611. "pgmassign",
  1612. "pgmchn",
  1613. "phaser1",
  1614. "phaser2",
  1615. "phasor",
  1616. "phasorbnk",
  1617. "phs",
  1618. "pindex",
  1619. "pinker",
  1620. "pinkish",
  1621. "pitch",
  1622. "pitchac",
  1623. "pitchamdf",
  1624. "planet",
  1625. "platerev",
  1626. "plltrack",
  1627. "pluck",
  1628. "poisson",
  1629. "pol2rect",
  1630. "polyaft",
  1631. "polynomial",
  1632. "port",
  1633. "portk",
  1634. "poscil",
  1635. "poscil3",
  1636. "pow",
  1637. "powershape",
  1638. "powoftwo",
  1639. "pows",
  1640. "prealloc",
  1641. "prepiano",
  1642. "print",
  1643. "print_type",
  1644. "printf",
  1645. "printf_i",
  1646. "printk",
  1647. "printk2",
  1648. "printks",
  1649. "printks2",
  1650. "prints",
  1651. "product",
  1652. "pset",
  1653. "ptable",
  1654. "ptable3",
  1655. "ptablei",
  1656. "ptableiw",
  1657. "ptablew",
  1658. "ptrack",
  1659. "puts",
  1660. "pvadd",
  1661. "pvbufread",
  1662. "pvcross",
  1663. "pvinterp",
  1664. "pvoc",
  1665. "pvread",
  1666. "pvs2array",
  1667. "pvs2tab",
  1668. "pvsadsyn",
  1669. "pvsanal",
  1670. "pvsarp",
  1671. "pvsbandp",
  1672. "pvsbandr",
  1673. "pvsbin",
  1674. "pvsblur",
  1675. "pvsbuffer",
  1676. "pvsbufread",
  1677. "pvsbufread2",
  1678. "pvscale",
  1679. "pvscent",
  1680. "pvsceps",
  1681. "pvscross",
  1682. "pvsdemix",
  1683. "pvsdiskin",
  1684. "pvsdisp",
  1685. "pvsenvftw",
  1686. "pvsfilter",
  1687. "pvsfread",
  1688. "pvsfreeze",
  1689. "pvsfromarray",
  1690. "pvsftr",
  1691. "pvsftw",
  1692. "pvsfwrite",
  1693. "pvsgain",
  1694. "pvsgendy",
  1695. "pvshift",
  1696. "pvsifd",
  1697. "pvsin",
  1698. "pvsinfo",
  1699. "pvsinit",
  1700. "pvslock",
  1701. "pvsmaska",
  1702. "pvsmix",
  1703. "pvsmooth",
  1704. "pvsmorph",
  1705. "pvsosc",
  1706. "pvsout",
  1707. "pvspitch",
  1708. "pvstanal",
  1709. "pvstencil",
  1710. "pvstrace",
  1711. "pvsvoc",
  1712. "pvswarp",
  1713. "pvsynth",
  1714. "pwd",
  1715. "pyassign",
  1716. "pyassigni",
  1717. "pyassignt",
  1718. "pycall",
  1719. "pycall1",
  1720. "pycall1i",
  1721. "pycall1t",
  1722. "pycall2",
  1723. "pycall2i",
  1724. "pycall2t",
  1725. "pycall3",
  1726. "pycall3i",
  1727. "pycall3t",
  1728. "pycall4",
  1729. "pycall4i",
  1730. "pycall4t",
  1731. "pycall5",
  1732. "pycall5i",
  1733. "pycall5t",
  1734. "pycall6",
  1735. "pycall6i",
  1736. "pycall6t",
  1737. "pycall7",
  1738. "pycall7i",
  1739. "pycall7t",
  1740. "pycall8",
  1741. "pycall8i",
  1742. "pycall8t",
  1743. "pycalli",
  1744. "pycalln",
  1745. "pycallni",
  1746. "pycallt",
  1747. "pyeval",
  1748. "pyevali",
  1749. "pyevalt",
  1750. "pyexec",
  1751. "pyexeci",
  1752. "pyexect",
  1753. "pyinit",
  1754. "pylassign",
  1755. "pylassigni",
  1756. "pylassignt",
  1757. "pylcall",
  1758. "pylcall1",
  1759. "pylcall1i",
  1760. "pylcall1t",
  1761. "pylcall2",
  1762. "pylcall2i",
  1763. "pylcall2t",
  1764. "pylcall3",
  1765. "pylcall3i",
  1766. "pylcall3t",
  1767. "pylcall4",
  1768. "pylcall4i",
  1769. "pylcall4t",
  1770. "pylcall5",
  1771. "pylcall5i",
  1772. "pylcall5t",
  1773. "pylcall6",
  1774. "pylcall6i",
  1775. "pylcall6t",
  1776. "pylcall7",
  1777. "pylcall7i",
  1778. "pylcall7t",
  1779. "pylcall8",
  1780. "pylcall8i",
  1781. "pylcall8t",
  1782. "pylcalli",
  1783. "pylcalln",
  1784. "pylcallni",
  1785. "pylcallt",
  1786. "pyleval",
  1787. "pylevali",
  1788. "pylevalt",
  1789. "pylexec",
  1790. "pylexeci",
  1791. "pylexect",
  1792. "pylrun",
  1793. "pylruni",
  1794. "pylrunt",
  1795. "pyrun",
  1796. "pyruni",
  1797. "pyrunt",
  1798. "qinf",
  1799. "qnan",
  1800. "r2c",
  1801. "rand",
  1802. "randh",
  1803. "randi",
  1804. "random",
  1805. "randomh",
  1806. "randomi",
  1807. "rbjeq",
  1808. "readclock",
  1809. "readf",
  1810. "readfi",
  1811. "readk",
  1812. "readk2",
  1813. "readk3",
  1814. "readk4",
  1815. "readks",
  1816. "readscore",
  1817. "readscratch",
  1818. "rect2pol",
  1819. "release",
  1820. "remoteport",
  1821. "remove",
  1822. "repluck",
  1823. "reson",
  1824. "resonk",
  1825. "resonr",
  1826. "resonx",
  1827. "resonxk",
  1828. "resony",
  1829. "resonz",
  1830. "resyn",
  1831. "reverb",
  1832. "reverb2",
  1833. "reverbsc",
  1834. "rewindscore",
  1835. "rezzy",
  1836. "rfft",
  1837. "rifft",
  1838. "rms",
  1839. "rnd",
  1840. "rnd31",
  1841. "round",
  1842. "rspline",
  1843. "rtclock",
  1844. "s16b14",
  1845. "s32b14",
  1846. "samphold",
  1847. "sandpaper",
  1848. "sc_lag",
  1849. "sc_lagud",
  1850. "sc_phasor",
  1851. "sc_trig",
  1852. "scale",
  1853. "scalearray",
  1854. "scanhammer",
  1855. "scans",
  1856. "scantable",
  1857. "scanu",
  1858. "schedkwhen",
  1859. "schedkwhennamed",
  1860. "schedule",
  1861. "schedwhen",
  1862. "scoreline",
  1863. "scoreline_i",
  1864. "seed",
  1865. "sekere",
  1866. "select",
  1867. "semitone",
  1868. "sense",
  1869. "sensekey",
  1870. "seqtime",
  1871. "seqtime2",
  1872. "serialBegin",
  1873. "serialEnd",
  1874. "serialFlush",
  1875. "serialPrint",
  1876. "serialRead",
  1877. "serialWrite",
  1878. "serialWrite_i",
  1879. "setcol",
  1880. "setctrl",
  1881. "setksmps",
  1882. "setrow",
  1883. "setscorepos",
  1884. "sfilist",
  1885. "sfinstr",
  1886. "sfinstr3",
  1887. "sfinstr3m",
  1888. "sfinstrm",
  1889. "sfload",
  1890. "sflooper",
  1891. "sfpassign",
  1892. "sfplay",
  1893. "sfplay3",
  1894. "sfplay3m",
  1895. "sfplaym",
  1896. "sfplist",
  1897. "sfpreset",
  1898. "shaker",
  1899. "shiftin",
  1900. "shiftout",
  1901. "signalflowgraph",
  1902. "signum",
  1903. "sin",
  1904. "sinh",
  1905. "sininv",
  1906. "sinsyn",
  1907. "sleighbells",
  1908. "slicearray",
  1909. "slider16",
  1910. "slider16f",
  1911. "slider16table",
  1912. "slider16tablef",
  1913. "slider32",
  1914. "slider32f",
  1915. "slider32table",
  1916. "slider32tablef",
  1917. "slider64",
  1918. "slider64f",
  1919. "slider64table",
  1920. "slider64tablef",
  1921. "slider8",
  1922. "slider8f",
  1923. "slider8table",
  1924. "slider8tablef",
  1925. "sliderKawai",
  1926. "sndloop",
  1927. "sndwarp",
  1928. "sndwarpst",
  1929. "sockrecv",
  1930. "sockrecvs",
  1931. "socksend",
  1932. "socksend_k",
  1933. "socksends",
  1934. "sorta",
  1935. "sortd",
  1936. "soundin",
  1937. "space",
  1938. "spat3d",
  1939. "spat3di",
  1940. "spat3dt",
  1941. "spdist",
  1942. "splitrig",
  1943. "sprintf",
  1944. "sprintfk",
  1945. "spsend",
  1946. "sqrt",
  1947. "statevar",
  1948. "stix",
  1949. "strcat",
  1950. "strcatk",
  1951. "strchar",
  1952. "strchark",
  1953. "strcmp",
  1954. "strcmpk",
  1955. "strcpy",
  1956. "strcpyk",
  1957. "strecv",
  1958. "streson",
  1959. "strfromurl",
  1960. "strget",
  1961. "strindex",
  1962. "strindexk",
  1963. "strlen",
  1964. "strlenk",
  1965. "strlower",
  1966. "strlowerk",
  1967. "strrindex",
  1968. "strrindexk",
  1969. "strset",
  1970. "strsub",
  1971. "strsubk",
  1972. "strtod",
  1973. "strtodk",
  1974. "strtol",
  1975. "strtolk",
  1976. "strupper",
  1977. "strupperk",
  1978. "stsend",
  1979. "subinstr",
  1980. "subinstrinit",
  1981. "sum",
  1982. "sumarray",
  1983. "svfilter",
  1984. "syncgrain",
  1985. "syncloop",
  1986. "syncphasor",
  1987. "system",
  1988. "system_i",
  1989. "tab",
  1990. "tab2pvs",
  1991. "tab_i",
  1992. "tabifd",
  1993. "table",
  1994. "table3",
  1995. "table3kt",
  1996. "tablecopy",
  1997. "tablefilter",
  1998. "tablefilteri",
  1999. "tablegpw",
  2000. "tablei",
  2001. "tableicopy",
  2002. "tableigpw",
  2003. "tableikt",
  2004. "tableimix",
  2005. "tableiw",
  2006. "tablekt",
  2007. "tablemix",
  2008. "tableng",
  2009. "tablera",
  2010. "tableseg",
  2011. "tableshuffle",
  2012. "tableshufflei",
  2013. "tablew",
  2014. "tablewa",
  2015. "tablewkt",
  2016. "tablexkt",
  2017. "tablexseg",
  2018. "tabmorph",
  2019. "tabmorpha",
  2020. "tabmorphak",
  2021. "tabmorphi",
  2022. "tabplay",
  2023. "tabrec",
  2024. "tabsum",
  2025. "tabw",
  2026. "tabw_i",
  2027. "tambourine",
  2028. "tan",
  2029. "tanh",
  2030. "taninv",
  2031. "taninv2",
  2032. "tb0",
  2033. "tb0_init",
  2034. "tb1",
  2035. "tb10",
  2036. "tb10_init",
  2037. "tb11",
  2038. "tb11_init",
  2039. "tb12",
  2040. "tb12_init",
  2041. "tb13",
  2042. "tb13_init",
  2043. "tb14",
  2044. "tb14_init",
  2045. "tb15",
  2046. "tb15_init",
  2047. "tb1_init",
  2048. "tb2",
  2049. "tb2_init",
  2050. "tb3",
  2051. "tb3_init",
  2052. "tb4",
  2053. "tb4_init",
  2054. "tb5",
  2055. "tb5_init",
  2056. "tb6",
  2057. "tb6_init",
  2058. "tb7",
  2059. "tb7_init",
  2060. "tb8",
  2061. "tb8_init",
  2062. "tb9",
  2063. "tb9_init",
  2064. "tbvcf",
  2065. "tempest",
  2066. "tempo",
  2067. "temposcal",
  2068. "tempoval",
  2069. "timedseq",
  2070. "timeinstk",
  2071. "timeinsts",
  2072. "timek",
  2073. "times",
  2074. "tival",
  2075. "tlineto",
  2076. "tone",
  2077. "tonek",
  2078. "tonex",
  2079. "tradsyn",
  2080. "trandom",
  2081. "transeg",
  2082. "transegb",
  2083. "transegr",
  2084. "trcross",
  2085. "trfilter",
  2086. "trhighest",
  2087. "trigger",
  2088. "trigseq",
  2089. "trirand",
  2090. "trlowest",
  2091. "trmix",
  2092. "trscale",
  2093. "trshift",
  2094. "trsplit",
  2095. "turnoff",
  2096. "turnoff2",
  2097. "turnon",
  2098. "tvconv",
  2099. "unirand",
  2100. "unwrap",
  2101. "upsamp",
  2102. "urandom",
  2103. "urd",
  2104. "vactrol",
  2105. "vadd",
  2106. "vadd_i",
  2107. "vaddv",
  2108. "vaddv_i",
  2109. "vaget",
  2110. "valpass",
  2111. "vaset",
  2112. "vbap",
  2113. "vbapg",
  2114. "vbapgmove",
  2115. "vbaplsinit",
  2116. "vbapmove",
  2117. "vbapz",
  2118. "vbapzmove",
  2119. "vcella",
  2120. "vco",
  2121. "vco2",
  2122. "vco2ft",
  2123. "vco2ift",
  2124. "vco2init",
  2125. "vcomb",
  2126. "vcopy",
  2127. "vcopy_i",
  2128. "vdel_k",
  2129. "vdelay",
  2130. "vdelay3",
  2131. "vdelayk",
  2132. "vdelayx",
  2133. "vdelayxq",
  2134. "vdelayxs",
  2135. "vdelayxw",
  2136. "vdelayxwq",
  2137. "vdelayxws",
  2138. "vdivv",
  2139. "vdivv_i",
  2140. "vecdelay",
  2141. "veloc",
  2142. "vexp",
  2143. "vexp_i",
  2144. "vexpseg",
  2145. "vexpv",
  2146. "vexpv_i",
  2147. "vibes",
  2148. "vibr",
  2149. "vibrato",
  2150. "vincr",
  2151. "vlimit",
  2152. "vlinseg",
  2153. "vlowres",
  2154. "vmap",
  2155. "vmirror",
  2156. "vmult",
  2157. "vmult_i",
  2158. "vmultv",
  2159. "vmultv_i",
  2160. "voice",
  2161. "vosim",
  2162. "vphaseseg",
  2163. "vport",
  2164. "vpow",
  2165. "vpow_i",
  2166. "vpowv",
  2167. "vpowv_i",
  2168. "vpvoc",
  2169. "vrandh",
  2170. "vrandi",
  2171. "vsubv",
  2172. "vsubv_i",
  2173. "vtaba",
  2174. "vtabi",
  2175. "vtabk",
  2176. "vtable1k",
  2177. "vtablea",
  2178. "vtablei",
  2179. "vtablek",
  2180. "vtablewa",
  2181. "vtablewi",
  2182. "vtablewk",
  2183. "vtabwa",
  2184. "vtabwi",
  2185. "vtabwk",
  2186. "vwrap",
  2187. "waveset",
  2188. "websocket",
  2189. "weibull",
  2190. "wgbow",
  2191. "wgbowedbar",
  2192. "wgbrass",
  2193. "wgclar",
  2194. "wgflute",
  2195. "wgpluck",
  2196. "wgpluck2",
  2197. "wguide1",
  2198. "wguide2",
  2199. "wiiconnect",
  2200. "wiidata",
  2201. "wiirange",
  2202. "wiisend",
  2203. "window",
  2204. "wrap",
  2205. "writescratch",
  2206. "wterrain",
  2207. "xadsr",
  2208. "xin",
  2209. "xout",
  2210. "xscanmap",
  2211. "xscans",
  2212. "xscansmap",
  2213. "xscanu",
  2214. "xtratim",
  2215. "xyscale",
  2216. "zacl",
  2217. "zakinit",
  2218. "zamod",
  2219. "zar",
  2220. "zarg",
  2221. "zaw",
  2222. "zawm",
  2223. "zdf_1pole",
  2224. "zdf_1pole_mode",
  2225. "zdf_2pole",
  2226. "zdf_2pole_mode",
  2227. "zdf_ladder",
  2228. "zfilter2",
  2229. "zir",
  2230. "ziw",
  2231. "ziwm",
  2232. "zkcl",
  2233. "zkmod",
  2234. "zkr",
  2235. "zkw",
  2236. "zkwm"
  2237. ];
  2238. var deprecatedOpcodes = [
  2239. "array",
  2240. "bformdec",
  2241. "bformenc",
  2242. "copy2ftab",
  2243. "copy2ttab",
  2244. "hrtfer",
  2245. "ktableseg",
  2246. "lentab",
  2247. "maxtab",
  2248. "mintab",
  2249. "pop",
  2250. "pop_f",
  2251. "push",
  2252. "push_f",
  2253. "scalet",
  2254. "sndload",
  2255. "soundout",
  2256. "soundouts",
  2257. "specaddm",
  2258. "specdiff",
  2259. "specdisp",
  2260. "specfilt",
  2261. "spechist",
  2262. "specptrk",
  2263. "specscal",
  2264. "specsum",
  2265. "spectrum",
  2266. "stack",
  2267. "sumtab",
  2268. "tabgen",
  2269. "tabmap",
  2270. "tabmap_i",
  2271. "tabslice",
  2272. "vbap16",
  2273. "vbap4",
  2274. "vbap4move",
  2275. "vbap8",
  2276. "vbap8move",
  2277. "xyin"
  2278. ];
  2279. opcodes = lang.arrayToMap(opcodes);
  2280. deprecatedOpcodes = lang.arrayToMap(deprecatedOpcodes);
  2281. this.lineContinuations = [
  2282. {
  2283. token : "constant.character.escape.line-continuation.csound",
  2284. regex : /\\$/
  2285. }, this.pushRule({
  2286. token : "constant.character.escape.line-continuation.csound",
  2287. regex : /\\/,
  2288. next : "line continuation"
  2289. })
  2290. ];
  2291. this.comments.push(this.lineContinuations);
  2292. this.quotedStringContents.push(
  2293. this.lineContinuations,
  2294. {
  2295. token : "invalid.illegal",
  2296. regex : /[^"\\]*$/
  2297. }
  2298. );
  2299. var start = this.$rules.start;
  2300. start.splice(1, 0, {
  2301. token : ["text.csound", "entity.name.label.csound", "entity.punctuation.label.csound", "text.csound"],
  2302. regex : /^([ \t]*)(\w+)(:)([ \t]+|$)/
  2303. });
  2304. start.push(
  2305. this.pushRule({
  2306. token : "keyword.function.csound",
  2307. regex : /\binstr\b/,
  2308. next : "instrument numbers and identifiers"
  2309. }), this.pushRule({
  2310. token : "keyword.function.csound",
  2311. regex : /\bopcode\b/,
  2312. next : "after opcode keyword"
  2313. }), {
  2314. token : "keyword.other.csound",
  2315. regex : /\bend(?:in|op)\b/
  2316. },
  2317. {
  2318. token : "variable.language.csound",
  2319. regex : /\b(?:0dbfs|A4|k(?:r|smps)|nchnls(?:_i)?|sr)\b/
  2320. },
  2321. this.numbers,
  2322. {
  2323. token : "keyword.operator.csound",
  2324. regex : "\\+=|-=|\\*=|/=|<<|>>|<=|>=|==|!=|&&|\\|\\||[~¬]|[=!+\\-*/^%&|<>#?:]"
  2325. },
  2326. this.pushRule({
  2327. token : "punctuation.definition.string.begin.csound",
  2328. regex : /"/,
  2329. next : "quoted string"
  2330. }), this.pushRule({
  2331. token : "punctuation.definition.string.begin.csound",
  2332. regex : /{{/,
  2333. next : "braced string"
  2334. }),
  2335. {
  2336. token : "keyword.control.csound",
  2337. regex : /\b(?:do|else(?:if)?|end(?:if|until)|fi|i(?:f|then)|kthen|od|r(?:ir)?eturn|then|until|while)\b/
  2338. },
  2339. this.pushRule({
  2340. token : "keyword.control.csound",
  2341. regex : /\b[ik]?goto\b/,
  2342. next : "goto before label"
  2343. }), this.pushRule({
  2344. token : "keyword.control.csound",
  2345. regex : /\b(?:r(?:einit|igoto)|tigoto)\b/,
  2346. next : "goto before label"
  2347. }), this.pushRule({
  2348. token : "keyword.control.csound",
  2349. regex : /\bc(?:g|in?|k|nk?)goto\b/,
  2350. next : ["goto before label", "goto before argument"]
  2351. }), this.pushRule({
  2352. token : "keyword.control.csound",
  2353. regex : /\btimout\b/,
  2354. next : ["goto before label", "goto before argument", "goto before argument"]
  2355. }), this.pushRule({
  2356. token : "keyword.control.csound",
  2357. regex : /\bloop_[gl][et]\b/,
  2358. next : ["goto before label", "goto before argument", "goto before argument", "goto before argument"]
  2359. }),
  2360. this.pushRule({
  2361. token : "support.function.csound",
  2362. regex : /\b(?:readscore|scoreline(?:_i)?)\b/,
  2363. next : "Csound score opcode"
  2364. }), this.pushRule({
  2365. token : "support.function.csound",
  2366. regex : /\bpyl?run[it]?\b(?!$)/,
  2367. next : "Python opcode"
  2368. }), this.pushRule({
  2369. token : "support.function.csound",
  2370. regex : /\blua_(?:exec|opdef)\b(?!$)/,
  2371. next : "Lua opcode"
  2372. }),
  2373. {
  2374. token : "support.variable.csound",
  2375. regex : /\bp\d+\b/
  2376. }, {
  2377. regex : /\b([A-Z_a-z]\w*)(?:(:)([A-Za-z]))?\b/, onMatch: function(value, currentState, stack, line) {
  2378. var tokens = value.split(this.splitRegex);
  2379. var name = tokens[1];
  2380. var type;
  2381. if (opcodes.hasOwnProperty(name))
  2382. type = "support.function.csound";
  2383. else if (deprecatedOpcodes.hasOwnProperty(name))
  2384. type = "invalid.deprecated.csound";
  2385. if (type) {
  2386. if (tokens[2]) {
  2387. return [
  2388. {type: type, value: name},
  2389. {type: "punctuation.type-annotation.csound", value: tokens[2]},
  2390. {type: "type-annotation.storage.type.csound", value: tokens[3]}
  2391. ];
  2392. }
  2393. return type;
  2394. }
  2395. return "text.csound";
  2396. }
  2397. }
  2398. );
  2399. this.$rules["macro parameter value list"].splice(2, 0, {
  2400. token : "punctuation.definition.string.begin.csound",
  2401. regex : /{{/,
  2402. next : "macro parameter value braced string"
  2403. });
  2404. this.addRules({
  2405. "macro parameter value braced string": [
  2406. {
  2407. token : "constant.character.escape.csound",
  2408. regex : /\\[#'()]/
  2409. }, {
  2410. token : "invalid.illegal.csound.csound",
  2411. regex : /[#'()]/
  2412. }, {
  2413. token : "punctuation.definition.string.end.csound",
  2414. regex : /}}/,
  2415. next : "macro parameter value list"
  2416. }, {
  2417. defaultToken: "string.braced.csound"
  2418. }
  2419. ],
  2420. "instrument numbers and identifiers": [
  2421. this.comments,
  2422. {
  2423. token : "entity.name.function.csound",
  2424. regex : /\d+|[A-Z_a-z]\w*/
  2425. }, this.popRule({
  2426. token : "empty",
  2427. regex : /$/
  2428. })
  2429. ],
  2430. "after opcode keyword": [
  2431. this.comments,
  2432. this.popRule({
  2433. token : "empty",
  2434. regex : /$/
  2435. }), this.popRule({
  2436. token : "entity.name.function.opcode.csound",
  2437. regex : /[A-Z_a-z]\w*/,
  2438. next : "opcode type signatures"
  2439. })
  2440. ],
  2441. "opcode type signatures": [
  2442. this.comments,
  2443. this.popRule({
  2444. token : "empty",
  2445. regex : /$/
  2446. }), {
  2447. token : "storage.type.csound",
  2448. regex : /\b(?:0|[afijkKoOpPStV\[\]]+)/
  2449. }
  2450. ],
  2451. "quoted string": [
  2452. this.popRule({
  2453. token : "punctuation.definition.string.end.csound",
  2454. regex : /"/
  2455. }),
  2456. this.quotedStringContents,
  2457. {
  2458. defaultToken: "string.quoted.csound"
  2459. }
  2460. ],
  2461. "braced string": [
  2462. this.popRule({
  2463. token : "punctuation.definition.string.end.csound",
  2464. regex : /}}/
  2465. }),
  2466. this.bracedStringContents,
  2467. {
  2468. defaultToken: "string.braced.csound"
  2469. }
  2470. ],
  2471. "goto before argument": [
  2472. this.popRule({
  2473. token : "text.csound",
  2474. regex : /,/
  2475. }),
  2476. start
  2477. ],
  2478. "goto before label": [
  2479. {
  2480. token : "text.csound",
  2481. regex : /\s+/
  2482. },
  2483. this.comments,
  2484. this.popRule({
  2485. token : "entity.name.label.csound",
  2486. regex : /\w+/
  2487. }), this.popRule({
  2488. token : "empty",
  2489. regex : /(?!\w)/
  2490. })
  2491. ],
  2492. "Csound score opcode": [
  2493. this.comments,
  2494. {
  2495. token : "punctuation.definition.string.begin.csound",
  2496. regex : /{{/,
  2497. next : "csound-score-start"
  2498. }, this.popRule({
  2499. token : "empty",
  2500. regex : /$/
  2501. })
  2502. ],
  2503. "Python opcode": [
  2504. this.comments,
  2505. {
  2506. token : "punctuation.definition.string.begin.csound",
  2507. regex : /{{/,
  2508. next : "python-start"
  2509. }, this.popRule({
  2510. token : "empty",
  2511. regex : /$/
  2512. })
  2513. ],
  2514. "Lua opcode": [
  2515. this.comments,
  2516. {
  2517. token : "punctuation.definition.string.begin.csound",
  2518. regex : /{{/,
  2519. next : "lua-start"
  2520. }, this.popRule({
  2521. token : "empty",
  2522. regex : /$/
  2523. })
  2524. ],
  2525. "line continuation": [
  2526. this.popRule({
  2527. token : "empty",
  2528. regex : /$/
  2529. }),
  2530. this.semicolonComments,
  2531. {
  2532. token : "invalid.illegal.csound",
  2533. regex : /\S.*/
  2534. }
  2535. ]
  2536. });
  2537. var rules = [
  2538. this.popRule({
  2539. token : "punctuation.definition.string.end.csound",
  2540. regex : /}}/
  2541. })
  2542. ];
  2543. this.embedRules(CsoundScoreHighlightRules, "csound-score-", rules);
  2544. this.embedRules(PythonHighlightRules, "python-", rules);
  2545. this.embedRules(LuaHighlightRules, "lua-", rules);
  2546. this.normalizeRules();
  2547. };
  2548. oop.inherits(CsoundOrchestraHighlightRules, CsoundPreprocessorHighlightRules);
  2549. exports.CsoundOrchestraHighlightRules = CsoundOrchestraHighlightRules;
  2550. });
  2551. ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2552. "use strict";
  2553. var oop = acequire("../lib/oop");
  2554. var lang = acequire("../lib/lang");
  2555. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  2556. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  2557. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  2558. var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero";
  2559. var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen";
  2560. var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace";
  2561. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
  2562. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  2563. var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|acequired|root|target|valid|visited)\\b";
  2564. var CssHighlightRules = function() {
  2565. var keywordMapper = this.createKeywordMapper({
  2566. "support.function": supportFunction,
  2567. "support.constant": supportConstant,
  2568. "support.type": supportType,
  2569. "support.constant.color": supportConstantColor,
  2570. "support.constant.fonts": supportConstantFonts
  2571. }, "text", true);
  2572. this.$rules = {
  2573. "start" : [{
  2574. include : ["strings", "url", "comments"]
  2575. }, {
  2576. token: "paren.lparen",
  2577. regex: "\\{",
  2578. next: "ruleset"
  2579. }, {
  2580. token: "paren.rparen",
  2581. regex: "\\}"
  2582. }, {
  2583. token: "string",
  2584. regex: "@",
  2585. next: "media"
  2586. }, {
  2587. token: "keyword",
  2588. regex: "#[a-z0-9-_]+"
  2589. }, {
  2590. token: "keyword",
  2591. regex: "%"
  2592. }, {
  2593. token: "variable",
  2594. regex: "\\.[a-z0-9-_]+"
  2595. }, {
  2596. token: "string",
  2597. regex: ":[a-z0-9-_]+"
  2598. }, {
  2599. token : "constant.numeric",
  2600. regex : numRe
  2601. }, {
  2602. token: "constant",
  2603. regex: "[a-z0-9-_]+"
  2604. }, {
  2605. caseInsensitive: true
  2606. }],
  2607. "media": [{
  2608. include : ["strings", "url", "comments"]
  2609. }, {
  2610. token: "paren.lparen",
  2611. regex: "\\{",
  2612. next: "start"
  2613. }, {
  2614. token: "paren.rparen",
  2615. regex: "\\}",
  2616. next: "start"
  2617. }, {
  2618. token: "string",
  2619. regex: ";",
  2620. next: "start"
  2621. }, {
  2622. token: "keyword",
  2623. regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
  2624. + "|page|font|keyframes|viewport|counter-style|font-feature-values"
  2625. + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
  2626. }],
  2627. "comments" : [{
  2628. token: "comment", // multi line comment
  2629. regex: "\\/\\*",
  2630. push: [{
  2631. token : "comment",
  2632. regex : "\\*\\/",
  2633. next : "pop"
  2634. }, {
  2635. defaultToken : "comment"
  2636. }]
  2637. }],
  2638. "ruleset" : [{
  2639. regex : "-(webkit|ms|moz|o)-",
  2640. token : "text"
  2641. }, {
  2642. token : "paren.rparen",
  2643. regex : "\\}",
  2644. next : "start"
  2645. }, {
  2646. include : ["strings", "url", "comments"]
  2647. }, {
  2648. token : ["constant.numeric", "keyword"],
  2649. regex : "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)"
  2650. }, {
  2651. token : "constant.numeric",
  2652. regex : numRe
  2653. }, {
  2654. token : "constant.numeric", // hex6 color
  2655. regex : "#[a-f0-9]{6}"
  2656. }, {
  2657. token : "constant.numeric", // hex3 color
  2658. regex : "#[a-f0-9]{3}"
  2659. }, {
  2660. token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  2661. regex : pseudoElements
  2662. }, {
  2663. token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  2664. regex : pseudoClasses
  2665. }, {
  2666. include: "url"
  2667. }, {
  2668. token : keywordMapper,
  2669. regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  2670. }, {
  2671. caseInsensitive: true
  2672. }],
  2673. url: [{
  2674. token : "support.function",
  2675. regex : "(?:url(:?-prefix)?|domain|regexp)\\(",
  2676. push: [{
  2677. token : "support.function",
  2678. regex : "\\)",
  2679. next : "pop"
  2680. }, {
  2681. defaultToken: "string"
  2682. }]
  2683. }],
  2684. strings: [{
  2685. token : "string.start",
  2686. regex : "'",
  2687. push : [{
  2688. token : "string.end",
  2689. regex : "'|$",
  2690. next: "pop"
  2691. }, {
  2692. include : "escapes"
  2693. }, {
  2694. token : "constant.language.escape",
  2695. regex : /\\$/,
  2696. consumeLineEnd: true
  2697. }, {
  2698. defaultToken: "string"
  2699. }]
  2700. }, {
  2701. token : "string.start",
  2702. regex : '"',
  2703. push : [{
  2704. token : "string.end",
  2705. regex : '"|$',
  2706. next: "pop"
  2707. }, {
  2708. include : "escapes"
  2709. }, {
  2710. token : "constant.language.escape",
  2711. regex : /\\$/,
  2712. consumeLineEnd: true
  2713. }, {
  2714. defaultToken: "string"
  2715. }]
  2716. }],
  2717. escapes: [{
  2718. token : "constant.language.escape",
  2719. regex : /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
  2720. }]
  2721. };
  2722. this.normalizeRules();
  2723. };
  2724. oop.inherits(CssHighlightRules, TextHighlightRules);
  2725. exports.CssHighlightRules = CssHighlightRules;
  2726. });
  2727. ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2728. "use strict";
  2729. var oop = acequire("../lib/oop");
  2730. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  2731. var DocCommentHighlightRules = function() {
  2732. this.$rules = {
  2733. "start" : [ {
  2734. token : "comment.doc.tag",
  2735. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  2736. },
  2737. DocCommentHighlightRules.getTagRule(),
  2738. {
  2739. defaultToken : "comment.doc",
  2740. caseInsensitive: true
  2741. }]
  2742. };
  2743. };
  2744. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  2745. DocCommentHighlightRules.getTagRule = function(start) {
  2746. return {
  2747. token : "comment.doc.tag.storage.type",
  2748. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  2749. };
  2750. };
  2751. DocCommentHighlightRules.getStartRule = function(start) {
  2752. return {
  2753. token : "comment.doc", // doc comment
  2754. regex : "\\/\\*(?=\\*)",
  2755. next : start
  2756. };
  2757. };
  2758. DocCommentHighlightRules.getEndRule = function (start) {
  2759. return {
  2760. token : "comment.doc", // closing comment
  2761. regex : "\\*\\/",
  2762. next : start
  2763. };
  2764. };
  2765. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  2766. });
  2767. ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  2768. "use strict";
  2769. var oop = acequire("../lib/oop");
  2770. var DocCommentHighlightRules = acequire("./doc_comment_highlight_rules").DocCommentHighlightRules;
  2771. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  2772. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  2773. var JavaScriptHighlightRules = function(options) {
  2774. var keywordMapper = this.createKeywordMapper({
  2775. "variable.language":
  2776. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  2777. "Namespace|QName|XML|XMLList|" + // E4X
  2778. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  2779. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  2780. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  2781. "SyntaxError|TypeError|URIError|" +
  2782. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  2783. "isNaN|parseFloat|parseInt|" +
  2784. "JSON|Math|" + // Other
  2785. "this|arguments|prototype|window|document" , // Pseudo
  2786. "keyword":
  2787. "const|yield|import|get|set|async|await|" +
  2788. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  2789. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  2790. "__parent__|__count__|escape|unescape|with|__proto__|" +
  2791. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  2792. "storage.type":
  2793. "const|let|var|function",
  2794. "constant.language":
  2795. "null|Infinity|NaN|undefined",
  2796. "support.function":
  2797. "alert",
  2798. "constant.language.boolean": "true|false"
  2799. }, "identifier");
  2800. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  2801. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  2802. "u[0-9a-fA-F]{4}|" + // unicode
  2803. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  2804. "[0-2][0-7]{0,2}|" + // oct
  2805. "3[0-7][0-7]?|" + // oct
  2806. "[4-7][0-7]?|" + //oct
  2807. ".)";
  2808. this.$rules = {
  2809. "no_regex" : [
  2810. DocCommentHighlightRules.getStartRule("doc-start"),
  2811. comments("no_regex"),
  2812. {
  2813. token : "string",
  2814. regex : "'(?=.)",
  2815. next : "qstring"
  2816. }, {
  2817. token : "string",
  2818. regex : '"(?=.)',
  2819. next : "qqstring"
  2820. }, {
  2821. token : "constant.numeric", // hexadecimal, octal and binary
  2822. regex : /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  2823. }, {
  2824. token : "constant.numeric", // decimal integers and floats
  2825. regex : /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  2826. }, {
  2827. token : [
  2828. "storage.type", "punctuation.operator", "support.function",
  2829. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  2830. ],
  2831. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  2832. next: "function_arguments"
  2833. }, {
  2834. token : [
  2835. "storage.type", "punctuation.operator", "entity.name.function", "text",
  2836. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  2837. ],
  2838. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  2839. next: "function_arguments"
  2840. }, {
  2841. token : [
  2842. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  2843. "text", "paren.lparen"
  2844. ],
  2845. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  2846. next: "function_arguments"
  2847. }, {
  2848. token : [
  2849. "storage.type", "punctuation.operator", "entity.name.function", "text",
  2850. "keyword.operator", "text",
  2851. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  2852. ],
  2853. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  2854. next: "function_arguments"
  2855. }, {
  2856. token : [
  2857. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  2858. ],
  2859. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  2860. next: "function_arguments"
  2861. }, {
  2862. token : [
  2863. "entity.name.function", "text", "punctuation.operator",
  2864. "text", "storage.type", "text", "paren.lparen"
  2865. ],
  2866. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  2867. next: "function_arguments"
  2868. }, {
  2869. token : [
  2870. "text", "text", "storage.type", "text", "paren.lparen"
  2871. ],
  2872. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  2873. next: "function_arguments"
  2874. }, {
  2875. token : "keyword",
  2876. regex : "from(?=\\s*('|\"))"
  2877. }, {
  2878. token : "keyword",
  2879. regex : "(?:" + kwBeforeRe + ")\\b",
  2880. next : "start"
  2881. }, {
  2882. token : ["support.constant"],
  2883. regex : /that\b/
  2884. }, {
  2885. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  2886. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  2887. }, {
  2888. token : keywordMapper,
  2889. regex : identifierRe
  2890. }, {
  2891. token : "punctuation.operator",
  2892. regex : /[.](?![.])/,
  2893. next : "property"
  2894. }, {
  2895. token : "storage.type",
  2896. regex : /=>/
  2897. }, {
  2898. token : "keyword.operator",
  2899. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  2900. next : "start"
  2901. }, {
  2902. token : "punctuation.operator",
  2903. regex : /[?:,;.]/,
  2904. next : "start"
  2905. }, {
  2906. token : "paren.lparen",
  2907. regex : /[\[({]/,
  2908. next : "start"
  2909. }, {
  2910. token : "paren.rparen",
  2911. regex : /[\])}]/
  2912. }, {
  2913. token: "comment",
  2914. regex: /^#!.*$/
  2915. }
  2916. ],
  2917. property: [{
  2918. token : "text",
  2919. regex : "\\s+"
  2920. }, {
  2921. token : [
  2922. "storage.type", "punctuation.operator", "entity.name.function", "text",
  2923. "keyword.operator", "text",
  2924. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  2925. ],
  2926. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  2927. next: "function_arguments"
  2928. }, {
  2929. token : "punctuation.operator",
  2930. regex : /[.](?![.])/
  2931. }, {
  2932. token : "support.function",
  2933. regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  2934. }, {
  2935. token : "support.function.dom",
  2936. regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  2937. }, {
  2938. token : "support.constant",
  2939. regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  2940. }, {
  2941. token : "identifier",
  2942. regex : identifierRe
  2943. }, {
  2944. regex: "",
  2945. token: "empty",
  2946. next: "no_regex"
  2947. }
  2948. ],
  2949. "start": [
  2950. DocCommentHighlightRules.getStartRule("doc-start"),
  2951. comments("start"),
  2952. {
  2953. token: "string.regexp",
  2954. regex: "\\/",
  2955. next: "regex"
  2956. }, {
  2957. token : "text",
  2958. regex : "\\s+|^$",
  2959. next : "start"
  2960. }, {
  2961. token: "empty",
  2962. regex: "",
  2963. next: "no_regex"
  2964. }
  2965. ],
  2966. "regex": [
  2967. {
  2968. token: "regexp.keyword.operator",
  2969. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  2970. }, {
  2971. token: "string.regexp",
  2972. regex: "/[sxngimy]*",
  2973. next: "no_regex"
  2974. }, {
  2975. token : "invalid",
  2976. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  2977. }, {
  2978. token : "constant.language.escape",
  2979. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  2980. }, {
  2981. token : "constant.language.delimiter",
  2982. regex: /\|/
  2983. }, {
  2984. token: "constant.language.escape",
  2985. regex: /\[\^?/,
  2986. next: "regex_character_class"
  2987. }, {
  2988. token: "empty",
  2989. regex: "$",
  2990. next: "no_regex"
  2991. }, {
  2992. defaultToken: "string.regexp"
  2993. }
  2994. ],
  2995. "regex_character_class": [
  2996. {
  2997. token: "regexp.charclass.keyword.operator",
  2998. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  2999. }, {
  3000. token: "constant.language.escape",
  3001. regex: "]",
  3002. next: "regex"
  3003. }, {
  3004. token: "constant.language.escape",
  3005. regex: "-"
  3006. }, {
  3007. token: "empty",
  3008. regex: "$",
  3009. next: "no_regex"
  3010. }, {
  3011. defaultToken: "string.regexp.charachterclass"
  3012. }
  3013. ],
  3014. "function_arguments": [
  3015. {
  3016. token: "variable.parameter",
  3017. regex: identifierRe
  3018. }, {
  3019. token: "punctuation.operator",
  3020. regex: "[, ]+"
  3021. }, {
  3022. token: "punctuation.operator",
  3023. regex: "$"
  3024. }, {
  3025. token: "empty",
  3026. regex: "",
  3027. next: "no_regex"
  3028. }
  3029. ],
  3030. "qqstring" : [
  3031. {
  3032. token : "constant.language.escape",
  3033. regex : escapedRe
  3034. }, {
  3035. token : "string",
  3036. regex : "\\\\$",
  3037. consumeLineEnd : true
  3038. }, {
  3039. token : "string",
  3040. regex : '"|$',
  3041. next : "no_regex"
  3042. }, {
  3043. defaultToken: "string"
  3044. }
  3045. ],
  3046. "qstring" : [
  3047. {
  3048. token : "constant.language.escape",
  3049. regex : escapedRe
  3050. }, {
  3051. token : "string",
  3052. regex : "\\\\$",
  3053. consumeLineEnd : true
  3054. }, {
  3055. token : "string",
  3056. regex : "'|$",
  3057. next : "no_regex"
  3058. }, {
  3059. defaultToken: "string"
  3060. }
  3061. ]
  3062. };
  3063. if (!options || !options.noES6) {
  3064. this.$rules.no_regex.unshift({
  3065. regex: "[{}]", onMatch: function(val, state, stack) {
  3066. this.next = val == "{" ? this.nextState : "";
  3067. if (val == "{" && stack.length) {
  3068. stack.unshift("start", state);
  3069. }
  3070. else if (val == "}" && stack.length) {
  3071. stack.shift();
  3072. this.next = stack.shift();
  3073. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  3074. return "paren.quasi.end";
  3075. }
  3076. return val == "{" ? "paren.lparen" : "paren.rparen";
  3077. },
  3078. nextState: "start"
  3079. }, {
  3080. token : "string.quasi.start",
  3081. regex : /`/,
  3082. push : [{
  3083. token : "constant.language.escape",
  3084. regex : escapedRe
  3085. }, {
  3086. token : "paren.quasi.start",
  3087. regex : /\${/,
  3088. push : "start"
  3089. }, {
  3090. token : "string.quasi.end",
  3091. regex : /`/,
  3092. next : "pop"
  3093. }, {
  3094. defaultToken: "string.quasi"
  3095. }]
  3096. });
  3097. if (!options || options.jsx != false)
  3098. JSX.call(this);
  3099. }
  3100. this.embedRules(DocCommentHighlightRules, "doc-",
  3101. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  3102. this.normalizeRules();
  3103. };
  3104. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  3105. function JSX() {
  3106. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  3107. var jsxTag = {
  3108. onMatch : function(val, state, stack) {
  3109. var offset = val.charAt(1) == "/" ? 2 : 1;
  3110. if (offset == 1) {
  3111. if (state != this.nextState)
  3112. stack.unshift(this.next, this.nextState, 0);
  3113. else
  3114. stack.unshift(this.next);
  3115. stack[2]++;
  3116. } else if (offset == 2) {
  3117. if (state == this.nextState) {
  3118. stack[1]--;
  3119. if (!stack[1] || stack[1] < 0) {
  3120. stack.shift();
  3121. stack.shift();
  3122. }
  3123. }
  3124. }
  3125. return [{
  3126. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  3127. value: val.slice(0, offset)
  3128. }, {
  3129. type: "meta.tag.tag-name.xml",
  3130. value: val.substr(offset)
  3131. }];
  3132. },
  3133. regex : "</?" + tagRegex + "",
  3134. next: "jsxAttributes",
  3135. nextState: "jsx"
  3136. };
  3137. this.$rules.start.unshift(jsxTag);
  3138. var jsxJsRule = {
  3139. regex: "{",
  3140. token: "paren.quasi.start",
  3141. push: "start"
  3142. };
  3143. this.$rules.jsx = [
  3144. jsxJsRule,
  3145. jsxTag,
  3146. {include : "reference"},
  3147. {defaultToken: "string"}
  3148. ];
  3149. this.$rules.jsxAttributes = [{
  3150. token : "meta.tag.punctuation.tag-close.xml",
  3151. regex : "/?>",
  3152. onMatch : function(value, currentState, stack) {
  3153. if (currentState == stack[0])
  3154. stack.shift();
  3155. if (value.length == 2) {
  3156. if (stack[0] == this.nextState)
  3157. stack[1]--;
  3158. if (!stack[1] || stack[1] < 0) {
  3159. stack.splice(0, 2);
  3160. }
  3161. }
  3162. this.next = stack[0] || "start";
  3163. return [{type: this.token, value: value}];
  3164. },
  3165. nextState: "jsx"
  3166. },
  3167. jsxJsRule,
  3168. comments("jsxAttributes"),
  3169. {
  3170. token : "entity.other.attribute-name.xml",
  3171. regex : tagRegex
  3172. }, {
  3173. token : "keyword.operator.attribute-equals.xml",
  3174. regex : "="
  3175. }, {
  3176. token : "text.tag-whitespace.xml",
  3177. regex : "\\s+"
  3178. }, {
  3179. token : "string.attribute-value.xml",
  3180. regex : "'",
  3181. stateName : "jsx_attr_q",
  3182. push : [
  3183. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  3184. {include : "reference"},
  3185. {defaultToken : "string.attribute-value.xml"}
  3186. ]
  3187. }, {
  3188. token : "string.attribute-value.xml",
  3189. regex : '"',
  3190. stateName : "jsx_attr_qq",
  3191. push : [
  3192. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  3193. {include : "reference"},
  3194. {defaultToken : "string.attribute-value.xml"}
  3195. ]
  3196. },
  3197. jsxTag
  3198. ];
  3199. this.$rules.reference = [{
  3200. token : "constant.language.escape.reference.xml",
  3201. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  3202. }];
  3203. }
  3204. function comments(next) {
  3205. return [
  3206. {
  3207. token : "comment", // multi line comment
  3208. regex : /\/\*/,
  3209. next: [
  3210. DocCommentHighlightRules.getTagRule(),
  3211. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  3212. {defaultToken : "comment", caseInsensitive: true}
  3213. ]
  3214. }, {
  3215. token : "comment",
  3216. regex : "\\/\\/",
  3217. next: [
  3218. DocCommentHighlightRules.getTagRule(),
  3219. {token : "comment", regex : "$|^", next : next || "pop"},
  3220. {defaultToken : "comment", caseInsensitive: true}
  3221. ]
  3222. }
  3223. ];
  3224. }
  3225. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  3226. });
  3227. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  3228. "use strict";
  3229. var oop = acequire("../lib/oop");
  3230. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  3231. var XmlHighlightRules = function(normalize) {
  3232. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  3233. this.$rules = {
  3234. start : [
  3235. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  3236. {
  3237. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  3238. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
  3239. },
  3240. {token : "comment.start.xml", regex : "<\\!--", next : "comment"},
  3241. {
  3242. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  3243. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  3244. },
  3245. {include : "tag"},
  3246. {token : "text.end-tag-open.xml", regex: "</"},
  3247. {token : "text.tag-open.xml", regex: "<"},
  3248. {include : "reference"},
  3249. {defaultToken : "text.xml"}
  3250. ],
  3251. processing_instruction : [{
  3252. token : "entity.other.attribute-name.decl-attribute-name.xml",
  3253. regex : tagRegex
  3254. }, {
  3255. token : "keyword.operator.decl-attribute-equals.xml",
  3256. regex : "="
  3257. }, {
  3258. include: "whitespace"
  3259. }, {
  3260. include: "string"
  3261. }, {
  3262. token : "punctuation.xml-decl.xml",
  3263. regex : "\\?>",
  3264. next : "start"
  3265. }],
  3266. doctype : [
  3267. {include : "whitespace"},
  3268. {include : "string"},
  3269. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  3270. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  3271. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  3272. ],
  3273. int_subset : [{
  3274. token : "text.xml",
  3275. regex : "\\s+"
  3276. }, {
  3277. token: "punctuation.int-subset.xml",
  3278. regex: "]",
  3279. next: "pop"
  3280. }, {
  3281. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  3282. regex : "(<\\!)(" + tagRegex + ")",
  3283. push : [{
  3284. token : "text",
  3285. regex : "\\s+"
  3286. },
  3287. {
  3288. token : "punctuation.markup-decl.xml",
  3289. regex : ">",
  3290. next : "pop"
  3291. },
  3292. {include : "string"}]
  3293. }],
  3294. cdata : [
  3295. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  3296. {token : "text.xml", regex : "\\s+"},
  3297. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  3298. ],
  3299. comment : [
  3300. {token : "comment.end.xml", regex : "-->", next : "start"},
  3301. {defaultToken : "comment.xml"}
  3302. ],
  3303. reference : [{
  3304. token : "constant.language.escape.reference.xml",
  3305. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  3306. }],
  3307. attr_reference : [{
  3308. token : "constant.language.escape.reference.attribute-value.xml",
  3309. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  3310. }],
  3311. tag : [{
  3312. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  3313. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  3314. next: [
  3315. {include : "attributes"},
  3316. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  3317. ]
  3318. }],
  3319. tag_whitespace : [
  3320. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  3321. ],
  3322. whitespace : [
  3323. {token : "text.whitespace.xml", regex : "\\s+"}
  3324. ],
  3325. string: [{
  3326. token : "string.xml",
  3327. regex : "'",
  3328. push : [
  3329. {token : "string.xml", regex: "'", next: "pop"},
  3330. {defaultToken : "string.xml"}
  3331. ]
  3332. }, {
  3333. token : "string.xml",
  3334. regex : '"',
  3335. push : [
  3336. {token : "string.xml", regex: '"', next: "pop"},
  3337. {defaultToken : "string.xml"}
  3338. ]
  3339. }],
  3340. attributes: [{
  3341. token : "entity.other.attribute-name.xml",
  3342. regex : tagRegex
  3343. }, {
  3344. token : "keyword.operator.attribute-equals.xml",
  3345. regex : "="
  3346. }, {
  3347. include: "tag_whitespace"
  3348. }, {
  3349. include: "attribute_value"
  3350. }],
  3351. attribute_value: [{
  3352. token : "string.attribute-value.xml",
  3353. regex : "'",
  3354. push : [
  3355. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  3356. {include : "attr_reference"},
  3357. {defaultToken : "string.attribute-value.xml"}
  3358. ]
  3359. }, {
  3360. token : "string.attribute-value.xml",
  3361. regex : '"',
  3362. push : [
  3363. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  3364. {include : "attr_reference"},
  3365. {defaultToken : "string.attribute-value.xml"}
  3366. ]
  3367. }]
  3368. };
  3369. if (this.constructor === XmlHighlightRules)
  3370. this.normalizeRules();
  3371. };
  3372. (function() {
  3373. this.embedTagRules = function(HighlightRules, prefix, tag){
  3374. this.$rules.tag.unshift({
  3375. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  3376. regex : "(<)(" + tag + "(?=\\s|>|$))",
  3377. next: [
  3378. {include : "attributes"},
  3379. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  3380. ]
  3381. });
  3382. this.$rules[tag + "-end"] = [
  3383. {include : "attributes"},
  3384. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  3385. onMatch : function(value, currentState, stack) {
  3386. stack.splice(0);
  3387. return this.token;
  3388. }}
  3389. ];
  3390. this.embedRules(HighlightRules, prefix, [{
  3391. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  3392. regex : "(</)(" + tag + "(?=\\s|>|$))",
  3393. next: tag + "-end"
  3394. }, {
  3395. token: "string.cdata.xml",
  3396. regex : "<\\!\\[CDATA\\["
  3397. }, {
  3398. token: "string.cdata.xml",
  3399. regex : "\\]\\]>"
  3400. }]);
  3401. };
  3402. }).call(TextHighlightRules.prototype);
  3403. oop.inherits(XmlHighlightRules, TextHighlightRules);
  3404. exports.XmlHighlightRules = XmlHighlightRules;
  3405. });
  3406. ace.define("ace/mode/html_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/css_highlight_rules","ace/mode/javascript_highlight_rules","ace/mode/xml_highlight_rules"], function(acequire, exports, module) {
  3407. "use strict";
  3408. var oop = acequire("../lib/oop");
  3409. var lang = acequire("../lib/lang");
  3410. var CssHighlightRules = acequire("./css_highlight_rules").CssHighlightRules;
  3411. var JavaScriptHighlightRules = acequire("./javascript_highlight_rules").JavaScriptHighlightRules;
  3412. var XmlHighlightRules = acequire("./xml_highlight_rules").XmlHighlightRules;
  3413. var tagMap = lang.createMap({
  3414. a : 'anchor',
  3415. button : 'form',
  3416. form : 'form',
  3417. img : 'image',
  3418. input : 'form',
  3419. label : 'form',
  3420. option : 'form',
  3421. script : 'script',
  3422. select : 'form',
  3423. textarea : 'form',
  3424. style : 'style',
  3425. table : 'table',
  3426. tbody : 'table',
  3427. td : 'table',
  3428. tfoot : 'table',
  3429. th : 'table',
  3430. tr : 'table'
  3431. });
  3432. var HtmlHighlightRules = function() {
  3433. XmlHighlightRules.call(this);
  3434. this.addRules({
  3435. attributes: [{
  3436. include : "tag_whitespace"
  3437. }, {
  3438. token : "entity.other.attribute-name.xml",
  3439. regex : "[-_a-zA-Z0-9:.]+"
  3440. }, {
  3441. token : "keyword.operator.attribute-equals.xml",
  3442. regex : "=",
  3443. push : [{
  3444. include: "tag_whitespace"
  3445. }, {
  3446. token : "string.unquoted.attribute-value.html",
  3447. regex : "[^<>='\"`\\s]+",
  3448. next : "pop"
  3449. }, {
  3450. token : "empty",
  3451. regex : "",
  3452. next : "pop"
  3453. }]
  3454. }, {
  3455. include : "attribute_value"
  3456. }],
  3457. tag: [{
  3458. token : function(start, tag) {
  3459. var group = tagMap[tag];
  3460. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  3461. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  3462. },
  3463. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  3464. next: "tag_stuff"
  3465. }],
  3466. tag_stuff: [
  3467. {include : "attributes"},
  3468. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  3469. ]
  3470. });
  3471. this.embedTagRules(CssHighlightRules, "css-", "style");
  3472. this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
  3473. if (this.constructor === HtmlHighlightRules)
  3474. this.normalizeRules();
  3475. };
  3476. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  3477. exports.HtmlHighlightRules = HtmlHighlightRules;
  3478. });
  3479. ace.define("ace/mode/csound_document_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/csound_orchestra_highlight_rules","ace/mode/csound_score_highlight_rules","ace/mode/html_highlight_rules","ace/mode/text_highlight_rules"], function(acequire, exports, module) {
  3480. "use strict";
  3481. var oop = acequire("../lib/oop");
  3482. var CsoundOrchestraHighlightRules = acequire("./csound_orchestra_highlight_rules").CsoundOrchestraHighlightRules;
  3483. var CsoundScoreHighlightRules = acequire("./csound_score_highlight_rules").CsoundScoreHighlightRules;
  3484. var HtmlHighlightRules = acequire("./html_highlight_rules").HtmlHighlightRules;
  3485. var TextHighlightRules = acequire("./text_highlight_rules").TextHighlightRules;
  3486. var CsoundDocumentHighlightRules = function() {
  3487. this.$rules = {
  3488. "start": [
  3489. {
  3490. token : ["meta.tag.punctuation.tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3491. regex : /(<)(CsoundSynthesi[sz]er)(>)/,
  3492. next : "synthesizer"
  3493. },
  3494. {defaultToken : "text.csound-document"}
  3495. ],
  3496. "synthesizer": [
  3497. {
  3498. token : ["meta.tag.punctuation.end-tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3499. regex : "(</)(CsoundSynthesi[sz]er)(>)",
  3500. next : "start"
  3501. }, {
  3502. token : ["meta.tag.punctuation.tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3503. regex : "(<)(CsInstruments)(>)",
  3504. next : "csound-start"
  3505. }, {
  3506. token : ["meta.tag.punctuation.tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3507. regex : "(<)(CsScore)(>)",
  3508. next : "csound-score-start"
  3509. }, {
  3510. token : ["meta.tag.punctuation.tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3511. regex : "(<)([Hh][Tt][Mm][Ll])(>)",
  3512. next : "html-start"
  3513. }
  3514. ]
  3515. };
  3516. this.embedRules(CsoundOrchestraHighlightRules, "csound-", [{
  3517. token : ["meta.tag.punctuation.end-tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3518. regex : "(</)(CsInstruments)(>)",
  3519. next : "synthesizer"
  3520. }]);
  3521. this.embedRules(CsoundScoreHighlightRules, "csound-score-", [{
  3522. token : ["meta.tag.punctuation.end-tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3523. regex : "(</)(CsScore)(>)",
  3524. next : "synthesizer"
  3525. }]);
  3526. this.embedRules(HtmlHighlightRules, "html-", [{
  3527. token : ["meta.tag.punctuation.end-tag-open.csound-document", "entity.name.tag.begin.csound-document", "meta.tag.punctuation.tag-close.csound-document"],
  3528. regex : "(</)([Hh][Tt][Mm][Ll])(>)",
  3529. next : "synthesizer"
  3530. }]);
  3531. this.normalizeRules();
  3532. };
  3533. oop.inherits(CsoundDocumentHighlightRules, TextHighlightRules);
  3534. exports.CsoundDocumentHighlightRules = CsoundDocumentHighlightRules;
  3535. });
  3536. ace.define("ace/mode/csound_document",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/csound_document_highlight_rules"], function(acequire, exports, module) {
  3537. "use strict";
  3538. var oop = acequire("../lib/oop");
  3539. var TextMode = acequire("./text").Mode;
  3540. var CsoundDocumentHighlightRules = acequire("./csound_document_highlight_rules").CsoundDocumentHighlightRules;
  3541. var Mode = function() {
  3542. this.HighlightRules = CsoundDocumentHighlightRules;
  3543. };
  3544. oop.inherits(Mode, TextMode);
  3545. exports.Mode = Mode;
  3546. });