corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 ace.define("ace/mode/doc_comment_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module) {
2 "use strict";
3  
4 var oop = require("../lib/oop");
5 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
6  
7 var DocCommentHighlightRules = function() {
8 this.$rules = {
9 "start" : [ {
10 token : "comment.doc.tag",
11 regex : "@[\\w\\d_]+" // TODO: fix email addresses
12 },
13 DocCommentHighlightRules.getTagRule(),
14 {
15 defaultToken : "comment.doc",
16 caseInsensitive: true
17 }]
18 };
19 };
20  
21 oop.inherits(DocCommentHighlightRules, TextHighlightRules);
22  
23 DocCommentHighlightRules.getTagRule = function(start) {
24 return {
25 token : "comment.doc.tag.storage.type",
26 regex : "\\b(?:TODO|FIXME|XXX|HACK)\\b"
27 };
28 }
29  
30 DocCommentHighlightRules.getStartRule = function(start) {
31 return {
32 token : "comment.doc", // doc comment
33 regex : "\\/\\*(?=\\*)",
34 next : start
35 };
36 };
37  
38 DocCommentHighlightRules.getEndRule = function (start) {
39 return {
40 token : "comment.doc", // closing comment
41 regex : "\\*\\/",
42 next : start
43 };
44 };
45  
46  
47 exports.DocCommentHighlightRules = DocCommentHighlightRules;
48  
49 });
50  
51 ace.define("ace/mode/c_cpp_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/doc_comment_highlight_rules","ace/mode/text_highlight_rules"], function(require, exports, module) {
52 "use strict";
53  
54 var oop = require("../lib/oop");
55 var DocCommentHighlightRules = require("./doc_comment_highlight_rules").DocCommentHighlightRules;
56 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
57 var cFunctions = exports.cFunctions = "\\b(?:hypot(?:f|l)?|s(?:scanf|ystem|nprintf|ca(?:nf|lb(?:n(?:f|l)?|ln(?:f|l)?))|i(?:n(?:h(?:f|l)?|f|l)?|gn(?:al|bit))|tr(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?)|error|pbrk|ftime|len|rchr|xfrm)|printf|et(?:jmp|vbuf|locale|buf)|qrt(?:f|l)?|w(?:scanf|printf)|rand)|n(?:e(?:arbyint(?:f|l)?|xt(?:toward(?:f|l)?|after(?:f|l)?))|an(?:f|l)?)|c(?:s(?:in(?:h(?:f|l)?|f|l)?|qrt(?:f|l)?)|cos(?:h(?:f)?|f|l)?|imag(?:f|l)?|t(?:ime|an(?:h(?:f|l)?|f|l)?)|o(?:s(?:h(?:f|l)?|f|l)?|nj(?:f|l)?|pysign(?:f|l)?)|p(?:ow(?:f|l)?|roj(?:f|l)?)|e(?:il(?:f|l)?|xp(?:f|l)?)|l(?:o(?:ck|g(?:f|l)?)|earerr)|a(?:sin(?:h(?:f|l)?|f|l)?|cos(?:h(?:f|l)?|f|l)?|tan(?:h(?:f|l)?|f|l)?|lloc|rg(?:f|l)?|bs(?:f|l)?)|real(?:f|l)?|brt(?:f|l)?)|t(?:ime|o(?:upper|lower)|an(?:h(?:f|l)?|f|l)?|runc(?:f|l)?|gamma(?:f|l)?|mp(?:nam|file))|i(?:s(?:space|n(?:ormal|an)|cntrl|inf|digit|u(?:nordered|pper)|p(?:unct|rint)|finite|w(?:space|c(?:ntrl|type)|digit|upper|p(?:unct|rint)|lower|al(?:num|pha)|graph|xdigit|blank)|l(?:ower|ess(?:equal|greater)?)|al(?:num|pha)|gr(?:eater(?:equal)?|aph)|xdigit|blank)|logb(?:f|l)?|max(?:div|abs))|di(?:v|fftime)|_Exit|unget(?:c|wc)|p(?:ow(?:f|l)?|ut(?:s|c(?:har)?|wc(?:har)?)|error|rintf)|e(?:rf(?:c(?:f|l)?|f|l)?|x(?:it|p(?:2(?:f|l)?|f|l|m1(?:f|l)?)?))|v(?:s(?:scanf|nprintf|canf|printf|w(?:scanf|printf))|printf|f(?:scanf|printf|w(?:scanf|printf))|w(?:scanf|printf)|a_(?:start|copy|end|arg))|qsort|f(?:s(?:canf|e(?:tpos|ek))|close|tell|open|dim(?:f|l)?|p(?:classify|ut(?:s|c|w(?:s|c))|rintf)|e(?:holdexcept|set(?:e(?:nv|xceptflag)|round)|clearexcept|testexcept|of|updateenv|r(?:aiseexcept|ror)|get(?:e(?:nv|xceptflag)|round))|flush|w(?:scanf|ide|printf|rite)|loor(?:f|l)?|abs(?:f|l)?|get(?:s|c|pos|w(?:s|c))|re(?:open|e|ad|xp(?:f|l)?)|m(?:in(?:f|l)?|od(?:f|l)?|a(?:f|l|x(?:f|l)?)?))|l(?:d(?:iv|exp(?:f|l)?)|o(?:ngjmp|cal(?:time|econv)|g(?:1(?:p(?:f|l)?|0(?:f|l)?)|2(?:f|l)?|f|l|b(?:f|l)?)?)|abs|l(?:div|abs|r(?:int(?:f|l)?|ound(?:f|l)?))|r(?:int(?:f|l)?|ound(?:f|l)?)|gamma(?:f|l)?)|w(?:scanf|c(?:s(?:s(?:tr|pn)|nc(?:py|at|mp)|c(?:spn|hr|oll|py|at|mp)|to(?:imax|d|u(?:l(?:l)?|max)|k|f|l(?:d|l)?|mbs)|pbrk|ftime|len|r(?:chr|tombs)|xfrm)|to(?:b|mb)|rtomb)|printf|mem(?:set|c(?:hr|py|mp)|move))|a(?:s(?:sert|ctime|in(?:h(?:f|l)?|f|l)?)|cos(?:h(?:f|l)?|f|l)?|t(?:o(?:i|f|l(?:l)?)|exit|an(?:h(?:f|l)?|2(?:f|l)?|f|l)?)|b(?:s|ort))|g(?:et(?:s|c(?:har)?|env|wc(?:har)?)|mtime)|r(?:int(?:f|l)?|ound(?:f|l)?|e(?:name|alloc|wind|m(?:ove|quo(?:f|l)?|ainder(?:f|l)?))|a(?:nd|ise))|b(?:search|towc)|m(?:odf(?:f|l)?|em(?:set|c(?:hr|py|mp)|move)|ktime|alloc|b(?:s(?:init|towcs|rtowcs)|towc|len|r(?:towc|len))))\\b"
58  
59 var c_cppHighlightRules = function() {
60  
61 var keywordControls = (
62 "break|case|continue|default|do|else|for|goto|if|_Pragma|" +
63 "return|switch|while|catch|operator|try|throw|using"
64 );
65  
66 var storageType = (
67 "asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|" +
68 "_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void|" +
69 "class|wchar_t|template|char16_t|char32_t"
70 );
71  
72 var storageModifiers = (
73 "const|extern|register|restrict|static|volatile|inline|private|" +
74 "protected|public|friend|explicit|virtual|export|mutable|typename|" +
75 "constexpr|new|delete|alignas|alignof|decltype|noexcept|thread_local"
76 );
77  
78 var keywordOperators = (
79 "and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq" +
80 "const_cast|dynamic_cast|reinterpret_cast|static_cast|sizeof|namespace"
81 );
82  
83 var builtinConstants = (
84 "NULL|true|false|TRUE|FALSE|nullptr"
85 );
86  
87 var keywordMapper = this.$keywords = this.createKeywordMapper({
88 "keyword.control" : keywordControls,
89 "storage.type" : storageType,
90 "storage.modifier" : storageModifiers,
91 "keyword.operator" : keywordOperators,
92 "variable.language": "this",
93 "constant.language": builtinConstants
94 }, "identifier");
95  
96 var identifierRe = "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*\\b";
97 var escapeRe = /\\(?:['"?\\abfnrtv]|[0-7]{1,3}|x[a-fA-F\d]{2}|u[a-fA-F\d]{4}U[a-fA-F\d]{8}|.)/.source;
98  
99 this.$rules = {
100 "start" : [
101 {
102 token : "comment",
103 regex : "//$",
104 next : "start"
105 }, {
106 token : "comment",
107 regex : "//",
108 next : "singleLineComment"
109 },
110 DocCommentHighlightRules.getStartRule("doc-start"),
111 {
112 token : "comment", // multi line comment
113 regex : "\\/\\*",
114 next : "comment"
115 }, {
116 token : "string", // character
117 regex : "'(?:" + escapeRe + "|.)?'"
118 }, {
119 token : "string.start",
120 regex : '"',
121 stateName: "qqstring",
122 next: [
123 { token: "string", regex: /\\\s*$/, next: "qqstring" },
124 { token: "constant.language.escape", regex: escapeRe },
125 { token: "constant.language.escape", regex: /%[^'"\\]/ },
126 { token: "string.end", regex: '"|$', next: "start" },
127 { defaultToken: "string"}
128 ]
129 }, {
130 token : "string.start",
131 regex : 'R"\\(',
132 stateName: "rawString",
133 next: [
134 { token: "string.end", regex: '\\)"', next: "start" },
135 { defaultToken: "string"}
136 ]
137 }, {
138 token : "constant.numeric", // hex
139 regex : "0[xX][0-9a-fA-F]+(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
140 }, {
141 token : "constant.numeric", // float
142 regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b"
143 }, {
144 token : "keyword", // pre-compiler directives
145 regex : "#\\s*(?:include|import|pragma|line|define|undef)\\b",
146 next : "directive"
147 }, {
148 token : "keyword", // special case pre-compiler directive
149 regex : "#\\s*(?:endif|if|ifdef|else|elif|ifndef)\\b"
150 }, {
151 token : "support.function.C99.c",
152 regex : cFunctions
153 }, {
154 token : keywordMapper,
155 regex : "[a-zA-Z_$][a-zA-Z0-9_$]*"
156 }, {
157 token : "keyword.operator",
158 regex : /--|\+\+|<<=|>>=|>>>=|<>|&&|\|\||\?:|[*%\/+\-&\^|~!<>=]=?/
159 <<=|><=|><><> }, {
160 <<=|><=|><><> token : "punctuation.operator",
161 <<=|><=|><><> regex : "\\?|\\:|\\,|\\;|\\."
162 <<=|><=|><><> }, {
163 <<=|><=|><><> token : "paren.lparen",
164 <<=|><=|><><> regex : "[[({]"
165 <<=|><=|><><> }, {
166 <<=|><=|><><> token : "paren.rparen",
167 <<=|><=|><><> regex : "[\\])}]"
168 <<=|><=|><><> }, {
169 <<=|><=|><><> token : "text",
170 <<=|><=|><><> regex : "\\s+"
171 <<=|><=|><><> }
172 <<=|><=|><><> ],
173 <<=|><=|><><> "comment" : [
174 <<=|><=|><><> {
175 <<=|><=|><><> token : "comment", // closing comment
176 <<=|><=|><><> regex : ".*?\\*\\/",
177 <<=|><=|><><> next : "start"
178 <<=|><=|><><> }, {
179 <<=|><=|><><> token : "comment", // comment spanning whole line
180 <<=|><=|><><> regex : ".+"
181 <<=|><=|><><> }
182 <<=|><=|><><> ],
183 <<=|><=|><><> "singleLineComment" : [
184 <<=|><=|><><> {
185 <<=|><=|><><> token : "comment",
186 <<=|><=|><><> regex : /\\$/,
187 <<=|><=|><><> next : "singleLineComment"
188 <<=|><=|><><> }, {
189 <<=|><=|><><> token : "comment",
190 <<=|><=|><><> regex : /$/,
191 <<=|><=|><><> next : "start"
192 <<=|><=|><><> }, {
193 <<=|><=|><><> defaultToken: "comment"
194 <<=|><=|><><> }
195 <<=|><=|><><> ],
196 <<=|><=|><><> "directive" : [
197 <<=|><=|><><> {
198 <<=|><=|><><> token : "constant.other.multiline",
199 <<=|><=|><><> regex : /\\/
200 <<=|><=|><><> },
201 <<=|><=|><><> {
202 <<=|><=|><><> token : "constant.other.multiline",
203 <<=|><=|><><> regex : /.*\\/
204 <<=|><=|><><> },
205 <<=|><=|><><> {
206 <<=|><=|><><> token : "constant.other",
207 <<=|><=|><><> regex : "\\s*<.+?>",
208 <<=|><=|><><><.+?> next : "start"
209 <<=|><=|><><><.+?> },
210 <<=|><=|><><><.+?> {
211 <<=|><=|><><><.+?> token : "constant.other", // single line
212 <<=|><=|><><><.+?> regex : '\\s*["](?:(?:\\\\.)|(?:[^"\\\\]))*?["]',
213 <<=|><=|><><><.+?> next : "start"
214 <<=|><=|><><><.+?> },
215 <<=|><=|><><><.+?> {
216 <<=|><=|><><><.+?> token : "constant.other", // single line
217 <<=|><=|><><><.+?> regex : "\\s*['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']",
218 <<=|><=|><><><.+?> next : "start"
219 <<=|><=|><><><.+?> },
220 <<=|><=|><><><.+?> {
221 <<=|><=|><><><.+?> token : "constant.other",
222 <<=|><=|><><><.+?> regex : /[^\\\/]+/,
223 <<=|><=|><><><.+?> next : "start"
224 <<=|><=|><><><.+?> }
225 <<=|><=|><><><.+?> ]
226 <<=|><=|><><><.+?> };
227  
228 <<=|><=|><><><.+?> this.embedRules(DocCommentHighlightRules, "doc-",
229 <<=|><=|><><><.+?> [ DocCommentHighlightRules.getEndRule("start") ]);
230 <<=|><=|><><><.+?> this.normalizeRules();
231 <<=|><=|><><><.+?>};
232  
233 <<=|><=|><><><.+?>oop.inherits(c_cppHighlightRules, TextHighlightRules);
234  
235 <<=|><=|><><><.+?>exports.c_cppHighlightRules = c_cppHighlightRules;
236 <<=|><=|><><><.+?>});
237  
238 <<=|><=|><><><.+?>ace.define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
239 <<=|><=|><><><.+?>"use strict";
240  
241 <<=|><=|><><><.+?>var Range = require("../range").Range;
242  
243 <<=|><=|><><><.+?>var MatchingBraceOutdent = function() {};
244  
245 <<=|><=|><><><.+?>(function() {
246  
247 <<=|><=|><><><.+?> this.checkOutdent = function(line, input) {
248 <<=|><=|><><><.+?> if (! /^\s+$/.test(line))
249 <<=|><=|><><><.+?> return false;
250  
251 <<=|><=|><><><.+?> return /^\s*\}/.test(input);
252 <<=|><=|><><><.+?> };
253  
254 <<=|><=|><><><.+?> this.autoOutdent = function(doc, row) {
255 <<=|><=|><><><.+?> var line = doc.getLine(row);
256 <<=|><=|><><><.+?> var match = line.match(/^(\s*\})/);
257  
258 <<=|><=|><><><.+?> if (!match) return 0;
259  
260 <<=|><=|><><><.+?> var column = match[1].length;
261 <<=|><=|><><><.+?> var openBracePos = doc.findMatchingBracket({row: row, column: column});
262  
263 <<=|><=|><><><.+?> if (!openBracePos || openBracePos.row == row) return 0;
264  
265 <<=|><=|><><><.+?> var indent = this.$getIndent(doc.getLine(openBracePos.row));
266 <<=|><=|><><><.+?> doc.replace(new Range(row, 0, row, column-1), indent);
267 <<=|><=|><><><.+?> };
268  
269 <<=|><=|><><><.+?> this.$getIndent = function(line) {
270 <<=|><=|><><><.+?> return line.match(/^\s*/)[0];
271 <<=|><=|><><><.+?> };
272  
273 <<=|><=|><><><.+?>}).call(MatchingBraceOutdent.prototype);
274  
275 <<=|><=|><><><.+?>exports.MatchingBraceOutdent = MatchingBraceOutdent;
276 <<=|><=|><><><.+?>});
277  
278 <<=|><=|><><><.+?>ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
279 <<=|><=|><><><.+?>"use strict";
280  
281 <<=|><=|><><><.+?>var oop = require("../../lib/oop");
282 <<=|><=|><><><.+?>var Range = require("../../range").Range;
283 <<=|><=|><><><.+?>var BaseFoldMode = require("./fold_mode").FoldMode;
284  
285 <<=|><=|><><><.+?>var FoldMode = exports.FoldMode = function(commentRegex) {
286 <<=|><=|><><><.+?> if (commentRegex) {
287 <<=|><=|><><><.+?> this.foldingStartMarker = new RegExp(
288 <<=|><=|><><><.+?> this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)
289 <<=|><=|><><><.+?> );
290 <<=|><=|><><><.+?> this.foldingStopMarker = new RegExp(
291 <<=|><=|><><><.+?> this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)
292 <<=|><=|><><><.+?> );
293 <<=|><=|><><><.+?> }
294 <<=|><=|><><><.+?>};
295 <<=|><=|><><><.+?>oop.inherits(FoldMode, BaseFoldMode);
296  
297 <<=|><=|><><><.+?>(function() {
298  
299 <<=|><=|><><><.+?> this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;
300 <<=|><=|><><><.+?> this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;
301 <<=|><=|><><><.+?> this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;
302 <<=|><=|><><><.+?> this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;
303 <<=|><=|><><><.+?> this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;
304 <<=|><=|><><><.+?> this._getFoldWidgetBase = this.getFoldWidget;
305 <<=|><=|><><><.+?> this.getFoldWidget = function(session, foldStyle, row) {
306 <<=|><=|><><><.+?> var line = session.getLine(row);
307  
308 <<=|><=|><><><.+?> if (this.singleLineBlockCommentRe.test(line)) {
309 <<=|><=|><><><.+?> if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))
310 <<=|><=|><><><.+?> return "";
311 <<=|><=|><><><.+?> }
312  
313 <<=|><=|><><><.+?> var fw = this._getFoldWidgetBase(session, foldStyle, row);
314  
315 <<=|><=|><><><.+?> if (!fw && this.startRegionRe.test(line))
316 <<=|><=|><><><.+?> return "start"; // lineCommentRegionStart
317  
318 <<=|><=|><><><.+?> return fw;
319 <<=|><=|><><><.+?> };
320  
321 <<=|><=|><><><.+?> this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {
322 <<=|><=|><><><.+?> var line = session.getLine(row);
323  
324 <<=|><=|><><><.+?> if (this.startRegionRe.test(line))
325 <<=|><=|><><><.+?> return this.getCommentRegionBlock(session, line, row);
326  
327 <<=|><=|><><><.+?> var match = line.match(this.foldingStartMarker);
328 <<=|><=|><><><.+?> if (match) {
329 <<=|><=|><><><.+?> var i = match.index;
330  
331 <<=|><=|><><><.+?> if (match[1])
332 <<=|><=|><><><.+?> return this.openingBracketBlock(session, match[1], row, i);
333  
334 <<=|><=|><><><.+?> var range = session.getCommentFoldRange(row, i + match[0].length, 1);
335  
336 <<=|><=|><><><.+?> if (range && !range.isMultiLine()) {
337 <<=|><=|><><><.+?> if (forceMultiline) {
338 <<=|><=|><><><.+?> range = this.getSectionRange(session, row);
339 <<=|><=|><><><.+?> } else if (foldStyle != "all")
340 <<=|><=|><><><.+?> range = null;
341 <<=|><=|><><><.+?> }
342  
343 <<=|><=|><><><.+?> return range;
344 <<=|><=|><><><.+?> }
345  
346 <<=|><=|><><><.+?> if (foldStyle === "markbegin")
347 <<=|><=|><><><.+?> return;
348  
349 <<=|><=|><><><.+?> var match = line.match(this.foldingStopMarker);
350 <<=|><=|><><><.+?> if (match) {
351 <<=|><=|><><><.+?> var i = match.index + match[0].length;
352  
353 <<=|><=|><><><.+?> if (match[1])
354 <<=|><=|><><><.+?> return this.closingBracketBlock(session, match[1], row, i);
355  
356 <<=|><=|><><><.+?> return session.getCommentFoldRange(row, i, -1);
357 <<=|><=|><><><.+?> }
358 <<=|><=|><><><.+?> };
359  
360 <<=|><=|><><><.+?> this.getSectionRange = function(session, row) {
361 <<=|><=|><><><.+?> var line = session.getLine(row);
362 <<=|><=|><><><.+?> var startIndent = line.search(/\S/);
363 <<=|><=|><><><.+?> var startRow = row;
364 <<=|><=|><><><.+?> var startColumn = line.length;
365 <<=|><=|><><><.+?> row = row + 1;
366 <<=|><=|><><><.+?> var endRow = row;
367 <<=|><=|><><><.+?> var maxRow = session.getLength();
368 <<=|><=|><><><.+?> while (++row < maxRow) {
369 <<=|><=|><><><.+?> line = session.getLine(row);
370 <<=|><=|><><><.+?> var indent = line.search(/\S/);
371 <<=|><=|><><><.+?> if (indent === -1)
372 <<=|><=|><><><.+?> continue;
373 <<=|><=|><><><.+?> if (startIndent > indent)
374 <<=|><=|><><><.+?> break;
375 <<=|><=|><><><.+?> var subRange = this.getFoldWidgetRange(session, "all", row);
376  
377 <<=|><=|><><><.+?> if (subRange) {
378 <<=|><=|><><><.+?> if (subRange.start.row <= startRow) {
379 <<=|><=|><><><.+?> break;
380 <<=|><=|><><><.+?> } else if (subRange.isMultiLine()) {
381 <<=|><=|><><><.+?> row = subRange.end.row;
382 <<=|><=|><><><.+?> } else if (startIndent == indent) {
383 <<=|><=|><><><.+?> break;
384 <<=|><=|><><><.+?> }
385 <<=|><=|><><><.+?> }
386 <<=|><=|><><><.+?> endRow = row;
387 <<=|><=|><><><.+?> }
388  
389 <<=|><=|><><><.+?> return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);
390 <<=|><=|><><><.+?> };
391 <<=|><=|><><><.+?> this.getCommentRegionBlock = function(session, line, row) {
392 <<=|><=|><><><.+?> var startColumn = line.search(/\s*$/);
393 <<=|><=|><><><.+?> var maxRow = session.getLength();
394 <<=|><=|><><><.+?> var startRow = row;
395  
396 <<=|><=|><><><.+?> var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;
397 <<=|><=|><><><.+?> var depth = 1;
398 <<=|><=|><><><.+?> while (++row < maxRow) {
399 <<=|><=|><><><.+?> line = session.getLine(row);
400 <<=|><=|><><><.+?> var m = re.exec(line);
401 <<=|><=|><><><.+?> if (!m) continue;
402 <<=|><=|><><><.+?> if (m[1]) depth--;
403 <<=|><=|><><><.+?> else depth++;
404  
405 <<=|><=|><><><.+?> if (!depth) break;
406 <<=|><=|><><><.+?> }
407  
408 <<=|><=|><><><.+?> var endRow = row;
409 <<=|><=|><><><.+?> if (endRow > startRow) {
410 <<=|><=|><><><.+?> return new Range(startRow, startColumn, endRow, line.length);
411 <<=|><=|><><><.+?> }
412 <<=|><=|><><><.+?> };
413  
414 <<=|><=|><><><.+?>}).call(FoldMode.prototype);
415  
416 <<=|><=|><><><.+?>});
417  
418 <<=|><=|><><><.+?>ace.define("ace/mode/c_cpp",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c_cpp_highlight_rules","ace/mode/matching_brace_outdent","ace/range","ace/mode/behaviour/cstyle","ace/mode/folding/cstyle"], function(require, exports, module) {
419 <<=|><=|><><><.+?>"use strict";
420  
421 <<=|><=|><><><.+?>var oop = require("../lib/oop");
422 <<=|><=|><><><.+?>var TextMode = require("./text").Mode;
423 <<=|><=|><><><.+?>var c_cppHighlightRules = require("./c_cpp_highlight_rules").c_cppHighlightRules;
424 <<=|><=|><><><.+?>var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
425 <<=|><=|><><><.+?>var Range = require("../range").Range;
426 <<=|><=|><><><.+?>var CstyleBehaviour = require("./behaviour/cstyle").CstyleBehaviour;
427 <<=|><=|><><><.+?>var CStyleFoldMode = require("./folding/cstyle").FoldMode;
428  
429 <<=|><=|><><><.+?>var Mode = function() {
430 <<=|><=|><><><.+?> this.HighlightRules = c_cppHighlightRules;
431  
432 <<=|><=|><><><.+?> this.$outdent = new MatchingBraceOutdent();
433 <<=|><=|><><><.+?> this.$behaviour = new CstyleBehaviour();
434  
435 <<=|><=|><><><.+?> this.foldingRules = new CStyleFoldMode();
436 <<=|><=|><><><.+?>};
437 <<=|><=|><><><.+?>oop.inherits(Mode, TextMode);
438  
439 <<=|><=|><><><.+?>(function() {
440  
441 <<=|><=|><><><.+?> this.lineCommentStart = "//";
442 <<=|><=|><><><.+?> this.blockComment = {start: "/*", end: "*/"};
443  
444 <<=|><=|><><><.+?> this.getNextLineIndent = function(state, line, tab) {
445 <<=|><=|><><><.+?> var indent = this.$getIndent(line);
446  
447 <<=|><=|><><><.+?> var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
448 <<=|><=|><><><.+?> var tokens = tokenizedLine.tokens;
449 <<=|><=|><><><.+?> var endState = tokenizedLine.state;
450  
451 <<=|><=|><><><.+?> if (tokens.length && tokens[tokens.length-1].type == "comment") {
452 <<=|><=|><><><.+?> return indent;
453 <<=|><=|><><><.+?> }
454  
455 <<=|><=|><><><.+?> if (state == "start") {
456 <<=|><=|><><><.+?> var match = line.match(/^.*[\{\(\[]\s*$/);
457 <<=|><=|><><><.+?> if (match) {
458 <<=|><=|><><><.+?> indent += tab;
459 <<=|><=|><><><.+?> }
460 <<=|><=|><><><.+?> } else if (state == "doc-start") {
461 <<=|><=|><><><.+?> if (endState == "start") {
462 <<=|><=|><><><.+?> return "";
463 <<=|><=|><><><.+?> }
464 <<=|><=|><><><.+?> var match = line.match(/^\s*(\/?)\*/);
465 <<=|><=|><><><.+?> if (match) {
466 <<=|><=|><><><.+?> if (match[1]) {
467 <<=|><=|><><><.+?> indent += " ";
468 <<=|><=|><><><.+?> }
469 <<=|><=|><><><.+?> indent += "* ";
470 <<=|><=|><><><.+?> }
471 <<=|><=|><><><.+?> }
472  
473 <<=|><=|><><><.+?> return indent;
474 <<=|><=|><><><.+?> };
475  
476 <<=|><=|><><><.+?> this.checkOutdent = function(state, line, input) {
477 <<=|><=|><><><.+?> return this.$outdent.checkOutdent(line, input);
478 <<=|><=|><><><.+?> };
479  
480 <<=|><=|><><><.+?> this.autoOutdent = function(state, doc, row) {
481 <<=|><=|><><><.+?> this.$outdent.autoOutdent(doc, row);
482 <<=|><=|><><><.+?> };
483  
484 <<=|><=|><><><.+?> this.$id = "ace/mode/c_cpp";
485 <<=|><=|><><><.+?>}).call(Mode.prototype);
486  
487 <<=|><=|><><><.+?>exports.Mode = Mode;
488 <<=|><=|><><><.+?>});