corrade-nucleus-nucleons – Blame information for rev 24
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
20 | office | 1 | ace.define("ace/mode/io_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 IoHighlightRules = function() { |
||
8 | |||
9 | this.$rules = { start: |
||
10 | [ { token: [ 'text', 'meta.empty-parenthesis.io' ], |
||
11 | regex: '(\\()(\\))', |
||
12 | comment: 'we match this to overload return inside () --Allan; scoping rules for what gets the scope have changed, so we now group the ) instead of the ( -- Rob' }, |
||
13 | { token: [ 'text', 'meta.comma-parenthesis.io' ], |
||
14 | regex: '(\\,)(\\))', |
||
15 | comment: 'We want to do the same for ,) -- Seckar; same as above -- Rob' }, |
||
16 | { token: 'keyword.control.io', |
||
17 | regex: '\\b(?:if|ifTrue|ifFalse|ifTrueIfFalse|for|loop|reverseForeach|foreach|map|continue|break|while|do|return)\\b' }, |
||
18 | { token: 'punctuation.definition.comment.io', |
||
19 | regex: '/\\*', |
||
20 | push: |
||
21 | [ { token: 'punctuation.definition.comment.io', |
||
22 | regex: '\\*/', |
||
23 | next: 'pop' }, |
||
24 | { defaultToken: 'comment.block.io' } ] }, |
||
25 | { token: 'punctuation.definition.comment.io', |
||
26 | regex: '//', |
||
27 | push: |
||
28 | [ { token: 'comment.line.double-slash.io', |
||
29 | regex: '$', |
||
30 | next: 'pop' }, |
||
31 | { defaultToken: 'comment.line.double-slash.io' } ] }, |
||
32 | { token: 'punctuation.definition.comment.io', |
||
33 | regex: '#', |
||
34 | push: |
||
35 | [ { token: 'comment.line.number-sign.io', regex: '$', next: 'pop' }, |
||
36 | { defaultToken: 'comment.line.number-sign.io' } ] }, |
||
37 | { token: 'variable.language.io', |
||
38 | regex: '\\b(?:self|sender|target|proto|protos|parent)\\b', |
||
39 | comment: 'I wonder if some of this isn\'t variable.other.language? --Allan; scoping this as variable.language to match Objective-C\'s handling of \'self\', which is inconsistent with C++\'s handling of \'this\' but perhaps intentionally so -- Rob' }, |
||
40 | { token: 'keyword.operator.io', |
||
41 | regex: '<=|>=|=|:=|\\*|\\||\\|\\||\\+|-|/|&|&&|>|<|\\?|@|@@|\\b(?:and|or)\\b' }, |
||
42 | { token: 'constant.other.io', regex: '\\bGL[\\w_]+\\b' }, |
||
43 | { token: 'support.class.io', regex: '\\b[A-Z](?:\\w+)?\\b' }, |
||
44 | { token: 'support.function.io', |
||
45 | regex: '\\b(?:clone|call|init|method|list|vector|block|\\w+(?=\\s*\\())\\b' }, |
||
46 | { token: 'support.function.open-gl.io', |
||
47 | regex: '\\bgl(?:u|ut)?[A-Z]\\w+\\b' }, |
||
48 | { token: 'punctuation.definition.string.begin.io', |
||
49 | regex: '"""', |
||
50 | push: |
||
51 | [ { token: 'punctuation.definition.string.end.io', |
||
52 | regex: '"""', |
||
53 | next: 'pop' }, |
||
54 | { token: 'constant.character.escape.io', regex: '\\\\.' }, |
||
55 | { defaultToken: 'string.quoted.triple.io' } ] }, |
||
56 | { token: 'punctuation.definition.string.begin.io', |
||
57 | regex: '"', |
||
58 | push: |
||
59 | [ { token: 'punctuation.definition.string.end.io', |
||
60 | regex: '"', |
||
61 | next: 'pop' }, |
||
62 | { token: 'constant.character.escape.io', regex: '\\\\.' }, |
||
63 | { defaultToken: 'string.quoted.double.io' } ] }, |
||
64 | { token: 'constant.numeric.io', |
||
65 | regex: '\\b(?:0(?:x|X)[0-9a-fA-F]*|(?:[0-9]+\\.?[0-9]*|\\.[0-9]+)(?:(?:e|E)(?:\\+|-)?[0-9]+)?)(?:L|l|UL|ul|u|U|F|f)?\\b' }, |
||
66 | { token: 'variable.other.global.io', regex: 'Lobby\\b' }, |
||
67 | { token: 'constant.language.io', |
||
68 | regex: '\\b(?:TRUE|true|FALSE|false|NULL|null|Null|Nil|nil|YES|NO)\\b' } ] } |
||
69 | |||
70 | this.normalizeRules(); |
||
71 | }; |
||
72 | |||
73 | IoHighlightRules.metaData = { fileTypes: [ 'io' ], |
||
74 | keyEquivalent: '^~I', |
||
75 | name: 'Io', |
||
76 | scopeName: 'source.io' } |
||
77 | |||
78 | |||
79 | oop.inherits(IoHighlightRules, TextHighlightRules); |
||
80 | |||
81 | exports.IoHighlightRules = IoHighlightRules; |
||
82 | }); |
||
83 | |||
84 | ace.define("ace/mode/folding/cstyle",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) { |
||
85 | "use strict"; |
||
86 | |||
87 | var oop = require("../../lib/oop"); |
||
88 | var Range = require("../../range").Range; |
||
89 | var BaseFoldMode = require("./fold_mode").FoldMode; |
||
90 | |||
91 | var FoldMode = exports.FoldMode = function(commentRegex) { |
||
92 | if (commentRegex) { |
||
93 | this.foldingStartMarker = new RegExp( |
||
94 | this.foldingStartMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.start) |
||
95 | ); |
||
96 | this.foldingStopMarker = new RegExp( |
||
97 | this.foldingStopMarker.source.replace(/\|[^|]*?$/, "|" + commentRegex.end) |
||
98 | ); |
||
99 | } |
||
100 | }; |
||
101 | oop.inherits(FoldMode, BaseFoldMode); |
||
102 | |||
103 | (function() { |
||
104 | |||
105 | this.foldingStartMarker = /(\{|\[)[^\}\]]*$|^\s*(\/\*)/; |
||
106 | this.foldingStopMarker = /^[^\[\{]*(\}|\])|^[\s\*]*(\*\/)/; |
||
107 | this.singleLineBlockCommentRe= /^\s*(\/\*).*\*\/\s*$/; |
||
108 | this.tripleStarBlockCommentRe = /^\s*(\/\*\*\*).*\*\/\s*$/; |
||
109 | this.startRegionRe = /^\s*(\/\*|\/\/)#?region\b/; |
||
110 | this._getFoldWidgetBase = this.getFoldWidget; |
||
111 | this.getFoldWidget = function(session, foldStyle, row) { |
||
112 | var line = session.getLine(row); |
||
113 | |||
114 | if (this.singleLineBlockCommentRe.test(line)) { |
||
115 | if (!this.startRegionRe.test(line) && !this.tripleStarBlockCommentRe.test(line)) |
||
116 | return ""; |
||
117 | } |
||
118 | |||
119 | var fw = this._getFoldWidgetBase(session, foldStyle, row); |
||
120 | |||
121 | if (!fw && this.startRegionRe.test(line)) |
||
122 | return "start"; // lineCommentRegionStart |
||
123 | |||
124 | return fw; |
||
125 | }; |
||
126 | |||
127 | this.getFoldWidgetRange = function(session, foldStyle, row, forceMultiline) { |
||
128 | var line = session.getLine(row); |
||
129 | |||
130 | if (this.startRegionRe.test(line)) |
||
131 | return this.getCommentRegionBlock(session, line, row); |
||
132 | |||
133 | var match = line.match(this.foldingStartMarker); |
||
134 | if (match) { |
||
135 | var i = match.index; |
||
136 | |||
137 | if (match[1]) |
||
138 | return this.openingBracketBlock(session, match[1], row, i); |
||
139 | |||
140 | var range = session.getCommentFoldRange(row, i + match[0].length, 1); |
||
141 | |||
142 | if (range && !range.isMultiLine()) { |
||
143 | if (forceMultiline) { |
||
144 | range = this.getSectionRange(session, row); |
||
145 | } else if (foldStyle != "all") |
||
146 | range = null; |
||
147 | } |
||
148 | |||
149 | return range; |
||
150 | } |
||
151 | |||
152 | if (foldStyle === "markbegin") |
||
153 | return; |
||
154 | |||
155 | var match = line.match(this.foldingStopMarker); |
||
156 | if (match) { |
||
157 | var i = match.index + match[0].length; |
||
158 | |||
159 | if (match[1]) |
||
160 | return this.closingBracketBlock(session, match[1], row, i); |
||
161 | |||
162 | return session.getCommentFoldRange(row, i, -1); |
||
163 | } |
||
164 | }; |
||
165 | |||
166 | this.getSectionRange = function(session, row) { |
||
167 | var line = session.getLine(row); |
||
168 | var startIndent = line.search(/\S/); |
||
169 | var startRow = row; |
||
170 | var startColumn = line.length; |
||
171 | row = row + 1; |
||
172 | var endRow = row; |
||
173 | var maxRow = session.getLength(); |
||
174 | while (++row < maxRow) { |
||
175 | line = session.getLine(row); |
||
176 | var indent = line.search(/\S/); |
||
177 | if (indent === -1) |
||
178 | continue; |
||
179 | if (startIndent > indent) |
||
180 | break; |
||
181 | var subRange = this.getFoldWidgetRange(session, "all", row); |
||
182 | |||
183 | if (subRange) { |
||
184 | if (subRange.start.row <= startRow) { |
||
185 | break; |
||
186 | } else if (subRange.isMultiLine()) { |
||
187 | row = subRange.end.row; |
||
188 | } else if (startIndent == indent) { |
||
189 | break; |
||
190 | } |
||
191 | } |
||
192 | endRow = row; |
||
193 | } |
||
194 | |||
195 | return new Range(startRow, startColumn, endRow, session.getLine(endRow).length); |
||
196 | }; |
||
197 | this.getCommentRegionBlock = function(session, line, row) { |
||
198 | var startColumn = line.search(/\s*$/); |
||
199 | var maxRow = session.getLength(); |
||
200 | var startRow = row; |
||
201 | |||
202 | var re = /^\s*(?:\/\*|\/\/|--)#?(end)?region\b/; |
||
203 | var depth = 1; |
||
204 | while (++row < maxRow) { |
||
205 | line = session.getLine(row); |
||
206 | var m = re.exec(line); |
||
207 | if (!m) continue; |
||
208 | if (m[1]) depth--; |
||
209 | else depth++; |
||
210 | |||
211 | if (!depth) break; |
||
212 | } |
||
213 | |||
214 | var endRow = row; |
||
215 | if (endRow > startRow) { |
||
216 | return new Range(startRow, startColumn, endRow, line.length); |
||
217 | } |
||
218 | }; |
||
219 | |||
220 | }).call(FoldMode.prototype); |
||
221 | |||
222 | }); |
||
223 | |||
224 | ace.define("ace/mode/io",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/io_highlight_rules","ace/mode/folding/cstyle"], function(require, exports, module) { |
||
225 | "use strict"; |
||
226 | |||
227 | var oop = require("../lib/oop"); |
||
228 | var TextMode = require("./text").Mode; |
||
229 | var IoHighlightRules = require("./io_highlight_rules").IoHighlightRules; |
||
230 | var FoldMode = require("./folding/cstyle").FoldMode; |
||
231 | |||
232 | var Mode = function() { |
||
233 | this.HighlightRules = IoHighlightRules; |
||
234 | this.foldingRules = new FoldMode(); |
||
235 | this.$behaviour = this.$defaultBehaviour; |
||
236 | }; |
||
237 | oop.inherits(Mode, TextMode); |
||
238 | |||
239 | (function() { |
||
240 | this.lineCommentStart = "//"; |
||
241 | this.blockComment = {start: "/*", end: "*/"}; |
||
242 | this.$id = "ace/mode/io"; |
||
243 | }).call(Mode.prototype); |
||
244 | |||
245 | exports.Mode = Mode; |
||
246 | }); |