mode-jade.js 84 KB

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