corrade-nucleus-nucleons – Blame information for rev 24
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | define("ace/mode/scss_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) { |
2 | "use strict"; |
||
3 | |||
4 | var oop = require("../lib/oop"); |
||
5 | var lang = require("../lib/lang"); |
||
6 | var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules; |
||
7 | |||
8 | var ScssHighlightRules = function() { |
||
9 | |||
10 | var properties = lang.arrayToMap( (function () { |
||
11 | |||
12 | var browserPrefix = ("-webkit-|-moz-|-o-|-ms-|-svg-|-pie-|-khtml-").split("|"); |
||
13 | |||
14 | var prefixProperties = ("appearance|background-clip|background-inline-policy|background-origin|" + |
||
15 | "background-size|binding|border-bottom-colors|border-left-colors|" + |
||
16 | "border-right-colors|border-top-colors|border-end|border-end-color|" + |
||
17 | "border-end-style|border-end-width|border-image|border-start|" + |
||
18 | "border-start-color|border-start-style|border-start-width|box-align|" + |
||
19 | "box-direction|box-flex|box-flexgroup|box-ordinal-group|box-orient|" + |
||
20 | "box-pack|box-sizing|column-count|column-gap|column-width|column-rule|" + |
||
21 | "column-rule-width|column-rule-style|column-rule-color|float-edge|" + |
||
22 | "font-feature-settings|font-language-override|force-broken-image-icon|" + |
||
23 | "image-region|margin-end|margin-start|opacity|outline|outline-color|" + |
||
24 | "outline-offset|outline-radius|outline-radius-bottomleft|" + |
||
25 | "outline-radius-bottomright|outline-radius-topleft|outline-radius-topright|" + |
||
26 | "outline-style|outline-width|padding-end|padding-start|stack-sizing|" + |
||
27 | "tab-size|text-blink|text-decoration-color|text-decoration-line|" + |
||
28 | "text-decoration-style|transform|transform-origin|transition|" + |
||
29 | "transition-delay|transition-duration|transition-property|" + |
||
30 | "transition-timing-function|user-focus|user-input|user-modify|user-select|" + |
||
31 | "window-shadow|border-radius").split("|"); |
||
32 | |||
33 | var properties = ("azimuth|background-attachment|background-color|background-image|" + |
||
34 | "background-position|background-repeat|background|border-bottom-color|" + |
||
35 | "border-bottom-style|border-bottom-width|border-bottom|border-collapse|" + |
||
36 | "border-color|border-left-color|border-left-style|border-left-width|" + |
||
37 | "border-left|border-right-color|border-right-style|border-right-width|" + |
||
38 | "border-right|border-spacing|border-style|border-top-color|" + |
||
39 | "border-top-style|border-top-width|border-top|border-width|border|bottom|" + |
||
40 | "box-shadow|box-sizing|caption-side|clear|clip|color|content|counter-increment|" + |
||
41 | "counter-reset|cue-after|cue-before|cue|cursor|direction|display|" + |
||
42 | "elevation|empty-cells|float|font-family|font-size-adjust|font-size|" + |
||
43 | "font-stretch|font-style|font-variant|font-weight|font|height|left|" + |
||
44 | "letter-spacing|line-height|list-style-image|list-style-position|" + |
||
45 | "list-style-type|list-style|margin-bottom|margin-left|margin-right|" + |
||
46 | "margin-top|marker-offset|margin|marks|max-height|max-width|min-height|" + |
||
47 | "min-width|opacity|orphans|outline-color|" + |
||
48 | "outline-style|outline-width|outline|overflow|overflow-x|overflow-y|padding-bottom|" + |
||
49 | "padding-left|padding-right|padding-top|padding|page-break-after|" + |
||
50 | "page-break-before|page-break-inside|page|pause-after|pause-before|" + |
||
51 | "pause|pitch-range|pitch|play-during|position|quotes|richness|right|" + |
||
52 | "size|speak-header|speak-numeral|speak-punctuation|speech-rate|speak|" + |
||
53 | "stress|table-layout|text-align|text-decoration|text-indent|" + |
||
54 | "text-shadow|text-transform|top|unicode-bidi|vertical-align|" + |
||
55 | "visibility|voice-family|volume|white-space|widows|width|word-spacing|" + |
||
56 | "z-index").split("|"); |
||
57 | var ret = []; |
||
58 | for (var i=0, ln=browserPrefix.length; i<ln; i++) { |
||
59 | Array.prototype.push.apply( |
||
60 | ret, |
||
61 | (( browserPrefix[i] + prefixProperties.join("|" + browserPrefix[i]) ).split("|")) |
||
62 | ); |
||
63 | } |
||
64 | Array.prototype.push.apply(ret, prefixProperties); |
||
65 | Array.prototype.push.apply(ret, properties); |
||
66 | |||
67 | return ret; |
||
68 | |||
69 | })() ); |
||
70 | |||
71 | |||
72 | |||
73 | var functions = lang.arrayToMap( |
||
74 | ("hsl|hsla|rgb|rgba|url|attr|counter|counters|abs|adjust_color|adjust_hue|" + |
||
75 | "alpha|join|blue|ceil|change_color|comparable|complement|darken|desaturate|" + |
||
76 | "floor|grayscale|green|hue|if|invert|join|length|lighten|lightness|mix|" + |
||
77 | "nth|opacify|opacity|percentage|quote|red|round|saturate|saturation|" + |
||
78 | "scale_color|transparentize|type_of|unit|unitless|unqoute").split("|") |
||
79 | ); |
||
80 | |||
81 | var constants = lang.arrayToMap( |
||
82 | ("absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|" + |
||
83 | "block|bold|bolder|border-box|both|bottom|break-all|break-word|capitalize|center|" + |
||
84 | "char|circle|cjk-ideographic|col-resize|collapse|content-box|crosshair|dashed|" + |
||
85 | "decimal-leading-zero|decimal|default|disabled|disc|" + |
||
86 | "distribute-all-lines|distribute-letter|distribute-space|" + |
||
87 | "distribute|dotted|double|e-resize|ellipsis|fixed|georgian|groove|" + |
||
88 | "hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|" + |
||
89 | "ideograph-alpha|ideograph-numeric|ideograph-parenthesis|" + |
||
90 | "ideograph-space|inactive|inherit|inline-block|inline|inset|inside|" + |
||
91 | "inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|" + |
||
92 | "keep-all|left|lighter|line-edge|line-through|line|list-item|loose|" + |
||
93 | "lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|" + |
||
94 | "medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|" + |
||
95 | "nw-resize|none|normal|not-allowed|nowrap|oblique|outset|outside|" + |
||
96 | "overline|pointer|progress|relative|repeat-x|repeat-y|repeat|right|" + |
||
97 | "ridge|row-resize|rtl|s-resize|scroll|se-resize|separate|small-caps|" + |
||
98 | "solid|square|static|strict|super|sw-resize|table-footer-group|" + |
||
99 | "table-header-group|tb-rl|text-bottom|text-top|text|thick|thin|top|" + |
||
100 | "transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|" + |
||
101 | "vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|" + |
||
102 | "zero").split("|") |
||
103 | ); |
||
104 | |||
105 | var colors = lang.arrayToMap( |
||
106 | ("aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|" + |
||
107 | "purple|red|silver|teal|white|yellow").split("|") |
||
108 | ); |
||
109 | |||
110 | var keywords = lang.arrayToMap( |
||
111 | ("@mixin|@extend|@include|@import|@media|@debug|@warn|@if|@for|@each|@while|@else|@font-face|@-webkit-keyframes|if|and|!default|module|def|end|declare").split("|") |
||
112 | ) |
||
113 | |||
114 | var tags = lang.arrayToMap( |
||
115 | ("a|abbr|acronym|address|applet|area|article|aside|audio|b|base|basefont|bdo|" + |
||
116 | "big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|" + |
||
117 | "command|datalist|dd|del|details|dfn|dir|div|dl|dt|em|embed|fieldset|" + |
||
118 | "figcaption|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|" + |
||
119 | "header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|li|" + |
||
120 | "link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|" + |
||
121 | "option|output|p|param|pre|progress|q|rp|rt|ruby|s|samp|script|section|select|" + |
||
122 | "small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|" + |
||
123 | "textarea|tfoot|th|thead|time|title|tr|tt|u|ul|var|video|wbr|xmp").split("|") |
||
124 | ); |
||
125 | |||
126 | var numRe = "\\-?(?:(?:[0-9]+)|(?:[0-9]*\\.[0-9]+))"; |
||
127 | |||
128 | this.$rules = { |
||
129 | "start" : [ |
||
130 | { |
||
131 | token : "comment", |
||
132 | regex : "\\/\\/.*$" |
||
133 | }, |
||
134 | { |
||
135 | token : "comment", // multi line comment |
||
136 | regex : "\\/\\*", |
||
137 | next : "comment" |
||
138 | }, { |
||
139 | token : "string", // single line |
||
140 | regex : '["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]' |
||
141 | }, { |
||
142 | token : "string", // multi line string start |
||
143 | regex : '["].*\\\\$', |
||
144 | next : "qqstring" |
||
145 | }, { |
||
146 | token : "string", // single line |
||
147 | regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" |
||
148 | }, { |
||
149 | token : "string", // multi line string start |
||
150 | regex : "['].*\\\\$", |
||
151 | next : "qstring" |
||
152 | }, { |
||
153 | token : "constant.numeric", |
||
154 | regex : numRe + "(?:em|ex|px|cm|mm|in|pt|pc|deg|rad|grad|ms|s|hz|khz|%)" |
||
155 | }, { |
||
156 | token : "constant.numeric", // hex6 color |
||
157 | regex : "#[a-f0-9]{6}" |
||
158 | }, { |
||
159 | token : "constant.numeric", // hex3 color |
||
160 | regex : "#[a-f0-9]{3}" |
||
161 | }, { |
||
162 | token : "constant.numeric", |
||
163 | regex : numRe |
||
164 | }, { |
||
165 | token : ["support.function", "string", "support.function"], |
||
166 | regex : "(url\\()(.*)(\\))" |
||
167 | }, { |
||
168 | token : function(value) { |
||
169 | if (properties.hasOwnProperty(value.toLowerCase())) |
||
170 | return "support.type"; |
||
171 | if (keywords.hasOwnProperty(value)) |
||
172 | return "keyword"; |
||
173 | else if (constants.hasOwnProperty(value)) |
||
174 | return "constant.language"; |
||
175 | else if (functions.hasOwnProperty(value)) |
||
176 | return "support.function"; |
||
177 | else if (colors.hasOwnProperty(value.toLowerCase())) |
||
178 | return "support.constant.color"; |
||
179 | else if (tags.hasOwnProperty(value.toLowerCase())) |
||
180 | return "variable.language"; |
||
181 | else |
||
182 | return "text"; |
||
183 | }, |
||
184 | regex : "\\-?[@a-z_][@a-z0-9_\\-]*" |
||
185 | }, { |
||
186 | token : "variable", |
||
187 | regex : "[a-z_\\-$][a-z0-9_\\-$]*\\b" |
||
188 | }, { |
||
189 | token: "variable.language", |
||
190 | regex: "#[a-z0-9-_]+" |
||
191 | }, { |
||
192 | token: "variable.language", |
||
193 | regex: "\\.[a-z0-9-_]+" |
||
194 | }, { |
||
195 | token: "variable.language", |
||
196 | regex: ":[a-z0-9-_]+" |
||
197 | }, { |
||
198 | token: "constant", |
||
199 | regex: "[a-z0-9-_]+" |
||
200 | }, { |
||
201 | token : "keyword.operator", |
||
202 | regex : "<|>|<=|>=|==|!=|-|%|#|\\+|\\$|\\+|\\*" |
||
203 | }, { |
||
204 | token : "paren.lparen", |
||
205 | regex : "[[({]" |
||
206 | }, { |
||
207 | token : "paren.rparen", |
||
208 | regex : "[\\])}]" |
||
209 | }, { |
||
210 | token : "text", |
||
211 | regex : "\\s+" |
||
212 | }, { |
||
213 | caseInsensitive: true |
||
214 | } |
||
215 | ], |
||
216 | "comment" : [ |
||
217 | { |
||
218 | token : "comment", // closing comment |
||
219 | regex : ".*?\\*\\/", |
||
220 | next : "start" |
||
221 | }, { |
||
222 | token : "comment", // comment spanning whole line |
||
223 | regex : ".+" |
||
224 | } |
||
225 | ], |
||
226 | "qqstring" : [ |
||
227 | { |
||
228 | token : "string", |
||
229 | regex : '(?:(?:\\\\.)|(?:[^"\\\\]))*?"', |
||
230 | next : "start" |
||
231 | }, { |
||
232 | token : "string", |
||
233 | regex : '.+' |
||
234 | } |
||
235 | ], |
||
236 | "qstring" : [ |
||
237 | { |
||
238 | token : "string", |
||
239 | regex : "(?:(?:\\\\.)|(?:[^'\\\\]))*?'", |
||
240 | next : "start" |
||
241 | }, { |
||
242 | token : "string", |
||
243 | regex : '.+' |
||
244 | } |
||
245 | ] |
||
246 | }; |
||
247 | }; |
||
248 | |||
249 | oop.inherits(ScssHighlightRules, TextHighlightRules); |
||
250 | |||
251 | exports.ScssHighlightRules = ScssHighlightRules; |
||
252 | |||
253 | }); |
||
254 | |||
255 | define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) { |
||
256 | "use strict"; |
||
257 | |||
258 | var Range = require("../range").Range; |
||
259 | |||
260 | var MatchingBraceOutdent = function() {}; |
||
261 | |||
262 | (function() { |
||
263 | |||
264 | this.checkOutdent = function(line, input) { |
||
265 | if (! /^\s+$/.test(line)) |
||
266 | return false; |
||
267 | |||
268 | return /^\s*\}/.test(input); |
||
269 | }; |
||
270 | |||
271 | this.autoOutdent = function(doc, row) { |
||
272 | var line = doc.getLine(row); |
||
273 | var match = line.match(/^(\s*\})/); |
||
274 | |||
275 | if (!match) return 0; |
||
276 | |||
277 | var column = match[1].length; |
||
278 | var openBracePos = doc.findMatchingBracket({row: row, column: column}); |
||
279 | |||
280 | if (!openBracePos || openBracePos.row == row) return 0; |
||
281 | |||
282 | var indent = this.$getIndent(doc.getLine(openBracePos.row)); |
||
283 | doc.replace(new Range(row, 0, row, column-1), indent); |
||
284 | }; |
||
285 | |||
286 | this.$getIndent = function(line) { |
||
287 | return line.match(/^\s*/)[0]; |
||
288 | }; |
||
289 | |||
290 | }).call(MatchingBraceOutdent.prototype); |
||
291 | |||
292 | exports.MatchingBraceOutdent = MatchingBraceOutdent; |
||
293 | }); |
||
294 | |||
295 | define("ace/mode/behaviour/css",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/mode/behaviour/cstyle","ace/token_iterator"], function(require, exports, module) { |
||
296 | "use strict"; |
||
297 | |||
298 | var oop = require("../../lib/oop"); |
||
299 | var Behaviour = require("../behaviour").Behaviour; |
||
300 | var CstyleBehaviour = require("./cstyle").CstyleBehaviour; |
||
301 | var TokenIterator = require("../../token_iterator").TokenIterator; |
||
302 | |||
303 | var CssBehaviour = function () { |
||
304 | |||
305 | this.inherit(CstyleBehaviour); |
||
306 | |||
307 | this.add("colon", "insertion", function (state, action, editor, session, text) { |
||
308 | if (text === ':') { |
||
309 | var cursor = editor.getCursorPosition(); |
||
310 | var iterator = new TokenIterator(session, cursor.row, cursor.column); |
||
311 | var token = iterator.getCurrentToken(); |
||
312 | if (token && token.value.match(/\s+/)) { |
||
313 | token = iterator.stepBackward(); |
||
314 | } |
||
315 | if (token && token.type === 'support.type') { |
||
316 | var line = session.doc.getLine(cursor.row); |
||
317 | var rightChar = line.substring(cursor.column, cursor.column + 1); |
||
318 | if (rightChar === ':') { |
||
319 | return { |
||
320 | text: '', |
||
321 | selection: [1, 1] |
||
322 | } |
||
323 | } |
||
324 | if (!line.substring(cursor.column).match(/^\s*;/)) { |
||
325 | return { |
||
326 | text: ':;', |
||
327 | selection: [1, 1] |
||
328 | } |
||
329 | } |
||
330 | } |
||
331 | } |
||
332 | }); |
||
333 | |||
334 | this.add("colon", "deletion", function (state, action, editor, session, range) { |
||
335 | var selected = session.doc.getTextRange(range); |
||
336 | if (!range.isMultiLine() && selected === ':') { |
||
337 | var cursor = editor.getCursorPosition(); |
||
338 | var iterator = new TokenIterator(session, cursor.row, cursor.column); |
||
339 | var token = iterator.getCurrentToken(); |
||
340 | if (token && token.value.match(/\s+/)) { |
||
341 | token = iterator.stepBackward(); |
||
342 | } |
||
343 | if (token && token.type === 'support.type') { |
||
344 | var line = session.doc.getLine(range.start.row); |
||
345 | var rightChar = line.substring(range.end.column, range.end.column + 1); |
||
346 | if (rightChar === ';') { |
||
347 | range.end.column ++; |
||
348 | return range; |
||
349 | } |
||
350 | } |
||
351 | } |
||
352 | }); |
||
353 | |||
354 | this.add("semicolon", "insertion", function (state, action, editor, session, text) { |
||
355 | if (text === ';') { |
||
356 | var cursor = editor.getCursorPosition(); |
||
357 | var line = session.doc.getLine(cursor.row); |
||
358 | var rightChar = line.substring(cursor.column, cursor.column + 1); |
||
359 | if (rightChar === ';') { |
||
360 | return { |
||
361 | text: '', |
||
362 | selection: [1, 1] |
||
363 | } |
||
364 | } |
||
365 | } |
||
366 | }); |
||
367 | |||
368 | } |
||
369 | oop.inherits(CssBehaviour, CstyleBehaviour); |
||
370 | |||
371 | exports.CssBehaviour = CssBehaviour; |
||
372 | }); |
||
373 | |||
374 | define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { |
||
375 | "use strict"; |
||
376 | |||
377 | var oop = require("../../lib/oop"); |
||
378 | var Range = require("../../range").Range; |
||
379 | var BaseFoldMode = require("./fold_mode").FoldMode; |
||
380 | |||
381 | var FoldMode = exports.FoldMode = function(commentRegex) { |
||
382 | if (commentRegex) { |
||
383 | this.foldingStartMarker = new RegExp( |
||
384 | this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) |
||
385 | ); |
||
386 | this.foldingStopMarker = new RegExp( |
||
387 | this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) |
||
388 | ); |
||
389 | } |
||
390 | }; |
||
391 | oop.inherits(FoldMode, BaseFoldMode); |
||
392 | |||
393 | (function() { |
||
394 | |||
395 | this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; |
||
396 | this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; |
||
397 | this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; |
||
398 | this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; |
||
399 | this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; |
||
400 | this._getFoldWidgetBase = this.getFoldWidget; |
||
401 | this.getFoldWidget = function(session, foldStyle, row) { |
||
402 | var line = session.getLine(row); |
||
403 | |||
404 | if (this.singleLineBlockCommentRe.test(line)) { |
||
405 | if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) |
||
406 | return ""; |
||
407 | } |
||
408 | |||
409 | var fw = this._getFoldWidgetBase(session, foldStyle, row); |
||
410 | |||
411 | if (!fw && this.startRegionRe.test(line)) |
||
412 | return "start"; // lineCommentRegionStart |
||
413 | |||
414 | return fw; |
||
415 | }; |
||
416 | |||
417 | this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { |
||
418 | var line = session.getLine(row); |
||
419 | |||
420 | if (this.startRegionRe.test(line)) |
||
421 | return this.getCommentRegionBlock(session, line, row); |
||
422 | |||
423 | var match = line.match(this.foldingStartMarker); |
||
424 | if (match) { |
||
425 | var i = match.index; |
||
426 | |||
427 | if (match[1]) |
||
428 | return this.openingBracketBlock(session, match[1], row, i); |
||
429 | |||
430 | var range = session.getCommentFoldRange(row, i + match[0].length, 1); |
||
431 | |||
432 | if (range && !range.isMultiLine()) { |
||
433 | if (forceMultiline) { |
||
434 | range = this.getSectionRange(session, row); |
||
435 | } else if (foldStyle != "all") |
||
436 | range = null; |
||
437 | } |
||
438 | |||
439 | return range; |
||
440 | } |
||
441 | |||
442 | if (foldStyle === "markbegin") |
||
443 | return; |
||
444 | |||
445 | var match = line.match(this.foldingStopMarker); |
||
446 | if (match) { |
||
447 | var i = match.index + match[0].length; |
||
448 | |||
449 | if (match[1]) |
||
450 | return this.closingBracketBlock(session, match[1], row, i); |
||
451 | |||
452 | return session.getCommentFoldRange(row, i, -1); |
||
453 | } |
||
454 | }; |
||
455 | |||
456 | this.getSectionRange = function(session, row) { |
||
457 | var line = session.getLine(row); |
||
458 | var startIndent = line.search(/\S/); |
||
459 | var startRow = row; |
||
460 | var startColumn = line.length; |
||
461 | row = row + 1; |
||
462 | var endRow = row; |
||
463 | var maxRow = session.getLength(); |
||
464 | while (++row < maxRow) { |
||
465 | line = session.getLine(row); |
||
466 | var indent = line.search(/\S/); |
||
467 | if (indent === -1) |
||
468 | continue; |
||
469 | if (startIndent > indent) |
||
470 | break; |
||
471 | var subRange = this.getFoldWidgetRange(session, "all", row); |
||
472 | |||
473 | if (subRange) { |
||
474 | if (subRange.start.row <= startRow) { |
||
475 | break; |
||
476 | } else if (subRange.isMultiLine()) { |
||
477 | row = subRange.end.row; |
||
478 | } else if (startIndent == indent) { |
||
479 | break; |
||
480 | } |
||
481 | } |
||
482 | endRow = row; |
||
483 | } |
||
484 | |||
485 | return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); |
||
486 | }; |
||
487 | this.getCommentRegionBlock = function(session, line, row) { |
||
488 | var startColumn = line.search(/\s*$/); |
||
489 | var maxRow = session.getLength(); |
||
490 | var startRow = row; |
||
491 | |||
492 | var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; |
||
493 | var depth = 1; |
||
494 | while (++row < maxRow) { |
||
495 | line = session.getLine(row); |
||
496 | var m = re.exec(line); |
||
497 | if (!m) continue; |
||
498 | if (m[1]) depth--; |
||
499 | else depth++; |
||
500 | |||
501 | if (!depth) break; |
||
502 | } |
||
503 | |||
504 | var endRow = row; |
||
505 | if (endRow > startRow) { |
||
506 | return new Range(startRow, startColumn, endRow, line.length); |
||
507 | } |
||
508 | }; |
||
509 | |||
510 | }).call(FoldMode.prototype); |
||
511 | |||
512 | }); |
||
513 | |||
514 | define("ace/mode/scss",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/scss_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/behaviour/css","ace/mode/folding/cstyle"], function(require, exports, module) { |
||
515 | "use strict"; |
||
516 | |||
517 | var oop = require("../lib/oop"); |
||
518 | var TextMode = require("./text").Mode; |
||
519 | var ScssHighlightRules = require("./scss_highlight_rules").ScssHighlightRules; |
||
520 | var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; |
||
521 | var CssBehaviour = require("./behaviour/css").CssBehaviour; |
||
522 | var CStyleFoldMode = require("./folding/cstyle").FoldMode; |
||
523 | |||
524 | var Mode = function() { |
||
525 | this.HighlightRules = ScssHighlightRules; |
||
526 | this.$outdent = new MatchingBraceOutdent(); |
||
527 | this.$behaviour = new CssBehaviour(); |
||
528 | this.foldingRules = new CStyleFoldMode(); |
||
529 | }; |
||
530 | oop.inherits(Mode, TextMode); |
||
531 | |||
532 | (function() { |
||
533 | |||
534 | this.lineCommentStart = "//"; |
||
535 | this.blockComment = {start: "/*", end: "*/"}; |
||
536 | |||
537 | this.getNextLineIndent = function(state, line, tab) { |
||
538 | var indent = this.$getIndent(line); |
||
539 | var tokens = this.getTokenizer().getLineTokens(line, state).tokens; |
||
540 | if (tokens.length && tokens[tokens.length-1].type == "comment") { |
||
541 | return indent; |
||
542 | } |
||
543 | |||
544 | var match = line.match(/^.*\{\s*$/); |
||
545 | if (match) { |
||
546 | indent += tab; |
||
547 | } |
||
548 | |||
549 | return indent; |
||
550 | }; |
||
551 | |||
552 | this.checkOutdent = function(state, line, input) { |
||
553 | return this.$outdent.checkOutdent(line, input); |
||
554 | }; |
||
555 | |||
556 | this.autoOutdent = function(state, doc, row) { |
||
557 | this.$outdent.autoOutdent(doc, row); |
||
558 | }; |
||
559 | |||
560 | this.$id = "ace/mode/scss"; |
||
561 | }).call(Mode.prototype); |
||
562 | |||
563 | exports.Mode = Mode; |
||
564 | |||
565 | }); |