mode-jsp.js 59 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  1. ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var lang = require("../lib/lang");
  5. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  6. var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|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. ace.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. ace.define("ace/mode/javascript_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
  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. ace.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. 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) {
  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. ace.define("ace/mode/java_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
  934. "use strict";
  935. var oop = require("../lib/oop");
  936. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  937. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  938. var JavaHighlightRules = function() {
  939. var keywords = (
  940. "abstract|continue|for|new|switch|" +
  941. "assert|default|goto|package|synchronized|" +
  942. "boolean|do|if|private|this|" +
  943. "break|double|implements|protected|throw|" +
  944. "byte|else|import|public|throws|" +
  945. "case|enum|instanceof|return|transient|" +
  946. "catch|extends|int|short|try|" +
  947. "char|final|interface|static|void|" +
  948. "class|finally|long|strictfp|volatile|" +
  949. "const|float|native|super|while|" +
  950. "var"
  951. );
  952. var buildinConstants = ("null|Infinity|NaN|undefined");
  953. var langClasses = (
  954. "AbstractMethodError|AssertionError|ClassCircularityError|"+
  955. "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
  956. "ExceptionInInitializerError|IllegalAccessError|"+
  957. "IllegalThreadStateException|InstantiationError|InternalError|"+
  958. "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
  959. "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
  960. "SuppressWarnings|TypeNotPresentException|UnknownError|"+
  961. "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
  962. "InstantiationException|IndexOutOfBoundsException|"+
  963. "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
  964. "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
  965. "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
  966. "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
  967. "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
  968. "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
  969. "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
  970. "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
  971. "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
  972. "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
  973. "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
  974. "ArrayStoreException|ClassCastException|LinkageError|"+
  975. "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
  976. "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
  977. "Cloneable|Class|CharSequence|Comparable|String|Object"
  978. );
  979. var keywordMapper = this.createKeywordMapper({
  980. "variable.language": "this",
  981. "keyword": keywords,
  982. "constant.language": buildinConstants,
  983. "support.function": langClasses
  984. }, "identifier");
  985. this.$rules = {
  986. "start" : [
  987. {
  988. token : "comment",
  989. regex : "\\/\\/.*$"
  990. },
  991. DocCommentHighlightRules.getStartRule("doc-start"),
  992. {
  993. token : "comment", // multi line comment
  994. regex : "\\/\\*",
  995. next : "comment"
  996. }, {
  997. token : "string", // single line
  998. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  999. }, {
  1000. token : "string", // single line
  1001. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  1002. }, {
  1003. token : "constant.numeric", // hex
  1004. regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
  1005. }, {
  1006. token : "constant.numeric", // float
  1007. regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
  1008. }, {
  1009. token : "constant.language.boolean",
  1010. regex : "(?:true|false)\\b"
  1011. }, {
  1012. regex: "(open(?:\\s+))?module(?=\\s*\\w)",
  1013. token: "keyword",
  1014. next: [{
  1015. regex: "{",
  1016. token: "paren.lparen",
  1017. next: [{
  1018. regex: "}",
  1019. token: "paren.rparen",
  1020. next: "start"
  1021. }, {
  1022. regex: "\\b(requires|transitive|exports|opens|to|uses|provides|with)\\b",
  1023. token: "keyword"
  1024. }]
  1025. }, {
  1026. token : "text",
  1027. regex : "\\s+"
  1028. }, {
  1029. token : "identifier",
  1030. regex : "\\w+"
  1031. }, {
  1032. token : "punctuation.operator",
  1033. regex : "."
  1034. }, {
  1035. token : "text",
  1036. regex : "\\s+"
  1037. }, {
  1038. regex: "", // exit if there is anything else
  1039. next: "start"
  1040. }]
  1041. }, {
  1042. token : keywordMapper,
  1043. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  1044. }, {
  1045. token : "keyword.operator",
  1046. regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
  1047. }, {
  1048. token : "lparen",
  1049. regex : "[[({]"
  1050. }, {
  1051. token : "rparen",
  1052. regex : "[\\])}]"
  1053. }, {
  1054. token : "text",
  1055. regex : "\\s+"
  1056. }
  1057. ],
  1058. "comment" : [
  1059. {
  1060. token : "comment", // closing comment
  1061. regex : "\\*\\/",
  1062. next : "start"
  1063. }, {
  1064. defaultToken : "comment"
  1065. }
  1066. ]
  1067. };
  1068. this.embedRules(DocCommentHighlightRules, "doc-",
  1069. [ DocCommentHighlightRules.getEndRule("start") ]);
  1070. this.normalizeRules();
  1071. };
  1072. oop.inherits(JavaHighlightRules, TextHighlightRules);
  1073. exports.JavaHighlightRules = JavaHighlightRules;
  1074. });
  1075. ace.define("ace/mode/jsp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/html_highlight_rules","ace/mode/java_highlight_rules"], function(require, exports, module) {
  1076. "use strict";
  1077. var oop = require("../lib/oop");
  1078. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  1079. var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
  1080. var JspHighlightRules = function() {
  1081. HtmlHighlightRules.call(this);
  1082. var builtinVariables = 'request|response|out|session|' +
  1083. 'application|config|pageContext|page|Exception';
  1084. var keywords = 'page|include|taglib';
  1085. var startRules = [
  1086. {
  1087. token : "comment",
  1088. regex : "<%--",
  1089. push : "jsp-dcomment"
  1090. }, {
  1091. token : "meta.tag", // jsp open tag
  1092. regex : "<%@?|<%=?|<%!?|<jsp:[^>]+>",
  1093. push : "jsp-start"
  1094. }
  1095. ];
  1096. var endRules = [
  1097. {
  1098. token : "meta.tag", // jsp close tag
  1099. regex : "%>|<\\/jsp:[^>]+>",
  1100. next : "pop"
  1101. }, {
  1102. token: "variable.language",
  1103. regex : builtinVariables
  1104. }, {
  1105. token: "keyword",
  1106. regex : keywords
  1107. }
  1108. ];
  1109. for (var key in this.$rules)
  1110. this.$rules[key].unshift.apply(this.$rules[key], startRules);
  1111. this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
  1112. this.addRules({
  1113. "jsp-dcomment" : [{
  1114. token : "comment",
  1115. regex : ".*?--%>",
  1116. next : "pop"
  1117. }]
  1118. });
  1119. this.normalizeRules();
  1120. };
  1121. oop.inherits(JspHighlightRules, HtmlHighlightRules);
  1122. exports.JspHighlightRules = JspHighlightRules;
  1123. });
  1124. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  1125. "use strict";
  1126. var Range = require("../range").Range;
  1127. var MatchingBraceOutdent = function() {};
  1128. (function() {
  1129. this.checkOutdent = function(line, input) {
  1130. if (! /^\s+$/.test(line))
  1131. return false;
  1132. return /^\s*\}/.test(input);
  1133. };
  1134. this.autoOutdent = function(doc, row) {
  1135. var line = doc.getLine(row);
  1136. var match = line.match(/^(\s*\})/);
  1137. if (!match) return 0;
  1138. var column = match[1].length;
  1139. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  1140. if (!openBracePos || openBracePos.row == row) return 0;
  1141. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  1142. doc.replace(new Range(row, 0, row, column-1), indent);
  1143. };
  1144. this.$getIndent = function(line) {
  1145. return line.match(/^\s*/)[0];
  1146. };
  1147. }).call(MatchingBraceOutdent.prototype);
  1148. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  1149. });
  1150. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1151. "use strict";
  1152. var oop = require("../../lib/oop");
  1153. var Range = require("../../range").Range;
  1154. var BaseFoldMode = require("./fold_mode").FoldMode;
  1155. var FoldMode = exports.FoldMode = function(commentRegex) {
  1156. if (commentRegex) {
  1157. this.foldingStartMarker = new RegExp(
  1158. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  1159. );
  1160. this.foldingStopMarker = new RegExp(
  1161. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  1162. );
  1163. }
  1164. };
  1165. oop.inherits(FoldMode, BaseFoldMode);
  1166. (function() {
  1167. this.foldingStartMarker = /([\{\[\(])[^\}\]\)]*$|^\s*(\/\*)/;
  1168. this.foldingStopMarker = /^[^\[\{\(]*([\}\]\)])|^[\s\*]*(\*\/)/;
  1169. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  1170. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  1171. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  1172. this._getFoldWidgetBase = this.getFoldWidget;
  1173. this.getFoldWidget = function(session, foldStyle, row) {
  1174. var line = session.getLine(row);
  1175. if (this.singleLineBlockCommentRe.test(line)) {
  1176. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  1177. return "";
  1178. }
  1179. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  1180. if (!fw && this.startRegionRe.test(line))
  1181. return "start"; // lineCommentRegionStart
  1182. return fw;
  1183. };
  1184. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  1185. var line = session.getLine(row);
  1186. if (this.startRegionRe.test(line))
  1187. return this.getCommentRegionBlock(session, line, row);
  1188. var match = line.match(this.foldingStartMarker);
  1189. if (match) {
  1190. var i = match.index;
  1191. if (match[1])
  1192. return this.openingBracketBlock(session, match[1], row, i);
  1193. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  1194. if (range && !range.isMultiLine()) {
  1195. if (forceMultiline) {
  1196. range = this.getSectionRange(session, row);
  1197. } else if (foldStyle != "all")
  1198. range = null;
  1199. }
  1200. return range;
  1201. }
  1202. if (foldStyle === "markbegin")
  1203. return;
  1204. var match = line.match(this.foldingStopMarker);
  1205. if (match) {
  1206. var i = match.index + match[0].length;
  1207. if (match[1])
  1208. return this.closingBracketBlock(session, match[1], row, i);
  1209. return session.getCommentFoldRange(row, i, -1);
  1210. }
  1211. };
  1212. this.getSectionRange = function(session, row) {
  1213. var line = session.getLine(row);
  1214. var startIndent = line.search(/\S/);
  1215. var startRow = row;
  1216. var startColumn = line.length;
  1217. row = row + 1;
  1218. var endRow = row;
  1219. var maxRow = session.getLength();
  1220. while (++row < maxRow) {
  1221. line = session.getLine(row);
  1222. var indent = line.search(/\S/);
  1223. if (indent === -1)
  1224. continue;
  1225. if (startIndent > indent)
  1226. break;
  1227. var subRange = this.getFoldWidgetRange(session, "all", row);
  1228. if (subRange) {
  1229. if (subRange.start.row <= startRow) {
  1230. break;
  1231. } else if (subRange.isMultiLine()) {
  1232. row = subRange.end.row;
  1233. } else if (startIndent == indent) {
  1234. break;
  1235. }
  1236. }
  1237. endRow = row;
  1238. }
  1239. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1240. };
  1241. this.getCommentRegionBlock = function(session, line, row) {
  1242. var startColumn = line.search(/\s*$/);
  1243. var maxRow = session.getLength();
  1244. var startRow = row;
  1245. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1246. var depth = 1;
  1247. while (++row < maxRow) {
  1248. line = session.getLine(row);
  1249. var m = re.exec(line);
  1250. if (!m) continue;
  1251. if (m[1]) depth--;
  1252. else depth++;
  1253. if (!depth) break;
  1254. }
  1255. var endRow = row;
  1256. if (endRow > startRow) {
  1257. return new Range(startRow, startColumn, endRow, line.length);
  1258. }
  1259. };
  1260. }).call(FoldMode.prototype);
  1261. });
  1262. ace.define("ace/mode/jsp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/jsp_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
  1263. "use strict";
  1264. var oop = require("../lib/oop");
  1265. var TextMode = require("./text").Mode;
  1266. var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
  1267. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1268. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  1269. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1270. var Mode = function() {
  1271. this.HighlightRules = JspHighlightRules;
  1272. this.$outdent = new MatchingBraceOutdent();
  1273. this.$behaviour = new CstyleBehaviour();
  1274. this.foldingRules = new CStyleFoldMode();
  1275. };
  1276. oop.inherits(Mode, TextMode);
  1277. (function() {
  1278. this.$id = "ace/mode/jsp";
  1279. this.snippetFileId = "ace/snippets/jsp";
  1280. }).call(Mode.prototype);
  1281. exports.Mode = Mode;
  1282. }); (function() {
  1283. ace.require(["ace/mode/jsp"], function(m) {
  1284. if (typeof module == "object" && typeof exports == "object" && module) {
  1285. module.exports = m;
  1286. }
  1287. });
  1288. })();