Debian Codegraph @

extensions/CodeEditor/modules/lib/ace/mode-diff.js

raw symbols SCIP
1 ace.define("ace/mode/diff_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"], function(require, exports, module){"use strict";
2 var oop = require("../lib/oop");
3 var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
4 var DiffHighlightRules = function () {
5 this.$rules = {
6 "start": [{
7 regex: "^(?:\\*{15}|={67}|-{3}|\\+{3})$",
8 token: "punctuation.definition.separator.diff",
9 "name": "keyword"
10 }, {
11 regex: "^(@@)(\\s*.+?\\s*)(@@)(.*)$",
12 token: [
13 "constant",
14 "constant.numeric",
15 "constant",
16 "comment.doc.tag"
17 ]
18 }, {
19 regex: "^(\\d+)([,\\d]+)(a|d|c)(\\d+)([,\\d]+)(.*)$",
20 token: [
21 "constant.numeric",
22 "punctuation.definition.range.diff",
23 "constant.function",
24 "constant.numeric",
25 "punctuation.definition.range.diff",
26 "invalid"
27 ],
28 "name": "meta."
29 }, {
30 regex: "^(\\-{3}|\\+{3}|\\*{3})( .+)$",
31 token: [
32 "constant.numeric",
33 "meta.tag"
34 ]
35 }, {
36 regex: "^([!+>])(.*?)(\\s*)$",
37 token: [
38 "support.constant",
39 "text",
40 "invalid"
41 ]
42 }, {
43 regex: "^([<\\-])(.*?)(\\s*)$",
44 token: [
45 "support.function",
46 "string",
47 "invalid"
48 ]
49 }, {
50 regex: "^(diff)(\\s+--\\w+)?(.+?)( .+)?$",
51 token: ["variable", "variable", "keyword", "variable"]
52 }, {
53 regex: "^Index.+$",
54 token: "variable"
55 }, {
56 regex: "^\\s+$",
57 token: "text"
58 }, {
59 regex: "\\s*$",
60 token: "invalid"
61 }, {
62 defaultToken: "invisible",
63 caseInsensitive: true
64 }
65 ]
66 };
67 };
68 oop.inherits(DiffHighlightRules, TextHighlightRules);
69 exports.DiffHighlightRules = DiffHighlightRules;
70
71 });
72
73 ace.define("ace/mode/folding/diff",["require","exports","module","ace/lib/oop","ace/mode/folding/fold_mode","ace/range"], function(require, exports, module){"use strict";
74 var oop = require("../../lib/oop");
75 var BaseFoldMode = require("./fold_mode").FoldMode;
76 var Range = require("../../range").Range;
77 var FoldMode = exports.FoldMode = function (levels, flag) {
78 this.regExpList = levels;
79 this.flag = flag;
80 this.foldingStartMarker = RegExp("^(" + levels.join("|") + ")", this.flag);
81 };
82 oop.inherits(FoldMode, BaseFoldMode);
83 (function () {
84 this.getFoldWidgetRange = function (session, foldStyle, row) {
85 var line = session.getLine(row);
86 var start = { row: row, column: line.length };
87 var regList = this.regExpList;
88 for (var i = 1; i <= regList.length; i++) {
89 var re = RegExp("^(" + regList.slice(0, i).join("|") + ")", this.flag);
90 if (re.test(line))
91 break;
92 }
93 for (var l = session.getLength(); ++row < l;) {
94 line = session.getLine(row);
95 if (re.test(line))
96 break;
97 }
98 if (row == start.row + 1)
99 return;
100 return new Range(start.row, start.column, row - 1, line.length);
101 };
102 }).call(FoldMode.prototype);
103
104 });
105
106 ace.define("ace/mode/diff",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/diff_highlight_rules","ace/mode/folding/diff"], function(require, exports, module){"use strict";
107 var oop = require("../lib/oop");
108 var TextMode = require("./text").Mode;
109 var HighlightRules = require("./diff_highlight_rules").DiffHighlightRules;
110 var FoldMode = require("./folding/diff").FoldMode;
111 var Mode = function () {
112 this.HighlightRules = HighlightRules;
113 this.foldingRules = new FoldMode(["diff", "@@|\\*{5}"], "i");
114 };
115 oop.inherits(Mode, TextMode);
116 (function () {
117 this.$id = "ace/mode/diff";
118 this.snippetFileId = "ace/snippets/diff";
119 }).call(Mode.prototype);
120 exports.Mode = Mode;
121
122 }); (function() {
123 ace.require(["ace/mode/diff"], function(m) {
124 if (typeof module == "object" && typeof exports == "object" && module) {
125 module.exports = m;
126 }
127 });
128 })();
129