corrade-nucleus-nucleons – Blame information for rev 20

Subversion Repositories:
Rev:
Rev Author Line No. Line
20 office 1 define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
2 "use strict";
3  
4 var Range = require("../range").Range;
5  
6 var MatchingBraceOutdent = function() {};
7  
8 (function() {
9  
10 this.checkOutdent = function(line, input) {
11 if (! /^\s+$/.test(line))
12 return false;
13  
14 return /^\s*\}/.test(input);
15 };
16  
17 this.autoOutdent = function(doc, row) {
18 var line = doc.getLine(row);
19 var match = line.match(/^(\s*\})/);
20  
21 if (!match) return 0;
22  
23 var column = match[1].length;
24 var openBracePos = doc.findMatchingBracket({row: row, column: column});
25  
26 if (!openBracePos || openBracePos.row == row) return 0;
27  
28 var indent = this.$getIndent(doc.getLine(openBracePos.row));
29 doc.replace(new Range(row, 0, row, column-1), indent);
30 };
31  
32 this.$getIndent = function(line) {
33 return line.match(/^\s*/)[0];
34 };
35  
36 }).call(MatchingBraceOutdent.prototype);
37  
38 exports.MatchingBraceOutdent = MatchingBraceOutdent;
39 });
40  
41 define("ace/mode/livescript",["require","exports","module","ace/tokenizer","ace/mode/matching_brace_outdent","ace/mode/text"], function(require, exports, module){
42 var identifier, LiveScriptMode, keywordend, stringfill;
43 identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
44 exports.Mode = LiveScriptMode = (function(superclass){
45 var indenter, prototype = extend$((import$(LiveScriptMode, superclass).displayName = 'LiveScriptMode', LiveScriptMode), superclass).prototype, constructor = LiveScriptMode;
46 function LiveScriptMode(){
47 var that;
48 this.$tokenizer = new (require('../tokenizer')).Tokenizer(LiveScriptMode.Rules);
49 if (that = require('../mode/matching_brace_outdent')) {
50 this.$outdent = new that.MatchingBraceOutdent;
51 }
52 this.$id = "ace/mode/livescript";
53 }
54 indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
55 prototype.getNextLineIndent = function(state, line, tab){
56 var indent, tokens;
57 indent = this.$getIndent(line);
58 tokens = this.$tokenizer.getLineTokens(line, state).tokens;
59 if (!(tokens.length && tokens[tokens.length - 1].type === 'comment')) {
60 if (state === 'start' && indenter.test(line)) {
61 indent += tab;
62 }
63 }
64 return indent;
65 };
66 prototype.lineCommentStart = "#";
67 prototype.blockComment = {start: "###", end: "###"};
68 prototype.checkOutdent = function(state, line, input){
69 var ref$;
70 return (ref$ = this.$outdent) != null ? ref$.checkOutdent(line, input) : void 8;
71 };
72 prototype.autoOutdent = function(state, doc, row){
73 var ref$;
74 return (ref$ = this.$outdent) != null ? ref$.autoOutdent(doc, row) : void 8;
75 };
76 return LiveScriptMode;
77 }(require('../mode/text').Mode));
78 keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
79 stringfill = {
80 defaultToken: 'string'
81 };
82 LiveScriptMode.Rules = {
83 start: [
84 {
85 token: 'keyword',
86 regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
87 }, {
88 token: 'constant.language',
89 regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
90 }, {
91 token: 'invalid.illegal',
92 regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
93 }, {
94 token: 'language.support.class',
95 regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
96 }, {
97 token: 'language.support.function',
98 regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
99 }, {
100 token: 'variable.language',
101 regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
102 }, {
103 token: 'identifier',
104 regex: identifier + '\\s*:(?![:=])'
105 }, {
106 token: 'variable',
107 regex: identifier
108 }, {
109 token: 'keyword.operator',
110 regex: '(?:\\.{3}|\\s+\\?)'
111 }, {
112 token: 'keyword.variable',
113 regex: '(?:@+|::|\\.\\.)',
114 next: 'key'
115 }, {
116 token: 'keyword.operator',
117 regex: '\\.\\s*',
118 next: 'key'
119 }, {
120 token: 'string',
121 regex: '\\\\\\S[^\\s,;)}\\]]*'
122 }, {
123 token: 'string.doc',
124 regex: '\'\'\'',
125 next: 'qdoc'
126 }, {
127 token: 'string.doc',
128 regex: '"""',
129 next: 'qqdoc'
130 }, {
131 token: 'string',
132 regex: '\'',
133 next: 'qstring'
134 }, {
135 token: 'string',
136 regex: '"',
137 next: 'qqstring'
138 }, {
139 token: 'string',
140 regex: '`',
141 next: 'js'
142 }, {
143 token: 'string',
144 regex: '<\\[',
145 next: 'words'
146 }, {
147 token: 'string.regex',
148 regex: '//',
149 next: 'heregex'
150 }, {
151 token: 'comment.doc',
152 regex: '/\\*',
153 next: 'comment'
154 }, {
155 token: 'comment',
156 regex: '#.*'
157 }, {
158 token: 'string.regex',
159 regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
160 next: 'key'
161 }, {
162 token: 'constant.numeric',
163 regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
164 }, {
165 token: 'lparen',
166 regex: '[({[]'
167 }, {
168 token: 'rparen',
169 regex: '[)}\\]]',
170 next: 'key'
171 }, {
172 token: 'keyword.operator',
173 regex: '[\\^!|&%+\\-]+'
174 }, {
175 token: 'text',
176 regex: '\\s+'
177 }
178 ],
179 heregex: [
180 {
181 token: 'string.regex',
182 regex: '.*?//[gimy$?]{0,4}',
183 next: 'start'
184 }, {
185 token: 'string.regex',
186 regex: '\\s*#{'
187 }, {
188 token: 'comment.regex',
189 regex: '\\s+(?:#.*)?'
190 }, {
191 defaultToken: 'string.regex'
192 }
193 ],
194 key: [
195 {
196 token: 'keyword.operator',
197 regex: '[.?@!]+'
198 }, {
199 token: 'identifier',
200 regex: identifier,
201 next: 'start'
202 }, {
203 token: 'text',
204 regex: '',
205 next: 'start'
206 }
207 ],
208 comment: [
209 {
210 token: 'comment.doc',
211 regex: '.*?\\*/',
212 next: 'start'
213 }, {
214 defaultToken: 'comment.doc'
215 }
216 ],
217 qdoc: [
218 {
219 token: 'string',
220 regex: ".*?'''",
221 next: 'key'
222 }, stringfill
223 ],
224 qqdoc: [
225 {
226 token: 'string',
227 regex: '.*?"""',
228 next: 'key'
229 }, stringfill
230 ],
231 qstring: [
232 {
233 token: 'string',
234 regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
235 next: 'key'
236 }, stringfill
237 ],
238 qqstring: [
239 {
240 token: 'string',
241 regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
242 next: 'key'
243 }, stringfill
244 ],
245 js: [
246 {
247 token: 'string',
248 regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
249 next: 'key'
250 }, stringfill
251 ],
252 words: [
253 {
254 token: 'string',
255 regex: '.*?\\]>',
256 next: 'key'
257 }, stringfill
258 ]
259 };
260 function extend$(sub, sup){
261 function fun(){} fun.prototype = (sub.superclass = sup).prototype;
262 (sub.prototype = new fun).constructor = sub;
263 if (typeof sup.extended == 'function') sup.extended(sub);
264 return sub;
265 }
266 function import$(obj, src){
267 var own = {}.hasOwnProperty;
268 for (var key in src) if (own.call(src, key)) obj[key] = src[key];
269 return obj;
270 }
271 });