mode-smarty.js 100 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552
  1. ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  5. var DocCommentHighlightRules = function() {
  6. this.$rules = {
  7. "start" : [ {
  8. token : "comment.doc.tag",
  9. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  10. },
  11. DocCommentHighlightRules.getTagRule(),
  12. {
  13. defaultToken : "comment.doc",
  14. caseInsensitive: true
  15. }]
  16. };
  17. };
  18. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  19. DocCommentHighlightRules.getTagRule = function(start) {
  20. return {
  21. token : "comment.doc.tag.storage.type",
  22. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  23. };
  24. }
  25. DocCommentHighlightRules.getStartRule = function(start) {
  26. return {
  27. token : "comment.doc", // doc comment
  28. regex : "\\/\\*(?=\\*)",
  29. next : start
  30. };
  31. };
  32. DocCommentHighlightRules.getEndRule = function (start) {
  33. return {
  34. token : "comment.doc", // closing comment
  35. regex : "\\*\\/",
  36. next : start
  37. };
  38. };
  39. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  40. });
  41. 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) {
  42. "use strict";
  43. var oop = require("../lib/oop");
  44. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  45. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  46. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  47. var JavaScriptHighlightRules = function(options) {
  48. var keywordMapper = this.createKeywordMapper({
  49. "variable.language":
  50. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  51. "Namespace|QName|XML|XMLList|" + // E4X
  52. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  53. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  54. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  55. "SyntaxError|TypeError|URIError|" +
  56. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  57. "isNaN|parseFloat|parseInt|" +
  58. "JSON|Math|" + // Other
  59. "this|arguments|prototype|window|document" , // Pseudo
  60. "keyword":
  61. "const|yield|import|get|set|async|await|" +
  62. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  63. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  64. "__parent__|__count__|escape|unescape|with|__proto__|" +
  65. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  66. "storage.type":
  67. "const|let|var|function",
  68. "constant.language":
  69. "null|Infinity|NaN|undefined",
  70. "support.function":
  71. "alert",
  72. "constant.language.boolean": "true|false"
  73. }, "identifier");
  74. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  75. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  76. "u[0-9a-fA-F]{4}|" + // unicode
  77. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  78. "[0-2][0-7]{0,2}|" + // oct
  79. "3[0-7][0-7]?|" + // oct
  80. "[4-7][0-7]?|" + //oct
  81. ".)";
  82. this.$rules = {
  83. "no_regex" : [
  84. DocCommentHighlightRules.getStartRule("doc-start"),
  85. comments("no_regex"),
  86. {
  87. token : "string",
  88. regex : "'(?=.)",
  89. next : "qstring"
  90. }, {
  91. token : "string",
  92. regex : '"(?=.)',
  93. next : "qqstring"
  94. }, {
  95. token : "constant.numeric", // hex
  96. regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
  97. }, {
  98. token : "constant.numeric", // float
  99. regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
  100. }, {
  101. token : [
  102. "storage.type", "punctuation.operator", "support.function",
  103. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  104. ],
  105. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  106. next: "function_arguments"
  107. }, {
  108. token : [
  109. "storage.type", "punctuation.operator", "entity.name.function", "text",
  110. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  111. ],
  112. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  113. next: "function_arguments"
  114. }, {
  115. token : [
  116. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  117. "text", "paren.lparen"
  118. ],
  119. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  120. next: "function_arguments"
  121. }, {
  122. token : [
  123. "storage.type", "punctuation.operator", "entity.name.function", "text",
  124. "keyword.operator", "text",
  125. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  126. ],
  127. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  128. next: "function_arguments"
  129. }, {
  130. token : [
  131. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  132. ],
  133. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  134. next: "function_arguments"
  135. }, {
  136. token : [
  137. "entity.name.function", "text", "punctuation.operator",
  138. "text", "storage.type", "text", "paren.lparen"
  139. ],
  140. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  141. next: "function_arguments"
  142. }, {
  143. token : [
  144. "text", "text", "storage.type", "text", "paren.lparen"
  145. ],
  146. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  147. next: "function_arguments"
  148. }, {
  149. token : "keyword",
  150. regex : "(?:" + kwBeforeRe + ")\\b",
  151. next : "start"
  152. }, {
  153. token : ["support.constant"],
  154. regex : /that\b/
  155. }, {
  156. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  157. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  158. }, {
  159. token : keywordMapper,
  160. regex : identifierRe
  161. }, {
  162. token : "punctuation.operator",
  163. regex : /[.](?![.])/,
  164. next : "property"
  165. }, {
  166. token : "keyword.operator",
  167. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  168. next : "start"
  169. }, {
  170. token : "punctuation.operator",
  171. regex : /[?:,;.]/,
  172. next : "start"
  173. }, {
  174. token : "paren.lparen",
  175. regex : /[\[({]/,
  176. next : "start"
  177. }, {
  178. token : "paren.rparen",
  179. regex : /[\])}]/
  180. }, {
  181. token: "comment",
  182. regex: /^#!.*$/
  183. }
  184. ],
  185. property: [{
  186. token : "text",
  187. regex : "\\s+"
  188. }, {
  189. token : [
  190. "storage.type", "punctuation.operator", "entity.name.function", "text",
  191. "keyword.operator", "text",
  192. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  193. ],
  194. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  195. next: "function_arguments"
  196. }, {
  197. token : "punctuation.operator",
  198. regex : /[.](?![.])/
  199. }, {
  200. token : "support.function",
  201. regex : /(s(?:h(?:ift|ow(?:Mod(?:elessDialog|alDialog)|Help))|croll(?:X|By(?:Pages|Lines)?|Y|To)?|t(?:op|rike)|i(?:n|zeToContent|debar|gnText)|ort|u(?:p|b(?:str(?:ing)?)?)|pli(?:ce|t)|e(?:nd|t(?:Re(?:sizable|questHeader)|M(?:i(?:nutes|lliseconds)|onth)|Seconds|Ho(?:tKeys|urs)|Year|Cursor|Time(?:out)?|Interval|ZOptions|Date|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Date|FullYear)|FullYear|Active)|arch)|qrt|lice|avePreferences|mall)|h(?:ome|andleEvent)|navigate|c(?:har(?:CodeAt|At)|o(?:s|n(?:cat|textual|firm)|mpile)|eil|lear(?:Timeout|Interval)?|a(?:ptureEvents|ll)|reate(?:StyleSheet|Popup|EventObject))|t(?:o(?:GMTString|S(?:tring|ource)|U(?:TCString|pperCase)|Lo(?:caleString|werCase))|est|a(?:n|int(?:Enabled)?))|i(?:s(?:NaN|Finite)|ndexOf|talics)|d(?:isableExternalCapture|ump|etachEvent)|u(?:n(?:shift|taint|escape|watch)|pdateCommands)|j(?:oin|avaEnabled)|p(?:o(?:p|w)|ush|lugins.refresh|a(?:ddings|rse(?:Int|Float)?)|r(?:int|ompt|eference))|e(?:scape|nableExternalCapture|val|lementFromPoint|x(?:p|ec(?:Script|Command)?))|valueOf|UTC|queryCommand(?:State|Indeterm|Enabled|Value)|f(?:i(?:nd|le(?:ModifiedDate|Size|CreatedDate|UpdatedDate)|xed)|o(?:nt(?:size|color)|rward)|loor|romCharCode)|watch|l(?:ink|o(?:ad|g)|astIndexOf)|a(?:sin|nchor|cos|t(?:tachEvent|ob|an(?:2)?)|pply|lert|b(?:s|ort))|r(?:ou(?:nd|teEvents)|e(?:size(?:By|To)|calc|turnValue|place|verse|l(?:oad|ease(?:Capture|Events)))|andom)|g(?:o|et(?:ResponseHeader|M(?:i(?:nutes|lliseconds)|onth)|Se(?:conds|lection)|Hours|Year|Time(?:zoneOffset)?|Da(?:y|te)|UTC(?:M(?:i(?:nutes|lliseconds)|onth)|Seconds|Hours|Da(?:y|te)|FullYear)|FullYear|A(?:ttention|llResponseHeaders)))|m(?:in|ove(?:B(?:y|elow)|To(?:Absolute)?|Above)|ergeAttributes|a(?:tch|rgins|x))|b(?:toa|ig|o(?:ld|rderWidths)|link|ack))\b(?=\()/
  202. }, {
  203. token : "support.function.dom",
  204. regex : /(s(?:ub(?:stringData|mit)|plitText|e(?:t(?:NamedItem|Attribute(?:Node)?)|lect))|has(?:ChildNodes|Feature)|namedItem|c(?:l(?:ick|o(?:se|neNode))|reate(?:C(?:omment|DATASection|aption)|T(?:Head|extNode|Foot)|DocumentFragment|ProcessingInstruction|E(?:ntityReference|lement)|Attribute))|tabIndex|i(?:nsert(?:Row|Before|Cell|Data)|tem)|open|delete(?:Row|C(?:ell|aption)|T(?:Head|Foot)|Data)|focus|write(?:ln)?|a(?:dd|ppend(?:Child|Data))|re(?:set|place(?:Child|Data)|move(?:NamedItem|Child|Attribute(?:Node)?)?)|get(?:NamedItem|Element(?:sBy(?:Name|TagName|ClassName)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  205. }, {
  206. token : "support.constant",
  207. regex : /(s(?:ystemLanguage|cr(?:ipts|ollbars|een(?:X|Y|Top|Left))|t(?:yle(?:Sheets)?|atus(?:Text|bar)?)|ibling(?:Below|Above)|ource|uffixes|e(?:curity(?:Policy)?|l(?:ection|f)))|h(?:istory|ost(?:name)?|as(?:h|Focus))|y|X(?:MLDocument|SLDocument)|n(?:ext|ame(?:space(?:s|URI)|Prop))|M(?:IN_VALUE|AX_VALUE)|c(?:haracterSet|o(?:n(?:structor|trollers)|okieEnabled|lorDepth|mp(?:onents|lete))|urrent|puClass|l(?:i(?:p(?:boardData)?|entInformation)|osed|asses)|alle(?:e|r)|rypto)|t(?:o(?:olbar|p)|ext(?:Transform|Indent|Decoration|Align)|ags)|SQRT(?:1_2|2)|i(?:n(?:ner(?:Height|Width)|put)|ds|gnoreCase)|zIndex|o(?:scpu|n(?:readystatechange|Line)|uter(?:Height|Width)|p(?:sProfile|ener)|ffscreenBuffering)|NEGATIVE_INFINITY|d(?:i(?:splay|alog(?:Height|Top|Width|Left|Arguments)|rectories)|e(?:scription|fault(?:Status|Ch(?:ecked|arset)|View)))|u(?:ser(?:Profile|Language|Agent)|n(?:iqueID|defined)|pdateInterval)|_content|p(?:ixelDepth|ort|ersonalbar|kcs11|l(?:ugins|atform)|a(?:thname|dding(?:Right|Bottom|Top|Left)|rent(?:Window|Layer)?|ge(?:X(?:Offset)?|Y(?:Offset)?))|r(?:o(?:to(?:col|type)|duct(?:Sub)?|mpter)|e(?:vious|fix)))|e(?:n(?:coding|abledPlugin)|x(?:ternal|pando)|mbeds)|v(?:isibility|endor(?:Sub)?|Linkcolor)|URLUnencoded|P(?:I|OSITIVE_INFINITY)|f(?:ilename|o(?:nt(?:Size|Family|Weight)|rmName)|rame(?:s|Element)|gColor)|E|whiteSpace|l(?:i(?:stStyleType|n(?:eHeight|kColor))|o(?:ca(?:tion(?:bar)?|lName)|wsrc)|e(?:ngth|ft(?:Context)?)|a(?:st(?:M(?:odified|atch)|Index|Paren)|yer(?:s|X)|nguage))|a(?:pp(?:MinorVersion|Name|Co(?:deName|re)|Version)|vail(?:Height|Top|Width|Left)|ll|r(?:ity|guments)|Linkcolor|bove)|r(?:ight(?:Context)?|e(?:sponse(?:XML|Text)|adyState))|global|x|m(?:imeTypes|ultiline|enubar|argin(?:Right|Bottom|Top|Left))|L(?:N(?:10|2)|OG(?:10E|2E))|b(?:o(?:ttom|rder(?:Width|RightWidth|BottomWidth|Style|Color|TopWidth|LeftWidth))|ufferDepth|elow|ackground(?:Color|Image)))\b/
  208. }, {
  209. token : "identifier",
  210. regex : identifierRe
  211. }, {
  212. regex: "",
  213. token: "empty",
  214. next: "no_regex"
  215. }
  216. ],
  217. "start": [
  218. DocCommentHighlightRules.getStartRule("doc-start"),
  219. comments("start"),
  220. {
  221. token: "string.regexp",
  222. regex: "\\/",
  223. next: "regex"
  224. }, {
  225. token : "text",
  226. regex : "\\s+|^$",
  227. next : "start"
  228. }, {
  229. token: "empty",
  230. regex: "",
  231. next: "no_regex"
  232. }
  233. ],
  234. "regex": [
  235. {
  236. token: "regexp.keyword.operator",
  237. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  238. }, {
  239. token: "string.regexp",
  240. regex: "/[sxngimy]*",
  241. next: "no_regex"
  242. }, {
  243. token : "invalid",
  244. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  245. }, {
  246. token : "constant.language.escape",
  247. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  248. }, {
  249. token : "constant.language.delimiter",
  250. regex: /\|/
  251. }, {
  252. token: "constant.language.escape",
  253. regex: /\[\^?/,
  254. next: "regex_character_class"
  255. }, {
  256. token: "empty",
  257. regex: "$",
  258. next: "no_regex"
  259. }, {
  260. defaultToken: "string.regexp"
  261. }
  262. ],
  263. "regex_character_class": [
  264. {
  265. token: "regexp.charclass.keyword.operator",
  266. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  267. }, {
  268. token: "constant.language.escape",
  269. regex: "]",
  270. next: "regex"
  271. }, {
  272. token: "constant.language.escape",
  273. regex: "-"
  274. }, {
  275. token: "empty",
  276. regex: "$",
  277. next: "no_regex"
  278. }, {
  279. defaultToken: "string.regexp.charachterclass"
  280. }
  281. ],
  282. "function_arguments": [
  283. {
  284. token: "variable.parameter",
  285. regex: identifierRe
  286. }, {
  287. token: "punctuation.operator",
  288. regex: "[, ]+"
  289. }, {
  290. token: "punctuation.operator",
  291. regex: "$"
  292. }, {
  293. token: "empty",
  294. regex: "",
  295. next: "no_regex"
  296. }
  297. ],
  298. "qqstring" : [
  299. {
  300. token : "constant.language.escape",
  301. regex : escapedRe
  302. }, {
  303. token : "string",
  304. regex : "\\\\$",
  305. next : "qqstring"
  306. }, {
  307. token : "string",
  308. regex : '"|$',
  309. next : "no_regex"
  310. }, {
  311. defaultToken: "string"
  312. }
  313. ],
  314. "qstring" : [
  315. {
  316. token : "constant.language.escape",
  317. regex : escapedRe
  318. }, {
  319. token : "string",
  320. regex : "\\\\$",
  321. next : "qstring"
  322. }, {
  323. token : "string",
  324. regex : "'|$",
  325. next : "no_regex"
  326. }, {
  327. defaultToken: "string"
  328. }
  329. ]
  330. };
  331. if (!options || !options.noES6) {
  332. this.$rules.no_regex.unshift({
  333. regex: "[{}]", onMatch: function(val, state, stack) {
  334. this.next = val == "{" ? this.nextState : "";
  335. if (val == "{" && stack.length) {
  336. stack.unshift("start", state);
  337. }
  338. else if (val == "}" && stack.length) {
  339. stack.shift();
  340. this.next = stack.shift();
  341. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  342. return "paren.quasi.end";
  343. }
  344. return val == "{" ? "paren.lparen" : "paren.rparen";
  345. },
  346. nextState: "start"
  347. }, {
  348. token : "string.quasi.start",
  349. regex : /`/,
  350. push : [{
  351. token : "constant.language.escape",
  352. regex : escapedRe
  353. }, {
  354. token : "paren.quasi.start",
  355. regex : /\${/,
  356. push : "start"
  357. }, {
  358. token : "string.quasi.end",
  359. regex : /`/,
  360. next : "pop"
  361. }, {
  362. defaultToken: "string.quasi"
  363. }]
  364. });
  365. if (!options || options.jsx != false)
  366. JSX.call(this);
  367. }
  368. this.embedRules(DocCommentHighlightRules, "doc-",
  369. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  370. this.normalizeRules();
  371. };
  372. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  373. function JSX() {
  374. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  375. var jsxTag = {
  376. onMatch : function(val, state, stack) {
  377. var offset = val.charAt(1) == "/" ? 2 : 1;
  378. if (offset == 1) {
  379. if (state != this.nextState)
  380. stack.unshift(this.next, this.nextState, 0);
  381. else
  382. stack.unshift(this.next);
  383. stack[2]++;
  384. } else if (offset == 2) {
  385. if (state == this.nextState) {
  386. stack[1]--;
  387. if (!stack[1] || stack[1] < 0) {
  388. stack.shift();
  389. stack.shift();
  390. }
  391. }
  392. }
  393. return [{
  394. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  395. value: val.slice(0, offset)
  396. }, {
  397. type: "meta.tag.tag-name.xml",
  398. value: val.substr(offset)
  399. }];
  400. },
  401. regex : "</?" + tagRegex + "",
  402. next: "jsxAttributes",
  403. nextState: "jsx"
  404. };
  405. this.$rules.start.unshift(jsxTag);
  406. var jsxJsRule = {
  407. regex: "{",
  408. token: "paren.quasi.start",
  409. push: "start"
  410. };
  411. this.$rules.jsx = [
  412. jsxJsRule,
  413. jsxTag,
  414. {include : "reference"},
  415. {defaultToken: "string"}
  416. ];
  417. this.$rules.jsxAttributes = [{
  418. token : "meta.tag.punctuation.tag-close.xml",
  419. regex : "/?>",
  420. onMatch : function(value, currentState, stack) {
  421. if (currentState == stack[0])
  422. stack.shift();
  423. if (value.length == 2) {
  424. if (stack[0] == this.nextState)
  425. stack[1]--;
  426. if (!stack[1] || stack[1] < 0) {
  427. stack.splice(0, 2);
  428. }
  429. }
  430. this.next = stack[0] || "start";
  431. return [{type: this.token, value: value}];
  432. },
  433. nextState: "jsx"
  434. },
  435. jsxJsRule,
  436. comments("jsxAttributes"),
  437. {
  438. token : "entity.other.attribute-name.xml",
  439. regex : tagRegex
  440. }, {
  441. token : "keyword.operator.attribute-equals.xml",
  442. regex : "="
  443. }, {
  444. token : "text.tag-whitespace.xml",
  445. regex : "\\s+"
  446. }, {
  447. token : "string.attribute-value.xml",
  448. regex : "'",
  449. stateName : "jsx_attr_q",
  450. push : [
  451. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  452. {include : "reference"},
  453. {defaultToken : "string.attribute-value.xml"}
  454. ]
  455. }, {
  456. token : "string.attribute-value.xml",
  457. regex : '"',
  458. stateName : "jsx_attr_qq",
  459. push : [
  460. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  461. {include : "reference"},
  462. {defaultToken : "string.attribute-value.xml"}
  463. ]
  464. },
  465. jsxTag
  466. ];
  467. this.$rules.reference = [{
  468. token : "constant.language.escape.reference.xml",
  469. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  470. }];
  471. }
  472. function comments(next) {
  473. return [
  474. {
  475. token : "comment", // multi line comment
  476. regex : /\/\*/,
  477. next: [
  478. DocCommentHighlightRules.getTagRule(),
  479. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  480. {defaultToken : "comment", caseInsensitive: true}
  481. ]
  482. }, {
  483. token : "comment",
  484. regex : "\\/\\/",
  485. next: [
  486. DocCommentHighlightRules.getTagRule(),
  487. {token : "comment", regex : "$|^", next : next || "pop"},
  488. {defaultToken : "comment", caseInsensitive: true}
  489. ]
  490. }
  491. ];
  492. }
  493. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  494. });
  495. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  496. "use strict";
  497. var Range = require("../range").Range;
  498. var MatchingBraceOutdent = function() {};
  499. (function() {
  500. this.checkOutdent = function(line, input) {
  501. if (! /^\s+$/.test(line))
  502. return false;
  503. return /^\s*\}/.test(input);
  504. };
  505. this.autoOutdent = function(doc, row) {
  506. var line = doc.getLine(row);
  507. var match = line.match(/^(\s*\})/);
  508. if (!match) return 0;
  509. var column = match[1].length;
  510. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  511. if (!openBracePos || openBracePos.row == row) return 0;
  512. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  513. doc.replace(new Range(row, 0, row, column-1), indent);
  514. };
  515. this.$getIndent = function(line) {
  516. return line.match(/^\s*/)[0];
  517. };
  518. }).call(MatchingBraceOutdent.prototype);
  519. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  520. });
  521. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
  522. "use strict";
  523. var oop = require("../../lib/oop");
  524. var Range = require("../../range").Range;
  525. var BaseFoldMode = require("./fold_mode").FoldMode;
  526. var FoldMode = exports.FoldMode = function(commentRegex) {
  527. if (commentRegex) {
  528. this.foldingStartMarker = new RegExp(
  529. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  530. );
  531. this.foldingStopMarker = new RegExp(
  532. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  533. );
  534. }
  535. };
  536. oop.inherits(FoldMode, BaseFoldMode);
  537. (function() {
  538. this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
  539. this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
  540. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  541. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  542. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  543. this._getFoldWidgetBase = this.getFoldWidget;
  544. this.getFoldWidget = function(session, foldStyle, row) {
  545. var line = session.getLine(row);
  546. if (this.singleLineBlockCommentRe.test(line)) {
  547. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  548. return "";
  549. }
  550. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  551. if (!fw && this.startRegionRe.test(line))
  552. return "start"; // lineCommentRegionStart
  553. return fw;
  554. };
  555. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  556. var line = session.getLine(row);
  557. if (this.startRegionRe.test(line))
  558. return this.getCommentRegionBlock(session, line, row);
  559. var match = line.match(this.foldingStartMarker);
  560. if (match) {
  561. var i = match.index;
  562. if (match[1])
  563. return this.openingBracketBlock(session, match[1], row, i);
  564. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  565. if (range && !range.isMultiLine()) {
  566. if (forceMultiline) {
  567. range = this.getSectionRange(session, row);
  568. } else if (foldStyle != "all")
  569. range = null;
  570. }
  571. return range;
  572. }
  573. if (foldStyle === "markbegin")
  574. return;
  575. var match = line.match(this.foldingStopMarker);
  576. if (match) {
  577. var i = match.index + match[0].length;
  578. if (match[1])
  579. return this.closingBracketBlock(session, match[1], row, i);
  580. return session.getCommentFoldRange(row, i, -1);
  581. }
  582. };
  583. this.getSectionRange = function(session, row) {
  584. var line = session.getLine(row);
  585. var startIndent = line.search(/\S/);
  586. var startRow = row;
  587. var startColumn = line.length;
  588. row = row + 1;
  589. var endRow = row;
  590. var maxRow = session.getLength();
  591. while (++row < maxRow) {
  592. line = session.getLine(row);
  593. var indent = line.search(/\S/);
  594. if (indent === -1)
  595. continue;
  596. if (startIndent > indent)
  597. break;
  598. var subRange = this.getFoldWidgetRange(session, "all", row);
  599. if (subRange) {
  600. if (subRange.start.row <= startRow) {
  601. break;
  602. } else if (subRange.isMultiLine()) {
  603. row = subRange.end.row;
  604. } else if (startIndent == indent) {
  605. break;
  606. }
  607. }
  608. endRow = row;
  609. }
  610. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  611. };
  612. this.getCommentRegionBlock = function(session, line, row) {
  613. var startColumn = line.search(/\s*$/);
  614. var maxRow = session.getLength();
  615. var startRow = row;
  616. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  617. var depth = 1;
  618. while (++row < maxRow) {
  619. line = session.getLine(row);
  620. var m = re.exec(line);
  621. if (!m) continue;
  622. if (m[1]) depth--;
  623. else depth++;
  624. if (!depth) break;
  625. }
  626. var endRow = row;
  627. if (endRow > startRow) {
  628. return new Range(startRow, startColumn, endRow, line.length);
  629. }
  630. };
  631. }).call(FoldMode.prototype);
  632. });
  633. 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) {
  634. "use strict";
  635. var oop = require("../lib/oop");
  636. var TextMode = require("./text").Mode;
  637. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  638. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  639. var WorkerClient = require("../worker/worker_client").WorkerClient;
  640. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  641. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  642. var Mode = function() {
  643. this.HighlightRules = JavaScriptHighlightRules;
  644. this.$outdent = new MatchingBraceOutdent();
  645. this.$behaviour = new CstyleBehaviour();
  646. this.foldingRules = new CStyleFoldMode();
  647. };
  648. oop.inherits(Mode, TextMode);
  649. (function() {
  650. this.lineCommentStart = "//";
  651. this.blockComment = {start: "/*", end: "*/"};
  652. this.getNextLineIndent = function(state, line, tab) {
  653. var indent = this.$getIndent(line);
  654. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  655. var tokens = tokenizedLine.tokens;
  656. var endState = tokenizedLine.state;
  657. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  658. return indent;
  659. }
  660. if (state == "start" || state == "no_regex") {
  661. var match = line.match(/^.*(?:\bcase\b.*:|[\{\(\[])\s*$/);
  662. if (match) {
  663. indent += tab;
  664. }
  665. } else if (state == "doc-start") {
  666. if (endState == "start" || endState == "no_regex") {
  667. return "";
  668. }
  669. var match = line.match(/^\s*(\/?)\*/);
  670. if (match) {
  671. if (match[1]) {
  672. indent += " ";
  673. }
  674. indent += "* ";
  675. }
  676. }
  677. return indent;
  678. };
  679. this.checkOutdent = function(state, line, input) {
  680. return this.$outdent.checkOutdent(line, input);
  681. };
  682. this.autoOutdent = function(state, doc, row) {
  683. this.$outdent.autoOutdent(doc, row);
  684. };
  685. this.createWorker = function(session) {
  686. var worker = new WorkerClient(["ace"], "ace/mode/javascript_worker", "JavaScriptWorker");
  687. worker.attachToDocument(session.getDocument());
  688. worker.on("annotate", function(results) {
  689. session.setAnnotations(results.data);
  690. });
  691. worker.on("terminate", function() {
  692. session.clearAnnotations();
  693. });
  694. return worker;
  695. };
  696. this.$id = "ace/mode/javascript";
  697. }).call(Mode.prototype);
  698. exports.Mode = Mode;
  699. });
  700. 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) {
  701. "use strict";
  702. var oop = require("../lib/oop");
  703. var lang = require("../lib/lang");
  704. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  705. 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";
  706. var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters";
  707. 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";
  708. var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
  709. 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";
  710. var numRe = exports.numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))";
  711. var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b";
  712. 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";
  713. var CssHighlightRules = function() {
  714. var keywordMapper = this.createKeywordMapper({
  715. "support.function": supportFunction,
  716. "support.constant": supportConstant,
  717. "support.type": supportType,
  718. "support.constant.color": supportConstantColor,
  719. "support.constant.fonts": supportConstantFonts
  720. }, "text", true);
  721. this.$rules = {
  722. "start" : [{
  723. token : "comment", // multi line comment
  724. regex : "\\/\\*",
  725. push : "comment"
  726. }, {
  727. token: "paren.lparen",
  728. regex: "\\{",
  729. push: "ruleset"
  730. }, {
  731. token: "string",
  732. regex: "@.*?{",
  733. push: "media"
  734. }, {
  735. token: "keyword",
  736. regex: "#[a-z0-9-_]+"
  737. }, {
  738. token: "variable",
  739. regex: "\\.[a-z0-9-_]+"
  740. }, {
  741. token: "string",
  742. regex: ":[a-z0-9-_]+"
  743. }, {
  744. token: "constant",
  745. regex: "[a-z0-9-_]+"
  746. }, {
  747. caseInsensitive: true
  748. }],
  749. "media" : [{
  750. token : "comment", // multi line comment
  751. regex : "\\/\\*",
  752. push : "comment"
  753. }, {
  754. token: "paren.lparen",
  755. regex: "\\{",
  756. push: "ruleset"
  757. }, {
  758. token: "string",
  759. regex: "\\}",
  760. next: "pop"
  761. }, {
  762. token: "keyword",
  763. regex: "#[a-z0-9-_]+"
  764. }, {
  765. token: "variable",
  766. regex: "\\.[a-z0-9-_]+"
  767. }, {
  768. token: "string",
  769. regex: ":[a-z0-9-_]+"
  770. }, {
  771. token: "constant",
  772. regex: "[a-z0-9-_]+"
  773. }, {
  774. caseInsensitive: true
  775. }],
  776. "comment" : [{
  777. token : "comment",
  778. regex : "\\*\\/",
  779. next : "pop"
  780. }, {
  781. defaultToken : "comment"
  782. }],
  783. "ruleset" : [
  784. {
  785. token : "paren.rparen",
  786. regex : "\\}",
  787. next: "pop"
  788. }, {
  789. token : "comment", // multi line comment
  790. regex : "\\/\\*",
  791. push : "comment"
  792. }, {
  793. token : "string", // single line
  794. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  795. }, {
  796. token : "string", // single line
  797. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  798. }, {
  799. token : ["constant.numeric", "keyword"],
  800. 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|%)"
  801. }, {
  802. token : "constant.numeric",
  803. regex : numRe
  804. }, {
  805. token : "constant.numeric", // hex6 color
  806. regex : "#[a-f0-9]{6}"
  807. }, {
  808. token : "constant.numeric", // hex3 color
  809. regex : "#[a-f0-9]{3}"
  810. }, {
  811. token : ["punctuation", "entity.other.attribute-name.pseudo-element.css"],
  812. regex : pseudoElements
  813. }, {
  814. token : ["punctuation", "entity.other.attribute-name.pseudo-class.css"],
  815. regex : pseudoClasses
  816. }, {
  817. token : ["support.function", "string", "support.function"],
  818. regex : "(url\\()(.*)(\\))"
  819. }, {
  820. token : keywordMapper,
  821. regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  822. }, {
  823. caseInsensitive: true
  824. }]
  825. };
  826. this.normalizeRules();
  827. };
  828. oop.inherits(CssHighlightRules, TextHighlightRules);
  829. exports.CssHighlightRules = CssHighlightRules;
  830. });
  831. ace.define("ace/mode/css_completions",["require","exports","module"], function(require, exports, module) {
  832. "use strict";
  833. var propertyMap = {
  834. "background": {"#$0": 1},
  835. "background-color": {"#$0": 1, "transparent": 1, "fixed": 1},
  836. "background-image": {"url('/$0')": 1},
  837. "background-repeat": {"repeat": 1, "repeat-x": 1, "repeat-y": 1, "no-repeat": 1, "inherit": 1},
  838. "background-position": {"bottom":2, "center":2, "left":2, "right":2, "top":2, "inherit":2},
  839. "background-attachment": {"scroll": 1, "fixed": 1},
  840. "background-size": {"cover": 1, "contain": 1},
  841. "background-clip": {"border-box": 1, "padding-box": 1, "content-box": 1},
  842. "background-origin": {"border-box": 1, "padding-box": 1, "content-box": 1},
  843. "border": {"solid $0": 1, "dashed $0": 1, "dotted $0": 1, "#$0": 1},
  844. "border-color": {"#$0": 1},
  845. "border-style": {"solid":2, "dashed":2, "dotted":2, "double":2, "groove":2, "hidden":2, "inherit":2, "inset":2, "none":2, "outset":2, "ridged":2},
  846. "border-collapse": {"collapse": 1, "separate": 1},
  847. "bottom": {"px": 1, "em": 1, "%": 1},
  848. "clear": {"left": 1, "right": 1, "both": 1, "none": 1},
  849. "color": {"#$0": 1, "rgb(#$00,0,0)": 1},
  850. "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},
  851. "display": {"none": 1, "block": 1, "inline": 1, "inline-block": 1, "table-cell": 1},
  852. "empty-cells": {"show": 1, "hide": 1},
  853. "float": {"left": 1, "right": 1, "none": 1},
  854. "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},
  855. "font-size": {"px": 1, "em": 1, "%": 1},
  856. "font-weight": {"bold": 1, "normal": 1},
  857. "font-style": {"italic": 1, "normal": 1},
  858. "font-variant": {"normal": 1, "small-caps": 1},
  859. "height": {"px": 1, "em": 1, "%": 1},
  860. "left": {"px": 1, "em": 1, "%": 1},
  861. "letter-spacing": {"normal": 1},
  862. "line-height": {"normal": 1},
  863. "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},
  864. "margin": {"px": 1, "em": 1, "%": 1},
  865. "margin-right": {"px": 1, "em": 1, "%": 1},
  866. "margin-left": {"px": 1, "em": 1, "%": 1},
  867. "margin-top": {"px": 1, "em": 1, "%": 1},
  868. "margin-bottom": {"px": 1, "em": 1, "%": 1},
  869. "max-height": {"px": 1, "em": 1, "%": 1},
  870. "max-width": {"px": 1, "em": 1, "%": 1},
  871. "min-height": {"px": 1, "em": 1, "%": 1},
  872. "min-width": {"px": 1, "em": 1, "%": 1},
  873. "overflow": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  874. "overflow-x": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  875. "overflow-y": {"hidden": 1, "visible": 1, "auto": 1, "scroll": 1},
  876. "padding": {"px": 1, "em": 1, "%": 1},
  877. "padding-top": {"px": 1, "em": 1, "%": 1},
  878. "padding-right": {"px": 1, "em": 1, "%": 1},
  879. "padding-bottom": {"px": 1, "em": 1, "%": 1},
  880. "padding-left": {"px": 1, "em": 1, "%": 1},
  881. "page-break-after": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  882. "page-break-before": {"auto": 1, "always": 1, "avoid": 1, "left": 1, "right": 1},
  883. "position": {"absolute": 1, "relative": 1, "fixed": 1, "static": 1},
  884. "right": {"px": 1, "em": 1, "%": 1},
  885. "table-layout": {"fixed": 1, "auto": 1},
  886. "text-decoration": {"none": 1, "underline": 1, "line-through": 1, "blink": 1},
  887. "text-align": {"left": 1, "right": 1, "center": 1, "justify": 1},
  888. "text-transform": {"capitalize": 1, "uppercase": 1, "lowercase": 1, "none": 1},
  889. "top": {"px": 1, "em": 1, "%": 1},
  890. "vertical-align": {"top": 1, "bottom": 1},
  891. "visibility": {"hidden": 1, "visible": 1},
  892. "white-space": {"nowrap": 1, "normal": 1, "pre": 1, "pre-line": 1, "pre-wrap": 1},
  893. "width": {"px": 1, "em": 1, "%": 1},
  894. "word-spacing": {"normal": 1},
  895. "filter": {"alpha(opacity=$0100)": 1},
  896. "text-shadow": {"$02px 2px 2px #777": 1},
  897. "text-overflow": {"ellipsis-word": 1, "clip": 1, "ellipsis": 1},
  898. "-moz-border-radius": 1,
  899. "-moz-border-radius-topright": 1,
  900. "-moz-border-radius-bottomright": 1,
  901. "-moz-border-radius-topleft": 1,
  902. "-moz-border-radius-bottomleft": 1,
  903. "-webkit-border-radius": 1,
  904. "-webkit-border-top-right-radius": 1,
  905. "-webkit-border-top-left-radius": 1,
  906. "-webkit-border-bottom-right-radius": 1,
  907. "-webkit-border-bottom-left-radius": 1,
  908. "-moz-box-shadow": 1,
  909. "-webkit-box-shadow": 1,
  910. "transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  911. "-moz-transform": {"rotate($00deg)": 1, "skew($00deg)": 1},
  912. "-webkit-transform": {"rotate($00deg)": 1, "skew($00deg)": 1 }
  913. };
  914. var CssCompletions = function() {
  915. };
  916. (function() {
  917. this.completionsDefined = false;
  918. this.defineCompletions = function() {
  919. if (document) {
  920. var style = document.createElement('c').style;
  921. for (var i in style) {
  922. if (typeof style[i] !== 'string')
  923. continue;
  924. var name = i.replace(/[A-Z]/g, function(x) {
  925. return '-' + x.toLowerCase();
  926. });
  927. if (!propertyMap.hasOwnProperty(name))
  928. propertyMap[name] = 1;
  929. }
  930. }
  931. this.completionsDefined = true;
  932. }
  933. this.getCompletions = function(state, session, pos, prefix) {
  934. if (!this.completionsDefined) {
  935. this.defineCompletions();
  936. }
  937. var token = session.getTokenAt(pos.row, pos.column);
  938. if (!token)
  939. return [];
  940. if (state==='ruleset'){
  941. var line = session.getLine(pos.row).substr(0, pos.column);
  942. if (/:[^;]+$/.test(line)) {
  943. /([\w\-]+):[^:]*$/.test(line);
  944. return this.getPropertyValueCompletions(state, session, pos, prefix);
  945. } else {
  946. return this.getPropertyCompletions(state, session, pos, prefix);
  947. }
  948. }
  949. return [];
  950. };
  951. this.getPropertyCompletions = function(state, session, pos, prefix) {
  952. var properties = Object.keys(propertyMap);
  953. return properties.map(function(property){
  954. return {
  955. caption: property,
  956. snippet: property + ': $0',
  957. meta: "property",
  958. score: Number.MAX_VALUE
  959. };
  960. });
  961. };
  962. this.getPropertyValueCompletions = function(state, session, pos, prefix) {
  963. var line = session.getLine(pos.row).substr(0, pos.column);
  964. var property = (/([\w\-]+):[^:]*$/.exec(line) || {})[1];
  965. if (!property)
  966. return [];
  967. var values = [];
  968. if (property in propertyMap && typeof propertyMap[property] === "object") {
  969. values = Object.keys(propertyMap[property]);
  970. }
  971. return values.map(function(value){
  972. return {
  973. caption: value,
  974. snippet: value,
  975. meta: "property value",
  976. score: Number.MAX_VALUE
  977. };
  978. });
  979. };
  980. }).call(CssCompletions.prototype);
  981. exports.CssCompletions = CssCompletions;
  982. });
  983. 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) {
  984. "use strict";
  985. var oop = require("../../lib/oop");
  986. var Behaviour = require("../behaviour").Behaviour;
  987. var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
  988. var TokenIterator = require("../../token_iterator").TokenIterator;
  989. var CssBehaviour = function () {
  990. this.inherit(CstyleBehaviour);
  991. this.add("colon", "insertion", function (state, action, editor, session, text) {
  992. if (text === ':') {
  993. var cursor = editor.getCursorPosition();
  994. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  995. var token = iterator.getCurrentToken();
  996. if (token && token.value.match(/\s+/)) {
  997. token = iterator.stepBackward();
  998. }
  999. if (token && token.type === 'support.type') {
  1000. var line = session.doc.getLine(cursor.row);
  1001. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1002. if (rightChar === ':') {
  1003. return {
  1004. text: '',
  1005. selection: [1, 1]
  1006. }
  1007. }
  1008. if (!line.substring(cursor.column).match(/^\s*;/)) {
  1009. return {
  1010. text: ':;',
  1011. selection: [1, 1]
  1012. }
  1013. }
  1014. }
  1015. }
  1016. });
  1017. this.add("colon", "deletion", function (state, action, editor, session, range) {
  1018. var selected = session.doc.getTextRange(range);
  1019. if (!range.isMultiLine() && selected === ':') {
  1020. var cursor = editor.getCursorPosition();
  1021. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1022. var token = iterator.getCurrentToken();
  1023. if (token && token.value.match(/\s+/)) {
  1024. token = iterator.stepBackward();
  1025. }
  1026. if (token && token.type === 'support.type') {
  1027. var line = session.doc.getLine(range.start.row);
  1028. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1029. if (rightChar === ';') {
  1030. range.end.column ++;
  1031. return range;
  1032. }
  1033. }
  1034. }
  1035. });
  1036. this.add("semicolon", "insertion", function (state, action, editor, session, text) {
  1037. if (text === ';') {
  1038. var cursor = editor.getCursorPosition();
  1039. var line = session.doc.getLine(cursor.row);
  1040. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1041. if (rightChar === ';') {
  1042. return {
  1043. text: '',
  1044. selection: [1, 1]
  1045. }
  1046. }
  1047. }
  1048. });
  1049. }
  1050. oop.inherits(CssBehaviour, CstyleBehaviour);
  1051. exports.CssBehaviour = CssBehaviour;
  1052. });
  1053. 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) {
  1054. "use strict";
  1055. var oop = require("../lib/oop");
  1056. var TextMode = require("./text").Mode;
  1057. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1058. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1059. var WorkerClient = require("../worker/worker_client").WorkerClient;
  1060. var CssCompletions = require("./css_completions").CssCompletions;
  1061. var CssBehaviour = require("./behaviour/css").CssBehaviour;
  1062. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1063. var Mode = function() {
  1064. this.HighlightRules = CssHighlightRules;
  1065. this.$outdent = new MatchingBraceOutdent();
  1066. this.$behaviour = new CssBehaviour();
  1067. this.$completer = new CssCompletions();
  1068. this.foldingRules = new CStyleFoldMode();
  1069. };
  1070. oop.inherits(Mode, TextMode);
  1071. (function() {
  1072. this.foldingRules = "cStyle";
  1073. this.blockComment = {start: "/*", end: "*/"};
  1074. this.getNextLineIndent = function(state, line, tab) {
  1075. var indent = this.$getIndent(line);
  1076. var tokens = this.getTokenizer().getLineTokens(line, state).tokens;
  1077. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  1078. return indent;
  1079. }
  1080. var match = line.match(/^.*\{\s*$/);
  1081. if (match) {
  1082. indent += tab;
  1083. }
  1084. return indent;
  1085. };
  1086. this.checkOutdent = function(state, line, input) {
  1087. return this.$outdent.checkOutdent(line, input);
  1088. };
  1089. this.autoOutdent = function(state, doc, row) {
  1090. this.$outdent.autoOutdent(doc, row);
  1091. };
  1092. this.getCompletions = function(state, session, pos, prefix) {
  1093. return this.$completer.getCompletions(state, session, pos, prefix);
  1094. };
  1095. this.createWorker = function(session) {
  1096. var worker = new WorkerClient(["ace"], "ace/mode/css_worker", "Worker");
  1097. worker.attachToDocument(session.getDocument());
  1098. worker.on("annotate", function(e) {
  1099. session.setAnnotations(e.data);
  1100. });
  1101. worker.on("terminate", function() {
  1102. session.clearAnnotations();
  1103. });
  1104. return worker;
  1105. };
  1106. this.$id = "ace/mode/css";
  1107. }).call(Mode.prototype);
  1108. exports.Mode = Mode;
  1109. });
  1110. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  1111. "use strict";
  1112. var oop = require("../lib/oop");
  1113. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  1114. var XmlHighlightRules = function(normalize) {
  1115. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  1116. this.$rules = {
  1117. start : [
  1118. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  1119. {
  1120. token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
  1121. regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
  1122. },
  1123. {
  1124. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  1125. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
  1126. },
  1127. {token : "comment.xml", regex : "<\\!--", next : "comment"},
  1128. {
  1129. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  1130. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  1131. },
  1132. {include : "tag"},
  1133. {token : "text.end-tag-open.xml", regex: "</"},
  1134. {token : "text.tag-open.xml", regex: "<"},
  1135. {include : "reference"},
  1136. {defaultToken : "text.xml"}
  1137. ],
  1138. xml_decl : [{
  1139. token : "entity.other.attribute-name.decl-attribute-name.xml",
  1140. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  1141. }, {
  1142. token : "keyword.operator.decl-attribute-equals.xml",
  1143. regex : "="
  1144. }, {
  1145. include: "whitespace"
  1146. }, {
  1147. include: "string"
  1148. }, {
  1149. token : "punctuation.xml-decl.xml",
  1150. regex : "\\?>",
  1151. next : "start"
  1152. }],
  1153. processing_instruction : [
  1154. {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
  1155. {defaultToken : "instruction.xml"}
  1156. ],
  1157. doctype : [
  1158. {include : "whitespace"},
  1159. {include : "string"},
  1160. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  1161. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  1162. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  1163. ],
  1164. int_subset : [{
  1165. token : "text.xml",
  1166. regex : "\\s+"
  1167. }, {
  1168. token: "punctuation.int-subset.xml",
  1169. regex: "]",
  1170. next: "pop"
  1171. }, {
  1172. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  1173. regex : "(<\\!)(" + tagRegex + ")",
  1174. push : [{
  1175. token : "text",
  1176. regex : "\\s+"
  1177. },
  1178. {
  1179. token : "punctuation.markup-decl.xml",
  1180. regex : ">",
  1181. next : "pop"
  1182. },
  1183. {include : "string"}]
  1184. }],
  1185. cdata : [
  1186. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  1187. {token : "text.xml", regex : "\\s+"},
  1188. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  1189. ],
  1190. comment : [
  1191. {token : "comment.xml", regex : "-->", next : "start"},
  1192. {defaultToken : "comment.xml"}
  1193. ],
  1194. reference : [{
  1195. token : "constant.language.escape.reference.xml",
  1196. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  1197. }],
  1198. attr_reference : [{
  1199. token : "constant.language.escape.reference.attribute-value.xml",
  1200. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  1201. }],
  1202. tag : [{
  1203. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  1204. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  1205. next: [
  1206. {include : "attributes"},
  1207. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  1208. ]
  1209. }],
  1210. tag_whitespace : [
  1211. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  1212. ],
  1213. whitespace : [
  1214. {token : "text.whitespace.xml", regex : "\\s+"}
  1215. ],
  1216. string: [{
  1217. token : "string.xml",
  1218. regex : "'",
  1219. push : [
  1220. {token : "string.xml", regex: "'", next: "pop"},
  1221. {defaultToken : "string.xml"}
  1222. ]
  1223. }, {
  1224. token : "string.xml",
  1225. regex : '"',
  1226. push : [
  1227. {token : "string.xml", regex: '"', next: "pop"},
  1228. {defaultToken : "string.xml"}
  1229. ]
  1230. }],
  1231. attributes: [{
  1232. token : "entity.other.attribute-name.xml",
  1233. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  1234. }, {
  1235. token : "keyword.operator.attribute-equals.xml",
  1236. regex : "="
  1237. }, {
  1238. include: "tag_whitespace"
  1239. }, {
  1240. include: "attribute_value"
  1241. }],
  1242. attribute_value: [{
  1243. token : "string.attribute-value.xml",
  1244. regex : "'",
  1245. push : [
  1246. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  1247. {include : "attr_reference"},
  1248. {defaultToken : "string.attribute-value.xml"}
  1249. ]
  1250. }, {
  1251. token : "string.attribute-value.xml",
  1252. regex : '"',
  1253. push : [
  1254. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  1255. {include : "attr_reference"},
  1256. {defaultToken : "string.attribute-value.xml"}
  1257. ]
  1258. }]
  1259. };
  1260. if (this.constructor === XmlHighlightRules)
  1261. this.normalizeRules();
  1262. };
  1263. (function() {
  1264. this.embedTagRules = function(HighlightRules, prefix, tag){
  1265. this.$rules.tag.unshift({
  1266. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  1267. regex : "(<)(" + tag + "(?=\\s|>|$))",
  1268. next: [
  1269. {include : "attributes"},
  1270. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  1271. ]
  1272. });
  1273. this.$rules[tag + "-end"] = [
  1274. {include : "attributes"},
  1275. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  1276. onMatch : function(value, currentState, stack) {
  1277. stack.splice(0);
  1278. return this.token;
  1279. }}
  1280. ]
  1281. this.embedRules(HighlightRules, prefix, [{
  1282. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  1283. regex : "(</)(" + tag + "(?=\\s|>|$))",
  1284. next: tag + "-end"
  1285. }, {
  1286. token: "string.cdata.xml",
  1287. regex : "<\\!\\[CDATA\\["
  1288. }, {
  1289. token: "string.cdata.xml",
  1290. regex : "\\]\\]>"
  1291. }]);
  1292. };
  1293. }).call(TextHighlightRules.prototype);
  1294. oop.inherits(XmlHighlightRules, TextHighlightRules);
  1295. exports.XmlHighlightRules = XmlHighlightRules;
  1296. });
  1297. 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) {
  1298. "use strict";
  1299. var oop = require("../lib/oop");
  1300. var lang = require("../lib/lang");
  1301. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  1302. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  1303. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  1304. var tagMap = lang.createMap({
  1305. a : 'anchor',
  1306. button : 'form',
  1307. form : 'form',
  1308. img : 'image',
  1309. input : 'form',
  1310. label : 'form',
  1311. option : 'form',
  1312. script : 'script',
  1313. select : 'form',
  1314. textarea : 'form',
  1315. style : 'style',
  1316. table : 'table',
  1317. tbody : 'table',
  1318. td : 'table',
  1319. tfoot : 'table',
  1320. th : 'table',
  1321. tr : 'table'
  1322. });
  1323. var HtmlHighlightRules = function() {
  1324. XmlHighlightRules.call(this);
  1325. this.addRules({
  1326. attributes: [{
  1327. include : "tag_whitespace"
  1328. }, {
  1329. token : "entity.other.attribute-name.xml",
  1330. regex : "[-_a-zA-Z0-9:.]+"
  1331. }, {
  1332. token : "keyword.operator.attribute-equals.xml",
  1333. regex : "=",
  1334. push : [{
  1335. include: "tag_whitespace"
  1336. }, {
  1337. token : "string.unquoted.attribute-value.html",
  1338. regex : "[^<>='\"`\\s]+",
  1339. next : "pop"
  1340. }, {
  1341. token : "empty",
  1342. regex : "",
  1343. next : "pop"
  1344. }]
  1345. }, {
  1346. include : "attribute_value"
  1347. }],
  1348. tag: [{
  1349. token : function(start, tag) {
  1350. var group = tagMap[tag];
  1351. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  1352. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  1353. },
  1354. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  1355. next: "tag_stuff"
  1356. }],
  1357. tag_stuff: [
  1358. {include : "attributes"},
  1359. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  1360. ]
  1361. });
  1362. this.embedTagRules(CssHighlightRules, "css-", "style");
  1363. this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
  1364. if (this.constructor === HtmlHighlightRules)
  1365. this.normalizeRules();
  1366. };
  1367. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  1368. exports.HtmlHighlightRules = HtmlHighlightRules;
  1369. });
  1370. 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) {
  1371. "use strict";
  1372. var oop = require("../../lib/oop");
  1373. var Behaviour = require("../behaviour").Behaviour;
  1374. var TokenIterator = require("../../token_iterator").TokenIterator;
  1375. var lang = require("../../lib/lang");
  1376. function is(token, type) {
  1377. return token.type.lastIndexOf(type + ".xml") > -1;
  1378. }
  1379. var XmlBehaviour = function () {
  1380. this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
  1381. if (text == '"' || text == "'") {
  1382. var quote = text;
  1383. var selected = session.doc.getTextRange(editor.getSelectionRange());
  1384. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  1385. return {
  1386. text: quote + selected + quote,
  1387. selection: false
  1388. };
  1389. }
  1390. var cursor = editor.getCursorPosition();
  1391. var line = session.doc.getLine(cursor.row);
  1392. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1393. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1394. var token = iterator.getCurrentToken();
  1395. if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
  1396. return {
  1397. text: "",
  1398. selection: [1, 1]
  1399. };
  1400. }
  1401. if (!token)
  1402. token = iterator.stepBackward();
  1403. if (!token)
  1404. return;
  1405. while (is(token, "tag-whitespace") || is(token, "whitespace")) {
  1406. token = iterator.stepBackward();
  1407. }
  1408. var rightSpace = !rightChar || rightChar.match(/\s/);
  1409. if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
  1410. return {
  1411. text: quote + quote,
  1412. selection: [1, 1]
  1413. };
  1414. }
  1415. }
  1416. });
  1417. this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
  1418. var selected = session.doc.getTextRange(range);
  1419. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  1420. var line = session.doc.getLine(range.start.row);
  1421. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  1422. if (rightChar == selected) {
  1423. range.end.column++;
  1424. return range;
  1425. }
  1426. }
  1427. });
  1428. this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
  1429. if (text == '>') {
  1430. var position = editor.getSelectionRange().start;
  1431. var iterator = new TokenIterator(session, position.row, position.column);
  1432. var token = iterator.getCurrentToken() || iterator.stepBackward();
  1433. if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
  1434. return;
  1435. if (is(token, "reference.attribute-value"))
  1436. return;
  1437. if (is(token, "attribute-value")) {
  1438. var firstChar = token.value.charAt(0);
  1439. if (firstChar == '"' || firstChar == "'") {
  1440. var lastChar = token.value.charAt(token.value.length - 1);
  1441. var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
  1442. if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
  1443. return;
  1444. }
  1445. }
  1446. while (!is(token, "tag-name")) {
  1447. token = iterator.stepBackward();
  1448. if (token.value == "<") {
  1449. token = iterator.stepForward();
  1450. break;
  1451. }
  1452. }
  1453. var tokenRow = iterator.getCurrentTokenRow();
  1454. var tokenColumn = iterator.getCurrentTokenColumn();
  1455. if (is(iterator.stepBackward(), "end-tag-open"))
  1456. return;
  1457. var element = token.value;
  1458. if (tokenRow == position.row)
  1459. element = element.substring(0, position.column - tokenColumn);
  1460. if (this.voidElements.hasOwnProperty(element.toLowerCase()))
  1461. return;
  1462. return {
  1463. text: ">" + "</" + element + ">",
  1464. selection: [1, 1]
  1465. };
  1466. }
  1467. });
  1468. this.add("autoindent", "insertion", function (state, action, editor, session, text) {
  1469. if (text == "\n") {
  1470. var cursor = editor.getCursorPosition();
  1471. var line = session.getLine(cursor.row);
  1472. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1473. var token = iterator.getCurrentToken();
  1474. if (token && token.type.indexOf("tag-close") !== -1) {
  1475. if (token.value == "/>")
  1476. return;
  1477. while (token && token.type.indexOf("tag-name") === -1) {
  1478. token = iterator.stepBackward();
  1479. }
  1480. if (!token) {
  1481. return;
  1482. }
  1483. var tag = token.value;
  1484. var row = iterator.getCurrentTokenRow();
  1485. token = iterator.stepBackward();
  1486. if (!token || token.type.indexOf("end-tag") !== -1) {
  1487. return;
  1488. }
  1489. if (this.voidElements && !this.voidElements[tag]) {
  1490. var nextToken = session.getTokenAt(cursor.row, cursor.column+1);
  1491. var line = session.getLine(row);
  1492. var nextIndent = this.$getIndent(line);
  1493. var indent = nextIndent + session.getTabString();
  1494. if (nextToken && nextToken.value === "</") {
  1495. return {
  1496. text: "\n" + indent + "\n" + nextIndent,
  1497. selection: [1, indent.length, 1, indent.length]
  1498. };
  1499. } else {
  1500. return {
  1501. text: "\n" + indent
  1502. };
  1503. }
  1504. }
  1505. }
  1506. }
  1507. });
  1508. };
  1509. oop.inherits(XmlBehaviour, Behaviour);
  1510. exports.XmlBehaviour = XmlBehaviour;
  1511. });
  1512. ace.define("ace/mode/folding/mixed",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1513. "use strict";
  1514. var oop = require("../../lib/oop");
  1515. var BaseFoldMode = require("./fold_mode").FoldMode;
  1516. var FoldMode = exports.FoldMode = function(defaultMode, subModes) {
  1517. this.defaultMode = defaultMode;
  1518. this.subModes = subModes;
  1519. };
  1520. oop.inherits(FoldMode, BaseFoldMode);
  1521. (function() {
  1522. this.$getMode = function(state) {
  1523. if (typeof state != "string")
  1524. state = state[0];
  1525. for (var key in this.subModes) {
  1526. if (state.indexOf(key) === 0)
  1527. return this.subModes[key];
  1528. }
  1529. return null;
  1530. };
  1531. this.$tryMode = function(state, session, foldStyle, row) {
  1532. var mode = this.$getMode(state);
  1533. return (mode ? mode.getFoldWidget(session, foldStyle, row) : "");
  1534. };
  1535. this.getFoldWidget = function(session, foldStyle, row) {
  1536. return (
  1537. this.$tryMode(session.getState(row-1), session, foldStyle, row) ||
  1538. this.$tryMode(session.getState(row), session, foldStyle, row) ||
  1539. this.defaultMode.getFoldWidget(session, foldStyle, row)
  1540. );
  1541. };
  1542. this.getFoldWidgetRange = function(session, foldStyle, row) {
  1543. var mode = this.$getMode(session.getState(row-1));
  1544. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1545. mode = this.$getMode(session.getState(row));
  1546. if (!mode || !mode.getFoldWidget(session, foldStyle, row))
  1547. mode = this.defaultMode;
  1548. return mode.getFoldWidgetRange(session, foldStyle, row);
  1549. };
  1550. }).call(FoldMode.prototype);
  1551. });
  1552. 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) {
  1553. "use strict";
  1554. var oop = require("../../lib/oop");
  1555. var lang = require("../../lib/lang");
  1556. var Range = require("../../range").Range;
  1557. var BaseFoldMode = require("./fold_mode").FoldMode;
  1558. var TokenIterator = require("../../token_iterator").TokenIterator;
  1559. var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
  1560. BaseFoldMode.call(this);
  1561. this.voidElements = voidElements || {};
  1562. this.optionalEndTags = oop.mixin({}, this.voidElements);
  1563. if (optionalEndTags)
  1564. oop.mixin(this.optionalEndTags, optionalEndTags);
  1565. };
  1566. oop.inherits(FoldMode, BaseFoldMode);
  1567. var Tag = function() {
  1568. this.tagName = "";
  1569. this.closing = false;
  1570. this.selfClosing = false;
  1571. this.start = {row: 0, column: 0};
  1572. this.end = {row: 0, column: 0};
  1573. };
  1574. function is(token, type) {
  1575. return token.type.lastIndexOf(type + ".xml") > -1;
  1576. }
  1577. (function() {
  1578. this.getFoldWidget = function(session, foldStyle, row) {
  1579. var tag = this._getFirstTagInLine(session, row);
  1580. if (!tag)
  1581. return "";
  1582. if (tag.closing || (!tag.tagName && tag.selfClosing))
  1583. return foldStyle == "markbeginend" ? "end" : "";
  1584. if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
  1585. return "";
  1586. if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
  1587. return "";
  1588. return "start";
  1589. };
  1590. this._getFirstTagInLine = function(session, row) {
  1591. var tokens = session.getTokens(row);
  1592. var tag = new Tag();
  1593. for (var i = 0; i < tokens.length; i++) {
  1594. var token = tokens[i];
  1595. if (is(token, "tag-open")) {
  1596. tag.end.column = tag.start.column + token.value.length;
  1597. tag.closing = is(token, "end-tag-open");
  1598. token = tokens[++i];
  1599. if (!token)
  1600. return null;
  1601. tag.tagName = token.value;
  1602. tag.end.column += token.value.length;
  1603. for (i++; i < tokens.length; i++) {
  1604. token = tokens[i];
  1605. tag.end.column += token.value.length;
  1606. if (is(token, "tag-close")) {
  1607. tag.selfClosing = token.value == '/>';
  1608. break;
  1609. }
  1610. }
  1611. return tag;
  1612. } else if (is(token, "tag-close")) {
  1613. tag.selfClosing = token.value == '/>';
  1614. return tag;
  1615. }
  1616. tag.start.column += token.value.length;
  1617. }
  1618. return null;
  1619. };
  1620. this._findEndTagInLine = function(session, row, tagName, startColumn) {
  1621. var tokens = session.getTokens(row);
  1622. var column = 0;
  1623. for (var i = 0; i < tokens.length; i++) {
  1624. var token = tokens[i];
  1625. column += token.value.length;
  1626. if (column < startColumn)
  1627. continue;
  1628. if (is(token, "end-tag-open")) {
  1629. token = tokens[i + 1];
  1630. if (token && token.value == tagName)
  1631. return true;
  1632. }
  1633. }
  1634. return false;
  1635. };
  1636. this._readTagForward = function(iterator) {
  1637. var token = iterator.getCurrentToken();
  1638. if (!token)
  1639. return null;
  1640. var tag = new Tag();
  1641. do {
  1642. if (is(token, "tag-open")) {
  1643. tag.closing = is(token, "end-tag-open");
  1644. tag.start.row = iterator.getCurrentTokenRow();
  1645. tag.start.column = iterator.getCurrentTokenColumn();
  1646. } else if (is(token, "tag-name")) {
  1647. tag.tagName = token.value;
  1648. } else if (is(token, "tag-close")) {
  1649. tag.selfClosing = token.value == "/>";
  1650. tag.end.row = iterator.getCurrentTokenRow();
  1651. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  1652. iterator.stepForward();
  1653. return tag;
  1654. }
  1655. } while(token = iterator.stepForward());
  1656. return null;
  1657. };
  1658. this._readTagBackward = function(iterator) {
  1659. var token = iterator.getCurrentToken();
  1660. if (!token)
  1661. return null;
  1662. var tag = new Tag();
  1663. do {
  1664. if (is(token, "tag-open")) {
  1665. tag.closing = is(token, "end-tag-open");
  1666. tag.start.row = iterator.getCurrentTokenRow();
  1667. tag.start.column = iterator.getCurrentTokenColumn();
  1668. iterator.stepBackward();
  1669. return tag;
  1670. } else if (is(token, "tag-name")) {
  1671. tag.tagName = token.value;
  1672. } else if (is(token, "tag-close")) {
  1673. tag.selfClosing = token.value == "/>";
  1674. tag.end.row = iterator.getCurrentTokenRow();
  1675. tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
  1676. }
  1677. } while(token = iterator.stepBackward());
  1678. return null;
  1679. };
  1680. this._pop = function(stack, tag) {
  1681. while (stack.length) {
  1682. var top = stack[stack.length-1];
  1683. if (!tag || top.tagName == tag.tagName) {
  1684. return stack.pop();
  1685. }
  1686. else if (this.optionalEndTags.hasOwnProperty(top.tagName)) {
  1687. stack.pop();
  1688. continue;
  1689. } else {
  1690. return null;
  1691. }
  1692. }
  1693. };
  1694. this.getFoldWidgetRange = function(session, foldStyle, row) {
  1695. var firstTag = this._getFirstTagInLine(session, row);
  1696. if (!firstTag)
  1697. return null;
  1698. var isBackward = firstTag.closing || firstTag.selfClosing;
  1699. var stack = [];
  1700. var tag;
  1701. if (!isBackward) {
  1702. var iterator = new TokenIterator(session, row, firstTag.start.column);
  1703. var start = {
  1704. row: row,
  1705. column: firstTag.start.column + firstTag.tagName.length + 2
  1706. };
  1707. if (firstTag.start.row == firstTag.end.row)
  1708. start.column = firstTag.end.column;
  1709. while (tag = this._readTagForward(iterator)) {
  1710. if (tag.selfClosing) {
  1711. if (!stack.length) {
  1712. tag.start.column += tag.tagName.length + 2;
  1713. tag.end.column -= 2;
  1714. return Range.fromPoints(tag.start, tag.end);
  1715. } else
  1716. continue;
  1717. }
  1718. if (tag.closing) {
  1719. this._pop(stack, tag);
  1720. if (stack.length == 0)
  1721. return Range.fromPoints(start, tag.start);
  1722. }
  1723. else {
  1724. stack.push(tag);
  1725. }
  1726. }
  1727. }
  1728. else {
  1729. var iterator = new TokenIterator(session, row, firstTag.end.column);
  1730. var end = {
  1731. row: row,
  1732. column: firstTag.start.column
  1733. };
  1734. while (tag = this._readTagBackward(iterator)) {
  1735. if (tag.selfClosing) {
  1736. if (!stack.length) {
  1737. tag.start.column += tag.tagName.length + 2;
  1738. tag.end.column -= 2;
  1739. return Range.fromPoints(tag.start, tag.end);
  1740. } else
  1741. continue;
  1742. }
  1743. if (!tag.closing) {
  1744. this._pop(stack, tag);
  1745. if (stack.length == 0) {
  1746. tag.start.column += tag.tagName.length + 2;
  1747. if (tag.start.row == tag.end.row && tag.start.column < tag.end.column)
  1748. tag.start.column = tag.end.column;
  1749. return Range.fromPoints(tag.start, end);
  1750. }
  1751. }
  1752. else {
  1753. stack.push(tag);
  1754. }
  1755. }
  1756. }
  1757. };
  1758. }).call(FoldMode.prototype);
  1759. });
  1760. 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) {
  1761. "use strict";
  1762. var oop = require("../../lib/oop");
  1763. var MixedFoldMode = require("./mixed").FoldMode;
  1764. var XmlFoldMode = require("./xml").FoldMode;
  1765. var CStyleFoldMode = require("./cstyle").FoldMode;
  1766. var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
  1767. MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
  1768. "js-": new CStyleFoldMode(),
  1769. "css-": new CStyleFoldMode()
  1770. });
  1771. };
  1772. oop.inherits(FoldMode, MixedFoldMode);
  1773. });
  1774. ace.define("ace/mode/html_completions",["require","exports","module","ace/token_iterator"], function(require, exports, module) {
  1775. "use strict";
  1776. var TokenIterator = require("../token_iterator").TokenIterator;
  1777. var commonAttributes = [
  1778. "accesskey",
  1779. "class",
  1780. "contenteditable",
  1781. "contextmenu",
  1782. "dir",
  1783. "draggable",
  1784. "dropzone",
  1785. "hidden",
  1786. "id",
  1787. "inert",
  1788. "itemid",
  1789. "itemprop",
  1790. "itemref",
  1791. "itemscope",
  1792. "itemtype",
  1793. "lang",
  1794. "spellcheck",
  1795. "style",
  1796. "tabindex",
  1797. "title",
  1798. "translate"
  1799. ];
  1800. var eventAttributes = [
  1801. "onabort",
  1802. "onblur",
  1803. "oncancel",
  1804. "oncanplay",
  1805. "oncanplaythrough",
  1806. "onchange",
  1807. "onclick",
  1808. "onclose",
  1809. "oncontextmenu",
  1810. "oncuechange",
  1811. "ondblclick",
  1812. "ondrag",
  1813. "ondragend",
  1814. "ondragenter",
  1815. "ondragleave",
  1816. "ondragover",
  1817. "ondragstart",
  1818. "ondrop",
  1819. "ondurationchange",
  1820. "onemptied",
  1821. "onended",
  1822. "onerror",
  1823. "onfocus",
  1824. "oninput",
  1825. "oninvalid",
  1826. "onkeydown",
  1827. "onkeypress",
  1828. "onkeyup",
  1829. "onload",
  1830. "onloadeddata",
  1831. "onloadedmetadata",
  1832. "onloadstart",
  1833. "onmousedown",
  1834. "onmousemove",
  1835. "onmouseout",
  1836. "onmouseover",
  1837. "onmouseup",
  1838. "onmousewheel",
  1839. "onpause",
  1840. "onplay",
  1841. "onplaying",
  1842. "onprogress",
  1843. "onratechange",
  1844. "onreset",
  1845. "onscroll",
  1846. "onseeked",
  1847. "onseeking",
  1848. "onselect",
  1849. "onshow",
  1850. "onstalled",
  1851. "onsubmit",
  1852. "onsuspend",
  1853. "ontimeupdate",
  1854. "onvolumechange",
  1855. "onwaiting"
  1856. ];
  1857. var globalAttributes = commonAttributes.concat(eventAttributes);
  1858. var attributeMap = {
  1859. "html": {"manifest": 1},
  1860. "head": {},
  1861. "title": {},
  1862. "base": {"href": 1, "target": 1},
  1863. "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},
  1864. "meta": {"http-equiv": {"content-type": 1}, "name": {"description": 1, "keywords": 1}, "content": {"text/html; charset=UTF-8": 1}, "charset": 1},
  1865. "style": {"type": 1, "media": {"all": 1, "screen": 1, "print": 1}, "scoped": 1},
  1866. "script": {"charset": 1, "type": {"text/javascript": 1}, "src": 1, "defer": 1, "async": 1},
  1867. "noscript": {"href": 1},
  1868. "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},
  1869. "section": {},
  1870. "nav": {},
  1871. "article": {"pubdate": 1},
  1872. "aside": {},
  1873. "h1": {},
  1874. "h2": {},
  1875. "h3": {},
  1876. "h4": {},
  1877. "h5": {},
  1878. "h6": {},
  1879. "header": {},
  1880. "footer": {},
  1881. "address": {},
  1882. "main": {},
  1883. "p": {},
  1884. "hr": {},
  1885. "pre": {},
  1886. "blockquote": {"cite": 1},
  1887. "ol": {"start": 1, "reversed": 1},
  1888. "ul": {},
  1889. "li": {"value": 1},
  1890. "dl": {},
  1891. "dt": {},
  1892. "dd": {},
  1893. "figure": {},
  1894. "figcaption": {},
  1895. "div": {},
  1896. "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},
  1897. "em": {},
  1898. "strong": {},
  1899. "small": {},
  1900. "s": {},
  1901. "cite": {},
  1902. "q": {"cite": 1},
  1903. "dfn": {},
  1904. "abbr": {},
  1905. "data": {},
  1906. "time": {"datetime": 1},
  1907. "code": {},
  1908. "var": {},
  1909. "samp": {},
  1910. "kbd": {},
  1911. "sub": {},
  1912. "sup": {},
  1913. "i": {},
  1914. "b": {},
  1915. "u": {},
  1916. "mark": {},
  1917. "ruby": {},
  1918. "rt": {},
  1919. "rp": {},
  1920. "bdi": {},
  1921. "bdo": {},
  1922. "span": {},
  1923. "br": {},
  1924. "wbr": {},
  1925. "ins": {"cite": 1, "datetime": 1},
  1926. "del": {"cite": 1, "datetime": 1},
  1927. "img": {"alt": 1, "src": 1, "height": 1, "width": 1, "usemap": 1, "ismap": 1},
  1928. "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}},
  1929. "embed": {"src": 1, "height": 1, "width": 1, "type": 1},
  1930. "object": {"param": 1, "data": 1, "type": 1, "height" : 1, "width": 1, "usemap": 1, "name": 1, "form": 1, "classid": 1},
  1931. "param": {"name": 1, "value": 1},
  1932. "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}},
  1933. "audio": {"src": 1, "autobuffer": 1, "autoplay": {"autoplay": 1}, "loop": {"loop": 1}, "controls": {"controls": 1}, "muted": {"muted": 1}, "preload": {"auto": 1, "metadata": 1, "none": 1 }},
  1934. "source": {"src": 1, "type": 1, "media": 1},
  1935. "track": {"kind": 1, "src": 1, "srclang": 1, "label": 1, "default": 1},
  1936. "canvas": {"width": 1, "height": 1},
  1937. "map": {"name": 1},
  1938. "area": {"shape": 1, "coords": 1, "href": 1, "hreflang": 1, "alt": 1, "target": 1, "media": 1, "rel": 1, "ping": 1, "type": 1},
  1939. "svg": {},
  1940. "math": {},
  1941. "table": {"summary": 1},
  1942. "caption": {},
  1943. "colgroup": {"span": 1},
  1944. "col": {"span": 1},
  1945. "tbody": {},
  1946. "thead": {},
  1947. "tfoot": {},
  1948. "tr": {},
  1949. "td": {"headers": 1, "rowspan": 1, "colspan": 1},
  1950. "th": {"headers": 1, "rowspan": 1, "colspan": 1, "scope": 1},
  1951. "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}},
  1952. "fieldset": {"disabled": 1, "form": 1, "name": 1},
  1953. "legend": {},
  1954. "label": {"form": 1, "for": 1},
  1955. "input": {
  1956. "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},
  1957. "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},
  1958. "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}},
  1959. "select": {"autofocus": 1, "disabled": 1, "form": 1, "multiple": {"multiple": 1}, "name": 1, "size": 1, "readonly":{"readonly": 1}},
  1960. "datalist": {},
  1961. "optgroup": {"disabled": 1, "label": 1},
  1962. "option": {"disabled": 1, "selected": 1, "label": 1, "value": 1},
  1963. "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}},
  1964. "keygen": {"autofocus": 1, "challenge": {"challenge": 1}, "disabled": {"disabled": 1}, "form": 1, "keytype": {"rsa": 1, "dsa": 1, "ec": 1}, "name": 1},
  1965. "output": {"for": 1, "form": 1, "name": 1},
  1966. "progress": {"value": 1, "max": 1},
  1967. "meter": {"value": 1, "min": 1, "max": 1, "low": 1, "high": 1, "optimum": 1},
  1968. "details": {"open": 1},
  1969. "summary": {},
  1970. "command": {"type": 1, "label": 1, "icon": 1, "disabled": 1, "checked": 1, "radiogroup": 1, "command": 1},
  1971. "menu": {"type": 1, "label": 1},
  1972. "dialog": {"open": 1}
  1973. };
  1974. var elements = Object.keys(attributeMap);
  1975. function is(token, type) {
  1976. return token.type.lastIndexOf(type + ".xml") > -1;
  1977. }
  1978. function findTagName(session, pos) {
  1979. var iterator = new TokenIterator(session, pos.row, pos.column);
  1980. var token = iterator.getCurrentToken();
  1981. while (token && !is(token, "tag-name")){
  1982. token = iterator.stepBackward();
  1983. }
  1984. if (token)
  1985. return token.value;
  1986. }
  1987. function findAttributeName(session, pos) {
  1988. var iterator = new TokenIterator(session, pos.row, pos.column);
  1989. var token = iterator.getCurrentToken();
  1990. while (token && !is(token, "attribute-name")){
  1991. token = iterator.stepBackward();
  1992. }
  1993. if (token)
  1994. return token.value;
  1995. }
  1996. var HtmlCompletions = function() {
  1997. };
  1998. (function() {
  1999. this.getCompletions = function(state, session, pos, prefix) {
  2000. var token = session.getTokenAt(pos.row, pos.column);
  2001. if (!token)
  2002. return [];
  2003. if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
  2004. return this.getTagCompletions(state, session, pos, prefix);
  2005. if (is(token, "tag-whitespace") || is(token, "attribute-name"))
  2006. return this.getAttributeCompletions(state, session, pos, prefix);
  2007. if (is(token, "attribute-value"))
  2008. return this.getAttributeValueCompletions(state, session, pos, prefix);
  2009. var line = session.getLine(pos.row).substr(0, pos.column);
  2010. if (/&[a-z]*$/i.test(line))
  2011. return this.getHTMLEntityCompletions(state, session, pos, prefix);
  2012. return [];
  2013. };
  2014. this.getTagCompletions = function(state, session, pos, prefix) {
  2015. return elements.map(function(element){
  2016. return {
  2017. value: element,
  2018. meta: "tag",
  2019. score: Number.MAX_VALUE
  2020. };
  2021. });
  2022. };
  2023. this.getAttributeCompletions = function(state, session, pos, prefix) {
  2024. var tagName = findTagName(session, pos);
  2025. if (!tagName)
  2026. return [];
  2027. var attributes = globalAttributes;
  2028. if (tagName in attributeMap) {
  2029. attributes = attributes.concat(Object.keys(attributeMap[tagName]));
  2030. }
  2031. return attributes.map(function(attribute){
  2032. return {
  2033. caption: attribute,
  2034. snippet: attribute + '="$0"',
  2035. meta: "attribute",
  2036. score: Number.MAX_VALUE
  2037. };
  2038. });
  2039. };
  2040. this.getAttributeValueCompletions = function(state, session, pos, prefix) {
  2041. var tagName = findTagName(session, pos);
  2042. var attributeName = findAttributeName(session, pos);
  2043. if (!tagName)
  2044. return [];
  2045. var values = [];
  2046. if (tagName in attributeMap && attributeName in attributeMap[tagName] && typeof attributeMap[tagName][attributeName] === "object") {
  2047. values = Object.keys(attributeMap[tagName][attributeName]);
  2048. }
  2049. return values.map(function(value){
  2050. return {
  2051. caption: value,
  2052. snippet: value,
  2053. meta: "attribute value",
  2054. score: Number.MAX_VALUE
  2055. };
  2056. });
  2057. };
  2058. this.getHTMLEntityCompletions = function(state, session, pos, prefix) {
  2059. 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;'];
  2060. return values.map(function(value){
  2061. return {
  2062. caption: value,
  2063. snippet: value,
  2064. meta: "html entity",
  2065. score: Number.MAX_VALUE
  2066. };
  2067. });
  2068. };
  2069. }).call(HtmlCompletions.prototype);
  2070. exports.HtmlCompletions = HtmlCompletions;
  2071. });
  2072. 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) {
  2073. "use strict";
  2074. var oop = require("../lib/oop");
  2075. var lang = require("../lib/lang");
  2076. var TextMode = require("./text").Mode;
  2077. var JavaScriptMode = require("./javascript").Mode;
  2078. var CssMode = require("./css").Mode;
  2079. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2080. var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
  2081. var HtmlFoldMode = require("./folding/html").FoldMode;
  2082. var HtmlCompletions = require("./html_completions").HtmlCompletions;
  2083. var WorkerClient = require("../worker/worker_client").WorkerClient;
  2084. var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "menuitem", "param", "source", "track", "wbr"];
  2085. var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
  2086. var Mode = function(options) {
  2087. this.fragmentContext = options && options.fragmentContext;
  2088. this.HighlightRules = HtmlHighlightRules;
  2089. this.$behaviour = new XmlBehaviour();
  2090. this.$completer = new HtmlCompletions();
  2091. this.createModeDelegates({
  2092. "js-": JavaScriptMode,
  2093. "css-": CssMode
  2094. });
  2095. this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
  2096. };
  2097. oop.inherits(Mode, TextMode);
  2098. (function() {
  2099. this.blockComment = {start: "<!--", end: "-->"};
  2100. this.voidElements = lang.arrayToMap(voidElements);
  2101. this.getNextLineIndent = function(state, line, tab) {
  2102. return this.$getIndent(line);
  2103. };
  2104. this.checkOutdent = function(state, line, input) {
  2105. return false;
  2106. };
  2107. this.getCompletions = function(state, session, pos, prefix) {
  2108. return this.$completer.getCompletions(state, session, pos, prefix);
  2109. };
  2110. this.createWorker = function(session) {
  2111. if (this.constructor != Mode)
  2112. return;
  2113. var worker = new WorkerClient(["ace"], "ace/mode/html_worker", "Worker");
  2114. worker.attachToDocument(session.getDocument());
  2115. if (this.fragmentContext)
  2116. worker.call("setOptions", [{context: this.fragmentContext}]);
  2117. worker.on("error", function(e) {
  2118. session.setAnnotations(e.data);
  2119. });
  2120. worker.on("terminate", function() {
  2121. session.clearAnnotations();
  2122. });
  2123. return worker;
  2124. };
  2125. this.$id = "ace/mode/html";
  2126. }).call(Mode.prototype);
  2127. exports.Mode = Mode;
  2128. });
  2129. ace.define("ace/mode/smarty_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules"], function(require, exports, module) {
  2130. "use strict";
  2131. var oop = require("../lib/oop");
  2132. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  2133. var SmartyHighlightRules = function() {
  2134. HtmlHighlightRules.call(this);
  2135. var smartyRules = { start:
  2136. [ { include: '#comments' },
  2137. { include: '#blocks' } ],
  2138. '#blocks':
  2139. [ { token: 'punctuation.section.embedded.begin.smarty',
  2140. regex: '\\{%?',
  2141. push:
  2142. [ { token: 'punctuation.section.embedded.end.smarty',
  2143. regex: '%?\\}',
  2144. next: 'pop' },
  2145. { include: '#strings' },
  2146. { include: '#variables' },
  2147. { include: '#lang' },
  2148. { defaultToken: 'source.smarty' } ] } ],
  2149. '#comments':
  2150. [ { token:
  2151. [ 'punctuation.definition.comment.smarty',
  2152. 'comment.block.smarty' ],
  2153. regex: '(\\{%?)(\\*)',
  2154. push:
  2155. [ { token: 'comment.block.smarty', regex: '\\*%?\\}', next: 'pop' },
  2156. { defaultToken: 'comment.block.smarty' } ] } ],
  2157. '#lang':
  2158. [ { token: 'keyword.operator.smarty',
  2159. regex: '(?:!=|!|<=|>=|<|>|===|==|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod)\\b' },
  2160. { token: 'constant.language.smarty',
  2161. regex: '\\b(?:TRUE|FALSE|true|false)\\b' },
  2162. { token: 'keyword.control.smarty',
  2163. regex: '\\b(?:if|else|elseif|foreach|foreachelse|section|switch|case|break|default)\\b' },
  2164. { token: 'variable.parameter.smarty', regex: '\\b[a-zA-Z]+=' },
  2165. { token: 'support.function.built-in.smarty',
  2166. regex: '\\b(?:capture|config_load|counter|cycle|debug|eval|fetch|include_php|include|insert|literal|math|strip|rdelim|ldelim|assign|constant|block|html_[a-z_]*)\\b' },
  2167. { token: 'support.function.variable-modifier.smarty',
  2168. regex: '\\|(?:capitalize|cat|count_characters|count_paragraphs|count_sentences|count_words|date_format|default|escape|indent|lower|nl2br|regex_replace|replace|spacify|string_format|strip_tags|strip|truncate|upper|wordwrap)' } ],
  2169. '#strings':
  2170. [ { token: 'punctuation.definition.string.begin.smarty',
  2171. regex: '\'',
  2172. push:
  2173. [ { token: 'punctuation.definition.string.end.smarty',
  2174. regex: '\'',
  2175. next: 'pop' },
  2176. { token: 'constant.character.escape.smarty', regex: '\\\\.' },
  2177. { defaultToken: 'string.quoted.single.smarty' } ] },
  2178. { token: 'punctuation.definition.string.begin.smarty',
  2179. regex: '"',
  2180. push:
  2181. [ { token: 'punctuation.definition.string.end.smarty',
  2182. regex: '"',
  2183. next: 'pop' },
  2184. { token: 'constant.character.escape.smarty', regex: '\\\\.' },
  2185. { defaultToken: 'string.quoted.double.smarty' } ] } ],
  2186. '#variables':
  2187. [ { token:
  2188. [ 'punctuation.definition.variable.smarty',
  2189. 'variable.other.global.smarty' ],
  2190. regex: '\\b(\\$)(Smarty\\.)' },
  2191. { token:
  2192. [ 'punctuation.definition.variable.smarty',
  2193. 'variable.other.smarty' ],
  2194. regex: '(\\$)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
  2195. { token: [ 'keyword.operator.smarty', 'variable.other.property.smarty' ],
  2196. regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b' },
  2197. { token:
  2198. [ 'keyword.operator.smarty',
  2199. 'meta.function-call.object.smarty',
  2200. 'punctuation.definition.variable.smarty',
  2201. 'variable.other.smarty',
  2202. 'punctuation.definition.variable.smarty' ],
  2203. regex: '(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))' } ] }
  2204. var smartyStart = smartyRules.start;
  2205. for (var rule in this.$rules) {
  2206. this.$rules[rule].unshift.apply(this.$rules[rule], smartyStart);
  2207. }
  2208. Object.keys(smartyRules).forEach(function(x) {
  2209. if (!this.$rules[x])
  2210. this.$rules[x] = smartyRules[x];
  2211. }, this);
  2212. this.normalizeRules();
  2213. };
  2214. SmartyHighlightRules.metaData = { fileTypes: [ 'tpl' ],
  2215. foldingStartMarker: '\\{%?',
  2216. foldingStopMarker: '%?\\}',
  2217. name: 'Smarty',
  2218. scopeName: 'text.html.smarty' }
  2219. oop.inherits(SmartyHighlightRules, HtmlHighlightRules);
  2220. exports.SmartyHighlightRules = SmartyHighlightRules;
  2221. });
  2222. ace.define("ace/mode/smarty",["require","exports","module","ace/lib/oop","ace/mode/html","ace/mode/smarty_highlight_rules"], function(require, exports, module) {
  2223. "use strict";
  2224. var oop = require("../lib/oop");
  2225. var HtmlMode = require("./html").Mode;
  2226. var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules;
  2227. var Mode = function() {
  2228. HtmlMode.call(this);
  2229. this.HighlightRules = SmartyHighlightRules;
  2230. };
  2231. oop.inherits(Mode, HtmlMode);
  2232. (function() {
  2233. this.$id = "ace/mode/smarty";
  2234. }).call(Mode.prototype);
  2235. exports.Mode = Mode;
  2236. });