3cbddc141c4d2eb71e54fe3037547812.js 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642
  1. ace.define("ace/mode/mushcode_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){/*
  2. * MUSHCodeMode
  3. */
  4. "use strict";
  5. var oop = require("../lib/oop");
  6. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  7. var MushCodeRules = function () {
  8. var keywords = ("@if|" +
  9. "@ifelse|" +
  10. "@switch|" +
  11. "@halt|" +
  12. "@dolist|" +
  13. "@create|" +
  14. "@scent|" +
  15. "@sound|" +
  16. "@touch|" +
  17. "@ataste|" +
  18. "@osound|" +
  19. "@ahear|" +
  20. "@aahear|" +
  21. "@amhear|" +
  22. "@otouch|" +
  23. "@otaste|" +
  24. "@drop|" +
  25. "@odrop|" +
  26. "@adrop|" +
  27. "@dropfail|" +
  28. "@odropfail|" +
  29. "@smell|" +
  30. "@oemit|" +
  31. "@emit|" +
  32. "@pemit|" +
  33. "@parent|" +
  34. "@clone|" +
  35. "@taste|" +
  36. "whisper|" +
  37. "page|" +
  38. "say|" +
  39. "pose|" +
  40. "semipose|" +
  41. "teach|" +
  42. "touch|" +
  43. "taste|" +
  44. "smell|" +
  45. "listen|" +
  46. "look|" +
  47. "move|" +
  48. "go|" +
  49. "home|" +
  50. "follow|" +
  51. "unfollow|" +
  52. "desert|" +
  53. "dismiss|" +
  54. "@tel");
  55. var builtinConstants = ("=#0");
  56. var builtinFunctions = ("default|" +
  57. "edefault|" +
  58. "eval|" +
  59. "get_eval|" +
  60. "get|" +
  61. "grep|" +
  62. "grepi|" +
  63. "hasattr|" +
  64. "hasattrp|" +
  65. "hasattrval|" +
  66. "hasattrpval|" +
  67. "lattr|" +
  68. "nattr|" +
  69. "poss|" +
  70. "udefault|" +
  71. "ufun|" +
  72. "u|" +
  73. "v|" +
  74. "uldefault|" +
  75. "xget|" +
  76. "zfun|" +
  77. "band|" +
  78. "bnand|" +
  79. "bnot|" +
  80. "bor|" +
  81. "bxor|" +
  82. "shl|" +
  83. "shr|" +
  84. "and|" +
  85. "cand|" +
  86. "cor|" +
  87. "eq|" +
  88. "gt|" +
  89. "gte|" +
  90. "lt|" +
  91. "lte|" +
  92. "nand|" +
  93. "neq|" +
  94. "nor|" +
  95. "not|" +
  96. "or|" +
  97. "t|" +
  98. "xor|" +
  99. "con|" +
  100. "entrances|" +
  101. "exit|" +
  102. "followers|" +
  103. "home|" +
  104. "lcon|" +
  105. "lexits|" +
  106. "loc|" +
  107. "locate|" +
  108. "lparent|" +
  109. "lsearch|" +
  110. "next|" +
  111. "num|" +
  112. "owner|" +
  113. "parent|" +
  114. "pmatch|" +
  115. "rloc|" +
  116. "rnum|" +
  117. "room|" +
  118. "where|" +
  119. "zone|" +
  120. "worn|" +
  121. "held|" +
  122. "carried|" +
  123. "acos|" +
  124. "asin|" +
  125. "atan|" +
  126. "ceil|" +
  127. "cos|" +
  128. "e|" +
  129. "exp|" +
  130. "fdiv|" +
  131. "fmod|" +
  132. "floor|" +
  133. "log|" +
  134. "ln|" +
  135. "pi|" +
  136. "power|" +
  137. "round|" +
  138. "sin|" +
  139. "sqrt|" +
  140. "tan|" +
  141. "aposs|" +
  142. "andflags|" +
  143. "conn|" +
  144. "commandssent|" +
  145. "controls|" +
  146. "doing|" +
  147. "elock|" +
  148. "findable|" +
  149. "flags|" +
  150. "fullname|" +
  151. "hasflag|" +
  152. "haspower|" +
  153. "hastype|" +
  154. "hidden|" +
  155. "idle|" +
  156. "isbaker|" +
  157. "lock|" +
  158. "lstats|" +
  159. "money|" +
  160. "who|" +
  161. "name|" +
  162. "nearby|" +
  163. "obj|" +
  164. "objflags|" +
  165. "photo|" +
  166. "poll|" +
  167. "powers|" +
  168. "pendingtext|" +
  169. "receivedtext|" +
  170. "restarts|" +
  171. "restarttime|" +
  172. "subj|" +
  173. "shortestpath|" +
  174. "tmoney|" +
  175. "type|" +
  176. "visible|" +
  177. "cat|" +
  178. "element|" +
  179. "elements|" +
  180. "extract|" +
  181. "filter|" +
  182. "filterbool|" +
  183. "first|" +
  184. "foreach|" +
  185. "fold|" +
  186. "grab|" +
  187. "graball|" +
  188. "index|" +
  189. "insert|" +
  190. "itemize|" +
  191. "items|" +
  192. "iter|" +
  193. "last|" +
  194. "ldelete|" +
  195. "map|" +
  196. "match|" +
  197. "matchall|" +
  198. "member|" +
  199. "mix|" +
  200. "munge|" +
  201. "pick|" +
  202. "remove|" +
  203. "replace|" +
  204. "rest|" +
  205. "revwords|" +
  206. "setdiff|" +
  207. "setinter|" +
  208. "setunion|" +
  209. "shuffle|" +
  210. "sort|" +
  211. "sortby|" +
  212. "splice|" +
  213. "step|" +
  214. "wordpos|" +
  215. "words|" +
  216. "add|" +
  217. "lmath|" +
  218. "max|" +
  219. "mean|" +
  220. "median|" +
  221. "min|" +
  222. "mul|" +
  223. "percent|" +
  224. "sign|" +
  225. "stddev|" +
  226. "sub|" +
  227. "val|" +
  228. "bound|" +
  229. "abs|" +
  230. "inc|" +
  231. "dec|" +
  232. "dist2d|" +
  233. "dist3d|" +
  234. "div|" +
  235. "floordiv|" +
  236. "mod|" +
  237. "modulo|" +
  238. "remainder|" +
  239. "vadd|" +
  240. "vdim|" +
  241. "vdot|" +
  242. "vmag|" +
  243. "vmax|" +
  244. "vmin|" +
  245. "vmul|" +
  246. "vsub|" +
  247. "vunit|" +
  248. "regedit|" +
  249. "regeditall|" +
  250. "regeditalli|" +
  251. "regediti|" +
  252. "regmatch|" +
  253. "regmatchi|" +
  254. "regrab|" +
  255. "regraball|" +
  256. "regraballi|" +
  257. "regrabi|" +
  258. "regrep|" +
  259. "regrepi|" +
  260. "after|" +
  261. "alphamin|" +
  262. "alphamax|" +
  263. "art|" +
  264. "before|" +
  265. "brackets|" +
  266. "capstr|" +
  267. "case|" +
  268. "caseall|" +
  269. "center|" +
  270. "containsfansi|" +
  271. "comp|" +
  272. "decompose|" +
  273. "decrypt|" +
  274. "delete|" +
  275. "edit|" +
  276. "encrypt|" +
  277. "escape|" +
  278. "if|" +
  279. "ifelse|" +
  280. "lcstr|" +
  281. "left|" +
  282. "lit|" +
  283. "ljust|" +
  284. "merge|" +
  285. "mid|" +
  286. "ostrlen|" +
  287. "pos|" +
  288. "repeat|" +
  289. "reverse|" +
  290. "right|" +
  291. "rjust|" +
  292. "scramble|" +
  293. "secure|" +
  294. "space|" +
  295. "spellnum|" +
  296. "squish|" +
  297. "strcat|" +
  298. "strmatch|" +
  299. "strinsert|" +
  300. "stripansi|" +
  301. "stripfansi|" +
  302. "strlen|" +
  303. "switch|" +
  304. "switchall|" +
  305. "table|" +
  306. "tr|" +
  307. "trim|" +
  308. "ucstr|" +
  309. "unsafe|" +
  310. "wrap|" +
  311. "ctitle|" +
  312. "cwho|" +
  313. "channels|" +
  314. "clock|" +
  315. "cflags|" +
  316. "ilev|" +
  317. "itext|" +
  318. "inum|" +
  319. "convsecs|" +
  320. "convutcsecs|" +
  321. "convtime|" +
  322. "ctime|" +
  323. "etimefmt|" +
  324. "isdaylight|" +
  325. "mtime|" +
  326. "secs|" +
  327. "msecs|" +
  328. "starttime|" +
  329. "time|" +
  330. "timefmt|" +
  331. "timestring|" +
  332. "utctime|" +
  333. "atrlock|" +
  334. "clone|" +
  335. "create|" +
  336. "cook|" +
  337. "dig|" +
  338. "emit|" +
  339. "lemit|" +
  340. "link|" +
  341. "oemit|" +
  342. "open|" +
  343. "pemit|" +
  344. "remit|" +
  345. "set|" +
  346. "tel|" +
  347. "wipe|" +
  348. "zemit|" +
  349. "fbcreate|" +
  350. "fbdestroy|" +
  351. "fbwrite|" +
  352. "fbclear|" +
  353. "fbcopy|" +
  354. "fbcopyto|" +
  355. "fbclip|" +
  356. "fbdump|" +
  357. "fbflush|" +
  358. "fbhset|" +
  359. "fblist|" +
  360. "fbstats|" +
  361. "qentries|" +
  362. "qentry|" +
  363. "play|" +
  364. "ansi|" +
  365. "break|" +
  366. "c|" +
  367. "asc|" +
  368. "die|" +
  369. "isdbref|" +
  370. "isint|" +
  371. "isnum|" +
  372. "isletters|" +
  373. "linecoords|" +
  374. "localize|" +
  375. "lnum|" +
  376. "nameshort|" +
  377. "null|" +
  378. "objeval|" +
  379. "r|" +
  380. "rand|" +
  381. "s|" +
  382. "setq|" +
  383. "setr|" +
  384. "soundex|" +
  385. "soundslike|" +
  386. "valid|" +
  387. "vchart|" +
  388. "vchart2|" +
  389. "vlabel|" +
  390. "@@|" +
  391. "bakerdays|" +
  392. "bodybuild|" +
  393. "box|" +
  394. "capall|" +
  395. "catalog|" +
  396. "children|" +
  397. "ctrailer|" +
  398. "darttime|" +
  399. "debt|" +
  400. "detailbar|" +
  401. "exploredroom|" +
  402. "fansitoansi|" +
  403. "fansitoxansi|" +
  404. "fullbar|" +
  405. "halfbar|" +
  406. "isdarted|" +
  407. "isnewbie|" +
  408. "isword|" +
  409. "lambda|" +
  410. "lobjects|" +
  411. "lplayers|" +
  412. "lthings|" +
  413. "lvexits|" +
  414. "lvobjects|" +
  415. "lvplayers|" +
  416. "lvthings|" +
  417. "newswrap|" +
  418. "numsuffix|" +
  419. "playerson|" +
  420. "playersthisweek|" +
  421. "randomad|" +
  422. "randword|" +
  423. "realrandword|" +
  424. "replacechr|" +
  425. "second|" +
  426. "splitamount|" +
  427. "strlenall|" +
  428. "text|" +
  429. "third|" +
  430. "tofansi|" +
  431. "totalac|" +
  432. "unique|" +
  433. "getaddressroom|" +
  434. "listpropertycomm|" +
  435. "listpropertyres|" +
  436. "lotowner|" +
  437. "lotrating|" +
  438. "lotratingcount|" +
  439. "lotvalue|" +
  440. "boughtproduct|" +
  441. "companyabb|" +
  442. "companyicon|" +
  443. "companylist|" +
  444. "companyname|" +
  445. "companyowners|" +
  446. "companyvalue|" +
  447. "employees|" +
  448. "invested|" +
  449. "productlist|" +
  450. "productname|" +
  451. "productowners|" +
  452. "productrating|" +
  453. "productratingcount|" +
  454. "productsoldat|" +
  455. "producttype|" +
  456. "ratedproduct|" +
  457. "soldproduct|" +
  458. "topproducts|" +
  459. "totalspentonproduct|" +
  460. "totalstock|" +
  461. "transfermoney|" +
  462. "uniquebuyercount|" +
  463. "uniqueproductsbought|" +
  464. "validcompany|" +
  465. "deletepicture|" +
  466. "fbsave|" +
  467. "getpicturesecurity|" +
  468. "haspicture|" +
  469. "listpictures|" +
  470. "picturesize|" +
  471. "replacecolor|" +
  472. "rgbtocolor|" +
  473. "savepicture|" +
  474. "setpicturesecurity|" +
  475. "showpicture|" +
  476. "piechart|" +
  477. "piechartlabel|" +
  478. "createmaze|" +
  479. "drawmaze|" +
  480. "drawwireframe");
  481. var keywordMapper = this.createKeywordMapper({
  482. "invalid.deprecated": "debugger",
  483. "support.function": builtinFunctions,
  484. "constant.language": builtinConstants,
  485. "keyword": keywords
  486. }, "identifier");
  487. var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
  488. var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
  489. var octInteger = "(?:0[oO]?[0-7]+)";
  490. var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
  491. var binInteger = "(?:0[bB][01]+)";
  492. var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
  493. var exponent = "(?:[eE][+-]?\\d+)";
  494. var fraction = "(?:\\.\\d+)";
  495. var intPart = "(?:\\d+)";
  496. var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
  497. var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
  498. var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
  499. this.$rules = {
  500. "start": [
  501. {
  502. token: "variable",
  503. regex: "%[0-9]{1}"
  504. },
  505. {
  506. token: "variable",
  507. regex: "%q[0-9A-Za-z]{1}"
  508. },
  509. {
  510. token: "variable",
  511. regex: "%[a-zA-Z]{1}"
  512. },
  513. {
  514. token: "variable.language",
  515. regex: "%[a-z0-9-_]+"
  516. },
  517. {
  518. token: "constant.numeric",
  519. regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
  520. }, {
  521. token: "constant.numeric",
  522. regex: floatNumber
  523. }, {
  524. token: "constant.numeric",
  525. regex: integer + "[lL]\\b"
  526. }, {
  527. token: "constant.numeric",
  528. regex: integer + "\\b"
  529. }, {
  530. token: keywordMapper,
  531. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  532. }, {
  533. token: "keyword.operator",
  534. regex: "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|#|%|<<|>>|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
  535. }, {
  536. token: "paren.lparen",
  537. regex: "[\\[\\(\\{]"
  538. }, {
  539. token: "paren.rparen",
  540. regex: "[\\]\\)\\}]"
  541. }, {
  542. token: "text",
  543. regex: "\\s+"
  544. }
  545. ]
  546. };
  547. };
  548. oop.inherits(MushCodeRules, TextHighlightRules);
  549. exports.MushCodeRules = MushCodeRules;
  550. });
  551. ace.define("ace/mode/folding/pythonic",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  552. var oop = require("../../lib/oop");
  553. var BaseFoldMode = require("./fold_mode").FoldMode;
  554. var FoldMode = exports.FoldMode = function (markers) {
  555. this.foldingStartMarker = new RegExp("([\\[{])(?:\\s*)$|(" + markers + ")(?:\\s*)(?:#.*)?$");
  556. };
  557. oop.inherits(FoldMode, BaseFoldMode);
  558. (function () {
  559. this.getFoldWidgetRange = function (session, foldStyle, row) {
  560. var line = session.getLine(row);
  561. var match = line.match(this.foldingStartMarker);
  562. if (match) {
  563. if (match[1])
  564. return this.openingBracketBlock(session, match[1], row, match.index);
  565. if (match[2])
  566. return this.indentationBlock(session, row, match.index + match[2].length);
  567. return this.indentationBlock(session, row);
  568. }
  569. };
  570. }).call(FoldMode.prototype);
  571. });
  572. ace.define("ace/mode/mushcode",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/mushcode_highlight_rules","ace/mode/folding/pythonic","ace/range"], function(require, exports, module){"use strict";
  573. var oop = require("../lib/oop");
  574. var TextMode = require("./text").Mode;
  575. var MushCodeRules = require("./mushcode_highlight_rules").MushCodeRules;
  576. var PythonFoldMode = require("./folding/pythonic").FoldMode;
  577. var Range = require("../range").Range;
  578. var Mode = function () {
  579. this.HighlightRules = MushCodeRules;
  580. this.foldingRules = new PythonFoldMode("\\:");
  581. this.$behaviour = this.$defaultBehaviour;
  582. };
  583. oop.inherits(Mode, TextMode);
  584. (function () {
  585. this.getNextLineIndent = function (state, line, tab) {
  586. var indent = this.$getIndent(line);
  587. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  588. var tokens = tokenizedLine.tokens;
  589. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  590. return indent;
  591. }
  592. if (state == "start") {
  593. var match = line.match(/^.*[\{\(\[:]\s*$/);
  594. if (match) {
  595. indent += tab;
  596. }
  597. }
  598. return indent;
  599. };
  600. var outdents = {
  601. "pass": 1,
  602. "return": 1,
  603. "raise": 1,
  604. "break": 1,
  605. "continue": 1
  606. };
  607. this.checkOutdent = function (state, line, input) {
  608. if (input !== "\r\n" && input !== "\r" && input !== "\n")
  609. return false;
  610. var tokens = this.getTokenizer().getLineTokens(line.trim(), state).tokens;
  611. if (!tokens)
  612. return false;
  613. do {
  614. var last = tokens.pop();
  615. } while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
  616. if (!last)
  617. return false;
  618. return (last.type == "keyword" && outdents[last.value]);
  619. };
  620. this.autoOutdent = function (state, doc, row) {
  621. row += 1;
  622. var indent = this.$getIndent(doc.getLine(row));
  623. var tab = doc.getTabString();
  624. if (indent.slice(-tab.length) == tab)
  625. doc.remove(new Range(row, indent.length - tab.length, row, indent.length));
  626. };
  627. this.$id = "ace/mode/mushcode";
  628. }).call(Mode.prototype);
  629. exports.Mode = Mode;
  630. }); (function() {
  631. ace.require(["ace/mode/mushcode"], function(m) {
  632. if (typeof module == "object" && typeof exports == "object" && module) {
  633. module.exports = m;
  634. }
  635. });
  636. })();