corrade-nucleus-nucleons – Blame information for rev 20
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | ace.define("ace/mode/maze_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 MazeHighlightRules = function() { |
||
8 | |||
9 | this.$rules = { |
||
10 | start: [{ |
||
11 | token: "keyword.control", |
||
12 | regex: /##|``/, |
||
13 | comment: "Wall" |
||
14 | }, { |
||
15 | token: "entity.name.tag", |
||
16 | regex: /\.\./, |
||
17 | comment: "Path" |
||
18 | }, { |
||
19 | token: "keyword.control", |
||
20 | regex: /<>/,> |
||
21 | <> comment: "Splitter"> |
||
22 | <> }, {> |
||
23 | <> token: "entity.name.tag",> |
||
24 | <> regex: /\*[\*A-Za-z0-9]/,> |
||
25 | <> comment: "Signal"> |
||
26 | <> }, {> |
||
27 | <> token: "constant.numeric",> |
||
28 | <> regex: /[0-9]{2}/,> |
||
29 | <> comment: "Pause"> |
||
30 | <> }, {> |
||
31 | <> token: "keyword.control",> |
||
32 | <> regex: /\^\^/,> |
||
33 | <> comment: "Start"> |
||
34 | <> }, {> |
||
35 | <> token: "keyword.control",> |
||
36 | <> regex: /\(\)/,> |
||
37 | <> comment: "Hole"> |
||
38 | <> }, {> |
||
39 | <> token: "support.function",> |
||
40 | <> regex: />>/,> |
||
41 | <> comment: "Out"> |
||
42 | <> }, {> |
||
43 | <> token: "support.function",> |
||
44 | <> regex: />\//,> |
||
45 | <> comment: "Ln Out"> |
||
46 | <> }, {> |
||
47 | <> token: "support.function",> |
||
48 | <> regex: /<,> |
||
49 | <>< comment: "In"> |
||
50 | <>< }, {> |
||
51 | <>< token: "keyword.control",> |
||
52 | <>< regex: /--/,> |
||
53 | <>< comment: "One use"> |
||
54 | <>< }, {> |
||
55 | <>< token: "constant.language",> |
||
56 | <>< regex: /%[LRUDNlrudn]/,> |
||
57 | <>< comment: "Direction"> |
||
58 | <>< }, {> |
||
59 | <>< token: [> |
||
60 | <>< "entity.name.function",> |
||
61 | <>< "keyword.other",> |
||
62 | <>< "keyword.operator",> |
||
63 | <>< "keyword.other",> |
||
64 | <>< "keyword.operator",> |
||
65 | <>< "constant.numeric",> |
||
66 | <>< "keyword.operator",> |
||
67 | <>< "keyword.other",> |
||
68 | <>< "keyword.operator",> |
||
69 | <>< "constant.numeric",> |
||
70 | <>< "string.quoted.double",> |
||
71 | <>< "string.quoted.single"> |
||
72 | <>< ],> |
||
73 | <>< regex: /([A-Za-z][A-Za-z0-9])( *-> *)(?:([-+*\/]=)( *)((?:-)?)([0-9]+)|(=)( *)(?:((?:-)?)([0-9]+)|("[^"]*")|('[^']*')))/,> |
||
74 | <>< comment: "Assignment function"> |
||
75 | <>< }, {> |
||
76 | <>< token: [> |
||
77 | <>< "entity.name.function",> |
||
78 | <>< "keyword.other",> |
||
79 | <>< "keyword.control",> |
||
80 | <>< "keyword.other",> |
||
81 | <>< "keyword.operator",> |
||
82 | <>< "keyword.other",> |
||
83 | <>< "keyword.operator",> |
||
84 | <>< "constant.numeric",> |
||
85 | <>< "entity.name.tag",> |
||
86 | <>< "keyword.other",> |
||
87 | <>< "keyword.control",> |
||
88 | <>< "keyword.other",> |
||
89 | <>< "constant.language",> |
||
90 | <>< "keyword.other",> |
||
91 | <>< "keyword.control",> |
||
92 | <>< "keyword.other",> |
||
93 | <>< "constant.language"> |
||
94 | <>< ],> |
||
95 | <>< regex: /([A-Za-z][A-Za-z0-9])( *-> *)(IF|if)( *)(?:([<>]=?|==)( *)((?:-)?)([0-9]+)|(\*[\*A-Za-z0-9]))( *)(THEN|then)( *)(%[LRUDNlrudn])(?:( *)(ELSE|else)( *)(%[LRUDNlrudn]))?/,>> |
||
96 | <><<> comment: "Equality Function">> |
||
97 | <><<> }, {>> |
||
98 | <><<> token: "entity.name.function",>> |
||
99 | <><<> regex: /[A-Za-z][A-Za-z0-9]/,>> |
||
100 | <><<> comment: "Function cell">> |
||
101 | <><<> }, {>> |
||
102 | <><<> token: "comment.line.double-slash",>> |
||
103 | <><<> regex: / *\/\/.*/,>> |
||
104 | <><<> comment: "Comment">> |
||
105 | <><<> }]>> |
||
106 | <><<> };>> |
||
107 | |||
108 | <><<> this.normalizeRules();>> |
||
109 | <><<>};>> |
||
110 | |||
111 | <><<>MazeHighlightRules.metaData = {>> |
||
112 | <><<> fileTypes: ["mz"],>> |
||
113 | <><<> name: "Maze",>> |
||
114 | <><<> scopeName: "source.maze">> |
||
115 | <><<>};>> |
||
116 | |||
117 | |||
118 | <><<>oop.inherits(MazeHighlightRules, TextHighlightRules);>> |
||
119 | |||
120 | <><<>exports.MazeHighlightRules = MazeHighlightRules;>> |
||
121 | <><<>});>> |
||
122 | |||
123 | <><<>ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {>> |
||
124 | <><<>"use strict";>> |
||
125 | |||
126 | <><<>var oop = require("../../lib/oop");>> |
||
127 | <><<>var Range = require("../../range").Range;>> |
||
128 | <><<>var BaseFoldMode = require("./fold_mode").FoldMode;>> |
||
129 | |||
130 | <><<>var FoldMode = exports.FoldMode = function(commentRegex) {>> |
||
131 | <><<> if (commentRegex) {>> |
||
132 | <><<> this.foldingStartMarker = new RegExp(>> |
||
133 | <><<> this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start)>> |
||
134 | <><<> );>> |
||
135 | <><<> this.foldingStopMarker = new RegExp(>> |
||
136 | <><<> this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end)>> |
||
137 | <><<> );>> |
||
138 | <><<> }>> |
||
139 | <><<>};>> |
||
140 | <><<>oop.inherits(FoldMode, BaseFoldMode);>> |
||
141 | |||
142 | <><<>(function() {>> |
||
143 | |||
144 | <><<> this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/;>> |
||
145 | <><<> this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/;>> |
||
146 | <><<> this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/;>> |
||
147 | <><<> this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/;>> |
||
148 | <><<> this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/;>> |
||
149 | <><<> this._getFoldWidgetBase = this.getFoldWidget;>> |
||
150 | <><<> this.getFoldWidget = function(session, foldStyle, row) {>> |
||
151 | <><<> var line = session.getLine(row);>> |
||
152 | |||
153 | <><<> if (this.singleLineBlockCommentRe.test(line)) {>> |
||
154 | <><<> if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line))>> |
||
155 | <><<> return "";>> |
||
156 | <><<> }>> |
||
157 | |||
158 | <><<> var fw = this._getFoldWidgetBase(session, foldStyle, row);>> |
||
159 | |||
160 | <><<> if (!fw && this.startRegionRe.test(line))>> |
||
161 | <><<> return "start"; // lineCommentRegionStart>> |
||
162 | |||
163 | <><<> return fw;>> |
||
164 | <><<> };>> |
||
165 | |||
166 | <><<> this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) {>> |
||
167 | <><<> var line = session.getLine(row);>> |
||
168 | |||
169 | <><<> if (this.startRegionRe.test(line))>> |
||
170 | <><<> return this.getCommentRegionBlock(session, line, row);>> |
||
171 | |||
172 | <><<> var match = line.match(this.foldingStartMarker);>> |
||
173 | <><<> if (match) {>> |
||
174 | <><<> var i = match.index;>> |
||
175 | |||
176 | <><<> if (match[1])>> |
||
177 | <><<> return this.openingBracketBlock(session, match[1], row, i);>> |
||
178 | |||
179 | <><<> var range = session.getCommentFoldRange(row, i + match[0].length, 1);>> |
||
180 | |||
181 | <><<> if (range && !range.isMultiLine()) {>> |
||
182 | <><<> if (forceMultiline) {>> |
||
183 | <><<> range = this.getSectionRange(session, row);>> |
||
184 | <><<> } else if (foldStyle != "all")>> |
||
185 | <><<> range = null;>> |
||
186 | <><<> }>> |
||
187 | |||
188 | <><<> return range;>> |
||
189 | <><<> }>> |
||
190 | |||
191 | <><<> if (foldStyle === "markbegin")>> |
||
192 | <><<> return;>> |
||
193 | |||
194 | <><<> var match = line.match(this.foldingStopMarker);>> |
||
195 | <><<> if (match) {>> |
||
196 | <><<> var i = match.index + match[0].length;>> |
||
197 | |||
198 | <><<> if (match[1])>> |
||
199 | <><<> return this.closingBracketBlock(session, match[1], row, i);>> |
||
200 | |||
201 | <><<> return session.getCommentFoldRange(row, i, -1);>> |
||
202 | <><<> }>> |
||
203 | <><<> };>> |
||
204 | |||
205 | <><<> this.getSectionRange = function(session, row) {>> |
||
206 | <><<> var line = session.getLine(row);>> |
||
207 | <><<> var startIndent = line.search(/\S/);>> |
||
208 | <><<> var startRow = row;>> |
||
209 | <><<> var startColumn = line.length;>> |
||
210 | <><<> row = row + 1;>> |
||
211 | <><<> var endRow = row;>> |
||
212 | <><<> var maxRow = session.getLength();>> |
||
213 | <><<> while (++row < maxRow) {>> |
||
214 | <><<> line = session.getLine(row);>> |
||
215 | <><<> var indent = line.search(/\S/);>> |
||
216 | <><<> if (indent === -1)>> |
||
217 | <><<> continue;>> |
||
218 | <><<> if (startIndent > indent)>> |
||
219 | <><<> break;>> |
||
220 | <><<> var subRange = this.getFoldWidgetRange(session, "all", row);>> |
||
221 | |||
222 | <><<> if (subRange) {>> |
||
223 | <><<> if (subRange.start.row <= startRow) {>> |
||
224 | <><<> break;>> |
||
225 | <><<> } else if (subRange.isMultiLine()) {>> |
||
226 | <><<> row = subRange.end.row;>> |
||
227 | <><<> } else if (startIndent == indent) {>> |
||
228 | <><<> break;>> |
||
229 | <><<> }>> |
||
230 | <><<> }>> |
||
231 | <><<> endRow = row;>> |
||
232 | <><<> }>> |
||
233 | |||
234 | <><<> return new Range(startRow, startColumn, endRow, session.getLine(endRow).length);>> |
||
235 | <><<> };>> |
||
236 | <><<> this.getCommentRegionBlock = function(session, line, row) {>> |
||
237 | <><<> var startColumn = line.search(/\s*$/);>> |
||
238 | <><<> var maxRow = session.getLength();>> |
||
239 | <><<> var startRow = row;>> |
||
240 | |||
241 | <><<> var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/;>> |
||
242 | <><<> var depth = 1;>> |
||
243 | <><<> while (++row < maxRow) {>> |
||
244 | <><<> line = session.getLine(row);>> |
||
245 | <><<> var m = re.exec(line);>> |
||
246 | <><<> if (!m) continue;>> |
||
247 | <><<> if (m[1]) depth--;>> |
||
248 | <><<> else depth++;>> |
||
249 | |||
250 | <><<> if (!depth) break;>> |
||
251 | <><<> }>> |
||
252 | |||
253 | <><<> var endRow = row;>> |
||
254 | <><<> if (endRow > startRow) {>> |
||
255 | <><<> return new Range(startRow, startColumn, endRow, line.length);>> |
||
256 | <><<> }>> |
||
257 | <><<> };>> |
||
258 | |||
259 | <><<>}).call(FoldMode.prototype);>> |
||
260 | |||
261 | <><<>});>> |
||
262 | |||
263 | <><<>ace.define("ace/mode/maze",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/maze_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) {>> |
||
264 | <><<>"use strict";>> |
||
265 | |||
266 | <><<>var oop = require("../lib/oop");>> |
||
267 | <><<>var TextMode = require("./text").Mode;>> |
||
268 | <><<>var MazeHighlightRules = require("./maze_highlight_rules").MazeHighlightRules;>> |
||
269 | <><<>var FoldMode = require("./folding/cstyle").FoldMode;>> |
||
270 | |||
271 | <><<>var Mode = function() {>> |
||
272 | <><<> this.HighlightRules = MazeHighlightRules;>> |
||
273 | <><<> this.foldingRules = new FoldMode();>> |
||
274 | <><<> this.$behaviour = this.$defaultBehaviour;>> |
||
275 | <><<>};>> |
||
276 | <><<>oop.inherits(Mode, TextMode);>> |
||
277 | |||
278 | <><<>(function() {>> |
||
279 | <><<> this.lineCommentStart = "//";>> |
||
280 | <><<> this.$id = "ace/mode/maze";>> |
||
281 | <><<>}).call(Mode.prototype);>> |
||
282 | |||
283 | <><<>exports.Mode = Mode;>> |
||
284 | <><<>});>> |