mode-jade.js 79 KB

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