3dc2451e6986b1da6be67cc0e2ac5191.js 80 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853
  1. ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  2. var oop = require("../lib/oop");
  3. var lang = require("../lib/lang");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. 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|max-zoom|min-height|min-width|min-zoom|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|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  6. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  7. 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|zoom";
  8. 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";
  9. 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";
  10. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))";
  11. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  12. 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|required|root|target|valid|visited)\\b";
  13. var CssHighlightRules = function () {
  14. var keywordMapper = this.createKeywordMapper({
  15. "support.function": supportFunction,
  16. "support.constant": supportConstant,
  17. "support.type": supportType,
  18. "support.constant.color": supportConstantColor,
  19. "support.constant.fonts": supportConstantFonts
  20. }, "text", true);
  21. this.$rules = {
  22. "start": [{
  23. include: ["strings", "url", "comments"]
  24. }, {
  25. token: "paren.lparen",
  26. regex: "\\{",
  27. next: "ruleset"
  28. }, {
  29. token: "paren.rparen",
  30. regex: "\\}"
  31. }, {
  32. token: "string",
  33. regex: "@(?!viewport)",
  34. next: "media"
  35. }, {
  36. token: "keyword",
  37. regex: "#[a-z0-9-_]+"
  38. }, {
  39. token: "keyword",
  40. regex: "%"
  41. }, {
  42. token: "variable",
  43. regex: "\\.[a-z0-9-_]+"
  44. }, {
  45. token: "string",
  46. regex: ":[a-z0-9-_]+"
  47. }, {
  48. token: "constant.numeric",
  49. regex: numRe
  50. }, {
  51. token: "constant",
  52. regex: "[a-z0-9-_]+"
  53. }, {
  54. caseInsensitive: true
  55. }],
  56. "media": [{
  57. include: ["strings", "url", "comments"]
  58. }, {
  59. token: "paren.lparen",
  60. regex: "\\{",
  61. next: "start"
  62. }, {
  63. token: "paren.rparen",
  64. regex: "\\}",
  65. next: "start"
  66. }, {
  67. token: "string",
  68. regex: ";",
  69. next: "start"
  70. }, {
  71. token: "keyword",
  72. regex: "(?:media|supports|document|charset|import|namespace|media|supports|document"
  73. + "|page|font|keyframes|viewport|counter-style|font-feature-values"
  74. + "|swash|ornaments|annotation|stylistic|styleset|character-variant)"
  75. }],
  76. "comments": [{
  77. token: "comment",
  78. regex: "\\/\\*",
  79. push: [{
  80. token: "comment",
  81. regex: "\\*\\/",
  82. next: "pop"
  83. }, {
  84. defaultToken: "comment"
  85. }]
  86. }],
  87. "ruleset": [{
  88. regex: "-(webkit|ms|moz|o)-",
  89. token: "text"
  90. }, {
  91. token: "punctuation.operator",
  92. regex: "[:;]"
  93. }, {
  94. token: "paren.rparen",
  95. regex: "\\}",
  96. next: "start"
  97. }, {
  98. include: ["strings", "url", "comments"]
  99. }, {
  100. token: ["constant.numeric", "keyword"],
  101. regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
  102. }, {
  103. token: "constant.numeric",
  104. regex: numRe
  105. }, {
  106. token: "constant.numeric",
  107. regex: "#[a-f0-9]{6}"
  108. }, {
  109. token: "constant.numeric",
  110. regex: "#[a-f0-9]{3}"
  111. }, {
  112. token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  113. regex: pseudoElements
  114. }, {
  115. token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  116. regex: pseudoClasses
  117. }, {
  118. include: "url"
  119. }, {
  120. token: keywordMapper,
  121. regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  122. }, {
  123. caseInsensitive: true
  124. }],
  125. url: [{
  126. token: "support.function",
  127. regex: "(?:url(:?-prefix)?|domain|regexp)\\(",
  128. push: [{
  129. token: "support.function",
  130. regex: "\\)",
  131. next: "pop"
  132. }, {
  133. defaultToken: "string"
  134. }]
  135. }],
  136. strings: [{
  137. token: "string.start",
  138. regex: "'",
  139. push: [{
  140. token: "string.end",
  141. regex: "'|$",
  142. next: "pop"
  143. }, {
  144. include: "escapes"
  145. }, {
  146. token: "constant.language.escape",
  147. regex: /\\$/,
  148. consumeLineEnd: true
  149. }, {
  150. defaultToken: "string"
  151. }]
  152. }, {
  153. token: "string.start",
  154. regex: '"',
  155. push: [{
  156. token: "string.end",
  157. regex: '"|$',
  158. next: "pop"
  159. }, {
  160. include: "escapes"
  161. }, {
  162. token: "constant.language.escape",
  163. regex: /\\$/,
  164. consumeLineEnd: true
  165. }, {
  166. defaultToken: "string"
  167. }]
  168. }],
  169. escapes: [{
  170. token: "constant.language.escape",
  171. regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/
  172. }]
  173. };
  174. this.normalizeRules();
  175. };
  176. oop.inherits(CssHighlightRules, TextHighlightRules);
  177. exports.CssHighlightRules = CssHighlightRules;
  178. });
  179. 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";
  180. var oop = require("../lib/oop");
  181. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  182. var DocCommentHighlightRules = function () {
  183. this.$rules = {
  184. "start": [{
  185. token: "comment.doc.tag",
  186. regex: "@[\\w\\d_]+" // TODO: fix email addresses
  187. },
  188. DocCommentHighlightRules.getTagRule(),
  189. {
  190. defaultToken: "comment.doc",
  191. caseInsensitive: true
  192. }]
  193. };
  194. };
  195. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  196. DocCommentHighlightRules.getTagRule = function (start) {
  197. return {
  198. token: "comment.doc.tag.storage.type",
  199. regex: "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  200. };
  201. };
  202. DocCommentHighlightRules.getStartRule = function (start) {
  203. return {
  204. token: "comment.doc",
  205. regex: "\\/\\*(?=\\*)",
  206. next: start
  207. };
  208. };
  209. DocCommentHighlightRules.getEndRule = function (start) {
  210. return {
  211. token: "comment.doc",
  212. regex: "\\*\\/",
  213. next: start
  214. };
  215. };
  216. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  217. });
  218. 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";
  219. var oop = require("../lib/oop");
  220. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  221. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  222. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  223. var JavaScriptHighlightRules = function (options) {
  224. var keywordMapper = this.createKeywordMapper({
  225. "variable.language": "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  226. "Namespace|QName|XML|XMLList|" + // E4X
  227. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  228. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  229. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  230. "SyntaxError|TypeError|URIError|" +
  231. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  232. "isNaN|parseFloat|parseInt|" +
  233. "JSON|Math|" + // Other
  234. "this|arguments|prototype|window|document",
  235. "keyword": "const|yield|import|get|set|async|await|" +
  236. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  237. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  238. "__parent__|__count__|escape|unescape|with|__proto__|" +
  239. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  240. "storage.type": "const|let|var|function",
  241. "constant.language": "null|Infinity|NaN|undefined",
  242. "support.function": "alert",
  243. "constant.language.boolean": "true|false"
  244. }, "identifier");
  245. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  246. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  247. "u[0-9a-fA-F]{4}|" + // unicode
  248. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  249. "[0-2][0-7]{0,2}|" + // oct
  250. "3[0-7][0-7]?|" + // oct
  251. "[4-7][0-7]?|" + //oct
  252. ".)";
  253. this.$rules = {
  254. "no_regex": [
  255. DocCommentHighlightRules.getStartRule("doc-start"),
  256. comments("no_regex"),
  257. {
  258. token: "string",
  259. regex: "'(?=.)",
  260. next: "qstring"
  261. }, {
  262. token: "string",
  263. regex: '"(?=.)',
  264. next: "qqstring"
  265. }, {
  266. token: "constant.numeric",
  267. regex: /0(?:[xX][0-9a-fA-F]+|[oO][0-7]+|[bB][01]+)\b/
  268. }, {
  269. token: "constant.numeric",
  270. regex: /(?:\d\d*(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+\b)?/
  271. }, {
  272. token: [
  273. "storage.type", "punctuation.operator", "support.function",
  274. "punctuation.operator", "entity.name.function", "text", "keyword.operator"
  275. ],
  276. regex: "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe + ")(\\s*)(=)",
  277. next: "function_arguments"
  278. }, {
  279. token: [
  280. "storage.type", "punctuation.operator", "entity.name.function", "text",
  281. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  282. ],
  283. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  284. next: "function_arguments"
  285. }, {
  286. token: [
  287. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  288. "text", "paren.lparen"
  289. ],
  290. regex: "(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  291. next: "function_arguments"
  292. }, {
  293. token: [
  294. "storage.type", "punctuation.operator", "entity.name.function", "text",
  295. "keyword.operator", "text",
  296. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  297. ],
  298. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  299. next: "function_arguments"
  300. }, {
  301. token: [
  302. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  303. ],
  304. regex: "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  305. next: "function_arguments"
  306. }, {
  307. token: [
  308. "entity.name.function", "text", "punctuation.operator",
  309. "text", "storage.type", "text", "paren.lparen"
  310. ],
  311. regex: "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  312. next: "function_arguments"
  313. }, {
  314. token: [
  315. "text", "text", "storage.type", "text", "paren.lparen"
  316. ],
  317. regex: "(:)(\\s*)(function)(\\s*)(\\()",
  318. next: "function_arguments"
  319. }, {
  320. token: "keyword",
  321. regex: "from(?=\\s*('|\"))"
  322. }, {
  323. token: "keyword",
  324. regex: "(?:" + kwBeforeRe + ")\\b",
  325. next: "start"
  326. }, {
  327. token: ["support.constant"],
  328. regex: /that\b/
  329. }, {
  330. token: ["storage.type", "punctuation.operator", "support.function.firebug"],
  331. regex: /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  332. }, {
  333. token: keywordMapper,
  334. regex: identifierRe
  335. }, {
  336. token: "punctuation.operator",
  337. regex: /[.](?![.])/,
  338. next: "property"
  339. }, {
  340. token: "storage.type",
  341. regex: /=>/,
  342. next: "start"
  343. }, {
  344. token: "keyword.operator",
  345. regex: /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  346. next: "start"
  347. }, {
  348. token: "punctuation.operator",
  349. regex: /[?:,;.]/,
  350. next: "start"
  351. }, {
  352. token: "paren.lparen",
  353. regex: /[\[({]/,
  354. next: "start"
  355. }, {
  356. token: "paren.rparen",
  357. regex: /[\])}]/
  358. }, {
  359. token: "comment",
  360. regex: /^#!.*$/
  361. }
  362. ],
  363. property: [{
  364. token: "text",
  365. regex: "\\s+"
  366. }, {
  367. token: [
  368. "storage.type", "punctuation.operator", "entity.name.function", "text",
  369. "keyword.operator", "text",
  370. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  371. ],
  372. regex: "(" + identifierRe + ")(\\.)(" + identifierRe + ")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  373. next: "function_arguments"
  374. }, {
  375. token: "punctuation.operator",
  376. regex: /[.](?![.])/
  377. }, {
  378. token: "support.function",
  379. 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(?=\()/
  380. }, {
  381. token: "support.function.dom",
  382. 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(?=\()/
  383. }, {
  384. token: "support.constant",
  385. 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/
  386. }, {
  387. token: "identifier",
  388. regex: identifierRe
  389. }, {
  390. regex: "",
  391. token: "empty",
  392. next: "no_regex"
  393. }
  394. ],
  395. "start": [
  396. DocCommentHighlightRules.getStartRule("doc-start"),
  397. comments("start"),
  398. {
  399. token: "string.regexp",
  400. regex: "\\/",
  401. next: "regex"
  402. }, {
  403. token: "text",
  404. regex: "\\s+|^$",
  405. next: "start"
  406. }, {
  407. token: "empty",
  408. regex: "",
  409. next: "no_regex"
  410. }
  411. ],
  412. "regex": [
  413. {
  414. token: "regexp.keyword.operator",
  415. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  416. }, {
  417. token: "string.regexp",
  418. regex: "/[sxngimy]*",
  419. next: "no_regex"
  420. }, {
  421. token: "invalid",
  422. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  423. }, {
  424. token: "constant.language.escape",
  425. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  426. }, {
  427. token: "constant.language.delimiter",
  428. regex: /\|/
  429. }, {
  430. token: "constant.language.escape",
  431. regex: /\[\^?/,
  432. next: "regex_character_class"
  433. }, {
  434. token: "empty",
  435. regex: "$",
  436. next: "no_regex"
  437. }, {
  438. defaultToken: "string.regexp"
  439. }
  440. ],
  441. "regex_character_class": [
  442. {
  443. token: "regexp.charclass.keyword.operator",
  444. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  445. }, {
  446. token: "constant.language.escape",
  447. regex: "]",
  448. next: "regex"
  449. }, {
  450. token: "constant.language.escape",
  451. regex: "-"
  452. }, {
  453. token: "empty",
  454. regex: "$",
  455. next: "no_regex"
  456. }, {
  457. defaultToken: "string.regexp.charachterclass"
  458. }
  459. ],
  460. "function_arguments": [
  461. {
  462. token: "variable.parameter",
  463. regex: identifierRe
  464. }, {
  465. token: "punctuation.operator",
  466. regex: "[, ]+"
  467. }, {
  468. token: "punctuation.operator",
  469. regex: "$"
  470. }, {
  471. token: "empty",
  472. regex: "",
  473. next: "no_regex"
  474. }
  475. ],
  476. "qqstring": [
  477. {
  478. token: "constant.language.escape",
  479. regex: escapedRe
  480. }, {
  481. token: "string",
  482. regex: "\\\\$",
  483. consumeLineEnd: true
  484. }, {
  485. token: "string",
  486. regex: '"|$',
  487. next: "no_regex"
  488. }, {
  489. defaultToken: "string"
  490. }
  491. ],
  492. "qstring": [
  493. {
  494. token: "constant.language.escape",
  495. regex: escapedRe
  496. }, {
  497. token: "string",
  498. regex: "\\\\$",
  499. consumeLineEnd: true
  500. }, {
  501. token: "string",
  502. regex: "'|$",
  503. next: "no_regex"
  504. }, {
  505. defaultToken: "string"
  506. }
  507. ]
  508. };
  509. if (!options || !options.noES6) {
  510. this.$rules.no_regex.unshift({
  511. regex: "[{}]", onMatch: function (val, state, stack) {
  512. this.next = val == "{" ? this.nextState : "";
  513. if (val == "{" && stack.length) {
  514. stack.unshift("start", state);
  515. }
  516. else if (val == "}" && stack.length) {
  517. stack.shift();
  518. this.next = stack.shift();
  519. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  520. return "paren.quasi.end";
  521. }
  522. return val == "{" ? "paren.lparen" : "paren.rparen";
  523. },
  524. nextState: "start"
  525. }, {
  526. token: "string.quasi.start",
  527. regex: /`/,
  528. push: [{
  529. token: "constant.language.escape",
  530. regex: escapedRe
  531. }, {
  532. token: "paren.quasi.start",
  533. regex: /\${/,
  534. push: "start"
  535. }, {
  536. token: "string.quasi.end",
  537. regex: /`/,
  538. next: "pop"
  539. }, {
  540. defaultToken: "string.quasi"
  541. }]
  542. });
  543. if (!options || options.jsx != false)
  544. JSX.call(this);
  545. }
  546. this.embedRules(DocCommentHighlightRules, "doc-", [DocCommentHighlightRules.getEndRule("no_regex")]);
  547. this.normalizeRules();
  548. };
  549. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  550. function JSX() {
  551. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  552. var jsxTag = {
  553. onMatch: function (val, state, stack) {
  554. var offset = val.charAt(1) == "/" ? 2 : 1;
  555. if (offset == 1) {
  556. if (state != this.nextState)
  557. stack.unshift(this.next, this.nextState, 0);
  558. else
  559. stack.unshift(this.next);
  560. stack[2]++;
  561. }
  562. else if (offset == 2) {
  563. if (state == this.nextState) {
  564. stack[1]--;
  565. if (!stack[1] || stack[1] < 0) {
  566. stack.shift();
  567. stack.shift();
  568. }
  569. }
  570. }
  571. return [{
  572. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  573. value: val.slice(0, offset)
  574. }, {
  575. type: "meta.tag.tag-name.xml",
  576. value: val.substr(offset)
  577. }];
  578. },
  579. regex: "</?" + tagRegex + "",
  580. next: "jsxAttributes",
  581. nextState: "jsx"
  582. };
  583. this.$rules.start.unshift(jsxTag);
  584. var jsxJsRule = {
  585. regex: "{",
  586. token: "paren.quasi.start",
  587. push: "start"
  588. };
  589. this.$rules.jsx = [
  590. jsxJsRule,
  591. jsxTag,
  592. { include: "reference" },
  593. { defaultToken: "string" }
  594. ];
  595. this.$rules.jsxAttributes = [{
  596. token: "meta.tag.punctuation.tag-close.xml",
  597. regex: "/?>",
  598. onMatch: function (value, currentState, stack) {
  599. if (currentState == stack[0])
  600. stack.shift();
  601. if (value.length == 2) {
  602. if (stack[0] == this.nextState)
  603. stack[1]--;
  604. if (!stack[1] || stack[1] < 0) {
  605. stack.splice(0, 2);
  606. }
  607. }
  608. this.next = stack[0] || "start";
  609. return [{ type: this.token, value: value }];
  610. },
  611. nextState: "jsx"
  612. },
  613. jsxJsRule,
  614. comments("jsxAttributes"),
  615. {
  616. token: "entity.other.attribute-name.xml",
  617. regex: tagRegex
  618. }, {
  619. token: "keyword.operator.attribute-equals.xml",
  620. regex: "="
  621. }, {
  622. token: "text.tag-whitespace.xml",
  623. regex: "\\s+"
  624. }, {
  625. token: "string.attribute-value.xml",
  626. regex: "'",
  627. stateName: "jsx_attr_q",
  628. push: [
  629. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  630. { include: "reference" },
  631. { defaultToken: "string.attribute-value.xml" }
  632. ]
  633. }, {
  634. token: "string.attribute-value.xml",
  635. regex: '"',
  636. stateName: "jsx_attr_qq",
  637. push: [
  638. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  639. { include: "reference" },
  640. { defaultToken: "string.attribute-value.xml" }
  641. ]
  642. },
  643. jsxTag
  644. ];
  645. this.$rules.reference = [{
  646. token: "constant.language.escape.reference.xml",
  647. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  648. }];
  649. }
  650. function comments(next) {
  651. return [
  652. {
  653. token: "comment",
  654. regex: /\/\*/,
  655. next: [
  656. DocCommentHighlightRules.getTagRule(),
  657. { token: "comment", regex: "\\*\\/", next: next || "pop" },
  658. { defaultToken: "comment", caseInsensitive: true }
  659. ]
  660. }, {
  661. token: "comment",
  662. regex: "\\/\\/",
  663. next: [
  664. DocCommentHighlightRules.getTagRule(),
  665. { token: "comment", regex: "$|^", next: next || "pop" },
  666. { defaultToken: "comment", caseInsensitive: true }
  667. ]
  668. }
  669. ];
  670. }
  671. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  672. });
  673. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  674. var oop = require("../lib/oop");
  675. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  676. var XmlHighlightRules = function (normalize) {
  677. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  678. this.$rules = {
  679. start: [
  680. { token: "string.cdata.xml", regex: "<\\!\\[CDATA\\[", next: "cdata" },
  681. {
  682. token: ["punctuation.instruction.xml", "keyword.instruction.xml"],
  683. regex: "(<\\?)(" + tagRegex + ")", next: "processing_instruction"
  684. },
  685. { token: "comment.start.xml", regex: "<\\!--", next: "comment" },
  686. {
  687. token: ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  688. regex: "(<\\!)(DOCTYPE)(?=[\\s])", next: "doctype", caseInsensitive: true
  689. },
  690. { include: "tag" },
  691. { token: "text.end-tag-open.xml", regex: "</" },
  692. { token: "text.tag-open.xml", regex: "<" },
  693. { include: "reference" },
  694. { defaultToken: "text.xml" }
  695. ],
  696. processing_instruction: [{
  697. token: "entity.other.attribute-name.decl-attribute-name.xml",
  698. regex: tagRegex
  699. }, {
  700. token: "keyword.operator.decl-attribute-equals.xml",
  701. regex: "="
  702. }, {
  703. include: "whitespace"
  704. }, {
  705. include: "string"
  706. }, {
  707. token: "punctuation.xml-decl.xml",
  708. regex: "\\?>",
  709. next: "start"
  710. }],
  711. doctype: [
  712. { include: "whitespace" },
  713. { include: "string" },
  714. { token: "xml-pe.doctype.xml", regex: ">", next: "start" },
  715. { token: "xml-pe.xml", regex: "[-_a-zA-Z0-9:]+" },
  716. { token: "punctuation.int-subset", regex: "\\[", push: "int_subset" }
  717. ],
  718. int_subset: [{
  719. token: "text.xml",
  720. regex: "\\s+"
  721. }, {
  722. token: "punctuation.int-subset.xml",
  723. regex: "]",
  724. next: "pop"
  725. }, {
  726. token: ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  727. regex: "(<\\!)(" + tagRegex + ")",
  728. push: [{
  729. token: "text",
  730. regex: "\\s+"
  731. },
  732. {
  733. token: "punctuation.markup-decl.xml",
  734. regex: ">",
  735. next: "pop"
  736. },
  737. { include: "string" }]
  738. }],
  739. cdata: [
  740. { token: "string.cdata.xml", regex: "\\]\\]>", next: "start" },
  741. { token: "text.xml", regex: "\\s+" },
  742. { token: "text.xml", regex: "(?:[^\\]]|\\](?!\\]>))+" }
  743. ],
  744. comment: [
  745. { token: "comment.end.xml", regex: "-->", next: "start" },
  746. { defaultToken: "comment.xml" }
  747. ],
  748. reference: [{
  749. token: "constant.language.escape.reference.xml",
  750. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  751. }],
  752. attr_reference: [{
  753. token: "constant.language.escape.reference.attribute-value.xml",
  754. regex: "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  755. }],
  756. tag: [{
  757. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  758. regex: "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  759. next: [
  760. { include: "attributes" },
  761. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  762. ]
  763. }],
  764. tag_whitespace: [
  765. { token: "text.tag-whitespace.xml", regex: "\\s+" }
  766. ],
  767. whitespace: [
  768. { token: "text.whitespace.xml", regex: "\\s+" }
  769. ],
  770. string: [{
  771. token: "string.xml",
  772. regex: "'",
  773. push: [
  774. { token: "string.xml", regex: "'", next: "pop" },
  775. { defaultToken: "string.xml" }
  776. ]
  777. }, {
  778. token: "string.xml",
  779. regex: '"',
  780. push: [
  781. { token: "string.xml", regex: '"', next: "pop" },
  782. { defaultToken: "string.xml" }
  783. ]
  784. }],
  785. attributes: [{
  786. token: "entity.other.attribute-name.xml",
  787. regex: tagRegex
  788. }, {
  789. token: "keyword.operator.attribute-equals.xml",
  790. regex: "="
  791. }, {
  792. include: "tag_whitespace"
  793. }, {
  794. include: "attribute_value"
  795. }],
  796. attribute_value: [{
  797. token: "string.attribute-value.xml",
  798. regex: "'",
  799. push: [
  800. { token: "string.attribute-value.xml", regex: "'", next: "pop" },
  801. { include: "attr_reference" },
  802. { defaultToken: "string.attribute-value.xml" }
  803. ]
  804. }, {
  805. token: "string.attribute-value.xml",
  806. regex: '"',
  807. push: [
  808. { token: "string.attribute-value.xml", regex: '"', next: "pop" },
  809. { include: "attr_reference" },
  810. { defaultToken: "string.attribute-value.xml" }
  811. ]
  812. }]
  813. };
  814. if (this.constructor === XmlHighlightRules)
  815. this.normalizeRules();
  816. };
  817. (function () {
  818. this.embedTagRules = function (HighlightRules, prefix, tag) {
  819. this.$rules.tag.unshift({
  820. token: ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  821. regex: "(<)(" + tag + "(?=\\s|>|$))",
  822. next: [
  823. { include: "attributes" },
  824. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: prefix + "start" }
  825. ]
  826. });
  827. this.$rules[tag + "-end"] = [
  828. { include: "attributes" },
  829. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start",
  830. onMatch: function (value, currentState, stack) {
  831. stack.splice(0);
  832. return this.token;
  833. } }
  834. ];
  835. this.embedRules(HighlightRules, prefix, [{
  836. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  837. regex: "(</)(" + tag + "(?=\\s|>|$))",
  838. next: tag + "-end"
  839. }, {
  840. token: "string.cdata.xml",
  841. regex: "<\\!\\[CDATA\\["
  842. }, {
  843. token: "string.cdata.xml",
  844. regex: "\\]\\]>"
  845. }]);
  846. };
  847. }).call(TextHighlightRules.prototype);
  848. oop.inherits(XmlHighlightRules, TextHighlightRules);
  849. exports.XmlHighlightRules = XmlHighlightRules;
  850. });
  851. 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(require, exports, module){"use strict";
  852. var oop = require("../lib/oop");
  853. var lang = require("../lib/lang");
  854. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  855. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  856. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  857. var tagMap = lang.createMap({
  858. a: 'anchor',
  859. button: 'form',
  860. form: 'form',
  861. img: 'image',
  862. input: 'form',
  863. label: 'form',
  864. option: 'form',
  865. script: 'script',
  866. select: 'form',
  867. textarea: 'form',
  868. style: 'style',
  869. table: 'table',
  870. tbody: 'table',
  871. td: 'table',
  872. tfoot: 'table',
  873. th: 'table',
  874. tr: 'table'
  875. });
  876. var HtmlHighlightRules = function () {
  877. XmlHighlightRules.call(this);
  878. this.addRules({
  879. attributes: [{
  880. include: "tag_whitespace"
  881. }, {
  882. token: "entity.other.attribute-name.xml",
  883. regex: "[-_a-zA-Z0-9:.]+"
  884. }, {
  885. token: "keyword.operator.attribute-equals.xml",
  886. regex: "=",
  887. push: [{
  888. include: "tag_whitespace"
  889. }, {
  890. token: "string.unquoted.attribute-value.html",
  891. regex: "[^<>='\"`\\s]+",
  892. next: "pop"
  893. }, {
  894. token: "empty",
  895. regex: "",
  896. next: "pop"
  897. }]
  898. }, {
  899. include: "attribute_value"
  900. }],
  901. tag: [{
  902. token: function (start, tag) {
  903. var group = tagMap[tag];
  904. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  905. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  906. },
  907. regex: "(</?)([-_a-zA-Z0-9:.]+)",
  908. next: "tag_stuff"
  909. }],
  910. tag_stuff: [
  911. { include: "attributes" },
  912. { token: "meta.tag.punctuation.tag-close.xml", regex: "/?>", next: "start" }
  913. ]
  914. });
  915. this.embedTagRules(CssHighlightRules, "css-", "style");
  916. this.embedTagRules(new JavaScriptHighlightRules({ jsx: false }).getRules(), "js-", "script");
  917. if (this.constructor === HtmlHighlightRules)
  918. this.normalizeRules();
  919. };
  920. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  921. exports.HtmlHighlightRules = HtmlHighlightRules;
  922. });
  923. ace.define("ace/mode/markdown_highlight_rules",["require","exports","module","ace/config","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module){"use strict";
  924. var modes = require("../config").$modes;
  925. var oop = require("../lib/oop");
  926. var lang = require("../lib/lang");
  927. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  928. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  929. var escaped = function (ch) {
  930. return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
  931. };
  932. var MarkdownHighlightRules = function () {
  933. HtmlHighlightRules.call(this);
  934. var codeBlockStartRule = {
  935. token: "support.function",
  936. regex: /^\s*(```+[^`]*|~~~+[^~]*)$/,
  937. onMatch: function (value, state, stack, line) {
  938. var m = value.match(/^(\s*)([`~]+)(.*)/);
  939. var language = /[\w-]+|$/.exec(m[3])[0];
  940. if (!modes[language])
  941. language = "";
  942. stack.unshift("githubblock", [], [m[1], m[2], language], state);
  943. return this.token;
  944. },
  945. next: "githubblock"
  946. };
  947. var codeBlockRules = [{
  948. token: "support.function",
  949. regex: ".*",
  950. onMatch: function (value, state, stack, line) {
  951. var embedState = stack[1];
  952. var indent = stack[2][0];
  953. var endMarker = stack[2][1];
  954. var language = stack[2][2];
  955. var m = /^(\s*)(`+|~+)\s*$/.exec(value);
  956. if (m && m[1].length < indent.length + 3
  957. && m[2].length >= endMarker.length && m[2][0] == endMarker[0]) {
  958. stack.splice(0, 3);
  959. this.next = stack.shift();
  960. return this.token;
  961. }
  962. this.next = "";
  963. if (language && modes[language]) {
  964. var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
  965. stack[1] = data.state;
  966. return data.tokens;
  967. }
  968. return this.token;
  969. }
  970. }];
  971. this.$rules["start"].unshift({
  972. token: "empty_line",
  973. regex: '^$',
  974. next: "allowBlock"
  975. }, {
  976. token: "markup.heading.1",
  977. regex: "^=+(?=\\s*$)"
  978. }, {
  979. token: "markup.heading.2",
  980. regex: "^\\-+(?=\\s*$)"
  981. }, {
  982. token: function (value) {
  983. return "markup.heading." + value.length;
  984. },
  985. regex: /^#{1,6}(?=\s|$)/,
  986. next: "header"
  987. }, codeBlockStartRule, {
  988. token: "string.blockquote",
  989. regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
  990. next: "blockquote"
  991. }, {
  992. token: "constant",
  993. regex: "^ {0,3}(?:(?:\\* ?){3,}|(?:\\- ?){3,}|(?:\\_ ?){3,})\\s*$",
  994. next: "allowBlock"
  995. }, {
  996. token: "markup.list",
  997. regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
  998. next: "listblock-start"
  999. }, {
  1000. include: "basic"
  1001. });
  1002. this.addRules({
  1003. "basic": [{
  1004. token: "constant.language.escape",
  1005. regex: /\\[\\`*_{}\[\]()#+\-.!]/
  1006. }, {
  1007. token: "support.function",
  1008. regex: "(`+)(.*?[^`])(\\1)"
  1009. }, {
  1010. token: ["text", "constant", "text", "url", "string", "text"],
  1011. regex: "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
  1012. }, {
  1013. token: ["text", "string", "text", "constant", "text"],
  1014. regex: "(\\[)(" + escaped("]") + ")(\\]\\s*\\[)(" + escaped("]") + ")(\\])"
  1015. }, {
  1016. token: ["text", "string", "text", "markup.underline", "string", "text"],
  1017. regex: "(\\!?\\[)(" + // [
  1018. escaped("]") + // link text or alt text
  1019. ")(\\]\\()" + // ](
  1020. '((?:[^\\)\\s\\\\]|\\\\.|\\s(?=[^"]))*)' + // href or image
  1021. '(\\s*"' + escaped('"') + '"\\s*)?' + // "title"
  1022. "(\\))" // )
  1023. }, {
  1024. token: "string.strong",
  1025. regex: "([*]{2}|[_]{2}(?=\\S))(.*?\\S[*_]*)(\\1)"
  1026. }, {
  1027. token: "string.emphasis",
  1028. regex: "([*]|[_](?=\\S))(.*?\\S[*_]*)(\\1)"
  1029. }, {
  1030. token: ["text", "url", "text"],
  1031. regex: "(<)(" +
  1032. "(?:https?|ftp|dict):[^'\">\\s]+" +
  1033. "|" +
  1034. "(?:mailto:)?[-.\\w]+\\@[-a-z0-9]+(?:\\.[-a-z0-9]+)*\\.[a-z]+" +
  1035. ")(>)"
  1036. }],
  1037. "allowBlock": [
  1038. { token: "support.function", regex: "^ {4}.+", next: "allowBlock" },
  1039. { token: "empty_line", regex: '^$', next: "allowBlock" },
  1040. { token: "empty", regex: "", next: "start" }
  1041. ],
  1042. "header": [{
  1043. regex: "$",
  1044. next: "start"
  1045. }, {
  1046. include: "basic"
  1047. }, {
  1048. defaultToken: "heading"
  1049. }],
  1050. "listblock-start": [{
  1051. token: "support.variable",
  1052. regex: /(?:\[[ x]\])?/,
  1053. next: "listblock"
  1054. }],
  1055. "listblock": [{
  1056. token: "empty_line",
  1057. regex: "^$",
  1058. next: "start"
  1059. }, {
  1060. token: "markup.list",
  1061. regex: "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+",
  1062. next: "listblock-start"
  1063. }, {
  1064. include: "basic", noEscape: true
  1065. },
  1066. codeBlockStartRule,
  1067. {
  1068. defaultToken: "list" //do not use markup.list to allow stling leading `*` differntly
  1069. }],
  1070. "blockquote": [{
  1071. token: "empty_line",
  1072. regex: "^\\s*$",
  1073. next: "start"
  1074. }, {
  1075. token: "string.blockquote",
  1076. regex: "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
  1077. next: "blockquote"
  1078. }, {
  1079. include: "basic", noEscape: true
  1080. }, {
  1081. defaultToken: "string.blockquote"
  1082. }],
  1083. "githubblock": codeBlockRules
  1084. });
  1085. this.normalizeRules();
  1086. };
  1087. oop.inherits(MarkdownHighlightRules, TextHighlightRules);
  1088. exports.MarkdownHighlightRules = MarkdownHighlightRules;
  1089. });
  1090. ace.define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
  1091. var oop = require("../lib/oop");
  1092. var lang = require("../lib/lang");
  1093. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1094. var CssHighlightRules = require("./css_highlight_rules");
  1095. var ScssHighlightRules = function () {
  1096. var properties = lang.arrayToMap(CssHighlightRules.supportType.split("|"));
  1097. var functions = lang.arrayToMap(("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" +
  1098. "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" +
  1099. "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" +
  1100. "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" +
  1101. "scale_color|transparentize|type_of|unit|unitless|unquote").split("|"));
  1102. var constants = lang.arrayToMap(CssHighlightRules.supportConstant.split("|"));
  1103. var colors = lang.arrayToMap(CssHighlightRules.supportConstantColor.split("|"));
  1104. var keywords = lang.arrayToMap(("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|"));
  1105. var tags = lang.arrayToMap(("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" +
  1106. "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" +
  1107. "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" +
  1108. "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" +
  1109. "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" +
  1110. "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" +
  1111. "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" +
  1112. "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" +
  1113. "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|"));
  1114. var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
  1115. this.$rules = {
  1116. "start": [
  1117. {
  1118. token: "comment",
  1119. regex: "\\/\\/.*$"
  1120. },
  1121. {
  1122. token: "comment",
  1123. regex: "\\/\\*",
  1124. next: "comment"
  1125. }, {
  1126. token: "string",
  1127. regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  1128. }, {
  1129. token: "string",
  1130. regex: '["].*\\\\$',
  1131. next: "qqstring"
  1132. }, {
  1133. token: "string",
  1134. regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  1135. }, {
  1136. token: "string",
  1137. regex: "['].*\\\\$",
  1138. next: "qstring"
  1139. }, {
  1140. token: "constant.numeric",
  1141. regex: numRe + "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)"
  1142. }, {
  1143. token: "constant.numeric",
  1144. regex: "#[a-f0-9]{6}"
  1145. }, {
  1146. token: "constant.numeric",
  1147. regex: "#[a-f0-9]{3}"
  1148. }, {
  1149. token: "constant.numeric",
  1150. regex: numRe
  1151. }, {
  1152. token: ["support.function", "string", "support.function"],
  1153. regex: "(url\\()(.*)(\\))"
  1154. }, {
  1155. token: function (value) {
  1156. if (properties.hasOwnProperty(value.toLowerCase()))
  1157. return "support.type";
  1158. if (keywords.hasOwnProperty(value))
  1159. return "keyword";
  1160. else if (constants.hasOwnProperty(value))
  1161. return "constant.language";
  1162. else if (functions.hasOwnProperty(value))
  1163. return "support.function";
  1164. else if (colors.hasOwnProperty(value.toLowerCase()))
  1165. return "support.constant.color";
  1166. else if (tags.hasOwnProperty(value.toLowerCase()))
  1167. return "variable.language";
  1168. else
  1169. return "text";
  1170. },
  1171. regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
  1172. }, {
  1173. token: "variable",
  1174. regex: "[a-z_\\-$][a-z0-9_\\-$]*\\b"
  1175. }, {
  1176. token: "variable.language",
  1177. regex: "#[a-z0-9-_]+"
  1178. }, {
  1179. token: "variable.language",
  1180. regex: "\\.[a-z0-9-_]+"
  1181. }, {
  1182. token: "variable.language",
  1183. regex: ":[a-z0-9-_]+"
  1184. }, {
  1185. token: "constant",
  1186. regex: "[a-z0-9-_]+"
  1187. }, {
  1188. token: "keyword.operator",
  1189. regex: "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*"
  1190. }, {
  1191. token: "paren.lparen",
  1192. regex: "[[({]"
  1193. }, {
  1194. token: "paren.rparen",
  1195. regex: "[\\])}]"
  1196. }, {
  1197. token: "text",
  1198. regex: "\\s+"
  1199. }, {
  1200. caseInsensitive: true
  1201. }
  1202. ],
  1203. "comment": [
  1204. {
  1205. token: "comment",
  1206. regex: "\\*\\/",
  1207. next: "start"
  1208. }, {
  1209. defaultToken: "comment"
  1210. }
  1211. ],
  1212. "qqstring": [
  1213. {
  1214. token: "string",
  1215. regex: '(?:(?:\\\\.)|(?:[^"\\\\]))*?"',
  1216. next: "start"
  1217. }, {
  1218. token: "string",
  1219. regex: '.+'
  1220. }
  1221. ],
  1222. "qstring": [
  1223. {
  1224. token: "string",
  1225. regex: "(?:(?:\\\\.)|(?:[^'\\\\]))*?'",
  1226. next: "start"
  1227. }, {
  1228. token: "string",
  1229. regex: '.+'
  1230. }
  1231. ]
  1232. };
  1233. };
  1234. oop.inherits(ScssHighlightRules, TextHighlightRules);
  1235. exports.ScssHighlightRules = ScssHighlightRules;
  1236. });
  1237. ace.define("ace/mode/less_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){"use strict";
  1238. var oop = require("../lib/oop");
  1239. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1240. var CssHighlightRules = require('./css_highlight_rules');
  1241. var LessHighlightRules = function () {
  1242. var keywordList = "@import|@media|@font-face|@keyframes|@-webkit-keyframes|@supports|" +
  1243. "@charset|@plugin|@namespace|@document|@page|@viewport|@-ms-viewport|" +
  1244. "or|and|when|not";
  1245. var keywords = keywordList.split('|');
  1246. var properties = CssHighlightRules.supportType.split('|');
  1247. var keywordMapper = this.createKeywordMapper({
  1248. "support.constant": CssHighlightRules.supportConstant,
  1249. "keyword": keywordList,
  1250. "support.constant.color": CssHighlightRules.supportConstantColor,
  1251. "support.constant.fonts": CssHighlightRules.supportConstantFonts
  1252. }, "identifier", true);
  1253. var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
  1254. this.$rules = {
  1255. "start": [
  1256. {
  1257. token: "comment",
  1258. regex: "\\/\\/.*$"
  1259. },
  1260. {
  1261. token: "comment",
  1262. regex: "\\/\\*",
  1263. next: "comment"
  1264. }, {
  1265. token: "string",
  1266. regex: '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  1267. }, {
  1268. token: "string",
  1269. regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  1270. }, {
  1271. token: ["constant.numeric", "keyword"],
  1272. 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|%)"
  1273. }, {
  1274. token: "constant.numeric",
  1275. regex: "#[a-f0-9]{6}"
  1276. }, {
  1277. token: "constant.numeric",
  1278. regex: "#[a-f0-9]{3}"
  1279. }, {
  1280. token: "constant.numeric",
  1281. regex: numRe
  1282. }, {
  1283. token: ["support.function", "paren.lparen", "string", "paren.rparen"],
  1284. regex: "(url)(\\()(.*)(\\))"
  1285. }, {
  1286. token: ["support.function", "paren.lparen"],
  1287. regex: "(:extend|[a-z0-9_\\-]+)(\\()"
  1288. }, {
  1289. token: function (value) {
  1290. if (keywords.indexOf(value.toLowerCase()) > -1)
  1291. return "keyword";
  1292. else
  1293. return "variable";
  1294. },
  1295. regex: "[@\\$][a-z0-9_\\-@\\$]*\\b"
  1296. }, {
  1297. token: "variable",
  1298. regex: "[@\\$]\\{[a-z0-9_\\-@\\$]*\\}"
  1299. }, {
  1300. token: function (first, second) {
  1301. if (properties.indexOf(first.toLowerCase()) > -1) {
  1302. return ["support.type.property", "text"];
  1303. }
  1304. else {
  1305. return ["support.type.unknownProperty", "text"];
  1306. }
  1307. },
  1308. regex: "([a-z0-9-_]+)(\\s*:)"
  1309. }, {
  1310. token: "keyword",
  1311. regex: "&" // special case - always treat as keyword
  1312. }, {
  1313. token: keywordMapper,
  1314. regex: "\\-?[@a-z_][@a-z0-9_\\-]*"
  1315. }, {
  1316. token: "variable.language",
  1317. regex: "#[a-z0-9-_]+"
  1318. }, {
  1319. token: "variable.language",
  1320. regex: "\\.[a-z0-9-_]+"
  1321. }, {
  1322. token: "variable.language",
  1323. regex: ":[a-z_][a-z0-9-_]*"
  1324. }, {
  1325. token: "constant",
  1326. regex: "[a-z0-9-_]+"
  1327. }, {
  1328. token: "keyword.operator",
  1329. regex: "<|>|<=|>=|=|!=|-|%|\\+|\\*"
  1330. }, {
  1331. token: "paren.lparen",
  1332. regex: "[[({]"
  1333. }, {
  1334. token: "paren.rparen",
  1335. regex: "[\\])}]"
  1336. }, {
  1337. token: "text",
  1338. regex: "\\s+"
  1339. }, {
  1340. caseInsensitive: true
  1341. }
  1342. ],
  1343. "comment": [
  1344. {
  1345. token: "comment",
  1346. regex: "\\*\\/",
  1347. next: "start"
  1348. }, {
  1349. defaultToken: "comment"
  1350. }
  1351. ]
  1352. };
  1353. this.normalizeRules();
  1354. };
  1355. oop.inherits(LessHighlightRules, TextHighlightRules);
  1356. exports.LessHighlightRules = LessHighlightRules;
  1357. });
  1358. ace.define("ace/mode/coffee_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
  1359. var oop = require("../lib/oop");
  1360. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1361. oop.inherits(CoffeeHighlightRules, TextHighlightRules);
  1362. function CoffeeHighlightRules() {
  1363. var identifier = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
  1364. var keywords = ("this|throw|then|try|typeof|super|switch|return|break|by|continue|" +
  1365. "catch|class|in|instanceof|is|isnt|if|else|extends|for|own|" +
  1366. "finally|function|while|when|new|no|not|delete|debugger|do|loop|of|off|" +
  1367. "or|on|unless|until|and|yes|yield|export|import|default");
  1368. var langConstant = ("true|false|null|undefined|NaN|Infinity");
  1369. var illegal = ("case|const|function|var|void|with|enum|implements|" +
  1370. "interface|let|package|private|protected|public|static");
  1371. var supportClass = ("Array|Boolean|Date|Function|Number|Object|RegExp|ReferenceError|String|" +
  1372. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" +
  1373. "SyntaxError|TypeError|URIError|" +
  1374. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  1375. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray");
  1376. var supportFunction = ("Math|JSON|isNaN|isFinite|parseInt|parseFloat|encodeURI|" +
  1377. "encodeURIComponent|decodeURI|decodeURIComponent|String|");
  1378. var variableLanguage = ("window|arguments|prototype|document");
  1379. var keywordMapper = this.createKeywordMapper({
  1380. "keyword": keywords,
  1381. "constant.language": langConstant,
  1382. "invalid.illegal": illegal,
  1383. "language.support.class": supportClass,
  1384. "language.support.function": supportFunction,
  1385. "variable.language": variableLanguage
  1386. }, "identifier");
  1387. var functionRule = {
  1388. token: ["paren.lparen", "variable.parameter", "paren.rparen", "text", "storage.type"],
  1389. regex: /(?:(\()((?:"[^")]*?"|'[^')]*?'|\/[^\/)]*?\/|[^()"'\/])*?)(\))(\s*))?([\-=]>)/.source
  1390. };
  1391. var stringEscape = /\\(?:x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)/;
  1392. this.$rules = {
  1393. start: [
  1394. {
  1395. token: "constant.numeric",
  1396. regex: "(?:0x[\\da-fA-F]+|(?:\\d+(?:\\.\\d+)?|\\.\\d+)(?:[eE][+-]?\\d+)?)"
  1397. }, {
  1398. stateName: "qdoc",
  1399. token: "string", regex: "'''", next: [
  1400. { token: "string", regex: "'''", next: "start" },
  1401. { token: "constant.language.escape", regex: stringEscape },
  1402. { defaultToken: "string" }
  1403. ]
  1404. }, {
  1405. stateName: "qqdoc",
  1406. token: "string",
  1407. regex: '"""',
  1408. next: [
  1409. { token: "string", regex: '"""', next: "start" },
  1410. { token: "paren.string", regex: '#{', push: "start" },
  1411. { token: "constant.language.escape", regex: stringEscape },
  1412. { defaultToken: "string" }
  1413. ]
  1414. }, {
  1415. stateName: "qstring",
  1416. token: "string", regex: "'", next: [
  1417. { token: "string", regex: "'", next: "start" },
  1418. { token: "constant.language.escape", regex: stringEscape },
  1419. { defaultToken: "string" }
  1420. ]
  1421. }, {
  1422. stateName: "qqstring",
  1423. token: "string.start", regex: '"', next: [
  1424. { token: "string.end", regex: '"', next: "start" },
  1425. { token: "paren.string", regex: '#{', push: "start" },
  1426. { token: "constant.language.escape", regex: stringEscape },
  1427. { defaultToken: "string" }
  1428. ]
  1429. }, {
  1430. stateName: "js",
  1431. token: "string", regex: "`", next: [
  1432. { token: "string", regex: "`", next: "start" },
  1433. { token: "constant.language.escape", regex: stringEscape },
  1434. { defaultToken: "string" }
  1435. ]
  1436. }, {
  1437. regex: "[{}]", onMatch: function (val, state, stack) {
  1438. this.next = "";
  1439. if (val == "{" && stack.length) {
  1440. stack.unshift("start", state);
  1441. return "paren";
  1442. }
  1443. if (val == "}" && stack.length) {
  1444. stack.shift();
  1445. this.next = stack.shift() || "";
  1446. if (this.next.indexOf("string") != -1)
  1447. return "paren.string";
  1448. }
  1449. return "paren";
  1450. }
  1451. }, {
  1452. token: "string.regex",
  1453. regex: "///",
  1454. next: "heregex"
  1455. }, {
  1456. token: "string.regex",
  1457. regex: /(?:\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)(?:[imgy]{0,4})(?!\w)/
  1458. }, {
  1459. token: "comment",
  1460. regex: "###(?!#)",
  1461. next: "comment"
  1462. }, {
  1463. token: "comment",
  1464. regex: "#.*"
  1465. }, {
  1466. token: ["punctuation.operator", "text", "identifier"],
  1467. regex: "(\\.)(\\s*)(" + illegal + ")"
  1468. }, {
  1469. token: "punctuation.operator",
  1470. regex: "\\.{1,3}"
  1471. }, {
  1472. token: ["keyword", "text", "language.support.class",
  1473. "text", "keyword", "text", "language.support.class"],
  1474. regex: "(class)(\\s+)(" + identifier + ")(?:(\\s+)(extends)(\\s+)(" + identifier + "))?"
  1475. }, {
  1476. token: ["entity.name.function", "text", "keyword.operator", "text"].concat(functionRule.token),
  1477. regex: "(" + identifier + ")(\\s*)([=:])(\\s*)" + functionRule.regex
  1478. },
  1479. functionRule,
  1480. {
  1481. token: "variable",
  1482. regex: "@(?:" + identifier + ")?"
  1483. }, {
  1484. token: keywordMapper,
  1485. regex: identifier
  1486. }, {
  1487. token: "punctuation.operator",
  1488. regex: "\\,|\\."
  1489. }, {
  1490. token: "storage.type",
  1491. regex: "[\\-=]>"
  1492. }, {
  1493. token: "keyword.operator",
  1494. regex: "(?:[-+*/%<>&|^!?=]=|>>>=?|\\-\\-|\\+\\+|::|&&=|\\|\\|=|<<=|>>=|\\?\\.|\\.{2,3}|[!*+-=><])"
  1495. }, {
  1496. token: "paren.lparen",
  1497. regex: "[({[]"
  1498. }, {
  1499. token: "paren.rparen",
  1500. regex: "[\\]})]"
  1501. }, {
  1502. token: "text",
  1503. regex: "\\s+"
  1504. }
  1505. ],
  1506. heregex: [{
  1507. token: "string.regex",
  1508. regex: '.*?///[imgy]{0,4}',
  1509. next: "start"
  1510. }, {
  1511. token: "comment.regex",
  1512. regex: "\\s+(?:#.*)?"
  1513. }, {
  1514. token: "string.regex",
  1515. regex: "\\S+"
  1516. }],
  1517. comment: [{
  1518. token: "comment",
  1519. regex: '###',
  1520. next: "start"
  1521. }, {
  1522. defaultToken: "comment"
  1523. }]
  1524. };
  1525. this.normalizeRules();
  1526. }
  1527. exports.CoffeeHighlightRules = CoffeeHighlightRules;
  1528. });
  1529. ace.define("ace/mode/jade_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/markdown_highlight_rules","ace/mode/scss_highlight_rules","ace/mode/less_highlight_rules","ace/mode/coffee_highlight_rules","ace/mode/javascript_highlight_rules"], function(require, exports, module){/*
  1530. THIS FILE WAS AUTOGENERATED BY mode_highlight_rules.tmpl.js (UUID: C5B73B98-5F2A-42E3-9F0E-028A74A9FE4B)
  1531. */
  1532. "use strict";
  1533. var oop = require("../lib/oop");
  1534. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1535. var MarkdownHighlightRules = require("./markdown_highlight_rules").MarkdownHighlightRules;
  1536. var SassHighlightRules = require("./scss_highlight_rules").ScssHighlightRules;
  1537. var LessHighlightRules = require("./less_highlight_rules").LessHighlightRules;
  1538. var CoffeeHighlightRules = require("./coffee_highlight_rules").CoffeeHighlightRules;
  1539. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1540. function mixin_embed(tag, prefix) {
  1541. return {
  1542. token: "entity.name.function.jade",
  1543. regex: "^\\s*\\:" + tag,
  1544. next: prefix + "start"
  1545. };
  1546. }
  1547. var JadeHighlightRules = function () {
  1548. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  1549. "u[0-9a-fA-F]{4}|" + // unicode
  1550. "[0-2][0-7]{0,2}|" + // oct
  1551. "3[0-6][0-7]?|" + // oct
  1552. "37[0-7]?|" + // oct
  1553. "[4-7][0-7]?|" + //oct
  1554. ".)";
  1555. this.$rules =
  1556. {
  1557. "start": [
  1558. {
  1559. token: "keyword.control.import.include.jade",
  1560. regex: "\\s*\\binclude\\b"
  1561. },
  1562. {
  1563. token: "keyword.other.doctype.jade",
  1564. regex: "^!!!\\s*(?:[a-zA-Z0-9-_]+)?"
  1565. },
  1566. {
  1567. onMatch: function (value, currentState, stack) {
  1568. stack.unshift(this.next, value.length - 2, currentState);
  1569. return "comment";
  1570. },
  1571. regex: /^\s*\/\//,
  1572. next: "comment_block"
  1573. },
  1574. mixin_embed("markdown", "markdown-"),
  1575. mixin_embed("sass", "sass-"),
  1576. mixin_embed("less", "less-"),
  1577. mixin_embed("coffee", "coffee-"),
  1578. {
  1579. token: ["storage.type.function.jade",
  1580. "entity.name.function.jade",
  1581. "punctuation.definition.parameters.begin.jade",
  1582. "variable.parameter.function.jade",
  1583. "punctuation.definition.parameters.end.jade"
  1584. ],
  1585. regex: "^(\\s*mixin)( [\\w\\-]+)(\\s*\\()(.*?)(\\))"
  1586. },
  1587. {
  1588. token: ["storage.type.function.jade", "entity.name.function.jade"],
  1589. regex: "^(\\s*mixin)( [\\w\\-]+)"
  1590. },
  1591. {
  1592. token: "source.js.embedded.jade",
  1593. regex: "^\\s*(?:-|=|!=)",
  1594. next: "js-start"
  1595. },
  1596. {
  1597. token: "string.interpolated.jade",
  1598. regex: "[#!]\\{[^\\}]+\\}"
  1599. },
  1600. {
  1601. token: "meta.tag.any.jade",
  1602. regex: /^\s*(?!\w+:)(?:[\w-]+|(?=\.|#)])/,
  1603. next: "tag_single"
  1604. },
  1605. {
  1606. token: "suport.type.attribute.id.jade",
  1607. regex: "#\\w+"
  1608. },
  1609. {
  1610. token: "suport.type.attribute.class.jade",
  1611. regex: "\\.\\w+"
  1612. },
  1613. {
  1614. token: "punctuation",
  1615. regex: "\\s*(?:\\()",
  1616. next: "tag_attributes"
  1617. }
  1618. ],
  1619. "comment_block": [
  1620. { regex: /^\s*(?:\/\/)?/, onMatch: function (value, currentState, stack) {
  1621. if (value.length <= stack[1]) {
  1622. if (value.slice(-1) == "/") {
  1623. stack[1] = value.length - 2;
  1624. this.next = "";
  1625. return "comment";
  1626. }
  1627. stack.shift();
  1628. stack.shift();
  1629. this.next = stack.shift();
  1630. return "text";
  1631. }
  1632. else {
  1633. this.next = "";
  1634. return "comment";
  1635. }
  1636. }, next: "start" },
  1637. { defaultToken: "comment" }
  1638. ],
  1639. "tag_single": [
  1640. {
  1641. token: "entity.other.attribute-name.class.jade",
  1642. regex: "\\.[\\w-]+"
  1643. },
  1644. {
  1645. token: "entity.other.attribute-name.id.jade",
  1646. regex: "#[\\w-]+"
  1647. },
  1648. {
  1649. token: ["text", "punctuation"],
  1650. regex: "($)|((?!\\.|#|=|-))",
  1651. next: "start"
  1652. }
  1653. ],
  1654. "tag_attributes": [
  1655. {
  1656. token: "string",
  1657. regex: "'(?=.)",
  1658. next: "qstring"
  1659. },
  1660. {
  1661. token: "string",
  1662. regex: '"(?=.)',
  1663. next: "qqstring"
  1664. },
  1665. {
  1666. token: ["entity.other.attribute-name.jade", "punctuation"],
  1667. regex: "([a-zA-Z:\\.-]+)(=)?",
  1668. next: "attribute_strings"
  1669. },
  1670. {
  1671. token: "punctuation",
  1672. regex: "\\)",
  1673. next: "start"
  1674. }
  1675. ],
  1676. "attribute_strings": [
  1677. {
  1678. token: "string",
  1679. regex: "'(?=.)",
  1680. next: "qstring"
  1681. },
  1682. {
  1683. token: "string",
  1684. regex: '"(?=.)',
  1685. next: "qqstring"
  1686. },
  1687. {
  1688. token: "string",
  1689. regex: '(?=\\S)',
  1690. next: "tag_attributes"
  1691. }
  1692. ],
  1693. "qqstring": [
  1694. {
  1695. token: "constant.language.escape",
  1696. regex: escapedRe
  1697. }, {
  1698. token: "string",
  1699. regex: '[^"\\\\]+'
  1700. }, {
  1701. token: "string",
  1702. regex: "\\\\$",
  1703. next: "qqstring"
  1704. }, {
  1705. token: "string",
  1706. regex: '"|$',
  1707. next: "tag_attributes"
  1708. }
  1709. ],
  1710. "qstring": [
  1711. {
  1712. token: "constant.language.escape",
  1713. regex: escapedRe
  1714. }, {
  1715. token: "string",
  1716. regex: "[^'\\\\]+"
  1717. }, {
  1718. token: "string",
  1719. regex: "\\\\$",
  1720. next: "qstring"
  1721. }, {
  1722. token: "string",
  1723. regex: "'|$",
  1724. next: "tag_attributes"
  1725. }
  1726. ]
  1727. };
  1728. this.embedRules(JavaScriptHighlightRules, "js-", [{
  1729. token: "text",
  1730. regex: ".$",
  1731. next: "start"
  1732. }]);
  1733. };
  1734. oop.inherits(JadeHighlightRules, TextHighlightRules);
  1735. exports.JadeHighlightRules = JadeHighlightRules;
  1736. });
  1737. ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
  1738. var oop = require("../../lib/oop");
  1739. var BaseFoldMode = require("./fold_mode").FoldMode;
  1740. var Range = require("../../range").Range;
  1741. var FoldMode = exports.FoldMode = function () { };
  1742. oop.inherits(FoldMode, BaseFoldMode);
  1743. (function () {
  1744. this.getFoldWidgetRange = function (session, foldStyle, row) {
  1745. var range = this.indentationBlock(session, row);
  1746. if (range)
  1747. return range;
  1748. var re = /\S/;
  1749. var line = session.getLine(row);
  1750. var startLevel = line.search(re);
  1751. if (startLevel == -1 || line[startLevel] != "#")
  1752. return;
  1753. var startColumn = line.length;
  1754. var maxRow = session.getLength();
  1755. var startRow = row;
  1756. var endRow = row;
  1757. while (++row < maxRow) {
  1758. line = session.getLine(row);
  1759. var level = line.search(re);
  1760. if (level == -1)
  1761. continue;
  1762. if (line[level] != "#")
  1763. break;
  1764. endRow = row;
  1765. }
  1766. if (endRow > startRow) {
  1767. var endColumn = session.getLine(endRow).length;
  1768. return new Range(startRow, startColumn, endRow, endColumn);
  1769. }
  1770. };
  1771. this.getFoldWidget = function (session, foldStyle, row) {
  1772. var line = session.getLine(row);
  1773. var indent = line.search(/\S/);
  1774. var next = session.getLine(row + 1);
  1775. var prev = session.getLine(row - 1);
  1776. var prevIndent = prev.search(/\S/);
  1777. var nextIndent = next.search(/\S/);
  1778. if (indent == -1) {
  1779. session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : "";
  1780. return "";
  1781. }
  1782. if (prevIndent == -1) {
  1783. if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
  1784. session.foldWidgets[row - 1] = "";
  1785. session.foldWidgets[row + 1] = "";
  1786. return "start";
  1787. }
  1788. }
  1789. else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
  1790. if (session.getLine(row - 2).search(/\S/) == -1) {
  1791. session.foldWidgets[row - 1] = "start";
  1792. session.foldWidgets[row + 1] = "";
  1793. return "";
  1794. }
  1795. }
  1796. if (prevIndent != -1 && prevIndent < indent)
  1797. session.foldWidgets[row - 1] = "start";
  1798. else
  1799. session.foldWidgets[row - 1] = "";
  1800. if (indent < nextIndent)
  1801. return "start";
  1802. else
  1803. return "";
  1804. };
  1805. }).call(FoldMode.prototype);
  1806. });
  1807. ace.define("ace/mode/jade",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jade_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){"use strict";
  1808. var oop = require("../lib/oop");
  1809. var TextMode = require("./text").Mode;
  1810. var JadeHighlightRules = require("./jade_highlight_rules").JadeHighlightRules;
  1811. var FoldMode = require("./folding/coffee").FoldMode;
  1812. var Mode = function () {
  1813. this.HighlightRules = JadeHighlightRules;
  1814. this.foldingRules = new FoldMode();
  1815. this.$behaviour = this.$defaultBehaviour;
  1816. };
  1817. oop.inherits(Mode, TextMode);
  1818. (function () {
  1819. this.lineCommentStart = "//";
  1820. this.$id = "ace/mode/jade";
  1821. }).call(Mode.prototype);
  1822. exports.Mode = Mode;
  1823. }); (function() {
  1824. ace.require(["ace/mode/jade"], function(m) {
  1825. if (typeof module == "object" && typeof exports == "object" && module) {
  1826. module.exports = m;
  1827. }
  1828. });
  1829. })();