5faaee78f309325231ec88cae9860a3c.js 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  1. ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  4. var DocCommentHighlightRules = function () {
  5. this.$rules = {
  6. "start": [{
  7. token: "comment.doc.tag",
  8. regex: "@[\\w\\d_]+" // TODO: fix email addresses
  9. },
  10. DocCommentHighlightRules.getTagRule(),
  11. {
  12. defaultToken: "comment.doc",
  13. caseInsensitive: true
  14. }]
  15. };
  16. };
  17. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  18. DocCommentHighlightRules.getTagRule = function (start) {
  19. return {
  20. token: "comment.doc.tag.storage.type",
  21. regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  22. };
  23. };
  24. DocCommentHighlightRules.getStartRule = function (start) {
  25. return {
  26. token: "comment.doc",
  27. regex: "\\/\\*(?=\\*)",
  28. next: start
  29. };
  30. };
  31. DocCommentHighlightRules.getEndRule = function (start) {
  32. return {
  33. token: "comment.doc",
  34. regex: "\\*\\/",
  35. next: start
  36. };
  37. };
  38. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  39. });
  40. 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(require, exports, module){"use strict";
  41. var oop = require("../lib/oop");
  42. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  43. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  44. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  45. var JavaScriptHighlightRules = function (options) {
  46. var keywordMapper = this.createKeywordMapper({
  47. "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  48. "Namespace|QName|XML|XMLList|" + // E4X
  49. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  50. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  51. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  52. "SyntaxError|TypeError|URIError|" +
  53. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  54. "isNaN|parseFloat|parseInt|" +
  55. "JSON|Math|" + // Other
  56. "this|arguments|prototype|window|document",
  57. "keyword": "const|yield|import|get|set|async|await|" +
  58. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  59. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  60. "__parent__|__count__|escape|unescape|with|__proto__|" +
  61. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  62. "storage.type": "const|let|var|function",
  63. "constant.language": "null|Infinity|NaN|undefined",
  64. "support.function": "alert",
  65. "constant.language.boolean": "true|false"
  66. }, "identifier");
  67. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  68. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  69. "u[0-9a-fA-F]{4}|" + // unicode
  70. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  71. "[0-2][0-7]{0,2}|" + // oct
  72. "3[0-7][0-7]?|" + // oct
  73. "[4-7][0-7]?|" + //oct
  74. ".)";
  75. this.$rules = {
  76. "no_regex": [
  77. DocCommentHighlightRules.getStartRule("doc-start"),
  78. comments("no_regex"),
  79. {
  80. token: "string",
  81. regex: "'(?=.)",
  82. next: "qstring"
  83. }, {
  84. token: "string",
  85. regex: '"(?=.)',
  86. next: "qqstring"
  87. }, {
  88. token: "constant.numeric",
  89. regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  90. }, {
  91. token: "constant.numeric",
  92. regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  93. }, {
  94. token: [
  95. "storage.type", "punctuation.operator", "support.function",
  96. "punctuation.operator", "entity.name.function", "text", "keyword.operator"
  97. ],
  98. regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
  99. next: "function_arguments"
  100. }, {
  101. token: [
  102. "storage.type", "punctuation.operator", "entity.name.function", "text",
  103. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  104. ],
  105. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  106. next: "function_arguments"
  107. }, {
  108. token: [
  109. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  110. "text", "paren.lparen"
  111. ],
  112. regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  113. next: "function_arguments"
  114. }, {
  115. token: [
  116. "storage.type", "punctuation.operator", "entity.name.function", "text",
  117. "keyword.operator", "text",
  118. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  119. ],
  120. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  121. next: "function_arguments"
  122. }, {
  123. token: [
  124. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  125. ],
  126. regex: "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  127. next: "function_arguments"
  128. }, {
  129. token: [
  130. "entity.name.function", "text", "punctuation.operator",
  131. "text", "storage.type", "text", "paren.lparen"
  132. ],
  133. regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  134. next: "function_arguments"
  135. }, {
  136. token: [
  137. "text", "text", "storage.type", "text", "paren.lparen"
  138. ],
  139. regex: "(:)(\\s*)(function)(\\s*)(\\()",
  140. next: "function_arguments"
  141. }, {
  142. token: "keyword",
  143. regex: "from(?=\\s*('|\"))"
  144. }, {
  145. token: "keyword",
  146. regex: "(?:" + kwBeforeRe + ")\\b",
  147. next: "start"
  148. }, {
  149. token: ["support.constant"],
  150. regex: /that\b/
  151. }, {
  152. token: ["storage.type", "punctuation.operator", "support.function.firebug"],
  153. regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  154. }, {
  155. token: keywordMapper,
  156. regex: identifierRe
  157. }, {
  158. token: "punctuation.operator",
  159. regex: /[.](?![.])/,
  160. next: "property"
  161. }, {
  162. token: "storage.type",
  163. regex: /=>/,
  164. next: "start"
  165. }, {
  166. token: "keyword.operator",
  167. regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  168. next: "start"
  169. }, {
  170. token: "punctuation.operator",
  171. regex: /[?:,;.]/,
  172. next: "start"
  173. }, {
  174. token: "paren.lparen",
  175. regex: /[\[({]/,
  176. next: "start"
  177. }, {
  178. token: "paren.rparen",
  179. regex: /[\])}]/
  180. }, {
  181. token: "comment",
  182. regex: /^#!.*$/
  183. }
  184. ],
  185. property: [{
  186. token: "text",
  187. regex: "\\s+"
  188. }, {
  189. token: [
  190. "storage.type", "punctuation.operator", "entity.name.function", "text",
  191. "keyword.operator", "text",
  192. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  193. ],
  194. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  195. next: "function_arguments"
  196. }, {
  197. token: "punctuation.operator",
  198. regex: /[.](?![.])/
  199. }, {
  200. token: "support.function",
  201. 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(?=\()/
  202. }, {
  203. token: "support.function.dom",
  204. 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(?=\()/
  205. }, {
  206. token: "support.constant",
  207. 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/
  208. }, {
  209. token: "identifier",
  210. regex: identifierRe
  211. }, {
  212. regex: "",
  213. token: "empty",
  214. next: "no_regex"
  215. }
  216. ],
  217. "start": [
  218. DocCommentHighlightRules.getStartRule("doc-start"),
  219. comments("start"),
  220. {
  221. token: "string.regexp",
  222. regex: "\\/",
  223. next: "regex"
  224. }, {
  225. token: "text",
  226. regex: "\\s+|^$",
  227. next: "start"
  228. }, {
  229. token: "empty",
  230. regex: "",
  231. next: "no_regex"
  232. }
  233. ],
  234. "regex": [
  235. {
  236. token: "regexp.keyword.operator",
  237. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  238. }, {
  239. token: "string.regexp",
  240. regex: "/[sxngimy]*",
  241. next: "no_regex"
  242. }, {
  243. token: "invalid",
  244. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  245. }, {
  246. token: "constant.language.escape",
  247. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  248. }, {
  249. token: "constant.language.delimiter",
  250. regex: /\|/
  251. }, {
  252. token: "constant.language.escape",
  253. regex: /\[\^?/,
  254. next: "regex_character_class"
  255. }, {
  256. token: "empty",
  257. regex: "$",
  258. next: "no_regex"
  259. }, {
  260. defaultToken: "string.regexp"
  261. }
  262. ],
  263. "regex_character_class": [
  264. {
  265. token: "regexp.charclass.keyword.operator",
  266. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  267. }, {
  268. token: "constant.language.escape",
  269. regex: "]",
  270. next: "regex"
  271. }, {
  272. token: "constant.language.escape",
  273. regex: "-"
  274. }, {
  275. token: "empty",
  276. regex: "$",
  277. next: "no_regex"
  278. }, {
  279. defaultToken: "string.regexp.charachterclass"
  280. }
  281. ],
  282. "function_arguments": [
  283. {
  284. token: "variable.parameter",
  285. regex: identifierRe
  286. }, {
  287. token: "punctuation.operator",
  288. regex: "[, ]+"
  289. }, {
  290. token: "punctuation.operator",
  291. regex: "$"
  292. }, {
  293. token: "empty",
  294. regex: "",
  295. next: "no_regex"
  296. }
  297. ],
  298. "qqstring": [
  299. {
  300. token: "constant.language.escape",
  301. regex: escapedRe
  302. }, {
  303. token: "string",
  304. regex: "\\\\$",
  305. consumeLineEnd: true
  306. }, {
  307. token: "string",
  308. regex: '"|$',
  309. next: "no_regex"
  310. }, {
  311. defaultToken: "string"
  312. }
  313. ],
  314. "qstring": [
  315. {
  316. token: "constant.language.escape",
  317. regex: escapedRe
  318. }, {
  319. token: "string",
  320. regex: "\\\\$",
  321. consumeLineEnd: true
  322. }, {
  323. token: "string",
  324. regex: "'|$",
  325. next: "no_regex"
  326. }, {
  327. defaultToken: "string"
  328. }
  329. ]
  330. };
  331. if (!options || !options.noES6) {
  332. this.$rules.no_regex.unshift({
  333. regex: "[{}]", onMatch: function (val, state, stack) {
  334. this.next = val == "{" ? this.nextState : "";
  335. if (val == "{" && stack.length) {
  336. stack.unshift("start", state);
  337. }
  338. else if (val == "}" && stack.length) {
  339. stack.shift();
  340. this.next = stack.shift();
  341. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  342. return "paren.quasi.end";
  343. }
  344. return val == "{" ? "paren.lparen" : "paren.rparen";
  345. },
  346. nextState: "start"
  347. }, {
  348. token: "string.quasi.start",
  349. regex: /`/,
  350. push: [{
  351. token: "constant.language.escape",
  352. regex: escapedRe
  353. }, {
  354. token: "paren.quasi.start",
  355. regex: /\${/,
  356. push: "start"
  357. }, {
  358. token: "string.quasi.end",
  359. regex: /`/,
  360. next: "pop"
  361. }, {
  362. defaultToken: "string.quasi"
  363. }]
  364. });
  365. if (!options || options.jsx != false)
  366. JSX.call(this);
  367. }
  368. this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
  369. this.normalizeRules();
  370. };
  371. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  372. function JSX() {
  373. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  374. var jsxTag = {
  375. onMatch: function (val, state, stack) {
  376. var offset = val.charAt(1) == "/" ? 2 : 1;
  377. if (offset == 1) {
  378. if (state != this.nextState)
  379. stack.unshift(this.next, this.nextState, 0);
  380. else
  381. stack.unshift(this.next);
  382. stack[2]++;
  383. }
  384. else if (offset == 2) {
  385. if (state == this.nextState) {
  386. stack[1]--;
  387. if (!stack[1] || stack[1] < 0) {
  388. stack.shift();
  389. stack.shift();
  390. }
  391. }
  392. }
  393. return [{
  394. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  395. value: val.slice(0, offset)
  396. }, {
  397. type: "meta.tag.tag-name.xml",
  398. value: val.substr(offset)
  399. }];
  400. },
  401. regex: "</?" + tagRegex + "",
  402. next: "jsxAttributes",
  403. nextState: "jsx"
  404. };
  405. this.$rules.start.unshift(jsxTag);
  406. var jsxJsRule = {
  407. regex: "{",
  408. token: "paren.quasi.start",
  409. push: "start"
  410. };
  411. this.$rules.jsx = [
  412. jsxJsRule,
  413. jsxTag,
  414. { include: "reference" },
  415. { defaultToken: "string" }
  416. ];
  417. this.$rules.jsxAttributes = [{
  418. token: "meta.tag.punctuation.tag-close.xml",
  419. regex: "/?>",
  420. onMatch: function (value, currentState, stack) {
  421. if (currentState == stack[0])
  422. stack.shift();
  423. if (value.length == 2) {
  424. if (stack[0] == this.nextState)
  425. stack[1]--;
  426. if (!stack[1] || stack[1] < 0) {
  427. stack.splice(0, 2);
  428. }
  429. }
  430. this.next = stack[0] || "start";
  431. return [{ type: this.token, value: value }];
  432. },
  433. nextState: "jsx"
  434. },
  435. jsxJsRule,
  436. comments("jsxAttributes"),
  437. {
  438. token: "entity.other.attribute-name.xml",
  439. regex: tagRegex
  440. }, {
  441. token: "keyword.operator.attribute-equals.xml",
  442. regex: "="
  443. }, {
  444. token: "text.tag-whitespace.xml",
  445. regex: "\\s+"
  446. }, {
  447. token: "string.attribute-value.xml",
  448. regex: "'",
  449. stateName: "jsx_attr_q",
  450. push: [
  451. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  452. { include: "reference" },
  453. { defaultToken: "string.attribute-value.xml" }
  454. ]
  455. }, {
  456. token: "string.attribute-value.xml",
  457. regex: '"',
  458. stateName: "jsx_attr_qq",
  459. push: [
  460. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  461. { include: "reference" },
  462. { defaultToken: "string.attribute-value.xml" }
  463. ]
  464. },
  465. jsxTag
  466. ];
  467. this.$rules.reference = [{
  468. token: "constant.language.escape.reference.xml",
  469. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  470. }];
  471. }
  472. function comments(next) {
  473. return [
  474. {
  475. token: "comment",
  476. regex: /\/\*/,
  477. next: [
  478. DocCommentHighlightRules.getTagRule(),
  479. { token: "comment", regex: "\\*\\/", next: next || "pop" },
  480. { defaultToken: "comment", caseInsensitive: true }
  481. ]
  482. }, {
  483. token: "comment",
  484. regex: "\\/\\/",
  485. next: [
  486. DocCommentHighlightRules.getTagRule(),
  487. { token: "comment", regex: "$|^", next: next || "pop" },
  488. { defaultToken: "comment", caseInsensitive: true }
  489. ]
  490. }
  491. ];
  492. }
  493. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  494. });
  495. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module){"use strict";
  496. var Range = require("../range").Range;
  497. var MatchingBraceOutdent = function () { };
  498. (function () {
  499. this.checkOutdent = function (line, input) {
  500. if (!/^\s+$/.test(line))
  501. return false;
  502. return /^\s*\}/.test(input);
  503. };
  504. this.autoOutdent = function (doc, row) {
  505. var line = doc.getLine(row);
  506. var match = line.match(/^(\s*\})/);
  507. if (!match)
  508. return 0;
  509. var column = match[1].length;
  510. var openBracePos = doc.findMatchingBracket({ row: row, column: column });
  511. if (!openBracePos || openBracePos.row == row)
  512. return 0;
  513. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  514. doc.replace(new Range(row, 0, row, column - 1), indent);
  515. };
  516. this.$getIndent = function (line) {
  517. return line.match(/^\s*/)[0];
  518. };
  519. }).call(MatchingBraceOutdent.prototype);
  520. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  521. });
  522. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module){"use strict";
  523. var oop = require("../../lib/oop");
  524. var Range = require("../../range").Range;
  525. var BaseFoldMode = require("./fold_mode").FoldMode;
  526. var FoldMode = exports.FoldMode = function (commentRegex) {
  527. if (commentRegex) {
  528. this.foldingStartMarker = new RegExp(this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start));
  529. this.foldingStopMarker = new RegExp(this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end));
  530. }
  531. };
  532. oop.inherits(FoldMode, BaseFoldMode);
  533. (function () {
  534. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  535. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  536. this.singleLineBlockCommentRe = /^\s*(\/\*).*\*\/\s*$/;
  537. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  538. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  539. this._getFoldWidgetBase = this.getFoldWidget;
  540. this.getFoldWidget = function (session, foldStyle, row) {
  541. var line = session.getLine(row);
  542. if (this.singleLineBlockCommentRe.test(line)) {
  543. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  544. return "";
  545. }
  546. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  547. if (!fw && this.startRegionRe.test(line))
  548. return "start"; // lineCommentRegionStart
  549. return fw;
  550. };
  551. this.getFoldWidgetRange = function (session, foldStyle, row, forceMultiline) {
  552. var line = session.getLine(row);
  553. if (this.startRegionRe.test(line))
  554. return this.getCommentRegionBlock(session, line, row);
  555. var match = line.match(this.foldingStartMarker);
  556. if (match) {
  557. var i = match.index;
  558. if (match[1])
  559. return this.openingBracketBlock(session, match[1], row, i);
  560. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  561. if (range && !range.isMultiLine()) {
  562. if (forceMultiline) {
  563. range = this.getSectionRange(session, row);
  564. }
  565. else if (foldStyle != "all")
  566. range = null;
  567. }
  568. return range;
  569. }
  570. if (foldStyle === "markbegin")
  571. return;
  572. var match = line.match(this.foldingStopMarker);
  573. if (match) {
  574. var i = match.index + match[0].length;
  575. if (match[1])
  576. return this.closingBracketBlock(session, match[1], row, i);
  577. return session.getCommentFoldRange(row, i, -1);
  578. }
  579. };
  580. this.getSectionRange = function (session, row) {
  581. var line = session.getLine(row);
  582. var startIndent = line.search(/\S/);
  583. var startRow = row;
  584. var startColumn = line.length;
  585. row = row + 1;
  586. var endRow = row;
  587. var maxRow = session.getLength();
  588. while (++row < maxRow) {
  589. line = session.getLine(row);
  590. var indent = line.search(/\S/);
  591. if (indent === -1)
  592. continue;
  593. if (startIndent > indent)
  594. break;
  595. var subRange = this.getFoldWidgetRange(session, "all", row);
  596. if (subRange) {
  597. if (subRange.start.row <= startRow) {
  598. break;
  599. }
  600. else if (subRange.isMultiLine()) {
  601. row = subRange.end.row;
  602. }
  603. else if (startIndent == indent) {
  604. break;
  605. }
  606. }
  607. endRow = row;
  608. }
  609. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  610. };
  611. this.getCommentRegionBlock = function (session, line, row) {
  612. var startColumn = line.search(/\s*$/);
  613. var maxRow = session.getLength();
  614. var startRow = row;
  615. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  616. var depth = 1;
  617. while (++row < maxRow) {
  618. line = session.getLine(row);
  619. var m = re.exec(line);
  620. if (!m)
  621. continue;
  622. if (m[1])
  623. depth--;
  624. else
  625. depth++;
  626. if (!depth)
  627. break;
  628. }
  629. var endRow = row;
  630. if (endRow > startRow) {
  631. return new Range(startRow, startColumn, endRow, line.length);
  632. }
  633. };
  634. }).call(FoldMode.prototype);
  635. });
  636. ace.define("ace/mode/javascript",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/javascript_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module){"use strict";
  637. var oop = require("../lib/oop");
  638. var TextMode = require("./text").Mode;
  639. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  640. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  641. var WorkerClient = require("../worker/worker_client").WorkerClient;
  642. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  643. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  644. var Mode = function () {
  645. this.HighlightRules = JavaScriptHighlightRules;
  646. this.$outdent = new MatchingBraceOutdent();
  647. this.$behaviour = new CstyleBehaviour();
  648. this.foldingRules = new CStyleFoldMode();
  649. };
  650. oop.inherits(Mode, TextMode);
  651. (function () {
  652. this.lineCommentStart = "//";
  653. this.blockComment = { start: "/*", end: "*/" };
  654. this.$quotes = { '"': '"', "'": "'", "`": "`" };
  655. this.getNextLineIndent = function (state, line, tab) {
  656. var indent = this.$getIndent(line);
  657. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  658. var tokens = tokenizedLine.tokens;
  659. var endState = tokenizedLine.state;
  660. if (tokens.length && tokens[tokens.length - 1].type == "comment") {
  661. return indent;
  662. }
  663. if (state == "start" || state == "no_regex") {
  664. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  665. if (match) {
  666. indent += tab;
  667. }
  668. }
  669. else if (state == "doc-start") {
  670. if (endState == "start" || endState == "no_regex") {
  671. return "";
  672. }
  673. var match = line.match(/^\s*(\/?)\*/);
  674. if (match) {
  675. if (match[1]) {
  676. indent += " ";
  677. }
  678. indent += "* ";
  679. }
  680. }
  681. return indent;
  682. };
  683. this.checkOutdent = function (state, line, input) {
  684. return this.$outdent.checkOutdent(line, input);
  685. };
  686. this.autoOutdent = function (state, doc, row) {
  687. this.$outdent.autoOutdent(doc, row);
  688. };
  689. this.createWorker = function (session) {
  690. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  691. worker.attachToDocument(session.getDocument());
  692. worker.on("annotate", function (results) {
  693. session.setAnnotations(results.data);
  694. });
  695. worker.on("terminate", function () {
  696. session.clearAnnotations();
  697. });
  698. return worker;
  699. };
  700. this.$id = "ace/mode/javascript";
  701. this.snippetFileId = "ace/snippets/javascript";
  702. }).call(Mode.prototype);
  703. exports.Mode = Mode;
  704. });
  705. ace.define("ace/mode/gobstones_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  706. var oop = require("../lib/oop");
  707. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  708. var GobstonesHighlightRules = function () {
  709. var definitions = {
  710. standard: "program|procedure|function|interactive|return|let",
  711. type: "type|is|variant|record|field|case"
  712. };
  713. var control = {
  714. commands: {
  715. repetitions: "repeat|while|foreach|in",
  716. alternatives: "if|elseif|else|switch"
  717. },
  718. expressions: {
  719. alternatives: "choose|when|otherwise|matching|select|on"
  720. }
  721. };
  722. var values = {
  723. colors: "Verde|Rojo|Azul|Negro",
  724. cardinals: "Norte|Sur|Este|Oeste",
  725. booleans: "True|False",
  726. numbers: /([-]?)([0-9]+)\b/,
  727. strings: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  728. };
  729. var primitives = {
  730. commands: "Poner|Sacar|Mover|IrAlBorde|VaciarTablero|BOOM",
  731. expressions: "nroBolitas|hayBolitas|puedeMover|" +
  732. "siguiente|previo|opuesto|" +
  733. "minBool|maxBool|minDir|maxDir|minColor|maxColor|" +
  734. "primero|sinElPrimero|esVacía|" +
  735. "boom",
  736. keys: "K_A|K_B|K_C|K_D|K_E|K_F|K_G|K_G|K_H|K_I|K_J|K_K|K_L|K_M|K_N|K_Ñ|" +
  737. "K_O|K_P|K_Q|K_R|K_S|K_T|K_U|K_V|K_W|K_X|K_Y|K_Z|" +
  738. "K_0|K_1|K_2|K_3|K_4|K_5|K_6|K_7|K_8|K_9|" +
  739. "K_F1|K_F2|K_F3|K_F4|K_F5|K_F6|K_F7|K_F8|K_F9|K_F10|K_F11|K_12|" +
  740. "K_UP|K_DOWN|K_LEFT|K_RIGHT|K_RETURN|K_BACKSPACE|K_TAB|K_SPACE|K_ESCAPE" +
  741. "K_CTRL_A|K_CTRL_B|K_CTRL_C|K_CTRL_D|K_CTRL_E|K_CTRL_F|K_CTRL_G|K_CTRL_G|" +
  742. "K_CTRL_H|K_CTRL_I|K_CTRL_J|K_CTRL_K|K_CTRL_L|K_CTRL_M|K_CTRL_N|K_CTRL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T_SHIFT_T|K_CTRL_ALT_SHIFT_U|K_CTRL_ALT_SHIFT_V|" +
  815. "K_CTRL_ALT_SHIFT_W|K_CTRL_ALT_SHIFT_X|K_CTRL_ALT_SHIFT_Y|K_CTRL_ALT_SHIFT_Z|" +
  816. "K_CTRL_ALT_SHIFT_0|K_CTRL_ALT_SHIFT_1|K_CTRL_ALT_SHIFT_2|K_CTRL_ALT_SHIFT_3|" +
  817. "K_CTRL_ALT_SHIFT_4|K_CTRL_ALT_SHIFT_5|K_CTRL_ALT_SHIFT_6|K_CTRL_ALT_SHIFT_7|" +
  818. "K_CTRL_ALT_SHIFT_8|K_CTRL_ALT_SHIFT_9|" +
  819. "K_CTRL_ALT_SHIFT_F1|K_CTRL_ALT_SHIFT_F2|K_CTRL_ALT_SHIFT_F3|K_CTRL_ALT_SHIFT_F4|" +
  820. "K_CTRL_ALT_SHIFT_F5|K_CTRL_ALT_SHIFT_F6|K_CTRL_ALT_SHIFT_F7|K_CTRL_ALT_SHIFT_F8|" +
  821. "K_CTRL_ALT_SHIFT_F9|K_CTRL_ALT_SHIFT_F10|K_CTRL_ALT_SHIFT_F11|K_CTRL_ALT_SHIFT_F12|" +
  822. "K_CTRL_ALT_SHIFT_UP|K_CTRL_ALT_SHIFT_DOWN|K_CTRL_ALT_SHIFT_LEFT|K_CTRL_ALT_SHIFT_RIGHT|" +
  823. "K_CTRL_ALT_SHIFT_RETURN|K_CTRL_ALT_SHIFT_BACKSPACE|K_CTRL_ALT_SHIFT_TAB|" +
  824. "K_CTRL_ALT_SHIFT_SPACE|K_CTRL_ALT_SHIFT_ESCAPE"
  825. };
  826. var operations = {
  827. commands: ":=",
  828. expressions: {
  829. numeric: "\\+|\\-|\\*|\\^|div|mod",
  830. comparison: ">=|<=|==|\\/=|>|<",
  831. boolean: "\\|\\||&&|not",
  832. other: "\\+\\+|<\\-|\\[|\\]|\\_|\\->"
  833. }
  834. };
  835. var comments = {
  836. line: {
  837. double_slash: "\\/\\/.*$",
  838. double_dash: "\\-\\-.*$",
  839. number_sign: "#.*$"
  840. },
  841. block: { start: "\\/\\*", end: "\\*\\/" },
  842. block_alt: { start: "\\{\\-", end: "\\-\\}" }
  843. };
  844. this.$rules = {
  845. "start": [
  846. {
  847. token: "comment.line.double-slash.gobstones",
  848. regex: comments.line.double_slash
  849. },
  850. {
  851. token: "comment.line.double-dash.gobstones",
  852. regex: comments.line.double_dash
  853. },
  854. {
  855. token: "comment.line.number-sign.gobstones",
  856. regex: comments.line.number_sign
  857. },
  858. {
  859. token: "comment.block.dash-asterisc.gobstones",
  860. regex: comments.block.start,
  861. next: "block_comment_end"
  862. },
  863. {
  864. token: "comment.block.brace-dash.gobstones",
  865. regex: comments.block_alt.start,
  866. next: "block_comment_alt_end"
  867. },
  868. {
  869. token: "constant.numeric.gobstones",
  870. regex: values.numbers
  871. },
  872. {
  873. token: "string.quoted.double.gobstones",
  874. regex: values.strings
  875. },
  876. {
  877. token: "keyword.operator.other.gobstones",
  878. regex: operations.expressions.other
  879. },
  880. {
  881. token: "keyword.operator.numeric.gobstones",
  882. regex: operations.expressions.numeric
  883. },
  884. {
  885. token: "keyword.operator.compare.gobstones",
  886. regex: operations.expressions.comparison
  887. },
  888. {
  889. token: "keyword.operator.boolean.gobstones",
  890. regex: operations.expressions.boolean
  891. },
  892. {
  893. token: this.createKeywordMapper({
  894. "storage.type.definitions.gobstones": definitions.standard,
  895. "storage.type.types.gobstones": definitions.type,
  896. "keyword.control.commands.repetitions.gobstones": control.commands.repetitions,
  897. "keyword.control.commands.alternatives.gobstones": control.commands.alternatives,
  898. "keyword.control.expressions.alternatives.gobstones": control.expressions.alternatives,
  899. "constant.language.colors.gobstones": values.colors,
  900. "constant.language.cardinals.gobstones": values.cardinals,
  901. "constant.language.boolean.gobstones": values.booleans,
  902. "support.function.gobstones": primitives.commands,
  903. "support.variable.gobstones": primitives.expressions,
  904. "variable.language.gobstones": primitives.keys
  905. }, "identifier.gobstones"),
  906. regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  907. },
  908. {
  909. token: "comma.gobstones",
  910. regex: ","
  911. },
  912. {
  913. token: "semicolon.gobstones",
  914. regex: ";"
  915. },
  916. {
  917. token: "lparen",
  918. regex: "[[({]"
  919. },
  920. {
  921. token: "rparen",
  922. regex: "[\\])}]"
  923. },
  924. {
  925. token: "text",
  926. regex: "\\s+"
  927. }
  928. ],
  929. "block_comment_end": [{
  930. token: "comment.block.dash-asterisc.gobstones",
  931. regex: comments.block.end,
  932. next: "start"
  933. }, {
  934. defaultToken: "comment.block.dash-asterisc.gobstones"
  935. }
  936. ],
  937. "block_comment_alt_end": [{
  938. token: "comment.block.brace-dash.gobstones",
  939. regex: comments.block_alt.end,
  940. next: "start"
  941. }, {
  942. defaultToken: "comment.block.brace-dash.gobstones"
  943. }
  944. ]
  945. };
  946. };
  947. oop.inherits(GobstonesHighlightRules, TextHighlightRules);
  948. exports.GobstonesHighlightRules = GobstonesHighlightRules;
  949. });
  950. ace.define("ace/mode/gobstones",["require","exports","module","ace/lib/oop","ace/mode/javascript","ace/mode/gobstones_highlight_rules"], function(require, exports, module){"use strict";
  951. var oop = require("../lib/oop");
  952. var JavaScriptMode = require("./javascript").Mode;
  953. var GobstonesHighlightRules = require("./gobstones_highlight_rules").GobstonesHighlightRules;
  954. var Mode = function () {
  955. JavaScriptMode.call(this);
  956. this.HighlightRules = GobstonesHighlightRules;
  957. this.$behaviour = this.$defaultBehaviour;
  958. };
  959. oop.inherits(Mode, JavaScriptMode);
  960. (function () {
  961. this.createWorker = function () {
  962. return null;
  963. };
  964. this.$id = "ace/mode/gobstones";
  965. this.snippetFileId = "ace/snippets/gobstones";
  966. }).call(Mode.prototype);
  967. exports.Mode = Mode;
  968. }); (function() {
  969. ace.require(["ace/mode/gobstones"], function(m) {
  970. if (typeof module == "object" && typeof exports == "object" && module) {
  971. module.exports = m;
  972. }
  973. });
  974. })();