mode-jsp.js 54 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  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|min-height|min-width|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|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";
  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. ace.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. 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) {
  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 identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*";
  178. var JavaScriptHighlightRules = function(options) {
  179. var keywordMapper = this.createKeywordMapper({
  180. "variable.language":
  181. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  182. "Namespace|QName|XML|XMLList|" + // E4X
  183. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  184. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  185. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  186. "SyntaxError|TypeError|URIError|" +
  187. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  188. "isNaN|parseFloat|parseInt|" +
  189. "JSON|Math|" + // Other
  190. "this|arguments|prototype|window|document" , // Pseudo
  191. "keyword":
  192. "const|yield|import|get|set|async|await|" +
  193. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  194. "if|in|of|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  195. "__parent__|__count__|escape|unescape|with|__proto__|" +
  196. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  197. "storage.type":
  198. "const|let|var|function",
  199. "constant.language":
  200. "null|Infinity|NaN|undefined",
  201. "support.function":
  202. "alert",
  203. "constant.language.boolean": "true|false"
  204. }, "identifier");
  205. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  206. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  207. "u[0-9a-fA-F]{4}|" + // unicode
  208. "u{[0-9a-fA-F]{1,6}}|" + // es6 unicode
  209. "[0-2][0-7]{0,2}|" + // oct
  210. "3[0-7][0-7]?|" + // oct
  211. "[4-7][0-7]?|" + //oct
  212. ".)";
  213. this.$rules = {
  214. "no_regex" : [
  215. DocCommentHighlightRules.getStartRule("doc-start"),
  216. comments("no_regex"),
  217. {
  218. token : "string",
  219. regex : "'(?=.)",
  220. next : "qstring"
  221. }, {
  222. token : "string",
  223. regex : '"(?=.)',
  224. next : "qqstring"
  225. }, {
  226. token : "constant.numeric", // hex
  227. regex : /0(?:[xX][0-9a-fA-F]+|[bB][01]+)\b/
  228. }, {
  229. token : "constant.numeric", // float
  230. regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
  231. }, {
  232. token : [
  233. "storage.type", "punctuation.operator", "support.function",
  234. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  235. ],
  236. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  237. next: "function_arguments"
  238. }, {
  239. token : [
  240. "storage.type", "punctuation.operator", "entity.name.function", "text",
  241. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  242. ],
  243. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  244. next: "function_arguments"
  245. }, {
  246. token : [
  247. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  248. "text", "paren.lparen"
  249. ],
  250. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  251. next: "function_arguments"
  252. }, {
  253. token : [
  254. "storage.type", "punctuation.operator", "entity.name.function", "text",
  255. "keyword.operator", "text",
  256. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  257. ],
  258. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  259. next: "function_arguments"
  260. }, {
  261. token : [
  262. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  263. ],
  264. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  265. next: "function_arguments"
  266. }, {
  267. token : [
  268. "entity.name.function", "text", "punctuation.operator",
  269. "text", "storage.type", "text", "paren.lparen"
  270. ],
  271. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  272. next: "function_arguments"
  273. }, {
  274. token : [
  275. "text", "text", "storage.type", "text", "paren.lparen"
  276. ],
  277. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  278. next: "function_arguments"
  279. }, {
  280. token : "keyword",
  281. regex : "(?:" + kwBeforeRe + ")\\b",
  282. next : "start"
  283. }, {
  284. token : ["support.constant"],
  285. regex : /that\b/
  286. }, {
  287. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  288. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  289. }, {
  290. token : keywordMapper,
  291. regex : identifierRe
  292. }, {
  293. token : "punctuation.operator",
  294. regex : /[.](?![.])/,
  295. next : "property"
  296. }, {
  297. token : "keyword.operator",
  298. regex : /--|\+\+|\.{3}|===|==|=|!=|!==|<+=?|>+=?|!|&&|\|\||\?:|[!$%&*+\-~\/^]=?/,
  299. next : "start"
  300. }, {
  301. token : "punctuation.operator",
  302. regex : /[?:,;.]/,
  303. next : "start"
  304. }, {
  305. token : "paren.lparen",
  306. regex : /[\[({]/,
  307. next : "start"
  308. }, {
  309. token : "paren.rparen",
  310. regex : /[\])}]/
  311. }, {
  312. token: "comment",
  313. regex: /^#!.*$/
  314. }
  315. ],
  316. property: [{
  317. token : "text",
  318. regex : "\\s+"
  319. }, {
  320. token : [
  321. "storage.type", "punctuation.operator", "entity.name.function", "text",
  322. "keyword.operator", "text",
  323. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  324. ],
  325. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(?:(\\s+)(\\w+))?(\\s*)(\\()",
  326. next: "function_arguments"
  327. }, {
  328. token : "punctuation.operator",
  329. regex : /[.](?![.])/
  330. }, {
  331. token : "support.function",
  332. 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(?=\()/
  333. }, {
  334. token : "support.function.dom",
  335. 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(?=\()/
  336. }, {
  337. token : "support.constant",
  338. 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/
  339. }, {
  340. token : "identifier",
  341. regex : identifierRe
  342. }, {
  343. regex: "",
  344. token: "empty",
  345. next: "no_regex"
  346. }
  347. ],
  348. "start": [
  349. DocCommentHighlightRules.getStartRule("doc-start"),
  350. comments("start"),
  351. {
  352. token: "string.regexp",
  353. regex: "\\/",
  354. next: "regex"
  355. }, {
  356. token : "text",
  357. regex : "\\s+|^$",
  358. next : "start"
  359. }, {
  360. token: "empty",
  361. regex: "",
  362. next: "no_regex"
  363. }
  364. ],
  365. "regex": [
  366. {
  367. token: "regexp.keyword.operator",
  368. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  369. }, {
  370. token: "string.regexp",
  371. regex: "/[sxngimy]*",
  372. next: "no_regex"
  373. }, {
  374. token : "invalid",
  375. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  376. }, {
  377. token : "constant.language.escape",
  378. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  379. }, {
  380. token : "constant.language.delimiter",
  381. regex: /\|/
  382. }, {
  383. token: "constant.language.escape",
  384. regex: /\[\^?/,
  385. next: "regex_character_class"
  386. }, {
  387. token: "empty",
  388. regex: "$",
  389. next: "no_regex"
  390. }, {
  391. defaultToken: "string.regexp"
  392. }
  393. ],
  394. "regex_character_class": [
  395. {
  396. token: "regexp.charclass.keyword.operator",
  397. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  398. }, {
  399. token: "constant.language.escape",
  400. regex: "]",
  401. next: "regex"
  402. }, {
  403. token: "constant.language.escape",
  404. regex: "-"
  405. }, {
  406. token: "empty",
  407. regex: "$",
  408. next: "no_regex"
  409. }, {
  410. defaultToken: "string.regexp.charachterclass"
  411. }
  412. ],
  413. "function_arguments": [
  414. {
  415. token: "variable.parameter",
  416. regex: identifierRe
  417. }, {
  418. token: "punctuation.operator",
  419. regex: "[, ]+"
  420. }, {
  421. token: "punctuation.operator",
  422. regex: "$"
  423. }, {
  424. token: "empty",
  425. regex: "",
  426. next: "no_regex"
  427. }
  428. ],
  429. "qqstring" : [
  430. {
  431. token : "constant.language.escape",
  432. regex : escapedRe
  433. }, {
  434. token : "string",
  435. regex : "\\\\$",
  436. next : "qqstring"
  437. }, {
  438. token : "string",
  439. regex : '"|$',
  440. next : "no_regex"
  441. }, {
  442. defaultToken: "string"
  443. }
  444. ],
  445. "qstring" : [
  446. {
  447. token : "constant.language.escape",
  448. regex : escapedRe
  449. }, {
  450. token : "string",
  451. regex : "\\\\$",
  452. next : "qstring"
  453. }, {
  454. token : "string",
  455. regex : "'|$",
  456. next : "no_regex"
  457. }, {
  458. defaultToken: "string"
  459. }
  460. ]
  461. };
  462. if (!options || !options.noES6) {
  463. this.$rules.no_regex.unshift({
  464. regex: "[{}]", onMatch: function(val, state, stack) {
  465. this.next = val == "{" ? this.nextState : "";
  466. if (val == "{" && stack.length) {
  467. stack.unshift("start", state);
  468. }
  469. else if (val == "}" && stack.length) {
  470. stack.shift();
  471. this.next = stack.shift();
  472. if (this.next.indexOf("string") != -1 || this.next.indexOf("jsx") != -1)
  473. return "paren.quasi.end";
  474. }
  475. return val == "{" ? "paren.lparen" : "paren.rparen";
  476. },
  477. nextState: "start"
  478. }, {
  479. token : "string.quasi.start",
  480. regex : /`/,
  481. push : [{
  482. token : "constant.language.escape",
  483. regex : escapedRe
  484. }, {
  485. token : "paren.quasi.start",
  486. regex : /\${/,
  487. push : "start"
  488. }, {
  489. token : "string.quasi.end",
  490. regex : /`/,
  491. next : "pop"
  492. }, {
  493. defaultToken: "string.quasi"
  494. }]
  495. });
  496. if (!options || options.jsx != false)
  497. JSX.call(this);
  498. }
  499. this.embedRules(DocCommentHighlightRules, "doc-",
  500. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  501. this.normalizeRules();
  502. };
  503. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  504. function JSX() {
  505. var tagRegex = identifierRe.replace("\\d", "\\d\\-");
  506. var jsxTag = {
  507. onMatch : function(val, state, stack) {
  508. var offset = val.charAt(1) == "/" ? 2 : 1;
  509. if (offset == 1) {
  510. if (state != this.nextState)
  511. stack.unshift(this.next, this.nextState, 0);
  512. else
  513. stack.unshift(this.next);
  514. stack[2]++;
  515. } else if (offset == 2) {
  516. if (state == this.nextState) {
  517. stack[1]--;
  518. if (!stack[1] || stack[1] < 0) {
  519. stack.shift();
  520. stack.shift();
  521. }
  522. }
  523. }
  524. return [{
  525. type: "meta.tag.punctuation." + (offset == 1 ? "" : "end-") + "tag-open.xml",
  526. value: val.slice(0, offset)
  527. }, {
  528. type: "meta.tag.tag-name.xml",
  529. value: val.substr(offset)
  530. }];
  531. },
  532. regex : "</?" + tagRegex + "",
  533. next: "jsxAttributes",
  534. nextState: "jsx"
  535. };
  536. this.$rules.start.unshift(jsxTag);
  537. var jsxJsRule = {
  538. regex: "{",
  539. token: "paren.quasi.start",
  540. push: "start"
  541. };
  542. this.$rules.jsx = [
  543. jsxJsRule,
  544. jsxTag,
  545. {include : "reference"},
  546. {defaultToken: "string"}
  547. ];
  548. this.$rules.jsxAttributes = [{
  549. token : "meta.tag.punctuation.tag-close.xml",
  550. regex : "/?>",
  551. onMatch : function(value, currentState, stack) {
  552. if (currentState == stack[0])
  553. stack.shift();
  554. if (value.length == 2) {
  555. if (stack[0] == this.nextState)
  556. stack[1]--;
  557. if (!stack[1] || stack[1] < 0) {
  558. stack.splice(0, 2);
  559. }
  560. }
  561. this.next = stack[0] || "start";
  562. return [{type: this.token, value: value}];
  563. },
  564. nextState: "jsx"
  565. },
  566. jsxJsRule,
  567. comments("jsxAttributes"),
  568. {
  569. token : "entity.other.attribute-name.xml",
  570. regex : tagRegex
  571. }, {
  572. token : "keyword.operator.attribute-equals.xml",
  573. regex : "="
  574. }, {
  575. token : "text.tag-whitespace.xml",
  576. regex : "\\s+"
  577. }, {
  578. token : "string.attribute-value.xml",
  579. regex : "'",
  580. stateName : "jsx_attr_q",
  581. push : [
  582. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  583. {include : "reference"},
  584. {defaultToken : "string.attribute-value.xml"}
  585. ]
  586. }, {
  587. token : "string.attribute-value.xml",
  588. regex : '"',
  589. stateName : "jsx_attr_qq",
  590. push : [
  591. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  592. {include : "reference"},
  593. {defaultToken : "string.attribute-value.xml"}
  594. ]
  595. },
  596. jsxTag
  597. ];
  598. this.$rules.reference = [{
  599. token : "constant.language.escape.reference.xml",
  600. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  601. }];
  602. }
  603. function comments(next) {
  604. return [
  605. {
  606. token : "comment", // multi line comment
  607. regex : /\/\*/,
  608. next: [
  609. DocCommentHighlightRules.getTagRule(),
  610. {token : "comment", regex : "\\*\\/", next : next || "pop"},
  611. {defaultToken : "comment", caseInsensitive: true}
  612. ]
  613. }, {
  614. token : "comment",
  615. regex : "\\/\\/",
  616. next: [
  617. DocCommentHighlightRules.getTagRule(),
  618. {token : "comment", regex : "$|^", next : next || "pop"},
  619. {defaultToken : "comment", caseInsensitive: true}
  620. ]
  621. }
  622. ];
  623. }
  624. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  625. });
  626. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  627. "use strict";
  628. var oop = require("../lib/oop");
  629. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  630. var XmlHighlightRules = function(normalize) {
  631. var tagRegex = "[_:a-zA-Z\xc0-\uffff][-_:.a-zA-Z0-9\xc0-\uffff]*";
  632. this.$rules = {
  633. start : [
  634. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  635. {
  636. token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
  637. regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
  638. },
  639. {
  640. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  641. regex : "(<\\?)(" + tagRegex + ")", next : "processing_instruction"
  642. },
  643. {token : "comment.xml", regex : "<\\!--", next : "comment"},
  644. {
  645. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  646. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  647. },
  648. {include : "tag"},
  649. {token : "text.end-tag-open.xml", regex: "</"},
  650. {token : "text.tag-open.xml", regex: "<"},
  651. {include : "reference"},
  652. {defaultToken : "text.xml"}
  653. ],
  654. xml_decl : [{
  655. token : "entity.other.attribute-name.decl-attribute-name.xml",
  656. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  657. }, {
  658. token : "keyword.operator.decl-attribute-equals.xml",
  659. regex : "="
  660. }, {
  661. include: "whitespace"
  662. }, {
  663. include: "string"
  664. }, {
  665. token : "punctuation.xml-decl.xml",
  666. regex : "\\?>",
  667. next : "start"
  668. }],
  669. processing_instruction : [
  670. {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
  671. {defaultToken : "instruction.xml"}
  672. ],
  673. doctype : [
  674. {include : "whitespace"},
  675. {include : "string"},
  676. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  677. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  678. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  679. ],
  680. int_subset : [{
  681. token : "text.xml",
  682. regex : "\\s+"
  683. }, {
  684. token: "punctuation.int-subset.xml",
  685. regex: "]",
  686. next: "pop"
  687. }, {
  688. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  689. regex : "(<\\!)(" + tagRegex + ")",
  690. push : [{
  691. token : "text",
  692. regex : "\\s+"
  693. },
  694. {
  695. token : "punctuation.markup-decl.xml",
  696. regex : ">",
  697. next : "pop"
  698. },
  699. {include : "string"}]
  700. }],
  701. cdata : [
  702. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  703. {token : "text.xml", regex : "\\s+"},
  704. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  705. ],
  706. comment : [
  707. {token : "comment.xml", regex : "-->", next : "start"},
  708. {defaultToken : "comment.xml"}
  709. ],
  710. reference : [{
  711. token : "constant.language.escape.reference.xml",
  712. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  713. }],
  714. attr_reference : [{
  715. token : "constant.language.escape.reference.attribute-value.xml",
  716. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  717. }],
  718. tag : [{
  719. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  720. regex : "(?:(<)|(</))((?:" + tagRegex + ":)?" + tagRegex + ")",
  721. next: [
  722. {include : "attributes"},
  723. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  724. ]
  725. }],
  726. tag_whitespace : [
  727. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  728. ],
  729. whitespace : [
  730. {token : "text.whitespace.xml", regex : "\\s+"}
  731. ],
  732. string: [{
  733. token : "string.xml",
  734. regex : "'",
  735. push : [
  736. {token : "string.xml", regex: "'", next: "pop"},
  737. {defaultToken : "string.xml"}
  738. ]
  739. }, {
  740. token : "string.xml",
  741. regex : '"',
  742. push : [
  743. {token : "string.xml", regex: '"', next: "pop"},
  744. {defaultToken : "string.xml"}
  745. ]
  746. }],
  747. attributes: [{
  748. token : "entity.other.attribute-name.xml",
  749. regex : "(?:" + tagRegex + ":)?" + tagRegex + ""
  750. }, {
  751. token : "keyword.operator.attribute-equals.xml",
  752. regex : "="
  753. }, {
  754. include: "tag_whitespace"
  755. }, {
  756. include: "attribute_value"
  757. }],
  758. attribute_value: [{
  759. token : "string.attribute-value.xml",
  760. regex : "'",
  761. push : [
  762. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  763. {include : "attr_reference"},
  764. {defaultToken : "string.attribute-value.xml"}
  765. ]
  766. }, {
  767. token : "string.attribute-value.xml",
  768. regex : '"',
  769. push : [
  770. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  771. {include : "attr_reference"},
  772. {defaultToken : "string.attribute-value.xml"}
  773. ]
  774. }]
  775. };
  776. if (this.constructor === XmlHighlightRules)
  777. this.normalizeRules();
  778. };
  779. (function() {
  780. this.embedTagRules = function(HighlightRules, prefix, tag){
  781. this.$rules.tag.unshift({
  782. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  783. regex : "(<)(" + tag + "(?=\\s|>|$))",
  784. next: [
  785. {include : "attributes"},
  786. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  787. ]
  788. });
  789. this.$rules[tag + "-end"] = [
  790. {include : "attributes"},
  791. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  792. onMatch : function(value, currentState, stack) {
  793. stack.splice(0);
  794. return this.token;
  795. }}
  796. ]
  797. this.embedRules(HighlightRules, prefix, [{
  798. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  799. regex : "(</)(" + tag + "(?=\\s|>|$))",
  800. next: tag + "-end"
  801. }, {
  802. token: "string.cdata.xml",
  803. regex : "<\\!\\[CDATA\\["
  804. }, {
  805. token: "string.cdata.xml",
  806. regex : "\\]\\]>"
  807. }]);
  808. };
  809. }).call(TextHighlightRules.prototype);
  810. oop.inherits(XmlHighlightRules, TextHighlightRules);
  811. exports.XmlHighlightRules = XmlHighlightRules;
  812. });
  813. 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) {
  814. "use strict";
  815. var oop = require("../lib/oop");
  816. var lang = require("../lib/lang");
  817. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  818. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  819. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  820. var tagMap = lang.createMap({
  821. a : 'anchor',
  822. button : 'form',
  823. form : 'form',
  824. img : 'image',
  825. input : 'form',
  826. label : 'form',
  827. option : 'form',
  828. script : 'script',
  829. select : 'form',
  830. textarea : 'form',
  831. style : 'style',
  832. table : 'table',
  833. tbody : 'table',
  834. td : 'table',
  835. tfoot : 'table',
  836. th : 'table',
  837. tr : 'table'
  838. });
  839. var HtmlHighlightRules = function() {
  840. XmlHighlightRules.call(this);
  841. this.addRules({
  842. attributes: [{
  843. include : "tag_whitespace"
  844. }, {
  845. token : "entity.other.attribute-name.xml",
  846. regex : "[-_a-zA-Z0-9:.]+"
  847. }, {
  848. token : "keyword.operator.attribute-equals.xml",
  849. regex : "=",
  850. push : [{
  851. include: "tag_whitespace"
  852. }, {
  853. token : "string.unquoted.attribute-value.html",
  854. regex : "[^<>='\"`\\s]+",
  855. next : "pop"
  856. }, {
  857. token : "empty",
  858. regex : "",
  859. next : "pop"
  860. }]
  861. }, {
  862. include : "attribute_value"
  863. }],
  864. tag: [{
  865. token : function(start, tag) {
  866. var group = tagMap[tag];
  867. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  868. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  869. },
  870. regex : "(</?)([-_a-zA-Z0-9:.]+)",
  871. next: "tag_stuff"
  872. }],
  873. tag_stuff: [
  874. {include : "attributes"},
  875. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  876. ]
  877. });
  878. this.embedTagRules(CssHighlightRules, "css-", "style");
  879. this.embedTagRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "js-", "script");
  880. if (this.constructor === HtmlHighlightRules)
  881. this.normalizeRules();
  882. };
  883. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  884. exports.HtmlHighlightRules = HtmlHighlightRules;
  885. });
  886. 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) {
  887. "use strict";
  888. var oop = require("../lib/oop");
  889. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  890. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  891. var JavaHighlightRules = function() {
  892. var keywords = (
  893. "abstract|continue|for|new|switch|" +
  894. "assert|default|goto|package|synchronized|" +
  895. "boolean|do|if|private|this|" +
  896. "break|double|implements|protected|throw|" +
  897. "byte|else|import|public|throws|" +
  898. "case|enum|instanceof|return|transient|" +
  899. "catch|extends|int|short|try|" +
  900. "char|final|interface|static|void|" +
  901. "class|finally|long|strictfp|volatile|" +
  902. "const|float|native|super|while"
  903. );
  904. var buildinConstants = ("null|Infinity|NaN|undefined");
  905. var langClasses = (
  906. "AbstractMethodError|AssertionError|ClassCircularityError|"+
  907. "ClassFormatError|Deprecated|EnumConstantNotPresentException|"+
  908. "ExceptionInInitializerError|IllegalAccessError|"+
  909. "IllegalThreadStateException|InstantiationError|InternalError|"+
  910. "NegativeArraySizeException|NoSuchFieldError|Override|Process|"+
  911. "ProcessBuilder|SecurityManager|StringIndexOutOfBoundsException|"+
  912. "SuppressWarnings|TypeNotPresentException|UnknownError|"+
  913. "UnsatisfiedLinkError|UnsupportedClassVersionError|VerifyError|"+
  914. "InstantiationException|IndexOutOfBoundsException|"+
  915. "ArrayIndexOutOfBoundsException|CloneNotSupportedException|"+
  916. "NoSuchFieldException|IllegalArgumentException|NumberFormatException|"+
  917. "SecurityException|Void|InheritableThreadLocal|IllegalStateException|"+
  918. "InterruptedException|NoSuchMethodException|IllegalAccessException|"+
  919. "UnsupportedOperationException|Enum|StrictMath|Package|Compiler|"+
  920. "Readable|Runtime|StringBuilder|Math|IncompatibleClassChangeError|"+
  921. "NoSuchMethodError|ThreadLocal|RuntimePermission|ArithmeticException|"+
  922. "NullPointerException|Long|Integer|Short|Byte|Double|Number|Float|"+
  923. "Character|Boolean|StackTraceElement|Appendable|StringBuffer|"+
  924. "Iterable|ThreadGroup|Runnable|Thread|IllegalMonitorStateException|"+
  925. "StackOverflowError|OutOfMemoryError|VirtualMachineError|"+
  926. "ArrayStoreException|ClassCastException|LinkageError|"+
  927. "NoClassDefFoundError|ClassNotFoundException|RuntimeException|"+
  928. "Exception|ThreadDeath|Error|Throwable|System|ClassLoader|"+
  929. "Cloneable|Class|CharSequence|Comparable|String|Object"
  930. );
  931. var keywordMapper = this.createKeywordMapper({
  932. "variable.language": "this",
  933. "keyword": keywords,
  934. "constant.language": buildinConstants,
  935. "support.function": langClasses
  936. }, "identifier");
  937. this.$rules = {
  938. "start" : [
  939. {
  940. token : "comment",
  941. regex : "\\/\\/.*$"
  942. },
  943. DocCommentHighlightRules.getStartRule("doc-start"),
  944. {
  945. token : "comment", // multi line comment
  946. regex : "\\/\\*",
  947. next : "comment"
  948. }, {
  949. token : "string", // single line
  950. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  951. }, {
  952. token : "string", // single line
  953. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  954. }, {
  955. token : "constant.numeric", // hex
  956. regex : /0(?:[xX][0-9a-fA-F][0-9a-fA-F_]*|[bB][01][01_]*)[LlSsDdFfYy]?\b/
  957. }, {
  958. token : "constant.numeric", // float
  959. regex : /[+-]?\d[\d_]*(?:(?:\.[\d_]*)?(?:[eE][+-]?[\d_]+)?)?[LlSsDdFfYy]?\b/
  960. }, {
  961. token : "constant.language.boolean",
  962. regex : "(?:true|false)\\b"
  963. }, {
  964. token : keywordMapper,
  965. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  966. }, {
  967. token : "keyword.operator",
  968. regex : "!|\\$|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|delete|typeof|void)"
  969. }, {
  970. token : "lparen",
  971. regex : "[[({]"
  972. }, {
  973. token : "rparen",
  974. regex : "[\\])}]"
  975. }, {
  976. token : "text",
  977. regex : "\\s+"
  978. }
  979. ],
  980. "comment" : [
  981. {
  982. token : "comment", // closing comment
  983. regex : ".*?\\*\\/",
  984. next : "start"
  985. }, {
  986. token : "comment", // comment spanning whole line
  987. regex : ".+"
  988. }
  989. ]
  990. };
  991. this.embedRules(DocCommentHighlightRules, "doc-",
  992. [ DocCommentHighlightRules.getEndRule("start") ]);
  993. };
  994. oop.inherits(JavaHighlightRules, TextHighlightRules);
  995. exports.JavaHighlightRules = JavaHighlightRules;
  996. });
  997. 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) {
  998. "use strict";
  999. var oop = require("../lib/oop");
  1000. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  1001. var JavaHighlightRules = require("./java_highlight_rules").JavaHighlightRules;
  1002. var JspHighlightRules = function() {
  1003. HtmlHighlightRules.call(this);
  1004. var builtinVariables = 'request|response|out|session|' +
  1005. 'application|config|pageContext|page|Exception';
  1006. var keywords = 'page|include|taglib';
  1007. var startRules = [
  1008. {
  1009. token : "comment",
  1010. regex : "<%--",
  1011. push : "jsp-dcomment"
  1012. }, {
  1013. token : "meta.tag", // jsp open tag
  1014. regex : "<%@?|<%=?|<%!?|<jsp:[^>]+>",
  1015. push : "jsp-start"
  1016. }
  1017. ];
  1018. var endRules = [
  1019. {
  1020. token : "meta.tag", // jsp close tag
  1021. regex : "%>|<\\/jsp:[^>]+>",
  1022. next : "pop"
  1023. }, {
  1024. token: "variable.language",
  1025. regex : builtinVariables
  1026. }, {
  1027. token: "keyword",
  1028. regex : keywords
  1029. }
  1030. ];
  1031. for (var key in this.$rules)
  1032. this.$rules[key].unshift.apply(this.$rules[key], startRules);
  1033. this.embedRules(JavaHighlightRules, "jsp-", endRules, ["start"]);
  1034. this.addRules({
  1035. "jsp-dcomment" : [{
  1036. token : "comment",
  1037. regex : ".*?--%>",
  1038. next : "pop"
  1039. }]
  1040. });
  1041. this.normalizeRules();
  1042. };
  1043. oop.inherits(JspHighlightRules, HtmlHighlightRules);
  1044. exports.JspHighlightRules = JspHighlightRules;
  1045. });
  1046. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  1047. "use strict";
  1048. var Range = require("../range").Range;
  1049. var MatchingBraceOutdent = function() {};
  1050. (function() {
  1051. this.checkOutdent = function(line, input) {
  1052. if (! /^\s+$/.test(line))
  1053. return false;
  1054. return /^\s*\}/.test(input);
  1055. };
  1056. this.autoOutdent = function(doc, row) {
  1057. var line = doc.getLine(row);
  1058. var match = line.match(/^(\s*\})/);
  1059. if (!match) return 0;
  1060. var column = match[1].length;
  1061. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  1062. if (!openBracePos || openBracePos.row == row) return 0;
  1063. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  1064. doc.replace(new Range(row, 0, row, column-1), indent);
  1065. };
  1066. this.$getIndent = function(line) {
  1067. return line.match(/^\s*/)[0];
  1068. };
  1069. }).call(MatchingBraceOutdent.prototype);
  1070. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  1071. });
  1072. ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
  1073. "use strict";
  1074. var oop = require("../../lib/oop");
  1075. var Range = require("../../range").Range;
  1076. var BaseFoldMode = require("./fold_mode").FoldMode;
  1077. var FoldMode = exports.FoldMode = function(commentRegex) {
  1078. if (commentRegex) {
  1079. this.foldingStartMarker = new RegExp(
  1080. this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
  1081. );
  1082. this.foldingStopMarker = new RegExp(
  1083. this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
  1084. );
  1085. }
  1086. };
  1087. oop.inherits(FoldMode, BaseFoldMode);
  1088. (function() {
  1089. this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
  1090. this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
  1091. this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
  1092. this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
  1093. this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
  1094. this._getFoldWidgetBase = this.getFoldWidget;
  1095. this.getFoldWidget = function(session, foldStyle, row) {
  1096. var line = session.getLine(row);
  1097. if (this.singleLineBlockCommentRe.test(line)) {
  1098. if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
  1099. return "";
  1100. }
  1101. var fw = this._getFoldWidgetBase(session, foldStyle, row);
  1102. if (!fw && this.startRegionRe.test(line))
  1103. return "start"; // lineCommentRegionStart
  1104. return fw;
  1105. };
  1106. this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
  1107. var line = session.getLine(row);
  1108. if (this.startRegionRe.test(line))
  1109. return this.getCommentRegionBlock(session, line, row);
  1110. var match = line.match(this.foldingStartMarker);
  1111. if (match) {
  1112. var i = match.index;
  1113. if (match[1])
  1114. return this.openingBracketBlock(session, match[1], row, i);
  1115. var range = session.getCommentFoldRange(row, i + match[0].length, 1);
  1116. if (range && !range.isMultiLine()) {
  1117. if (forceMultiline) {
  1118. range = this.getSectionRange(session, row);
  1119. } else if (foldStyle != "all")
  1120. range = null;
  1121. }
  1122. return range;
  1123. }
  1124. if (foldStyle === "markbegin")
  1125. return;
  1126. var match = line.match(this.foldingStopMarker);
  1127. if (match) {
  1128. var i = match.index + match[0].length;
  1129. if (match[1])
  1130. return this.closingBracketBlock(session, match[1], row, i);
  1131. return session.getCommentFoldRange(row, i, -1);
  1132. }
  1133. };
  1134. this.getSectionRange = function(session, row) {
  1135. var line = session.getLine(row);
  1136. var startIndent = line.search(/\S/);
  1137. var startRow = row;
  1138. var startColumn = line.length;
  1139. row = row + 1;
  1140. var endRow = row;
  1141. var maxRow = session.getLength();
  1142. while (++row < maxRow) {
  1143. line = session.getLine(row);
  1144. var indent = line.search(/\S/);
  1145. if (indent === -1)
  1146. continue;
  1147. if (startIndent > indent)
  1148. break;
  1149. var subRange = this.getFoldWidgetRange(session, "all", row);
  1150. if (subRange) {
  1151. if (subRange.start.row <= startRow) {
  1152. break;
  1153. } else if (subRange.isMultiLine()) {
  1154. row = subRange.end.row;
  1155. } else if (startIndent == indent) {
  1156. break;
  1157. }
  1158. }
  1159. endRow = row;
  1160. }
  1161. return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
  1162. };
  1163. this.getCommentRegionBlock = function(session, line, row) {
  1164. var startColumn = line.search(/\s*$/);
  1165. var maxRow = session.getLength();
  1166. var startRow = row;
  1167. var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
  1168. var depth = 1;
  1169. while (++row < maxRow) {
  1170. line = session.getLine(row);
  1171. var m = re.exec(line);
  1172. if (!m) continue;
  1173. if (m[1]) depth--;
  1174. else depth++;
  1175. if (!depth) break;
  1176. }
  1177. var endRow = row;
  1178. if (endRow > startRow) {
  1179. return new Range(startRow, startColumn, endRow, line.length);
  1180. }
  1181. };
  1182. }).call(FoldMode.prototype);
  1183. });
  1184. 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) {
  1185. "use strict";
  1186. var oop = require("../lib/oop");
  1187. var TextMode = require("./text").Mode;
  1188. var JspHighlightRules = require("./jsp_highlight_rules").JspHighlightRules;
  1189. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  1190. var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
  1191. var CStyleFoldMode = require("./folding/cstyle").FoldMode;
  1192. var Mode = function() {
  1193. this.HighlightRules = JspHighlightRules;
  1194. this.$outdent = new MatchingBraceOutdent();
  1195. this.$behaviour = new CstyleBehaviour();
  1196. this.foldingRules = new CStyleFoldMode();
  1197. };
  1198. oop.inherits(Mode, TextMode);
  1199. (function() {
  1200. this.$id = "ace/mode/jsp";
  1201. }).call(Mode.prototype);
  1202. exports.Mode = Mode;
  1203. });