279a2126957722bd396f011c41d616f2.js 87 KB

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