| 1 |
ace.define("ace/mode/css_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict"; |
| 2 |
var oop = require("../lib/oop"); |
| 3 |
var lang = require("../lib/lang"); |
| 4 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
| 5 |
var supportType = exports.supportType = "align-content|align-items|align-self|all|animation|animation-delay|animation-direction|animation-duration|animation-fill-mode|animation-iteration-count|animation-name|animation-play-state|animation-timing-function|backface-visibility|background|background-attachment|background-blend-mode|background-clip|background-color|background-image|background-origin|background-position|background-repeat|background-size|border|border-bottom|border-bottom-color|border-bottom-left-radius|border-bottom-right-radius|border-bottom-style|border-bottom-width|border-collapse|border-color|border-image|border-image-outset|border-image-repeat|border-image-slice|border-image-source|border-image-width|border-left|border-left-color|border-left-style|border-left-width|border-radius|border-right|border-right-color|border-right-style|border-right-width|border-spacing|border-style|border-top|border-top-color|border-top-left-radius|border-top-right-radius|border-top-style|border-top-width|border-width|bottom|box-shadow|box-sizing|caption-side|clear|clip|color|column-count|column-fill|column-gap|column-rule|column-rule-color|column-rule-style|column-rule-width|column-span|column-width|columns|content|counter-increment|counter-reset|cursor|direction|display|empty-cells|filter|flex|flex-basis|flex-direction|flex-flow|flex-grow|flex-shrink|flex-wrap|float|font|font-family|font-size|font-size-adjust|font-stretch|font-style|font-variant|font-weight|hanging-punctuation|height|justify-content|left|letter-spacing|line-height|list-style|list-style-image|list-style-position|list-style-type|margin|margin-bottom|margin-left|margin-right|margin-top|max-height|max-width|max-zoom|min-height|min-width|min-zoom|nav-down|nav-index|nav-left|nav-right|nav-up|opacity|order|outline|outline-color|outline-offset|outline-style|outline-width|overflow|overflow-x|overflow-y|padding|padding-bottom|padding-left|padding-right|padding-top|page-break-after|page-break-before|page-break-inside|perspective|perspective-origin|position|quotes|resize|right|tab-size|table-layout|text-align|text-align-last|text-decoration|text-decoration-color|text-decoration-line|text-decoration-style|text-indent|text-justify|text-overflow|text-shadow|text-transform|top|transform|transform-origin|transform-style|transition|transition-delay|transition-duration|transition-property|transition-timing-function|unicode-bidi|user-select|user-zoom|vertical-align|visibility|white-space|width|word-break|word-spacing|word-wrap|z-index"; |
| 6 |
var supportFunction = exports.supportFunction = "rgb|rgba|url|attr|counter|counters"; |
| 7 |
var supportConstant = exports.supportConstant = "absolute|after-edge|after|all-scroll|all|alphabetic|always|antialiased|armenian|auto|avoid-column|avoid-page|avoid|balance|baseline|before-edge|before|below|bidi-override|block-line-height|block|bold|bolder|border-box|both|bottom|box|break-all|break-word|capitalize|caps-height|caption|center|central|char|circle|cjk-ideographic|clone|close-quote|col-resize|collapse|column|consider-shifts|contain|content-box|cover|crosshair|cubic-bezier|dashed|decimal-leading-zero|decimal|default|disabled|disc|disregard-shifts|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in|ease-in-out|ease-out|ease|ellipsis|end|exclude-ruby|flex-end|flex-start|fill|fixed|georgian|glyphs|grid-height|groove|hand|hanging|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|icon|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|ideographic|inactive|include-ruby|inherit|initial|inline-block|inline-box|inline-line-height|inline-table|inline|inset|inside|inter-ideograph|inter-word|invert|italic|justify|katakana-iroha|katakana|keep-all|last|left|lighter|line-edge|line-through|line|linear|list-item|local|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|mathematical|max-height|max-size|medium|menu|message-box|middle|move|n-resize|ne-resize|newspaper|no-change|no-close-quote|no-drop|no-open-quote|no-repeat|none|normal|not-allowed|nowrap|nw-resize|oblique|open-quote|outset|outside|overline|padding-box|page|pointer|pre-line|pre-wrap|pre|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|replaced|reset-size|ridge|right|round|row-resize|rtl|s-resize|scroll|se-resize|separate|slice|small-caps|small-caption|solid|space|square|start|static|status-bar|step-end|step-start|steps|stretch|strict|sub|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-after-edge|text-before-edge|text-bottom|text-size|text-top|text|thick|thin|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|use-script|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|z-index|zero|zoom"; |
| 8 |
var supportConstantColor = exports.supportConstantColor = "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen"; |
| 9 |
var supportConstantFonts = exports.supportConstantFonts = "arial|century|comic|courier|cursive|fantasy|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace"; |
| 10 |
var numRe = exports.numRe = "\\-?(?:(?:[0-9]+(?:\\.[0-9]+)?)|(?:\\.[0-9]+))"; |
| 11 |
var pseudoElements = exports.pseudoElements = "(\\:+)\\b(after|before|first-letter|first-line|moz-selection|selection)\\b"; |
| 12 |
var pseudoClasses = exports.pseudoClasses = "(:)\\b(active|checked|disabled|empty|enabled|first-child|first-of-type|focus|hover|indeterminate|invalid|last-child|last-of-type|link|not|nth-child|nth-last-child|nth-last-of-type|nth-of-type|only-child|only-of-type|required|root|target|valid|visited)\\b"; |
| 13 |
var CssHighlightRules = function () { |
| 14 |
var keywordMapper = this.createKeywordMapper({ |
| 15 |
"support.function": supportFunction, |
| 16 |
"support.constant": supportConstant, |
| 17 |
"support.type": supportType, |
| 18 |
"support.constant.color": supportConstantColor, |
| 19 |
"support.constant.fonts": supportConstantFonts |
| 20 |
}, "text", true); |
| 21 |
this.$rules = { |
| 22 |
"start": [{ |
| 23 |
include: ["strings", "url", "comments"] |
| 24 |
}, { |
| 25 |
token: "paren.lparen", |
| 26 |
regex: "\\{", |
| 27 |
next: "ruleset" |
| 28 |
}, { |
| 29 |
token: "paren.rparen", |
| 30 |
regex: "\\}" |
| 31 |
}, { |
| 32 |
token: "string", |
| 33 |
regex: "@(?!viewport)", |
| 34 |
next: "media" |
| 35 |
}, { |
| 36 |
token: "keyword", |
| 37 |
regex: "#[a-z0-9-_]+" |
| 38 |
}, { |
| 39 |
token: "keyword", |
| 40 |
regex: "%" |
| 41 |
}, { |
| 42 |
token: "variable", |
| 43 |
regex: "\\.[a-z0-9-_]+" |
| 44 |
}, { |
| 45 |
token: "string", |
| 46 |
regex: ":[a-z0-9-_]+" |
| 47 |
}, { |
| 48 |
token: "constant.numeric", |
| 49 |
regex: numRe |
| 50 |
}, { |
| 51 |
token: "constant", |
| 52 |
regex: "[a-z0-9-_]+" |
| 53 |
}, { |
| 54 |
caseInsensitive: true |
| 55 |
}], |
| 56 |
"media": [{ |
| 57 |
include: ["strings", "url", "comments"] |
| 58 |
}, { |
| 59 |
token: "paren.lparen", |
| 60 |
regex: "\\{", |
| 61 |
next: "start" |
| 62 |
}, { |
| 63 |
token: "paren.rparen", |
| 64 |
regex: "\\}", |
| 65 |
next: "start" |
| 66 |
}, { |
| 67 |
token: "string", |
| 68 |
regex: ";", |
| 69 |
next: "start" |
| 70 |
}, { |
| 71 |
token: "keyword", |
| 72 |
regex: "(?:media|supports|document|charset|import|namespace|media|supports|document" |
| 73 |
+ "|page|font|keyframes|viewport|counter-style|font-feature-values" |
| 74 |
+ "|swash|ornaments|annotation|stylistic|styleset|character-variant)" |
| 75 |
}], |
| 76 |
"comments": [{ |
| 77 |
token: "comment", |
| 78 |
regex: "\\/\\*", |
| 79 |
push: [{ |
| 80 |
token: "comment", |
| 81 |
regex: "\\*\\/", |
| 82 |
next: "pop" |
| 83 |
}, { |
| 84 |
defaultToken: "comment" |
| 85 |
}] |
| 86 |
}], |
| 87 |
"ruleset": [{ |
| 88 |
regex: "-(webkit|ms|moz|o)-", |
| 89 |
token: "text" |
| 90 |
}, { |
| 91 |
token: "punctuation.operator", |
| 92 |
regex: "[:;]" |
| 93 |
}, { |
| 94 |
token: "paren.rparen", |
| 95 |
regex: "\\}", |
| 96 |
next: "start" |
| 97 |
}, { |
| 98 |
include: ["strings", "url", "comments"] |
| 99 |
}, { |
| 100 |
token: ["constant.numeric", "keyword"], |
| 101 |
regex: "(" + numRe + ")(ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vm|vw|%)" |
| 102 |
}, { |
| 103 |
token: "constant.numeric", |
| 104 |
regex: numRe |
| 105 |
}, { |
| 106 |
token: "constant.numeric", |
| 107 |
regex: "#[a-f0-9]{6}" |
| 108 |
}, { |
| 109 |
token: "constant.numeric", |
| 110 |
regex: "#[a-f0-9]{3}" |
| 111 |
}, { |
| 112 |
token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"], |
| 113 |
regex: pseudoElements |
| 114 |
}, { |
| 115 |
token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"], |
| 116 |
regex: pseudoClasses |
| 117 |
}, { |
| 118 |
include: "url" |
| 119 |
}, { |
| 120 |
token: keywordMapper, |
| 121 |
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" |
| 122 |
}, { |
| 123 |
caseInsensitive: true |
| 124 |
}], |
| 125 |
url: [{ |
| 126 |
token: "support.function", |
| 127 |
regex: "(?:url(:?-prefix)?|domain|regexp)\\(", |
| 128 |
push: [{ |
| 129 |
token: "support.function", |
| 130 |
regex: "\\)", |
| 131 |
next: "pop" |
| 132 |
}, { |
| 133 |
defaultToken: "string" |
| 134 |
}] |
| 135 |
}], |
| 136 |
strings: [{ |
| 137 |
token: "string.start", |
| 138 |
regex: "'", |
| 139 |
push: [{ |
| 140 |
token: "string.end", |
| 141 |
regex: "'|$", |
| 142 |
next: "pop" |
| 143 |
}, { |
| 144 |
include: "escapes" |
| 145 |
}, { |
| 146 |
token: "constant.language.escape", |
| 147 |
regex: /\\$/, |
| 148 |
consumeLineEnd: true |
| 149 |
}, { |
| 150 |
defaultToken: "string" |
| 151 |
}] |
| 152 |
}, { |
| 153 |
token: "string.start", |
| 154 |
regex: '"', |
| 155 |
push: [{ |
| 156 |
token: "string.end", |
| 157 |
regex: '"|$', |
| 158 |
next: "pop" |
| 159 |
}, { |
| 160 |
include: "escapes" |
| 161 |
}, { |
| 162 |
token: "constant.language.escape", |
| 163 |
regex: /\\$/, |
| 164 |
consumeLineEnd: true |
| 165 |
}, { |
| 166 |
defaultToken: "string" |
| 167 |
}] |
| 168 |
}], |
| 169 |
escapes: [{ |
| 170 |
token: "constant.language.escape", |
| 171 |
regex: /\\([a-fA-F\d]{1,6}|[^a-fA-F\d])/ |
| 172 |
}] |
| 173 |
}; |
| 174 |
this.normalizeRules(); |
| 175 |
}; |
| 176 |
oop.inherits(CssHighlightRules, TextHighlightRules); |
| 177 |
exports.CssHighlightRules = CssHighlightRules; |
| 178 |
|
| 179 |
}); |
| 180 |
|
| 181 |
ace.define("ace/mode/stylus_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules","ace/mode/css_highlight_rules"], function(require, exports, module){ |
| 182 |
|
| 183 |
"use strict"; |
| 184 |
var oop = require("../lib/oop"); |
| 185 |
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
| 186 |
var CssHighlightRules = require("./css_highlight_rules"); |
| 187 |
var StylusHighlightRules = function () { |
| 188 |
var keywordMapper = this.createKeywordMapper({ |
| 189 |
"support.type": CssHighlightRules.supportType, |
| 190 |
"support.function": CssHighlightRules.supportFunction, |
| 191 |
"support.constant": CssHighlightRules.supportConstant, |
| 192 |
"support.constant.color": CssHighlightRules.supportConstantColor, |
| 193 |
"support.constant.fonts": CssHighlightRules.supportConstantFonts |
| 194 |
}, "text", true); |
| 195 |
this.$rules = { |
| 196 |
start: [ |
| 197 |
{ |
| 198 |
token: "comment", |
| 199 |
regex: /\/\/.*$/ |
| 200 |
}, |
| 201 |
{ |
| 202 |
token: "comment", |
| 203 |
regex: /\/\*/, |
| 204 |
next: "comment" |
| 205 |
}, |
| 206 |
{ |
| 207 |
token: ["entity.name.function.stylus", "text"], |
| 208 |
regex: "^([-a-zA-Z_][-\\w]*)?(\\()" |
| 209 |
}, |
| 210 |
{ |
| 211 |
token: ["entity.other.attribute-name.class.stylus"], |
| 212 |
regex: "\\.-?[_a-zA-Z]+[_a-zA-Z0-9-]*" |
| 213 |
}, |
| 214 |
{ |
| 215 |
token: ["entity.language.stylus"], |
| 216 |
regex: "^ *&" |
| 217 |
}, |
| 218 |
{ |
| 219 |
token: ["variable.language.stylus"], |
| 220 |
regex: "(arguments)" |
| 221 |
}, |
| 222 |
{ |
| 223 |
token: ["keyword.stylus"], |
| 224 |
regex: "@[-\\w]+" |
| 225 |
}, |
| 226 |
{ |
| 227 |
token: ["punctuation", "entity.other.attribute-name.pseudo-element.css"], |
| 228 |
regex: CssHighlightRules.pseudoElements |
| 229 |
}, { |
| 230 |
token: ["punctuation", "entity.other.attribute-name.pseudo-class.css"], |
| 231 |
regex: CssHighlightRules.pseudoClasses |
| 232 |
}, |
| 233 |
{ |
| 234 |
token: ["entity.name.tag.stylus"], |
| 235 |
regex: "(?:\\b)(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(?:h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|samp|script|section|select|small|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)(?:\\b)" |
| 236 |
}, |
| 237 |
{ |
| 238 |
token: "constant.numeric", |
| 239 |
regex: "#[a-fA-F0-9]{6}" |
| 240 |
}, |
| 241 |
{ |
| 242 |
token: "constant.numeric", |
| 243 |
regex: "#[a-fA-F0-9]{3}" |
| 244 |
}, |
| 245 |
{ |
| 246 |
token: ["punctuation.definition.entity.stylus", "entity.other.attribute-name.id.stylus"], |
| 247 |
regex: "(#)([a-zA-Z][a-zA-Z0-9_-]*)" |
| 248 |
}, |
| 249 |
{ |
| 250 |
token: "meta.vendor-prefix.stylus", |
| 251 |
regex: "-webkit-|-moz\\-|-ms-|-o-" |
| 252 |
}, |
| 253 |
{ |
| 254 |
token: "keyword.control.stylus", |
| 255 |
regex: "(?:!important|for|in|return|true|false|null|if|else|unless|return)\\b" |
| 256 |
}, |
| 257 |
{ |
| 258 |
token: "keyword.operator.stylus", |
| 259 |
regex: "!|~|\\+|-|(?:\\*)?\\*|\\/|%|(?:\\.)\\.\\.|<|>|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=" |
| 260 |
}, |
| 261 |
{ |
| 262 |
token: "keyword.operator.stylus", |
| 263 |
regex: "(?:in|is(?:nt)?|not)\\b" |
| 264 |
}, |
| 265 |
{ |
| 266 |
token: "string", |
| 267 |
regex: "'(?=.)", |
| 268 |
next: "qstring" |
| 269 |
}, { |
| 270 |
token: "string", |
| 271 |
regex: '"(?=.)', |
| 272 |
next: "qqstring" |
| 273 |
}, |
| 274 |
{ |
| 275 |
token: "constant.numeric", |
| 276 |
regex: CssHighlightRules.numRe |
| 277 |
}, |
| 278 |
{ |
| 279 |
token: "keyword", |
| 280 |
regex: "(?:ch|cm|deg|em|ex|fr|gd|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vm|vw|%)\\b" |
| 281 |
}, |
| 282 |
{ |
| 283 |
token: keywordMapper, |
| 284 |
regex: "\\-?[a-zA-Z_][a-zA-Z0-9_\\-]*" |
| 285 |
} |
| 286 |
], |
| 287 |
"comment": [ |
| 288 |
{ |
| 289 |
token: "comment", |
| 290 |
regex: "\\*\\/", |
| 291 |
next: "start" |
| 292 |
}, { |
| 293 |
defaultToken: "comment" |
| 294 |
} |
| 295 |
], |
| 296 |
"qqstring": [ |
| 297 |
{ |
| 298 |
token: "string", |
| 299 |
regex: '[^"\\\\]+' |
| 300 |
}, |
| 301 |
{ |
| 302 |
token: "string", |
| 303 |
regex: "\\\\$", |
| 304 |
next: "qqstring" |
| 305 |
}, |
| 306 |
{ |
| 307 |
token: "string", |
| 308 |
regex: '"|$', |
| 309 |
next: "start" |
| 310 |
} |
| 311 |
], |
| 312 |
"qstring": [ |
| 313 |
{ |
| 314 |
token: "string", |
| 315 |
regex: "[^'\\\\]+" |
| 316 |
}, |
| 317 |
{ |
| 318 |
token: "string", |
| 319 |
regex: "\\\\$", |
| 320 |
next: "qstring" |
| 321 |
}, |
| 322 |
{ |
| 323 |
token: "string", |
| 324 |
regex: "'|$", |
| 325 |
next: "start" |
| 326 |
} |
| 327 |
] |
| 328 |
}; |
| 329 |
}; |
| 330 |
oop.inherits(StylusHighlightRules, TextHighlightRules); |
| 331 |
exports.StylusHighlightRules = StylusHighlightRules; |
| 332 |
|
| 333 |
}); |
| 334 |
|
| 335 |
ace.define("ace/mode/folding/coffee",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict"; |
| 336 |
var oop = require("../../lib/oop"); |
| 337 |
var BaseFoldMode = require("./fold_mode").FoldMode; |
| 338 |
var Range = require("../../range").Range; |
| 339 |
var FoldMode = exports.FoldMode = function () { }; |
| 340 |
oop.inherits(FoldMode, BaseFoldMode); |
| 341 |
(function () { |
| 342 |
this.commentBlock = function (session, row) { |
| 343 |
var re = /\S/; |
| 344 |
var line = session.getLine(row); |
| 345 |
var startLevel = line.search(re); |
| 346 |
if (startLevel == -1 || line[startLevel] != "#") |
| 347 |
return; |
| 348 |
var startColumn = line.length; |
| 349 |
var maxRow = session.getLength(); |
| 350 |
var startRow = row; |
| 351 |
var endRow = row; |
| 352 |
while (++row < maxRow) { |
| 353 |
line = session.getLine(row); |
| 354 |
var level = line.search(re); |
| 355 |
if (level == -1) |
| 356 |
continue; |
| 357 |
if (line[level] != "#") |
| 358 |
break; |
| 359 |
endRow = row; |
| 360 |
} |
| 361 |
if (endRow > startRow) { |
| 362 |
var endColumn = session.getLine(endRow).length; |
| 363 |
return new Range(startRow, startColumn, endRow, endColumn); |
| 364 |
} |
| 365 |
}; |
| 366 |
this.getFoldWidgetRange = function (session, foldStyle, row) { |
| 367 |
var range = this.indentationBlock(session, row); |
| 368 |
if (range) |
| 369 |
return range; |
| 370 |
range = this.commentBlock(session, row); |
| 371 |
if (range) |
| 372 |
return range; |
| 373 |
}; |
| 374 |
this.getFoldWidget = function (session, foldStyle, row) { |
| 375 |
var line = session.getLine(row); |
| 376 |
var indent = line.search(/\S/); |
| 377 |
var next = session.getLine(row + 1); |
| 378 |
var prev = session.getLine(row - 1); |
| 379 |
var prevIndent = prev.search(/\S/); |
| 380 |
var nextIndent = next.search(/\S/); |
| 381 |
if (indent == -1) { |
| 382 |
session.foldWidgets[row - 1] = prevIndent != -1 && prevIndent < nextIndent ? "start" : ""; |
| 383 |
return ""; |
| 384 |
} |
| 385 |
if (prevIndent == -1) { |
| 386 |
if (indent == nextIndent && line[indent] == "#" && next[indent] == "#") { |
| 387 |
session.foldWidgets[row - 1] = ""; |
| 388 |
session.foldWidgets[row + 1] = ""; |
| 389 |
return "start"; |
| 390 |
} |
| 391 |
} |
| 392 |
else if (prevIndent == indent && line[indent] == "#" && prev[indent] == "#") { |
| 393 |
if (session.getLine(row - 2).search(/\S/) == -1) { |
| 394 |
session.foldWidgets[row - 1] = "start"; |
| 395 |
session.foldWidgets[row + 1] = ""; |
| 396 |
return ""; |
| 397 |
} |
| 398 |
} |
| 399 |
if (prevIndent != -1 && prevIndent < indent) |
| 400 |
session.foldWidgets[row - 1] = "start"; |
| 401 |
else |
| 402 |
session.foldWidgets[row - 1] = ""; |
| 403 |
if (indent < nextIndent) |
| 404 |
return "start"; |
| 405 |
else |
| 406 |
return ""; |
| 407 |
}; |
| 408 |
}).call(FoldMode.prototype); |
| 409 |
|
| 410 |
}); |
| 411 |
|
| 412 |
ace.define("ace/mode/stylus",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/stylus_highlight_rules","ace/mode/folding/coffee"], function(require, exports, module){ |
| 413 |
|
| 414 |
|
| 415 |
"use strict"; |
| 416 |
var oop = require("../lib/oop"); |
| 417 |
var TextMode = require("./text").Mode; |
| 418 |
var StylusHighlightRules = require("./stylus_highlight_rules").StylusHighlightRules; |
| 419 |
var FoldMode = require("./folding/coffee").FoldMode; |
| 420 |
var Mode = function () { |
| 421 |
this.HighlightRules = StylusHighlightRules; |
| 422 |
this.foldingRules = new FoldMode(); |
| 423 |
this.$behaviour = this.$defaultBehaviour; |
| 424 |
}; |
| 425 |
oop.inherits(Mode, TextMode); |
| 426 |
(function () { |
| 427 |
this.lineCommentStart = "//"; |
| 428 |
this.blockComment = { start: "/*", end: "*/" }; |
| 429 |
this.$id = "ace/mode/stylus"; |
| 430 |
}).call(Mode.prototype); |
| 431 |
exports.Mode = Mode; |
| 432 |
|
| 433 |
}); (function() { |
| 434 |
ace.require(["ace/mode/stylus"], function(m) { |
| 435 |
if (typeof module == "object" && typeof exports == "object" && module) { |
| 436 |
module.exports = m; |
| 437 |
} |
| 438 |
}); |
| 439 |
})(); |
| 440 |
|