mode-html_elixir.js 121 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005
  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) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var lang = require("../lib/lang");
  5. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  6. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|min-height|min-width|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index";
  7. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  8. 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";
  9. var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
  10. 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";
  11. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
  12. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  13. 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";
  14. var CssHighlightRules = function() {
  15. var keywordMapper = this.createKeywordMapper({
  16. "support.function": supportFunction,
  17. "support.constant": supportConstant,
  18. "support.type": supportType,
  19. "support.constant.color": supportConstantColor,
  20. "support.constant.fonts": supportConstantFonts
  21. }, "text", true);
  22. this.$rules = {
  23. "start" : [{
  24. token : "comment", // multi line comment
  25. regex : "\\/\\*",
  26. push : "comment"
  27. }, {
  28. token: "paren.lparen",
  29. regex: "\\{",
  30. push: "ruleset"
  31. }, {
  32. token: "string",
  33. regex: "@.*?{",
  34. push: "media"
  35. }, {
  36. token: "keyword",
  37. regex: "#[a-z0-9-_]+"
  38. }, {
  39. token: "variable",
  40. regex: "\\.[a-z0-9-_]+"
  41. }, {
  42. token: "string",
  43. regex: ":[a-z0-9-_]+"
  44. }, {
  45. token: "constant",
  46. regex: "[a-z0-9-_]+"
  47. }, {
  48. caseInsensitive: true
  49. }],
  50. "media" : [{
  51. token : "comment", // multi line comment
  52. regex : "\\/\\*",
  53. push : "comment"
  54. }, {
  55. token: "paren.lparen",
  56. regex: "\\{",
  57. push: "ruleset"
  58. }, {
  59. token: "string",
  60. regex: "\\}",
  61. next: "pop"
  62. }, {
  63. token: "keyword",
  64. regex: "#[a-z0-9-_]+"
  65. }, {
  66. token: "variable",
  67. regex: "\\.[a-z0-9-_]+"
  68. }, {
  69. token: "string",
  70. regex: ":[a-z0-9-_]+"
  71. }, {
  72. token: "constant",
  73. regex: "[a-z0-9-_]+"
  74. }, {
  75. caseInsensitive: true
  76. }],
  77. "comment" : [{
  78. token : "comment",
  79. regex : "\\*\\/",
  80. next : "pop"
  81. }, {
  82. defaultToken : "comment"
  83. }],
  84. "ruleset" : [
  85. {
  86. token : "paren.rparen",
  87. regex : "\\}",
  88. next: "pop"
  89. }, {
  90. token : "comment", // multi line comment
  91. regex : "\\/\\*",
  92. push : "comment"
  93. }, {
  94. token : "string", // single line
  95. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  96. }, {
  97. token : "string", // single line
  98. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  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|vm|vw|%)"
  102. }, {
  103. token : "constant.numeric",
  104. regex : numRe
  105. }, {
  106. token : "constant.numeric", // hex6 color
  107. regex : "#[a-f0-9]{6}"
  108. }, {
  109. token : "constant.numeric", // hex3 color
  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. token : ["support.function", "string", "support.function"],
  119. regex : "(url\\()(.*)(\\))"
  120. }, {
  121. token : keywordMapper,
  122. regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  123. }, {
  124. caseInsensitive: true
  125. }]
  126. };
  127. this.normalizeRules();
  128. };
  129. oop.inherits(CssHighlightRules, TextHighlightRules);
  130. exports.CssHighlightRules = CssHighlightRules;
  131. });
  132. ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  133. "use strict";
  134. var oop = require("../lib/oop");
  135. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  136. var DocCommentHighlightRules = function() {
  137. this.$rules = {
  138. "start" : [ {
  139. token : "comment.doc.tag",
  140. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  141. },
  142. DocCommentHighlightRules.getTagRule(),
  143. {
  144. defaultToken : "comment.doc",
  145. caseInsensitive: true
  146. }]
  147. };
  148. };
  149. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  150. DocCommentHighlightRules.getTagRule = function(start) {
  151. return {
  152. token : "comment.doc.tag.storage.type",
  153. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  154. };
  155. }
  156. DocCommentHighlightRules.getStartRule = function(start) {
  157. return {
  158. token : "comment.doc", // doc comment
  159. regex : "\\/\\*(?=\\*)",
  160. next : start
  161. };
  162. };
  163. DocCommentHighlightRules.getEndRule = function (start) {
  164. return {
  165. token : "comment.doc", // closing comment
  166. regex : "\\*\\/",
  167. next : start
  168. };
  169. };
  170. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  171. });
  172. 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) {
  173. "use strict";
  174. var oop = require("../lib/oop");
  175. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  176. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  177. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  178. var JavaScriptHighlightRules = function(options) {
  179. var keywordMapper = this.createKeywordMapper({
  180. "variable.language":
  181. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  182. "Namespace|QName|XML|XMLList|" + // E4X
  183. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  184. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  185. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  186. "SyntaxError|TypeError|URIError|" +
  187. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  188. "isNaN|parseFloat|parseInt|" +
  189. "JSON|Math|" + // Other
  190. "this|arguments|prototype|window|document" , // Pseudo
  191. "keyword":
  192. "const|yield|import|get|set|async|await|" +
  193. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  194. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  195. "__parent__|__count__|escape|unescape|with|__proto__|" +
  196. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  197. "storage.type":
  198. "const|let|var|function",
  199. "constant.language":
  200. "null|Infinity|NaN|undefined",
  201. "support.function":
  202. "alert",
  203. "constant.language.boolean": "true|false"
  204. }, "identifier");
  205. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  206. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  207. "u[0-9a-fA-F]{4}|" + // unicode
  208. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  209. "[0-2][0-7]{0,2}|" + // oct
  210. "3[0-7][0-7]?|" + // oct
  211. "[4-7][0-7]?|" + //oct
  212. ".)";
  213. this.$rules = {
  214. "no_regex" : [
  215. DocCommentHighlightRules.getStartRule("doc-start"),
  216. comments("no_regex"),
  217. {
  218. token : "string",
  219. regex : "'(?=.)",
  220. next : "qstring"
  221. }, {
  222. token : "string",
  223. regex : '"(?=.)',
  224. next : "qqstring"
  225. }, {
  226. token : "constant.numeric", // hex
  227. regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
  228. }, {
  229. token : "constant.numeric", // float
  230. regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
  231. }, {
  232. token : [
  233. "storage.type", "punctuation.operator", "support.function",
  234. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  235. ],
  236. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  237. next: "function_arguments"
  238. }, {
  239. token : [
  240. "storage.type", "punctuation.operator", "entity.name.function", "text",
  241. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  242. ],
  243. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  244. next: "function_arguments"
  245. }, {
  246. token : [
  247. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  248. "text", "paren.lparen"
  249. ],
  250. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  251. next: "function_arguments"
  252. }, {
  253. token : [
  254. "storage.type", "punctuation.operator", "entity.name.function", "text",
  255. "keyword.operator", "text",
  256. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  257. ],
  258. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  259. next: "function_arguments"
  260. }, {
  261. token : [
  262. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  263. ],
  264. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  265. next: "function_arguments"
  266. }, {
  267. token : [
  268. "entity.name.function", "text", "punctuation.operator",
  269. "text", "storage.type", "text", "paren.lparen"
  270. ],
  271. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  272. next: "function_arguments"
  273. }, {
  274. token : [
  275. "text", "text", "storage.type", "text", "paren.lparen"
  276. ],
  277. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  278. next: "function_arguments"
  279. }, {
  280. token : "keyword",
  281. regex : "(?:" + kwBeforeRe + ")\\b",
  282. next : "start"
  283. }, {
  284. token : ["support.constant"],
  285. regex : /that\b/
  286. }, {
  287. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  288. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  289. }, {
  290. token : keywordMapper,
  291. regex : identifierRe
  292. }, {
  293. token : "punctuation.operator",
  294. regex : /[.](?![.])/,
  295. next : "property"
  296. }, {
  297. token : "keyword.operator",
  298. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  299. next : "start"
  300. }, {
  301. token : "punctuation.operator",
  302. regex : /[?:,;.]/,
  303. next : "start"
  304. }, {
  305. token : "paren.lparen",
  306. regex : /[\[({]/,
  307. next : "start"
  308. }, {
  309. token : "paren.rparen",
  310. regex : /[\])}]/
  311. }, {
  312. token: "comment",
  313. regex: /^#!.*$/
  314. }
  315. ],
  316. property: [{
  317. token : "text",
  318. regex : "\\s+"
  319. }, {
  320. token : [
  321. "storage.type", "punctuation.operator", "entity.name.function", "text",
  322. "keyword.operator", "text",
  323. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  324. ],
  325. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  326. next: "function_arguments"
  327. }, {
  328. token : "punctuation.operator",
  329. regex : /[.](?![.])/
  330. }, {
  331. token : "support.function",
  332. 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(?=\()/
  333. }, {
  334. token : "support.function.dom",
  335. 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(?=\()/
  336. }, {
  337. token : "support.constant",
  338. 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/
  339. }, {
  340. token : "identifier",
  341. regex : identifierRe
  342. }, {
  343. regex: "",
  344. token: "empty",
  345. next: "no_regex"
  346. }
  347. ],
  348. "start": [
  349. DocCommentHighlightRules.getStartRule("doc-start"),
  350. comments("start"),
  351. {
  352. token: "string.regexp",
  353. regex: "\\/",
  354. next: "regex"
  355. }, {
  356. token : "text",
  357. regex : "\\s+|^$",
  358. next : "start"
  359. }, {
  360. token: "empty",
  361. regex: "",
  362. next: "no_regex"
  363. }
  364. ],
  365. "regex": [
  366. {
  367. token: "regexp.keyword.operator",
  368. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  369. }, {
  370. token: "string.regexp",
  371. regex: "/[sxngimy]*",
  372. next: "no_regex"
  373. }, {
  374. token : "invalid",
  375. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  376. }, {
  377. token : "constant.language.escape",
  378. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  379. }, {
  380. token : "constant.language.delimiter",
  381. regex: /\|/
  382. }, {
  383. token: "constant.language.escape",
  384. regex: /\[\^?/,
  385. next: "regex_character_class"
  386. }, {
  387. token: "empty",
  388. regex: "$",
  389. next: "no_regex"
  390. }, {
  391. defaultToken: "string.regexp"
  392. }
  393. ],
  394. "regex_character_class": [
  395. {
  396. token: "regexp.charclass.keyword.operator",
  397. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  398. }, {
  399. token: "constant.language.escape",
  400. regex: "]",
  401. next: "regex"
  402. }, {
  403. token: "constant.language.escape",
  404. regex: "-"
  405. }, {
  406. token: "empty",
  407. regex: "$",
  408. next: "no_regex"
  409. }, {
  410. defaultToken: "string.regexp.charachterclass"
  411. }
  412. ],
  413. "function_arguments": [
  414. {
  415. token: "variable.parameter",
  416. regex: identifierRe
  417. }, {
  418. token: "punctuation.operator",
  419. regex: "[, ]+"
  420. }, {
  421. token: "punctuation.operator",
  422. regex: "$"
  423. }, {
  424. token: "empty",
  425. regex: "",
  426. next: "no_regex"
  427. }
  428. ],
  429. "qqstring" : [
  430. {
  431. token : "constant.language.escape",
  432. regex : escapedRe
  433. }, {
  434. token : "string",
  435. regex : "\\\\$",
  436. next : "qqstring"
  437. }, {
  438. token : "string",
  439. regex : '"|$',
  440. next : "no_regex"
  441. }, {
  442. defaultToken: "string"
  443. }
  444. ],
  445. "qstring" : [
  446. {
  447. token : "constant.language.escape",
  448. regex : escapedRe
  449. }, {
  450. token : "string",
  451. regex : "\\\\$",
  452. next : "qstring"
  453. }, {
  454. token : "string",
  455. regex : "'|$",
  456. next : "no_regex"
  457. }, {
  458. defaultToken: "string"
  459. }
  460. ]
  461. };
  462. if (!options || !options.noES6) {
  463. this.$rules.no_regex.unshift({
  464. regex: "[{}]", onMatch: function(val, state, stack) {
  465. this.next = val == "{" ? this.nextState : "";
  466. if (val == "{" && stack.length) {
  467. stack.unshift("start", state);
  468. }
  469. else if (val == "}" && stack.length) {
  470. stack.shift();
  471. this.next = stack.shift();
  472. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  473. return "paren.quasi.end";
  474. }
  475. return val == "{" ? "paren.lparen" : "paren.rparen";
  476. },
  477. nextState: "start"
  478. }, {
  479. token : "string.quasi.start",
  480. regex : /`/,
  481. push : [{
  482. token : "constant.language.escape",
  483. regex : escapedRe
  484. }, {
  485. token : "paren.quasi.start",
  486. regex : /\${/,
  487. push : "start"
  488. }, {
  489. token : "string.quasi.end",
  490. regex : /`/,
  491. next : "pop"
  492. }, {
  493. defaultToken: "string.quasi"
  494. }]
  495. });
  496. if (!options || options.jsx != false)
  497. JSX.call(this);
  498. }
  499. this.embedRules(DocCommentHighlightRules, "doc-",
  500. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  501. this.normalizeRules();
  502. };
  503. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  504. function JSX() {
  505. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  506. var jsxTag = {
  507. onMatch : function(val, state, stack) {
  508. var offset = val.charAt(1) == "/" ? 2 : 1;
  509. if (offset == 1) {
  510. if (state != this.nextState)
  511. stack.unshift(this.next, this.nextState, 0);
  512. else
  513. stack.unshift(this.next);
  514. stack[2]++;
  515. } else if (offset == 2) {
  516. if (state == this.nextState) {
  517. stack[1]--;
  518. if (!stack[1] || stack[1] < 0) {
  519. stack.shift();
  520. stack.shift();
  521. }
  522. }
  523. }
  524. return [{
  525. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  526. value: val.slice(0, offset)
  527. }, {
  528. type: "meta.tag.tag-name.xml",
  529. value: val.substr(offset)
  530. }];
  531. },
  532. regex : "</?" + tagRegex + "",
  533. next: "jsxAttributes",
  534. nextState: "jsx"
  535. };
  536. this.$rules.start.unshift(jsxTag);
  537. var jsxJsRule = {
  538. regex: "{",
  539. token: "paren.quasi.start",
  540. push: "start"
  541. };
  542. this.$rules.jsx = [
  543. jsxJsRule,
  544. jsxTag,
  545. {include : "reference"},
  546. {defaultToken: "string"}
  547. ];
  548. this.$rules.jsxAttributes = [{
  549. token : "meta.tag.punctuation.tag-close.xml",
  550. regex : "/?>",
  551. onMatch : function(value, currentState, stack) {
  552. if (currentState == stack[0])
  553. stack.shift();
  554. if (value.length == 2) {
  555. if (stack[0] == this.nextState)
  556. stack[1]--;
  557. if (!stack[1] || stack[1] < 0) {
  558. stack.splice(0, 2);
  559. }
  560. }
  561. this.next = stack[0] || "start";
  562. return [{type: this.token, value: value}];
  563. },
  564. nextState: "jsx"
  565. },
  566. jsxJsRule,
  567. comments("jsxAttributes"),
  568. {
  569. token : "entity.other.attribute-name.xml",
  570. regex : tagRegex
  571. }, {
  572. token : "keyword.operator.attribute-equals.xml",
  573. regex : "="
  574. }, {
  575. token : "text.tag-whitespace.xml",
  576. regex : "\\s+"
  577. }, {
  578. token : "string.attribute-value.xml",
  579. regex : "'",
  580. stateName : "jsx_attr_q",
  581. push : [
  582. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  583. {include : "reference"},
  584. {defaultToken : "string.attribute-value.xml"}
  585. ]
  586. }, {
  587. token : "string.attribute-value.xml",
  588. regex : '"',
  589. stateName : "jsx_attr_qq",
  590. push : [
  591. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  592. {include : "reference"},
  593. {defaultToken : "string.attribute-value.xml"}
  594. ]
  595. },
  596. jsxTag
  597. ];
  598. this.$rules.reference = [{
  599. token : "constant.language.escape.reference.xml",
  600. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  601. }];
  602. }
  603. function comments(next) {
  604. return [
  605. {
  606. token : "comment", // multi line comment
  607. regex : /\/\*/,
  608. next: [
  609. DocCommentHighlightRules.getTagRule(),
  610. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  611. {defaultToken : "comment", caseInsensitive: true}
  612. ]
  613. }, {
  614. token : "comment",
  615. regex : "\\/\\/",
  616. next: [
  617. DocCommentHighlightRules.getTagRule(),
  618. {token : "comment", regex : "$|^", next : next || "pop"},
  619. {defaultToken : "comment", caseInsensitive: true}
  620. ]
  621. }
  622. ];
  623. }
  624. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  625. });
  626. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  627. "use strict";
  628. var oop = require("../lib/oop");
  629. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  630. var XmlHighlightRules = function(normalize) {
  631. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  632. this.$rules = {
  633. start : [
  634. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  635. {
  636. token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
  637. regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
  638. },
  639. {
  640. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  641. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
  642. },
  643. {token : "comment.xml", regex : "<\\!--", next : "comment"},
  644. {
  645. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  646. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  647. },
  648. {include : "tag"},
  649. {token : "text.end-tag-open.xml", regex: "</"},
  650. {token : "text.tag-open.xml", regex: "<"},
  651. {include : "reference"},
  652. {defaultToken : "text.xml"}
  653. ],
  654. xml_decl : [{
  655. token : "entity.other.attribute-name.decl-attribute-name.xml",
  656. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  657. }, {
  658. token : "keyword.operator.decl-attribute-equals.xml",
  659. regex : "="
  660. }, {
  661. include: "whitespace"
  662. }, {
  663. include: "string"
  664. }, {
  665. token : "punctuation.xml-decl.xml",
  666. regex : "\\?>",
  667. next : "start"
  668. }],
  669. processing_instruction : [
  670. {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
  671. {defaultToken : "instruction.xml"}
  672. ],
  673. doctype : [
  674. {include : "whitespace"},
  675. {include : "string"},
  676. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  677. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  678. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  679. ],
  680. int_subset : [{
  681. token : "text.xml",
  682. regex : "\\s+"
  683. }, {
  684. token: "punctuation.int-subset.xml",
  685. regex: "]",
  686. next: "pop"
  687. }, {
  688. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  689. regex : "(<\\!)(" + tagRegex + ")",
  690. push : [{
  691. token : "text",
  692. regex : "\\s+"
  693. },
  694. {
  695. token : "punctuation.markup-decl.xml",
  696. regex : ">",
  697. next : "pop"
  698. },
  699. {include : "string"}]
  700. }],
  701. cdata : [
  702. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  703. {token : "text.xml", regex : "\\s+"},
  704. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  705. ],
  706. comment : [
  707. {token : "comment.xml", regex : "-->", next : "start"},
  708. {defaultToken : "comment.xml"}
  709. ],
  710. reference : [{
  711. token : "constant.language.escape.reference.xml",
  712. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  713. }],
  714. attr_reference : [{
  715. token : "constant.language.escape.reference.attribute-value.xml",
  716. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  717. }],
  718. tag : [{
  719. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  720. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  721. next: [
  722. {include : "attributes"},
  723. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  724. ]
  725. }],
  726. tag_whitespace : [
  727. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  728. ],
  729. whitespace : [
  730. {token : "text.whitespace.xml", regex : "\\s+"}
  731. ],
  732. string: [{
  733. token : "string.xml",
  734. regex : "'",
  735. push : [
  736. {token : "string.xml", regex: "'", next: "pop"},
  737. {defaultToken : "string.xml"}
  738. ]
  739. }, {
  740. token : "string.xml",
  741. regex : '"',
  742. push : [
  743. {token : "string.xml", regex: '"', next: "pop"},
  744. {defaultToken : "string.xml"}
  745. ]
  746. }],
  747. attributes: [{
  748. token : "entity.other.attribute-name.xml",
  749. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  750. }, {
  751. token : "keyword.operator.attribute-equals.xml",
  752. regex : "="
  753. }, {
  754. include: "tag_whitespace"
  755. }, {
  756. include: "attribute_value"
  757. }],
  758. attribute_value: [{
  759. token : "string.attribute-value.xml",
  760. regex : "'",
  761. push : [
  762. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  763. {include : "attr_reference"},
  764. {defaultToken : "string.attribute-value.xml"}
  765. ]
  766. }, {
  767. token : "string.attribute-value.xml",
  768. regex : '"',
  769. push : [
  770. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  771. {include : "attr_reference"},
  772. {defaultToken : "string.attribute-value.xml"}
  773. ]
  774. }]
  775. };
  776. if (this.constructor === XmlHighlightRules)
  777. this.normalizeRules();
  778. };
  779. (function() {
  780. this.embedTagRules = function(HighlightRules, prefix, tag){
  781. this.$rules.tag.unshift({
  782. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  783. regex : "(<)(" + tag + "(?=\\s|>|$))",
  784. next: [
  785. {include : "attributes"},
  786. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  787. ]
  788. });
  789. this.$rules[tag + "-end"] = [
  790. {include : "attributes"},
  791. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  792. onMatch : function(value, currentState, stack) {
  793. stack.splice(0);
  794. return this.token;
  795. }}
  796. ]
  797. this.embedRules(HighlightRules, prefix, [{
  798. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  799. regex : "(</)(" + tag + "(?=\\s|>|$))",
  800. next: tag + "-end"
  801. }, {
  802. token: "string.cdata.xml",
  803. regex : "<\\!\\[CDATA\\["
  804. }, {
  805. token: "string.cdata.xml",
  806. regex : "\\]\\]>"
  807. }]);
  808. };
  809. }).call(TextHighlightRules.prototype);
  810. oop.inherits(XmlHighlightRules, TextHighlightRules);
  811. exports.XmlHighlightRules = XmlHighlightRules;
  812. });
  813. 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) {
  814. "use strict";
  815. var oop = require("../lib/oop");
  816. var lang = require("../lib/lang");
  817. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  818. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  819. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  820. var tagMap = lang.createMap({
  821. a : 'anchor',
  822. button : 'form',
  823. form : 'form',
  824. img : 'image',
  825. input : 'form',
  826. label : 'form',
  827. option : 'form',
  828. script : 'script',
  829. select : 'form',
  830. textarea : 'form',
  831. style : 'style',
  832. table : 'table',
  833. tbody : 'table',
  834. td : 'table',
  835. tfoot : 'table',
  836. th : 'table',
  837. tr : 'table'
  838. });
  839. var HtmlHighlightRules = function() {
  840. XmlHighlightRules.call(this);
  841. this.addRules({
  842. attributes: [{
  843. include : "tag_whitespace"
  844. }, {
  845. token : "entity.other.attribute-name.xml",
  846. regex : "[-_a-zA-Z0-9:.]+"
  847. }, {
  848. token : "keyword.operator.attribute-equals.xml",
  849. regex : "=",
  850. push : [{
  851. include: "tag_whitespace"
  852. }, {
  853. token : "string.unquoted.attribute-value.html",
  854. regex : "[^<>='\"`\\s]+",
  855. next : "pop"
  856. }, {
  857. token : "empty",
  858. regex : "",
  859. next : "pop"
  860. }]
  861. }, {
  862. include : "attribute_value"
  863. }],
  864. tag: [{
  865. token : function(start, tag) {
  866. var group = tagMap[tag];
  867. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  868. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  869. },
  870. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  871. next: "tag_stuff"
  872. }],
  873. tag_stuff: [
  874. {include : "attributes"},
  875. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  876. ]
  877. });
  878. this.embedTagRules(CssHighlightRules, "css-", "style");
  879. this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
  880. if (this.constructor === HtmlHighlightRules)
  881. this.normalizeRules();
  882. };
  883. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  884. exports.HtmlHighlightRules = HtmlHighlightRules;
  885. });
  886. ace.define("ace/mode/elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  887. "use strict";
  888. var oop = require("../lib/oop");
  889. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  890. var ElixirHighlightRules = function() {
  891. this.$rules = { start:
  892. [ { token:
  893. [ 'meta.module.elixir',
  894. 'keyword.control.module.elixir',
  895. 'meta.module.elixir',
  896. 'entity.name.type.module.elixir' ],
  897. regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
  898. { token: 'comment.documentation.heredoc',
  899. regex: '@(?:module|type)?doc (?:~[a-z])?"""',
  900. push:
  901. [ { token: 'comment.documentation.heredoc',
  902. regex: '\\s*"""',
  903. next: 'pop' },
  904. { include: '#interpolated_elixir' },
  905. { include: '#escaped_char' },
  906. { defaultToken: 'comment.documentation.heredoc' } ],
  907. comment: '@doc with heredocs is treated as documentation' },
  908. { token: 'comment.documentation.heredoc',
  909. regex: '@(?:module|type)?doc ~[A-Z]"""',
  910. push:
  911. [ { token: 'comment.documentation.heredoc',
  912. regex: '\\s*"""',
  913. next: 'pop' },
  914. { defaultToken: 'comment.documentation.heredoc' } ],
  915. comment: '@doc with heredocs is treated as documentation' },
  916. { token: 'comment.documentation.heredoc',
  917. regex: '@(?:module|type)?doc (?:~[a-z])?\'\'\'',
  918. push:
  919. [ { token: 'comment.documentation.heredoc',
  920. regex: '\\s*\'\'\'',
  921. next: 'pop' },
  922. { include: '#interpolated_elixir' },
  923. { include: '#escaped_char' },
  924. { defaultToken: 'comment.documentation.heredoc' } ],
  925. comment: '@doc with heredocs is treated as documentation' },
  926. { token: 'comment.documentation.heredoc',
  927. regex: '@(?:module|type)?doc ~[A-Z]\'\'\'',
  928. push:
  929. [ { token: 'comment.documentation.heredoc',
  930. regex: '\\s*\'\'\'',
  931. next: 'pop' },
  932. { defaultToken: 'comment.documentation.heredoc' } ],
  933. comment: '@doc with heredocs is treated as documentation' },
  934. { token: 'comment.documentation.false',
  935. regex: '@(?:module|type)?doc false',
  936. comment: '@doc false is treated as documentation' },
  937. { token: 'comment.documentation.string',
  938. regex: '@(?:module|type)?doc "',
  939. push:
  940. [ { token: 'comment.documentation.string',
  941. regex: '"',
  942. next: 'pop' },
  943. { include: '#interpolated_elixir' },
  944. { include: '#escaped_char' },
  945. { defaultToken: 'comment.documentation.string' } ],
  946. comment: '@doc with string is treated as documentation' },
  947. { token: 'keyword.control.elixir',
  948. regex: '\\b(?:do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])',
  949. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  950. originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|for|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defstruct|defmacrop?|defdelegate|defcallback|defmacrocallback|defexception|defoverridable|exit|after|rescue|catch|else|raise|throw|import|require|alias|use|quote|unquote|super)\\b(?![?!])' },
  951. { token: 'keyword.operator.elixir',
  952. regex: '\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
  953. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  954. originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
  955. comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
  956. { token: 'constant.language.elixir',
  957. regex: '\\b(?:nil|true|false)\\b(?![?!])' },
  958. { token: 'variable.language.elixir',
  959. regex: '\\b__(?:CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
  960. { token:
  961. [ 'punctuation.definition.variable.elixir',
  962. 'variable.other.readwrite.module.elixir' ],
  963. regex: '(@)([a-zA-Z_]\\w*)' },
  964. { token:
  965. [ 'punctuation.definition.variable.elixir',
  966. 'variable.other.anonymous.elixir' ],
  967. regex: '(&)(\\d*)' },
  968. { token: 'variable.other.constant.elixir',
  969. regex: '\\b[A-Z]\\w*\\b' },
  970. { token: 'constant.numeric.elixir',
  971. regex: '\\b(?:0x[\\da-fA-F](?:_?[\\da-fA-F])*|\\d(?:_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?:_?\\d)*)?(?:[eE][-+]?\\d(?:_?\\d)*)?|0b[01]+|0o[0-7]+)\\b',
  972. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  973. originalRegex: '\\b(0x\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0b[01]+|0o[0-7]+)\\b' },
  974. { token: 'punctuation.definition.constant.elixir',
  975. regex: ':\'',
  976. push:
  977. [ { token: 'punctuation.definition.constant.elixir',
  978. regex: '\'',
  979. next: 'pop' },
  980. { include: '#interpolated_elixir' },
  981. { include: '#escaped_char' },
  982. { defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] },
  983. { token: 'punctuation.definition.constant.elixir',
  984. regex: ':"',
  985. push:
  986. [ { token: 'punctuation.definition.constant.elixir',
  987. regex: '"',
  988. next: 'pop' },
  989. { include: '#interpolated_elixir' },
  990. { include: '#escaped_char' },
  991. { defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] },
  992. { token: 'punctuation.definition.string.begin.elixir',
  993. regex: '(?:\'\'\')',
  994. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  995. originalRegex: '(?>\'\'\')',
  996. push:
  997. [ { token: 'punctuation.definition.string.end.elixir',
  998. regex: '^\\s*\'\'\'',
  999. next: 'pop' },
  1000. { include: '#interpolated_elixir' },
  1001. { include: '#escaped_char' },
  1002. { defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ],
  1003. comment: 'Single-quoted heredocs' },
  1004. { token: 'punctuation.definition.string.begin.elixir',
  1005. regex: '\'',
  1006. push:
  1007. [ { token: 'punctuation.definition.string.end.elixir',
  1008. regex: '\'',
  1009. next: 'pop' },
  1010. { include: '#interpolated_elixir' },
  1011. { include: '#escaped_char' },
  1012. { defaultToken: 'support.function.variable.quoted.single.elixir' } ],
  1013. comment: 'single quoted string (allows for interpolation)' },
  1014. { token: 'punctuation.definition.string.begin.elixir',
  1015. regex: '(?:""")',
  1016. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1017. originalRegex: '(?>""")',
  1018. push:
  1019. [ { token: 'punctuation.definition.string.end.elixir',
  1020. regex: '^\\s*"""',
  1021. next: 'pop' },
  1022. { include: '#interpolated_elixir' },
  1023. { include: '#escaped_char' },
  1024. { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
  1025. comment: 'Double-quoted heredocs' },
  1026. { token: 'punctuation.definition.string.begin.elixir',
  1027. regex: '"',
  1028. push:
  1029. [ { token: 'punctuation.definition.string.end.elixir',
  1030. regex: '"',
  1031. next: 'pop' },
  1032. { include: '#interpolated_elixir' },
  1033. { include: '#escaped_char' },
  1034. { defaultToken: 'string.quoted.double.elixir' } ],
  1035. comment: 'double quoted string (allows for interpolation)' },
  1036. { token: 'punctuation.definition.string.begin.elixir',
  1037. regex: '~[a-z](?:""")',
  1038. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1039. originalRegex: '~[a-z](?>""")',
  1040. push:
  1041. [ { token: 'punctuation.definition.string.end.elixir',
  1042. regex: '^\\s*"""',
  1043. next: 'pop' },
  1044. { include: '#interpolated_elixir' },
  1045. { include: '#escaped_char' },
  1046. { defaultToken: 'string.quoted.double.heredoc.elixir' } ],
  1047. comment: 'Double-quoted heredocs sigils' },
  1048. { token: 'punctuation.definition.string.begin.elixir',
  1049. regex: '~[a-z]\\{',
  1050. push:
  1051. [ { token: 'punctuation.definition.string.end.elixir',
  1052. regex: '\\}[a-z]*',
  1053. next: 'pop' },
  1054. { include: '#interpolated_elixir' },
  1055. { include: '#escaped_char' },
  1056. { defaultToken: 'string.interpolated.elixir' } ],
  1057. comment: 'sigil (allow for interpolation)' },
  1058. { token: 'punctuation.definition.string.begin.elixir',
  1059. regex: '~[a-z]\\[',
  1060. push:
  1061. [ { token: 'punctuation.definition.string.end.elixir',
  1062. regex: '\\][a-z]*',
  1063. next: 'pop' },
  1064. { include: '#interpolated_elixir' },
  1065. { include: '#escaped_char' },
  1066. { defaultToken: 'string.interpolated.elixir' } ],
  1067. comment: 'sigil (allow for interpolation)' },
  1068. { token: 'punctuation.definition.string.begin.elixir',
  1069. regex: '~[a-z]\\<',
  1070. push:
  1071. [ { token: 'punctuation.definition.string.end.elixir',
  1072. regex: '\\>[a-z]*',
  1073. next: 'pop' },
  1074. { include: '#interpolated_elixir' },
  1075. { include: '#escaped_char' },
  1076. { defaultToken: 'string.interpolated.elixir' } ],
  1077. comment: 'sigil (allow for interpolation)' },
  1078. { token: 'punctuation.definition.string.begin.elixir',
  1079. regex: '~[a-z]\\(',
  1080. push:
  1081. [ { token: 'punctuation.definition.string.end.elixir',
  1082. regex: '\\)[a-z]*',
  1083. next: 'pop' },
  1084. { include: '#interpolated_elixir' },
  1085. { include: '#escaped_char' },
  1086. { defaultToken: 'string.interpolated.elixir' } ],
  1087. comment: 'sigil (allow for interpolation)' },
  1088. { token: 'punctuation.definition.string.begin.elixir',
  1089. regex: '~[a-z][^\\w]',
  1090. push:
  1091. [ { token: 'punctuation.definition.string.end.elixir',
  1092. regex: '[^\\w][a-z]*',
  1093. next: 'pop' },
  1094. { include: '#interpolated_elixir' },
  1095. { include: '#escaped_char' },
  1096. { include: '#escaped_char' },
  1097. { defaultToken: 'string.interpolated.elixir' } ],
  1098. comment: 'sigil (allow for interpolation)' },
  1099. { token: 'punctuation.definition.string.begin.elixir',
  1100. regex: '~[A-Z](?:""")',
  1101. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1102. originalRegex: '~[A-Z](?>""")',
  1103. push:
  1104. [ { token: 'punctuation.definition.string.end.elixir',
  1105. regex: '^\\s*"""',
  1106. next: 'pop' },
  1107. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1108. comment: 'Double-quoted heredocs sigils' },
  1109. { token: 'punctuation.definition.string.begin.elixir',
  1110. regex: '~[A-Z]\\{',
  1111. push:
  1112. [ { token: 'punctuation.definition.string.end.elixir',
  1113. regex: '\\}[a-z]*',
  1114. next: 'pop' },
  1115. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1116. comment: 'sigil (without interpolation)' },
  1117. { token: 'punctuation.definition.string.begin.elixir',
  1118. regex: '~[A-Z]\\[',
  1119. push:
  1120. [ { token: 'punctuation.definition.string.end.elixir',
  1121. regex: '\\][a-z]*',
  1122. next: 'pop' },
  1123. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1124. comment: 'sigil (without interpolation)' },
  1125. { token: 'punctuation.definition.string.begin.elixir',
  1126. regex: '~[A-Z]\\<',
  1127. push:
  1128. [ { token: 'punctuation.definition.string.end.elixir',
  1129. regex: '\\>[a-z]*',
  1130. next: 'pop' },
  1131. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1132. comment: 'sigil (without interpolation)' },
  1133. { token: 'punctuation.definition.string.begin.elixir',
  1134. regex: '~[A-Z]\\(',
  1135. push:
  1136. [ { token: 'punctuation.definition.string.end.elixir',
  1137. regex: '\\)[a-z]*',
  1138. next: 'pop' },
  1139. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1140. comment: 'sigil (without interpolation)' },
  1141. { token: 'punctuation.definition.string.begin.elixir',
  1142. regex: '~[A-Z][^\\w]',
  1143. push:
  1144. [ { token: 'punctuation.definition.string.end.elixir',
  1145. regex: '[^\\w][a-z]*',
  1146. next: 'pop' },
  1147. { defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
  1148. comment: 'sigil (without interpolation)' },
  1149. { token: ['punctuation.definition.constant.elixir', 'constant.other.symbol.elixir'],
  1150. regex: '(:)([a-zA-Z_][\\w@]*(?:[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(?:\\^\\^)?)',
  1151. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1152. originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|\\|>|=>|~|~=|=|/|\\\\\\\\|\\*\\*?|\\.\\.?\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\%?\\{\\}|%|\\[\\]|\\^(\\^\\^)?)',
  1153. comment: 'symbols' },
  1154. { token: 'punctuation.definition.constant.elixir',
  1155. regex: '(?:[a-zA-Z_][\\w@]*(?:[?!])?):(?!:)',
  1156. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1157. originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
  1158. comment: 'symbols' },
  1159. { token:
  1160. [ 'punctuation.definition.comment.elixir',
  1161. 'comment.line.number-sign.elixir' ],
  1162. regex: '(#)(.*)' },
  1163. { token: 'constant.numeric.elixir',
  1164. regex: '\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|[^xMC])|[^\\s\\\\])',
  1165. TODO: 'FIXME: regexp doesn\'t have js equivalent',
  1166. originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|[^xMC])|[^\\s\\\\])',
  1167. comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (3rd alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
  1168. { token: 'keyword.operator.assignment.augmented.elixir',
  1169. regex: '\\+=|\\-=|\\|\\|=|~=|&&=' },
  1170. { token: 'keyword.operator.comparison.elixir',
  1171. regex: '===?|!==?|<=?|>=?' },
  1172. { token: 'keyword.operator.bitwise.elixir',
  1173. regex: '\\|{3}|&{3}|\\^{3}|<{3}|>{3}|~{3}' },
  1174. { token: 'keyword.operator.logical.elixir',
  1175. regex: '!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
  1176. originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
  1177. { token: 'keyword.operator.arithmetic.elixir',
  1178. regex: '\\*|\\+|\\-|/' },
  1179. { token: 'keyword.operator.other.elixir',
  1180. regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\\\\\\\|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|\\|>|~|=>' },
  1181. { token: 'keyword.operator.assignment.elixir', regex: '=' },
  1182. { token: 'punctuation.separator.other.elixir', regex: ':' },
  1183. { token: 'punctuation.separator.statement.elixir',
  1184. regex: '\\;' },
  1185. { token: 'punctuation.separator.object.elixir', regex: ',' },
  1186. { token: 'punctuation.separator.method.elixir', regex: '\\.' },
  1187. { token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
  1188. { token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
  1189. { token: 'punctuation.section.function.elixir',
  1190. regex: '\\(|\\)' } ],
  1191. '#escaped_char':
  1192. [ { token: 'constant.character.escape.elixir',
  1193. regex: '\\\\(?:x[\\da-fA-F]{1,2}|.)' } ],
  1194. '#interpolated_elixir':
  1195. [ { token:
  1196. [ 'source.elixir.embedded.source',
  1197. 'source.elixir.embedded.source.empty' ],
  1198. regex: '(#\\{)(\\})' },
  1199. { todo:
  1200. { token: 'punctuation.section.embedded.elixir',
  1201. regex: '#\\{',
  1202. push:
  1203. [ { token: 'punctuation.section.embedded.elixir',
  1204. regex: '\\}',
  1205. next: 'pop' },
  1206. { include: '#nest_curly_and_self' },
  1207. { include: '$self' },
  1208. { defaultToken: 'source.elixir.embedded.source' } ] } } ],
  1209. '#nest_curly_and_self':
  1210. [ { token: 'punctuation.section.scope.elixir',
  1211. regex: '\\{',
  1212. push:
  1213. [ { token: 'punctuation.section.scope.elixir',
  1214. regex: '\\}',
  1215. next: 'pop' },
  1216. { include: '#nest_curly_and_self' } ] },
  1217. { include: '$self' } ],
  1218. '#regex_sub':
  1219. [ { include: '#interpolated_elixir' },
  1220. { include: '#escaped_char' },
  1221. { token:
  1222. [ 'punctuation.definition.arbitrary-repitition.elixir',
  1223. 'string.regexp.arbitrary-repitition.elixir',
  1224. 'string.regexp.arbitrary-repitition.elixir',
  1225. 'punctuation.definition.arbitrary-repitition.elixir' ],
  1226. regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
  1227. { token: 'punctuation.definition.character-class.elixir',
  1228. regex: '\\[(?:\\^?\\])?',
  1229. push:
  1230. [ { token: 'punctuation.definition.character-class.elixir',
  1231. regex: '\\]',
  1232. next: 'pop' },
  1233. { include: '#escaped_char' },
  1234. { defaultToken: 'string.regexp.character-class.elixir' } ] },
  1235. { token: 'punctuation.definition.group.elixir',
  1236. regex: '\\(',
  1237. push:
  1238. [ { token: 'punctuation.definition.group.elixir',
  1239. regex: '\\)',
  1240. next: 'pop' },
  1241. { include: '#regex_sub' },
  1242. { defaultToken: 'string.regexp.group.elixir' } ] },
  1243. { token:
  1244. [ 'punctuation.definition.comment.elixir',
  1245. 'comment.line.number-sign.elixir' ],
  1246. regex: '(?:^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
  1247. originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
  1248. comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] }
  1249. this.normalizeRules();
  1250. };
  1251. ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
  1252. fileTypes: [ 'ex', 'exs' ],
  1253. firstLineMatch: '^#!/.*\\belixir',
  1254. foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
  1255. foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
  1256. keyEquivalent: '^~E',
  1257. name: 'Elixir',
  1258. scopeName: 'source.elixir' }
  1259. oop.inherits(ElixirHighlightRules, TextHighlightRules);
  1260. exports.ElixirHighlightRules = ElixirHighlightRules;
  1261. });
  1262. ace.define("ace/mode/html_elixir_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/elixir_highlight_rules"], function(require, exports, module) {
  1263. "use strict";
  1264. var oop = require("../lib/oop");
  1265. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  1266. var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
  1267. var HtmlElixirHighlightRules = function() {
  1268. HtmlHighlightRules.call(this);
  1269. var startRules = [
  1270. {
  1271. regex: "<%%|%%>",
  1272. token: "constant.language.escape"
  1273. }, {
  1274. token : "comment.start.eex",
  1275. regex : "<%#",
  1276. push : [{
  1277. token : "comment.end.eex",
  1278. regex: "%>",
  1279. next: "pop",
  1280. defaultToken:"comment"
  1281. }]
  1282. }, {
  1283. token : "support.elixir_tag",
  1284. regex : "<%+(?!>)[-=]?",
  1285. push : "elixir-start"
  1286. }
  1287. ];
  1288. var endRules = [
  1289. {
  1290. token : "support.elixir_tag",
  1291. regex : "%>",
  1292. next : "pop"
  1293. }, {
  1294. token: "comment",
  1295. regex: "#(?:[^%]|%[^>])*"
  1296. }
  1297. ];
  1298. for (var key in this.$rules)
  1299. this.$rules[key].unshift.apply(this.$rules[key], startRules);
  1300. this.embedRules(ElixirHighlightRules, "elixir-", endRules, ["start"]);
  1301. this.normalizeRules();
  1302. };
  1303. oop.inherits(HtmlElixirHighlightRules, HtmlHighlightRules);
  1304. exports.HtmlElixirHighlightRules = HtmlElixirHighlightRules;
  1305. });
  1306. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  1307. "use strict";
  1308. var Range = require("../range").Range;
  1309. var MatchingBraceOutdent = function() {};
  1310. (function() {
  1311. this.checkOutdent = function(line, input) {
  1312. if (! /^\s+$/.test(line))
  1313. return false;
  1314. return /^\s*\}/.test(input);
  1315. };
  1316. this.autoOutdent = function(doc, row) {
  1317. var line = doc.getLine(row);
  1318. var match = line.match(/^(\s*\})/);
  1319. if (!match) return 0;
  1320. var column = match[1].length;
  1321. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  1322. if (!openBracePos || openBracePos.row == row) return 0;
  1323. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  1324. doc.replace(new Range(row, 0, row, column-1), indent);
  1325. };
  1326. this.$getIndent = function(line) {
  1327. return line.match(/^\s*/)[0];
  1328. };
  1329. }).call(MatchingBraceOutdent.prototype);
  1330. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  1331. });
  1332. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1333. "use strict";
  1334. var oop = require("../../lib/oop");
  1335. var Range = require("../../range").Range;
  1336. var BaseFoldMode = require("./fold_mode").FoldMode;
  1337. var FoldMode = exports.FoldMode = function(commentRegex) {
  1338. if (commentRegex) {
  1339. this.foldingStartMarker = new RegExp(
  1340. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  1341. );
  1342. this.foldingStopMarker = new RegExp(
  1343. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  1344. );
  1345. }
  1346. };
  1347. oop.inherits(FoldMode, BaseFoldMode);
  1348. (function() {
  1349. this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
  1350. this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
  1351. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  1352. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  1353. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  1354. this._getFoldWidgetBase = this.getFoldWidget;
  1355. this.getFoldWidget = function(session, foldStyle, row) {
  1356. var line = session.getLine(row);
  1357. if (this.singleLineBlockCommentRe.test(line)) {
  1358. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  1359. return "";
  1360. }
  1361. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  1362. if (!fw && this.startRegionRe.test(line))
  1363. return "start"; // lineCommentRegionStart
  1364. return fw;
  1365. };
  1366. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  1367. var line = session.getLine(row);
  1368. if (this.startRegionRe.test(line))
  1369. return this.getCommentRegionBlock(session, line, row);
  1370. var match = line.match(this.foldingStartMarker);
  1371. if (match) {
  1372. var i = match.index;
  1373. if (match[1])
  1374. return this.openingBracketBlock(session, match[1], row, i);
  1375. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  1376. if (range && !range.isMultiLine()) {
  1377. if (forceMultiline) {
  1378. range = this.getSectionRange(session, row);
  1379. } else if (foldStyle != "all")
  1380. range = null;
  1381. }
  1382. return range;
  1383. }
  1384. if (foldStyle === "markbegin")
  1385. return;
  1386. var match = line.match(this.foldingStopMarker);
  1387. if (match) {
  1388. var i = match.index + match[0].length;
  1389. if (match[1])
  1390. return this.closingBracketBlock(session, match[1], row, i);
  1391. return session.getCommentFoldRange(row, i, -1);
  1392. }
  1393. };
  1394. this.getSectionRange = function(session, row) {
  1395. var line = session.getLine(row);
  1396. var startIndent = line.search(/\S/);
  1397. var startRow = row;
  1398. var startColumn = line.length;
  1399. row = row + 1;
  1400. var endRow = row;
  1401. var maxRow = session.getLength();
  1402. while (++row < maxRow) {
  1403. line = session.getLine(row);
  1404. var indent = line.search(/\S/);
  1405. if (indent === -1)
  1406. continue;
  1407. if (startIndent > indent)
  1408. break;
  1409. var subRange = this.getFoldWidgetRange(session, "all", row);
  1410. if (subRange) {
  1411. if (subRange.start.row <= startRow) {
  1412. break;
  1413. } else if (subRange.isMultiLine()) {
  1414. row = subRange.end.row;
  1415. } else if (startIndent == indent) {
  1416. break;
  1417. }
  1418. }
  1419. endRow = row;
  1420. }
  1421. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1422. };
  1423. this.getCommentRegionBlock = function(session, line, row) {
  1424. var startColumn = line.search(/\s*$/);
  1425. var maxRow = session.getLength();
  1426. var startRow = row;
  1427. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1428. var depth = 1;
  1429. while (++row < maxRow) {
  1430. line = session.getLine(row);
  1431. var m = re.exec(line);
  1432. if (!m) continue;
  1433. if (m[1]) depth--;
  1434. else depth++;
  1435. if (!depth) break;
  1436. }
  1437. var endRow = row;
  1438. if (endRow > startRow) {
  1439. return new Range(startRow, startColumn, endRow, line.length);
  1440. }
  1441. };
  1442. }).call(FoldMode.prototype);
  1443. });
  1444. 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) {
  1445. "use strict";
  1446. var oop = require("../lib/oop");
  1447. var TextMode = require("./text").Mode;
  1448. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1449. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1450. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1451. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  1452. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1453. var Mode = function() {
  1454. this.HighlightRules = JavaScriptHighlightRules;
  1455. this.$outdent = new MatchingBraceOutdent();
  1456. this.$behaviour = new CstyleBehaviour();
  1457. this.foldingRules = new CStyleFoldMode();
  1458. };
  1459. oop.inherits(Mode, TextMode);
  1460. (function() {
  1461. this.lineCommentStart = "//";
  1462. this.blockComment = {start: "/*", end: "*/"};
  1463. this.getNextLineIndent = function(state, line, tab) {
  1464. var indent = this.$getIndent(line);
  1465. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  1466. var tokens = tokenizedLine.tokens;
  1467. var endState = tokenizedLine.state;
  1468. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  1469. return indent;
  1470. }
  1471. if (state == "start" || state == "no_regex") {
  1472. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  1473. if (match) {
  1474. indent += tab;
  1475. }
  1476. } else if (state == "doc-start") {
  1477. if (endState == "start" || endState == "no_regex") {
  1478. return "";
  1479. }
  1480. var match = line.match(/^\s*(\/?)\*/);
  1481. if (match) {
  1482. if (match[1]) {
  1483. indent += " ";
  1484. }
  1485. indent += "* ";
  1486. }
  1487. }
  1488. return indent;
  1489. };
  1490. this.checkOutdent = function(state, line, input) {
  1491. return this.$outdent.checkOutdent(line, input);
  1492. };
  1493. this.autoOutdent = function(state, doc, row) {
  1494. this.$outdent.autoOutdent(doc, row);
  1495. };
  1496. this.createWorker = function(session) {
  1497. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  1498. worker.attachToDocument(session.getDocument());
  1499. worker.on("annotate", function(results) {
  1500. session.setAnnotations(results.data);
  1501. });
  1502. worker.on("terminate", function() {
  1503. session.clearAnnotations();
  1504. });
  1505. return worker;
  1506. };
  1507. this.$id = "ace/mode/javascript";
  1508. }).call(Mode.prototype);
  1509. exports.Mode = Mode;
  1510. });
  1511. ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
  1512. "use strict";
  1513. var propertyMap = {
  1514. "background": {"#$0": 1},
  1515. "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
  1516. "background-image": {"url('/$0')": 1},
  1517. "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
  1518. "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
  1519. "background-attachment": {"scroll": 1, "fixed": 1},
  1520. "background-size": {"cover": 1, "contain": 1},
  1521. "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
  1522. "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
  1523. "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
  1524. "border-color": {"#$0": 1},
  1525. "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
  1526. "border-collapse": {"collapse": 1, "separate": 1},
  1527. "bottom": {"px": 1, "em": 1, "%": 1},
  1528. "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
  1529. "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
  1530. "cursor": {"default": 1, "pointer": 1, "move": 1, "text": 1, "wait": 1, "help": 1, "progress": 1, "n-resize": 1, "ne-resize": 1, "e-resize": 1, "se-resize": 1, "s-resize": 1, "sw-resize": 1, "w-resize": 1, "nw-resize": 1},
  1531. "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
  1532. "empty-cells": {"show": 1, "hide": 1},
  1533. "float": {"left": 1, "right": 1, "none": 1},
  1534. "font-family": {"Arial":2,"Comic Sans MS":2,"Consolas":2,"Courier New":2,"Courier":2,"Georgia":2,"Monospace":2,"Sans-Serif":2, "Segoe UI":2,"Tahoma":2,"Times New Roman":2,"Trebuchet MS":2,"Verdana": 1},
  1535. "font-size": {"px": 1, "em": 1, "%": 1},
  1536. "font-weight": {"bold": 1, "normal": 1},
  1537. "font-style": {"italic": 1, "normal": 1},
  1538. "font-variant": {"normal": 1, "small-caps": 1},
  1539. "height": {"px": 1, "em": 1, "%": 1},
  1540. "left": {"px": 1, "em": 1, "%": 1},
  1541. "letter-spacing": {"normal": 1},
  1542. "line-height": {"normal": 1},
  1543. "list-style-type": {"none": 1, "disc": 1, "circle": 1, "square": 1, "decimal": 1, "decimal-leading-zero": 1, "lower-roman": 1, "upper-roman": 1, "lower-greek": 1, "lower-latin": 1, "upper-latin": 1, "georgian": 1, "lower-alpha": 1, "upper-alpha": 1},
  1544. "margin": {"px": 1, "em": 1, "%": 1},
  1545. "margin-right": {"px": 1, "em": 1, "%": 1},
  1546. "margin-left": {"px": 1, "em": 1, "%": 1},
  1547. "margin-top": {"px": 1, "em": 1, "%": 1},
  1548. "margin-bottom": {"px": 1, "em": 1, "%": 1},
  1549. "max-height": {"px": 1, "em": 1, "%": 1},
  1550. "max-width": {"px": 1, "em": 1, "%": 1},
  1551. "min-height": {"px": 1, "em": 1, "%": 1},
  1552. "min-width": {"px": 1, "em": 1, "%": 1},
  1553. "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1554. "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1555. "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  1556. "padding": {"px": 1, "em": 1, "%": 1},
  1557. "padding-top": {"px": 1, "em": 1, "%": 1},
  1558. "padding-right": {"px": 1, "em": 1, "%": 1},
  1559. "padding-bottom": {"px": 1, "em": 1, "%": 1},
  1560. "padding-left": {"px": 1, "em": 1, "%": 1},
  1561. "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  1562. "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  1563. "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
  1564. "right": {"px": 1, "em": 1, "%": 1},
  1565. "table-layout": {"fixed": 1, "auto": 1},
  1566. "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
  1567. "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
  1568. "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
  1569. "top": {"px": 1, "em": 1, "%": 1},
  1570. "vertical-align": {"top": 1, "bottom": 1},
  1571. "visibility": {"hidden": 1, "visible": 1},
  1572. "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
  1573. "width": {"px": 1, "em": 1, "%": 1},
  1574. "word-spacing": {"normal": 1},
  1575. "filter": {"alpha(opacity=$0100)": 1},
  1576. "text-shadow": {"$02px 2px 2px #777": 1},
  1577. "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
  1578. "-moz-border-radius": 1,
  1579. "-moz-border-radius-topright": 1,
  1580. "-moz-border-radius-bottomright": 1,
  1581. "-moz-border-radius-topleft": 1,
  1582. "-moz-border-radius-bottomleft": 1,
  1583. "-webkit-border-radius": 1,
  1584. "-webkit-border-top-right-radius": 1,
  1585. "-webkit-border-top-left-radius": 1,
  1586. "-webkit-border-bottom-right-radius": 1,
  1587. "-webkit-border-bottom-left-radius": 1,
  1588. "-moz-box-shadow": 1,
  1589. "-webkit-box-shadow": 1,
  1590. "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  1591. "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  1592. "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
  1593. };
  1594. var CssCompletions = function() {
  1595. };
  1596. (function() {
  1597. this.completionsDefined = false;
  1598. this.defineCompletions = function() {
  1599. if (document) {
  1600. var style = document.createElement('c').style;
  1601. for (var i in style) {
  1602. if (typeof style[i] !== 'string')
  1603. continue;
  1604. var name = i.replace(/[A-Z]/g, function(x) {
  1605. return '-' + x.toLowerCase();
  1606. });
  1607. if (!propertyMap.hasOwnProperty(name))
  1608. propertyMap[name] = 1;
  1609. }
  1610. }
  1611. this.completionsDefined = true;
  1612. }
  1613. this.getCompletions = function(state, session, pos, prefix) {
  1614. if (!this.completionsDefined) {
  1615. this.defineCompletions();
  1616. }
  1617. var token = session.getTokenAt(pos.row, pos.column);
  1618. if (!token)
  1619. return [];
  1620. if (state==='ruleset'){
  1621. var line = session.getLine(pos.row).substr(0, pos.column);
  1622. if (/:[^;]+$/.test(line)) {
  1623. /([\w\-]+):[^:]*$/.test(line);
  1624. return this.getPropertyValueCompletions(state, session, pos, prefix);
  1625. } else {
  1626. return this.getPropertyCompletions(state, session, pos, prefix);
  1627. }
  1628. }
  1629. return [];
  1630. };
  1631. this.getPropertyCompletions = function(state, session, pos, prefix) {
  1632. var properties = Object.keys(propertyMap);
  1633. return properties.map(function(property){
  1634. return {
  1635. caption: property,
  1636. snippet: property + ': $0',
  1637. meta: "property",
  1638. score: Number.MAX_VALUE
  1639. };
  1640. });
  1641. };
  1642. this.getPropertyValueCompletions = function(state, session, pos, prefix) {
  1643. var line = session.getLine(pos.row).substr(0, pos.column);
  1644. var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
  1645. if (!property)
  1646. return [];
  1647. var values = [];
  1648. if (property in propertyMap && typeof propertyMap[property] === "object") {
  1649. values = Object.keys(propertyMap[property]);
  1650. }
  1651. return values.map(function(value){
  1652. return {
  1653. caption: value,
  1654. snippet: value,
  1655. meta: "property value",
  1656. score: Number.MAX_VALUE
  1657. };
  1658. });
  1659. };
  1660. }).call(CssCompletions.prototype);
  1661. exports.CssCompletions = CssCompletions;
  1662. });
  1663. ace.define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) {
  1664. "use strict";
  1665. var oop = require("../../lib/oop");
  1666. var Behaviour = require("../behaviour").Behaviour;
  1667. var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
  1668. var TokenIterator = require("../../token_iterator").TokenIterator;
  1669. var CssBehaviour = function () {
  1670. this.inherit(CstyleBehaviour);
  1671. this.add("colon", "insertion", function (state, action, editor, session, text) {
  1672. if (text === ':') {
  1673. var cursor = editor.getCursorPosition();
  1674. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1675. var token = iterator.getCurrentToken();
  1676. if (token && token.value.match(/\s+/)) {
  1677. token = iterator.stepBackward();
  1678. }
  1679. if (token && token.type === 'support.type') {
  1680. var line = session.doc.getLine(cursor.row);
  1681. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1682. if (rightChar === ':') {
  1683. return {
  1684. text: '',
  1685. selection: [1, 1]
  1686. }
  1687. }
  1688. if (!line.substring(cursor.column).match(/^\s*;/)) {
  1689. return {
  1690. text: ':;',
  1691. selection: [1, 1]
  1692. }
  1693. }
  1694. }
  1695. }
  1696. });
  1697. this.add("colon", "deletion", function (state, action, editor, session, range) {
  1698. var selected = session.doc.getTextRange(range);
  1699. if (!range.isMultiLine() && selected === ':') {
  1700. var cursor = editor.getCursorPosition();
  1701. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1702. var token = iterator.getCurrentToken();
  1703. if (token && token.value.match(/\s+/)) {
  1704. token = iterator.stepBackward();
  1705. }
  1706. if (token && token.type === 'support.type') {
  1707. var line = session.doc.getLine(range.start.row);
  1708. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1709. if (rightChar === ';') {
  1710. range.end.column ++;
  1711. return range;
  1712. }
  1713. }
  1714. }
  1715. });
  1716. this.add("semicolon", "insertion", function (state, action, editor, session, text) {
  1717. if (text === ';') {
  1718. var cursor = editor.getCursorPosition();
  1719. var line = session.doc.getLine(cursor.row);
  1720. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1721. if (rightChar === ';') {
  1722. return {
  1723. text: '',
  1724. selection: [1, 1]
  1725. }
  1726. }
  1727. }
  1728. });
  1729. }
  1730. oop.inherits(CssBehaviour, CstyleBehaviour);
  1731. exports.CssBehaviour = CssBehaviour;
  1732. });
  1733. ace.define("ace/mode/css",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/css_highlight_rules","ace/mode/matching_brace_outdent","ace/worker/worker_client","ace/mode/css_completions","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) {
  1734. "use strict";
  1735. var oop = require("../lib/oop");
  1736. var TextMode = require("./text").Mode;
  1737. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1738. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1739. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1740. var CssCompletions = require("./css_completions").CssCompletions;
  1741. var CssBehaviour = require("./behaviour/css").CssBehaviour;
  1742. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1743. var Mode = function() {
  1744. this.HighlightRules = CssHighlightRules;
  1745. this.$outdent = new MatchingBraceOutdent();
  1746. this.$behaviour = new CssBehaviour();
  1747. this.$completer = new CssCompletions();
  1748. this.foldingRules = new CStyleFoldMode();
  1749. };
  1750. oop.inherits(Mode, TextMode);
  1751. (function() {
  1752. this.foldingRules = "cStyle";
  1753. this.blockComment = {start: "/*", end: "*/"};
  1754. this.getNextLineIndent = function(state, line, tab) {
  1755. var indent = this.$getIndent(line);
  1756. var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
  1757. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  1758. return indent;
  1759. }
  1760. var match = line.match(/^.*\{\s*$/);
  1761. if (match) {
  1762. indent += tab;
  1763. }
  1764. return indent;
  1765. };
  1766. this.checkOutdent = function(state, line, input) {
  1767. return this.$outdent.checkOutdent(line, input);
  1768. };
  1769. this.autoOutdent = function(state, doc, row) {
  1770. this.$outdent.autoOutdent(doc, row);
  1771. };
  1772. this.getCompletions = function(state, session, pos, prefix) {
  1773. return this.$completer.getCompletions(state, session, pos, prefix);
  1774. };
  1775. this.createWorker = function(session) {
  1776. var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
  1777. worker.attachToDocument(session.getDocument());
  1778. worker.on("annotate", function(e) {
  1779. session.setAnnotations(e.data);
  1780. });
  1781. worker.on("terminate", function() {
  1782. session.clearAnnotations();
  1783. });
  1784. return worker;
  1785. };
  1786. this.$id = "ace/mode/css";
  1787. }).call(Mode.prototype);
  1788. exports.Mode = Mode;
  1789. });
  1790. ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
  1791. "use strict";
  1792. var oop = require("../../lib/oop");
  1793. var Behaviour = require("../behaviour").Behaviour;
  1794. var TokenIterator = require("../../token_iterator").TokenIterator;
  1795. var lang = require("../../lib/lang");
  1796. function is(token, type) {
  1797. return token.type.lastIndexOf(type + ".xml") > -1;
  1798. }
  1799. var XmlBehaviour = function () {
  1800. this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
  1801. if (text == '"' || text == "'") {
  1802. var quote = text;
  1803. var selected = session.doc.getTextRange(editor.getSelectionRange());
  1804. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  1805. return {
  1806. text: quote + selected + quote,
  1807. selection: false
  1808. };
  1809. }
  1810. var cursor = editor.getCursorPosition();
  1811. var line = session.doc.getLine(cursor.row);
  1812. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1813. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1814. var token = iterator.getCurrentToken();
  1815. if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
  1816. return {
  1817. text: "",
  1818. selection: [1, 1]
  1819. };
  1820. }
  1821. if (!token)
  1822. token = iterator.stepBackward();
  1823. if (!token)
  1824. return;
  1825. while (is(token, "tag-whitespace") || is(token, "whitespace")) {
  1826. token = iterator.stepBackward();
  1827. }
  1828. var rightSpace = !rightChar || rightChar.match(/\s/);
  1829. if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
  1830. return {
  1831. text: quote + quote,
  1832. selection: [1, 1]
  1833. };
  1834. }
  1835. }
  1836. });
  1837. this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
  1838. var selected = session.doc.getTextRange(range);
  1839. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  1840. var line = session.doc.getLine(range.start.row);
  1841. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  1842. if (rightChar == selected) {
  1843. range.end.column++;
  1844. return range;
  1845. }
  1846. }
  1847. });
  1848. this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
  1849. if (text == '>') {
  1850. var position = editor.getSelectionRange().start;
  1851. var iterator = new TokenIterator(session, position.row, position.column);
  1852. var token = iterator.getCurrentToken() || iterator.stepBackward();
  1853. if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
  1854. return;
  1855. if (is(token, "reference.attribute-value"))
  1856. return;
  1857. if (is(token, "attribute-value")) {
  1858. var firstChar = token.value.charAt(0);
  1859. if (firstChar == '"' || firstChar == "'") {
  1860. var lastChar = token.value.charAt(token.value.length - 1);
  1861. var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
  1862. if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
  1863. return;
  1864. }
  1865. }
  1866. while (!is(token, "tag-name")) {
  1867. token = iterator.stepBackward();
  1868. if (token.value == "<") {
  1869. token = iterator.stepForward();
  1870. break;
  1871. }
  1872. }
  1873. var tokenRow = iterator.getCurrentTokenRow();
  1874. var tokenColumn = iterator.getCurrentTokenColumn();
  1875. if (is(iterator.stepBackward(), "end-tag-open"))
  1876. return;
  1877. var element = token.value;
  1878. if (tokenRow == position.row)
  1879. element = element.substring(0, position.column - tokenColumn);
  1880. if (this.voidElements.hasOwnProperty(element.toLowerCase()))
  1881. return;
  1882. return {
  1883. text: ">" + "</" + element + ">",
  1884. selection: [1, 1]
  1885. };
  1886. }
  1887. });
  1888. this.add("autoindent", "insertion", function (state, action, editor, session, text) {
  1889. if (text == "\n") {
  1890. var cursor = editor.getCursorPosition();
  1891. var line = session.getLine(cursor.row);
  1892. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1893. var token = iterator.getCurrentToken();
  1894. if (token && token.type.indexOf("tag-close") !== -1) {
  1895. if (token.value == "/>")
  1896. return;
  1897. while (token && token.type.indexOf("tag-name") === -1) {
  1898. token = iterator.stepBackward();
  1899. }
  1900. if (!token) {
  1901. return;
  1902. }
  1903. var tag = token.value;
  1904. var row = iterator.getCurrentTokenRow();
  1905. token = iterator.stepBackward();
  1906. if (!token || token.type.indexOf("end-tag") !== -1) {
  1907. return;
  1908. }
  1909. if (this.voidElements && !this.voidElements[tag]) {
  1910. var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
  1911. var line = session.getLine(row);
  1912. var nextIndent = this.$getIndent(line);
  1913. var indent = nextIndent + session.getTabString();
  1914. if (nextToken && nextToken.value === "</") {
  1915. return {
  1916. text: "\n" + indent + "\n" + nextIndent,
  1917. selection: [1, indent.length, 1, indent.length]
  1918. };
  1919. } else {
  1920. return {
  1921. text: "\n" + indent
  1922. };
  1923. }
  1924. }
  1925. }
  1926. }
  1927. });
  1928. };
  1929. oop.inherits(XmlBehaviour, Behaviour);
  1930. exports.XmlBehaviour = XmlBehaviour;
  1931. });
  1932. ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1933. "use strict";
  1934. var oop = require("../../lib/oop");
  1935. var BaseFoldMode = require("./fold_mode").FoldMode;
  1936. var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
  1937. this.defaultMode = defaultMode;
  1938. this.subModes = subModes;
  1939. };
  1940. oop.inherits(FoldMode, BaseFoldMode);
  1941. (function() {
  1942. this.$getMode = function(state) {
  1943. if (typeof state != "string")
  1944. state = state[0];
  1945. for (var key in this.subModes) {
  1946. if (state.indexOf(key) === 0)
  1947. return this.subModes[key];
  1948. }
  1949. return null;
  1950. };
  1951. this.$tryMode = function(state, session, foldStyle, row) {
  1952. var mode = this.$getMode(state);
  1953. return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
  1954. };
  1955. this.getFoldWidget = function(session, foldStyle, row) {
  1956. return (
  1957. this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
  1958. this.$tryMode(session.getState(row), session, foldStyle, row) ||
  1959. this.defaultMode.getFoldWidget(session, foldStyle, row)
  1960. );
  1961. };
  1962. this.getFoldWidgetRange = function(session, foldStyle, row) {
  1963. var mode = this.$getMode(session.getState(row-1));
  1964. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1965. mode = this.$getMode(session.getState(row));
  1966. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1967. mode = this.defaultMode;
  1968. return mode.getFoldWidgetRange(session, foldStyle, row);
  1969. };
  1970. }).call(FoldMode.prototype);
  1971. });
  1972. ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"], function(require, exports, module) {
  1973. "use strict";
  1974. var oop = require("../../lib/oop");
  1975. var lang = require("../../lib/lang");
  1976. var Range = require("../../range").Range;
  1977. var BaseFoldMode = require("./fold_mode").FoldMode;
  1978. var TokenIterator = require("../../token_iterator").TokenIterator;
  1979. var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
  1980. BaseFoldMode.call(this);
  1981. this.voidElements = voidElements || {};
  1982. this.optionalEndTags = oop.mixin({}, this.voidElements);
  1983. if (optionalEndTags)
  1984. oop.mixin(this.optionalEndTags, optionalEndTags);
  1985. };
  1986. oop.inherits(FoldMode, BaseFoldMode);
  1987. var Tag = function() {
  1988. this.tagName = "";
  1989. this.closing = false;
  1990. this.selfClosing = false;
  1991. this.start = {row: 0, column: 0};
  1992. this.end = {row: 0, column: 0};
  1993. };
  1994. function is(token, type) {
  1995. return token.type.lastIndexOf(type + ".xml") > -1;
  1996. }
  1997. (function() {
  1998. this.getFoldWidget = function(session, foldStyle, row) {
  1999. var tag = this._getFirstTagInLine(session, row);
  2000. if (!tag)
  2001. return "";
  2002. if (tag.closing || (!tag.tagName && tag.selfClosing))
  2003. return foldStyle == "markbeginend" ? "end" : "";
  2004. if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
  2005. return "";
  2006. if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
  2007. return "";
  2008. return "start";
  2009. };
  2010. this._getFirstTagInLine = function(session, row) {
  2011. var tokens = session.getTokens(row);
  2012. var tag = new Tag();
  2013. for (var i = 0; i < tokens.length; i++) {
  2014. var token = tokens[i];
  2015. if (is(token, "tag-open")) {
  2016. tag.end.column = tag.start.column + token.value.length;
  2017. tag.closing = is(token, "end-tag-open");
  2018. token = tokens[++i];
  2019. if (!token)
  2020. return null;
  2021. tag.tagName = token.value;
  2022. tag.end.column += token.value.length;
  2023. for (i++; i < tokens.length; i++) {
  2024. token = tokens[i];
  2025. tag.end.column += token.value.length;
  2026. if (is(token, "tag-close")) {
  2027. tag.selfClosing = token.value == '/>';
  2028. break;
  2029. }
  2030. }
  2031. return tag;
  2032. } else if (is(token, "tag-close")) {
  2033. tag.selfClosing = token.value == '/>';
  2034. return tag;
  2035. }
  2036. tag.start.column += token.value.length;
  2037. }
  2038. return null;
  2039. };
  2040. this._findEndTagInLine = function(session, row, tagName, startColumn) {
  2041. var tokens = session.getTokens(row);
  2042. var column = 0;
  2043. for (var i = 0; i < tokens.length; i++) {
  2044. var token = tokens[i];
  2045. column += token.value.length;
  2046. if (column < startColumn)
  2047. continue;
  2048. if (is(token, "end-tag-open")) {
  2049. token = tokens[i + 1];
  2050. if (token && token.value == tagName)
  2051. return true;
  2052. }
  2053. }
  2054. return false;
  2055. };
  2056. this._readTagForward = function(iterator) {
  2057. var token = iterator.getCurrentToken();
  2058. if (!token)
  2059. return null;
  2060. var tag = new Tag();
  2061. do {
  2062. if (is(token, "tag-open")) {
  2063. tag.closing = is(token, "end-tag-open");
  2064. tag.start.row = iterator.getCurrentTokenRow();
  2065. tag.start.column = iterator.getCurrentTokenColumn();
  2066. } else if (is(token, "tag-name")) {
  2067. tag.tagName = token.value;
  2068. } else if (is(token, "tag-close")) {
  2069. tag.selfClosing = token.value == "/>";
  2070. tag.end.row = iterator.getCurrentTokenRow();
  2071. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  2072. iterator.stepForward();
  2073. return tag;
  2074. }
  2075. } while(token = iterator.stepForward());
  2076. return null;
  2077. };
  2078. this._readTagBackward = function(iterator) {
  2079. var token = iterator.getCurrentToken();
  2080. if (!token)
  2081. return null;
  2082. var tag = new Tag();
  2083. do {
  2084. if (is(token, "tag-open")) {
  2085. tag.closing = is(token, "end-tag-open");
  2086. tag.start.row = iterator.getCurrentTokenRow();
  2087. tag.start.column = iterator.getCurrentTokenColumn();
  2088. iterator.stepBackward();
  2089. return tag;
  2090. } else if (is(token, "tag-name")) {
  2091. tag.tagName = token.value;
  2092. } else if (is(token, "tag-close")) {
  2093. tag.selfClosing = token.value == "/>";
  2094. tag.end.row = iterator.getCurrentTokenRow();
  2095. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  2096. }
  2097. } while(token = iterator.stepBackward());
  2098. return null;
  2099. };
  2100. this._pop = function(stack, tag) {
  2101. while (stack.length) {
  2102. var top = stack[stack.length-1];
  2103. if (!tag || top.tagName == tag.tagName) {
  2104. return stack.pop();
  2105. }
  2106. else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
  2107. stack.pop();
  2108. continue;
  2109. } else {
  2110. return null;
  2111. }
  2112. }
  2113. };
  2114. this.getFoldWidgetRange = function(session, foldStyle, row) {
  2115. var firstTag = this._getFirstTagInLine(session, row);
  2116. if (!firstTag)
  2117. return null;
  2118. var isBackward = firstTag.closing || firstTag.selfClosing;
  2119. var stack = [];
  2120. var tag;
  2121. if (!isBackward) {
  2122. var iterator = new TokenIterator(session, row, firstTag.start.column);
  2123. var start = {
  2124. row: row,
  2125. column: firstTag.start.column + firstTag.tagName.length + 2
  2126. };
  2127. if (firstTag.start.row == firstTag.end.row)
  2128. start.column = firstTag.end.column;
  2129. while (tag = this._readTagForward(iterator)) {
  2130. if (tag.selfClosing) {
  2131. if (!stack.length) {
  2132. tag.start.column += tag.tagName.length + 2;
  2133. tag.end.column -= 2;
  2134. return Range.fromPoints(tag.start, tag.end);
  2135. } else
  2136. continue;
  2137. }
  2138. if (tag.closing) {
  2139. this._pop(stack, tag);
  2140. if (stack.length == 0)
  2141. return Range.fromPoints(start, tag.start);
  2142. }
  2143. else {
  2144. stack.push(tag);
  2145. }
  2146. }
  2147. }
  2148. else {
  2149. var iterator = new TokenIterator(session, row, firstTag.end.column);
  2150. var end = {
  2151. row: row,
  2152. column: firstTag.start.column
  2153. };
  2154. while (tag = this._readTagBackward(iterator)) {
  2155. if (tag.selfClosing) {
  2156. if (!stack.length) {
  2157. tag.start.column += tag.tagName.length + 2;
  2158. tag.end.column -= 2;
  2159. return Range.fromPoints(tag.start, tag.end);
  2160. } else
  2161. continue;
  2162. }
  2163. if (!tag.closing) {
  2164. this._pop(stack, tag);
  2165. if (stack.length == 0) {
  2166. tag.start.column += tag.tagName.length + 2;
  2167. if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
  2168. tag.start.column = tag.end.column;
  2169. return Range.fromPoints(tag.start, end);
  2170. }
  2171. }
  2172. else {
  2173. stack.push(tag);
  2174. }
  2175. }
  2176. }
  2177. };
  2178. }).call(FoldMode.prototype);
  2179. });
  2180. ace.define("ace/mode/folding/html",["require","exports","module","ace/lib/oop","ace/mode/folding/mixed","ace/mode/folding/xml","ace/mode/folding/cstyle"], function(require, exports, module) {
  2181. "use strict";
  2182. var oop = require("../../lib/oop");
  2183. var MixedFoldMode = require("./mixed").FoldMode;
  2184. var XmlFoldMode = require("./xml").FoldMode;
  2185. var CStyleFoldMode = require("./cstyle").FoldMode;
  2186. var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
  2187. MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
  2188. "js-": new CStyleFoldMode(),
  2189. "css-": new CStyleFoldMode()
  2190. });
  2191. };
  2192. oop.inherits(FoldMode, MixedFoldMode);
  2193. });
  2194. ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
  2195. "use strict";
  2196. var TokenIterator = require("../token_iterator").TokenIterator;
  2197. var commonAttributes = [
  2198. "accesskey",
  2199. "class",
  2200. "contenteditable",
  2201. "contextmenu",
  2202. "dir",
  2203. "draggable",
  2204. "dropzone",
  2205. "hidden",
  2206. "id",
  2207. "inert",
  2208. "itemid",
  2209. "itemprop",
  2210. "itemref",
  2211. "itemscope",
  2212. "itemtype",
  2213. "lang",
  2214. "spellcheck",
  2215. "style",
  2216. "tabindex",
  2217. "title",
  2218. "translate"
  2219. ];
  2220. var eventAttributes = [
  2221. "onabort",
  2222. "onblur",
  2223. "oncancel",
  2224. "oncanplay",
  2225. "oncanplaythrough",
  2226. "onchange",
  2227. "onclick",
  2228. "onclose",
  2229. "oncontextmenu",
  2230. "oncuechange",
  2231. "ondblclick",
  2232. "ondrag",
  2233. "ondragend",
  2234. "ondragenter",
  2235. "ondragleave",
  2236. "ondragover",
  2237. "ondragstart",
  2238. "ondrop",
  2239. "ondurationchange",
  2240. "onemptied",
  2241. "onended",
  2242. "onerror",
  2243. "onfocus",
  2244. "oninput",
  2245. "oninvalid",
  2246. "onkeydown",
  2247. "onkeypress",
  2248. "onkeyup",
  2249. "onload",
  2250. "onloadeddata",
  2251. "onloadedmetadata",
  2252. "onloadstart",
  2253. "onmousedown",
  2254. "onmousemove",
  2255. "onmouseout",
  2256. "onmouseover",
  2257. "onmouseup",
  2258. "onmousewheel",
  2259. "onpause",
  2260. "onplay",
  2261. "onplaying",
  2262. "onprogress",
  2263. "onratechange",
  2264. "onreset",
  2265. "onscroll",
  2266. "onseeked",
  2267. "onseeking",
  2268. "onselect",
  2269. "onshow",
  2270. "onstalled",
  2271. "onsubmit",
  2272. "onsuspend",
  2273. "ontimeupdate",
  2274. "onvolumechange",
  2275. "onwaiting"
  2276. ];
  2277. var globalAttributes = commonAttributes.concat(eventAttributes);
  2278. var attributeMap = {
  2279. "html": {"manifest": 1},
  2280. "head": {},
  2281. "title": {},
  2282. "base": {"href": 1, "target": 1},
  2283. "link": {"href": 1, "hreflang": 1, "rel": {"stylesheet": 1, "icon": 1}, "media": {"all": 1, "screen": 1, "print": 1}, "type": {"text/css": 1, "image/png": 1, "image/jpeg": 1, "image/gif": 1}, "sizes": 1},
  2284. "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
  2285. "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
  2286. "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
  2287. "noscript": {"href": 1},
  2288. "body": {"onafterprint": 1, "onbeforeprint": 1, "onbeforeunload": 1, "onhashchange": 1, "onmessage": 1, "onoffline": 1, "onpopstate": 1, "onredo": 1, "onresize": 1, "onstorage": 1, "onundo": 1, "onunload": 1},
  2289. "section": {},
  2290. "nav": {},
  2291. "article": {"pubdate": 1},
  2292. "aside": {},
  2293. "h1": {},
  2294. "h2": {},
  2295. "h3": {},
  2296. "h4": {},
  2297. "h5": {},
  2298. "h6": {},
  2299. "header": {},
  2300. "footer": {},
  2301. "address": {},
  2302. "main": {},
  2303. "p": {},
  2304. "hr": {},
  2305. "pre": {},
  2306. "blockquote": {"cite": 1},
  2307. "ol": {"start": 1, "reversed": 1},
  2308. "ul": {},
  2309. "li": {"value": 1},
  2310. "dl": {},
  2311. "dt": {},
  2312. "dd": {},
  2313. "figure": {},
  2314. "figcaption": {},
  2315. "div": {},
  2316. "a": {"href": 1, "target": {"_blank": 1, "top": 1}, "ping": 1, "rel": {"nofollow": 1, "alternate": 1, "author": 1, "bookmark": 1, "help": 1, "license": 1, "next": 1, "noreferrer": 1, "prefetch": 1, "prev": 1, "search": 1, "tag": 1}, "media": 1, "hreflang": 1, "type": 1},
  2317. "em": {},
  2318. "strong": {},
  2319. "small": {},
  2320. "s": {},
  2321. "cite": {},
  2322. "q": {"cite": 1},
  2323. "dfn": {},
  2324. "abbr": {},
  2325. "data": {},
  2326. "time": {"datetime": 1},
  2327. "code": {},
  2328. "var": {},
  2329. "samp": {},
  2330. "kbd": {},
  2331. "sub": {},
  2332. "sup": {},
  2333. "i": {},
  2334. "b": {},
  2335. "u": {},
  2336. "mark": {},
  2337. "ruby": {},
  2338. "rt": {},
  2339. "rp": {},
  2340. "bdi": {},
  2341. "bdo": {},
  2342. "span": {},
  2343. "br": {},
  2344. "wbr": {},
  2345. "ins": {"cite": 1, "datetime": 1},
  2346. "del": {"cite": 1, "datetime": 1},
  2347. "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
  2348. "iframe": {"name": 1, "src": 1, "height": 1, "width": 1, "sandbox": {"allow-same-origin": 1, "allow-top-navigation": 1, "allow-forms": 1, "allow-scripts": 1}, "seamless": {"seamless": 1}},
  2349. "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
  2350. "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
  2351. "param": {"name": 1, "value": 1},
  2352. "video": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "width": 1, "height": 1, "poster": 1, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1}},
  2353. "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
  2354. "source": {"src": 1, "type": 1, "media": 1},
  2355. "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
  2356. "canvas": {"width": 1, "height": 1},
  2357. "map": {"name": 1},
  2358. "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
  2359. "svg": {},
  2360. "math": {},
  2361. "table": {"summary": 1},
  2362. "caption": {},
  2363. "colgroup": {"span": 1},
  2364. "col": {"span": 1},
  2365. "tbody": {},
  2366. "thead": {},
  2367. "tfoot": {},
  2368. "tr": {},
  2369. "td": {"headers": 1, "rowspan": 1, "colspan": 1},
  2370. "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
  2371. "form": {"accept-charset": 1, "action": 1, "autocomplete": 1, "enctype": {"multipart/form-data": 1, "application/x-www-form-urlencoded": 1}, "method": {"get": 1, "post": 1}, "name": 1, "novalidate": 1, "target": {"_blank": 1, "top": 1}},
  2372. "fieldset": {"disabled": 1, "form": 1, "name": 1},
  2373. "legend": {},
  2374. "label": {"form": 1, "for": 1},
  2375. "input": {
  2376. "type": {"text": 1, "password": 1, "hidden": 1, "checkbox": 1, "submit": 1, "radio": 1, "file": 1, "button": 1, "reset": 1, "image": 31, "color": 1, "date": 1, "datetime": 1, "datetime-local": 1, "email": 1, "month": 1, "number": 1, "range": 1, "search": 1, "tel": 1, "time": 1, "url": 1, "week": 1},
  2377. "accept": 1, "alt": 1, "autocomplete": {"on": 1, "off": 1}, "autofocus": {"autofocus": 1}, "checked": {"checked": 1}, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": {"application/x-www-form-urlencoded": 1, "multipart/form-data": 1, "text/plain": 1}, "formmethod": {"get": 1, "post": 1}, "formnovalidate": {"formnovalidate": 1}, "formtarget": {"_blank": 1, "_self": 1, "_parent": 1, "_top": 1}, "height": 1, "list": 1, "max": 1, "maxlength": 1, "min": 1, "multiple": {"multiple": 1}, "name": 1, "pattern": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "size": 1, "src": 1, "step": 1, "width": 1, "files": 1, "value": 1},
  2378. "button": {"autofocus": 1, "disabled": {"disabled": 1}, "form": 1, "formaction": 1, "formenctype": 1, "formmethod": 1, "formnovalidate": 1, "formtarget": 1, "name": 1, "value": 1, "type": {"button": 1, "submit": 1}},
  2379. "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
  2380. "datalist": {},
  2381. "optgroup": {"disabled": 1, "label": 1},
  2382. "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
  2383. "textarea": {"autofocus": {"autofocus": 1}, "disabled": {"disabled": 1}, "form": 1, "maxlength": 1, "name": 1, "placeholder": 1, "readonly": {"readonly": 1}, "required": {"required": 1}, "rows": 1, "cols": 1, "wrap": {"on": 1, "off": 1, "hard": 1, "soft": 1}},
  2384. "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
  2385. "output": {"for": 1, "form": 1, "name": 1},
  2386. "progress": {"value": 1, "max": 1},
  2387. "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
  2388. "details": {"open": 1},
  2389. "summary": {},
  2390. "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
  2391. "menu": {"type": 1, "label": 1},
  2392. "dialog": {"open": 1}
  2393. };
  2394. var elements = Object.keys(attributeMap);
  2395. function is(token, type) {
  2396. return token.type.lastIndexOf(type + ".xml") > -1;
  2397. }
  2398. function findTagName(session, pos) {
  2399. var iterator = new TokenIterator(session, pos.row, pos.column);
  2400. var token = iterator.getCurrentToken();
  2401. while (token && !is(token, "tag-name")){
  2402. token = iterator.stepBackward();
  2403. }
  2404. if (token)
  2405. return token.value;
  2406. }
  2407. function findAttributeName(session, pos) {
  2408. var iterator = new TokenIterator(session, pos.row, pos.column);
  2409. var token = iterator.getCurrentToken();
  2410. while (token && !is(token, "attribute-name")){
  2411. token = iterator.stepBackward();
  2412. }
  2413. if (token)
  2414. return token.value;
  2415. }
  2416. var HtmlCompletions = function() {
  2417. };
  2418. (function() {
  2419. this.getCompletions = function(state, session, pos, prefix) {
  2420. var token = session.getTokenAt(pos.row, pos.column);
  2421. if (!token)
  2422. return [];
  2423. if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
  2424. return this.getTagCompletions(state, session, pos, prefix);
  2425. if (is(token, "tag-whitespace") || is(token, "attribute-name"))
  2426. return this.getAttributeCompletions(state, session, pos, prefix);
  2427. if (is(token, "attribute-value"))
  2428. return this.getAttributeValueCompletions(state, session, pos, prefix);
  2429. var line = session.getLine(pos.row).substr(0, pos.column);
  2430. if (/&[a-z]*$/i.test(line))
  2431. return this.getHTMLEntityCompletions(state, session, pos, prefix);
  2432. return [];
  2433. };
  2434. this.getTagCompletions = function(state, session, pos, prefix) {
  2435. return elements.map(function(element){
  2436. return {
  2437. value: element,
  2438. meta: "tag",
  2439. score: Number.MAX_VALUE
  2440. };
  2441. });
  2442. };
  2443. this.getAttributeCompletions = function(state, session, pos, prefix) {
  2444. var tagName = findTagName(session, pos);
  2445. if (!tagName)
  2446. return [];
  2447. var attributes = globalAttributes;
  2448. if (tagName in attributeMap) {
  2449. attributes = attributes.concat(Object.keys(attributeMap[tagName]));
  2450. }
  2451. return attributes.map(function(attribute){
  2452. return {
  2453. caption: attribute,
  2454. snippet: attribute + '="$0"',
  2455. meta: "attribute",
  2456. score: Number.MAX_VALUE
  2457. };
  2458. });
  2459. };
  2460. this.getAttributeValueCompletions = function(state, session, pos, prefix) {
  2461. var tagName = findTagName(session, pos);
  2462. var attributeName = findAttributeName(session, pos);
  2463. if (!tagName)
  2464. return [];
  2465. var values = [];
  2466. if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
  2467. values = Object.keys(attributeMap[tagName][attributeName]);
  2468. }
  2469. return values.map(function(value){
  2470. return {
  2471. caption: value,
  2472. snippet: value,
  2473. meta: "attribute value",
  2474. score: Number.MAX_VALUE
  2475. };
  2476. });
  2477. };
  2478. this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
  2479. var values = ['Aacute;', 'aacute;', 'Acirc;', 'acirc;', 'acute;', 'AElig;', 'aelig;', 'Agrave;', 'agrave;', 'alefsym;', 'Alpha;', 'alpha;', 'amp;', 'and;', 'ang;', 'Aring;', 'aring;', 'asymp;', 'Atilde;', 'atilde;', 'Auml;', 'auml;', 'bdquo;', 'Beta;', 'beta;', 'brvbar;', 'bull;', 'cap;', 'Ccedil;', 'ccedil;', 'cedil;', 'cent;', 'Chi;', 'chi;', 'circ;', 'clubs;', 'cong;', 'copy;', 'crarr;', 'cup;', 'curren;', 'Dagger;', 'dagger;', 'dArr;', 'darr;', 'deg;', 'Delta;', 'delta;', 'diams;', 'divide;', 'Eacute;', 'eacute;', 'Ecirc;', 'ecirc;', 'Egrave;', 'egrave;', 'empty;', 'emsp;', 'ensp;', 'Epsilon;', 'epsilon;', 'equiv;', 'Eta;', 'eta;', 'ETH;', 'eth;', 'Euml;', 'euml;', 'euro;', 'exist;', 'fnof;', 'forall;', 'frac12;', 'frac14;', 'frac34;', 'frasl;', 'Gamma;', 'gamma;', 'ge;', 'gt;', 'hArr;', 'harr;', 'hearts;', 'hellip;', 'Iacute;', 'iacute;', 'Icirc;', 'icirc;', 'iexcl;', 'Igrave;', 'igrave;', 'image;', 'infin;', 'int;', 'Iota;', 'iota;', 'iquest;', 'isin;', 'Iuml;', 'iuml;', 'Kappa;', 'kappa;', 'Lambda;', 'lambda;', 'lang;', 'laquo;', 'lArr;', 'larr;', 'lceil;', 'ldquo;', 'le;', 'lfloor;', 'lowast;', 'loz;', 'lrm;', 'lsaquo;', 'lsquo;', 'lt;', 'macr;', 'mdash;', 'micro;', 'middot;', 'minus;', 'Mu;', 'mu;', 'nabla;', 'nbsp;', 'ndash;', 'ne;', 'ni;', 'not;', 'notin;', 'nsub;', 'Ntilde;', 'ntilde;', 'Nu;', 'nu;', 'Oacute;', 'oacute;', 'Ocirc;', 'ocirc;', 'OElig;', 'oelig;', 'Ograve;', 'ograve;', 'oline;', 'Omega;', 'omega;', 'Omicron;', 'omicron;', 'oplus;', 'or;', 'ordf;', 'ordm;', 'Oslash;', 'oslash;', 'Otilde;', 'otilde;', 'otimes;', 'Ouml;', 'ouml;', 'para;', 'part;', 'permil;', 'perp;', 'Phi;', 'phi;', 'Pi;', 'pi;', 'piv;', 'plusmn;', 'pound;', 'Prime;', 'prime;', 'prod;', 'prop;', 'Psi;', 'psi;', 'quot;', 'radic;', 'rang;', 'raquo;', 'rArr;', 'rarr;', 'rceil;', 'rdquo;', 'real;', 'reg;', 'rfloor;', 'Rho;', 'rho;', 'rlm;', 'rsaquo;', 'rsquo;', 'sbquo;', 'Scaron;', 'scaron;', 'sdot;', 'sect;', 'shy;', 'Sigma;', 'sigma;', 'sigmaf;', 'sim;', 'spades;', 'sub;', 'sube;', 'sum;', 'sup;', 'sup1;', 'sup2;', 'sup3;', 'supe;', 'szlig;', 'Tau;', 'tau;', 'there4;', 'Theta;', 'theta;', 'thetasym;', 'thinsp;', 'THORN;', 'thorn;', 'tilde;', 'times;', 'trade;', 'Uacute;', 'uacute;', 'uArr;', 'uarr;', 'Ucirc;', 'ucirc;', 'Ugrave;', 'ugrave;', 'uml;', 'upsih;', 'Upsilon;', 'upsilon;', 'Uuml;', 'uuml;', 'weierp;', 'Xi;', 'xi;', 'Yacute;', 'yacute;', 'yen;', 'Yuml;', 'yuml;', 'Zeta;', 'zeta;', 'zwj;', 'zwnj;'];
  2480. return values.map(function(value){
  2481. return {
  2482. caption: value,
  2483. snippet: value,
  2484. meta: "html entity",
  2485. score: Number.MAX_VALUE
  2486. };
  2487. });
  2488. };
  2489. }).call(HtmlCompletions.prototype);
  2490. exports.HtmlCompletions = HtmlCompletions;
  2491. });
  2492. ace.define("ace/mode/html",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/javascript","ace/mode/css","ace/mode/html_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/html","ace/mode/html_completions","ace/worker/worker_client"], function(require, exports, module) {
  2493. "use strict";
  2494. var oop = require("../lib/oop");
  2495. var lang = require("../lib/lang");
  2496. var TextMode = require("./text").Mode;
  2497. var JavaScriptMode = require("./javascript").Mode;
  2498. var CssMode = require("./css").Mode;
  2499. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2500. var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
  2501. var HtmlFoldMode = require("./folding/html").FoldMode;
  2502. var HtmlCompletions = require("./html_completions").HtmlCompletions;
  2503. var WorkerClient = require("../worker/worker_client").WorkerClient;
  2504. var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
  2505. var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
  2506. var Mode = function(options) {
  2507. this.fragmentContext = options && options.fragmentContext;
  2508. this.HighlightRules = HtmlHighlightRules;
  2509. this.$behaviour = new XmlBehaviour();
  2510. this.$completer = new HtmlCompletions();
  2511. this.createModeDelegates({
  2512. "js-": JavaScriptMode,
  2513. "css-": CssMode
  2514. });
  2515. this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
  2516. };
  2517. oop.inherits(Mode, TextMode);
  2518. (function() {
  2519. this.blockComment = {start: "<!--", end: "-->"};
  2520. this.voidElements = lang.arrayToMap(voidElements);
  2521. this.getNextLineIndent = function(state, line, tab) {
  2522. return this.$getIndent(line);
  2523. };
  2524. this.checkOutdent = function(state, line, input) {
  2525. return false;
  2526. };
  2527. this.getCompletions = function(state, session, pos, prefix) {
  2528. return this.$completer.getCompletions(state, session, pos, prefix);
  2529. };
  2530. this.createWorker = function(session) {
  2531. if (this.constructor != Mode)
  2532. return;
  2533. var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
  2534. worker.attachToDocument(session.getDocument());
  2535. if (this.fragmentContext)
  2536. worker.call("setOptions", [{context: this.fragmentContext}]);
  2537. worker.on("error", function(e) {
  2538. session.setAnnotations(e.data);
  2539. });
  2540. worker.on("terminate", function() {
  2541. session.clearAnnotations();
  2542. });
  2543. return worker;
  2544. };
  2545. this.$id = "ace/mode/html";
  2546. }).call(Mode.prototype);
  2547. exports.Mode = Mode;
  2548. });
  2549. ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module) {
  2550. "use strict";
  2551. var oop = require("../../lib/oop");
  2552. var BaseFoldMode = require("./fold_mode").FoldMode;
  2553. var Range = require("../../range").Range;
  2554. var FoldMode = exports.FoldMode = function() {};
  2555. oop.inherits(FoldMode, BaseFoldMode);
  2556. (function() {
  2557. this.getFoldWidgetRange = function(session, foldStyle, row) {
  2558. var range = this.indentationBlock(session, row);
  2559. if (range)
  2560. return range;
  2561. var re = /\S/;
  2562. var line = session.getLine(row);
  2563. var startLevel = line.search(re);
  2564. if (startLevel == -1 || line[startLevel] != "#")
  2565. return;
  2566. var startColumn = line.length;
  2567. var maxRow = session.getLength();
  2568. var startRow = row;
  2569. var endRow = row;
  2570. while (++row < maxRow) {
  2571. line = session.getLine(row);
  2572. var level = line.search(re);
  2573. if (level == -1)
  2574. continue;
  2575. if (line[level] != "#")
  2576. break;
  2577. endRow = row;
  2578. }
  2579. if (endRow > startRow) {
  2580. var endColumn = session.getLine(endRow).length;
  2581. return new Range(startRow, startColumn, endRow, endColumn);
  2582. }
  2583. };
  2584. this.getFoldWidget = function(session, foldStyle, row) {
  2585. var line = session.getLine(row);
  2586. var indent = line.search(/\S/);
  2587. var next = session.getLine(row + 1);
  2588. var prev = session.getLine(row - 1);
  2589. var prevIndent = prev.search(/\S/);
  2590. var nextIndent = next.search(/\S/);
  2591. if (indent == -1) {
  2592. session.foldWidgets[row - 1] = prevIndent!= -1 && prevIndent < nextIndent ? "start" : "";
  2593. return "";
  2594. }
  2595. if (prevIndent == -1) {
  2596. if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") {
  2597. session.foldWidgets[row - 1] = "";
  2598. session.foldWidgets[row + 1] = "";
  2599. return "start";
  2600. }
  2601. } else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") {
  2602. if (session.getLine(row - 2).search(/\S/) == -1) {
  2603. session.foldWidgets[row - 1] = "start";
  2604. session.foldWidgets[row + 1] = "";
  2605. return "";
  2606. }
  2607. }
  2608. if (prevIndent!= -1 && prevIndent < indent)
  2609. session.foldWidgets[row - 1] = "start";
  2610. else
  2611. session.foldWidgets[row - 1] = "";
  2612. if (indent < nextIndent)
  2613. return "start";
  2614. else
  2615. return "";
  2616. };
  2617. }).call(FoldMode.prototype);
  2618. });
  2619. ace.define("ace/mode/elixir",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/elixir_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module) {
  2620. "use strict";
  2621. var oop = require("../lib/oop");
  2622. var TextMode = require("./text").Mode;
  2623. var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
  2624. var FoldMode = require("./folding/coffee").FoldMode;
  2625. var Mode = function() {
  2626. this.HighlightRules = ElixirHighlightRules;
  2627. this.foldingRules = new FoldMode();
  2628. this.$behaviour = this.$defaultBehaviour;
  2629. };
  2630. oop.inherits(Mode, TextMode);
  2631. (function() {
  2632. this.lineCommentStart = "#";
  2633. this.$id = "ace/mode/elixir"
  2634. }).call(Mode.prototype);
  2635. exports.Mode = Mode;
  2636. });
  2637. ace.define("ace/mode/html_elixir",["require","exports","module","ace/lib/oop","ace/mode/html_elixir_highlight_rules","ace/mode/html","ace/mode/javascript","ace/mode/css","ace/mode/elixir"], function(require, exports, module) {
  2638. "use strict";
  2639. var oop = require("../lib/oop");
  2640. var HtmlElixirHighlightRules = require("./html_elixir_highlight_rules").HtmlElixirHighlightRules;
  2641. var HtmlMode = require("./html").Mode;
  2642. var JavaScriptMode = require("./javascript").Mode;
  2643. var CssMode = require("./css").Mode;
  2644. var ElixirMode = require("./elixir").Mode;
  2645. var Mode = function() {
  2646. HtmlMode.call(this);
  2647. this.HighlightRules = HtmlElixirHighlightRules;
  2648. this.createModeDelegates({
  2649. "js-": JavaScriptMode,
  2650. "css-": CssMode,
  2651. "elixir-": ElixirMode
  2652. });
  2653. };
  2654. oop.inherits(Mode, HtmlMode);
  2655. (function() {
  2656. this.$id = "ace/mode/html_elixir";
  2657. }).call(Mode.prototype);
  2658. exports.Mode = Mode;
  2659. });