mode-jsp.js 67 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586
  1. define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
  2. "use strict";
  3. var oop = require("../lib/oop");
  4. var lang = require("../lib/lang");
  5. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  6. var supportType = exports.supportType = "animation-fill-mode|alignment-adjust|alignment-baseline|animation-delay|animation-direction|animation-duration|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|animation|appearance|azimuth|backface-visibility|background-attachment|background-break|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|background|baseline-shift|binding|bleed|bookmark-label|bookmark-level|bookmark-state|bookmark-target|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|border|bottom|box-align|box-decoration-break|box-direction|box-flex-group|box-flex|box-lines|box-ordinal-group|box-orient|box-pack|box-shadow|box-sizing|break-after|break-before|break-inside|caption-side|clear|clip|color-profile|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|crop|cue-after|cue-before|cue|cursor|direction|display|dominant-baseline|drop-initial-after-adjust|drop-initial-after-align|drop-initial-before-adjust|drop-initial-before-align|drop-initial-size|drop-initial-value|elevation|empty-cells|fit|fit-position|float-offset|float|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|font|grid-columns|grid-rows|hanging-punctuation|height|hyphenate-after|hyphenate-before|hyphenate-character|hyphenate-lines|hyphenate-resource|hyphens|icon|image-orientation|image-rendering|image-resolution|inline-box-align|left|letter-spacing|line-height|line-stacking-ruby|line-stacking-shift|line-stacking-strategy|line-stacking|list-style-image|list-style-position|list-style-type|list-style|margin-bottom|margin-left|margin-right|margin-top|margin|mark-after|mark-before|mark|marks|marquee-direction|marquee-play-count|marquee-speed|marquee-style|max-height|max-width|min-height|min-width|move-to|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|orphans|outline-color|outline-offset|outline-style|outline-width|outline|overflow-style|overflow-x|overflow-y|overflow|padding-bottom|padding-left|padding-right|padding-top|padding|page-break-after|page-break-before|page-break-inside|page-policy|page|pause-after|pause-before|pause|perspective-origin|perspective|phonemes|pitch-range|pitch|play-during|pointer-events|position|presentation-level|punctuation-trim|quotes|rendering-intent|resize|rest-after|rest-before|rest|richness|right|rotation-point|rotation|ruby-align|ruby-overhang|ruby-position|ruby-span|size|speak-header|speak-numeral|speak-punctuation|speak|speech-rate|stress|string-set|table-layout|target-name|target-new|target-position|target|text-align-last|text-align|text-decoration|text-emphasis|text-height|text-indent|text-justify|text-outline|text-shadow|text-transform|text-wrap|top|transform-origin|transform-style|transform|transition-delay|transition-duration|transition-property|transition-timing-function|transition|unicode-bidi|vertical-align|visibility|voice-balance|voice-duration|voice-family|voice-pitch-range|voice-pitch|voice-rate|voice-stress|voice-volume|volume|white-space-collapse|white-space|widows|width|word-break|word-spacing|word-wrap|z-index";
  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";
  9. var supportConstantColor = exports.supportConstantColor = "aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow";
  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. token : "comment", // multi line comment
  25. regex : "\\/\\*",
  26. push : "comment"
  27. }, {
  28. token: "paren.lparen",
  29. regex: "\\{",
  30. push: "ruleset"
  31. }, {
  32. token: "string",
  33. regex: "@.*?{",
  34. push: "media"
  35. }, {
  36. token: "keyword",
  37. regex: "#[a-z0-9-_]+"
  38. }, {
  39. token: "variable",
  40. regex: "\\.[a-z0-9-_]+"
  41. }, {
  42. token: "string",
  43. regex: ":[a-z0-9-_]+"
  44. }, {
  45. token: "constant",
  46. regex: "[a-z0-9-_]+"
  47. }, {
  48. caseInsensitive: true
  49. }],
  50. "media" : [{
  51. token : "comment", // multi line comment
  52. regex : "\\/\\*",
  53. push : "comment"
  54. }, {
  55. token: "paren.lparen",
  56. regex: "\\{",
  57. push: "ruleset"
  58. }, {
  59. token: "string",
  60. regex: "\\}",
  61. next: "pop"
  62. }, {
  63. token: "keyword",
  64. regex: "#[a-z0-9-_]+"
  65. }, {
  66. token: "variable",
  67. regex: "\\.[a-z0-9-_]+"
  68. }, {
  69. token: "string",
  70. regex: ":[a-z0-9-_]+"
  71. }, {
  72. token: "constant",
  73. regex: "[a-z0-9-_]+"
  74. }, {
  75. caseInsensitive: true
  76. }],
  77. "comment" : [{
  78. token : "comment",
  79. regex : "\\*\\/",
  80. next : "pop"
  81. }, {
  82. defaultToken : "comment"
  83. }],
  84. "ruleset" : [
  85. {
  86. token : "paren.rparen",
  87. regex : "\\}",
  88. next: "pop"
  89. }, {
  90. token : "comment", // multi line comment
  91. regex : "\\/\\*",
  92. push : "comment"
  93. }, {
  94. token : "string", // single line
  95. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  96. }, {
  97. token : "string", // single line
  98. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  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|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. token : ["support.function", "string", "support.function"],
  119. regex : "(url\\()(.*)(\\))"
  120. }, {
  121. token : keywordMapper,
  122. regex : "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*"
  123. }, {
  124. caseInsensitive: true
  125. }]
  126. };
  127. this.normalizeRules();
  128. };
  129. oop.inherits(CssHighlightRules, TextHighlightRules);
  130. exports.CssHighlightRules = CssHighlightRules;
  131. });
  132. define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  133. "use strict";
  134. var oop = require("../lib/oop");
  135. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  136. var DocCommentHighlightRules = function() {
  137. this.$rules = {
  138. "start" : [ {
  139. token : "comment.doc.tag",
  140. regex : "@[\\w\\d_]+" // TODO: fix email addresses
  141. },
  142. DocCommentHighlightRules.getTagRule(),
  143. {
  144. defaultToken : "comment.doc",
  145. caseInsensitive: true
  146. }]
  147. };
  148. };
  149. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  150. DocCommentHighlightRules.getTagRule = function(start) {
  151. return {
  152. token : "comment.doc.tag.storage.type",
  153. regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
  154. };
  155. }
  156. DocCommentHighlightRules.getStartRule = function(start) {
  157. return {
  158. token : "comment.doc", // doc comment
  159. regex : "\\/\\*(?=\\*)",
  160. next : start
  161. };
  162. };
  163. DocCommentHighlightRules.getEndRule = function (start) {
  164. return {
  165. token : "comment.doc", // closing comment
  166. regex : "\\*\\/",
  167. next : start
  168. };
  169. };
  170. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  171. });
  172. 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) {
  173. "use strict";
  174. var oop = require("../lib/oop");
  175. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  176. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  177. var JavaScriptHighlightRules = function(options) {
  178. var keywordMapper = this.createKeywordMapper({
  179. "variable.language":
  180. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  181. "Namespace|QName|XML|XMLList|" + // E4X
  182. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  183. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  184. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  185. "SyntaxError|TypeError|URIError|" +
  186. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  187. "isNaN|parseFloat|parseInt|" +
  188. "JSON|Math|" + // Other
  189. "this|arguments|prototype|window|document" , // Pseudo
  190. "keyword":
  191. "const|yield|import|get|set|" +
  192. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  193. "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  194. "__parent__|__count__|escape|unescape|with|__proto__|" +
  195. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  196. "storage.type":
  197. "const|let|var|function",
  198. "constant.language":
  199. "null|Infinity|NaN|undefined",
  200. "support.function":
  201. "alert",
  202. "constant.language.boolean": "true|false"
  203. }, "identifier");
  204. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  205. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
  206. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  207. "u[0-9a-fA-F]{4}|" + // unicode
  208. "[0-2][0-7]{0,2}|" + // oct
  209. "3[0-6][0-7]?|" + // oct
  210. "37[0-7]?|" + // oct
  211. "[4-7][0-7]?|" + //oct
  212. ".)";
  213. this.$rules = {
  214. "no_regex" : [
  215. {
  216. token : "comment",
  217. regex : "\\/\\/",
  218. next : "line_comment"
  219. },
  220. DocCommentHighlightRules.getStartRule("doc-start"),
  221. {
  222. token : "comment", // multi line comment
  223. regex : /\/\*/,
  224. next : "comment"
  225. }, {
  226. token : "string",
  227. regex : "'(?=.)",
  228. next : "qstring"
  229. }, {
  230. token : "string",
  231. regex : '"(?=.)',
  232. next : "qqstring"
  233. }, {
  234. token : "constant.numeric", // hex
  235. regex : /0[xX][0-9a-fA-F]+\b/
  236. }, {
  237. token : "constant.numeric", // float
  238. regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
  239. }, {
  240. token : [
  241. "storage.type", "punctuation.operator", "support.function",
  242. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  243. ],
  244. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  245. next: "function_arguments"
  246. }, {
  247. token : [
  248. "storage.type", "punctuation.operator", "entity.name.function", "text",
  249. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  250. ],
  251. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  252. next: "function_arguments"
  253. }, {
  254. token : [
  255. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  256. "text", "paren.lparen"
  257. ],
  258. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  259. next: "function_arguments"
  260. }, {
  261. token : [
  262. "storage.type", "punctuation.operator", "entity.name.function", "text",
  263. "keyword.operator", "text",
  264. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  265. ],
  266. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  267. next: "function_arguments"
  268. }, {
  269. token : [
  270. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  271. ],
  272. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  273. next: "function_arguments"
  274. }, {
  275. token : [
  276. "entity.name.function", "text", "punctuation.operator",
  277. "text", "storage.type", "text", "paren.lparen"
  278. ],
  279. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  280. next: "function_arguments"
  281. }, {
  282. token : [
  283. "text", "text", "storage.type", "text", "paren.lparen"
  284. ],
  285. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  286. next: "function_arguments"
  287. }, {
  288. token : "keyword",
  289. regex : "(?:" + kwBeforeRe + ")\\b",
  290. next : "start"
  291. }, {
  292. token : ["punctuation.operator", "support.function"],
  293. 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(?=\()/
  294. }, {
  295. token : ["punctuation.operator", "support.function.dom"],
  296. 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(?=\()/
  297. }, {
  298. token : ["punctuation.operator", "support.constant"],
  299. 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/
  300. }, {
  301. token : ["support.constant"],
  302. regex : /that\b/
  303. }, {
  304. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  305. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  306. }, {
  307. token : keywordMapper,
  308. regex : identifierRe
  309. }, {
  310. token : "keyword.operator",
  311. regex : /--|\+\+|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|[!$%&*+\-~\/^]=?/,
  312. next : "start"
  313. }, {
  314. token : "punctuation.operator",
  315. regex : /[?:,;.]/,
  316. next : "start"
  317. }, {
  318. token : "paren.lparen",
  319. regex : /[\[({]/,
  320. next : "start"
  321. }, {
  322. token : "paren.rparen",
  323. regex : /[\])}]/
  324. }, {
  325. token: "comment",
  326. regex: /^#!.*$/
  327. }
  328. ],
  329. "start": [
  330. DocCommentHighlightRules.getStartRule("doc-start"),
  331. {
  332. token : "comment", // multi line comment
  333. regex : "\\/\\*",
  334. next : "comment_regex_allowed"
  335. }, {
  336. token : "comment",
  337. regex : "\\/\\/",
  338. next : "line_comment_regex_allowed"
  339. }, {
  340. token: "string.regexp",
  341. regex: "\\/",
  342. next: "regex"
  343. }, {
  344. token : "text",
  345. regex : "\\s+|^$",
  346. next : "start"
  347. }, {
  348. token: "empty",
  349. regex: "",
  350. next: "no_regex"
  351. }
  352. ],
  353. "regex": [
  354. {
  355. token: "regexp.keyword.operator",
  356. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  357. }, {
  358. token: "string.regexp",
  359. regex: "/[sxngimy]*",
  360. next: "no_regex"
  361. }, {
  362. token : "invalid",
  363. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  364. }, {
  365. token : "constant.language.escape",
  366. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  367. }, {
  368. token : "constant.language.delimiter",
  369. regex: /\|/
  370. }, {
  371. token: "constant.language.escape",
  372. regex: /\[\^?/,
  373. next: "regex_character_class"
  374. }, {
  375. token: "empty",
  376. regex: "$",
  377. next: "no_regex"
  378. }, {
  379. defaultToken: "string.regexp"
  380. }
  381. ],
  382. "regex_character_class": [
  383. {
  384. token: "regexp.charclass.keyword.operator",
  385. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  386. }, {
  387. token: "constant.language.escape",
  388. regex: "]",
  389. next: "regex"
  390. }, {
  391. token: "constant.language.escape",
  392. regex: "-"
  393. }, {
  394. token: "empty",
  395. regex: "$",
  396. next: "no_regex"
  397. }, {
  398. defaultToken: "string.regexp.charachterclass"
  399. }
  400. ],
  401. "function_arguments": [
  402. {
  403. token: "variable.parameter",
  404. regex: identifierRe
  405. }, {
  406. token: "punctuation.operator",
  407. regex: "[, ]+"
  408. }, {
  409. token: "punctuation.operator",
  410. regex: "$"
  411. }, {
  412. token: "empty",
  413. regex: "",
  414. next: "no_regex"
  415. }
  416. ],
  417. "comment_regex_allowed" : [
  418. DocCommentHighlightRules.getTagRule(),
  419. {token : "comment", regex : "\\*\\/", next : "start"},
  420. {defaultToken : "comment", caseInsensitive: true}
  421. ],
  422. "comment" : [
  423. DocCommentHighlightRules.getTagRule(),
  424. {token : "comment", regex : "\\*\\/", next : "no_regex"},
  425. {defaultToken : "comment", caseInsensitive: true}
  426. ],
  427. "line_comment_regex_allowed" : [
  428. DocCommentHighlightRules.getTagRule(),
  429. {token : "comment", regex : "$|^", next : "start"},
  430. {defaultToken : "comment", caseInsensitive: true}
  431. ],
  432. "line_comment" : [
  433. DocCommentHighlightRules.getTagRule(),
  434. {token : "comment", regex : "$|^", next : "no_regex"},
  435. {defaultToken : "comment", caseInsensitive: true}
  436. ],
  437. "qqstring" : [
  438. {
  439. token : "constant.language.escape",
  440. regex : escapedRe
  441. }, {
  442. token : "string",
  443. regex : "\\\\$",
  444. next : "qqstring"
  445. }, {
  446. token : "string",
  447. regex : '"|$',
  448. next : "no_regex"
  449. }, {
  450. defaultToken: "string"
  451. }
  452. ],
  453. "qstring" : [
  454. {
  455. token : "constant.language.escape",
  456. regex : escapedRe
  457. }, {
  458. token : "string",
  459. regex : "\\\\$",
  460. next : "qstring"
  461. }, {
  462. token : "string",
  463. regex : "'|$",
  464. next : "no_regex"
  465. }, {
  466. defaultToken: "string"
  467. }
  468. ]
  469. };
  470. if (!options || !options.noES6) {
  471. this.$rules.no_regex.unshift({
  472. regex: "[{}]", onMatch: function(val, state, stack) {
  473. this.next = val == "{" ? this.nextState : "";
  474. if (val == "{" && stack.length) {
  475. stack.unshift("start", state);
  476. return "paren";
  477. }
  478. if (val == "}" && stack.length) {
  479. stack.shift();
  480. this.next = stack.shift();
  481. if (this.next.indexOf("string") != -1)
  482. return "paren.quasi.end";
  483. }
  484. return val == "{" ? "paren.lparen" : "paren.rparen";
  485. },
  486. nextState: "start"
  487. }, {
  488. token : "string.quasi.start",
  489. regex : /`/,
  490. push : [{
  491. token : "constant.language.escape",
  492. regex : escapedRe
  493. }, {
  494. token : "paren.quasi.start",
  495. regex : /\${/,
  496. push : "start"
  497. }, {
  498. token : "string.quasi.end",
  499. regex : /`/,
  500. next : "pop"
  501. }, {
  502. defaultToken: "string.quasi"
  503. }]
  504. });
  505. }
  506. this.embedRules(DocCommentHighlightRules, "doc-",
  507. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  508. this.normalizeRules();
  509. };
  510. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  511. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  512. });
  513. define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  514. "use strict";
  515. var oop = require("../lib/oop");
  516. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  517. var XmlHighlightRules = function(normalize) {
  518. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  519. this.$rules = {
  520. start : [
  521. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  522. {
  523. token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
  524. regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
  525. },
  526. {
  527. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  528. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction",
  529. },
  530. {token : "comment.xml", regex : "<\\!--", next : "comment"},
  531. {
  532. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  533. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  534. },
  535. {include : "tag"},
  536. {token : "text.end-tag-open.xml", regex: "</"},
  537. {token : "text.tag-open.xml", regex: "<"},
  538. {include : "reference"},
  539. {defaultToken : "text.xml"}
  540. ],
  541. xml_decl : [{
  542. token : "entity.other.attribute-name.decl-attribute-name.xml",
  543. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  544. }, {
  545. token : "keyword.operator.decl-attribute-equals.xml",
  546. regex : "="
  547. }, {
  548. include: "whitespace"
  549. }, {
  550. include: "string"
  551. }, {
  552. token : "punctuation.xml-decl.xml",
  553. regex : "\\?>",
  554. next : "start"
  555. }],
  556. processing_instruction : [
  557. {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
  558. {defaultToken : "instruction.xml"}
  559. ],
  560. doctype : [
  561. {include : "whitespace"},
  562. {include : "string"},
  563. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  564. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  565. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  566. ],
  567. int_subset : [{
  568. token : "text.xml",
  569. regex : "\\s+"
  570. }, {
  571. token: "punctuation.int-subset.xml",
  572. regex: "]",
  573. next: "pop"
  574. }, {
  575. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  576. regex : "(<\\!)(" + tagRegex + ")",
  577. push : [{
  578. token : "text",
  579. regex : "\\s+"
  580. },
  581. {
  582. token : "punctuation.markup-decl.xml",
  583. regex : ">",
  584. next : "pop"
  585. },
  586. {include : "string"}]
  587. }],
  588. cdata : [
  589. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  590. {token : "text.xml", regex : "\\s+"},
  591. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  592. ],
  593. comment : [
  594. {token : "comment.xml", regex : "-->", next : "start"},
  595. {defaultToken : "comment.xml"}
  596. ],
  597. reference : [{
  598. token : "constant.language.escape.reference.xml",
  599. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  600. }],
  601. attr_reference : [{
  602. token : "constant.language.escape.reference.attribute-value.xml",
  603. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  604. }],
  605. tag : [{
  606. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  607. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  608. next: [
  609. {include : "attributes"},
  610. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  611. ]
  612. }],
  613. tag_whitespace : [
  614. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  615. ],
  616. whitespace : [
  617. {token : "text.whitespace.xml", regex : "\\s+"}
  618. ],
  619. string: [{
  620. token : "string.xml",
  621. regex : "'",
  622. push : [
  623. {token : "string.xml", regex: "'", next: "pop"},
  624. {defaultToken : "string.xml"}
  625. ]
  626. }, {
  627. token : "string.xml",
  628. regex : '"',
  629. push : [
  630. {token : "string.xml", regex: '"', next: "pop"},
  631. {defaultToken : "string.xml"}
  632. ]
  633. }],
  634. attributes: [{
  635. token : "entity.other.attribute-name.xml",
  636. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  637. }, {
  638. token : "keyword.operator.attribute-equals.xml",
  639. regex : "="
  640. }, {
  641. include: "tag_whitespace"
  642. }, {
  643. include: "attribute_value"
  644. }],
  645. attribute_value: [{
  646. token : "string.attribute-value.xml",
  647. regex : "'",
  648. push : [
  649. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  650. {include : "attr_reference"},
  651. {defaultToken : "string.attribute-value.xml"}
  652. ]
  653. }, {
  654. token : "string.attribute-value.xml",
  655. regex : '"',
  656. push : [
  657. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  658. {include : "attr_reference"},
  659. {defaultToken : "string.attribute-value.xml"}
  660. ]
  661. }]
  662. };
  663. if (this.constructor === XmlHighlightRules)
  664. this.normalizeRules();
  665. };
  666. (function() {
  667. this.embedTagRules = function(HighlightRules, prefix, tag){
  668. this.$rules.tag.unshift({
  669. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  670. regex : "(<)(" + tag + "(?=\\s|>|$))",
  671. next: [
  672. {include : "attributes"},
  673. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  674. ]
  675. });
  676. this.$rules[tag + "-end"] = [
  677. {include : "attributes"},
  678. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  679. onMatch : function(value, currentState, stack) {
  680. stack.splice(0);
  681. return this.token;
  682. }}
  683. ]
  684. this.embedRules(HighlightRules, prefix, [{
  685. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  686. regex : "(</)(" + tag + "(?=\\s|>|$))",
  687. next: tag + "-end"
  688. }, {
  689. token: "string.cdata.xml",
  690. regex : "<\\!\\[CDATA\\["
  691. }, {
  692. token: "string.cdata.xml",
  693. regex : "\\]\\]>"
  694. }]);
  695. };
  696. }).call(TextHighlightRules.prototype);
  697. oop.inherits(XmlHighlightRules, TextHighlightRules);
  698. exports.XmlHighlightRules = XmlHighlightRules;
  699. });
  700. 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) {
  701. "use strict";
  702. var oop = require("../lib/oop");
  703. var lang = require("../lib/lang");
  704. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  705. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  706. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  707. var tagMap = lang.createMap({
  708. a : 'anchor',
  709. button : 'form',
  710. form : 'form',
  711. img : 'image',
  712. input : 'form',
  713. label : 'form',
  714. option : 'form',
  715. script : 'script',
  716. select : 'form',
  717. textarea : 'form',
  718. style : 'style',
  719. table : 'table',
  720. tbody : 'table',
  721. td : 'table',
  722. tfoot : 'table',
  723. th : 'table',
  724. tr : 'table'
  725. });
  726. var HtmlHighlightRules = function() {
  727. XmlHighlightRules.call(this);
  728. this.addRules({
  729. attributes: [{
  730. include : "tag_whitespace"
  731. }, {
  732. token : "entity.other.attribute-name.xml",
  733. regex : "[-_a-zA-Z0-9:.]+"
  734. }, {
  735. token : "keyword.operator.attribute-equals.xml",
  736. regex : "=",
  737. push : [{
  738. include: "tag_whitespace"
  739. }, {
  740. token : "string.unquoted.attribute-value.html",
  741. regex : "[^<>='\"`\\s]+",
  742. next : "pop"
  743. }, {
  744. token : "empty",
  745. regex : "",
  746. next : "pop"
  747. }]
  748. }, {
  749. include : "attribute_value"
  750. }],
  751. tag: [{
  752. token : function(start, tag) {
  753. var group = tagMap[tag];
  754. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  755. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  756. },
  757. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  758. next: "tag_stuff"
  759. }],
  760. tag_stuff: [
  761. {include : "attributes"},
  762. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  763. ],
  764. });
  765. this.embedTagRules(CssHighlightRules, "css-", "style");
  766. this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
  767. if (this.constructor === HtmlHighlightRules)
  768. this.normalizeRules();
  769. };
  770. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  771. exports.HtmlHighlightRules = HtmlHighlightRules;
  772. });
  773. 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) {
  774. "use strict";
  775. var oop = require("../lib/oop");
  776. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  777. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  778. var JavaHighlightRules = function() {
  779. var keywords = (
  780. "abstract|continue|for|new|switch|" +
  781. "assert|default|goto|package|synchronized|" +
  782. "boolean|do|if|private|this|" +
  783. "break|double|implements|protected|throw|" +
  784. "byte|else|import|public|throws|" +
  785. "case|enum|instanceof|return|transient|" +
  786. "catch|extends|int|short|try|" +
  787. "char|final|interface|static|void|" +
  788. "class|finally|long|strictfp|volatile|" +
  789. "const|float|native|super|while"
  790. );
  791. var buildinConstants = ("null|Infinity|NaN|undefined");
  792. var langClasses = (
  793. "AbstractMethodError|AssertionError|ClassCircularityError|"+
  794. "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
  795. "ExceptionInInitializerError|IllegalAccessError|"+
  796. "IllegalThreadStateException|InstantiationError|InternalError|"+
  797. "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
  798. "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
  799. "SuppressWarnings|TypeNotPresentException|UnknownError|"+
  800. "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
  801. "InstantiationException|IndexOutOfBoundsException|"+
  802. "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
  803. "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
  804. "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
  805. "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
  806. "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
  807. "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
  808. "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
  809. "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
  810. "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
  811. "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
  812. "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
  813. "ArrayStoreException|ClassCastException|LinkageError|"+
  814. "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
  815. "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
  816. "Cloneable|Class|CharSequence|Comparable|String|Object"
  817. );
  818. var keywordMapper = this.createKeywordMapper({
  819. "variable.language": "this",
  820. "keyword": keywords,
  821. "constant.language": buildinConstants,
  822. "support.function": langClasses
  823. }, "identifier");
  824. this.$rules = {
  825. "start" : [
  826. {
  827. token : "comment",
  828. regex : "\\/\\/.*$"
  829. },
  830. DocCommentHighlightRules.getStartRule("doc-start"),
  831. {
  832. token : "comment", // multi line comment
  833. regex : "\\/\\*",
  834. next : "comment"
  835. }, {
  836. token : "string", // single line
  837. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  838. }, {
  839. token : "string", // single line
  840. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  841. }, {
  842. token : "constant.numeric", // hex
  843. regex : "0[xX][0-9a-fA-F]+\\b"
  844. }, {
  845. token : "constant.numeric", // float
  846. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  847. }, {
  848. token : "constant.language.boolean",
  849. regex : "(?:true|false)\\b"
  850. }, {
  851. token : keywordMapper,
  852. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  853. }, {
  854. token : "keyword.operator",
  855. regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
  856. }, {
  857. token : "lparen",
  858. regex : "[[({]"
  859. }, {
  860. token : "rparen",
  861. regex : "[\\])}]"
  862. }, {
  863. token : "text",
  864. regex : "\\s+"
  865. }
  866. ],
  867. "comment" : [
  868. {
  869. token : "comment", // closing comment
  870. regex : ".*?\\*\\/",
  871. next : "start"
  872. }, {
  873. token : "comment", // comment spanning whole line
  874. regex : ".+"
  875. }
  876. ]
  877. };
  878. this.embedRules(DocCommentHighlightRules, "doc-",
  879. [ DocCommentHighlightRules.getEndRule("start") ]);
  880. };
  881. oop.inherits(JavaHighlightRules, TextHighlightRules);
  882. exports.JavaHighlightRules = JavaHighlightRules;
  883. });
  884. 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) {
  885. "use strict";
  886. var oop = require("../lib/oop");
  887. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  888. var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
  889. var JspHighlightRules = function() {
  890. HtmlHighlightRules.call(this);
  891. var builtinVariables = 'request|response|out|session|' +
  892. 'application|config|pageContext|page|Exception';
  893. var keywords = 'page|include|taglib';
  894. var startRules = [
  895. {
  896. token : "comment",
  897. regex : "<%--",
  898. push : "jsp-dcomment"
  899. }, {
  900. token : "meta.tag", // jsp open tag
  901. regex : "<%@?|<%=?|<jsp:[^>]+>",
  902. push : "jsp-start"
  903. }
  904. ];
  905. var endRules = [
  906. {
  907. token : "meta.tag", // jsp close tag
  908. regex : "%>|<\\/jsp:[^>]+>",
  909. next : "pop"
  910. }, {
  911. token: "variable.language",
  912. regex : builtinVariables
  913. }, {
  914. token: "keyword",
  915. regex : keywords
  916. }
  917. ];
  918. for (var key in this.$rules)
  919. this.$rules[key].unshift.apply(this.$rules[key], startRules);
  920. this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
  921. this.addRules({
  922. "jsp-dcomment" : [{
  923. token : "comment",
  924. regex : ".*?--%>",
  925. next : "pop"
  926. }]
  927. });
  928. this.normalizeRules();
  929. };
  930. oop.inherits(JspHighlightRules, HtmlHighlightRules);
  931. exports.JspHighlightRules = JspHighlightRules;
  932. });
  933. define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  934. "use strict";
  935. var Range = require("../range").Range;
  936. var MatchingBraceOutdent = function() {};
  937. (function() {
  938. this.checkOutdent = function(line, input) {
  939. if (! /^\s+$/.test(line))
  940. return false;
  941. return /^\s*\}/.test(input);
  942. };
  943. this.autoOutdent = function(doc, row) {
  944. var line = doc.getLine(row);
  945. var match = line.match(/^(\s*\})/);
  946. if (!match) return 0;
  947. var column = match[1].length;
  948. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  949. if (!openBracePos || openBracePos.row == row) return 0;
  950. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  951. doc.replace(new Range(row, 0, row, column-1), indent);
  952. };
  953. this.$getIndent = function(line) {
  954. return line.match(/^\s*/)[0];
  955. };
  956. }).call(MatchingBraceOutdent.prototype);
  957. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  958. });
  959. define("ace/mode/behaviour/cstyle",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator","ace/lib/lang"], function(require, exports, module) {
  960. "use strict";
  961. var oop = require("../../lib/oop");
  962. var Behaviour = require("../behaviour").Behaviour;
  963. var TokenIterator = require("../../token_iterator").TokenIterator;
  964. var lang = require("../../lib/lang");
  965. var SAFE_INSERT_IN_TOKENS =
  966. ["text", "paren.rparen", "punctuation.operator"];
  967. var SAFE_INSERT_BEFORE_TOKENS =
  968. ["text", "paren.rparen", "punctuation.operator", "comment"];
  969. var context;
  970. var contextCache = {};
  971. var initContext = function(editor) {
  972. var id = -1;
  973. if (editor.multiSelect) {
  974. id = editor.selection.index;
  975. if (contextCache.rangeCount != editor.multiSelect.rangeCount)
  976. contextCache = {rangeCount: editor.multiSelect.rangeCount};
  977. }
  978. if (contextCache[id])
  979. return context = contextCache[id];
  980. context = contextCache[id] = {
  981. autoInsertedBrackets: 0,
  982. autoInsertedRow: -1,
  983. autoInsertedLineEnd: "",
  984. maybeInsertedBrackets: 0,
  985. maybeInsertedRow: -1,
  986. maybeInsertedLineStart: "",
  987. maybeInsertedLineEnd: ""
  988. };
  989. };
  990. var getWrapped = function(selection, selected, opening, closing) {
  991. var rowDiff = selection.end.row - selection.start.row;
  992. return {
  993. text: opening + selected + closing,
  994. selection: [
  995. 0,
  996. selection.start.column + 1,
  997. rowDiff,
  998. selection.end.column + (rowDiff ? 0 : 1)
  999. ]
  1000. };
  1001. };
  1002. var CstyleBehaviour = function() {
  1003. this.add("braces", "insertion", function(state, action, editor, session, text) {
  1004. var cursor = editor.getCursorPosition();
  1005. var line = session.doc.getLine(cursor.row);
  1006. if (text == '{') {
  1007. initContext(editor);
  1008. var selection = editor.getSelectionRange();
  1009. var selected = session.doc.getTextRange(selection);
  1010. if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
  1011. return getWrapped(selection, selected, '{', '}');
  1012. } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
  1013. if (/[\]\}\)]/.test(line[cursor.column]) || editor.inMultiSelectMode) {
  1014. CstyleBehaviour.recordAutoInsert(editor, session, "}");
  1015. return {
  1016. text: '{}',
  1017. selection: [1, 1]
  1018. };
  1019. } else {
  1020. CstyleBehaviour.recordMaybeInsert(editor, session, "{");
  1021. return {
  1022. text: '{',
  1023. selection: [1, 1]
  1024. };
  1025. }
  1026. }
  1027. } else if (text == '}') {
  1028. initContext(editor);
  1029. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1030. if (rightChar == '}') {
  1031. var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
  1032. if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
  1033. CstyleBehaviour.popAutoInsertedClosing();
  1034. return {
  1035. text: '',
  1036. selection: [1, 1]
  1037. };
  1038. }
  1039. }
  1040. } else if (text == "\n" || text == "\r\n") {
  1041. initContext(editor);
  1042. var closing = "";
  1043. if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
  1044. closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
  1045. CstyleBehaviour.clearMaybeInsertedClosing();
  1046. }
  1047. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1048. if (rightChar === '}') {
  1049. var openBracePos = session.findMatchingBracket({row: cursor.row, column: cursor.column+1}, '}');
  1050. if (!openBracePos)
  1051. return null;
  1052. var next_indent = this.$getIndent(session.getLine(openBracePos.row));
  1053. } else if (closing) {
  1054. var next_indent = this.$getIndent(line);
  1055. } else {
  1056. CstyleBehaviour.clearMaybeInsertedClosing();
  1057. return;
  1058. }
  1059. var indent = next_indent + session.getTabString();
  1060. return {
  1061. text: '\n' + indent + '\n' + next_indent + closing,
  1062. selection: [1, indent.length, 1, indent.length]
  1063. };
  1064. } else {
  1065. CstyleBehaviour.clearMaybeInsertedClosing();
  1066. }
  1067. });
  1068. this.add("braces", "deletion", function(state, action, editor, session, range) {
  1069. var selected = session.doc.getTextRange(range);
  1070. if (!range.isMultiLine() && selected == '{') {
  1071. initContext(editor);
  1072. var line = session.doc.getLine(range.start.row);
  1073. var rightChar = line.substring(range.end.column, range.end.column + 1);
  1074. if (rightChar == '}') {
  1075. range.end.column++;
  1076. return range;
  1077. } else {
  1078. context.maybeInsertedBrackets--;
  1079. }
  1080. }
  1081. });
  1082. this.add("parens", "insertion", function(state, action, editor, session, text) {
  1083. if (text == '(') {
  1084. initContext(editor);
  1085. var selection = editor.getSelectionRange();
  1086. var selected = session.doc.getTextRange(selection);
  1087. if (selected !== "" && editor.getWrapBehavioursEnabled()) {
  1088. return getWrapped(selection, selected, '(', ')');
  1089. } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
  1090. CstyleBehaviour.recordAutoInsert(editor, session, ")");
  1091. return {
  1092. text: '()',
  1093. selection: [1, 1]
  1094. };
  1095. }
  1096. } else if (text == ')') {
  1097. initContext(editor);
  1098. var cursor = editor.getCursorPosition();
  1099. var line = session.doc.getLine(cursor.row);
  1100. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1101. if (rightChar == ')') {
  1102. var matching = session.$findOpeningBracket(')', {column: cursor.column + 1, row: cursor.row});
  1103. if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
  1104. CstyleBehaviour.popAutoInsertedClosing();
  1105. return {
  1106. text: '',
  1107. selection: [1, 1]
  1108. };
  1109. }
  1110. }
  1111. }
  1112. });
  1113. this.add("parens", "deletion", function(state, action, editor, session, range) {
  1114. var selected = session.doc.getTextRange(range);
  1115. if (!range.isMultiLine() && selected == '(') {
  1116. initContext(editor);
  1117. var line = session.doc.getLine(range.start.row);
  1118. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  1119. if (rightChar == ')') {
  1120. range.end.column++;
  1121. return range;
  1122. }
  1123. }
  1124. });
  1125. this.add("brackets", "insertion", function(state, action, editor, session, text) {
  1126. if (text == '[') {
  1127. initContext(editor);
  1128. var selection = editor.getSelectionRange();
  1129. var selected = session.doc.getTextRange(selection);
  1130. if (selected !== "" && editor.getWrapBehavioursEnabled()) {
  1131. return getWrapped(selection, selected, '[', ']');
  1132. } else if (CstyleBehaviour.isSaneInsertion(editor, session)) {
  1133. CstyleBehaviour.recordAutoInsert(editor, session, "]");
  1134. return {
  1135. text: '[]',
  1136. selection: [1, 1]
  1137. };
  1138. }
  1139. } else if (text == ']') {
  1140. initContext(editor);
  1141. var cursor = editor.getCursorPosition();
  1142. var line = session.doc.getLine(cursor.row);
  1143. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1144. if (rightChar == ']') {
  1145. var matching = session.$findOpeningBracket(']', {column: cursor.column + 1, row: cursor.row});
  1146. if (matching !== null && CstyleBehaviour.isAutoInsertedClosing(cursor, line, text)) {
  1147. CstyleBehaviour.popAutoInsertedClosing();
  1148. return {
  1149. text: '',
  1150. selection: [1, 1]
  1151. };
  1152. }
  1153. }
  1154. }
  1155. });
  1156. this.add("brackets", "deletion", function(state, action, editor, session, range) {
  1157. var selected = session.doc.getTextRange(range);
  1158. if (!range.isMultiLine() && selected == '[') {
  1159. initContext(editor);
  1160. var line = session.doc.getLine(range.start.row);
  1161. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  1162. if (rightChar == ']') {
  1163. range.end.column++;
  1164. return range;
  1165. }
  1166. }
  1167. });
  1168. this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
  1169. if (text == '"' || text == "'") {
  1170. initContext(editor);
  1171. var quote = text;
  1172. var selection = editor.getSelectionRange();
  1173. var selected = session.doc.getTextRange(selection);
  1174. if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
  1175. return getWrapped(selection, selected, quote, quote);
  1176. } else if (!selected) {
  1177. var cursor = editor.getCursorPosition();
  1178. var line = session.doc.getLine(cursor.row);
  1179. var leftChar = line.substring(cursor.column-1, cursor.column);
  1180. var rightChar = line.substring(cursor.column, cursor.column + 1);
  1181. var token = session.getTokenAt(cursor.row, cursor.column);
  1182. var rightToken = session.getTokenAt(cursor.row, cursor.column + 1);
  1183. if (leftChar == "\\" && token && /escape/.test(token.type))
  1184. return null;
  1185. var stringBefore = token && /string|escape/.test(token.type);
  1186. var stringAfter = !rightToken || /string|escape/.test(rightToken.type);
  1187. var pair;
  1188. if (rightChar == quote) {
  1189. pair = stringBefore !== stringAfter;
  1190. } else {
  1191. if (stringBefore && !stringAfter)
  1192. return null; // wrap string with different quote
  1193. if (stringBefore && stringAfter)
  1194. return null; // do not pair quotes inside strings
  1195. var wordRe = session.$mode.tokenRe;
  1196. wordRe.lastIndex = 0;
  1197. var isWordBefore = wordRe.test(leftChar);
  1198. wordRe.lastIndex = 0;
  1199. var isWordAfter = wordRe.test(leftChar);
  1200. if (isWordBefore || isWordAfter)
  1201. return null; // before or after alphanumeric
  1202. if (rightChar && !/[\s;,.})\]\\]/.test(rightChar))
  1203. return null; // there is rightChar and it isn't closing
  1204. pair = true;
  1205. }
  1206. return {
  1207. text: pair ? quote + quote : "",
  1208. selection: [1,1]
  1209. };
  1210. }
  1211. }
  1212. });
  1213. this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
  1214. var selected = session.doc.getTextRange(range);
  1215. if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
  1216. initContext(editor);
  1217. var line = session.doc.getLine(range.start.row);
  1218. var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
  1219. if (rightChar == selected) {
  1220. range.end.column++;
  1221. return range;
  1222. }
  1223. }
  1224. });
  1225. };
  1226. CstyleBehaviour.isSaneInsertion = function(editor, session) {
  1227. var cursor = editor.getCursorPosition();
  1228. var iterator = new TokenIterator(session, cursor.row, cursor.column);
  1229. if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
  1230. var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
  1231. if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
  1232. return false;
  1233. }
  1234. iterator.stepForward();
  1235. return iterator.getCurrentTokenRow() !== cursor.row ||
  1236. this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
  1237. };
  1238. CstyleBehaviour.$matchTokenType = function(token, types) {
  1239. return types.indexOf(token.type || token) > -1;
  1240. };
  1241. CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
  1242. var cursor = editor.getCursorPosition();
  1243. var line = session.doc.getLine(cursor.row);
  1244. if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
  1245. context.autoInsertedBrackets = 0;
  1246. context.autoInsertedRow = cursor.row;
  1247. context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
  1248. context.autoInsertedBrackets++;
  1249. };
  1250. CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
  1251. var cursor = editor.getCursorPosition();
  1252. var line = session.doc.getLine(cursor.row);
  1253. if (!this.isMaybeInsertedClosing(cursor, line))
  1254. context.maybeInsertedBrackets = 0;
  1255. context.maybeInsertedRow = cursor.row;
  1256. context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
  1257. context.maybeInsertedLineEnd = line.substr(cursor.column);
  1258. context.maybeInsertedBrackets++;
  1259. };
  1260. CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
  1261. return context.autoInsertedBrackets > 0 &&
  1262. cursor.row === context.autoInsertedRow &&
  1263. bracket === context.autoInsertedLineEnd[0] &&
  1264. line.substr(cursor.column) === context.autoInsertedLineEnd;
  1265. };
  1266. CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
  1267. return context.maybeInsertedBrackets > 0 &&
  1268. cursor.row === context.maybeInsertedRow &&
  1269. line.substr(cursor.column) === context.maybeInsertedLineEnd &&
  1270. line.substr(0, cursor.column) == context.maybeInsertedLineStart;
  1271. };
  1272. CstyleBehaviour.popAutoInsertedClosing = function() {
  1273. context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
  1274. context.autoInsertedBrackets--;
  1275. };
  1276. CstyleBehaviour.clearMaybeInsertedClosing = function() {
  1277. if (context) {
  1278. context.maybeInsertedBrackets = 0;
  1279. context.maybeInsertedRow = -1;
  1280. }
  1281. };
  1282. oop.inherits(CstyleBehaviour, Behaviour);
  1283. exports.CstyleBehaviour = CstyleBehaviour;
  1284. });
  1285. define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1286. "use strict";
  1287. var oop = require("../../lib/oop");
  1288. var Range = require("../../range").Range;
  1289. var BaseFoldMode = require("./fold_mode").FoldMode;
  1290. var FoldMode = exports.FoldMode = function(commentRegex) {
  1291. if (commentRegex) {
  1292. this.foldingStartMarker = new RegExp(
  1293. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  1294. );
  1295. this.foldingStopMarker = new RegExp(
  1296. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  1297. );
  1298. }
  1299. };
  1300. oop.inherits(FoldMode, BaseFoldMode);
  1301. (function() {
  1302. this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
  1303. this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
  1304. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  1305. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  1306. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  1307. this._getFoldWidgetBase = this.getFoldWidget;
  1308. this.getFoldWidget = function(session, foldStyle, row) {
  1309. var line = session.getLine(row);
  1310. if (this.singleLineBlockCommentRe.test(line)) {
  1311. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  1312. return "";
  1313. }
  1314. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  1315. if (!fw && this.startRegionRe.test(line))
  1316. return "start"; // lineCommentRegionStart
  1317. return fw;
  1318. };
  1319. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  1320. var line = session.getLine(row);
  1321. if (this.startRegionRe.test(line))
  1322. return this.getCommentRegionBlock(session, line, row);
  1323. var match = line.match(this.foldingStartMarker);
  1324. if (match) {
  1325. var i = match.index;
  1326. if (match[1])
  1327. return this.openingBracketBlock(session, match[1], row, i);
  1328. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  1329. if (range && !range.isMultiLine()) {
  1330. if (forceMultiline) {
  1331. range = this.getSectionRange(session, row);
  1332. } else if (foldStyle != "all")
  1333. range = null;
  1334. }
  1335. return range;
  1336. }
  1337. if (foldStyle === "markbegin")
  1338. return;
  1339. var match = line.match(this.foldingStopMarker);
  1340. if (match) {
  1341. var i = match.index + match[0].length;
  1342. if (match[1])
  1343. return this.closingBracketBlock(session, match[1], row, i);
  1344. return session.getCommentFoldRange(row, i, -1);
  1345. }
  1346. };
  1347. this.getSectionRange = function(session, row) {
  1348. var line = session.getLine(row);
  1349. var startIndent = line.search(/\S/);
  1350. var startRow = row;
  1351. var startColumn = line.length;
  1352. row = row + 1;
  1353. var endRow = row;
  1354. var maxRow = session.getLength();
  1355. while (++row < maxRow) {
  1356. line = session.getLine(row);
  1357. var indent = line.search(/\S/);
  1358. if (indent === -1)
  1359. continue;
  1360. if (startIndent > indent)
  1361. break;
  1362. var subRange = this.getFoldWidgetRange(session, "all", row);
  1363. if (subRange) {
  1364. if (subRange.start.row <= startRow) {
  1365. break;
  1366. } else if (subRange.isMultiLine()) {
  1367. row = subRange.end.row;
  1368. } else if (startIndent == indent) {
  1369. break;
  1370. }
  1371. }
  1372. endRow = row;
  1373. }
  1374. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1375. };
  1376. this.getCommentRegionBlock = function(session, line, row) {
  1377. var startColumn = line.search(/\s*$/);
  1378. var maxRow = session.getLength();
  1379. var startRow = row;
  1380. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1381. var depth = 1;
  1382. while (++row < maxRow) {
  1383. line = session.getLine(row);
  1384. var m = re.exec(line);
  1385. if (!m) continue;
  1386. if (m[1]) depth--;
  1387. else depth++;
  1388. if (!depth) break;
  1389. }
  1390. var endRow = row;
  1391. if (endRow > startRow) {
  1392. return new Range(startRow, startColumn, endRow, line.length);
  1393. }
  1394. };
  1395. }).call(FoldMode.prototype);
  1396. });
  1397. 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) {
  1398. "use strict";
  1399. var oop = require("../lib/oop");
  1400. var TextMode = require("./text").Mode;
  1401. var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
  1402. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1403. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  1404. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1405. var Mode = function() {
  1406. this.HighlightRules = JspHighlightRules;
  1407. this.$outdent = new MatchingBraceOutdent();
  1408. this.$behaviour = new CstyleBehaviour();
  1409. this.foldingRules = new CStyleFoldMode();
  1410. };
  1411. oop.inherits(Mode, TextMode);
  1412. (function() {
  1413. this.$id = "ace/mode/jsp";
  1414. }).call(Mode.prototype);
  1415. exports.Mode = Mode;
  1416. });