mode-liquid.js 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976
  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 = "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|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. token : "comment.doc.tag",
  143. regex : "\\bTODO\\b"
  144. }, {
  145. defaultToken : "comment.doc"
  146. }]
  147. };
  148. };
  149. oop.inherits(DocCommentHighlightRules, TextHighlightRules);
  150. DocCommentHighlightRules.getStartRule = function(start) {
  151. return {
  152. token : "comment.doc", // doc comment
  153. regex : "\\/\\*(?=\\*)",
  154. next : start
  155. };
  156. };
  157. DocCommentHighlightRules.getEndRule = function (start) {
  158. return {
  159. token : "comment.doc", // closing comment
  160. regex : "\\*\\/",
  161. next : start
  162. };
  163. };
  164. exports.DocCommentHighlightRules = DocCommentHighlightRules;
  165. });
  166. 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) {
  167. "use strict";
  168. var oop = require("../lib/oop");
  169. var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
  170. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  171. var JavaScriptHighlightRules = function() {
  172. var keywordMapper = this.createKeywordMapper({
  173. "variable.language":
  174. "Array|Boolean|Date|Function|Iterator|Number|Object|RegExp|String|Proxy|" + // Constructors
  175. "Namespace|QName|XML|XMLList|" + // E4X
  176. "ArrayBuffer|Float32Array|Float64Array|Int16Array|Int32Array|Int8Array|" +
  177. "Uint16Array|Uint32Array|Uint8Array|Uint8ClampedArray|" +
  178. "Error|EvalError|InternalError|RangeError|ReferenceError|StopIteration|" + // Errors
  179. "SyntaxError|TypeError|URIError|" +
  180. "decodeURI|decodeURIComponent|encodeURI|encodeURIComponent|eval|isFinite|" + // Non-constructor functions
  181. "isNaN|parseFloat|parseInt|" +
  182. "JSON|Math|" + // Other
  183. "this|arguments|prototype|window|document" , // Pseudo
  184. "keyword":
  185. "const|yield|import|get|set|" +
  186. "break|case|catch|continue|default|delete|do|else|finally|for|function|" +
  187. "if|in|instanceof|new|return|switch|throw|try|typeof|let|var|while|with|debugger|" +
  188. "__parent__|__count__|escape|unescape|with|__proto__|" +
  189. "class|enum|extends|super|export|implements|private|public|interface|package|protected|static",
  190. "storage.type":
  191. "const|let|var|function",
  192. "constant.language":
  193. "null|Infinity|NaN|undefined",
  194. "support.function":
  195. "alert",
  196. "constant.language.boolean": "true|false"
  197. }, "identifier");
  198. var kwBeforeRe = "case|do|else|finally|in|instanceof|return|throw|try|typeof|yield|void";
  199. var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
  200. var escapedRe = "\\\\(?:x[0-9a-fA-F]{2}|" + // hex
  201. "u[0-9a-fA-F]{4}|" + // unicode
  202. "[0-2][0-7]{0,2}|" + // oct
  203. "3[0-6][0-7]?|" + // oct
  204. "37[0-7]?|" + // oct
  205. "[4-7][0-7]?|" + //oct
  206. ".)";
  207. this.$rules = {
  208. "no_regex" : [
  209. {
  210. token : "comment",
  211. regex : "\\/\\/",
  212. next : "line_comment"
  213. },
  214. DocCommentHighlightRules.getStartRule("doc-start"),
  215. {
  216. token : "comment", // multi line comment
  217. regex : /\/\*/,
  218. next : "comment"
  219. }, {
  220. token : "string",
  221. regex : "'(?=.)",
  222. next : "qstring"
  223. }, {
  224. token : "string",
  225. regex : '"(?=.)',
  226. next : "qqstring"
  227. }, {
  228. token : "constant.numeric", // hex
  229. regex : /0[xX][0-9a-fA-F]+\b/
  230. }, {
  231. token : "constant.numeric", // float
  232. regex : /[+-]?\d+(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
  233. }, {
  234. token : [
  235. "storage.type", "punctuation.operator", "support.function",
  236. "punctuation.operator", "entity.name.function", "text","keyword.operator"
  237. ],
  238. regex : "(" + identifierRe + ")(\\.)(prototype)(\\.)(" + identifierRe +")(\\s*)(=)",
  239. next: "function_arguments"
  240. }, {
  241. token : [
  242. "storage.type", "punctuation.operator", "entity.name.function", "text",
  243. "keyword.operator", "text", "storage.type", "text", "paren.lparen"
  244. ],
  245. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  246. next: "function_arguments"
  247. }, {
  248. token : [
  249. "entity.name.function", "text", "keyword.operator", "text", "storage.type",
  250. "text", "paren.lparen"
  251. ],
  252. regex : "(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s*)(\\()",
  253. next: "function_arguments"
  254. }, {
  255. token : [
  256. "storage.type", "punctuation.operator", "entity.name.function", "text",
  257. "keyword.operator", "text",
  258. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  259. ],
  260. regex : "(" + identifierRe + ")(\\.)(" + identifierRe +")(\\s*)(=)(\\s*)(function)(\\s+)(\\w+)(\\s*)(\\()",
  261. next: "function_arguments"
  262. }, {
  263. token : [
  264. "storage.type", "text", "entity.name.function", "text", "paren.lparen"
  265. ],
  266. regex : "(function)(\\s+)(" + identifierRe + ")(\\s*)(\\()",
  267. next: "function_arguments"
  268. }, {
  269. token : [
  270. "entity.name.function", "text", "punctuation.operator",
  271. "text", "storage.type", "text", "paren.lparen"
  272. ],
  273. regex : "(" + identifierRe + ")(\\s*)(:)(\\s*)(function)(\\s*)(\\()",
  274. next: "function_arguments"
  275. }, {
  276. token : [
  277. "text", "text", "storage.type", "text", "paren.lparen"
  278. ],
  279. regex : "(:)(\\s*)(function)(\\s*)(\\()",
  280. next: "function_arguments"
  281. }, {
  282. token : "keyword",
  283. regex : "(?:" + kwBeforeRe + ")\\b",
  284. next : "start"
  285. }, {
  286. token : ["punctuation.operator", "support.function"],
  287. 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(?=\()/
  288. }, {
  289. token : ["punctuation.operator", "support.function.dom"],
  290. 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)|ById)|Attribute(?:Node)?)|blur)\b(?=\()/
  291. }, {
  292. token : ["punctuation.operator", "support.constant"],
  293. 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/
  294. }, {
  295. token : ["support.constant"],
  296. regex : /that\b/
  297. }, {
  298. token : ["storage.type", "punctuation.operator", "support.function.firebug"],
  299. regex : /(console)(\.)(warn|info|log|error|time|trace|timeEnd|assert)\b/
  300. }, {
  301. token : keywordMapper,
  302. regex : identifierRe
  303. }, {
  304. token : "keyword.operator",
  305. regex : /--|\+\+|[!$%&*+\-~]|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|%=|\+=|\-=|&=|\^=/,
  306. next : "start"
  307. }, {
  308. token : "punctuation.operator",
  309. regex : /\?|\:|\,|\;|\./,
  310. next : "start"
  311. }, {
  312. token : "paren.lparen",
  313. regex : /[\[({]/,
  314. next : "start"
  315. }, {
  316. token : "paren.rparen",
  317. regex : /[\])}]/
  318. }, {
  319. token : "keyword.operator",
  320. regex : /\/=?/,
  321. next : "start"
  322. }, {
  323. token: "comment",
  324. regex: /^#!.*$/
  325. }
  326. ],
  327. "start": [
  328. DocCommentHighlightRules.getStartRule("doc-start"),
  329. {
  330. token : "comment", // multi line comment
  331. regex : "\\/\\*",
  332. next : "comment_regex_allowed"
  333. }, {
  334. token : "comment",
  335. regex : "\\/\\/",
  336. next : "line_comment_regex_allowed"
  337. }, {
  338. token: "string.regexp",
  339. regex: "\\/",
  340. next: "regex"
  341. }, {
  342. token : "text",
  343. regex : "\\s+|^$",
  344. next : "start"
  345. }, {
  346. token: "empty",
  347. regex: "",
  348. next: "no_regex"
  349. }
  350. ],
  351. "regex": [
  352. {
  353. token: "regexp.keyword.operator",
  354. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  355. }, {
  356. token: "string.regexp",
  357. regex: "/[sxngimy]*",
  358. next: "no_regex"
  359. }, {
  360. token : "invalid",
  361. regex: /\{\d+\b,?\d*\}[+*]|[+*$^?][+*]|[$^][?]|\?{3,}/
  362. }, {
  363. token : "constant.language.escape",
  364. regex: /\(\?[:=!]|\)|\{\d+\b,?\d*\}|[+*]\?|[()$^+*?.]/
  365. }, {
  366. token : "constant.language.delimiter",
  367. regex: /\|/
  368. }, {
  369. token: "constant.language.escape",
  370. regex: /\[\^?/,
  371. next: "regex_character_class"
  372. }, {
  373. token: "empty",
  374. regex: "$",
  375. next: "no_regex"
  376. }, {
  377. defaultToken: "string.regexp"
  378. }
  379. ],
  380. "regex_character_class": [
  381. {
  382. token: "regexp.keyword.operator",
  383. regex: "\\\\(?:u[\\da-fA-F]{4}|x[\\da-fA-F]{2}|.)"
  384. }, {
  385. token: "constant.language.escape",
  386. regex: "]",
  387. next: "regex"
  388. }, {
  389. token: "constant.language.escape",
  390. regex: "-"
  391. }, {
  392. token: "empty",
  393. regex: "$",
  394. next: "no_regex"
  395. }, {
  396. defaultToken: "string.regexp.charachterclass"
  397. }
  398. ],
  399. "function_arguments": [
  400. {
  401. token: "variable.parameter",
  402. regex: identifierRe
  403. }, {
  404. token: "punctuation.operator",
  405. regex: "[, ]+"
  406. }, {
  407. token: "punctuation.operator",
  408. regex: "$"
  409. }, {
  410. token: "empty",
  411. regex: "",
  412. next: "no_regex"
  413. }
  414. ],
  415. "comment_regex_allowed" : [
  416. {token : "comment", regex : "\\*\\/", next : "start"},
  417. {defaultToken : "comment"}
  418. ],
  419. "comment" : [
  420. {token : "comment", regex : "\\*\\/", next : "no_regex"},
  421. {defaultToken : "comment"}
  422. ],
  423. "line_comment_regex_allowed" : [
  424. {token : "comment", regex : "$|^", next : "start"},
  425. {defaultToken : "comment"}
  426. ],
  427. "line_comment" : [
  428. {token : "comment", regex : "$|^", next : "no_regex"},
  429. {defaultToken : "comment"}
  430. ],
  431. "qqstring" : [
  432. {
  433. token : "constant.language.escape",
  434. regex : escapedRe
  435. }, {
  436. token : "string",
  437. regex : "\\\\$",
  438. next : "qqstring"
  439. }, {
  440. token : "string",
  441. regex : '"|$',
  442. next : "no_regex"
  443. }, {
  444. defaultToken: "string"
  445. }
  446. ],
  447. "qstring" : [
  448. {
  449. token : "constant.language.escape",
  450. regex : escapedRe
  451. }, {
  452. token : "string",
  453. regex : "\\\\$",
  454. next : "qstring"
  455. }, {
  456. token : "string",
  457. regex : "'|$",
  458. next : "no_regex"
  459. }, {
  460. defaultToken: "string"
  461. }
  462. ]
  463. };
  464. this.embedRules(DocCommentHighlightRules, "doc-",
  465. [ DocCommentHighlightRules.getEndRule("no_regex") ]);
  466. };
  467. oop.inherits(JavaScriptHighlightRules, TextHighlightRules);
  468. exports.JavaScriptHighlightRules = JavaScriptHighlightRules;
  469. });
  470. ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
  471. "use strict";
  472. var oop = require("../lib/oop");
  473. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  474. var XmlHighlightRules = function(normalize) {
  475. this.$rules = {
  476. start : [
  477. {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
  478. {
  479. token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
  480. regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
  481. },
  482. {
  483. token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
  484. regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
  485. },
  486. {token : "comment.xml", regex : "<\\!--", next : "comment"},
  487. {
  488. token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
  489. regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
  490. },
  491. {include : "tag"},
  492. {token : "text.end-tag-open.xml", regex: "</"},
  493. {token : "text.tag-open.xml", regex: "<"},
  494. {include : "reference"},
  495. {defaultToken : "text.xml"}
  496. ],
  497. xml_decl : [{
  498. token : "entity.other.attribute-name.decl-attribute-name.xml",
  499. regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
  500. }, {
  501. token : "keyword.operator.decl-attribute-equals.xml",
  502. regex : "="
  503. }, {
  504. include: "whitespace"
  505. }, {
  506. include: "string"
  507. }, {
  508. token : "punctuation.xml-decl.xml",
  509. regex : "\\?>",
  510. next : "start"
  511. }],
  512. processing_instruction : [
  513. {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
  514. {defaultToken : "instruction.xml"}
  515. ],
  516. doctype : [
  517. {include : "whitespace"},
  518. {include : "string"},
  519. {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
  520. {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
  521. {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
  522. ],
  523. int_subset : [{
  524. token : "text.xml",
  525. regex : "\\s+"
  526. }, {
  527. token: "punctuation.int-subset.xml",
  528. regex: "]",
  529. next: "pop"
  530. }, {
  531. token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
  532. regex : "(<\\!)([-_a-zA-Z0-9]+)",
  533. push : [{
  534. token : "text",
  535. regex : "\\s+"
  536. },
  537. {
  538. token : "punctuation.markup-decl.xml",
  539. regex : ">",
  540. next : "pop"
  541. },
  542. {include : "string"}]
  543. }],
  544. cdata : [
  545. {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
  546. {token : "text.xml", regex : "\\s+"},
  547. {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
  548. ],
  549. comment : [
  550. {token : "comment.xml", regex : "-->", next : "start"},
  551. {defaultToken : "comment.xml"}
  552. ],
  553. reference : [{
  554. token : "constant.language.escape.reference.xml",
  555. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  556. }],
  557. attr_reference : [{
  558. token : "constant.language.escape.reference.attribute-value.xml",
  559. regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
  560. }],
  561. tag : [{
  562. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
  563. regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
  564. next: [
  565. {include : "attributes"},
  566. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  567. ]
  568. }],
  569. tag_whitespace : [
  570. {token : "text.tag-whitespace.xml", regex : "\\s+"}
  571. ],
  572. whitespace : [
  573. {token : "text.whitespace.xml", regex : "\\s+"}
  574. ],
  575. string: [{
  576. token : "string.xml",
  577. regex : "'",
  578. push : [
  579. {token : "string.xml", regex: "'", next: "pop"},
  580. {defaultToken : "string.xml"}
  581. ]
  582. }, {
  583. token : "string.xml",
  584. regex : '"',
  585. push : [
  586. {token : "string.xml", regex: '"', next: "pop"},
  587. {defaultToken : "string.xml"}
  588. ]
  589. }],
  590. attributes: [{
  591. token : "entity.other.attribute-name.xml",
  592. regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
  593. }, {
  594. token : "keyword.operator.attribute-equals.xml",
  595. regex : "="
  596. }, {
  597. include: "tag_whitespace"
  598. }, {
  599. include: "attribute_value"
  600. }],
  601. attribute_value: [{
  602. token : "string.attribute-value.xml",
  603. regex : "'",
  604. push : [
  605. {token : "string.attribute-value.xml", regex: "'", next: "pop"},
  606. {include : "attr_reference"},
  607. {defaultToken : "string.attribute-value.xml"}
  608. ]
  609. }, {
  610. token : "string.attribute-value.xml",
  611. regex : '"',
  612. push : [
  613. {token : "string.attribute-value.xml", regex: '"', next: "pop"},
  614. {include : "attr_reference"},
  615. {defaultToken : "string.attribute-value.xml"}
  616. ]
  617. }]
  618. };
  619. if (this.constructor === XmlHighlightRules)
  620. this.normalizeRules();
  621. };
  622. (function() {
  623. this.embedTagRules = function(HighlightRules, prefix, tag){
  624. this.$rules.tag.unshift({
  625. token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  626. regex : "(<)(" + tag + "(?=\\s|>|$))",
  627. next: [
  628. {include : "attributes"},
  629. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
  630. ]
  631. });
  632. this.$rules[tag + "-end"] = [
  633. {include : "attributes"},
  634. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
  635. onMatch : function(value, currentState, stack) {
  636. stack.splice(0);
  637. return this.token;
  638. }}
  639. ]
  640. this.embedRules(HighlightRules, prefix, [{
  641. token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
  642. regex : "(</)(" + tag + "(?=\\s|>|$))",
  643. next: tag + "-end"
  644. }, {
  645. token: "string.cdata.xml",
  646. regex : "<\\!\\[CDATA\\["
  647. }, {
  648. token: "string.cdata.xml",
  649. regex : "\\]\\]>"
  650. }]);
  651. };
  652. }).call(TextHighlightRules.prototype);
  653. oop.inherits(XmlHighlightRules, TextHighlightRules);
  654. exports.XmlHighlightRules = XmlHighlightRules;
  655. });
  656. 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) {
  657. "use strict";
  658. var oop = require("../lib/oop");
  659. var lang = require("../lib/lang");
  660. var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
  661. var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
  662. var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
  663. var tagMap = lang.createMap({
  664. a : 'anchor',
  665. button : 'form',
  666. form : 'form',
  667. img : 'image',
  668. input : 'form',
  669. label : 'form',
  670. option : 'form',
  671. script : 'script',
  672. select : 'form',
  673. textarea : 'form',
  674. style : 'style',
  675. table : 'table',
  676. tbody : 'table',
  677. td : 'table',
  678. tfoot : 'table',
  679. th : 'table',
  680. tr : 'table'
  681. });
  682. var HtmlHighlightRules = function() {
  683. XmlHighlightRules.call(this);
  684. this.addRules({
  685. attributes: [{
  686. include : "tag_whitespace"
  687. }, {
  688. token : "entity.other.attribute-name.xml",
  689. regex : "[-_a-zA-Z0-9:]+"
  690. }, {
  691. token : "keyword.operator.attribute-equals.xml",
  692. regex : "=",
  693. push : [{
  694. include: "tag_whitespace"
  695. }, {
  696. token : "string.unquoted.attribute-value.html",
  697. regex : "[^<>='\"`\\s]+",
  698. next : "pop"
  699. }, {
  700. token : "empty",
  701. regex : "",
  702. next : "pop"
  703. }]
  704. }, {
  705. include : "attribute_value"
  706. }],
  707. tag: [{
  708. token : function(start, tag) {
  709. var group = tagMap[tag];
  710. return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
  711. "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
  712. },
  713. regex : "(</?)([-_a-zA-Z0-9:]+)",
  714. next: "tag_stuff"
  715. }],
  716. tag_stuff: [
  717. {include : "attributes"},
  718. {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
  719. ],
  720. });
  721. this.embedTagRules(CssHighlightRules, "css-", "style");
  722. this.embedTagRules(JavaScriptHighlightRules, "js-", "script");
  723. if (this.constructor === HtmlHighlightRules)
  724. this.normalizeRules();
  725. };
  726. oop.inherits(HtmlHighlightRules, XmlHighlightRules);
  727. exports.HtmlHighlightRules = HtmlHighlightRules;
  728. });
  729. ace.define("ace/mode/liquid_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/html_highlight_rules"], function(require, exports, module) {
  730. "use strict";
  731. var oop = require("../lib/oop");
  732. var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
  733. var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
  734. var LiquidHighlightRules = function() {
  735. HtmlHighlightRules.call(this);
  736. var functions = (
  737. "date|capitalize|downcase|upcase|first|last|join|sort|map|size|escape|" +
  738. "escape_once|strip_html|strip_newlines|newline_to_br|replace|replace_first|" +
  739. "truncate|truncatewords|prepend|append|minus|plus|times|divided_by|split"
  740. );
  741. var keywords = (
  742. "capture|endcapture|case|endcase|when|comment|endcomment|" +
  743. "cycle|for|endfor|in|reversed|if|endif|else|elsif|include|endinclude|unless|endunless|" +
  744. "style|text|image|widget|plugin|marker|endmarker|tablerow|endtablerow"
  745. );
  746. var builtinVariables = 'forloop|tablerowloop';
  747. var definitions = ("assign");
  748. var keywordMapper = this.createKeywordMapper({
  749. "variable.language": builtinVariables,
  750. "keyword": keywords,
  751. "support.function": functions,
  752. "keyword.definition": definitions
  753. }, "identifier");
  754. for (var rule in this.$rules) {
  755. this.$rules[rule].unshift({
  756. token : "variable",
  757. regex : "{%",
  758. push : "liquid-start"
  759. }, {
  760. token : "variable",
  761. regex : "{{",
  762. push : "liquid-start"
  763. });
  764. }
  765. this.addRules({
  766. "liquid-start" : [{
  767. token: "variable",
  768. regex: "}}",
  769. next: "pop"
  770. }, {
  771. token: "variable",
  772. regex: "%}",
  773. next: "pop"
  774. }, {
  775. token : "string", // single line
  776. regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]'
  777. }, {
  778. token : "string", // single line
  779. regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']"
  780. }, {
  781. token : "constant.numeric", // hex
  782. regex : "0[xX][0-9a-fA-F]+\\b"
  783. }, {
  784. token : "constant.numeric", // float
  785. regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b"
  786. }, {
  787. token : "constant.language.boolean",
  788. regex : "(?:true|false)\\b"
  789. }, {
  790. token : keywordMapper,
  791. regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
  792. }, {
  793. token : "keyword.operator",
  794. regex : "\/|\\*|\\-|\\+|=|!=|\\?\\:"
  795. }, {
  796. token : "paren.lparen",
  797. regex : /[\[\({]/
  798. }, {
  799. token : "paren.rparen",
  800. regex : /[\])}]/
  801. }, {
  802. token : "text",
  803. regex : "\\s+"
  804. }]
  805. });
  806. this.normalizeRules();
  807. };
  808. oop.inherits(LiquidHighlightRules, TextHighlightRules);
  809. exports.LiquidHighlightRules = LiquidHighlightRules;
  810. });
  811. ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
  812. "use strict";
  813. var Range = require("../range").Range;
  814. var MatchingBraceOutdent = function() {};
  815. (function() {
  816. this.checkOutdent = function(line, input) {
  817. if (! /^\s+$/.test(line))
  818. return false;
  819. return /^\s*\}/.test(input);
  820. };
  821. this.autoOutdent = function(doc, row) {
  822. var line = doc.getLine(row);
  823. var match = line.match(/^(\s*\})/);
  824. if (!match) return 0;
  825. var column = match[1].length;
  826. var openBracePos = doc.findMatchingBracket({row: row, column: column});
  827. if (!openBracePos || openBracePos.row == row) return 0;
  828. var indent = this.$getIndent(doc.getLine(openBracePos.row));
  829. doc.replace(new Range(row, 0, row, column-1), indent);
  830. };
  831. this.$getIndent = function(line) {
  832. return line.match(/^\s*/)[0];
  833. };
  834. }).call(MatchingBraceOutdent.prototype);
  835. exports.MatchingBraceOutdent = MatchingBraceOutdent;
  836. });
  837. ace.define("ace/mode/liquid",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/liquid_highlight_rules","ace/mode/matching_brace_outdent","ace/range"], function(require, exports, module) {
  838. var oop = require("../lib/oop");
  839. var TextMode = require("./text").Mode;
  840. var LiquidHighlightRules = require("./liquid_highlight_rules").LiquidHighlightRules;
  841. var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
  842. var Range = require("../range").Range;
  843. var Mode = function() {
  844. this.HighlightRules = LiquidHighlightRules;
  845. this.$outdent = new MatchingBraceOutdent();
  846. };
  847. oop.inherits(Mode, TextMode);
  848. (function() {
  849. this.blockComment = {start: "<!--", end: "-->"};
  850. this.getNextLineIndent = function(state, line, tab) {
  851. var indent = this.$getIndent(line);
  852. var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
  853. var tokens = tokenizedLine.tokens;
  854. var endState = tokenizedLine.state;
  855. if (tokens.length && tokens[tokens.length-1].type == "comment") {
  856. return indent;
  857. }
  858. if (state == "start") {
  859. var match = line.match(/^.*[\{\(\[]\s*$/);
  860. if (match) {
  861. indent += tab;
  862. }
  863. }
  864. return indent;
  865. };
  866. this.checkOutdent = function(state, line, input) {
  867. return this.$outdent.checkOutdent(line, input);
  868. };
  869. this.autoOutdent = function(state, doc, row) {
  870. this.$outdent.autoOutdent(doc, row);
  871. };
  872. this.$id = "ace/mode/liquid";
  873. }).call(Mode.prototype);
  874. exports.Mode = Mode;
  875. });