bzr branch
http://gegoxaren.bato24.eu/bzr/lenasys/trunk
15.1.1
by galaxyAbstractor
Started implementation of a new codeviewer using Ace |
1 |
"no use strict"; |
2 |
;(function(window) { |
|
3 |
if (typeof window.window != "undefined" && window.document) { |
|
4 |
return; |
|
5 |
}
|
|
6 |
||
7 |
window.console = { |
|
8 |
log: function() { |
|
9 |
var msgs = Array.prototype.slice.call(arguments, 0); |
|
10 |
postMessage({type: "log", data: msgs}); |
|
11 |
}, |
|
12 |
error: function() { |
|
13 |
var msgs = Array.prototype.slice.call(arguments, 0); |
|
14 |
postMessage({type: "log", data: msgs}); |
|
15 |
} |
|
16 |
};
|
|
17 |
window.window = window; |
|
18 |
window.ace = window; |
|
19 |
||
20 |
window.normalizeModule = function(parentId, moduleName) { |
|
21 |
// normalize plugin requires |
|
22 |
if (moduleName.indexOf("!") !== -1) { |
|
23 |
var chunks = moduleName.split("!"); |
|
24 |
return normalizeModule(parentId, chunks[0]) + "!" + normalizeModule(parentId, chunks[1]); |
|
25 |
} |
|
26 |
// normalize relative requires |
|
27 |
if (moduleName.charAt(0) == ".") { |
|
28 |
var base = parentId.split("/").slice(0, -1).join("/"); |
|
29 |
moduleName = base + "/" + moduleName; |
|
30 |
|
|
31 |
while(moduleName.indexOf(".") !== -1 && previous != moduleName) { |
|
32 |
var previous = moduleName; |
|
33 |
moduleName = moduleName.replace(/\/\.\//, "/").replace(/[^\/]+\/\.\.\//, ""); |
|
34 |
} |
|
35 |
} |
|
36 |
|
|
37 |
return moduleName; |
|
38 |
};
|
|
39 |
||
40 |
window.require = function(parentId, id) { |
|
41 |
if (!id.charAt) |
|
42 |
throw new Error("worker.js require() accepts only (parentId, id) as arguments"); |
|
43 |
||
44 |
id = normalizeModule(parentId, id); |
|
45 |
||
46 |
var module = require.modules[id]; |
|
47 |
if (module) { |
|
48 |
if (!module.initialized) { |
|
49 |
module.initialized = true; |
|
50 |
module.exports = module.factory().exports; |
|
51 |
} |
|
52 |
return module.exports; |
|
53 |
} |
|
54 |
|
|
55 |
var chunks = id.split("/"); |
|
56 |
chunks[0] = require.tlns[chunks[0]] || chunks[0]; |
|
57 |
var path = chunks.join("/") + ".js"; |
|
58 |
|
|
59 |
require.id = id; |
|
60 |
importScripts(path); |
|
61 |
return require(parentId, id); |
|
62 |
};
|
|
63 |
||
64 |
require.modules = {}; |
|
65 |
require.tlns = {}; |
|
66 |
||
67 |
window.define = function(id, deps, factory) { |
|
68 |
if (arguments.length == 2) { |
|
69 |
factory = deps; |
|
70 |
if (typeof id != "string") { |
|
71 |
deps = id; |
|
72 |
id = require.id; |
|
73 |
} |
|
74 |
} else if (arguments.length == 1) { |
|
75 |
factory = id; |
|
76 |
id = require.id; |
|
77 |
} |
|
78 |
||
79 |
if (id.indexOf("text!") === 0) |
|
80 |
return; |
|
81 |
|
|
82 |
var req = function(deps, factory) { |
|
83 |
return require(id, deps, factory); |
|
84 |
}; |
|
85 |
||
86 |
require.modules[id] = { |
|
87 |
factory: function() { |
|
88 |
var module = { |
|
89 |
exports: {} |
|
90 |
}; |
|
91 |
var returnExports = factory(req, module.exports, module); |
|
92 |
if (returnExports) |
|
93 |
module.exports = returnExports; |
|
94 |
return module; |
|
95 |
} |
|
96 |
}; |
|
97 |
};
|
|
98 |
||
99 |
window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { |
|
100 |
require.tlns = topLevelNamespaces; |
|
101 |
}
|
|
102 |
||
103 |
window.initSender = function initSender() { |
|
104 |
||
105 |
var EventEmitter = require(null, "ace/lib/event_emitter").EventEmitter; |
|
106 |
var oop = require(null, "ace/lib/oop"); |
|
107 |
|
|
108 |
var Sender = function() {}; |
|
109 |
|
|
110 |
(function() { |
|
111 |
|
|
112 |
oop.implement(this, EventEmitter); |
|
113 |
|
|
114 |
this.callback = function(data, callbackId) { |
|
115 |
postMessage({ |
|
116 |
type: "call", |
|
117 |
id: callbackId, |
|
118 |
data: data |
|
119 |
}); |
|
120 |
}; |
|
121 |
|
|
122 |
this.emit = function(name, data) { |
|
123 |
postMessage({ |
|
124 |
type: "event", |
|
125 |
name: name, |
|
126 |
data: data |
|
127 |
}); |
|
128 |
}; |
|
129 |
|
|
130 |
}).call(Sender.prototype); |
|
131 |
|
|
132 |
return new Sender(); |
|
133 |
}
|
|
134 |
||
135 |
window.main = null; |
|
136 |
window.sender = null; |
|
137 |
||
138 |
window.onmessage = function(e) { |
|
139 |
var msg = e.data; |
|
140 |
if (msg.command) { |
|
141 |
if (main[msg.command]) |
|
142 |
main[msg.command].apply(main, msg.args); |
|
143 |
else |
|
144 |
throw new Error("Unknown command:" + msg.command); |
|
145 |
} |
|
146 |
else if (msg.init) { |
|
147 |
initBaseUrls(msg.tlns); |
|
148 |
require(null, "ace/lib/fixoldbrowsers"); |
|
149 |
sender = initSender(); |
|
150 |
var clazz = require(null, msg.module)[msg.classname]; |
|
151 |
main = new clazz(sender); |
|
152 |
} |
|
153 |
else if (msg.event && sender) { |
|
154 |
sender._emit(msg.event, msg.data); |
|
155 |
} |
|
156 |
};
|
|
157 |
})(this);// vim:set ts=4 sts=4 sw=4 st: |
|
158 |
||
159 |
define('ace/lib/fixoldbrowsers', ['require', 'exports', 'module' , 'ace/lib/regexp', 'ace/lib/es5-shim'], function(require, exports, module) { |
|
160 |
||
161 |
||
162 |
require("./regexp"); |
|
163 |
require("./es5-shim"); |
|
164 |
||
165 |
});
|
|
166 |
|
|
167 |
define('ace/lib/regexp', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
168 |
||
169 |
var real = { |
|
170 |
exec: RegExp.prototype.exec, |
|
171 |
test: RegExp.prototype.test, |
|
172 |
match: String.prototype.match, |
|
173 |
replace: String.prototype.replace, |
|
174 |
split: String.prototype.split |
|
175 |
}, |
|
176 |
compliantExecNpcg = real.exec.call(/()??/, "")[1] === undefined, // check `exec` handling of nonparticipating capturing groups |
|
177 |
compliantLastIndexIncrement = function () { |
|
178 |
var x = /^/g; |
|
179 |
real.test.call(x, ""); |
|
180 |
return !x.lastIndex; |
|
181 |
}(); |
|
182 |
||
183 |
if (compliantLastIndexIncrement && compliantExecNpcg) |
|
184 |
return; |
|
185 |
RegExp.prototype.exec = function (str) { |
|
186 |
var match = real.exec.apply(this, arguments), |
|
187 |
name, r2; |
|
188 |
if ( typeof(str) == 'string' && match) { |
|
189 |
if (!compliantExecNpcg && match.length > 1 && indexOf(match, "") > -1) { |
|
190 |
r2 = RegExp(this.source, real.replace.call(getNativeFlags(this), "g", "")); |
|
191 |
real.replace.call(str.slice(match.index), r2, function () { |
|
192 |
for (var i = 1; i < arguments.length - 2; i++) { |
|
193 |
if (arguments[i] === undefined) |
|
194 |
match[i] = undefined; |
|
195 |
} |
|
196 |
}); |
|
197 |
} |
|
198 |
if (this._xregexp && this._xregexp.captureNames) { |
|
199 |
for (var i = 1; i < match.length; i++) { |
|
200 |
name = this._xregexp.captureNames[i - 1]; |
|
201 |
if (name) |
|
202 |
match[name] = match[i]; |
|
203 |
} |
|
204 |
} |
|
205 |
if (!compliantLastIndexIncrement && this.global && !match[0].length && (this.lastIndex > match.index)) |
|
206 |
this.lastIndex--; |
|
207 |
} |
|
208 |
return match; |
|
209 |
}; |
|
210 |
if (!compliantLastIndexIncrement) { |
|
211 |
RegExp.prototype.test = function (str) { |
|
212 |
var match = real.exec.call(this, str); |
|
213 |
if (match && this.global && !match[0].length && (this.lastIndex > match.index)) |
|
214 |
this.lastIndex--; |
|
215 |
return !!match; |
|
216 |
}; |
|
217 |
} |
|
218 |
||
219 |
function getNativeFlags (regex) { |
|
220 |
return (regex.global ? "g" : "") + |
|
221 |
(regex.ignoreCase ? "i" : "") + |
|
222 |
(regex.multiline ? "m" : "") + |
|
223 |
(regex.extended ? "x" : "") + // Proposed for ES4; included in AS3 |
|
224 |
(regex.sticky ? "y" : ""); |
|
225 |
} |
|
226 |
||
227 |
function indexOf (array, item, from) { |
|
228 |
if (Array.prototype.indexOf) // Use the native array method if available |
|
229 |
return array.indexOf(item, from); |
|
230 |
for (var i = from || 0; i < array.length; i++) { |
|
231 |
if (array[i] === item) |
|
232 |
return i; |
|
233 |
} |
|
234 |
return -1; |
|
235 |
} |
|
236 |
||
237 |
});
|
|
238 |
||
239 |
define('ace/lib/es5-shim', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
240 |
||
241 |
function Empty() {} |
|
242 |
||
243 |
if (!Function.prototype.bind) { |
|
244 |
Function.prototype.bind = function bind(that) { // .length is 1 |
|
245 |
var target = this; |
|
246 |
if (typeof target != "function") { |
|
247 |
throw new TypeError("Function.prototype.bind called on incompatible " + target); |
|
248 |
} |
|
249 |
var args = slice.call(arguments, 1); // for normal call |
|
250 |
var bound = function () { |
|
251 |
||
252 |
if (this instanceof bound) { |
|
253 |
||
254 |
var result = target.apply( |
|
255 |
this, |
|
256 |
args.concat(slice.call(arguments)) |
|
257 |
); |
|
258 |
if (Object(result) === result) { |
|
259 |
return result; |
|
260 |
} |
|
261 |
return this; |
|
262 |
||
263 |
} else { |
|
264 |
return target.apply( |
|
265 |
that, |
|
266 |
args.concat(slice.call(arguments)) |
|
267 |
); |
|
268 |
||
269 |
} |
|
270 |
||
271 |
}; |
|
272 |
if(target.prototype) { |
|
273 |
Empty.prototype = target.prototype; |
|
274 |
bound.prototype = new Empty(); |
|
275 |
Empty.prototype = null; |
|
276 |
} |
|
277 |
return bound; |
|
278 |
}; |
|
279 |
}
|
|
280 |
var call = Function.prototype.call; |
|
281 |
var prototypeOfArray = Array.prototype; |
|
282 |
var prototypeOfObject = Object.prototype; |
|
283 |
var slice = prototypeOfArray.slice; |
|
284 |
var _toString = call.bind(prototypeOfObject.toString); |
|
285 |
var owns = call.bind(prototypeOfObject.hasOwnProperty); |
|
286 |
var defineGetter; |
|
287 |
var defineSetter; |
|
288 |
var lookupGetter; |
|
289 |
var lookupSetter; |
|
290 |
var supportsAccessors; |
|
291 |
if ((supportsAccessors = owns(prototypeOfObject, "__defineGetter__"))) { |
|
292 |
defineGetter = call.bind(prototypeOfObject.__defineGetter__); |
|
293 |
defineSetter = call.bind(prototypeOfObject.__defineSetter__); |
|
294 |
lookupGetter = call.bind(prototypeOfObject.__lookupGetter__); |
|
295 |
lookupSetter = call.bind(prototypeOfObject.__lookupSetter__); |
|
296 |
}
|
|
297 |
if ([1,2].splice(0).length != 2) { |
|
298 |
if(function() { // test IE < 9 to splice bug - see issue #138 |
|
299 |
function makeArray(l) { |
|
300 |
var a = new Array(l+2); |
|
301 |
a[0] = a[1] = 0; |
|
302 |
return a; |
|
303 |
} |
|
304 |
var array = [], lengthBefore; |
|
305 |
|
|
306 |
array.splice.apply(array, makeArray(20)); |
|
307 |
array.splice.apply(array, makeArray(26)); |
|
308 |
||
309 |
lengthBefore = array.length; //46 |
|
310 |
array.splice(5, 0, "XXX"); // add one element |
|
311 |
||
312 |
lengthBefore + 1 == array.length |
|
313 |
||
314 |
if (lengthBefore + 1 == array.length) { |
|
315 |
return true;// has right splice implementation without bugs |
|
316 |
} |
|
317 |
}()) {//IE 6/7 |
|
318 |
var array_splice = Array.prototype.splice; |
|
319 |
Array.prototype.splice = function(start, deleteCount) { |
|
320 |
if (!arguments.length) { |
|
321 |
return []; |
|
322 |
} else { |
|
323 |
return array_splice.apply(this, [ |
|
324 |
start === void 0 ? 0 : start, |
|
325 |
deleteCount === void 0 ? (this.length - start) : deleteCount |
|
326 |
].concat(slice.call(arguments, 2))) |
|
327 |
} |
|
328 |
}; |
|
329 |
} else {//IE8 |
|
330 |
Array.prototype.splice = function(pos, removeCount){ |
|
331 |
var length = this.length; |
|
332 |
if (pos > 0) { |
|
333 |
if (pos > length) |
|
334 |
pos = length; |
|
335 |
} else if (pos == void 0) { |
|
336 |
pos = 0; |
|
337 |
} else if (pos < 0) { |
|
338 |
pos = Math.max(length + pos, 0); |
|
339 |
} |
|
340 |
||
341 |
if (!(pos+removeCount < length)) |
|
342 |
removeCount = length - pos; |
|
343 |
||
344 |
var removed = this.slice(pos, pos+removeCount); |
|
345 |
var insert = slice.call(arguments, 2); |
|
346 |
var add = insert.length; |
|
347 |
if (pos === length) { |
|
348 |
if (add) { |
|
349 |
this.push.apply(this, insert); |
|
350 |
} |
|
351 |
} else { |
|
352 |
var remove = Math.min(removeCount, length - pos); |
|
353 |
var tailOldPos = pos + remove; |
|
354 |
var tailNewPos = tailOldPos + add - remove; |
|
355 |
var tailCount = length - tailOldPos; |
|
356 |
var lengthAfterRemove = length - remove; |
|
357 |
||
358 |
if (tailNewPos < tailOldPos) { // case A |
|
359 |
for (var i = 0; i < tailCount; ++i) { |
|
360 |
this[tailNewPos+i] = this[tailOldPos+i]; |
|
361 |
} |
|
362 |
} else if (tailNewPos > tailOldPos) { // case B |
|
363 |
for (i = tailCount; i--; ) { |
|
364 |
this[tailNewPos+i] = this[tailOldPos+i]; |
|
365 |
} |
|
366 |
} // else, add == remove (nothing to do) |
|
367 |
||
368 |
if (add && pos === lengthAfterRemove) { |
|
369 |
this.length = lengthAfterRemove; // truncate array |
|
370 |
this.push.apply(this, insert); |
|
371 |
} else { |
|
372 |
this.length = lengthAfterRemove + add; // reserves space |
|
373 |
for (i = 0; i < add; ++i) { |
|
374 |
this[pos+i] = insert[i]; |
|
375 |
} |
|
376 |
} |
|
377 |
} |
|
378 |
return removed; |
|
379 |
}; |
|
380 |
} |
|
381 |
}
|
|
382 |
if (!Array.isArray) { |
|
383 |
Array.isArray = function isArray(obj) { |
|
384 |
return _toString(obj) == "[object Array]"; |
|
385 |
}; |
|
386 |
}
|
|
387 |
var boxedString = Object("a"), |
|
388 |
splitString = boxedString[0] != "a" || !(0 in boxedString); |
|
389 |
||
390 |
if (!Array.prototype.forEach) { |
|
391 |
Array.prototype.forEach = function forEach(fun /*, thisp*/) { |
|
392 |
var object = toObject(this), |
|
393 |
self = splitString && _toString(this) == "[object String]" ? |
|
394 |
this.split("") : |
|
395 |
object, |
|
396 |
thisp = arguments[1], |
|
397 |
i = -1, |
|
398 |
length = self.length >>> 0; |
|
399 |
if (_toString(fun) != "[object Function]") { |
|
400 |
throw new TypeError(); // TODO message |
|
401 |
} |
|
402 |
||
403 |
while (++i < length) { |
|
404 |
if (i in self) { |
|
405 |
fun.call(thisp, self[i], i, object); |
|
406 |
} |
|
407 |
} |
|
408 |
}; |
|
409 |
}
|
|
410 |
if (!Array.prototype.map) { |
|
411 |
Array.prototype.map = function map(fun /*, thisp*/) { |
|
412 |
var object = toObject(this), |
|
413 |
self = splitString && _toString(this) == "[object String]" ? |
|
414 |
this.split("") : |
|
415 |
object, |
|
416 |
length = self.length >>> 0, |
|
417 |
result = Array(length), |
|
418 |
thisp = arguments[1]; |
|
419 |
if (_toString(fun) != "[object Function]") { |
|
420 |
throw new TypeError(fun + " is not a function"); |
|
421 |
} |
|
422 |
||
423 |
for (var i = 0; i < length; i++) { |
|
424 |
if (i in self) |
|
425 |
result[i] = fun.call(thisp, self[i], i, object); |
|
426 |
} |
|
427 |
return result; |
|
428 |
}; |
|
429 |
}
|
|
430 |
if (!Array.prototype.filter) { |
|
431 |
Array.prototype.filter = function filter(fun /*, thisp */) { |
|
432 |
var object = toObject(this), |
|
433 |
self = splitString && _toString(this) == "[object String]" ? |
|
434 |
this.split("") : |
|
435 |
object, |
|
436 |
length = self.length >>> 0, |
|
437 |
result = [], |
|
438 |
value, |
|
439 |
thisp = arguments[1]; |
|
440 |
if (_toString(fun) != "[object Function]") { |
|
441 |
throw new TypeError(fun + " is not a function"); |
|
442 |
} |
|
443 |
||
444 |
for (var i = 0; i < length; i++) { |
|
445 |
if (i in self) { |
|
446 |
value = self[i]; |
|
447 |
if (fun.call(thisp, value, i, object)) { |
|
448 |
result.push(value); |
|
449 |
} |
|
450 |
} |
|
451 |
} |
|
452 |
return result; |
|
453 |
}; |
|
454 |
}
|
|
455 |
if (!Array.prototype.every) { |
|
456 |
Array.prototype.every = function every(fun /*, thisp */) { |
|
457 |
var object = toObject(this), |
|
458 |
self = splitString && _toString(this) == "[object String]" ? |
|
459 |
this.split("") : |
|
460 |
object, |
|
461 |
length = self.length >>> 0, |
|
462 |
thisp = arguments[1]; |
|
463 |
if (_toString(fun) != "[object Function]") { |
|
464 |
throw new TypeError(fun + " is not a function"); |
|
465 |
} |
|
466 |
||
467 |
for (var i = 0; i < length; i++) { |
|
468 |
if (i in self && !fun.call(thisp, self[i], i, object)) { |
|
469 |
return false; |
|
470 |
} |
|
471 |
} |
|
472 |
return true; |
|
473 |
}; |
|
474 |
}
|
|
475 |
if (!Array.prototype.some) { |
|
476 |
Array.prototype.some = function some(fun /*, thisp */) { |
|
477 |
var object = toObject(this), |
|
478 |
self = splitString && _toString(this) == "[object String]" ? |
|
479 |
this.split("") : |
|
480 |
object, |
|
481 |
length = self.length >>> 0, |
|
482 |
thisp = arguments[1]; |
|
483 |
if (_toString(fun) != "[object Function]") { |
|
484 |
throw new TypeError(fun + " is not a function"); |
|
485 |
} |
|
486 |
||
487 |
for (var i = 0; i < length; i++) { |
|
488 |
if (i in self && fun.call(thisp, self[i], i, object)) { |
|
489 |
return true; |
|
490 |
} |
|
491 |
} |
|
492 |
return false; |
|
493 |
}; |
|
494 |
}
|
|
495 |
if (!Array.prototype.reduce) { |
|
496 |
Array.prototype.reduce = function reduce(fun /*, initial*/) { |
|
497 |
var object = toObject(this), |
|
498 |
self = splitString && _toString(this) == "[object String]" ? |
|
499 |
this.split("") : |
|
500 |
object, |
|
501 |
length = self.length >>> 0; |
|
502 |
if (_toString(fun) != "[object Function]") { |
|
503 |
throw new TypeError(fun + " is not a function"); |
|
504 |
} |
|
505 |
if (!length && arguments.length == 1) { |
|
506 |
throw new TypeError("reduce of empty array with no initial value"); |
|
507 |
} |
|
508 |
||
509 |
var i = 0; |
|
510 |
var result; |
|
511 |
if (arguments.length >= 2) { |
|
512 |
result = arguments[1]; |
|
513 |
} else { |
|
514 |
do { |
|
515 |
if (i in self) { |
|
516 |
result = self[i++]; |
|
517 |
break; |
|
518 |
} |
|
519 |
if (++i >= length) { |
|
520 |
throw new TypeError("reduce of empty array with no initial value"); |
|
521 |
} |
|
522 |
} while (true); |
|
523 |
} |
|
524 |
||
525 |
for (; i < length; i++) { |
|
526 |
if (i in self) { |
|
527 |
result = fun.call(void 0, result, self[i], i, object); |
|
528 |
} |
|
529 |
} |
|
530 |
||
531 |
return result; |
|
532 |
}; |
|
533 |
}
|
|
534 |
if (!Array.prototype.reduceRight) { |
|
535 |
Array.prototype.reduceRight = function reduceRight(fun /*, initial*/) { |
|
536 |
var object = toObject(this), |
|
537 |
self = splitString && _toString(this) == "[object String]" ? |
|
538 |
this.split("") : |
|
539 |
object, |
|
540 |
length = self.length >>> 0; |
|
541 |
if (_toString(fun) != "[object Function]") { |
|
542 |
throw new TypeError(fun + " is not a function"); |
|
543 |
} |
|
544 |
if (!length && arguments.length == 1) { |
|
545 |
throw new TypeError("reduceRight of empty array with no initial value"); |
|
546 |
} |
|
547 |
||
548 |
var result, i = length - 1; |
|
549 |
if (arguments.length >= 2) { |
|
550 |
result = arguments[1]; |
|
551 |
} else { |
|
552 |
do { |
|
553 |
if (i in self) { |
|
554 |
result = self[i--]; |
|
555 |
break; |
|
556 |
} |
|
557 |
if (--i < 0) { |
|
558 |
throw new TypeError("reduceRight of empty array with no initial value"); |
|
559 |
} |
|
560 |
} while (true); |
|
561 |
} |
|
562 |
||
563 |
do { |
|
564 |
if (i in this) { |
|
565 |
result = fun.call(void 0, result, self[i], i, object); |
|
566 |
} |
|
567 |
} while (i--); |
|
568 |
||
569 |
return result; |
|
570 |
}; |
|
571 |
}
|
|
572 |
if (!Array.prototype.indexOf || ([0, 1].indexOf(1, 2) != -1)) { |
|
573 |
Array.prototype.indexOf = function indexOf(sought /*, fromIndex */ ) { |
|
574 |
var self = splitString && _toString(this) == "[object String]" ? |
|
575 |
this.split("") : |
|
576 |
toObject(this), |
|
577 |
length = self.length >>> 0; |
|
578 |
||
579 |
if (!length) { |
|
580 |
return -1; |
|
581 |
} |
|
582 |
||
583 |
var i = 0; |
|
584 |
if (arguments.length > 1) { |
|
585 |
i = toInteger(arguments[1]); |
|
586 |
} |
|
587 |
i = i >= 0 ? i : Math.max(0, length + i); |
|
588 |
for (; i < length; i++) { |
|
589 |
if (i in self && self[i] === sought) { |
|
590 |
return i; |
|
591 |
} |
|
592 |
} |
|
593 |
return -1; |
|
594 |
}; |
|
595 |
}
|
|
596 |
if (!Array.prototype.lastIndexOf || ([0, 1].lastIndexOf(0, -3) != -1)) { |
|
597 |
Array.prototype.lastIndexOf = function lastIndexOf(sought /*, fromIndex */) { |
|
598 |
var self = splitString && _toString(this) == "[object String]" ? |
|
599 |
this.split("") : |
|
600 |
toObject(this), |
|
601 |
length = self.length >>> 0; |
|
602 |
||
603 |
if (!length) { |
|
604 |
return -1; |
|
605 |
} |
|
606 |
var i = length - 1; |
|
607 |
if (arguments.length > 1) { |
|
608 |
i = Math.min(i, toInteger(arguments[1])); |
|
609 |
} |
|
610 |
i = i >= 0 ? i : length - Math.abs(i); |
|
611 |
for (; i >= 0; i--) { |
|
612 |
if (i in self && sought === self[i]) { |
|
613 |
return i; |
|
614 |
} |
|
615 |
} |
|
616 |
return -1; |
|
617 |
}; |
|
618 |
}
|
|
619 |
if (!Object.getPrototypeOf) { |
|
620 |
Object.getPrototypeOf = function getPrototypeOf(object) { |
|
621 |
return object.__proto__ || ( |
|
622 |
object.constructor ? |
|
623 |
object.constructor.prototype : |
|
624 |
prototypeOfObject |
|
625 |
); |
|
626 |
}; |
|
627 |
}
|
|
628 |
if (!Object.getOwnPropertyDescriptor) { |
|
629 |
var ERR_NON_OBJECT = "Object.getOwnPropertyDescriptor called on a " + |
|
630 |
"non-object: "; |
|
631 |
Object.getOwnPropertyDescriptor = function getOwnPropertyDescriptor(object, property) { |
|
632 |
if ((typeof object != "object" && typeof object != "function") || object === null) |
|
633 |
throw new TypeError(ERR_NON_OBJECT + object); |
|
634 |
if (!owns(object, property)) |
|
635 |
return; |
|
636 |
||
637 |
var descriptor, getter, setter; |
|
638 |
descriptor = { enumerable: true, configurable: true }; |
|
639 |
if (supportsAccessors) { |
|
640 |
var prototype = object.__proto__; |
|
641 |
object.__proto__ = prototypeOfObject; |
|
642 |
||
643 |
var getter = lookupGetter(object, property); |
|
644 |
var setter = lookupSetter(object, property); |
|
645 |
object.__proto__ = prototype; |
|
646 |
||
647 |
if (getter || setter) { |
|
648 |
if (getter) descriptor.get = getter; |
|
649 |
if (setter) descriptor.set = setter; |
|
650 |
return descriptor; |
|
651 |
} |
|
652 |
} |
|
653 |
descriptor.value = object[property]; |
|
654 |
return descriptor; |
|
655 |
}; |
|
656 |
}
|
|
657 |
if (!Object.getOwnPropertyNames) { |
|
658 |
Object.getOwnPropertyNames = function getOwnPropertyNames(object) { |
|
659 |
return Object.keys(object); |
|
660 |
}; |
|
661 |
}
|
|
662 |
if (!Object.create) { |
|
663 |
var createEmpty; |
|
664 |
if (Object.prototype.__proto__ === null) { |
|
665 |
createEmpty = function () { |
|
666 |
return { "__proto__": null }; |
|
667 |
}; |
|
668 |
} else { |
|
669 |
createEmpty = function () { |
|
670 |
var empty = {}; |
|
671 |
for (var i in empty) |
|
672 |
empty[i] = null; |
|
673 |
empty.constructor = |
|
674 |
empty.hasOwnProperty = |
|
675 |
empty.propertyIsEnumerable = |
|
676 |
empty.isPrototypeOf = |
|
677 |
empty.toLocaleString = |
|
678 |
empty.toString = |
|
679 |
empty.valueOf = |
|
680 |
empty.__proto__ = null; |
|
681 |
return empty; |
|
682 |
} |
|
683 |
} |
|
684 |
||
685 |
Object.create = function create(prototype, properties) { |
|
686 |
var object; |
|
687 |
if (prototype === null) { |
|
688 |
object = createEmpty(); |
|
689 |
} else { |
|
690 |
if (typeof prototype != "object") |
|
691 |
throw new TypeError("typeof prototype["+(typeof prototype)+"] != 'object'"); |
|
692 |
var Type = function () {}; |
|
693 |
Type.prototype = prototype; |
|
694 |
object = new Type(); |
|
695 |
object.__proto__ = prototype; |
|
696 |
} |
|
697 |
if (properties !== void 0) |
|
698 |
Object.defineProperties(object, properties); |
|
699 |
return object; |
|
700 |
}; |
|
701 |
}
|
|
702 |
||
703 |
function doesDefinePropertyWork(object) { |
|
704 |
try { |
|
705 |
Object.defineProperty(object, "sentinel", {}); |
|
706 |
return "sentinel" in object; |
|
707 |
} catch (exception) { |
|
708 |
} |
|
709 |
}
|
|
710 |
if (Object.defineProperty) { |
|
711 |
var definePropertyWorksOnObject = doesDefinePropertyWork({}); |
|
712 |
var definePropertyWorksOnDom = typeof document == "undefined" || |
|
713 |
doesDefinePropertyWork(document.createElement("div")); |
|
714 |
if (!definePropertyWorksOnObject || !definePropertyWorksOnDom) { |
|
715 |
var definePropertyFallback = Object.defineProperty; |
|
716 |
} |
|
717 |
}
|
|
718 |
||
719 |
if (!Object.defineProperty || definePropertyFallback) { |
|
720 |
var ERR_NON_OBJECT_DESCRIPTOR = "Property description must be an object: "; |
|
721 |
var ERR_NON_OBJECT_TARGET = "Object.defineProperty called on non-object: " |
|
722 |
var ERR_ACCESSORS_NOT_SUPPORTED = "getters & setters can not be defined " + |
|
723 |
"on this javascript engine"; |
|
724 |
||
725 |
Object.defineProperty = function defineProperty(object, property, descriptor) { |
|
726 |
if ((typeof object != "object" && typeof object != "function") || object === null) |
|
727 |
throw new TypeError(ERR_NON_OBJECT_TARGET + object); |
|
728 |
if ((typeof descriptor != "object" && typeof descriptor != "function") || descriptor === null) |
|
729 |
throw new TypeError(ERR_NON_OBJECT_DESCRIPTOR + descriptor); |
|
730 |
if (definePropertyFallback) { |
|
731 |
try { |
|
732 |
return definePropertyFallback.call(Object, object, property, descriptor); |
|
733 |
} catch (exception) { |
|
734 |
} |
|
735 |
} |
|
736 |
if (owns(descriptor, "value")) { |
|
737 |
||
738 |
if (supportsAccessors && (lookupGetter(object, property) || |
|
739 |
lookupSetter(object, property))) |
|
740 |
{ |
|
741 |
var prototype = object.__proto__; |
|
742 |
object.__proto__ = prototypeOfObject; |
|
743 |
delete object[property]; |
|
744 |
object[property] = descriptor.value; |
|
745 |
object.__proto__ = prototype; |
|
746 |
} else { |
|
747 |
object[property] = descriptor.value; |
|
748 |
} |
|
749 |
} else { |
|
750 |
if (!supportsAccessors) |
|
751 |
throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); |
|
752 |
if (owns(descriptor, "get")) |
|
753 |
defineGetter(object, property, descriptor.get); |
|
754 |
if (owns(descriptor, "set")) |
|
755 |
defineSetter(object, property, descriptor.set); |
|
756 |
} |
|
757 |
||
758 |
return object; |
|
759 |
}; |
|
760 |
}
|
|
761 |
if (!Object.defineProperties) { |
|
762 |
Object.defineProperties = function defineProperties(object, properties) { |
|
763 |
for (var property in properties) { |
|
764 |
if (owns(properties, property)) |
|
765 |
Object.defineProperty(object, property, properties[property]); |
|
766 |
} |
|
767 |
return object; |
|
768 |
}; |
|
769 |
}
|
|
770 |
if (!Object.seal) { |
|
771 |
Object.seal = function seal(object) { |
|
772 |
return object; |
|
773 |
}; |
|
774 |
}
|
|
775 |
if (!Object.freeze) { |
|
776 |
Object.freeze = function freeze(object) { |
|
777 |
return object; |
|
778 |
}; |
|
779 |
}
|
|
780 |
try { |
|
781 |
Object.freeze(function () {}); |
|
782 |
} catch (exception) { |
|
783 |
Object.freeze = (function freeze(freezeObject) { |
|
784 |
return function freeze(object) { |
|
785 |
if (typeof object == "function") { |
|
786 |
return object; |
|
787 |
} else { |
|
788 |
return freezeObject(object); |
|
789 |
} |
|
790 |
}; |
|
791 |
})(Object.freeze); |
|
792 |
}
|
|
793 |
if (!Object.preventExtensions) { |
|
794 |
Object.preventExtensions = function preventExtensions(object) { |
|
795 |
return object; |
|
796 |
}; |
|
797 |
}
|
|
798 |
if (!Object.isSealed) { |
|
799 |
Object.isSealed = function isSealed(object) { |
|
800 |
return false; |
|
801 |
}; |
|
802 |
}
|
|
803 |
if (!Object.isFrozen) { |
|
804 |
Object.isFrozen = function isFrozen(object) { |
|
805 |
return false; |
|
806 |
}; |
|
807 |
}
|
|
808 |
if (!Object.isExtensible) { |
|
809 |
Object.isExtensible = function isExtensible(object) { |
|
810 |
if (Object(object) === object) { |
|
811 |
throw new TypeError(); // TODO message |
|
812 |
} |
|
813 |
var name = ''; |
|
814 |
while (owns(object, name)) { |
|
815 |
name += '?'; |
|
816 |
} |
|
817 |
object[name] = true; |
|
818 |
var returnValue = owns(object, name); |
|
819 |
delete object[name]; |
|
820 |
return returnValue; |
|
821 |
}; |
|
822 |
}
|
|
823 |
if (!Object.keys) { |
|
824 |
var hasDontEnumBug = true, |
|
825 |
dontEnums = [ |
|
826 |
"toString", |
|
827 |
"toLocaleString", |
|
828 |
"valueOf", |
|
829 |
"hasOwnProperty", |
|
830 |
"isPrototypeOf", |
|
831 |
"propertyIsEnumerable", |
|
832 |
"constructor" |
|
833 |
], |
|
834 |
dontEnumsLength = dontEnums.length; |
|
835 |
||
836 |
for (var key in {"toString": null}) { |
|
837 |
hasDontEnumBug = false; |
|
838 |
} |
|
839 |
||
840 |
Object.keys = function keys(object) { |
|
841 |
||
842 |
if ( |
|
843 |
(typeof object != "object" && typeof object != "function") || |
|
844 |
object === null |
|
845 |
) { |
|
846 |
throw new TypeError("Object.keys called on a non-object"); |
|
847 |
} |
|
848 |
||
849 |
var keys = []; |
|
850 |
for (var name in object) { |
|
851 |
if (owns(object, name)) { |
|
852 |
keys.push(name); |
|
853 |
} |
|
854 |
} |
|
855 |
||
856 |
if (hasDontEnumBug) { |
|
857 |
for (var i = 0, ii = dontEnumsLength; i < ii; i++) { |
|
858 |
var dontEnum = dontEnums[i]; |
|
859 |
if (owns(object, dontEnum)) { |
|
860 |
keys.push(dontEnum); |
|
861 |
} |
|
862 |
} |
|
863 |
} |
|
864 |
return keys; |
|
865 |
}; |
|
866 |
||
867 |
}
|
|
868 |
if (!Date.now) { |
|
869 |
Date.now = function now() { |
|
870 |
return new Date().getTime(); |
|
871 |
}; |
|
872 |
}
|
|
873 |
var ws = "\x09\x0A\x0B\x0C\x0D\x20\xA0\u1680\u180E\u2000\u2001\u2002\u2003" + |
|
874 |
"\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u3000\u2028" + |
|
875 |
"\u2029\uFEFF"; |
|
876 |
if (!String.prototype.trim || ws.trim()) { |
|
877 |
ws = "[" + ws + "]"; |
|
878 |
var trimBeginRegexp = new RegExp("^" + ws + ws + "*"), |
|
879 |
trimEndRegexp = new RegExp(ws + ws + "*$"); |
|
880 |
String.prototype.trim = function trim() { |
|
881 |
return String(this).replace(trimBeginRegexp, "").replace(trimEndRegexp, ""); |
|
882 |
}; |
|
883 |
}
|
|
884 |
||
885 |
function toInteger(n) { |
|
886 |
n = +n; |
|
887 |
if (n !== n) { // isNaN |
|
888 |
n = 0; |
|
889 |
} else if (n !== 0 && n !== (1/0) && n !== -(1/0)) { |
|
890 |
n = (n > 0 || -1) * Math.floor(Math.abs(n)); |
|
891 |
} |
|
892 |
return n; |
|
893 |
}
|
|
894 |
||
895 |
function isPrimitive(input) { |
|
896 |
var type = typeof input; |
|
897 |
return ( |
|
898 |
input === null || |
|
899 |
type === "undefined" || |
|
900 |
type === "boolean" || |
|
901 |
type === "number" || |
|
902 |
type === "string" |
|
903 |
); |
|
904 |
}
|
|
905 |
||
906 |
function toPrimitive(input) { |
|
907 |
var val, valueOf, toString; |
|
908 |
if (isPrimitive(input)) { |
|
909 |
return input; |
|
910 |
} |
|
911 |
valueOf = input.valueOf; |
|
912 |
if (typeof valueOf === "function") { |
|
913 |
val = valueOf.call(input); |
|
914 |
if (isPrimitive(val)) { |
|
915 |
return val; |
|
916 |
} |
|
917 |
} |
|
918 |
toString = input.toString; |
|
919 |
if (typeof toString === "function") { |
|
920 |
val = toString.call(input); |
|
921 |
if (isPrimitive(val)) { |
|
922 |
return val; |
|
923 |
} |
|
924 |
} |
|
925 |
throw new TypeError(); |
|
926 |
}
|
|
927 |
var toObject = function (o) { |
|
928 |
if (o == null) { // this matches both null and undefined |
|
929 |
throw new TypeError("can't convert "+o+" to object"); |
|
930 |
} |
|
931 |
return Object(o); |
|
932 |
};
|
|
933 |
||
934 |
});
|
|
935 |
||
936 |
define('ace/lib/event_emitter', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
937 |
||
938 |
||
939 |
var EventEmitter = {}; |
|
940 |
var stopPropagation = function() { this.propagationStopped = true; }; |
|
941 |
var preventDefault = function() { this.defaultPrevented = true; }; |
|
942 |
||
943 |
EventEmitter._emit = |
|
944 |
EventEmitter._dispatchEvent = function(eventName, e) { |
|
945 |
this._eventRegistry || (this._eventRegistry = {}); |
|
946 |
this._defaultHandlers || (this._defaultHandlers = {}); |
|
947 |
||
948 |
var listeners = this._eventRegistry[eventName] || []; |
|
949 |
var defaultHandler = this._defaultHandlers[eventName]; |
|
950 |
if (!listeners.length && !defaultHandler) |
|
951 |
return; |
|
952 |
||
953 |
if (typeof e != "object" || !e) |
|
954 |
e = {}; |
|
955 |
||
956 |
if (!e.type) |
|
957 |
e.type = eventName; |
|
958 |
if (!e.stopPropagation) |
|
959 |
e.stopPropagation = stopPropagation; |
|
960 |
if (!e.preventDefault) |
|
961 |
e.preventDefault = preventDefault; |
|
962 |
if (!e.target) |
|
963 |
e.target = this; |
|
964 |
||
965 |
for (var i=0; i<listeners.length; i++) { |
|
966 |
listeners[i](e); |
|
967 |
if (e.propagationStopped) |
|
968 |
break; |
|
969 |
} |
|
970 |
|
|
971 |
if (defaultHandler && !e.defaultPrevented) |
|
972 |
return defaultHandler(e); |
|
973 |
};
|
|
974 |
||
975 |
||
976 |
EventEmitter._signal = function(eventName, e) { |
|
977 |
var listeners = (this._eventRegistry || {})[eventName]; |
|
978 |
if (!listeners) |
|
979 |
return; |
|
980 |
||
981 |
for (var i=0; i<listeners.length; i++) |
|
982 |
listeners[i](e); |
|
983 |
};
|
|
984 |
||
985 |
EventEmitter.once = function(eventName, callback) { |
|
986 |
var _self = this; |
|
987 |
var newCallback = function() { |
|
988 |
fun && fun.apply(null, arguments); |
|
989 |
_self.removeEventListener(event, newCallback); |
|
990 |
}; |
|
991 |
this.addEventListener(event, newCallback); |
|
992 |
};
|
|
993 |
||
994 |
||
995 |
EventEmitter.setDefaultHandler = function(eventName, callback) { |
|
996 |
this._defaultHandlers = this._defaultHandlers || {}; |
|
997 |
|
|
998 |
if (this._defaultHandlers[eventName]) |
|
999 |
throw new Error("The default handler for '" + eventName + "' is already set"); |
|
1000 |
|
|
1001 |
this._defaultHandlers[eventName] = callback; |
|
1002 |
};
|
|
1003 |
||
1004 |
EventEmitter.on = |
|
1005 |
EventEmitter.addEventListener = function(eventName, callback, capturing) { |
|
1006 |
this._eventRegistry = this._eventRegistry || {}; |
|
1007 |
||
1008 |
var listeners = this._eventRegistry[eventName]; |
|
1009 |
if (!listeners) |
|
1010 |
listeners = this._eventRegistry[eventName] = []; |
|
1011 |
||
1012 |
if (listeners.indexOf(callback) == -1) |
|
1013 |
listeners[capturing ? "unshift" : "push"](callback); |
|
1014 |
return callback; |
|
1015 |
};
|
|
1016 |
||
1017 |
EventEmitter.removeListener = |
|
1018 |
EventEmitter.removeEventListener = function(eventName, callback) { |
|
1019 |
this._eventRegistry = this._eventRegistry || {}; |
|
1020 |
||
1021 |
var listeners = this._eventRegistry[eventName]; |
|
1022 |
if (!listeners) |
|
1023 |
return; |
|
1024 |
||
1025 |
var index = listeners.indexOf(callback); |
|
1026 |
if (index !== -1) |
|
1027 |
listeners.splice(index, 1); |
|
1028 |
};
|
|
1029 |
||
1030 |
EventEmitter.removeAllListeners = function(eventName) { |
|
1031 |
if (this._eventRegistry) this._eventRegistry[eventName] = []; |
|
1032 |
};
|
|
1033 |
||
1034 |
exports.EventEmitter = EventEmitter; |
|
1035 |
||
1036 |
});
|
|
1037 |
||
1038 |
define('ace/lib/oop', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
1039 |
||
1040 |
||
1041 |
exports.inherits = (function() { |
|
1042 |
var tempCtor = function() {}; |
|
1043 |
return function(ctor, superCtor) { |
|
1044 |
tempCtor.prototype = superCtor.prototype; |
|
1045 |
ctor.super_ = superCtor.prototype; |
|
1046 |
ctor.prototype = new tempCtor(); |
|
1047 |
ctor.prototype.constructor = ctor; |
|
1048 |
}; |
|
1049 |
}());
|
|
1050 |
||
1051 |
exports.mixin = function(obj, mixin) { |
|
1052 |
for (var key in mixin) { |
|
1053 |
obj[key] = mixin[key]; |
|
1054 |
} |
|
1055 |
};
|
|
1056 |
||
1057 |
exports.implement = function(proto, mixin) { |
|
1058 |
exports.mixin(proto, mixin); |
|
1059 |
};
|
|
1060 |
||
1061 |
});
|
|
1062 |
||
1063 |
define('ace/mode/coffee_worker', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', 'ace/mode/coffee/coffee-script'], function(require, exports, module) { |
|
1064 |
||
1065 |
||
1066 |
var oop = require("../lib/oop"); |
|
1067 |
var Mirror = require("../worker/mirror").Mirror; |
|
1068 |
var coffee = require("../mode/coffee/coffee-script"); |
|
1069 |
||
1070 |
window.addEventListener = function() {}; |
|
1071 |
||
1072 |
||
1073 |
var Worker = exports.Worker = function(sender) { |
|
1074 |
Mirror.call(this, sender); |
|
1075 |
this.setTimeout(200); |
|
1076 |
};
|
|
1077 |
||
1078 |
oop.inherits(Worker, Mirror); |
|
1079 |
||
1080 |
(function() { |
|
1081 |
||
1082 |
this.onUpdate = function() { |
|
1083 |
var value = this.doc.getValue(); |
|
1084 |
||
1085 |
try { |
|
1086 |
coffee.parse(value); |
|
1087 |
} catch(e) { |
|
1088 |
var m = e.message.match(/Parse error on line (\d+): (.*)/); |
|
1089 |
if (m) { |
|
1090 |
this.sender.emit("error", { |
|
1091 |
row: parseInt(m[1], 10) - 1, |
|
1092 |
column: null, |
|
1093 |
text: m[2], |
|
1094 |
type: "error" |
|
1095 |
}); |
|
1096 |
return; |
|
1097 |
} |
|
1098 |
||
1099 |
if (e instanceof SyntaxError) { |
|
1100 |
var m = e.message.match(/ on line (\d+)/); |
|
1101 |
if (m) { |
|
1102 |
this.sender.emit("error", { |
|
1103 |
row: parseInt(m[1], 10) - 1, |
|
1104 |
column: null, |
|
1105 |
text: e.message.replace(m[0], ""), |
|
1106 |
type: "error" |
|
1107 |
}); |
|
1108 |
} |
|
1109 |
} |
|
1110 |
return; |
|
1111 |
} |
|
1112 |
this.sender.emit("ok"); |
|
1113 |
}; |
|
1114 |
||
1115 |
}).call(Worker.prototype); |
|
1116 |
||
1117 |
});
|
|
1118 |
define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function(require, exports, module) { |
|
1119 |
||
1120 |
||
1121 |
var Document = require("../document").Document; |
|
1122 |
var lang = require("../lib/lang"); |
|
1123 |
|
|
1124 |
var Mirror = exports.Mirror = function(sender) { |
|
1125 |
this.sender = sender; |
|
1126 |
var doc = this.doc = new Document(""); |
|
1127 |
|
|
1128 |
var deferredUpdate = this.deferredUpdate = lang.delayedCall(this.onUpdate.bind(this)); |
|
1129 |
|
|
1130 |
var _self = this; |
|
1131 |
sender.on("change", function(e) { |
|
1132 |
doc.applyDeltas([e.data]); |
|
1133 |
deferredUpdate.schedule(_self.$timeout); |
|
1134 |
}); |
|
1135 |
};
|
|
1136 |
||
1137 |
(function() { |
|
1138 |
|
|
1139 |
this.$timeout = 500; |
|
1140 |
|
|
1141 |
this.setTimeout = function(timeout) { |
|
1142 |
this.$timeout = timeout; |
|
1143 |
}; |
|
1144 |
|
|
1145 |
this.setValue = function(value) { |
|
1146 |
this.doc.setValue(value); |
|
1147 |
this.deferredUpdate.schedule(this.$timeout); |
|
1148 |
}; |
|
1149 |
|
|
1150 |
this.getValue = function(callbackId) { |
|
1151 |
this.sender.callback(this.doc.getValue(), callbackId); |
|
1152 |
}; |
|
1153 |
|
|
1154 |
this.onUpdate = function() { |
|
1155 |
}; |
|
1156 |
|
|
1157 |
}).call(Mirror.prototype); |
|
1158 |
||
1159 |
});
|
|
1160 |
||
1161 |
define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function(require, exports, module) { |
|
1162 |
||
1163 |
||
1164 |
var oop = require("./lib/oop"); |
|
1165 |
var EventEmitter = require("./lib/event_emitter").EventEmitter; |
|
1166 |
var Range = require("./range").Range; |
|
1167 |
var Anchor = require("./anchor").Anchor; |
|
1168 |
||
1169 |
var Document = function(text) { |
|
1170 |
this.$lines = []; |
|
1171 |
if (text.length == 0) { |
|
1172 |
this.$lines = [""]; |
|
1173 |
} else if (Array.isArray(text)) { |
|
1174 |
this.insertLines(0, text); |
|
1175 |
} else { |
|
1176 |
this.insert({row: 0, column:0}, text); |
|
1177 |
} |
|
1178 |
};
|
|
1179 |
||
1180 |
(function() { |
|
1181 |
||
1182 |
oop.implement(this, EventEmitter); |
|
1183 |
this.setValue = function(text) { |
|
1184 |
var len = this.getLength(); |
|
1185 |
this.remove(new Range(0, 0, len, this.getLine(len-1).length)); |
|
1186 |
this.insert({row: 0, column:0}, text); |
|
1187 |
}; |
|
1188 |
this.getValue = function() { |
|
1189 |
return this.getAllLines().join(this.getNewLineCharacter()); |
|
1190 |
}; |
|
1191 |
this.createAnchor = function(row, column) { |
|
1192 |
return new Anchor(this, row, column); |
|
1193 |
}; |
|
1194 |
if ("aaa".split(/a/).length == 0) |
|
1195 |
this.$split = function(text) { |
|
1196 |
return text.replace(/\r\n|\r/g, "\n").split("\n"); |
|
1197 |
} |
|
1198 |
else |
|
1199 |
this.$split = function(text) { |
|
1200 |
return text.split(/\r\n|\r|\n/); |
|
1201 |
}; |
|
1202 |
||
1203 |
||
1204 |
|
|
1205 |
this.$detectNewLine = function(text) { |
|
1206 |
var match = text.match(/^.*?(\r\n|\r|\n)/m); |
|
1207 |
if (match) { |
|
1208 |
this.$autoNewLine = match[1]; |
|
1209 |
} else { |
|
1210 |
this.$autoNewLine = "\n"; |
|
1211 |
} |
|
1212 |
}; |
|
1213 |
this.getNewLineCharacter = function() { |
|
1214 |
switch (this.$newLineMode) { |
|
1215 |
case "windows": |
|
1216 |
return "\r\n"; |
|
1217 |
||
1218 |
case "unix": |
|
1219 |
return "\n"; |
|
1220 |
||
1221 |
default: |
|
1222 |
return this.$autoNewLine; |
|
1223 |
} |
|
1224 |
}; |
|
1225 |
||
1226 |
this.$autoNewLine = "\n"; |
|
1227 |
this.$newLineMode = "auto"; |
|
1228 |
this.setNewLineMode = function(newLineMode) { |
|
1229 |
if (this.$newLineMode === newLineMode) |
|
1230 |
return; |
|
1231 |
||
1232 |
this.$newLineMode = newLineMode; |
|
1233 |
}; |
|
1234 |
this.getNewLineMode = function() { |
|
1235 |
return this.$newLineMode; |
|
1236 |
}; |
|
1237 |
this.isNewLine = function(text) { |
|
1238 |
return (text == "\r\n" || text == "\r" || text == "\n"); |
|
1239 |
}; |
|
1240 |
this.getLine = function(row) { |
|
1241 |
return this.$lines[row] || ""; |
|
1242 |
}; |
|
1243 |
this.getLines = function(firstRow, lastRow) { |
|
1244 |
return this.$lines.slice(firstRow, lastRow + 1); |
|
1245 |
}; |
|
1246 |
this.getAllLines = function() { |
|
1247 |
return this.getLines(0, this.getLength()); |
|
1248 |
}; |
|
1249 |
this.getLength = function() { |
|
1250 |
return this.$lines.length; |
|
1251 |
}; |
|
1252 |
this.getTextRange = function(range) { |
|
1253 |
if (range.start.row == range.end.row) { |
|
1254 |
return this.$lines[range.start.row].substring(range.start.column, |
|
1255 |
range.end.column); |
|
1256 |
} |
|
1257 |
else { |
|
1258 |
var lines = this.getLines(range.start.row+1, range.end.row-1); |
|
1259 |
lines.unshift((this.$lines[range.start.row] || "").substring(range.start.column)); |
|
1260 |
lines.push((this.$lines[range.end.row] || "").substring(0, range.end.column)); |
|
1261 |
return lines.join(this.getNewLineCharacter()); |
|
1262 |
} |
|
1263 |
}; |
|
1264 |
||
1265 |
this.$clipPosition = function(position) { |
|
1266 |
var length = this.getLength(); |
|
1267 |
if (position.row >= length) { |
|
1268 |
position.row = Math.max(0, length - 1); |
|
1269 |
position.column = this.getLine(length-1).length; |
|
1270 |
} |
|
1271 |
return position; |
|
1272 |
}; |
|
1273 |
this.insert = function(position, text) { |
|
1274 |
if (!text || text.length === 0) |
|
1275 |
return position; |
|
1276 |
||
1277 |
position = this.$clipPosition(position); |
|
1278 |
if (this.getLength() <= 1) |
|
1279 |
this.$detectNewLine(text); |
|
1280 |
||
1281 |
var lines = this.$split(text); |
|
1282 |
var firstLine = lines.splice(0, 1)[0]; |
|
1283 |
var lastLine = lines.length == 0 ? null : lines.splice(lines.length - 1, 1)[0]; |
|
1284 |
||
1285 |
position = this.insertInLine(position, firstLine); |
|
1286 |
if (lastLine !== null) { |
|
1287 |
position = this.insertNewLine(position); // terminate first line |
|
1288 |
position = this.insertLines(position.row, lines); |
|
1289 |
position = this.insertInLine(position, lastLine || ""); |
|
1290 |
} |
|
1291 |
return position; |
|
1292 |
}; |
|
1293 |
this.insertLines = function(row, lines) { |
|
1294 |
if (lines.length == 0) |
|
1295 |
return {row: row, column: 0}; |
|
1296 |
if (lines.length > 0xFFFF) { |
|
1297 |
var end = this.insertLines(row, lines.slice(0xFFFF)); |
|
1298 |
lines = lines.slice(0, 0xFFFF); |
|
1299 |
} |
|
1300 |
||
1301 |
var args = [row, 0]; |
|
1302 |
args.push.apply(args, lines); |
|
1303 |
this.$lines.splice.apply(this.$lines, args); |
|
1304 |
||
1305 |
var range = new Range(row, 0, row + lines.length, 0); |
|
1306 |
var delta = { |
|
1307 |
action: "insertLines", |
|
1308 |
range: range, |
|
1309 |
lines: lines |
|
1310 |
}; |
|
1311 |
this._emit("change", { data: delta }); |
|
1312 |
return end || range.end; |
|
1313 |
}; |
|
1314 |
this.insertNewLine = function(position) { |
|
1315 |
position = this.$clipPosition(position); |
|
1316 |
var line = this.$lines[position.row] || ""; |
|
1317 |
||
1318 |
this.$lines[position.row] = line.substring(0, position.column); |
|
1319 |
this.$lines.splice(position.row + 1, 0, line.substring(position.column, line.length)); |
|
1320 |
||
1321 |
var end = { |
|
1322 |
row : position.row + 1, |
|
1323 |
column : 0 |
|
1324 |
}; |
|
1325 |
||
1326 |
var delta = { |
|
1327 |
action: "insertText", |
|
1328 |
range: Range.fromPoints(position, end), |
|
1329 |
text: this.getNewLineCharacter() |
|
1330 |
}; |
|
1331 |
this._emit("change", { data: delta }); |
|
1332 |
||
1333 |
return end; |
|
1334 |
}; |
|
1335 |
this.insertInLine = function(position, text) { |
|
1336 |
if (text.length == 0) |
|
1337 |
return position; |
|
1338 |
||
1339 |
var line = this.$lines[position.row] || ""; |
|
1340 |
||
1341 |
this.$lines[position.row] = line.substring(0, position.column) + text |
|
1342 |
+ line.substring(position.column); |
|
1343 |
||
1344 |
var end = { |
|
1345 |
row : position.row, |
|
1346 |
column : position.column + text.length |
|
1347 |
}; |
|
1348 |
||
1349 |
var delta = { |
|
1350 |
action: "insertText", |
|
1351 |
range: Range.fromPoints(position, end), |
|
1352 |
text: text |
|
1353 |
}; |
|
1354 |
this._emit("change", { data: delta }); |
|
1355 |
||
1356 |
return end; |
|
1357 |
}; |
|
1358 |
this.remove = function(range) { |
|
1359 |
range.start = this.$clipPosition(range.start); |
|
1360 |
range.end = this.$clipPosition(range.end); |
|
1361 |
||
1362 |
if (range.isEmpty()) |
|
1363 |
return range.start; |
|
1364 |
||
1365 |
var firstRow = range.start.row; |
|
1366 |
var lastRow = range.end.row; |
|
1367 |
||
1368 |
if (range.isMultiLine()) { |
|
1369 |
var firstFullRow = range.start.column == 0 ? firstRow : firstRow + 1; |
|
1370 |
var lastFullRow = lastRow - 1; |
|
1371 |
||
1372 |
if (range.end.column > 0) |
|
1373 |
this.removeInLine(lastRow, 0, range.end.column); |
|
1374 |
||
1375 |
if (lastFullRow >= firstFullRow) |
|
1376 |
this.removeLines(firstFullRow, lastFullRow); |
|
1377 |
||
1378 |
if (firstFullRow != firstRow) { |
|
1379 |
this.removeInLine(firstRow, range.start.column, this.getLine(firstRow).length); |
|
1380 |
this.removeNewLine(range.start.row); |
|
1381 |
} |
|
1382 |
} |
|
1383 |
else { |
|
1384 |
this.removeInLine(firstRow, range.start.column, range.end.column); |
|
1385 |
} |
|
1386 |
return range.start; |
|
1387 |
}; |
|
1388 |
this.removeInLine = function(row, startColumn, endColumn) { |
|
1389 |
if (startColumn == endColumn) |
|
1390 |
return; |
|
1391 |
||
1392 |
var range = new Range(row, startColumn, row, endColumn); |
|
1393 |
var line = this.getLine(row); |
|
1394 |
var removed = line.substring(startColumn, endColumn); |
|
1395 |
var newLine = line.substring(0, startColumn) + line.substring(endColumn, line.length); |
|
1396 |
this.$lines.splice(row, 1, newLine); |
|
1397 |
||
1398 |
var delta = { |
|
1399 |
action: "removeText", |
|
1400 |
range: range, |
|
1401 |
text: removed |
|
1402 |
}; |
|
1403 |
this._emit("change", { data: delta }); |
|
1404 |
return range.start; |
|
1405 |
}; |
|
1406 |
this.removeLines = function(firstRow, lastRow) { |
|
1407 |
var range = new Range(firstRow, 0, lastRow + 1, 0); |
|
1408 |
var removed = this.$lines.splice(firstRow, lastRow - firstRow + 1); |
|
1409 |
||
1410 |
var delta = { |
|
1411 |
action: "removeLines", |
|
1412 |
range: range, |
|
1413 |
nl: this.getNewLineCharacter(), |
|
1414 |
lines: removed |
|
1415 |
}; |
|
1416 |
this._emit("change", { data: delta }); |
|
1417 |
return removed; |
|
1418 |
}; |
|
1419 |
this.removeNewLine = function(row) { |
|
1420 |
var firstLine = this.getLine(row); |
|
1421 |
var secondLine = this.getLine(row+1); |
|
1422 |
||
1423 |
var range = new Range(row, firstLine.length, row+1, 0); |
|
1424 |
var line = firstLine + secondLine; |
|
1425 |
||
1426 |
this.$lines.splice(row, 2, line); |
|
1427 |
||
1428 |
var delta = { |
|
1429 |
action: "removeText", |
|
1430 |
range: range, |
|
1431 |
text: this.getNewLineCharacter() |
|
1432 |
}; |
|
1433 |
this._emit("change", { data: delta }); |
|
1434 |
}; |
|
1435 |
this.replace = function(range, text) { |
|
1436 |
if (text.length == 0 && range.isEmpty()) |
|
1437 |
return range.start; |
|
1438 |
if (text == this.getTextRange(range)) |
|
1439 |
return range.end; |
|
1440 |
||
1441 |
this.remove(range); |
|
1442 |
if (text) { |
|
1443 |
var end = this.insert(range.start, text); |
|
1444 |
} |
|
1445 |
else { |
|
1446 |
end = range.start; |
|
1447 |
} |
|
1448 |
||
1449 |
return end; |
|
1450 |
}; |
|
1451 |
this.applyDeltas = function(deltas) { |
|
1452 |
for (var i=0; i<deltas.length; i++) { |
|
1453 |
var delta = deltas[i]; |
|
1454 |
var range = Range.fromPoints(delta.range.start, delta.range.end); |
|
1455 |
||
1456 |
if (delta.action == "insertLines") |
|
1457 |
this.insertLines(range.start.row, delta.lines); |
|
1458 |
else if (delta.action == "insertText") |
|
1459 |
this.insert(range.start, delta.text); |
|
1460 |
else if (delta.action == "removeLines") |
|
1461 |
this.removeLines(range.start.row, range.end.row - 1); |
|
1462 |
else if (delta.action == "removeText") |
|
1463 |
this.remove(range); |
|
1464 |
} |
|
1465 |
}; |
|
1466 |
this.revertDeltas = function(deltas) { |
|
1467 |
for (var i=deltas.length-1; i>=0; i--) { |
|
1468 |
var delta = deltas[i]; |
|
1469 |
||
1470 |
var range = Range.fromPoints(delta.range.start, delta.range.end); |
|
1471 |
||
1472 |
if (delta.action == "insertLines") |
|
1473 |
this.removeLines(range.start.row, range.end.row - 1); |
|
1474 |
else if (delta.action == "insertText") |
|
1475 |
this.remove(range); |
|
1476 |
else if (delta.action == "removeLines") |
|
1477 |
this.insertLines(range.start.row, delta.lines); |
|
1478 |
else if (delta.action == "removeText") |
|
1479 |
this.insert(range.start, delta.text); |
|
1480 |
} |
|
1481 |
}; |
|
1482 |
this.indexToPosition = function(index, startRow) { |
|
1483 |
var lines = this.$lines || this.getAllLines(); |
|
1484 |
var newlineLength = this.getNewLineCharacter().length; |
|
1485 |
for (var i = startRow || 0, l = lines.length; i < l; i++) { |
|
1486 |
index -= lines[i].length + newlineLength; |
|
1487 |
if (index < 0) |
|
1488 |
return {row: i, column: index + lines[i].length + newlineLength}; |
|
1489 |
} |
|
1490 |
return {row: l-1, column: lines[l-1].length}; |
|
1491 |
}; |
|
1492 |
this.positionToIndex = function(pos, startRow) { |
|
1493 |
var lines = this.$lines || this.getAllLines(); |
|
1494 |
var newlineLength = this.getNewLineCharacter().length; |
|
1495 |
var index = 0; |
|
1496 |
var row = Math.min(pos.row, lines.length); |
|
1497 |
for (var i = startRow || 0; i < row; ++i) |
|
1498 |
index += lines[i].length; |
|
1499 |
||
1500 |
return index + newlineLength * i + pos.column; |
|
1501 |
}; |
|
1502 |
||
1503 |
}).call(Document.prototype); |
|
1504 |
||
1505 |
exports.Document = Document; |
|
1506 |
});
|
|
1507 |
||
1508 |
define('ace/range', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
1509 |
||
1510 |
var comparePoints = function(p1, p2) { |
|
1511 |
return p1.row - p2.row || p1.column - p2.column; |
|
1512 |
};
|
|
1513 |
var Range = function(startRow, startColumn, endRow, endColumn) { |
|
1514 |
this.start = { |
|
1515 |
row: startRow, |
|
1516 |
column: startColumn |
|
1517 |
}; |
|
1518 |
||
1519 |
this.end = { |
|
1520 |
row: endRow, |
|
1521 |
column: endColumn |
|
1522 |
}; |
|
1523 |
};
|
|
1524 |
||
1525 |
(function() { |
|
1526 |
this.isEqual = function(range) { |
|
1527 |
return this.start.row === range.start.row && |
|
1528 |
this.end.row === range.end.row && |
|
1529 |
this.start.column === range.start.column && |
|
1530 |
this.end.column === range.end.column; |
|
1531 |
}; |
|
1532 |
this.toString = function() { |
|
1533 |
return ("Range: [" + this.start.row + "/" + this.start.column + |
|
1534 |
"] -> [" + this.end.row + "/" + this.end.column + "]"); |
|
1535 |
}; |
|
1536 |
||
1537 |
this.contains = function(row, column) { |
|
1538 |
return this.compare(row, column) == 0; |
|
1539 |
}; |
|
1540 |
this.compareRange = function(range) { |
|
1541 |
var cmp, |
|
1542 |
end = range.end, |
|
1543 |
start = range.start; |
|
1544 |
||
1545 |
cmp = this.compare(end.row, end.column); |
|
1546 |
if (cmp == 1) { |
|
1547 |
cmp = this.compare(start.row, start.column); |
|
1548 |
if (cmp == 1) { |
|
1549 |
return 2; |
|
1550 |
} else if (cmp == 0) { |
|
1551 |
return 1; |
|
1552 |
} else { |
|
1553 |
return 0; |
|
1554 |
} |
|
1555 |
} else if (cmp == -1) { |
|
1556 |
return -2; |
|
1557 |
} else { |
|
1558 |
cmp = this.compare(start.row, start.column); |
|
1559 |
if (cmp == -1) { |
|
1560 |
return -1; |
|
1561 |
} else if (cmp == 1) { |
|
1562 |
return 42; |
|
1563 |
} else { |
|
1564 |
return 0; |
|
1565 |
} |
|
1566 |
} |
|
1567 |
}; |
|
1568 |
this.comparePoint = function(p) { |
|
1569 |
return this.compare(p.row, p.column); |
|
1570 |
}; |
|
1571 |
this.containsRange = function(range) { |
|
1572 |
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0; |
|
1573 |
}; |
|
1574 |
this.intersects = function(range) { |
|
1575 |
var cmp = this.compareRange(range); |
|
1576 |
return (cmp == -1 || cmp == 0 || cmp == 1); |
|
1577 |
}; |
|
1578 |
this.isEnd = function(row, column) { |
|
1579 |
return this.end.row == row && this.end.column == column; |
|
1580 |
}; |
|
1581 |
this.isStart = function(row, column) { |
|
1582 |
return this.start.row == row && this.start.column == column; |
|
1583 |
}; |
|
1584 |
this.setStart = function(row, column) { |
|
1585 |
if (typeof row == "object") { |
|
1586 |
this.start.column = row.column; |
|
1587 |
this.start.row = row.row; |
|
1588 |
} else { |
|
1589 |
this.start.row = row; |
|
1590 |
this.start.column = column; |
|
1591 |
} |
|
1592 |
}; |
|
1593 |
this.setEnd = function(row, column) { |
|
1594 |
if (typeof row == "object") { |
|
1595 |
this.end.column = row.column; |
|
1596 |
this.end.row = row.row; |
|
1597 |
} else { |
|
1598 |
this.end.row = row; |
|
1599 |
this.end.column = column; |
|
1600 |
} |
|
1601 |
}; |
|
1602 |
this.inside = function(row, column) { |
|
1603 |
if (this.compare(row, column) == 0) { |
|
1604 |
if (this.isEnd(row, column) || this.isStart(row, column)) { |
|
1605 |
return false; |
|
1606 |
} else { |
|
1607 |
return true; |
|
1608 |
} |
|
1609 |
} |
|
1610 |
return false; |
|
1611 |
}; |
|
1612 |
this.insideStart = function(row, column) { |
|
1613 |
if (this.compare(row, column) == 0) { |
|
1614 |
if (this.isEnd(row, column)) { |
|
1615 |
return false; |
|
1616 |
} else { |
|
1617 |
return true; |
|
1618 |
} |
|
1619 |
} |
|
1620 |
return false; |
|
1621 |
}; |
|
1622 |
this.insideEnd = function(row, column) { |
|
1623 |
if (this.compare(row, column) == 0) { |
|
1624 |
if (this.isStart(row, column)) { |
|
1625 |
return false; |
|
1626 |
} else { |
|
1627 |
return true; |
|
1628 |
} |
|
1629 |
} |
|
1630 |
return false; |
|
1631 |
}; |
|
1632 |
this.compare = function(row, column) { |
|
1633 |
if (!this.isMultiLine()) { |
|
1634 |
if (row === this.start.row) { |
|
1635 |
return column < this.start.column ? -1 : (column > this.end.column ? 1 : 0); |
|
1636 |
}; |
|
1637 |
} |
|
1638 |
||
1639 |
if (row < this.start.row) |
|
1640 |
return -1; |
|
1641 |
||
1642 |
if (row > this.end.row) |
|
1643 |
return 1; |
|
1644 |
||
1645 |
if (this.start.row === row) |
|
1646 |
return column >= this.start.column ? 0 : -1; |
|
1647 |
||
1648 |
if (this.end.row === row) |
|
1649 |
return column <= this.end.column ? 0 : 1; |
|
1650 |
||
1651 |
return 0; |
|
1652 |
}; |
|
1653 |
this.compareStart = function(row, column) { |
|
1654 |
if (this.start.row == row && this.start.column == column) { |
|
1655 |
return -1; |
|
1656 |
} else { |
|
1657 |
return this.compare(row, column); |
|
1658 |
} |
|
1659 |
}; |
|
1660 |
this.compareEnd = function(row, column) { |
|
1661 |
if (this.end.row == row && this.end.column == column) { |
|
1662 |
return 1; |
|
1663 |
} else { |
|
1664 |
return this.compare(row, column); |
|
1665 |
} |
|
1666 |
}; |
|
1667 |
this.compareInside = function(row, column) { |
|
1668 |
if (this.end.row == row && this.end.column == column) { |
|
1669 |
return 1; |
|
1670 |
} else if (this.start.row == row && this.start.column == column) { |
|
1671 |
return -1; |
|
1672 |
} else { |
|
1673 |
return this.compare(row, column); |
|
1674 |
} |
|
1675 |
}; |
|
1676 |
this.clipRows = function(firstRow, lastRow) { |
|
1677 |
if (this.end.row > lastRow) |
|
1678 |
var end = {row: lastRow + 1, column: 0}; |
|
1679 |
else if (this.end.row < firstRow) |
|
1680 |
var end = {row: firstRow, column: 0}; |
|
1681 |
||
1682 |
if (this.start.row > lastRow) |
|
1683 |
var start = {row: lastRow + 1, column: 0}; |
|
1684 |
else if (this.start.row < firstRow) |
|
1685 |
var start = {row: firstRow, column: 0}; |
|
1686 |
||
1687 |
return Range.fromPoints(start || this.start, end || this.end); |
|
1688 |
}; |
|
1689 |
this.extend = function(row, column) { |
|
1690 |
var cmp = this.compare(row, column); |
|
1691 |
||
1692 |
if (cmp == 0) |
|
1693 |
return this; |
|
1694 |
else if (cmp == -1) |
|
1695 |
var start = {row: row, column: column}; |
|
1696 |
else |
|
1697 |
var end = {row: row, column: column}; |
|
1698 |
||
1699 |
return Range.fromPoints(start || this.start, end || this.end); |
|
1700 |
}; |
|
1701 |
||
1702 |
this.isEmpty = function() { |
|
1703 |
return (this.start.row === this.end.row && this.start.column === this.end.column); |
|
1704 |
}; |
|
1705 |
this.isMultiLine = function() { |
|
1706 |
return (this.start.row !== this.end.row); |
|
1707 |
}; |
|
1708 |
this.clone = function() { |
|
1709 |
return Range.fromPoints(this.start, this.end); |
|
1710 |
}; |
|
1711 |
this.collapseRows = function() { |
|
1712 |
if (this.end.column == 0) |
|
1713 |
return new Range(this.start.row, 0, Math.max(this.start.row, this.end.row-1), 0) |
|
1714 |
else |
|
1715 |
return new Range(this.start.row, 0, this.end.row, 0) |
|
1716 |
}; |
|
1717 |
this.toScreenRange = function(session) { |
|
1718 |
var screenPosStart = session.documentToScreenPosition(this.start); |
|
1719 |
var screenPosEnd = session.documentToScreenPosition(this.end); |
|
1720 |
||
1721 |
return new Range( |
|
1722 |
screenPosStart.row, screenPosStart.column, |
|
1723 |
screenPosEnd.row, screenPosEnd.column |
|
1724 |
); |
|
1725 |
}; |
|
1726 |
this.moveBy = function(row, column) { |
|
1727 |
this.start.row += row; |
|
1728 |
this.start.column += column; |
|
1729 |
this.end.row += row; |
|
1730 |
this.end.column += column; |
|
1731 |
}; |
|
1732 |
||
1733 |
}).call(Range.prototype); |
|
1734 |
Range.fromPoints = function(start, end) { |
|
1735 |
return new Range(start.row, start.column, end.row, end.column); |
|
1736 |
};
|
|
1737 |
Range.comparePoints = comparePoints; |
|
1738 |
||
1739 |
exports.Range = Range; |
|
1740 |
});
|
|
1741 |
||
1742 |
define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function(require, exports, module) { |
|
1743 |
||
1744 |
||
1745 |
var oop = require("./lib/oop"); |
|
1746 |
var EventEmitter = require("./lib/event_emitter").EventEmitter; |
|
1747 |
||
1748 |
var Anchor = exports.Anchor = function(doc, row, column) { |
|
1749 |
this.document = doc; |
|
1750 |
|
|
1751 |
if (typeof column == "undefined") |
|
1752 |
this.setPosition(row.row, row.column); |
|
1753 |
else |
|
1754 |
this.setPosition(row, column); |
|
1755 |
||
1756 |
this.$onChange = this.onChange.bind(this); |
|
1757 |
doc.on("change", this.$onChange); |
|
1758 |
};
|
|
1759 |
||
1760 |
(function() { |
|
1761 |
||
1762 |
oop.implement(this, EventEmitter); |
|
1763 |
||
1764 |
this.getPosition = function() { |
|
1765 |
return this.$clipPositionToDocument(this.row, this.column); |
|
1766 |
}; |
|
1767 |
|
|
1768 |
this.getDocument = function() { |
|
1769 |
return this.document; |
|
1770 |
}; |
|
1771 |
||
1772 |
this.onChange = function(e) { |
|
1773 |
var delta = e.data; |
|
1774 |
var range = delta.range; |
|
1775 |
|
|
1776 |
if (range.start.row == range.end.row && range.start.row != this.row) |
|
1777 |
return; |
|
1778 |
|
|
1779 |
if (range.start.row > this.row) |
|
1780 |
return; |
|
1781 |
|
|
1782 |
if (range.start.row == this.row && range.start.column > this.column) |
|
1783 |
return; |
|
1784 |
|
|
1785 |
var row = this.row; |
|
1786 |
var column = this.column; |
|
1787 |
|
|
1788 |
if (delta.action === "insertText") { |
|
1789 |
if (range.start.row === row && range.start.column <= column) { |
|
1790 |
if (range.start.row === range.end.row) { |
|
1791 |
column += range.end.column - range.start.column; |
|
1792 |
} |
|
1793 |
else { |
|
1794 |
column -= range.start.column; |
|
1795 |
row += range.end.row - range.start.row; |
|
1796 |
} |
|
1797 |
} |
|
1798 |
else if (range.start.row !== range.end.row && range.start.row < row) { |
|
1799 |
row += range.end.row - range.start.row; |
|
1800 |
} |
|
1801 |
} else if (delta.action === "insertLines") { |
|
1802 |
if (range.start.row <= row) { |
|
1803 |
row += range.end.row - range.start.row; |
|
1804 |
} |
|
1805 |
} |
|
1806 |
else if (delta.action == "removeText") { |
|
1807 |
if (range.start.row == row && range.start.column < column) { |
|
1808 |
if (range.end.column >= column) |
|
1809 |
column = range.start.column; |
|
1810 |
else |
|
1811 |
column = Math.max(0, column - (range.end.column - range.start.column)); |
|
1812 |
|
|
1813 |
} else if (range.start.row !== range.end.row && range.start.row < row) { |
|
1814 |
if (range.end.row == row) { |
|
1815 |
column = Math.max(0, column - range.end.column) + range.start.column; |
|
1816 |
} |
|
1817 |
row -= (range.end.row - range.start.row); |
|
1818 |
} |
|
1819 |
else if (range.end.row == row) { |
|
1820 |
row -= range.end.row - range.start.row; |
|
1821 |
column = Math.max(0, column - range.end.column) + range.start.column; |
|
1822 |
} |
|
1823 |
} else if (delta.action == "removeLines") { |
|
1824 |
if (range.start.row <= row) { |
|
1825 |
if (range.end.row <= row) |
|
1826 |
row -= range.end.row - range.start.row; |
|
1827 |
else { |
|
1828 |
row = range.start.row; |
|
1829 |
column = 0; |
|
1830 |
} |
|
1831 |
} |
|
1832 |
} |
|
1833 |
||
1834 |
this.setPosition(row, column, true); |
|
1835 |
}; |
|
1836 |
||
1837 |
this.setPosition = function(row, column, noClip) { |
|
1838 |
var pos; |
|
1839 |
if (noClip) { |
|
1840 |
pos = { |
|
1841 |
row: row, |
|
1842 |
column: column |
|
1843 |
}; |
|
1844 |
} |
|
1845 |
else { |
|
1846 |
pos = this.$clipPositionToDocument(row, column); |
|
1847 |
} |
|
1848 |
|
|
1849 |
if (this.row == pos.row && this.column == pos.column) |
|
1850 |
return; |
|
1851 |
|
|
1852 |
var old = { |
|
1853 |
row: this.row, |
|
1854 |
column: this.column |
|
1855 |
}; |
|
1856 |
|
|
1857 |
this.row = pos.row; |
|
1858 |
this.column = pos.column; |
|
1859 |
this._emit("change", { |
|
1860 |
old: old, |
|
1861 |
value: pos |
|
1862 |
}); |
|
1863 |
}; |
|
1864 |
||
1865 |
this.detach = function() { |
|
1866 |
this.document.removeEventListener("change", this.$onChange); |
|
1867 |
}; |
|
1868 |
this.$clipPositionToDocument = function(row, column) { |
|
1869 |
var pos = {}; |
|
1870 |
|
|
1871 |
if (row >= this.document.getLength()) { |
|
1872 |
pos.row = Math.max(0, this.document.getLength() - 1); |
|
1873 |
pos.column = this.document.getLine(pos.row).length; |
|
1874 |
} |
|
1875 |
else if (row < 0) { |
|
1876 |
pos.row = 0; |
|
1877 |
pos.column = 0; |
|
1878 |
} |
|
1879 |
else { |
|
1880 |
pos.row = row; |
|
1881 |
pos.column = Math.min(this.document.getLine(pos.row).length, Math.max(0, column)); |
|
1882 |
} |
|
1883 |
|
|
1884 |
if (column < 0) |
|
1885 |
pos.column = 0; |
|
1886 |
|
|
1887 |
return pos; |
|
1888 |
}; |
|
1889 |
|
|
1890 |
}).call(Anchor.prototype); |
|
1891 |
||
1892 |
});
|
|
1893 |
||
1894 |
define('ace/lib/lang', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
1895 |
||
1896 |
||
1897 |
exports.stringReverse = function(string) { |
|
1898 |
return string.split("").reverse().join(""); |
|
1899 |
};
|
|
1900 |
||
1901 |
exports.stringRepeat = function (string, count) { |
|
1902 |
var result = ''; |
|
1903 |
while (count > 0) { |
|
1904 |
if (count & 1) |
|
1905 |
result += string; |
|
1906 |
||
1907 |
if (count >>= 1) |
|
1908 |
string += string; |
|
1909 |
} |
|
1910 |
return result; |
|
1911 |
};
|
|
1912 |
||
1913 |
var trimBeginRegexp = /^\s\s*/; |
|
1914 |
var trimEndRegexp = /\s\s*$/; |
|
1915 |
||
1916 |
exports.stringTrimLeft = function (string) { |
|
1917 |
return string.replace(trimBeginRegexp, ''); |
|
1918 |
};
|
|
1919 |
||
1920 |
exports.stringTrimRight = function (string) { |
|
1921 |
return string.replace(trimEndRegexp, ''); |
|
1922 |
};
|
|
1923 |
||
1924 |
exports.copyObject = function(obj) { |
|
1925 |
var copy = {}; |
|
1926 |
for (var key in obj) { |
|
1927 |
copy[key] = obj[key]; |
|
1928 |
} |
|
1929 |
return copy; |
|
1930 |
};
|
|
1931 |
||
1932 |
exports.copyArray = function(array){ |
|
1933 |
var copy = []; |
|
1934 |
for (var i=0, l=array.length; i<l; i++) { |
|
1935 |
if (array[i] && typeof array[i] == "object") |
|
1936 |
copy[i] = this.copyObject( array[i] ); |
|
1937 |
else |
|
1938 |
copy[i] = array[i]; |
|
1939 |
} |
|
1940 |
return copy; |
|
1941 |
};
|
|
1942 |
||
1943 |
exports.deepCopy = function (obj) { |
|
1944 |
if (typeof obj != "object") { |
|
1945 |
return obj; |
|
1946 |
} |
|
1947 |
|
|
1948 |
var copy = obj.constructor(); |
|
1949 |
for (var key in obj) { |
|
1950 |
if (typeof obj[key] == "object") { |
|
1951 |
copy[key] = this.deepCopy(obj[key]); |
|
1952 |
} else { |
|
1953 |
copy[key] = obj[key]; |
|
1954 |
} |
|
1955 |
} |
|
1956 |
return copy; |
|
1957 |
};
|
|
1958 |
||
1959 |
exports.arrayToMap = function(arr) { |
|
1960 |
var map = {}; |
|
1961 |
for (var i=0; i<arr.length; i++) { |
|
1962 |
map[arr[i]] = 1; |
|
1963 |
} |
|
1964 |
return map; |
|
1965 |
||
1966 |
};
|
|
1967 |
||
1968 |
exports.createMap = function(props) { |
|
1969 |
var map = Object.create(null); |
|
1970 |
for (var i in props) { |
|
1971 |
map[i] = props[i]; |
|
1972 |
} |
|
1973 |
return map; |
|
1974 |
};
|
|
1975 |
exports.arrayRemove = function(array, value) { |
|
1976 |
for (var i = 0; i <= array.length; i++) { |
|
1977 |
if (value === array[i]) { |
|
1978 |
array.splice(i, 1); |
|
1979 |
} |
|
1980 |
} |
|
1981 |
};
|
|
1982 |
||
1983 |
exports.escapeRegExp = function(str) { |
|
1984 |
return str.replace(/([.*+?^${}()|[\]\/\\])/g, '\\$1'); |
|
1985 |
};
|
|
1986 |
||
1987 |
exports.escapeHTML = function(str) { |
|
1988 |
return str.replace(/&/g, "&").replace(/"/g, """).replace(/'/g, "'").replace(/</g, "<"); |
|
1989 |
};
|
|
1990 |
||
1991 |
exports.getMatchOffsets = function(string, regExp) { |
|
1992 |
var matches = []; |
|
1993 |
||
1994 |
string.replace(regExp, function(str) { |
|
1995 |
matches.push({ |
|
1996 |
offset: arguments[arguments.length-2], |
|
1997 |
length: str.length |
|
1998 |
}); |
|
1999 |
}); |
|
2000 |
||
2001 |
return matches; |
|
2002 |
};
|
|
2003 |
exports.deferredCall = function(fcn) { |
|
2004 |
||
2005 |
var timer = null; |
|
2006 |
var callback = function() { |
|
2007 |
timer = null; |
|
2008 |
fcn(); |
|
2009 |
}; |
|
2010 |
||
2011 |
var deferred = function(timeout) { |
|
2012 |
deferred.cancel(); |
|
2013 |
timer = setTimeout(callback, timeout || 0); |
|
2014 |
return deferred; |
|
2015 |
}; |
|
2016 |
||
2017 |
deferred.schedule = deferred; |
|
2018 |
||
2019 |
deferred.call = function() { |
|
2020 |
this.cancel(); |
|
2021 |
fcn(); |
|
2022 |
return deferred; |
|
2023 |
}; |
|
2024 |
||
2025 |
deferred.cancel = function() { |
|
2026 |
clearTimeout(timer); |
|
2027 |
timer = null; |
|
2028 |
return deferred; |
|
2029 |
}; |
|
2030 |
||
2031 |
return deferred; |
|
2032 |
};
|
|
2033 |
||
2034 |
||
2035 |
exports.delayedCall = function(fcn, defaultTimeout) { |
|
2036 |
var timer = null; |
|
2037 |
var callback = function() { |
|
2038 |
timer = null; |
|
2039 |
fcn(); |
|
2040 |
}; |
|
2041 |
||
2042 |
var _self = function(timeout) { |
|
2043 |
timer && clearTimeout(timer); |
|
2044 |
timer = setTimeout(callback, timeout || defaultTimeout); |
|
2045 |
}; |
|
2046 |
||
2047 |
_self.delay = _self; |
|
2048 |
_self.schedule = function(timeout) { |
|
2049 |
if (timer == null) |
|
2050 |
timer = setTimeout(callback, timeout || 0); |
|
2051 |
}; |
|
2052 |
||
2053 |
_self.call = function() { |
|
2054 |
this.cancel(); |
|
2055 |
fcn(); |
|
2056 |
}; |
|
2057 |
||
2058 |
_self.cancel = function() { |
|
2059 |
timer && clearTimeout(timer); |
|
2060 |
timer = null; |
|
2061 |
}; |
|
2062 |
||
2063 |
_self.isPending = function() { |
|
2064 |
return timer; |
|
2065 |
}; |
|
2066 |
||
2067 |
return _self; |
|
2068 |
};
|
|
2069 |
});
|
|
2070 |
|
|
2071 |
define('ace/mode/coffee/coffee-script', ['require', 'exports', 'module' , 'ace/mode/coffee/lexer', 'ace/mode/coffee/parser', 'ace/mode/coffee/nodes'], function(require, exports, module) { |
|
2072 |
|
|
2073 |
var Lexer = require("./lexer").Lexer; |
|
2074 |
var parser = require("./parser"); |
|
2075 |
||
2076 |
var lexer = new Lexer(); |
|
2077 |
parser.lexer = { |
|
2078 |
lex: function() { |
|
2079 |
var tag, _ref2; |
|
2080 |
_ref2 = this.tokens[this.pos++] || [''], tag = _ref2[0], this.yytext = _ref2[1], this.yylineno = _ref2[2]; |
|
2081 |
return tag; |
|
2082 |
}, |
|
2083 |
setInput: function(tokens) { |
|
2084 |
this.tokens = tokens; |
|
2085 |
return this.pos = 0; |
|
2086 |
}, |
|
2087 |
upcomingInput: function() { |
|
2088 |
return ""; |
|
2089 |
} |
|
2090 |
}; |
|
2091 |
parser.yy = require('./nodes'); |
|
2092 |
|
|
2093 |
exports.parse = function(code) { |
|
2094 |
return parser.parse(lexer.tokenize(code)); |
|
2095 |
}; |
|
2096 |
});
|
|
2097 |
||
2098 |
define('ace/mode/coffee/lexer', ['require', 'exports', 'module' , 'ace/mode/coffee/rewriter', 'ace/mode/coffee/helpers'], function(require, exports, module) { |
|
2099 |
||
2100 |
var BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDEXABLE, INVERSES, JSTOKEN, JS_FORBIDDEN, JS_KEYWORDS, LINE_BREAK, LINE_CONTINUER, LOGIC, Lexer, MATH, MULTILINER, MULTI_DENT, NOT_REGEX, NOT_SPACED_REGEX, NUMBER, OPERATOR, REGEX, RELATION, RESERVED, Rewriter, SHIFT, SIMPLESTR, STRICT_PROSCRIBED, TRAILING_SPACES, UNARY, WHITESPACE, compact, count, key, last, starts, _ref, _ref1, |
|
2101 |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; |
|
2102 |
||
2103 |
_ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES; |
|
2104 |
||
2105 |
_ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last; |
|
2106 |
||
2107 |
exports.Lexer = Lexer = (function() { |
|
2108 |
||
2109 |
function Lexer() {} |
|
2110 |
||
2111 |
Lexer.prototype.tokenize = function(code, opts) { |
|
2112 |
var i, tag; |
|
2113 |
if (opts == null) { |
|
2114 |
opts = {}; |
|
2115 |
} |
|
2116 |
if (WHITESPACE.test(code)) { |
|
2117 |
code = "\n" + code; |
|
2118 |
} |
|
2119 |
code = code.replace(/\r/g, '').replace(TRAILING_SPACES, ''); |
|
2120 |
this.code = code; |
|
2121 |
this.line = opts.line || 0; |
|
2122 |
this.indent = 0; |
|
2123 |
this.indebt = 0; |
|
2124 |
this.outdebt = 0; |
|
2125 |
this.indents = []; |
|
2126 |
this.ends = []; |
|
2127 |
this.tokens = []; |
|
2128 |
i = 0; |
|
2129 |
while (this.chunk = code.slice(i)) { |
|
2130 |
i += this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken(); |
|
2131 |
} |
|
2132 |
this.closeIndentation(); |
|
2133 |
if (tag = this.ends.pop()) { |
|
2134 |
this.error("missing " + tag); |
|
2135 |
} |
|
2136 |
if (opts.rewrite === false) { |
|
2137 |
return this.tokens; |
|
2138 |
} |
|
2139 |
return (new Rewriter).rewrite(this.tokens); |
|
2140 |
}; |
|
2141 |
||
2142 |
Lexer.prototype.identifierToken = function() { |
|
2143 |
var colon, forcedIdentifier, id, input, match, prev, tag, _ref2, _ref3; |
|
2144 |
if (!(match = IDENTIFIER.exec(this.chunk))) { |
|
2145 |
return 0; |
|
2146 |
} |
|
2147 |
input = match[0], id = match[1], colon = match[2]; |
|
2148 |
if (id === 'own' && this.tag() === 'FOR') { |
|
2149 |
this.token('OWN', id); |
|
2150 |
return id.length; |
|
2151 |
} |
|
2152 |
forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::') || !prev.spaced && prev[0] === '@'); |
|
2153 |
tag = 'IDENTIFIER'; |
|
2154 |
if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) { |
|
2155 |
tag = id.toUpperCase(); |
|
2156 |
if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) { |
|
2157 |
tag = 'LEADING_WHEN'; |
|
2158 |
} else if (tag === 'FOR') { |
|
2159 |
this.seenFor = true; |
|
2160 |
} else if (tag === 'UNLESS') { |
|
2161 |
tag = 'IF'; |
|
2162 |
} else if (__indexOf.call(UNARY, tag) >= 0) { |
|
2163 |
tag = 'UNARY'; |
|
2164 |
} else if (__indexOf.call(RELATION, tag) >= 0) { |
|
2165 |
if (tag !== 'INSTANCEOF' && this.seenFor) { |
|
2166 |
tag = 'FOR' + tag; |
|
2167 |
this.seenFor = false; |
|
2168 |
} else { |
|
2169 |
tag = 'RELATION'; |
|
2170 |
if (this.value() === '!') { |
|
2171 |
this.tokens.pop(); |
|
2172 |
id = '!' + id; |
|
2173 |
} |
|
2174 |
} |
|
2175 |
} |
|
2176 |
} |
|
2177 |
if (__indexOf.call(JS_FORBIDDEN, id) >= 0) { |
|
2178 |
if (forcedIdentifier) { |
|
2179 |
tag = 'IDENTIFIER'; |
|
2180 |
id = new String(id); |
|
2181 |
id.reserved = true; |
|
2182 |
} else if (__indexOf.call(RESERVED, id) >= 0) { |
|
2183 |
this.error("reserved word \"" + id + "\""); |
|
2184 |
} |
|
2185 |
} |
|
2186 |
if (!forcedIdentifier) { |
|
2187 |
if (__indexOf.call(COFFEE_ALIASES, id) >= 0) { |
|
2188 |
id = COFFEE_ALIAS_MAP[id]; |
|
2189 |
} |
|
2190 |
tag = (function() { |
|
2191 |
switch (id) { |
|
2192 |
case '!': |
|
2193 |
return 'UNARY'; |
|
2194 |
case '==': |
|
2195 |
case '!=': |
|
2196 |
return 'COMPARE'; |
|
2197 |
case '&&': |
|
2198 |
case '||': |
|
2199 |
return 'LOGIC'; |
|
2200 |
case 'true': |
|
2201 |
case 'false': |
|
2202 |
return 'BOOL'; |
|
2203 |
case 'break': |
|
2204 |
case 'continue': |
|
2205 |
return 'STATEMENT'; |
|
2206 |
default: |
|
2207 |
return tag; |
|
2208 |
} |
|
2209 |
})(); |
|
2210 |
} |
|
2211 |
this.token(tag, id); |
|
2212 |
if (colon) { |
|
2213 |
this.token(':', ':'); |
|
2214 |
} |
|
2215 |
return input.length; |
|
2216 |
}; |
|
2217 |
||
2218 |
Lexer.prototype.numberToken = function() { |
|
2219 |
var binaryLiteral, lexedLength, match, number, octalLiteral; |
|
2220 |
if (!(match = NUMBER.exec(this.chunk))) { |
|
2221 |
return 0; |
|
2222 |
} |
|
2223 |
number = match[0]; |
|
2224 |
if (/^0[BOX]/.test(number)) { |
|
2225 |
this.error("radix prefix '" + number + "' must be lowercase"); |
|
2226 |
} else if (/E/.test(number) && !/^0x/.test(number)) { |
|
2227 |
this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'"); |
|
2228 |
} else if (/^0\d*[89]/.test(number)) { |
|
2229 |
this.error("decimal literal '" + number + "' must not be prefixed with '0'"); |
|
2230 |
} else if (/^0\d+/.test(number)) { |
|
2231 |
this.error("octal literal '" + number + "' must be prefixed with '0o'"); |
|
2232 |
} |
|
2233 |
lexedLength = number.length; |
|
2234 |
if (octalLiteral = /^0o([0-7]+)/.exec(number)) { |
|
2235 |
number = '0x' + (parseInt(octalLiteral[1], 8)).toString(16); |
|
2236 |
} |
|
2237 |
if (binaryLiteral = /^0b([01]+)/.exec(number)) { |
|
2238 |
number = '0x' + (parseInt(binaryLiteral[1], 2)).toString(16); |
|
2239 |
} |
|
2240 |
this.token('NUMBER', number); |
|
2241 |
return lexedLength; |
|
2242 |
}; |
|
2243 |
||
2244 |
Lexer.prototype.stringToken = function() { |
|
2245 |
var match, octalEsc, string; |
|
2246 |
switch (this.chunk.charAt(0)) { |
|
2247 |
case "'": |
|
2248 |
if (!(match = SIMPLESTR.exec(this.chunk))) { |
|
2249 |
return 0; |
|
2250 |
} |
|
2251 |
this.token('STRING', (string = match[0]).replace(MULTILINER, '\\\n')); |
|
2252 |
break; |
|
2253 |
case '"': |
|
2254 |
if (!(string = this.balancedString(this.chunk, '"'))) { |
|
2255 |
return 0; |
|
2256 |
} |
|
2257 |
if (0 < string.indexOf('#{', 1)) { |
|
2258 |
this.interpolateString(string.slice(1, -1)); |
|
2259 |
} else { |
|
2260 |
this.token('STRING', this.escapeLines(string)); |
|
2261 |
} |
|
2262 |
break; |
|
2263 |
default: |
|
2264 |
return 0; |
|
2265 |
} |
|
2266 |
if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) { |
|
2267 |
this.error("octal escape sequences " + string + " are not allowed"); |
|
2268 |
} |
|
2269 |
this.line += count(string, '\n'); |
|
2270 |
return string.length; |
|
2271 |
}; |
|
2272 |
||
2273 |
Lexer.prototype.heredocToken = function() { |
|
2274 |
var doc, heredoc, match, quote; |
|
2275 |
if (!(match = HEREDOC.exec(this.chunk))) { |
|
2276 |
return 0; |
|
2277 |
} |
|
2278 |
heredoc = match[0]; |
|
2279 |
quote = heredoc.charAt(0); |
|
2280 |
doc = this.sanitizeHeredoc(match[2], { |
|
2281 |
quote: quote, |
|
2282 |
indent: null |
|
2283 |
}); |
|
2284 |
if (quote === '"' && 0 <= doc.indexOf('#{')) { |
|
2285 |
this.interpolateString(doc, { |
|
2286 |
heredoc: true |
|
2287 |
}); |
|
2288 |
} else { |
|
2289 |
this.token('STRING', this.makeString(doc, quote, true)); |
|
2290 |
} |
|
2291 |
this.line += count(heredoc, '\n'); |
|
2292 |
return heredoc.length; |
|
2293 |
}; |
|
2294 |
||
2295 |
Lexer.prototype.commentToken = function() { |
|
2296 |
var comment, here, match; |
|
2297 |
if (!(match = this.chunk.match(COMMENT))) { |
|
2298 |
return 0; |
|
2299 |
} |
|
2300 |
comment = match[0], here = match[1]; |
|
2301 |
if (here) { |
|
2302 |
this.token('HERECOMMENT', this.sanitizeHeredoc(here, { |
|
2303 |
herecomment: true, |
|
2304 |
indent: Array(this.indent + 1).join(' ') |
|
2305 |
})); |
|
2306 |
} |
|
2307 |
this.line += count(comment, '\n'); |
|
2308 |
return comment.length; |
|
2309 |
}; |
|
2310 |
||
2311 |
Lexer.prototype.jsToken = function() { |
|
2312 |
var match, script; |
|
2313 |
if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) { |
|
2314 |
return 0; |
|
2315 |
} |
|
2316 |
this.token('JS', (script = match[0]).slice(1, -1)); |
|
2317 |
this.line += count(script, '\n'); |
|
2318 |
return script.length; |
|
2319 |
}; |
|
2320 |
||
2321 |
Lexer.prototype.regexToken = function() { |
|
2322 |
var flags, length, match, prev, regex, _ref2, _ref3; |
|
2323 |
if (this.chunk.charAt(0) !== '/') { |
|
2324 |
return 0; |
|
2325 |
} |
|
2326 |
if (match = HEREGEX.exec(this.chunk)) { |
|
2327 |
length = this.heregexToken(match); |
|
2328 |
this.line += count(match[0], '\n'); |
|
2329 |
return length; |
|
2330 |
} |
|
2331 |
prev = last(this.tokens); |
|
2332 |
if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) { |
|
2333 |
return 0; |
|
2334 |
} |
|
2335 |
if (!(match = REGEX.exec(this.chunk))) { |
|
2336 |
return 0; |
|
2337 |
} |
|
2338 |
_ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2]; |
|
2339 |
if (regex.slice(0, 2) === '/*') { |
|
2340 |
this.error('regular expressions cannot begin with `*`'); |
|
2341 |
} |
|
2342 |
if (regex === '//') { |
|
2343 |
regex = '/(?:)/'; |
|
2344 |
} |
|
2345 |
this.token('REGEX', "" + regex + flags); |
|
2346 |
return match.length; |
|
2347 |
}; |
|
2348 |
||
2349 |
Lexer.prototype.heregexToken = function(match) { |
|
2350 |
var body, flags, heregex, re, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4, _ref5; |
|
2351 |
heregex = match[0], body = match[1], flags = match[2]; |
|
2352 |
if (0 > body.indexOf('#{')) { |
|
2353 |
re = body.replace(HEREGEX_OMIT, '').replace(/\//g, '\\/'); |
|
2354 |
if (re.match(/^\*/)) { |
|
2355 |
this.error('regular expressions cannot begin with `*`'); |
|
2356 |
} |
|
2357 |
this.token('REGEX', "/" + (re || '(?:)') + "/" + flags); |
|
2358 |
return heregex.length; |
|
2359 |
} |
|
2360 |
this.token('IDENTIFIER', 'RegExp'); |
|
2361 |
this.tokens.push(['CALL_START', '(']); |
|
2362 |
tokens = []; |
|
2363 |
_ref2 = this.interpolateString(body, { |
|
2364 |
regex: true |
|
2365 |
}); |
|
2366 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
2367 |
_ref3 = _ref2[_i], tag = _ref3[0], value = _ref3[1]; |
|
2368 |
if (tag === 'TOKENS') { |
|
2369 |
tokens.push.apply(tokens, value); |
|
2370 |
} else { |
|
2371 |
if (!(value = value.replace(HEREGEX_OMIT, ''))) { |
|
2372 |
continue; |
|
2373 |
} |
|
2374 |
value = value.replace(/\\/g, '\\\\'); |
|
2375 |
tokens.push(['STRING', this.makeString(value, '"', true)]); |
|
2376 |
} |
|
2377 |
tokens.push(['+', '+']); |
|
2378 |
} |
|
2379 |
tokens.pop(); |
|
2380 |
if (((_ref4 = tokens[0]) != null ? _ref4[0] : void 0) !== 'STRING') { |
|
2381 |
this.tokens.push(['STRING', '""'], ['+', '+']); |
|
2382 |
} |
|
2383 |
(_ref5 = this.tokens).push.apply(_ref5, tokens); |
|
2384 |
if (flags) { |
|
2385 |
this.tokens.push([',', ','], ['STRING', '"' + flags + '"']); |
|
2386 |
} |
|
2387 |
this.token(')', ')'); |
|
2388 |
return heregex.length; |
|
2389 |
}; |
|
2390 |
||
2391 |
Lexer.prototype.lineToken = function() { |
|
2392 |
var diff, indent, match, noNewlines, size; |
|
2393 |
if (!(match = MULTI_DENT.exec(this.chunk))) { |
|
2394 |
return 0; |
|
2395 |
} |
|
2396 |
indent = match[0]; |
|
2397 |
this.line += count(indent, '\n'); |
|
2398 |
this.seenFor = false; |
|
2399 |
size = indent.length - 1 - indent.lastIndexOf('\n'); |
|
2400 |
noNewlines = this.unfinished(); |
|
2401 |
if (size - this.indebt === this.indent) { |
|
2402 |
if (noNewlines) { |
|
2403 |
this.suppressNewlines(); |
|
2404 |
} else { |
|
2405 |
this.newlineToken(); |
|
2406 |
} |
|
2407 |
return indent.length; |
|
2408 |
} |
|
2409 |
if (size > this.indent) { |
|
2410 |
if (noNewlines) { |
|
2411 |
this.indebt = size - this.indent; |
|
2412 |
this.suppressNewlines(); |
|
2413 |
return indent.length; |
|
2414 |
} |
|
2415 |
diff = size - this.indent + this.outdebt; |
|
2416 |
this.token('INDENT', diff); |
|
2417 |
this.indents.push(diff); |
|
2418 |
this.ends.push('OUTDENT'); |
|
2419 |
this.outdebt = this.indebt = 0; |
|
2420 |
} else { |
|
2421 |
this.indebt = 0; |
|
2422 |
this.outdentToken(this.indent - size, noNewlines); |
|
2423 |
} |
|
2424 |
this.indent = size; |
|
2425 |
return indent.length; |
|
2426 |
}; |
|
2427 |
||
2428 |
Lexer.prototype.outdentToken = function(moveOut, noNewlines) { |
|
2429 |
var dent, len; |
|
2430 |
while (moveOut > 0) { |
|
2431 |
len = this.indents.length - 1; |
|
2432 |
if (this.indents[len] === void 0) { |
|
2433 |
moveOut = 0; |
|
2434 |
} else if (this.indents[len] === this.outdebt) { |
|
2435 |
moveOut -= this.outdebt; |
|
2436 |
this.outdebt = 0; |
|
2437 |
} else if (this.indents[len] < this.outdebt) { |
|
2438 |
this.outdebt -= this.indents[len]; |
|
2439 |
moveOut -= this.indents[len]; |
|
2440 |
} else { |
|
2441 |
dent = this.indents.pop() - this.outdebt; |
|
2442 |
moveOut -= dent; |
|
2443 |
this.outdebt = 0; |
|
2444 |
this.pair('OUTDENT'); |
|
2445 |
this.token('OUTDENT', dent); |
|
2446 |
} |
|
2447 |
} |
|
2448 |
if (dent) { |
|
2449 |
this.outdebt -= moveOut; |
|
2450 |
} |
|
2451 |
while (this.value() === ';') { |
|
2452 |
this.tokens.pop(); |
|
2453 |
} |
|
2454 |
if (!(this.tag() === 'TERMINATOR' || noNewlines)) { |
|
2455 |
this.token('TERMINATOR', '\n'); |
|
2456 |
} |
|
2457 |
return this; |
|
2458 |
}; |
|
2459 |
||
2460 |
Lexer.prototype.whitespaceToken = function() { |
|
2461 |
var match, nline, prev; |
|
2462 |
if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) { |
|
2463 |
return 0; |
|
2464 |
} |
|
2465 |
prev = last(this.tokens); |
|
2466 |
if (prev) { |
|
2467 |
prev[match ? 'spaced' : 'newLine'] = true; |
|
2468 |
} |
|
2469 |
if (match) { |
|
2470 |
return match[0].length; |
|
2471 |
} else { |
|
2472 |
return 0; |
|
2473 |
} |
|
2474 |
}; |
|
2475 |
||
2476 |
Lexer.prototype.newlineToken = function() { |
|
2477 |
while (this.value() === ';') { |
|
2478 |
this.tokens.pop(); |
|
2479 |
} |
|
2480 |
if (this.tag() !== 'TERMINATOR') { |
|
2481 |
this.token('TERMINATOR', '\n'); |
|
2482 |
} |
|
2483 |
return this; |
|
2484 |
}; |
|
2485 |
||
2486 |
Lexer.prototype.suppressNewlines = function() { |
|
2487 |
if (this.value() === '\\') { |
|
2488 |
this.tokens.pop(); |
|
2489 |
} |
|
2490 |
return this; |
|
2491 |
}; |
|
2492 |
||
2493 |
Lexer.prototype.literalToken = function() { |
|
2494 |
var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5; |
|
2495 |
if (match = OPERATOR.exec(this.chunk)) { |
|
2496 |
value = match[0]; |
|
2497 |
if (CODE.test(value)) { |
|
2498 |
this.tagParameters(); |
|
2499 |
} |
|
2500 |
} else { |
|
2501 |
value = this.chunk.charAt(0); |
|
2502 |
} |
|
2503 |
tag = value; |
|
2504 |
prev = last(this.tokens); |
|
2505 |
if (value === '=' && prev) { |
|
2506 |
if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) { |
|
2507 |
this.error("reserved word \"" + (this.value()) + "\" can't be assigned"); |
|
2508 |
} |
|
2509 |
if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') { |
|
2510 |
prev[0] = 'COMPOUND_ASSIGN'; |
|
2511 |
prev[1] += '='; |
|
2512 |
return value.length; |
|
2513 |
} |
|
2514 |
} |
|
2515 |
if (value === ';') { |
|
2516 |
this.seenFor = false; |
|
2517 |
tag = 'TERMINATOR'; |
|
2518 |
} else if (__indexOf.call(MATH, value) >= 0) { |
|
2519 |
tag = 'MATH'; |
|
2520 |
} else if (__indexOf.call(COMPARE, value) >= 0) { |
|
2521 |
tag = 'COMPARE'; |
|
2522 |
} else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) { |
|
2523 |
tag = 'COMPOUND_ASSIGN'; |
|
2524 |
} else if (__indexOf.call(UNARY, value) >= 0) { |
|
2525 |
tag = 'UNARY'; |
|
2526 |
} else if (__indexOf.call(SHIFT, value) >= 0) { |
|
2527 |
tag = 'SHIFT'; |
|
2528 |
} else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) { |
|
2529 |
tag = 'LOGIC'; |
|
2530 |
} else if (prev && !prev.spaced) { |
|
2531 |
if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) { |
|
2532 |
if (prev[0] === '?') { |
|
2533 |
prev[0] = 'FUNC_EXIST'; |
|
2534 |
} |
|
2535 |
tag = 'CALL_START'; |
|
2536 |
} else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) { |
|
2537 |
tag = 'INDEX_START'; |
|
2538 |
switch (prev[0]) { |
|
2539 |
case '?': |
|
2540 |
prev[0] = 'INDEX_SOAK'; |
|
2541 |
} |
|
2542 |
} |
|
2543 |
} |
|
2544 |
switch (value) { |
|
2545 |
case '(': |
|
2546 |
case '{': |
|
2547 |
case '[': |
|
2548 |
this.ends.push(INVERSES[value]); |
|
2549 |
break; |
|
2550 |
case ')': |
|
2551 |
case '}': |
|
2552 |
case ']': |
|
2553 |
this.pair(value); |
|
2554 |
} |
|
2555 |
this.token(tag, value); |
|
2556 |
return value.length; |
|
2557 |
}; |
|
2558 |
||
2559 |
Lexer.prototype.sanitizeHeredoc = function(doc, options) { |
|
2560 |
var attempt, herecomment, indent, match, _ref2; |
|
2561 |
indent = options.indent, herecomment = options.herecomment; |
|
2562 |
if (herecomment) { |
|
2563 |
if (HEREDOC_ILLEGAL.test(doc)) { |
|
2564 |
this.error("block comment cannot contain \"*/\", starting"); |
|
2565 |
} |
|
2566 |
if (doc.indexOf('\n') <= 0) { |
|
2567 |
return doc; |
|
2568 |
} |
|
2569 |
} else { |
|
2570 |
while (match = HEREDOC_INDENT.exec(doc)) { |
|
2571 |
attempt = match[1]; |
|
2572 |
if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) { |
|
2573 |
indent = attempt; |
|
2574 |
} |
|
2575 |
} |
|
2576 |
} |
|
2577 |
if (indent) { |
|
2578 |
doc = doc.replace(RegExp("\\n" + indent, "g"), '\n'); |
|
2579 |
} |
|
2580 |
if (!herecomment) { |
|
2581 |
doc = doc.replace(/^\n/, ''); |
|
2582 |
} |
|
2583 |
return doc; |
|
2584 |
}; |
|
2585 |
||
2586 |
Lexer.prototype.tagParameters = function() { |
|
2587 |
var i, stack, tok, tokens; |
|
2588 |
if (this.tag() !== ')') { |
|
2589 |
return this; |
|
2590 |
} |
|
2591 |
stack = []; |
|
2592 |
tokens = this.tokens; |
|
2593 |
i = tokens.length; |
|
2594 |
tokens[--i][0] = 'PARAM_END'; |
|
2595 |
while (tok = tokens[--i]) { |
|
2596 |
switch (tok[0]) { |
|
2597 |
case ')': |
|
2598 |
stack.push(tok); |
|
2599 |
break; |
|
2600 |
case '(': |
|
2601 |
case 'CALL_START': |
|
2602 |
if (stack.length) { |
|
2603 |
stack.pop(); |
|
2604 |
} else if (tok[0] === '(') { |
|
2605 |
tok[0] = 'PARAM_START'; |
|
2606 |
return this; |
|
2607 |
} else { |
|
2608 |
return this; |
|
2609 |
} |
|
2610 |
} |
|
2611 |
} |
|
2612 |
return this; |
|
2613 |
}; |
|
2614 |
||
2615 |
Lexer.prototype.closeIndentation = function() { |
|
2616 |
return this.outdentToken(this.indent); |
|
2617 |
}; |
|
2618 |
||
2619 |
Lexer.prototype.balancedString = function(str, end) { |
|
2620 |
var continueCount, i, letter, match, prev, stack, _i, _ref2; |
|
2621 |
continueCount = 0; |
|
2622 |
stack = [end]; |
|
2623 |
for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) { |
|
2624 |
if (continueCount) { |
|
2625 |
--continueCount; |
|
2626 |
continue; |
|
2627 |
} |
|
2628 |
switch (letter = str.charAt(i)) { |
|
2629 |
case '\\': |
|
2630 |
++continueCount; |
|
2631 |
continue; |
|
2632 |
case end: |
|
2633 |
stack.pop(); |
|
2634 |
if (!stack.length) { |
|
2635 |
return str.slice(0, +i + 1 || 9e9); |
|
2636 |
} |
|
2637 |
end = stack[stack.length - 1]; |
|
2638 |
continue; |
|
2639 |
} |
|
2640 |
if (end === '}' && (letter === '"' || letter === "'")) { |
|
2641 |
stack.push(end = letter); |
|
2642 |
} else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) { |
|
2643 |
continueCount += match[0].length - 1; |
|
2644 |
} else if (end === '}' && letter === '{') { |
|
2645 |
stack.push(end = '}'); |
|
2646 |
} else if (end === '"' && prev === '#' && letter === '{') { |
|
2647 |
stack.push(end = '}'); |
|
2648 |
} |
|
2649 |
prev = letter; |
|
2650 |
} |
|
2651 |
return this.error("missing " + (stack.pop()) + ", starting"); |
|
2652 |
}; |
|
2653 |
||
2654 |
Lexer.prototype.interpolateString = function(str, options) { |
|
2655 |
var expr, heredoc, i, inner, interpolated, len, letter, nested, pi, regex, tag, tokens, value, _i, _len, _ref2, _ref3, _ref4; |
|
2656 |
if (options == null) { |
|
2657 |
options = {}; |
|
2658 |
} |
|
2659 |
heredoc = options.heredoc, regex = options.regex; |
|
2660 |
tokens = []; |
|
2661 |
pi = 0; |
|
2662 |
i = -1; |
|
2663 |
while (letter = str.charAt(i += 1)) { |
|
2664 |
if (letter === '\\') { |
|
2665 |
i += 1; |
|
2666 |
continue; |
|
2667 |
} |
|
2668 |
if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) { |
|
2669 |
continue; |
|
2670 |
} |
|
2671 |
if (pi < i) { |
|
2672 |
tokens.push(['NEOSTRING', str.slice(pi, i)]); |
|
2673 |
} |
|
2674 |
inner = expr.slice(1, -1); |
|
2675 |
if (inner.length) { |
|
2676 |
nested = new Lexer().tokenize(inner, { |
|
2677 |
line: this.line, |
|
2678 |
rewrite: false |
|
2679 |
}); |
|
2680 |
nested.pop(); |
|
2681 |
if (((_ref2 = nested[0]) != null ? _ref2[0] : void 0) === 'TERMINATOR') { |
|
2682 |
nested.shift(); |
|
2683 |
} |
|
2684 |
if (len = nested.length) { |
|
2685 |
if (len > 1) { |
|
2686 |
nested.unshift(['(', '(', this.line]); |
|
2687 |
nested.push([')', ')', this.line]); |
|
2688 |
} |
|
2689 |
tokens.push(['TOKENS', nested]); |
|
2690 |
} |
|
2691 |
} |
|
2692 |
i += expr.length; |
|
2693 |
pi = i + 1; |
|
2694 |
} |
|
2695 |
if ((i > pi && pi < str.length)) { |
|
2696 |
tokens.push(['NEOSTRING', str.slice(pi)]); |
|
2697 |
} |
|
2698 |
if (regex) { |
|
2699 |
return tokens; |
|
2700 |
} |
|
2701 |
if (!tokens.length) { |
|
2702 |
return this.token('STRING', '""'); |
|
2703 |
} |
|
2704 |
if (tokens[0][0] !== 'NEOSTRING') { |
|
2705 |
tokens.unshift(['', '']); |
|
2706 |
} |
|
2707 |
if (interpolated = tokens.length > 1) { |
|
2708 |
this.token('(', '('); |
|
2709 |
} |
|
2710 |
for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) { |
|
2711 |
_ref3 = tokens[i], tag = _ref3[0], value = _ref3[1]; |
|
2712 |
if (i) { |
|
2713 |
this.token('+', '+'); |
|
2714 |
} |
|
2715 |
if (tag === 'TOKENS') { |
|
2716 |
(_ref4 = this.tokens).push.apply(_ref4, value); |
|
2717 |
} else { |
|
2718 |
this.token('STRING', this.makeString(value, '"', heredoc)); |
|
2719 |
} |
|
2720 |
} |
|
2721 |
if (interpolated) { |
|
2722 |
this.token(')', ')'); |
|
2723 |
} |
|
2724 |
return tokens; |
|
2725 |
}; |
|
2726 |
||
2727 |
Lexer.prototype.pair = function(tag) { |
|
2728 |
var size, wanted; |
|
2729 |
if (tag !== (wanted = last(this.ends))) { |
|
2730 |
if ('OUTDENT' !== wanted) { |
|
2731 |
this.error("unmatched " + tag); |
|
2732 |
} |
|
2733 |
this.indent -= size = last(this.indents); |
|
2734 |
this.outdentToken(size, true); |
|
2735 |
return this.pair(tag); |
|
2736 |
} |
|
2737 |
return this.ends.pop(); |
|
2738 |
}; |
|
2739 |
||
2740 |
Lexer.prototype.token = function(tag, value) { |
|
2741 |
return this.tokens.push([tag, value, this.line]); |
|
2742 |
}; |
|
2743 |
||
2744 |
Lexer.prototype.tag = function(index, tag) { |
|
2745 |
var tok; |
|
2746 |
return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]); |
|
2747 |
}; |
|
2748 |
||
2749 |
Lexer.prototype.value = function(index, val) { |
|
2750 |
var tok; |
|
2751 |
return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]); |
|
2752 |
}; |
|
2753 |
||
2754 |
Lexer.prototype.unfinished = function() { |
|
2755 |
var _ref2; |
|
2756 |
return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS'); |
|
2757 |
}; |
|
2758 |
||
2759 |
Lexer.prototype.escapeLines = function(str, heredoc) { |
|
2760 |
return str.replace(MULTILINER, heredoc ? '\\n' : ''); |
|
2761 |
}; |
|
2762 |
||
2763 |
Lexer.prototype.makeString = function(body, quote, heredoc) { |
|
2764 |
if (!body) { |
|
2765 |
return quote + quote; |
|
2766 |
} |
|
2767 |
body = body.replace(/\\([\s\S])/g, function(match, contents) { |
|
2768 |
if (contents === '\n' || contents === quote) { |
|
2769 |
return contents; |
|
2770 |
} else { |
|
2771 |
return match; |
|
2772 |
} |
|
2773 |
}); |
|
2774 |
body = body.replace(RegExp("" + quote, "g"), '\\$&'); |
|
2775 |
return quote + this.escapeLines(body, heredoc) + quote; |
|
2776 |
}; |
|
2777 |
||
2778 |
Lexer.prototype.error = function(message) { |
|
2779 |
throw SyntaxError("" + message + " on line " + (this.line + 1)); |
|
2780 |
}; |
|
2781 |
||
2782 |
return Lexer; |
|
2783 |
||
2784 |
})(); |
|
2785 |
||
2786 |
JS_KEYWORDS = ['true', 'false', 'null', 'this', 'new', 'delete', 'typeof', 'in', 'instanceof', 'return', 'throw', 'break', 'continue', 'debugger', 'if', 'else', 'switch', 'for', 'while', 'do', 'try', 'catch', 'finally', 'class', 'extends', 'super']; |
|
2787 |
||
2788 |
COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when']; |
|
2789 |
||
2790 |
COFFEE_ALIAS_MAP = { |
|
2791 |
and: '&&', |
|
2792 |
or: '||', |
|
2793 |
is: '==', |
|
2794 |
isnt: '!=', |
|
2795 |
not: '!', |
|
2796 |
yes: 'true', |
|
2797 |
no: 'false', |
|
2798 |
on: 'true', |
|
2799 |
off: 'false' |
|
2800 |
}; |
|
2801 |
||
2802 |
COFFEE_ALIASES = (function() { |
|
2803 |
var _results; |
|
2804 |
_results = []; |
|
2805 |
for (key in COFFEE_ALIAS_MAP) { |
|
2806 |
_results.push(key); |
|
2807 |
} |
|
2808 |
return _results; |
|
2809 |
})(); |
|
2810 |
||
2811 |
COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES); |
|
2812 |
||
2813 |
RESERVED = ['case', 'default', 'function', 'var', 'void', 'with', 'const', 'let', 'enum', 'export', 'import', 'native', '__hasProp', '__extends', '__slice', '__bind', '__indexOf', 'implements', 'interface', 'package', 'private', 'protected', 'public', 'static', 'yield']; |
|
2814 |
||
2815 |
STRICT_PROSCRIBED = ['arguments', 'eval']; |
|
2816 |
||
2817 |
JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED); |
|
2818 |
||
2819 |
exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED); |
|
2820 |
||
2821 |
exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED; |
|
2822 |
||
2823 |
IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/; |
|
2824 |
||
2825 |
NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i; |
|
2826 |
||
2827 |
HEREDOC = /^("""|''')([\s\S]*?)(?:\n[^\n\S]*)?\1/; |
|
2828 |
||
2829 |
OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>])\2=?|\?\.|\.{2,3})/; |
|
2830 |
||
2831 |
WHITESPACE = /^[^\n\S]+/; |
|
2832 |
||
2833 |
COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|(?:###)?$)|^(?:\s*#(?!##[^#]).*)+/; |
|
2834 |
||
2835 |
CODE = /^[-=]>/; |
|
2836 |
||
2837 |
MULTI_DENT = /^(?:\n[^\n\S]*)+/; |
|
2838 |
||
2839 |
SIMPLESTR = /^'[^\\']*(?:\\.[^\\']*)*'/; |
|
2840 |
||
2841 |
JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/; |
|
2842 |
||
2843 |
REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/; |
|
2844 |
||
2845 |
HEREGEX = /^\/{3}([\s\S]+?)\/{3}([imgy]{0,4})(?!\w)/; |
|
2846 |
||
2847 |
HEREGEX_OMIT = /\s+(?:#.*)?/g; |
|
2848 |
||
2849 |
MULTILINER = /\n/g; |
|
2850 |
||
2851 |
HEREDOC_INDENT = /\n+([^\n\S]*)/g; |
|
2852 |
||
2853 |
HEREDOC_ILLEGAL = /\*\//; |
|
2854 |
||
2855 |
LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/; |
|
2856 |
||
2857 |
TRAILING_SPACES = /\s+$/; |
|
2858 |
||
2859 |
COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=']; |
|
2860 |
||
2861 |
UNARY = ['!', '~', 'NEW', 'TYPEOF', 'DELETE', 'DO']; |
|
2862 |
||
2863 |
LOGIC = ['&&', '||', '&', '|', '^']; |
|
2864 |
||
2865 |
SHIFT = ['<<', '>>', '>>>']; |
|
2866 |
||
2867 |
COMPARE = ['==', '!=', '<', '>', '<=', '>=']; |
|
2868 |
||
2869 |
MATH = ['*', '/', '%']; |
|
2870 |
||
2871 |
RELATION = ['IN', 'OF', 'INSTANCEOF']; |
|
2872 |
||
2873 |
BOOL = ['TRUE', 'FALSE']; |
|
2874 |
||
2875 |
NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--', ']']; |
|
2876 |
||
2877 |
NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING'); |
|
2878 |
||
2879 |
CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER']; |
|
2880 |
||
2881 |
INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED'); |
|
2882 |
||
2883 |
LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR']; |
|
2884 |
||
2885 |
||
2886 |
});
|
|
2887 |
||
2888 |
define('ace/mode/coffee/rewriter', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
2889 |
||
2890 |
var BALANCED_PAIRS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_BLOCK, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, left, rite, _i, _len, _ref, |
|
2891 |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }, |
|
2892 |
__slice = [].slice; |
|
2893 |
||
2894 |
exports.Rewriter = (function() { |
|
2895 |
||
2896 |
function Rewriter() {} |
|
2897 |
||
2898 |
Rewriter.prototype.rewrite = function(tokens) { |
|
2899 |
this.tokens = tokens; |
|
2900 |
this.removeLeadingNewlines(); |
|
2901 |
this.removeMidExpressionNewlines(); |
|
2902 |
this.closeOpenCalls(); |
|
2903 |
this.closeOpenIndexes(); |
|
2904 |
this.addImplicitIndentation(); |
|
2905 |
this.tagPostfixConditionals(); |
|
2906 |
this.addImplicitBraces(); |
|
2907 |
this.addImplicitParentheses(); |
|
2908 |
return this.tokens; |
|
2909 |
}; |
|
2910 |
||
2911 |
Rewriter.prototype.scanTokens = function(block) { |
|
2912 |
var i, token, tokens; |
|
2913 |
tokens = this.tokens; |
|
2914 |
i = 0; |
|
2915 |
while (token = tokens[i]) { |
|
2916 |
i += block.call(this, token, i, tokens); |
|
2917 |
} |
|
2918 |
return true; |
|
2919 |
}; |
|
2920 |
||
2921 |
Rewriter.prototype.detectEnd = function(i, condition, action) { |
|
2922 |
var levels, token, tokens, _ref, _ref1; |
|
2923 |
tokens = this.tokens; |
|
2924 |
levels = 0; |
|
2925 |
while (token = tokens[i]) { |
|
2926 |
if (levels === 0 && condition.call(this, token, i)) { |
|
2927 |
return action.call(this, token, i); |
|
2928 |
} |
|
2929 |
if (!token || levels < 0) { |
|
2930 |
return action.call(this, token, i - 1); |
|
2931 |
} |
|
2932 |
if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) { |
|
2933 |
levels += 1; |
|
2934 |
} else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) { |
|
2935 |
levels -= 1; |
|
2936 |
} |
|
2937 |
i += 1; |
|
2938 |
} |
|
2939 |
return i - 1; |
|
2940 |
}; |
|
2941 |
||
2942 |
Rewriter.prototype.removeLeadingNewlines = function() { |
|
2943 |
var i, tag, _i, _len, _ref; |
|
2944 |
_ref = this.tokens; |
|
2945 |
for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) { |
|
2946 |
tag = _ref[i][0]; |
|
2947 |
if (tag !== 'TERMINATOR') { |
|
2948 |
break; |
|
2949 |
} |
|
2950 |
} |
|
2951 |
if (i) { |
|
2952 |
return this.tokens.splice(0, i); |
|
2953 |
} |
|
2954 |
}; |
|
2955 |
||
2956 |
Rewriter.prototype.removeMidExpressionNewlines = function() { |
|
2957 |
return this.scanTokens(function(token, i, tokens) { |
|
2958 |
var _ref; |
|
2959 |
if (!(token[0] === 'TERMINATOR' && (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0))) { |
|
2960 |
return 1; |
|
2961 |
} |
|
2962 |
tokens.splice(i, 1); |
|
2963 |
return 0; |
|
2964 |
}); |
|
2965 |
}; |
|
2966 |
||
2967 |
Rewriter.prototype.closeOpenCalls = function() { |
|
2968 |
var action, condition; |
|
2969 |
condition = function(token, i) { |
|
2970 |
var _ref; |
|
2971 |
return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')'; |
|
2972 |
}; |
|
2973 |
action = function(token, i) { |
|
2974 |
return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END'; |
|
2975 |
}; |
|
2976 |
return this.scanTokens(function(token, i) { |
|
2977 |
if (token[0] === 'CALL_START') { |
|
2978 |
this.detectEnd(i + 1, condition, action); |
|
2979 |
} |
|
2980 |
return 1; |
|
2981 |
}); |
|
2982 |
}; |
|
2983 |
||
2984 |
Rewriter.prototype.closeOpenIndexes = function() { |
|
2985 |
var action, condition; |
|
2986 |
condition = function(token, i) { |
|
2987 |
var _ref; |
|
2988 |
return (_ref = token[0]) === ']' || _ref === 'INDEX_END'; |
|
2989 |
}; |
|
2990 |
action = function(token, i) { |
|
2991 |
return token[0] = 'INDEX_END'; |
|
2992 |
}; |
|
2993 |
return this.scanTokens(function(token, i) { |
|
2994 |
if (token[0] === 'INDEX_START') { |
|
2995 |
this.detectEnd(i + 1, condition, action); |
|
2996 |
} |
|
2997 |
return 1; |
|
2998 |
}); |
|
2999 |
}; |
|
3000 |
||
3001 |
Rewriter.prototype.addImplicitBraces = function() { |
|
3002 |
var action, condition, sameLine, stack, start, startIndent, startIndex, startsLine; |
|
3003 |
stack = []; |
|
3004 |
start = null; |
|
3005 |
startsLine = null; |
|
3006 |
sameLine = true; |
|
3007 |
startIndent = 0; |
|
3008 |
startIndex = 0; |
|
3009 |
condition = function(token, i) { |
|
3010 |
var one, tag, three, two, _ref, _ref1; |
|
3011 |
_ref = this.tokens.slice(i + 1, +(i + 3) + 1 || 9e9), one = _ref[0], two = _ref[1], three = _ref[2]; |
|
3012 |
if ('HERECOMMENT' === (one != null ? one[0] : void 0)) { |
|
3013 |
return false; |
|
3014 |
} |
|
3015 |
tag = token[0]; |
|
3016 |
if (__indexOf.call(LINEBREAKS, tag) >= 0) { |
|
3017 |
sameLine = false; |
|
3018 |
} |
|
3019 |
return (((tag === 'TERMINATOR' || tag === 'OUTDENT') || (__indexOf.call(IMPLICIT_END, tag) >= 0 && sameLine && !(i - startIndex === 1))) && ((!startsLine && this.tag(i - 1) !== ',') || !((two != null ? two[0] : void 0) === ':' || (one != null ? one[0] : void 0) === '@' && (three != null ? three[0] : void 0) === ':'))) || (tag === ',' && one && ((_ref1 = one[0]) !== 'IDENTIFIER' && _ref1 !== 'NUMBER' && _ref1 !== 'STRING' && _ref1 !== '@' && _ref1 !== 'TERMINATOR' && _ref1 !== 'OUTDENT')); |
|
3020 |
}; |
|
3021 |
action = function(token, i) { |
|
3022 |
var tok; |
|
3023 |
tok = this.generate('}', '}', token[2]); |
|
3024 |
return this.tokens.splice(i, 0, tok); |
|
3025 |
}; |
|
3026 |
return this.scanTokens(function(token, i, tokens) { |
|
3027 |
var ago, idx, prevTag, tag, tok, value, _ref, _ref1; |
|
3028 |
if (_ref = (tag = token[0]), __indexOf.call(EXPRESSION_START, _ref) >= 0) { |
|
3029 |
stack.push([(tag === 'INDENT' && this.tag(i - 1) === '{' ? '{' : tag), i]); |
|
3030 |
return 1; |
|
3031 |
} |
|
3032 |
if (__indexOf.call(EXPRESSION_END, tag) >= 0) { |
|
3033 |
start = stack.pop(); |
|
3034 |
return 1; |
|
3035 |
} |
|
3036 |
if (!(tag === ':' && ((ago = this.tag(i - 2)) === ':' || ((_ref1 = stack[stack.length - 1]) != null ? _ref1[0] : void 0) !== '{'))) { |
|
3037 |
return 1; |
|
3038 |
} |
|
3039 |
sameLine = true; |
|
3040 |
startIndex = i + 1; |
|
3041 |
stack.push(['{']); |
|
3042 |
idx = ago === '@' ? i - 2 : i - 1; |
|
3043 |
while (this.tag(idx - 2) === 'HERECOMMENT') { |
|
3044 |
idx -= 2; |
|
3045 |
} |
|
3046 |
prevTag = this.tag(idx - 1); |
|
3047 |
startsLine = !prevTag || (__indexOf.call(LINEBREAKS, prevTag) >= 0); |
|
3048 |
value = new String('{'); |
|
3049 |
value.generated = true; |
|
3050 |
tok = this.generate('{', value, token[2]); |
|
3051 |
tokens.splice(idx, 0, tok); |
|
3052 |
this.detectEnd(i + 2, condition, action); |
|
3053 |
return 2; |
|
3054 |
}); |
|
3055 |
}; |
|
3056 |
||
3057 |
Rewriter.prototype.addImplicitParentheses = function() { |
|
3058 |
var action, condition, noCall, seenControl, seenSingle; |
|
3059 |
noCall = seenSingle = seenControl = false; |
|
3060 |
condition = function(token, i) { |
|
3061 |
var post, tag, _ref, _ref1; |
|
3062 |
tag = token[0]; |
|
3063 |
if (!seenSingle && token.fromThen) { |
|
3064 |
return true; |
|
3065 |
} |
|
3066 |
if (tag === 'IF' || tag === 'ELSE' || tag === 'CATCH' || tag === '->' || tag === '=>' || tag === 'CLASS') { |
|
3067 |
seenSingle = true; |
|
3068 |
} |
|
3069 |
if (tag === 'IF' || tag === 'ELSE' || tag === 'SWITCH' || tag === 'TRY' || tag === '=') { |
|
3070 |
seenControl = true; |
|
3071 |
} |
|
3072 |
if ((tag === '.' || tag === '?.' || tag === '::') && this.tag(i - 1) === 'OUTDENT') { |
|
3073 |
return true; |
|
3074 |
} |
|
3075 |
return !token.generated && this.tag(i - 1) !== ',' && (__indexOf.call(IMPLICIT_END, tag) >= 0 || (tag === 'INDENT' && !seenControl)) && (tag !== 'INDENT' || (((_ref = this.tag(i - 2)) !== 'CLASS' && _ref !== 'EXTENDS') && (_ref1 = this.tag(i - 1), __indexOf.call(IMPLICIT_BLOCK, _ref1) < 0) && !((post = this.tokens[i + 1]) && post.generated && post[0] === '{'))); |
|
3076 |
}; |
|
3077 |
action = function(token, i) { |
|
3078 |
return this.tokens.splice(i, 0, this.generate('CALL_END', ')', token[2])); |
|
3079 |
}; |
|
3080 |
return this.scanTokens(function(token, i, tokens) { |
|
3081 |
var callObject, current, next, prev, tag, _ref, _ref1, _ref2; |
|
3082 |
tag = token[0]; |
|
3083 |
if (tag === 'CLASS' || tag === 'IF' || tag === 'FOR' || tag === 'WHILE') { |
|
3084 |
noCall = true; |
|
3085 |
} |
|
3086 |
_ref = tokens.slice(i - 1, +(i + 1) + 1 || 9e9), prev = _ref[0], current = _ref[1], next = _ref[2]; |
|
3087 |
callObject = !noCall && tag === 'INDENT' && next && next.generated && next[0] === '{' && prev && (_ref1 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref1) >= 0); |
|
3088 |
seenSingle = false; |
|
3089 |
seenControl = false; |
|
3090 |
if (__indexOf.call(LINEBREAKS, tag) >= 0) { |
|
3091 |
noCall = false; |
|
3092 |
} |
|
3093 |
if (prev && !prev.spaced && tag === '?') { |
|
3094 |
token.call = true; |
|
3095 |
} |
|
3096 |
if (token.fromThen) { |
|
3097 |
return 1; |
|
3098 |
} |
|
3099 |
if (!(callObject || (prev != null ? prev.spaced : void 0) && (prev.call || (_ref2 = prev[0], __indexOf.call(IMPLICIT_FUNC, _ref2) >= 0)) && (__indexOf.call(IMPLICIT_CALL, tag) >= 0 || !(token.spaced || token.newLine) && __indexOf.call(IMPLICIT_UNSPACED_CALL, tag) >= 0))) { |
|
3100 |
return 1; |
|
3101 |
} |
|
3102 |
tokens.splice(i, 0, this.generate('CALL_START', '(', token[2])); |
|
3103 |
this.detectEnd(i + 1, condition, action); |
|
3104 |
if (prev[0] === '?') { |
|
3105 |
prev[0] = 'FUNC_EXIST'; |
|
3106 |
} |
|
3107 |
return 2; |
|
3108 |
}); |
|
3109 |
}; |
|
3110 |
||
3111 |
Rewriter.prototype.addImplicitIndentation = function() { |
|
3112 |
var action, condition, indent, outdent, starter; |
|
3113 |
starter = indent = outdent = null; |
|
3114 |
condition = function(token, i) { |
|
3115 |
var _ref; |
|
3116 |
return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'ELSE' && (starter !== 'IF' && starter !== 'THEN')); |
|
3117 |
}; |
|
3118 |
action = function(token, i) { |
|
3119 |
return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent); |
|
3120 |
}; |
|
3121 |
return this.scanTokens(function(token, i, tokens) { |
|
3122 |
var tag, _ref, _ref1; |
|
3123 |
tag = token[0]; |
|
3124 |
if (tag === 'TERMINATOR' && this.tag(i + 1) === 'THEN') { |
|
3125 |
tokens.splice(i, 1); |
|
3126 |
return 0; |
|
3127 |
} |
|
3128 |
if (tag === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') { |
|
3129 |
tokens.splice.apply(tokens, [i, 0].concat(__slice.call(this.indentation(token)))); |
|
3130 |
return 2; |
|
3131 |
} |
|
3132 |
if (tag === 'CATCH' && ((_ref = this.tag(i + 2)) === 'OUTDENT' || _ref === 'TERMINATOR' || _ref === 'FINALLY')) { |
|
3133 |
tokens.splice.apply(tokens, [i + 2, 0].concat(__slice.call(this.indentation(token)))); |
|
3134 |
return 4; |
|
3135 |
} |
|
3136 |
if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) { |
|
3137 |
starter = tag; |
|
3138 |
_ref1 = this.indentation(token, true), indent = _ref1[0], outdent = _ref1[1]; |
|
3139 |
if (starter === 'THEN') { |
|
3140 |
indent.fromThen = true; |
|
3141 |
} |
|
3142 |
tokens.splice(i + 1, 0, indent); |
|
3143 |
this.detectEnd(i + 2, condition, action); |
|
3144 |
if (tag === 'THEN') { |
|
3145 |
tokens.splice(i, 1); |
|
3146 |
} |
|
3147 |
return 1; |
|
3148 |
} |
|
3149 |
return 1; |
|
3150 |
}); |
|
3151 |
}; |
|
3152 |
||
3153 |
Rewriter.prototype.tagPostfixConditionals = function() { |
|
3154 |
var action, condition, original; |
|
3155 |
original = null; |
|
3156 |
condition = function(token, i) { |
|
3157 |
var _ref; |
|
3158 |
return (_ref = token[0]) === 'TERMINATOR' || _ref === 'INDENT'; |
|
3159 |
}; |
|
3160 |
action = function(token, i) { |
|
3161 |
if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) { |
|
3162 |
return original[0] = 'POST_' + original[0]; |
|
3163 |
} |
|
3164 |
}; |
|
3165 |
return this.scanTokens(function(token, i) { |
|
3166 |
if (token[0] !== 'IF') { |
|
3167 |
return 1; |
|
3168 |
} |
|
3169 |
original = token; |
|
3170 |
this.detectEnd(i + 1, condition, action); |
|
3171 |
return 1; |
|
3172 |
}); |
|
3173 |
}; |
|
3174 |
||
3175 |
Rewriter.prototype.indentation = function(token, implicit) { |
|
3176 |
var indent, outdent; |
|
3177 |
if (implicit == null) { |
|
3178 |
implicit = false; |
|
3179 |
} |
|
3180 |
indent = ['INDENT', 2, token[2]]; |
|
3181 |
outdent = ['OUTDENT', 2, token[2]]; |
|
3182 |
if (implicit) { |
|
3183 |
indent.generated = outdent.generated = true; |
|
3184 |
} |
|
3185 |
return [indent, outdent]; |
|
3186 |
}; |
|
3187 |
||
3188 |
Rewriter.prototype.generate = function(tag, value, line) { |
|
3189 |
var tok; |
|
3190 |
tok = [tag, value, line]; |
|
3191 |
tok.generated = true; |
|
3192 |
return tok; |
|
3193 |
}; |
|
3194 |
||
3195 |
Rewriter.prototype.tag = function(i) { |
|
3196 |
var _ref; |
|
3197 |
return (_ref = this.tokens[i]) != null ? _ref[0] : void 0; |
|
3198 |
}; |
|
3199 |
||
3200 |
return Rewriter; |
|
3201 |
||
3202 |
})(); |
|
3203 |
||
3204 |
BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']]; |
|
3205 |
||
3206 |
exports.INVERSES = INVERSES = {}; |
|
3207 |
||
3208 |
EXPRESSION_START = []; |
|
3209 |
||
3210 |
EXPRESSION_END = []; |
|
3211 |
||
3212 |
for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) { |
|
3213 |
_ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1]; |
|
3214 |
EXPRESSION_START.push(INVERSES[rite] = left); |
|
3215 |
EXPRESSION_END.push(INVERSES[left] = rite); |
|
3216 |
} |
|
3217 |
||
3218 |
EXPRESSION_CLOSE = ['CATCH', 'WHEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END); |
|
3219 |
||
3220 |
IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS']; |
|
3221 |
||
3222 |
IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'SUPER', '@', '->', '=>', '[', '(', '{', '--', '++']; |
|
3223 |
||
3224 |
IMPLICIT_UNSPACED_CALL = ['+', '-']; |
|
3225 |
||
3226 |
IMPLICIT_BLOCK = ['->', '=>', '{', '[', ',']; |
|
3227 |
||
3228 |
IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR']; |
|
3229 |
||
3230 |
SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN']; |
|
3231 |
||
3232 |
SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN']; |
|
3233 |
||
3234 |
LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT']; |
|
3235 |
||
3236 |
||
3237 |
});
|
|
3238 |
||
3239 |
define('ace/mode/coffee/helpers', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
3240 |
||
3241 |
var extend, flatten, _ref; |
|
3242 |
||
3243 |
exports.starts = function(string, literal, start) { |
|
3244 |
return literal === string.substr(start, literal.length); |
|
3245 |
}; |
|
3246 |
||
3247 |
exports.ends = function(string, literal, back) { |
|
3248 |
var len; |
|
3249 |
len = literal.length; |
|
3250 |
return literal === string.substr(string.length - len - (back || 0), len); |
|
3251 |
}; |
|
3252 |
||
3253 |
exports.compact = function(array) { |
|
3254 |
var item, _i, _len, _results; |
|
3255 |
_results = []; |
|
3256 |
for (_i = 0, _len = array.length; _i < _len; _i++) { |
|
3257 |
item = array[_i]; |
|
3258 |
if (item) { |
|
3259 |
_results.push(item); |
|
3260 |
} |
|
3261 |
} |
|
3262 |
return _results; |
|
3263 |
}; |
|
3264 |
||
3265 |
exports.count = function(string, substr) { |
|
3266 |
var num, pos; |
|
3267 |
num = pos = 0; |
|
3268 |
if (!substr.length) { |
|
3269 |
return 1 / 0; |
|
3270 |
} |
|
3271 |
while (pos = 1 + string.indexOf(substr, pos)) { |
|
3272 |
num++; |
|
3273 |
} |
|
3274 |
return num; |
|
3275 |
}; |
|
3276 |
||
3277 |
exports.merge = function(options, overrides) { |
|
3278 |
return extend(extend({}, options), overrides); |
|
3279 |
}; |
|
3280 |
||
3281 |
extend = exports.extend = function(object, properties) { |
|
3282 |
var key, val; |
|
3283 |
for (key in properties) { |
|
3284 |
val = properties[key]; |
|
3285 |
object[key] = val; |
|
3286 |
} |
|
3287 |
return object; |
|
3288 |
}; |
|
3289 |
||
3290 |
exports.flatten = flatten = function(array) { |
|
3291 |
var element, flattened, _i, _len; |
|
3292 |
flattened = []; |
|
3293 |
for (_i = 0, _len = array.length; _i < _len; _i++) { |
|
3294 |
element = array[_i]; |
|
3295 |
if (element instanceof Array) { |
|
3296 |
flattened = flattened.concat(flatten(element)); |
|
3297 |
} else { |
|
3298 |
flattened.push(element); |
|
3299 |
} |
|
3300 |
} |
|
3301 |
return flattened; |
|
3302 |
}; |
|
3303 |
||
3304 |
exports.del = function(obj, key) { |
|
3305 |
var val; |
|
3306 |
val = obj[key]; |
|
3307 |
delete obj[key]; |
|
3308 |
return val; |
|
3309 |
}; |
|
3310 |
||
3311 |
exports.last = function(array, back) { |
|
3312 |
return array[array.length - (back || 0) - 1]; |
|
3313 |
}; |
|
3314 |
||
3315 |
exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) { |
|
3316 |
var e, _i, _len; |
|
3317 |
for (_i = 0, _len = this.length; _i < _len; _i++) { |
|
3318 |
e = this[_i]; |
|
3319 |
if (fn(e)) { |
|
3320 |
return true; |
|
3321 |
} |
|
3322 |
} |
|
3323 |
return false; |
|
3324 |
}; |
|
3325 |
||
3326 |
||
3327 |
});
|
|
3328 |
||
3329 |
define('ace/mode/coffee/parser', ['require', 'exports', 'module' ], function(require, exports, module) { |
|
3330 |
||
3331 |
var parser = {trace: function trace() { }, |
|
3332 |
yy: {}, |
|
3333 |
symbols_: {"error":2,"Root":3,"Body":4,"Block":5,"TERMINATOR":6,"Line":7,"Expression":8,"Statement":9,"Return":10,"Comment":11,"STATEMENT":12,"Value":13,"Invocation":14,"Code":15,"Operation":16,"Assign":17,"If":18,"Try":19,"While":20,"For":21,"Switch":22,"Class":23,"Throw":24,"INDENT":25,"OUTDENT":26,"Identifier":27,"IDENTIFIER":28,"AlphaNumeric":29,"NUMBER":30,"STRING":31,"Literal":32,"JS":33,"REGEX":34,"DEBUGGER":35,"UNDEFINED":36,"NULL":37,"BOOL":38,"Assignable":39,"=":40,"AssignObj":41,"ObjAssignable":42,":":43,"ThisProperty":44,"RETURN":45,"HERECOMMENT":46,"PARAM_START":47,"ParamList":48,"PARAM_END":49,"FuncGlyph":50,"->":51,"=>":52,"OptComma":53,",":54,"Param":55,"ParamVar":56,"...":57,"Array":58,"Object":59,"Splat":60,"SimpleAssignable":61,"Accessor":62,"Parenthetical":63,"Range":64,"This":65,".":66,"?.":67,"::":68,"Index":69,"INDEX_START":70,"IndexValue":71,"INDEX_END":72,"INDEX_SOAK":73,"Slice":74,"{":75,"AssignList":76,"}":77,"CLASS":78,"EXTENDS":79,"OptFuncExist":80,"Arguments":81,"SUPER":82,"FUNC_EXIST":83,"CALL_START":84,"CALL_END":85,"ArgList":86,"THIS":87,"@":88,"[":89,"]":90,"RangeDots":91,"..":92,"Arg":93,"SimpleArgs":94,"TRY":95,"Catch":96,"FINALLY":97,"CATCH":98,"THROW":99,"(":100,")":101,"WhileSource":102,"WHILE":103,"WHEN":104,"UNTIL":105,"Loop":106,"LOOP":107,"ForBody":108,"FOR":109,"ForStart":110,"ForSource":111,"ForVariables":112,"OWN":113,"ForValue":114,"FORIN":115,"FOROF":116,"BY":117,"SWITCH":118,"Whens":119,"ELSE":120,"When":121,"LEADING_WHEN":122,"IfBlock":123,"IF":124,"POST_IF":125,"UNARY":126,"-":127,"+":128,"--":129,"++":130,"?":131,"MATH":132,"SHIFT":133,"COMPARE":134,"LOGIC":135,"RELATION":136,"COMPOUND_ASSIGN":137,"$accept":0,"$end":1}, |
|
3334 |
terminals_: {2:"error",6:"TERMINATOR",12:"STATEMENT",25:"INDENT",26:"OUTDENT",28:"IDENTIFIER",30:"NUMBER",31:"STRING",33:"JS",34:"REGEX",35:"DEBUGGER",36:"UNDEFINED",37:"NULL",38:"BOOL",40:"=",43:":",45:"RETURN",46:"HERECOMMENT",47:"PARAM_START",49:"PARAM_END",51:"->",52:"=>",54:",",57:"...",66:".",67:"?.",68:"::",70:"INDEX_START",72:"INDEX_END",73:"INDEX_SOAK",75:"{",77:"}",78:"CLASS",79:"EXTENDS",82:"SUPER",83:"FUNC_EXIST",84:"CALL_START",85:"CALL_END",87:"THIS",88:"@",89:"[",90:"]",92:"..",95:"TRY",97:"FINALLY",98:"CATCH",99:"THROW",100:"(",101:")",103:"WHILE",104:"WHEN",105:"UNTIL",107:"LOOP",109:"FOR",113:"OWN",115:"FORIN",116:"FOROF",117:"BY",118:"SWITCH",120:"ELSE",122:"LEADING_WHEN",124:"IF",125:"POST_IF",126:"UNARY",127:"-",128:"+",129:"--",130:"++",131:"?",132:"MATH",133:"SHIFT",134:"COMPARE",135:"LOGIC",136:"RELATION",137:"COMPOUND_ASSIGN"}, |
|
3335 |
productions_: [0,[3,0],[3,1],[3,2],[4,1],[4,3],[4,2],[7,1],[7,1],[9,1],[9,1],[9,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[8,1],[5,2],[5,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[17,3],[17,4],[17,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[10,2],[10,1],[11,1],[15,5],[15,2],[50,1],[50,1],[53,0],[53,1],[48,0],[48,1],[48,3],[48,4],[48,6],[55,1],[55,2],[55,3],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[13,1],[13,1],[13,1],[13,1],[13,1],[62,2],[62,2],[62,2],[62,1],[62,1],[69,3],[69,2],[71,1],[71,1],[59,4],[76,0],[76,1],[76,3],[76,4],[76,6],[23,1],[23,2],[23,3],[23,4],[23,2],[23,3],[23,4],[23,5],[14,3],[14,3],[14,1],[14,2],[80,0],[80,1],[81,2],[81,4],[65,1],[65,1],[44,2],[58,2],[58,4],[91,1],[91,1],[64,5],[74,3],[74,2],[74,2],[74,1],[86,1],[86,3],[86,4],[86,4],[86,6],[93,1],[93,1],[94,1],[94,3],[19,2],[19,3],[19,4],[19,5],[96,3],[24,2],[63,3],[63,5],[102,2],[102,4],[102,2],[102,4],[20,2],[20,2],[20,2],[20,1],[106,2],[106,2],[21,2],[21,2],[21,2],[108,2],[108,2],[110,2],[110,3],[114,1],[114,1],[114,1],[114,1],[112,1],[112,3],[111,2],[111,2],[111,4],[111,4],[111,4],[111,6],[111,6],[22,5],[22,7],[22,4],[22,6],[119,1],[119,2],[121,3],[121,4],[123,3],[123,5],[18,1],[18,3],[18,3],[18,3],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,2],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,3],[16,5],[16,3]], |
|
3336 |
performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) { |
|
3337 |
||
3338 |
var $0 = $$.length - 1; |
|
3339 |
switch (yystate) { |
|
3340 |
case 1:return this.$ = new yy.Block; |
|
3341 |
break; |
|
3342 |
case 2:return this.$ = $$[$0]; |
|
3343 |
break; |
|
3344 |
case 3:return this.$ = $$[$0-1]; |
|
3345 |
break; |
|
3346 |
case 4:this.$ = yy.Block.wrap([$$[$0]]); |
|
3347 |
break; |
|
3348 |
case 5:this.$ = $$[$0-2].push($$[$0]); |
|
3349 |
break; |
|
3350 |
case 6:this.$ = $$[$0-1]; |
|
3351 |
break; |
|
3352 |
case 7:this.$ = $$[$0]; |
|
3353 |
break; |
|
3354 |
case 8:this.$ = $$[$0]; |
|
3355 |
break; |
|
3356 |
case 9:this.$ = $$[$0]; |
|
3357 |
break; |
|
3358 |
case 10:this.$ = $$[$0]; |
|
3359 |
break; |
|
3360 |
case 11:this.$ = new yy.Literal($$[$0]); |
|
3361 |
break; |
|
3362 |
case 12:this.$ = $$[$0]; |
|
3363 |
break; |
|
3364 |
case 13:this.$ = $$[$0]; |
|
3365 |
break; |
|
3366 |
case 14:this.$ = $$[$0]; |
|
3367 |
break; |
|
3368 |
case 15:this.$ = $$[$0]; |
|
3369 |
break; |
|
3370 |
case 16:this.$ = $$[$0]; |
|
3371 |
break; |
|
3372 |
case 17:this.$ = $$[$0]; |
|
3373 |
break; |
|
3374 |
case 18:this.$ = $$[$0]; |
|
3375 |
break; |
|
3376 |
case 19:this.$ = $$[$0]; |
|
3377 |
break; |
|
3378 |
case 20:this.$ = $$[$0]; |
|
3379 |
break; |
|
3380 |
case 21:this.$ = $$[$0]; |
|
3381 |
break; |
|
3382 |
case 22:this.$ = $$[$0]; |
|
3383 |
break; |
|
3384 |
case 23:this.$ = $$[$0]; |
|
3385 |
break; |
|
3386 |
case 24:this.$ = new yy.Block; |
|
3387 |
break; |
|
3388 |
case 25:this.$ = $$[$0-1]; |
|
3389 |
break; |
|
3390 |
case 26:this.$ = new yy.Literal($$[$0]); |
|
3391 |
break; |
|
3392 |
case 27:this.$ = new yy.Literal($$[$0]); |
|
3393 |
break; |
|
3394 |
case 28:this.$ = new yy.Literal($$[$0]); |
|
3395 |
break; |
|
3396 |
case 29:this.$ = $$[$0]; |
|
3397 |
break; |
|
3398 |
case 30:this.$ = new yy.Literal($$[$0]); |
|
3399 |
break; |
|
3400 |
case 31:this.$ = new yy.Literal($$[$0]); |
|
3401 |
break; |
|
3402 |
case 32:this.$ = new yy.Literal($$[$0]); |
|
3403 |
break; |
|
3404 |
case 33:this.$ = new yy.Undefined; |
|
3405 |
break; |
|
3406 |
case 34:this.$ = new yy.Null; |
|
3407 |
break; |
|
3408 |
case 35:this.$ = new yy.Bool($$[$0]); |
|
3409 |
break; |
|
3410 |
case 36:this.$ = new yy.Assign($$[$0-2], $$[$0]); |
|
3411 |
break; |
|
3412 |
case 37:this.$ = new yy.Assign($$[$0-3], $$[$0]); |
|
3413 |
break; |
|
3414 |
case 38:this.$ = new yy.Assign($$[$0-4], $$[$0-1]); |
|
3415 |
break; |
|
3416 |
case 39:this.$ = new yy.Value($$[$0]); |
|
3417 |
break; |
|
3418 |
case 40:this.$ = new yy.Assign(new yy.Value($$[$0-2]), $$[$0], 'object'); |
|
3419 |
break; |
|
3420 |
case 41:this.$ = new yy.Assign(new yy.Value($$[$0-4]), $$[$0-1], 'object'); |
|
3421 |
break; |
|
3422 |
case 42:this.$ = $$[$0]; |
|
3423 |
break; |
|
3424 |
case 43:this.$ = $$[$0]; |
|
3425 |
break; |
|
3426 |
case 44:this.$ = $$[$0]; |
|
3427 |
break; |
|
3428 |
case 45:this.$ = $$[$0]; |
|
3429 |
break; |
|
3430 |
case 46:this.$ = new yy.Return($$[$0]); |
|
3431 |
break; |
|
3432 |
case 47:this.$ = new yy.Return; |
|
3433 |
break; |
|
3434 |
case 48:this.$ = new yy.Comment($$[$0]); |
|
3435 |
break; |
|
3436 |
case 49:this.$ = new yy.Code($$[$0-3], $$[$0], $$[$0-1]); |
|
3437 |
break; |
|
3438 |
case 50:this.$ = new yy.Code([], $$[$0], $$[$0-1]); |
|
3439 |
break; |
|
3440 |
case 51:this.$ = 'func'; |
|
3441 |
break; |
|
3442 |
case 52:this.$ = 'boundfunc'; |
|
3443 |
break; |
|
3444 |
case 53:this.$ = $$[$0]; |
|
3445 |
break; |
|
3446 |
case 54:this.$ = $$[$0]; |
|
3447 |
break; |
|
3448 |
case 55:this.$ = []; |
|
3449 |
break; |
|
3450 |
case 56:this.$ = [$$[$0]]; |
|
3451 |
break; |
|
3452 |
case 57:this.$ = $$[$0-2].concat($$[$0]); |
|
3453 |
break; |
|
3454 |
case 58:this.$ = $$[$0-3].concat($$[$0]); |
|
3455 |
break; |
|
3456 |
case 59:this.$ = $$[$0-5].concat($$[$0-2]); |
|
3457 |
break; |
|
3458 |
case 60:this.$ = new yy.Param($$[$0]); |
|
3459 |
break; |
|
3460 |
case 61:this.$ = new yy.Param($$[$0-1], null, true); |
|
3461 |
break; |
|
3462 |
case 62:this.$ = new yy.Param($$[$0-2], $$[$0]); |
|
3463 |
break; |
|
3464 |
case 63:this.$ = $$[$0]; |
|
3465 |
break; |
|
3466 |
case 64:this.$ = $$[$0]; |
|
3467 |
break; |
|
3468 |
case 65:this.$ = $$[$0]; |
|
3469 |
break; |
|
3470 |
case 66:this.$ = $$[$0]; |
|
3471 |
break; |
|
3472 |
case 67:this.$ = new yy.Splat($$[$0-1]); |
|
3473 |
break; |
|
3474 |
case 68:this.$ = new yy.Value($$[$0]); |
|
3475 |
break; |
|
3476 |
case 69:this.$ = $$[$0-1].add($$[$0]); |
|
3477 |
break; |
|
3478 |
case 70:this.$ = new yy.Value($$[$0-1], [].concat($$[$0])); |
|
3479 |
break; |
|
3480 |
case 71:this.$ = $$[$0]; |
|
3481 |
break; |
|
3482 |
case 72:this.$ = $$[$0]; |
|
3483 |
break; |
|
3484 |
case 73:this.$ = new yy.Value($$[$0]); |
|
3485 |
break; |
|
3486 |
case 74:this.$ = new yy.Value($$[$0]); |
|
3487 |
break; |
|
3488 |
case 75:this.$ = $$[$0]; |
|
3489 |
break; |
|
3490 |
case 76:this.$ = new yy.Value($$[$0]); |
|
3491 |
break; |
|
3492 |
case 77:this.$ = new yy.Value($$[$0]); |
|
3493 |
break; |
|
3494 |
case 78:this.$ = new yy.Value($$[$0]); |
|
3495 |
break; |
|
3496 |
case 79:this.$ = $$[$0]; |
|
3497 |
break; |
|
3498 |
case 80:this.$ = new yy.Access($$[$0]); |
|
3499 |
break; |
|
3500 |
case 81:this.$ = new yy.Access($$[$0], 'soak'); |
|
3501 |
break; |
|
3502 |
case 82:this.$ = [new yy.Access(new yy.Literal('prototype')), new yy.Access($$[$0])]; |
|
3503 |
break; |
|
3504 |
case 83:this.$ = new yy.Access(new yy.Literal('prototype')); |
|
3505 |
break; |
|
3506 |
case 84:this.$ = $$[$0]; |
|
3507 |
break; |
|
3508 |
case 85:this.$ = $$[$0-1]; |
|
3509 |
break; |
|
3510 |
case 86:this.$ = yy.extend($$[$0], { |
|
3511 |
soak: true |
|
3512 |
}); |
|
3513 |
break; |
|
3514 |
case 87:this.$ = new yy.Index($$[$0]); |
|
3515 |
break; |
|
3516 |
case 88:this.$ = new yy.Slice($$[$0]); |
|
3517 |
break; |
|
3518 |
case 89:this.$ = new yy.Obj($$[$0-2], $$[$0-3].generated); |
|
3519 |
break; |
|
3520 |
case 90:this.$ = []; |
|
3521 |
break; |
|
3522 |
case 91:this.$ = [$$[$0]]; |
|
3523 |
break; |
|
3524 |
case 92:this.$ = $$[$0-2].concat($$[$0]); |
|
3525 |
break; |
|
3526 |
case 93:this.$ = $$[$0-3].concat($$[$0]); |
|
3527 |
break; |
|
3528 |
case 94:this.$ = $$[$0-5].concat($$[$0-2]); |
|
3529 |
break; |
|
3530 |
case 95:this.$ = new yy.Class; |
|
3531 |
break; |
|
3532 |
case 96:this.$ = new yy.Class(null, null, $$[$0]); |
|
3533 |
break; |
|
3534 |
case 97:this.$ = new yy.Class(null, $$[$0]); |
|
3535 |
break; |
|
3536 |
case 98:this.$ = new yy.Class(null, $$[$0-1], $$[$0]); |
|
3537 |
break; |
|
3538 |
case 99:this.$ = new yy.Class($$[$0]); |
|
3539 |
break; |
|
3540 |
case 100:this.$ = new yy.Class($$[$0-1], null, $$[$0]); |
|
3541 |
break; |
|
3542 |
case 101:this.$ = new yy.Class($$[$0-2], $$[$0]); |
|
3543 |
break; |
|
3544 |
case 102:this.$ = new yy.Class($$[$0-3], $$[$0-1], $$[$0]); |
|
3545 |
break; |
|
3546 |
case 103:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); |
|
3547 |
break; |
|
3548 |
case 104:this.$ = new yy.Call($$[$0-2], $$[$0], $$[$0-1]); |
|
3549 |
break; |
|
3550 |
case 105:this.$ = new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]); |
|
3551 |
break; |
|
3552 |
case 106:this.$ = new yy.Call('super', $$[$0]); |
|
3553 |
break; |
|
3554 |
case 107:this.$ = false; |
|
3555 |
break; |
|
3556 |
case 108:this.$ = true; |
|
3557 |
break; |
|
3558 |
case 109:this.$ = []; |
|
3559 |
break; |
|
3560 |
case 110:this.$ = $$[$0-2]; |
|
3561 |
break; |
|
3562 |
case 111:this.$ = new yy.Value(new yy.Literal('this')); |
|
3563 |
break; |
|
3564 |
case 112:this.$ = new yy.Value(new yy.Literal('this')); |
|
3565 |
break; |
|
3566 |
case 113:this.$ = new yy.Value(new yy.Literal('this'), [new yy.Access($$[$0])], 'this'); |
|
3567 |
break; |
|
3568 |
case 114:this.$ = new yy.Arr([]); |
|
3569 |
break; |
|
3570 |
case 115:this.$ = new yy.Arr($$[$0-2]); |
|
3571 |
break; |
|
3572 |
case 116:this.$ = 'inclusive'; |
|
3573 |
break; |
|
3574 |
case 117:this.$ = 'exclusive'; |
|
3575 |
break; |
|
3576 |
case 118:this.$ = new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]); |
|
3577 |
break; |
|
3578 |
case 119:this.$ = new yy.Range($$[$0-2], $$[$0], $$[$0-1]); |
|
3579 |
break; |
|
3580 |
case 120:this.$ = new yy.Range($$[$0-1], null, $$[$0]); |
|
3581 |
break; |
|
3582 |
case 121:this.$ = new yy.Range(null, $$[$0], $$[$0-1]); |
|
3583 |
break; |
|
3584 |
case 122:this.$ = new yy.Range(null, null, $$[$0]); |
|
3585 |
break; |
|
3586 |
case 123:this.$ = [$$[$0]]; |
|
3587 |
break; |
|
3588 |
case 124:this.$ = $$[$0-2].concat($$[$0]); |
|
3589 |
break; |
|
3590 |
case 125:this.$ = $$[$0-3].concat($$[$0]); |
|
3591 |
break; |
|
3592 |
case 126:this.$ = $$[$0-2]; |
|
3593 |
break; |
|
3594 |
case 127:this.$ = $$[$0-5].concat($$[$0-2]); |
|
3595 |
break; |
|
3596 |
case 128:this.$ = $$[$0]; |
|
3597 |
break; |
|
3598 |
case 129:this.$ = $$[$0]; |
|
3599 |
break; |
|
3600 |
case 130:this.$ = $$[$0]; |
|
3601 |
break; |
|
3602 |
case 131:this.$ = [].concat($$[$0-2], $$[$0]); |
|
3603 |
break; |
|
3604 |
case 132:this.$ = new yy.Try($$[$0]); |
|
3605 |
break; |
|
3606 |
case 133:this.$ = new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]); |
|
3607 |
break; |
|
3608 |
case 134:this.$ = new yy.Try($$[$0-2], null, null, $$[$0]); |
|
3609 |
break; |
|
3610 |
case 135:this.$ = new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]); |
|
3611 |
break; |
|
3612 |
case 136:this.$ = [$$[$0-1], $$[$0]]; |
|
3613 |
break; |
|
3614 |
case 137:this.$ = new yy.Throw($$[$0]); |
|
3615 |
break; |
|
3616 |
case 138:this.$ = new yy.Parens($$[$0-1]); |
|
3617 |
break; |
|
3618 |
case 139:this.$ = new yy.Parens($$[$0-2]); |
|
3619 |
break; |
|
3620 |
case 140:this.$ = new yy.While($$[$0]); |
|
3621 |
break; |
|
3622 |
case 141:this.$ = new yy.While($$[$0-2], { |
|
3623 |
guard: $$[$0] |
|
3624 |
}); |
|
3625 |
break; |
|
3626 |
case 142:this.$ = new yy.While($$[$0], { |
|
3627 |
invert: true |
|
3628 |
}); |
|
3629 |
break; |
|
3630 |
case 143:this.$ = new yy.While($$[$0-2], { |
|
3631 |
invert: true, |
|
3632 |
guard: $$[$0] |
|
3633 |
}); |
|
3634 |
break; |
|
3635 |
case 144:this.$ = $$[$0-1].addBody($$[$0]); |
|
3636 |
break; |
|
3637 |
case 145:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); |
|
3638 |
break; |
|
3639 |
case 146:this.$ = $$[$0].addBody(yy.Block.wrap([$$[$0-1]])); |
|
3640 |
break; |
|
3641 |
case 147:this.$ = $$[$0]; |
|
3642 |
break; |
|
3643 |
case 148:this.$ = new yy.While(new yy.Literal('true')).addBody($$[$0]); |
|
3644 |
break; |
|
3645 |
case 149:this.$ = new yy.While(new yy.Literal('true')).addBody(yy.Block.wrap([$$[$0]])); |
|
3646 |
break; |
|
3647 |
case 150:this.$ = new yy.For($$[$0-1], $$[$0]); |
|
3648 |
break; |
|
3649 |
case 151:this.$ = new yy.For($$[$0-1], $$[$0]); |
|
3650 |
break; |
|
3651 |
case 152:this.$ = new yy.For($$[$0], $$[$0-1]); |
|
3652 |
break; |
|
3653 |
case 153:this.$ = { |
|
3654 |
source: new yy.Value($$[$0]) |
|
3655 |
}; |
|
3656 |
break; |
|
3657 |
case 154:this.$ = (function () { |
|
3658 |
$$[$0].own = $$[$0-1].own; |
|
3659 |
$$[$0].name = $$[$0-1][0]; |
|
3660 |
$$[$0].index = $$[$0-1][1]; |
|
3661 |
return $$[$0]; |
|
3662 |
}()); |
|
3663 |
break; |
|
3664 |
case 155:this.$ = $$[$0]; |
|
3665 |
break; |
|
3666 |
case 156:this.$ = (function () { |
|
3667 |
$$[$0].own = true; |
|
3668 |
return $$[$0]; |
|
3669 |
}()); |
|
3670 |
break; |
|
3671 |
case 157:this.$ = $$[$0]; |
|
3672 |
break; |
|
3673 |
case 158:this.$ = $$[$0]; |
|
3674 |
break; |
|
3675 |
case 159:this.$ = new yy.Value($$[$0]); |
|
3676 |
break; |
|
3677 |
case 160:this.$ = new yy.Value($$[$0]); |
|
3678 |
break; |
|
3679 |
case 161:this.$ = [$$[$0]]; |
|
3680 |
break; |
|
3681 |
case 162:this.$ = [$$[$0-2], $$[$0]]; |
|
3682 |
break; |
|
3683 |
case 163:this.$ = { |
|
3684 |
source: $$[$0] |
|
3685 |
}; |
|
3686 |
break; |
|
3687 |
case 164:this.$ = { |
|
3688 |
source: $$[$0], |
|
3689 |
object: true |
|
3690 |
}; |
|
3691 |
break; |
|
3692 |
case 165:this.$ = { |
|
3693 |
source: $$[$0-2], |
|
3694 |
guard: $$[$0] |
|
3695 |
}; |
|
3696 |
break; |
|
3697 |
case 166:this.$ = { |
|
3698 |
source: $$[$0-2], |
|
3699 |
guard: $$[$0], |
|
3700 |
object: true |
|
3701 |
}; |
|
3702 |
break; |
|
3703 |
case 167:this.$ = { |
|
3704 |
source: $$[$0-2], |
|
3705 |
step: $$[$0] |
|
3706 |
}; |
|
3707 |
break; |
|
3708 |
case 168:this.$ = { |
|
3709 |
source: $$[$0-4], |
|
3710 |
guard: $$[$0-2], |
|
3711 |
step: $$[$0] |
|
3712 |
}; |
|
3713 |
break; |
|
3714 |
case 169:this.$ = { |
|
3715 |
source: $$[$0-4], |
|
3716 |
step: $$[$0-2], |
|
3717 |
guard: $$[$0] |
|
3718 |
}; |
|
3719 |
break; |
|
3720 |
case 170:this.$ = new yy.Switch($$[$0-3], $$[$0-1]); |
|
3721 |
break; |
|
3722 |
case 171:this.$ = new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]); |
|
3723 |
break; |
|
3724 |
case 172:this.$ = new yy.Switch(null, $$[$0-1]); |
|
3725 |
break; |
|
3726 |
case 173:this.$ = new yy.Switch(null, $$[$0-3], $$[$0-1]); |
|
3727 |
break; |
|
3728 |
case 174:this.$ = $$[$0]; |
|
3729 |
break; |
|
3730 |
case 175:this.$ = $$[$0-1].concat($$[$0]); |
|
3731 |
break; |
|
3732 |
case 176:this.$ = [[$$[$0-1], $$[$0]]]; |
|
3733 |
break; |
|
3734 |
case 177:this.$ = [[$$[$0-2], $$[$0-1]]]; |
|
3735 |
break; |
|
3736 |
case 178:this.$ = new yy.If($$[$0-1], $$[$0], { |
|
3737 |
type: $$[$0-2] |
|
3738 |
}); |
|
3739 |
break; |
|
3740 |
case 179:this.$ = $$[$0-4].addElse(new yy.If($$[$0-1], $$[$0], { |
|
3741 |
type: $$[$0-2] |
|
3742 |
})); |
|
3743 |
break; |
|
3744 |
case 180:this.$ = $$[$0]; |
|
3745 |
break; |
|
3746 |
case 181:this.$ = $$[$0-2].addElse($$[$0]); |
|
3747 |
break; |
|
3748 |
case 182:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { |
|
3749 |
type: $$[$0-1], |
|
3750 |
statement: true |
|
3751 |
}); |
|
3752 |
break; |
|
3753 |
case 183:this.$ = new yy.If($$[$0], yy.Block.wrap([$$[$0-2]]), { |
|
3754 |
type: $$[$0-1], |
|
3755 |
statement: true |
|
3756 |
}); |
|
3757 |
break; |
|
3758 |
case 184:this.$ = new yy.Op($$[$0-1], $$[$0]); |
|
3759 |
break; |
|
3760 |
case 185:this.$ = new yy.Op('-', $$[$0]); |
|
3761 |
break; |
|
3762 |
case 186:this.$ = new yy.Op('+', $$[$0]); |
|
3763 |
break; |
|
3764 |
case 187:this.$ = new yy.Op('--', $$[$0]); |
|
3765 |
break; |
|
3766 |
case 188:this.$ = new yy.Op('++', $$[$0]); |
|
3767 |
break; |
|
3768 |
case 189:this.$ = new yy.Op('--', $$[$0-1], null, true); |
|
3769 |
break; |
|
3770 |
case 190:this.$ = new yy.Op('++', $$[$0-1], null, true); |
|
3771 |
break; |
|
3772 |
case 191:this.$ = new yy.Existence($$[$0-1]); |
|
3773 |
break; |
|
3774 |
case 192:this.$ = new yy.Op('+', $$[$0-2], $$[$0]); |
|
3775 |
break; |
|
3776 |
case 193:this.$ = new yy.Op('-', $$[$0-2], $$[$0]); |
|
3777 |
break; |
|
3778 |
case 194:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); |
|
3779 |
break; |
|
3780 |
case 195:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); |
|
3781 |
break; |
|
3782 |
case 196:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); |
|
3783 |
break; |
|
3784 |
case 197:this.$ = new yy.Op($$[$0-1], $$[$0-2], $$[$0]); |
|
3785 |
break; |
|
3786 |
case 198:this.$ = (function () { |
|
3787 |
if ($$[$0-1].charAt(0) === '!') { |
|
3788 |
return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert(); |
|
3789 |
} else { |
|
3790 |
return new yy.Op($$[$0-1], $$[$0-2], $$[$0]); |
|
3791 |
} |
|
3792 |
}()); |
|
3793 |
break; |
|
3794 |
case 199:this.$ = new yy.Assign($$[$0-2], $$[$0], $$[$0-1]); |
|
3795 |
break; |
|
3796 |
case 200:this.$ = new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]); |
|
3797 |
break; |
|
3798 |
case 201:this.$ = new yy.Extends($$[$0-2], $$[$0]); |
|
3799 |
break; |
|
3800 |
}
|
|
3801 |
},
|
|
3802 |
table: [{1:[2,1],3:1,4:2,5:3,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[3]},{1:[2,2],6:[1,74]},{6:[1,75]},{1:[2,4],6:[2,4],26:[2,4],101:[2,4]},{4:77,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[1,76],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,7],6:[2,7],26:[2,7],101:[2,7],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,8],6:[2,8],26:[2,8],101:[2,8],102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,12],73:[1,100],77:[2,12],80:92,83:[1,94],84:[2,107],85:[2,12],90:[2,12],92:[2,12],101:[2,12],103:[2,12],104:[2,12],105:[2,12],109:[2,12],117:[2,12],125:[2,12],127:[2,12],128:[2,12],131:[2,12],132:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],72:[2,13],73:[1,100],77:[2,13],80:101,83:[1,94],84:[2,107],85:[2,13],90:[2,13],92:[2,13],101:[2,13],103:[2,13],104:[2,13],105:[2,13],109:[2,13],117:[2,13],125:[2,13],127:[2,13],128:[2,13],131:[2,13],132:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],72:[2,14],77:[2,14],85:[2,14],90:[2,14],92:[2,14],101:[2,14],103:[2,14],104:[2,14],105:[2,14],109:[2,14],117:[2,14],125:[2,14],127:[2,14],128:[2,14],131:[2,14],132:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],72:[2,15],77:[2,15],85:[2,15],90:[2,15],92:[2,15],101:[2,15],103:[2,15],104:[2,15],105:[2,15],109:[2,15],117:[2,15],125:[2,15],127:[2,15],128:[2,15],131:[2,15],132:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],72:[2,16],77:[2,16],85:[2,16],90:[2,16],92:[2,16],101:[2,16],103:[2,16],104:[2,16],105:[2,16],109:[2,16],117:[2,16],125:[2,16],127:[2,16],128:[2,16],131:[2,16],132:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],72:[2,17],77:[2,17],85:[2,17],90:[2,17],92:[2,17],101:[2,17],103:[2,17],104:[2,17],105:[2,17],109:[2,17],117:[2,17],125:[2,17],127:[2,17],128:[2,17],131:[2,17],132:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],72:[2,18],77:[2,18],85:[2,18],90:[2,18],92:[2,18],101:[2,18],103:[2,18],104:[2,18],105:[2,18],109:[2,18],117:[2,18],125:[2,18],127:[2,18],128:[2,18],131:[2,18],132:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],72:[2,19],77:[2,19],85:[2,19],90:[2,19],92:[2,19],101:[2,19],103:[2,19],104:[2,19],105:[2,19],109:[2,19],117:[2,19],125:[2,19],127:[2,19],128:[2,19],131:[2,19],132:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],72:[2,20],77:[2,20],85:[2,20],90:[2,20],92:[2,20],101:[2,20],103:[2,20],104:[2,20],105:[2,20],109:[2,20],117:[2,20],125:[2,20],127:[2,20],128:[2,20],131:[2,20],132:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],72:[2,21],77:[2,21],85:[2,21],90:[2,21],92:[2,21],101:[2,21],103:[2,21],104:[2,21],105:[2,21],109:[2,21],117:[2,21],125:[2,21],127:[2,21],128:[2,21],131:[2,21],132:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],72:[2,22],77:[2,22],85:[2,22],90:[2,22],92:[2,22],101:[2,22],103:[2,22],104:[2,22],105:[2,22],109:[2,22],117:[2,22],125:[2,22],127:[2,22],128:[2,22],131:[2,22],132:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],72:[2,23],77:[2,23],85:[2,23],90:[2,23],92:[2,23],101:[2,23],103:[2,23],104:[2,23],105:[2,23],109:[2,23],117:[2,23],125:[2,23],127:[2,23],128:[2,23],131:[2,23],132:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23]},{1:[2,9],6:[2,9],26:[2,9],101:[2,9],103:[2,9],105:[2,9],109:[2,9],125:[2,9]},{1:[2,10],6:[2,10],26:[2,10],101:[2,10],103:[2,10],105:[2,10],109:[2,10],125:[2,10]},{1:[2,11],6:[2,11],26:[2,11],101:[2,11],103:[2,11],105:[2,11],109:[2,11],125:[2,11]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,103],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],70:[2,75],72:[2,75],73:[2,75],77:[2,75],83:[2,75],84:[2,75],85:[2,75],90:[2,75],92:[2,75],101:[2,75],103:[2,75],104:[2,75],105:[2,75],109:[2,75],117:[2,75],125:[2,75],127:[2,75],128:[2,75],131:[2,75],132:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75]},{1:[2,76],6:[2,76],25:[2,76],26:[2,76],49:[2,76],54:[2,76],57:[2,76],66:[2,76],67:[2,76],68:[2,76],70:[2,76],72:[2,76],73:[2,76],77:[2,76],83:[2,76],84:[2,76],85:[2,76],90:[2,76],92:[2,76],101:[2,76],103:[2,76],104:[2,76],105:[2,76],109:[2,76],117:[2,76],125:[2,76],127:[2,76],128:[2,76],131:[2,76],132:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76]},{1:[2,77],6:[2,77],25:[2,77],26:[2,77],49:[2,77],54:[2,77],57:[2,77],66:[2,77],67:[2,77],68:[2,77],70:[2,77],72:[2,77],73:[2,77],77:[2,77],83:[2,77],84:[2,77],85:[2,77],90:[2,77],92:[2,77],101:[2,77],103:[2,77],104:[2,77],105:[2,77],109:[2,77],117:[2,77],125:[2,77],127:[2,77],128:[2,77],131:[2,77],132:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77]},{1:[2,78],6:[2,78],25:[2,78],26:[2,78],49:[2,78],54:[2,78],57:[2,78],66:[2,78],67:[2,78],68:[2,78],70:[2,78],72:[2,78],73:[2,78],77:[2,78],83:[2,78],84:[2,78],85:[2,78],90:[2,78],92:[2,78],101:[2,78],103:[2,78],104:[2,78],105:[2,78],109:[2,78],117:[2,78],125:[2,78],127:[2,78],128:[2,78],131:[2,78],132:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78]},{1:[2,79],6:[2,79],25:[2,79],26:[2,79],49:[2,79],54:[2,79],57:[2,79],66:[2,79],67:[2,79],68:[2,79],70:[2,79],72:[2,79],73:[2,79],77:[2,79],83:[2,79],84:[2,79],85:[2,79],90:[2,79],92:[2,79],101:[2,79],103:[2,79],104:[2,79],105:[2,79],109:[2,79],117:[2,79],125:[2,79],127:[2,79],128:[2,79],131:[2,79],132:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79]},{1:[2,105],6:[2,105],25:[2,105],26:[2,105],49:[2,105],54:[2,105],57:[2,105],66:[2,105],67:[2,105],68:[2,105],70:[2,105],72:[2,105],73:[2,105],77:[2,105],81:104,83:[2,105],84:[1,105],85:[2,105],90:[2,105],92:[2,105],101:[2,105],103:[2,105],104:[2,105],105:[2,105],109:[2,105],117:[2,105],125:[2,105],127:[2,105],128:[2,105],131:[2,105],132:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105]},{6:[2,55],25:[2,55],27:109,28:[1,73],44:110,48:106,49:[2,55],54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{5:115,25:[1,5]},{8:116,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:118,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:119,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:120,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{13:121,14:122,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,58:47,59:48,61:124,63:25,64:26,65:27,75:[1,70],82:[1,28],87:[1,58],88:[1,59],89:[1,57],100:[1,56]},{1:[2,72],6:[2,72],25:[2,72],26:[2,72],40:[2,72],49:[2,72],54:[2,72],57:[2,72],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,72],73:[2,72],77:[2,72],79:[1,128],83:[2,72],84:[2,72],85:[2,72],90:[2,72],92:[2,72],101:[2,72],103:[2,72],104:[2,72],105:[2,72],109:[2,72],117:[2,72],125:[2,72],127:[2,72],128:[2,72],129:[1,125],130:[1,126],131:[2,72],132:[2,72],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[1,127]},{1:[2,180],6:[2,180],25:[2,180],26:[2,180],49:[2,180],54:[2,180],57:[2,180],72:[2,180],77:[2,180],85:[2,180],90:[2,180],92:[2,180],101:[2,180],103:[2,180],104:[2,180],105:[2,180],109:[2,180],117:[2,180],120:[1,129],125:[2,180],127:[2,180],128:[2,180],131:[2,180],132:[2,180],133:[2,180],134:[2,180],135:[2,180],136:[2,180]},{5:130,25:[1,5]},{5:131,25:[1,5]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],72:[2,147],77:[2,147],85:[2,147],90:[2,147],92:[2,147],101:[2,147],103:[2,147],104:[2,147],105:[2,147],109:[2,147],117:[2,147],125:[2,147],127:[2,147],128:[2,147],131:[2,147],132:[2,147],133:[2,147],134:[2,147],135:[2,147],136:[2,147]},{5:132,25:[1,5]},{8:133,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,134],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,95],5:135,6:[2,95],13:121,14:122,25:[1,5],26:[2,95],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:123,44:63,49:[2,95],54:[2,95],57:[2,95],58:47,59:48,61:137,63:25,64:26,65:27,72:[2,95],75:[1,70],77:[2,95],79:[1,136],82:[1,28],85:[2,95],87:[1,58],88:[1,59],89:[1,57],90:[2,95],92:[2,95],100:[1,56],101:[2,95],103:[2,95],104:[2,95],105:[2,95],109:[2,95],117:[2,95],125:[2,95],127:[2,95],128:[2,95],131:[2,95],132:[2,95],133:[2,95],134:[2,95],135:[2,95],136:[2,95]},{8:138,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,47],6:[2,47],8:139,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,47],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,47],102:39,103:[2,47],105:[2,47],106:40,107:[1,67],108:41,109:[2,47],110:69,118:[1,42],123:37,124:[1,64],125:[2,47],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],54:[2,48],77:[2,48],101:[2,48],103:[2,48],105:[2,48],109:[2,48],125:[2,48]},{1:[2,73],6:[2,73],25:[2,73],26:[2,73],40:[2,73],49:[2,73],54:[2,73],57:[2,73],66:[2,73],67:[2,73],68:[2,73],70:[2,73],72:[2,73],73:[2,73],77:[2,73],83:[2,73],84:[2,73],85:[2,73],90:[2,73],92:[2,73],101:[2,73],103:[2,73],104:[2,73],105:[2,73],109:[2,73],117:[2,73],125:[2,73],127:[2,73],128:[2,73],131:[2,73],132:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73]},{1:[2,74],6:[2,74],25:[2,74],26:[2,74],40:[2,74],49:[2,74],54:[2,74],57:[2,74],66:[2,74],67:[2,74],68:[2,74],70:[2,74],72:[2,74],73:[2,74],77:[2,74],83:[2,74],84:[2,74],85:[2,74],90:[2,74],92:[2,74],101:[2,74],103:[2,74],104:[2,74],105:[2,74],109:[2,74],117:[2,74],125:[2,74],127:[2,74],128:[2,74],131:[2,74],132:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74]},{1:[2,29],6:[2,29],25:[2,29],26:[2,29],49:[2,29],54:[2,29],57:[2,29],66:[2,29],67:[2,29],68:[2,29],70:[2,29],72:[2,29],73:[2,29],77:[2,29],83:[2,29],84:[2,29],85:[2,29],90:[2,29],92:[2,29],101:[2,29],103:[2,29],104:[2,29],105:[2,29],109:[2,29],117:[2,29],125:[2,29],127:[2,29],128:[2,29],131:[2,29],132:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29]},{1:[2,30],6:[2,30],25:[2,30],26:[2,30],49:[2,30],54:[2,30],57:[2,30],66:[2,30],67:[2,30],68:[2,30],70:[2,30],72:[2,30],73:[2,30],77:[2,30],83:[2,30],84:[2,30],85:[2,30],90:[2,30],92:[2,30],101:[2,30],103:[2,30],104:[2,30],105:[2,30],109:[2,30],117:[2,30],125:[2,30],127:[2,30],128:[2,30],131:[2,30],132:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30]},{1:[2,31],6:[2,31],25:[2,31],26:[2,31],49:[2,31],54:[2,31],57:[2,31],66:[2,31],67:[2,31],68:[2,31],70:[2,31],72:[2,31],73:[2,31],77:[2,31],83:[2,31],84:[2,31],85:[2,31],90:[2,31],92:[2,31],101:[2,31],103:[2,31],104:[2,31],105:[2,31],109:[2,31],117:[2,31],125:[2,31],127:[2,31],128:[2,31],131:[2,31],132:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31]},{1:[2,32],6:[2,32],25:[2,32],26:[2,32],49:[2,32],54:[2,32],57:[2,32],66:[2,32],67:[2,32],68:[2,32],70:[2,32],72:[2,32],73:[2,32],77:[2,32],83:[2,32],84:[2,32],85:[2,32],90:[2,32],92:[2,32],101:[2,32],103:[2,32],104:[2,32],105:[2,32],109:[2,32],117:[2,32],125:[2,32],127:[2,32],128:[2,32],131:[2,32],132:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32]},{1:[2,33],6:[2,33],25:[2,33],26:[2,33],49:[2,33],54:[2,33],57:[2,33],66:[2,33],67:[2,33],68:[2,33],70:[2,33],72:[2,33],73:[2,33],77:[2,33],83:[2,33],84:[2,33],85:[2,33],90:[2,33],92:[2,33],101:[2,33],103:[2,33],104:[2,33],105:[2,33],109:[2,33],117:[2,33],125:[2,33],127:[2,33],128:[2,33],131:[2,33],132:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33]},{1:[2,34],6:[2,34],25:[2,34],26:[2,34],49:[2,34],54:[2,34],57:[2,34],66:[2,34],67:[2,34],68:[2,34],70:[2,34],72:[2,34],73:[2,34],77:[2,34],83:[2,34],84:[2,34],85:[2,34],90:[2,34],92:[2,34],101:[2,34],103:[2,34],104:[2,34],105:[2,34],109:[2,34],117:[2,34],125:[2,34],127:[2,34],128:[2,34],131:[2,34],132:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],66:[2,35],67:[2,35],68:[2,35],70:[2,35],72:[2,35],73:[2,35],77:[2,35],83:[2,35],84:[2,35],85:[2,35],90:[2,35],92:[2,35],101:[2,35],103:[2,35],104:[2,35],105:[2,35],109:[2,35],117:[2,35],125:[2,35],127:[2,35],128:[2,35],131:[2,35],132:[2,35],133:[2,35],134:[2,35],135:[2,35],136:[2,35]},{4:140,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,141],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:142,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,111],6:[2,111],25:[2,111],26:[2,111],49:[2,111],54:[2,111],57:[2,111],66:[2,111],67:[2,111],68:[2,111],70:[2,111],72:[2,111],73:[2,111],77:[2,111],83:[2,111],84:[2,111],85:[2,111],90:[2,111],92:[2,111],101:[2,111],103:[2,111],104:[2,111],105:[2,111],109:[2,111],117:[2,111],125:[2,111],127:[2,111],128:[2,111],131:[2,111],132:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],27:148,28:[1,73],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],70:[2,112],72:[2,112],73:[2,112],77:[2,112],83:[2,112],84:[2,112],85:[2,112],90:[2,112],92:[2,112],101:[2,112],103:[2,112],104:[2,112],105:[2,112],109:[2,112],117:[2,112],125:[2,112],127:[2,112],128:[2,112],131:[2,112],132:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112]},{25:[2,51]},{25:[2,52]},{1:[2,68],6:[2,68],25:[2,68],26:[2,68],40:[2,68],49:[2,68],54:[2,68],57:[2,68],66:[2,68],67:[2,68],68:[2,68],70:[2,68],72:[2,68],73:[2,68],77:[2,68],79:[2,68],83:[2,68],84:[2,68],85:[2,68],90:[2,68],92:[2,68],101:[2,68],103:[2,68],104:[2,68],105:[2,68],109:[2,68],117:[2,68],125:[2,68],127:[2,68],128:[2,68],129:[2,68],130:[2,68],131:[2,68],132:[2,68],133:[2,68],134:[2,68],135:[2,68],136:[2,68],137:[2,68]},{1:[2,71],6:[2,71],25:[2,71],26:[2,71],40:[2,71],49:[2,71],54:[2,71],57:[2,71],66:[2,71],67:[2,71],68:[2,71],70:[2,71],72:[2,71],73:[2,71],77:[2,71],79:[2,71],83:[2,71],84:[2,71],85:[2,71],90:[2,71],92:[2,71],101:[2,71],103:[2,71],104:[2,71],105:[2,71],109:[2,71],117:[2,71],125:[2,71],127:[2,71],128:[2,71],129:[2,71],130:[2,71],131:[2,71],132:[2,71],133:[2,71],134:[2,71],135:[2,71],136:[2,71],137:[2,71]},{8:149,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:150,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:151,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:152,8:153,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,5],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{27:158,28:[1,73],44:159,58:160,59:161,64:154,75:[1,70],88:[1,113],89:[1,57],112:155,113:[1,156],114:157},{111:162,115:[1,163],116:[1,164]},{6:[2,90],11:168,25:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:165,77:[2,90],88:[1,113]},{1:[2,27],6:[2,27],25:[2,27],26:[2,27],43:[2,27],49:[2,27],54:[2,27],57:[2,27],66:[2,27],67:[2,27],68:[2,27],70:[2,27],72:[2,27],73:[2,27],77:[2,27],83:[2,27],84:[2,27],85:[2,27],90:[2,27],92:[2,27],101:[2,27],103:[2,27],104:[2,27],105:[2,27],109:[2,27],117:[2,27],125:[2,27],127:[2,27],128:[2,27],131:[2,27],132:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],43:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],70:[2,28],72:[2,28],73:[2,28],77:[2,28],83:[2,28],84:[2,28],85:[2,28],90:[2,28],92:[2,28],101:[2,28],103:[2,28],104:[2,28],105:[2,28],109:[2,28],117:[2,28],125:[2,28],127:[2,28],128:[2,28],131:[2,28],132:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],40:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],70:[2,26],72:[2,26],73:[2,26],77:[2,26],79:[2,26],83:[2,26],84:[2,26],85:[2,26],90:[2,26],92:[2,26],101:[2,26],103:[2,26],104:[2,26],105:[2,26],109:[2,26],115:[2,26],116:[2,26],117:[2,26],125:[2,26],127:[2,26],128:[2,26],129:[2,26],130:[2,26],131:[2,26],132:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26]},{1:[2,6],6:[2,6],7:172,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,26:[2,6],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],101:[2,6],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,3]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],72:[2,24],77:[2,24],85:[2,24],90:[2,24],92:[2,24],97:[2,24],98:[2,24],101:[2,24],103:[2,24],104:[2,24],105:[2,24],109:[2,24],117:[2,24],120:[2,24],122:[2,24],125:[2,24],127:[2,24],128:[2,24],131:[2,24],132:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24]},{6:[1,74],26:[1,173]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],72:[2,191],77:[2,191],85:[2,191],90:[2,191],92:[2,191],101:[2,191],103:[2,191],104:[2,191],105:[2,191],109:[2,191],117:[2,191],125:[2,191],127:[2,191],128:[2,191],131:[2,191],132:[2,191],133:[2,191],134:[2,191],135:[2,191],136:[2,191]},{8:174,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:175,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:176,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:177,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:178,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:179,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:180,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:181,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],72:[2,146],77:[2,146],85:[2,146],90:[2,146],92:[2,146],101:[2,146],103:[2,146],104:[2,146],105:[2,146],109:[2,146],117:[2,146],125:[2,146],127:[2,146],128:[2,146],131:[2,146],132:[2,146],133:[2,146],134:[2,146],135:[2,146],136:[2,146]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],72:[2,151],77:[2,151],85:[2,151],90:[2,151],92:[2,151],101:[2,151],103:[2,151],104:[2,151],105:[2,151],109:[2,151],117:[2,151],125:[2,151],127:[2,151],128:[2,151],131:[2,151],132:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151]},{8:182,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],72:[2,145],77:[2,145],85:[2,145],90:[2,145],92:[2,145],101:[2,145],103:[2,145],104:[2,145],105:[2,145],109:[2,145],117:[2,145],125:[2,145],127:[2,145],128:[2,145],131:[2,145],132:[2,145],133:[2,145],134:[2,145],135:[2,145],136:[2,145]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],72:[2,150],77:[2,150],85:[2,150],90:[2,150],92:[2,150],101:[2,150],103:[2,150],104:[2,150],105:[2,150],109:[2,150],117:[2,150],125:[2,150],127:[2,150],128:[2,150],131:[2,150],132:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150]},{81:183,84:[1,105]},{1:[2,69],6:[2,69],25:[2,69],26:[2,69],40:[2,69],49:[2,69],54:[2,69],57:[2,69],66:[2,69],67:[2,69],68:[2,69],70:[2,69],72:[2,69],73:[2,69],77:[2,69],79:[2,69],83:[2,69],84:[2,69],85:[2,69],90:[2,69],92:[2,69],101:[2,69],103:[2,69],104:[2,69],105:[2,69],109:[2,69],117:[2,69],125:[2,69],127:[2,69],128:[2,69],129:[2,69],130:[2,69],131:[2,69],132:[2,69],133:[2,69],134:[2,69],135:[2,69],136:[2,69],137:[2,69]},{84:[2,108]},{27:184,28:[1,73]},{27:185,28:[1,73]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],27:186,28:[1,73],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],70:[2,83],72:[2,83],73:[2,83],77:[2,83],79:[2,83],83:[2,83],84:[2,83],85:[2,83],90:[2,83],92:[2,83],101:[2,83],103:[2,83],104:[2,83],105:[2,83],109:[2,83],117:[2,83],125:[2,83],127:[2,83],128:[2,83],129:[2,83],130:[2,83],131:[2,83],132:[2,83],133:[2,83],134:[2,83],135:[2,83],136:[2,83],137:[2,83]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],70:[2,84],72:[2,84],73:[2,84],77:[2,84],79:[2,84],83:[2,84],84:[2,84],85:[2,84],90:[2,84],92:[2,84],101:[2,84],103:[2,84],104:[2,84],105:[2,84],109:[2,84],117:[2,84],125:[2,84],127:[2,84],128:[2,84],129:[2,84],130:[2,84],131:[2,84],132:[2,84],133:[2,84],134:[2,84],135:[2,84],136:[2,84],137:[2,84]},{8:188,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],57:[1,192],58:47,59:48,61:36,63:25,64:26,65:27,71:187,74:189,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],91:190,92:[1,191],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{69:193,70:[1,99],73:[1,100]},{81:194,84:[1,105]},{1:[2,70],6:[2,70],25:[2,70],26:[2,70],40:[2,70],49:[2,70],54:[2,70],57:[2,70],66:[2,70],67:[2,70],68:[2,70],70:[2,70],72:[2,70],73:[2,70],77:[2,70],79:[2,70],83:[2,70],84:[2,70],85:[2,70],90:[2,70],92:[2,70],101:[2,70],103:[2,70],104:[2,70],105:[2,70],109:[2,70],117:[2,70],125:[2,70],127:[2,70],128:[2,70],129:[2,70],130:[2,70],131:[2,70],132:[2,70],133:[2,70],134:[2,70],135:[2,70],136:[2,70],137:[2,70]},{6:[1,196],8:195,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,197],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,106],6:[2,106],25:[2,106],26:[2,106],49:[2,106],54:[2,106],57:[2,106],66:[2,106],67:[2,106],68:[2,106],70:[2,106],72:[2,106],73:[2,106],77:[2,106],83:[2,106],84:[2,106],85:[2,106],90:[2,106],92:[2,106],101:[2,106],103:[2,106],104:[2,106],105:[2,106],109:[2,106],117:[2,106],125:[2,106],127:[2,106],128:[2,106],131:[2,106],132:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[1,198],86:199,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],49:[1,201],53:203,54:[1,202]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{6:[2,60],25:[2,60],26:[2,60],40:[1,205],49:[2,60],54:[2,60],57:[1,204]},{6:[2,63],25:[2,63],26:[2,63],40:[2,63],49:[2,63],54:[2,63],57:[2,63]},{6:[2,64],25:[2,64],26:[2,64],40:[2,64],49:[2,64],54:[2,64],57:[2,64]},{6:[2,65],25:[2,65],26:[2,65],40:[2,65],49:[2,65],54:[2,65],57:[2,65]},{6:[2,66],25:[2,66],26:[2,66],40:[2,66],49:[2,66],54:[2,66],57:[2,66]},{27:148,28:[1,73]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:144,87:[1,58],88:[1,59],89:[1,57],90:[1,143],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,50],6:[2,50],25:[2,50],26:[2,50],49:[2,50],54:[2,50],57:[2,50],72:[2,50],77:[2,50],85:[2,50],90:[2,50],92:[2,50],101:[2,50],103:[2,50],104:[2,50],105:[2,50],109:[2,50],117:[2,50],125:[2,50],127:[2,50],128:[2,50],131:[2,50],132:[2,50],133:[2,50],134:[2,50],135:[2,50],136:[2,50]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],72:[2,184],77:[2,184],85:[2,184],90:[2,184],92:[2,184],101:[2,184],102:87,103:[2,184],104:[2,184],105:[2,184],108:88,109:[2,184],110:69,117:[2,184],125:[2,184],127:[2,184],128:[2,184],131:[1,78],132:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184]},{102:90,103:[1,65],105:[1,66],108:91,109:[1,68],110:69,125:[1,89]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],72:[2,185],77:[2,185],85:[2,185],90:[2,185],92:[2,185],101:[2,185],102:87,103:[2,185],104:[2,185],105:[2,185],108:88,109:[2,185],110:69,117:[2,185],125:[2,185],127:[2,185],128:[2,185],131:[1,78],132:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],72:[2,186],77:[2,186],85:[2,186],90:[2,186],92:[2,186],101:[2,186],102:87,103:[2,186],104:[2,186],105:[2,186],108:88,109:[2,186],110:69,117:[2,186],125:[2,186],127:[2,186],128:[2,186],131:[1,78],132:[2,186],133:[2,186],134:[2,186],135:[2,186],136:[2,186]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,187],73:[2,72],77:[2,187],83:[2,72],84:[2,72],85:[2,187],90:[2,187],92:[2,187],101:[2,187],103:[2,187],104:[2,187],105:[2,187],109:[2,187],117:[2,187],125:[2,187],127:[2,187],128:[2,187],131:[2,187],132:[2,187],133:[2,187],134:[2,187],135:[2,187],136:[2,187]},{62:93,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:92,83:[1,94],84:[2,107]},{62:102,66:[1,95],67:[1,96],68:[1,97],69:98,70:[1,99],73:[1,100],80:101,83:[1,94],84:[2,107]},{66:[2,75],67:[2,75],68:[2,75],70:[2,75],73:[2,75],83:[2,75],84:[2,75]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,188],73:[2,72],77:[2,188],83:[2,72],84:[2,72],85:[2,188],90:[2,188],92:[2,188],101:[2,188],103:[2,188],104:[2,188],105:[2,188],109:[2,188],117:[2,188],125:[2,188],127:[2,188],128:[2,188],131:[2,188],132:[2,188],133:[2,188],134:[2,188],135:[2,188],136:[2,188]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],72:[2,189],77:[2,189],85:[2,189],90:[2,189],92:[2,189],101:[2,189],103:[2,189],104:[2,189],105:[2,189],109:[2,189],117:[2,189],125:[2,189],127:[2,189],128:[2,189],131:[2,189],132:[2,189],133:[2,189],134:[2,189],135:[2,189],136:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],72:[2,190],77:[2,190],85:[2,190],90:[2,190],92:[2,190],101:[2,190],103:[2,190],104:[2,190],105:[2,190],109:[2,190],117:[2,190],125:[2,190],127:[2,190],128:[2,190],131:[2,190],132:[2,190],133:[2,190],134:[2,190],135:[2,190],136:[2,190]},{8:206,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,207],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:208,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{5:209,25:[1,5],124:[1,210]},{1:[2,132],6:[2,132],25:[2,132],26:[2,132],49:[2,132],54:[2,132],57:[2,132],72:[2,132],77:[2,132],85:[2,132],90:[2,132],92:[2,132],96:211,97:[1,212],98:[1,213],101:[2,132],103:[2,132],104:[2,132],105:[2,132],109:[2,132],117:[2,132],125:[2,132],127:[2,132],128:[2,132],131:[2,132],132:[2,132],133:[2,132],134:[2,132],135:[2,132],136:[2,132]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],72:[2,144],77:[2,144],85:[2,144],90:[2,144],92:[2,144],101:[2,144],103:[2,144],104:[2,144],105:[2,144],109:[2,144],117:[2,144],125:[2,144],127:[2,144],128:[2,144],131:[2,144],132:[2,144],133:[2,144],134:[2,144],135:[2,144],136:[2,144]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],72:[2,152],77:[2,152],85:[2,152],90:[2,152],92:[2,152],101:[2,152],103:[2,152],104:[2,152],105:[2,152],109:[2,152],117:[2,152],125:[2,152],127:[2,152],128:[2,152],131:[2,152],132:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152]},{25:[1,214],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{119:215,121:216,122:[1,217]},{1:[2,96],6:[2,96],25:[2,96],26:[2,96],49:[2,96],54:[2,96],57:[2,96],72:[2,96],77:[2,96],85:[2,96],90:[2,96],92:[2,96],101:[2,96],103:[2,96],104:[2,96],105:[2,96],109:[2,96],117:[2,96],125:[2,96],127:[2,96],128:[2,96],131:[2,96],132:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96]},{8:218,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,99],5:219,6:[2,99],25:[1,5],26:[2,99],49:[2,99],54:[2,99],57:[2,99],66:[2,72],67:[2,72],68:[2,72],70:[2,72],72:[2,99],73:[2,72],77:[2,99],79:[1,220],83:[2,72],84:[2,72],85:[2,99],90:[2,99],92:[2,99],101:[2,99],103:[2,99],104:[2,99],105:[2,99],109:[2,99],117:[2,99],125:[2,99],127:[2,99],128:[2,99],131:[2,99],132:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],72:[2,137],77:[2,137],85:[2,137],90:[2,137],92:[2,137],101:[2,137],102:87,103:[2,137],104:[2,137],105:[2,137],108:88,109:[2,137],110:69,117:[2,137],125:[2,137],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,46],6:[2,46],26:[2,46],101:[2,46],102:87,103:[2,46],105:[2,46],108:88,109:[2,46],110:69,125:[2,46],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,74],101:[1,221]},{4:222,7:4,8:6,9:7,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,128],25:[2,128],54:[2,128],57:[1,224],90:[2,128],91:223,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],70:[2,114],72:[2,114],73:[2,114],77:[2,114],83:[2,114],84:[2,114],85:[2,114],90:[2,114],92:[2,114],101:[2,114],103:[2,114],104:[2,114],105:[2,114],109:[2,114],115:[2,114],116:[2,114],117:[2,114],125:[2,114],127:[2,114],128:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114]},{6:[2,53],25:[2,53],53:225,54:[1,226],90:[2,53]},{6:[2,123],25:[2,123],26:[2,123],54:[2,123],85:[2,123],90:[2,123]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:227,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],85:[2,129],90:[2,129]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],40:[2,113],43:[2,113],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],70:[2,113],72:[2,113],73:[2,113],77:[2,113],79:[2,113],83:[2,113],84:[2,113],85:[2,113],90:[2,113],92:[2,113],101:[2,113],103:[2,113],104:[2,113],105:[2,113],109:[2,113],115:[2,113],116:[2,113],117:[2,113],125:[2,113],127:[2,113],128:[2,113],129:[2,113],130:[2,113],131:[2,113],132:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113]},{5:228,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],72:[2,140],77:[2,140],85:[2,140],90:[2,140],92:[2,140],101:[2,140],102:87,103:[1,65],104:[1,229],105:[1,66],108:88,109:[1,68],110:69,117:[2,140],125:[2,140],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],72:[2,142],77:[2,142],85:[2,142],90:[2,142],92:[2,142],101:[2,142],102:87,103:[1,65],104:[1,230],105:[1,66],108:88,109:[1,68],110:69,117:[2,142],125:[2,142],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],72:[2,148],77:[2,148],85:[2,148],90:[2,148],92:[2,148],101:[2,148],103:[2,148],104:[2,148],105:[2,148],109:[2,148],117:[2,148],125:[2,148],127:[2,148],128:[2,148],131:[2,148],132:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],72:[2,149],77:[2,149],85:[2,149],90:[2,149],92:[2,149],101:[2,149],102:87,103:[1,65],104:[2,149],105:[1,66],108:88,109:[1,68],110:69,117:[2,149],125:[2,149],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],72:[2,153],77:[2,153],85:[2,153],90:[2,153],92:[2,153],101:[2,153],103:[2,153],104:[2,153],105:[2,153],109:[2,153],117:[2,153],125:[2,153],127:[2,153],128:[2,153],131:[2,153],132:[2,153],133:[2,153],134:[2,153],135:[2,153],136:[2,153]},{115:[2,155],116:[2,155]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],112:231,114:157},{54:[1,232],115:[2,161],116:[2,161]},{54:[2,157],115:[2,157],116:[2,157]},{54:[2,158],115:[2,158],116:[2,158]},{54:[2,159],115:[2,159],116:[2,159]},{54:[2,160],115:[2,160],116:[2,160]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],72:[2,154],77:[2,154],85:[2,154],90:[2,154],92:[2,154],101:[2,154],103:[2,154],104:[2,154],105:[2,154],109:[2,154],117:[2,154],125:[2,154],127:[2,154],128:[2,154],131:[2,154],132:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154]},{8:233,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:234,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],53:235,54:[1,236],77:[2,53]},{6:[2,91],25:[2,91],26:[2,91],54:[2,91],77:[2,91]},{6:[2,39],25:[2,39],26:[2,39],43:[1,237],54:[2,39],77:[2,39]},{6:[2,42],25:[2,42],26:[2,42],54:[2,42],77:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],77:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],77:[2,44]},{6:[2,45],25:[2,45],26:[2,45],43:[2,45],54:[2,45],77:[2,45]},{1:[2,5],6:[2,5],26:[2,5],101:[2,5]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],49:[2,25],54:[2,25],57:[2,25],72:[2,25],77:[2,25],85:[2,25],90:[2,25],92:[2,25],97:[2,25],98:[2,25],101:[2,25],103:[2,25],104:[2,25],105:[2,25],109:[2,25],117:[2,25],120:[2,25],122:[2,25],125:[2,25],127:[2,25],128:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],72:[2,192],77:[2,192],85:[2,192],90:[2,192],92:[2,192],101:[2,192],102:87,103:[2,192],104:[2,192],105:[2,192],108:88,109:[2,192],110:69,117:[2,192],125:[2,192],127:[2,192],128:[2,192],131:[1,78],132:[1,81],133:[2,192],134:[2,192],135:[2,192],136:[2,192]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],72:[2,193],77:[2,193],85:[2,193],90:[2,193],92:[2,193],101:[2,193],102:87,103:[2,193],104:[2,193],105:[2,193],108:88,109:[2,193],110:69,117:[2,193],125:[2,193],127:[2,193],128:[2,193],131:[1,78],132:[1,81],133:[2,193],134:[2,193],135:[2,193],136:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],72:[2,194],77:[2,194],85:[2,194],90:[2,194],92:[2,194],101:[2,194],102:87,103:[2,194],104:[2,194],105:[2,194],108:88,109:[2,194],110:69,117:[2,194],125:[2,194],127:[2,194],128:[2,194],131:[1,78],132:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],72:[2,195],77:[2,195],85:[2,195],90:[2,195],92:[2,195],101:[2,195],102:87,103:[2,195],104:[2,195],105:[2,195],108:88,109:[2,195],110:69,117:[2,195],125:[2,195],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[2,195],134:[2,195],135:[2,195],136:[2,195]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],72:[2,196],77:[2,196],85:[2,196],90:[2,196],92:[2,196],101:[2,196],102:87,103:[2,196],104:[2,196],105:[2,196],108:88,109:[2,196],110:69,117:[2,196],125:[2,196],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,196],135:[2,196],136:[1,85]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],72:[2,197],77:[2,197],85:[2,197],90:[2,197],92:[2,197],101:[2,197],102:87,103:[2,197],104:[2,197],105:[2,197],108:88,109:[2,197],110:69,117:[2,197],125:[2,197],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[2,197],136:[1,85]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],72:[2,198],77:[2,198],85:[2,198],90:[2,198],92:[2,198],101:[2,198],102:87,103:[2,198],104:[2,198],105:[2,198],108:88,109:[2,198],110:69,117:[2,198],125:[2,198],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[2,198],135:[2,198],136:[2,198]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],72:[2,183],77:[2,183],85:[2,183],90:[2,183],92:[2,183],101:[2,183],102:87,103:[1,65],104:[2,183],105:[1,66],108:88,109:[1,68],110:69,117:[2,183],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],72:[2,182],77:[2,182],85:[2,182],90:[2,182],92:[2,182],101:[2,182],102:87,103:[1,65],104:[2,182],105:[1,66],108:88,109:[1,68],110:69,117:[2,182],125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],66:[2,103],67:[2,103],68:[2,103],70:[2,103],72:[2,103],73:[2,103],77:[2,103],83:[2,103],84:[2,103],85:[2,103],90:[2,103],92:[2,103],101:[2,103],103:[2,103],104:[2,103],105:[2,103],109:[2,103],117:[2,103],125:[2,103],127:[2,103],128:[2,103],131:[2,103],132:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103]},{1:[2,80],6:[2,80],25:[2,80],26:[2,80],40:[2,80],49:[2,80],54:[2,80],57:[2,80],66:[2,80],67:[2,80],68:[2,80],70:[2,80],72:[2,80],73:[2,80],77:[2,80],79:[2,80],83:[2,80],84:[2,80],85:[2,80],90:[2,80],92:[2,80],101:[2,80],103:[2,80],104:[2,80],105:[2,80],109:[2,80],117:[2,80],125:[2,80],127:[2,80],128:[2,80],129:[2,80],130:[2,80],131:[2,80],132:[2,80],133:[2,80],134:[2,80],135:[2,80],136:[2,80],137:[2,80]},{1:[2,81],6:[2,81],25:[2,81],26:[2,81],40:[2,81],49:[2,81],54:[2,81],57:[2,81],66:[2,81],67:[2,81],68:[2,81],70:[2,81],72:[2,81],73:[2,81],77:[2,81],79:[2,81],83:[2,81],84:[2,81],85:[2,81],90:[2,81],92:[2,81],101:[2,81],103:[2,81],104:[2,81],105:[2,81],109:[2,81],117:[2,81],125:[2,81],127:[2,81],128:[2,81],129:[2,81],130:[2,81],131:[2,81],132:[2,81],133:[2,81],134:[2,81],135:[2,81],136:[2,81],137:[2,81]},{1:[2,82],6:[2,82],25:[2,82],26:[2,82],40:[2,82],49:[2,82],54:[2,82],57:[2,82],66:[2,82],67:[2,82],68:[2,82],70:[2,82],72:[2,82],73:[2,82],77:[2,82],79:[2,82],83:[2,82],84:[2,82],85:[2,82],90:[2,82],92:[2,82],101:[2,82],103:[2,82],104:[2,82],105:[2,82],109:[2,82],117:[2,82],125:[2,82],127:[2,82],128:[2,82],129:[2,82],130:[2,82],131:[2,82],132:[2,82],133:[2,82],134:[2,82],135:[2,82],136:[2,82],137:[2,82]},{72:[1,238]},{57:[1,192],72:[2,87],91:239,92:[1,191],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{72:[2,88]},{8:240,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,122],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{12:[2,116],28:[2,116],30:[2,116],31:[2,116],33:[2,116],34:[2,116],35:[2,116],36:[2,116],37:[2,116],38:[2,116],45:[2,116],46:[2,116],47:[2,116],51:[2,116],52:[2,116],72:[2,116],75:[2,116],78:[2,116],82:[2,116],87:[2,116],88:[2,116],89:[2,116],95:[2,116],99:[2,116],100:[2,116],103:[2,116],105:[2,116],107:[2,116],109:[2,116],118:[2,116],124:[2,116],126:[2,116],127:[2,116],128:[2,116],129:[2,116],130:[2,116]},{12:[2,117],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],72:[2,117],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{1:[2,86],6:[2,86],25:[2,86],26:[2,86],40:[2,86],49:[2,86],54:[2,86],57:[2,86],66:[2,86],67:[2,86],68:[2,86],70:[2,86],72:[2,86],73:[2,86],77:[2,86],79:[2,86],83:[2,86],84:[2,86],85:[2,86],90:[2,86],92:[2,86],101:[2,86],103:[2,86],104:[2,86],105:[2,86],109:[2,86],117:[2,86],125:[2,86],127:[2,86],128:[2,86],129:[2,86],130:[2,86],131:[2,86],132:[2,86],133:[2,86],134:[2,86],135:[2,86],136:[2,86],137:[2,86]},{1:[2,104],6:[2,104],25:[2,104],26:[2,104],49:[2,104],54:[2,104],57:[2,104],66:[2,104],67:[2,104],68:[2,104],70:[2,104],72:[2,104],73:[2,104],77:[2,104],83:[2,104],84:[2,104],85:[2,104],90:[2,104],92:[2,104],101:[2,104],103:[2,104],104:[2,104],105:[2,104],109:[2,104],117:[2,104],125:[2,104],127:[2,104],128:[2,104],131:[2,104],132:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],72:[2,36],77:[2,36],85:[2,36],90:[2,36],92:[2,36],101:[2,36],102:87,103:[2,36],104:[2,36],105:[2,36],108:88,109:[2,36],110:69,117:[2,36],125:[2,36],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:241,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:242,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,109],6:[2,109],25:[2,109],26:[2,109],49:[2,109],54:[2,109],57:[2,109],66:[2,109],67:[2,109],68:[2,109],70:[2,109],72:[2,109],73:[2,109],77:[2,109],83:[2,109],84:[2,109],85:[2,109],90:[2,109],92:[2,109],101:[2,109],103:[2,109],104:[2,109],105:[2,109],109:[2,109],117:[2,109],125:[2,109],127:[2,109],128:[2,109],131:[2,109],132:[2,109],133:[2,109],134:[2,109],135:[2,109],136:[2,109]},{6:[2,53],25:[2,53],53:243,54:[1,226],85:[2,53]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],57:[1,244],85:[2,128],90:[2,128],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{50:245,51:[1,60],52:[1,61]},{6:[2,54],25:[2,54],26:[2,54],27:109,28:[1,73],44:110,55:246,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[1,247],25:[1,248]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61]},{8:249,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],72:[2,199],77:[2,199],85:[2,199],90:[2,199],92:[2,199],101:[2,199],102:87,103:[2,199],104:[2,199],105:[2,199],108:88,109:[2,199],110:69,117:[2,199],125:[2,199],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:250,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],72:[2,201],77:[2,201],85:[2,201],90:[2,201],92:[2,201],101:[2,201],102:87,103:[2,201],104:[2,201],105:[2,201],108:88,109:[2,201],110:69,117:[2,201],125:[2,201],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,181],6:[2,181],25:[2,181],26:[2,181],49:[2,181],54:[2,181],57:[2,181],72:[2,181],77:[2,181],85:[2,181],90:[2,181],92:[2,181],101:[2,181],103:[2,181],104:[2,181],105:[2,181],109:[2,181],117:[2,181],125:[2,181],127:[2,181],128:[2,181],131:[2,181],132:[2,181],133:[2,181],134:[2,181],135:[2,181],136:[2,181]},{8:251,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,133],6:[2,133],25:[2,133],26:[2,133],49:[2,133],54:[2,133],57:[2,133],72:[2,133],77:[2,133],85:[2,133],90:[2,133],92:[2,133],97:[1,252],101:[2,133],103:[2,133],104:[2,133],105:[2,133],109:[2,133],117:[2,133],125:[2,133],127:[2,133],128:[2,133],131:[2,133],132:[2,133],133:[2,133],134:[2,133],135:[2,133],136:[2,133]},{5:253,25:[1,5]},{27:254,28:[1,73]},{119:255,121:216,122:[1,217]},{26:[1,256],120:[1,257],121:258,122:[1,217]},{26:[2,174],120:[2,174],122:[2,174]},{8:260,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],94:259,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,97],5:261,6:[2,97],25:[1,5],26:[2,97],49:[2,97],54:[2,97],57:[2,97],72:[2,97],77:[2,97],85:[2,97],90:[2,97],92:[2,97],101:[2,97],102:87,103:[1,65],104:[2,97],105:[1,66],108:88,109:[1,68],110:69,117:[2,97],125:[2,97],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,100],6:[2,100],25:[2,100],26:[2,100],49:[2,100],54:[2,100],57:[2,100],72:[2,100],77:[2,100],85:[2,100],90:[2,100],92:[2,100],101:[2,100],103:[2,100],104:[2,100],105:[2,100],109:[2,100],117:[2,100],125:[2,100],127:[2,100],128:[2,100],131:[2,100],132:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100]},{8:262,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],66:[2,138],67:[2,138],68:[2,138],70:[2,138],72:[2,138],73:[2,138],77:[2,138],83:[2,138],84:[2,138],85:[2,138],90:[2,138],92:[2,138],101:[2,138],103:[2,138],104:[2,138],105:[2,138],109:[2,138],117:[2,138],125:[2,138],127:[2,138],128:[2,138],131:[2,138],132:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138]},{6:[1,74],26:[1,263]},{8:264,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,67],12:[2,117],25:[2,67],28:[2,117],30:[2,117],31:[2,117],33:[2,117],34:[2,117],35:[2,117],36:[2,117],37:[2,117],38:[2,117],45:[2,117],46:[2,117],47:[2,117],51:[2,117],52:[2,117],54:[2,67],75:[2,117],78:[2,117],82:[2,117],87:[2,117],88:[2,117],89:[2,117],90:[2,67],95:[2,117],99:[2,117],100:[2,117],103:[2,117],105:[2,117],107:[2,117],109:[2,117],118:[2,117],124:[2,117],126:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117]},{6:[1,266],25:[1,267],90:[1,265]},{6:[2,54],8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[2,54],26:[2,54],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],85:[2,54],87:[1,58],88:[1,59],89:[1,57],90:[2,54],93:268,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,53],25:[2,53],26:[2,53],53:269,54:[1,226]},{1:[2,178],6:[2,178],25:[2,178],26:[2,178],49:[2,178],54:[2,178],57:[2,178],72:[2,178],77:[2,178],85:[2,178],90:[2,178],92:[2,178],101:[2,178],103:[2,178],104:[2,178],105:[2,178],109:[2,178],117:[2,178],120:[2,178],125:[2,178],127:[2,178],128:[2,178],131:[2,178],132:[2,178],133:[2,178],134:[2,178],135:[2,178],136:[2,178]},{8:270,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:271,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{115:[2,156],116:[2,156]},{27:158,28:[1,73],44:159,58:160,59:161,75:[1,70],88:[1,113],89:[1,114],114:272},{1:[2,163],6:[2,163],25:[2,163],26:[2,163],49:[2,163],54:[2,163],57:[2,163],72:[2,163],77:[2,163],85:[2,163],90:[2,163],92:[2,163],101:[2,163],102:87,103:[2,163],104:[1,273],105:[2,163],108:88,109:[2,163],110:69,117:[1,274],125:[2,163],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,164],6:[2,164],25:[2,164],26:[2,164],49:[2,164],54:[2,164],57:[2,164],72:[2,164],77:[2,164],85:[2,164],90:[2,164],92:[2,164],101:[2,164],102:87,103:[2,164],104:[1,275],105:[2,164],108:88,109:[2,164],110:69,117:[2,164],125:[2,164],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,277],25:[1,278],77:[1,276]},{6:[2,54],11:168,25:[2,54],26:[2,54],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:279,42:167,44:171,46:[1,46],77:[2,54],88:[1,113]},{8:280,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,281],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,85],6:[2,85],25:[2,85],26:[2,85],40:[2,85],49:[2,85],54:[2,85],57:[2,85],66:[2,85],67:[2,85],68:[2,85],70:[2,85],72:[2,85],73:[2,85],77:[2,85],79:[2,85],83:[2,85],84:[2,85],85:[2,85],90:[2,85],92:[2,85],101:[2,85],103:[2,85],104:[2,85],105:[2,85],109:[2,85],117:[2,85],125:[2,85],127:[2,85],128:[2,85],129:[2,85],130:[2,85],131:[2,85],132:[2,85],133:[2,85],134:[2,85],135:[2,85],136:[2,85],137:[2,85]},{8:282,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,72:[2,120],75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,121],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],72:[2,37],77:[2,37],85:[2,37],90:[2,37],92:[2,37],101:[2,37],102:87,103:[2,37],104:[2,37],105:[2,37],108:88,109:[2,37],110:69,117:[2,37],125:[2,37],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,283],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],85:[1,284]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],85:[2,67],90:[2,67]},{5:285,25:[1,5]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{27:109,28:[1,73],44:110,55:286,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,55],25:[2,55],26:[2,55],27:109,28:[1,73],44:110,48:287,54:[2,55],55:107,56:108,58:111,59:112,75:[1,70],88:[1,113],89:[1,114]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{26:[1,288],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:289,25:[1,5],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{5:290,25:[1,5]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],72:[2,134],77:[2,134],85:[2,134],90:[2,134],92:[2,134],101:[2,134],103:[2,134],104:[2,134],105:[2,134],109:[2,134],117:[2,134],125:[2,134],127:[2,134],128:[2,134],131:[2,134],132:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134]},{5:291,25:[1,5]},{26:[1,292],120:[1,293],121:258,122:[1,217]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],72:[2,172],77:[2,172],85:[2,172],90:[2,172],92:[2,172],101:[2,172],103:[2,172],104:[2,172],105:[2,172],109:[2,172],117:[2,172],125:[2,172],127:[2,172],128:[2,172],131:[2,172],132:[2,172],133:[2,172],134:[2,172],135:[2,172],136:[2,172]},{5:294,25:[1,5]},{26:[2,175],120:[2,175],122:[2,175]},{5:295,25:[1,5],54:[1,296]},{25:[2,130],54:[2,130],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,98],6:[2,98],25:[2,98],26:[2,98],49:[2,98],54:[2,98],57:[2,98],72:[2,98],77:[2,98],85:[2,98],90:[2,98],92:[2,98],101:[2,98],103:[2,98],104:[2,98],105:[2,98],109:[2,98],117:[2,98],125:[2,98],127:[2,98],128:[2,98],131:[2,98],132:[2,98],133:[2,98],134:[2,98],135:[2,98],136:[2,98]},{1:[2,101],5:297,6:[2,101],25:[1,5],26:[2,101],49:[2,101],54:[2,101],57:[2,101],72:[2,101],77:[2,101],85:[2,101],90:[2,101],92:[2,101],101:[2,101],102:87,103:[1,65],104:[2,101],105:[1,66],108:88,109:[1,68],110:69,117:[2,101],125:[2,101],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{101:[1,298]},{90:[1,299],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,115],6:[2,115],25:[2,115],26:[2,115],40:[2,115],49:[2,115],54:[2,115],57:[2,115],66:[2,115],67:[2,115],68:[2,115],70:[2,115],72:[2,115],73:[2,115],77:[2,115],83:[2,115],84:[2,115],85:[2,115],90:[2,115],92:[2,115],101:[2,115],103:[2,115],104:[2,115],105:[2,115],109:[2,115],115:[2,115],116:[2,115],117:[2,115],125:[2,115],127:[2,115],128:[2,115],131:[2,115],132:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],93:300,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:200,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,25:[1,146],27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,60:147,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],86:301,87:[1,58],88:[1,59],89:[1,57],93:145,95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],85:[2,124],90:[2,124]},{6:[1,266],25:[1,267],26:[1,302]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],72:[2,141],77:[2,141],85:[2,141],90:[2,141],92:[2,141],101:[2,141],102:87,103:[1,65],104:[2,141],105:[1,66],108:88,109:[1,68],110:69,117:[2,141],125:[2,141],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],72:[2,143],77:[2,143],85:[2,143],90:[2,143],92:[2,143],101:[2,143],102:87,103:[1,65],104:[2,143],105:[1,66],108:88,109:[1,68],110:69,117:[2,143],125:[2,143],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{115:[2,162],116:[2,162]},{8:303,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:304,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:305,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,89],6:[2,89],25:[2,89],26:[2,89],40:[2,89],49:[2,89],54:[2,89],57:[2,89],66:[2,89],67:[2,89],68:[2,89],70:[2,89],72:[2,89],73:[2,89],77:[2,89],83:[2,89],84:[2,89],85:[2,89],90:[2,89],92:[2,89],101:[2,89],103:[2,89],104:[2,89],105:[2,89],109:[2,89],115:[2,89],116:[2,89],117:[2,89],125:[2,89],127:[2,89],128:[2,89],131:[2,89],132:[2,89],133:[2,89],134:[2,89],135:[2,89],136:[2,89]},{11:168,27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:306,42:167,44:171,46:[1,46],88:[1,113]},{6:[2,90],11:168,25:[2,90],26:[2,90],27:169,28:[1,73],29:170,30:[1,71],31:[1,72],41:166,42:167,44:171,46:[1,46],54:[2,90],76:307,88:[1,113]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],77:[2,92]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],77:[2,40],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{8:308,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{72:[2,119],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,38],6:[2,38],25:[2,38],26:[2,38],49:[2,38],54:[2,38],57:[2,38],72:[2,38],77:[2,38],85:[2,38],90:[2,38],92:[2,38],101:[2,38],103:[2,38],104:[2,38],105:[2,38],109:[2,38],117:[2,38],125:[2,38],127:[2,38],128:[2,38],131:[2,38],132:[2,38],133:[2,38],134:[2,38],135:[2,38],136:[2,38]},{1:[2,110],6:[2,110],25:[2,110],26:[2,110],49:[2,110],54:[2,110],57:[2,110],66:[2,110],67:[2,110],68:[2,110],70:[2,110],72:[2,110],73:[2,110],77:[2,110],83:[2,110],84:[2,110],85:[2,110],90:[2,110],92:[2,110],101:[2,110],103:[2,110],104:[2,110],105:[2,110],109:[2,110],117:[2,110],125:[2,110],127:[2,110],128:[2,110],131:[2,110],132:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],72:[2,49],77:[2,49],85:[2,49],90:[2,49],92:[2,49],101:[2,49],103:[2,49],104:[2,49],105:[2,49],109:[2,49],117:[2,49],125:[2,49],127:[2,49],128:[2,49],131:[2,49],132:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{6:[2,53],25:[2,53],26:[2,53],53:309,54:[1,202]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],72:[2,200],77:[2,200],85:[2,200],90:[2,200],92:[2,200],101:[2,200],103:[2,200],104:[2,200],105:[2,200],109:[2,200],117:[2,200],125:[2,200],127:[2,200],128:[2,200],131:[2,200],132:[2,200],133:[2,200],134:[2,200],135:[2,200],136:[2,200]},{1:[2,179],6:[2,179],25:[2,179],26:[2,179],49:[2,179],54:[2,179],57:[2,179],72:[2,179],77:[2,179],85:[2,179],90:[2,179],92:[2,179],101:[2,179],103:[2,179],104:[2,179],105:[2,179],109:[2,179],117:[2,179],120:[2,179],125:[2,179],127:[2,179],128:[2,179],131:[2,179],132:[2,179],133:[2,179],134:[2,179],135:[2,179],136:[2,179]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],72:[2,135],77:[2,135],85:[2,135],90:[2,135],92:[2,135],101:[2,135],103:[2,135],104:[2,135],105:[2,135],109:[2,135],117:[2,135],125:[2,135],127:[2,135],128:[2,135],131:[2,135],132:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],72:[2,136],77:[2,136],85:[2,136],90:[2,136],92:[2,136],97:[2,136],101:[2,136],103:[2,136],104:[2,136],105:[2,136],109:[2,136],117:[2,136],125:[2,136],127:[2,136],128:[2,136],131:[2,136],132:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],72:[2,170],77:[2,170],85:[2,170],90:[2,170],92:[2,170],101:[2,170],103:[2,170],104:[2,170],105:[2,170],109:[2,170],117:[2,170],125:[2,170],127:[2,170],128:[2,170],131:[2,170],132:[2,170],133:[2,170],134:[2,170],135:[2,170],136:[2,170]},{5:310,25:[1,5]},{26:[1,311]},{6:[1,312],26:[2,176],120:[2,176],122:[2,176]},{8:313,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{1:[2,102],6:[2,102],25:[2,102],26:[2,102],49:[2,102],54:[2,102],57:[2,102],72:[2,102],77:[2,102],85:[2,102],90:[2,102],92:[2,102],101:[2,102],103:[2,102],104:[2,102],105:[2,102],109:[2,102],117:[2,102],125:[2,102],127:[2,102],128:[2,102],131:[2,102],132:[2,102],133:[2,102],134:[2,102],135:[2,102],136:[2,102]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],66:[2,139],67:[2,139],68:[2,139],70:[2,139],72:[2,139],73:[2,139],77:[2,139],83:[2,139],84:[2,139],85:[2,139],90:[2,139],92:[2,139],101:[2,139],103:[2,139],104:[2,139],105:[2,139],109:[2,139],117:[2,139],125:[2,139],127:[2,139],128:[2,139],131:[2,139],132:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139]},{1:[2,118],6:[2,118],25:[2,118],26:[2,118],49:[2,118],54:[2,118],57:[2,118],66:[2,118],67:[2,118],68:[2,118],70:[2,118],72:[2,118],73:[2,118],77:[2,118],83:[2,118],84:[2,118],85:[2,118],90:[2,118],92:[2,118],101:[2,118],103:[2,118],104:[2,118],105:[2,118],109:[2,118],117:[2,118],125:[2,118],127:[2,118],128:[2,118],131:[2,118],132:[2,118],133:[2,118],134:[2,118],135:[2,118],136:[2,118]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],85:[2,125],90:[2,125]},{6:[2,53],25:[2,53],26:[2,53],53:314,54:[1,226]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],85:[2,126],90:[2,126]},{1:[2,165],6:[2,165],25:[2,165],26:[2,165],49:[2,165],54:[2,165],57:[2,165],72:[2,165],77:[2,165],85:[2,165],90:[2,165],92:[2,165],101:[2,165],102:87,103:[2,165],104:[2,165],105:[2,165],108:88,109:[2,165],110:69,117:[1,315],125:[2,165],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],72:[2,167],77:[2,167],85:[2,167],90:[2,167],92:[2,167],101:[2,167],102:87,103:[2,167],104:[1,316],105:[2,167],108:88,109:[2,167],110:69,117:[2,167],125:[2,167],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,166],6:[2,166],25:[2,166],26:[2,166],49:[2,166],54:[2,166],57:[2,166],72:[2,166],77:[2,166],85:[2,166],90:[2,166],92:[2,166],101:[2,166],102:87,103:[2,166],104:[2,166],105:[2,166],108:88,109:[2,166],110:69,117:[2,166],125:[2,166],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],77:[2,93]},{6:[2,53],25:[2,53],26:[2,53],53:317,54:[1,236]},{26:[1,318],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,247],25:[1,248],26:[1,319]},{26:[1,320]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],72:[2,173],77:[2,173],85:[2,173],90:[2,173],92:[2,173],101:[2,173],103:[2,173],104:[2,173],105:[2,173],109:[2,173],117:[2,173],125:[2,173],127:[2,173],128:[2,173],131:[2,173],132:[2,173],133:[2,173],134:[2,173],135:[2,173],136:[2,173]},{26:[2,177],120:[2,177],122:[2,177]},{25:[2,131],54:[2,131],102:87,103:[1,65],105:[1,66],108:88,109:[1,68],110:69,125:[1,86],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[1,266],25:[1,267],26:[1,321]},{8:322,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{8:323,9:117,10:20,11:21,12:[1,22],13:8,14:9,15:10,16:11,17:12,18:13,19:14,20:15,21:16,22:17,23:18,24:19,27:62,28:[1,73],29:49,30:[1,71],31:[1,72],32:24,33:[1,50],34:[1,51],35:[1,52],36:[1,53],37:[1,54],38:[1,55],39:23,44:63,45:[1,45],46:[1,46],47:[1,29],50:30,51:[1,60],52:[1,61],58:47,59:48,61:36,63:25,64:26,65:27,75:[1,70],78:[1,43],82:[1,28],87:[1,58],88:[1,59],89:[1,57],95:[1,38],99:[1,44],100:[1,56],102:39,103:[1,65],105:[1,66],106:40,107:[1,67],108:41,109:[1,68],110:69,118:[1,42],123:37,124:[1,64],126:[1,31],127:[1,32],128:[1,33],129:[1,34],130:[1,35]},{6:[1,277],25:[1,278],26:[1,324]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],77:[2,41]},{6:[2,59],25:[2,59],26:[2,59],49:[2,59],54:[2,59]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],72:[2,171],77:[2,171],85:[2,171],90:[2,171],92:[2,171],101:[2,171],103:[2,171],104:[2,171],105:[2,171],109:[2,171],117:[2,171],125:[2,171],127:[2,171],128:[2,171],131:[2,171],132:[2,171],133:[2,171],134:[2,171],135:[2,171],136:[2,171]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],85:[2,127],90:[2,127]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],72:[2,168],77:[2,168],85:[2,168],90:[2,168],92:[2,168],101:[2,168],102:87,103:[2,168],104:[2,168],105:[2,168],108:88,109:[2,168],110:69,117:[2,168],125:[2,168],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],72:[2,169],77:[2,169],85:[2,169],90:[2,169],92:[2,169],101:[2,169],102:87,103:[2,169],104:[2,169],105:[2,169],108:88,109:[2,169],110:69,117:[2,169],125:[2,169],127:[1,80],128:[1,79],131:[1,78],132:[1,81],133:[1,82],134:[1,83],135:[1,84],136:[1,85]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],77:[2,94]}], |
|
3803 |
defaultActions: {60:[2,51],61:[2,52],75:[2,3],94:[2,108],189:[2,88]}, |
|
3804 |
parseError: function parseError(str, hash) { |
|
3805 |
throw new Error(str); |
|
3806 |
},
|
|
3807 |
parse: function parse(input) { |
|
3808 |
var self = this, |
|
3809 |
stack = [0], |
|
3810 |
vstack = [null], // semantic value stack |
|
3811 |
lstack = [], // location stack |
|
3812 |
table = this.table, |
|
3813 |
yytext = '', |
|
3814 |
yylineno = 0, |
|
3815 |
yyleng = 0, |
|
3816 |
recovering = 0, |
|
3817 |
TERROR = 2, |
|
3818 |
EOF = 1; |
|
3819 |
||
3820 |
this.lexer.setInput(input); |
|
3821 |
this.lexer.yy = this.yy; |
|
3822 |
this.yy.lexer = this.lexer; |
|
3823 |
if (typeof this.lexer.yylloc == 'undefined') |
|
3824 |
this.lexer.yylloc = {}; |
|
3825 |
var yyloc = this.lexer.yylloc; |
|
3826 |
lstack.push(yyloc); |
|
3827 |
||
3828 |
if (typeof this.yy.parseError === 'function') |
|
3829 |
this.parseError = this.yy.parseError; |
|
3830 |
||
3831 |
function popStack (n) { |
|
3832 |
stack.length = stack.length - 2*n; |
|
3833 |
vstack.length = vstack.length - n; |
|
3834 |
lstack.length = lstack.length - n; |
|
3835 |
} |
|
3836 |
||
3837 |
function lex() { |
|
3838 |
var token; |
|
3839 |
token = self.lexer.lex() || 1; // $end = 1 |
|
3840 |
if (typeof token !== 'number') { |
|
3841 |
token = self.symbols_[token] || token; |
|
3842 |
} |
|
3843 |
return token; |
|
3844 |
} |
|
3845 |
||
3846 |
var symbol, preErrorSymbol, state, action, a, r, yyval={},p,len,newState, expected; |
|
3847 |
while (true) { |
|
3848 |
state = stack[stack.length-1]; |
|
3849 |
if (this.defaultActions[state]) { |
|
3850 |
action = this.defaultActions[state]; |
|
3851 |
} else { |
|
3852 |
if (symbol == null) |
|
3853 |
symbol = lex(); |
|
3854 |
action = table[state] && table[state][symbol]; |
|
3855 |
} |
|
3856 |
_handle_error: |
|
3857 |
if (typeof action === 'undefined' || !action.length || !action[0]) { |
|
3858 |
||
3859 |
if (!recovering) { |
|
3860 |
expected = []; |
|
3861 |
for (p in table[state]) if (this.terminals_[p] && p > 2) { |
|
3862 |
expected.push("'"+this.terminals_[p]+"'"); |
|
3863 |
} |
|
3864 |
var errStr = ''; |
|
3865 |
if (this.lexer.showPosition) { |
|
3866 |
errStr = 'Parse error on line '+(yylineno+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+expected.join(', ') + ", got '" + this.terminals_[symbol]+ "'"; |
|
3867 |
} else { |
|
3868 |
errStr = 'Parse error on line '+(yylineno+1)+": Unexpected " + |
|
3869 |
(symbol == 1 /*EOF*/ ? "end of input" : |
|
3870 |
("'"+(this.terminals_[symbol] || symbol)+"'")); |
|
3871 |
} |
|
3872 |
this.parseError(errStr, |
|
3873 |
{text: this.lexer.match, token: this.terminals_[symbol] || symbol, line: this.lexer.yylineno, loc: yyloc, expected: expected}); |
|
3874 |
} |
|
3875 |
if (recovering == 3) { |
|
3876 |
if (symbol == EOF) { |
|
3877 |
throw new Error(errStr || 'Parsing halted.'); |
|
3878 |
} |
|
3879 |
yyleng = this.lexer.yyleng; |
|
3880 |
yytext = this.lexer.yytext; |
|
3881 |
yylineno = this.lexer.yylineno; |
|
3882 |
yyloc = this.lexer.yylloc; |
|
3883 |
symbol = lex(); |
|
3884 |
} |
|
3885 |
while (1) { |
|
3886 |
if ((TERROR.toString()) in table[state]) { |
|
3887 |
break; |
|
3888 |
} |
|
3889 |
if (state == 0) { |
|
3890 |
throw new Error(errStr || 'Parsing halted.'); |
|
3891 |
} |
|
3892 |
popStack(1); |
|
3893 |
state = stack[stack.length-1]; |
|
3894 |
} |
|
3895 |
||
3896 |
preErrorSymbol = symbol; // save the lookahead token |
|
3897 |
symbol = TERROR; // insert generic error symbol as new lookahead |
|
3898 |
state = stack[stack.length-1]; |
|
3899 |
action = table[state] && table[state][TERROR]; |
|
3900 |
recovering = 3; // allow 3 real symbols to be shifted before reporting a new error |
|
3901 |
} |
|
3902 |
if (action[0] instanceof Array && action.length > 1) { |
|
3903 |
throw new Error('Parse Error: multiple actions possible at state: '+state+', token: '+symbol); |
|
3904 |
} |
|
3905 |
||
3906 |
switch (action[0]) { |
|
3907 |
||
3908 |
case 1: // shift |
|
3909 |
||
3910 |
stack.push(symbol); |
|
3911 |
vstack.push(this.lexer.yytext); |
|
3912 |
lstack.push(this.lexer.yylloc); |
|
3913 |
stack.push(action[1]); // push state |
|
3914 |
symbol = null; |
|
3915 |
if (!preErrorSymbol) { // normal execution/no error |
|
3916 |
yyleng = this.lexer.yyleng; |
|
3917 |
yytext = this.lexer.yytext; |
|
3918 |
yylineno = this.lexer.yylineno; |
|
3919 |
yyloc = this.lexer.yylloc; |
|
3920 |
if (recovering > 0) |
|
3921 |
recovering--; |
|
3922 |
} else { // error just occurred, resume old lookahead f/ before error |
|
3923 |
symbol = preErrorSymbol; |
|
3924 |
preErrorSymbol = null; |
|
3925 |
} |
|
3926 |
break; |
|
3927 |
||
3928 |
case 2: // reduce |
|
3929 |
||
3930 |
len = this.productions_[action[1]][1]; |
|
3931 |
yyval.$ = vstack[vstack.length-len]; // default to $$ = $1 |
|
3932 |
yyval._$ = { |
|
3933 |
first_line: lstack[lstack.length-(len||1)].first_line, |
|
3934 |
last_line: lstack[lstack.length-1].last_line, |
|
3935 |
first_column: lstack[lstack.length-(len||1)].first_column, |
|
3936 |
last_column: lstack[lstack.length-1].last_column |
|
3937 |
}; |
|
3938 |
r = this.performAction.call(yyval, yytext, yyleng, yylineno, this.yy, action[1], vstack, lstack); |
|
3939 |
||
3940 |
if (typeof r !== 'undefined') { |
|
3941 |
return r; |
|
3942 |
} |
|
3943 |
if (len) { |
|
3944 |
stack = stack.slice(0,-1*len*2); |
|
3945 |
vstack = vstack.slice(0, -1*len); |
|
3946 |
lstack = lstack.slice(0, -1*len); |
|
3947 |
} |
|
3948 |
||
3949 |
stack.push(this.productions_[action[1]][0]); // push nonterminal (reduce) |
|
3950 |
vstack.push(yyval.$); |
|
3951 |
lstack.push(yyval._$); |
|
3952 |
newState = table[stack[stack.length-2]][stack[stack.length-1]]; |
|
3953 |
stack.push(newState); |
|
3954 |
break; |
|
3955 |
||
3956 |
case 3: // accept |
|
3957 |
return true; |
|
3958 |
} |
|
3959 |
||
3960 |
} |
|
3961 |
||
3962 |
return true; |
|
3963 |
}};
|
|
3964 |
undefined
|
|
3965 |
||
3966 |
module.exports = parser; |
|
3967 |
||
3968 |
||
3969 |
});
|
|
3970 |
||
3971 |
define('ace/mode/coffee/nodes', ['require', 'exports', 'module' , 'ace/mode/coffee/scope', 'ace/mode/coffee/lexer', 'ace/mode/coffee/helpers'], function(require, exports, module) { |
|
3972 |
||
3973 |
var Access, Arr, Assign, Base, Block, Call, Class, Closure, Code, Comment, Existence, Extends, For, IDENTIFIER, IDENTIFIER_STR, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, compact, del, ends, extend, flatten, last, merge, multident, some, starts, unfoldSoak, utility, _ref, _ref1, |
|
3974 |
__hasProp = {}.hasOwnProperty, |
|
3975 |
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, |
|
3976 |
__indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; |
|
3977 |
||
3978 |
Scope = require('./scope').Scope; |
|
3979 |
||
3980 |
_ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED; |
|
3981 |
||
3982 |
_ref1 = require('./helpers'), compact = _ref1.compact, flatten = _ref1.flatten, extend = _ref1.extend, merge = _ref1.merge, del = _ref1.del, starts = _ref1.starts, ends = _ref1.ends, last = _ref1.last, some = _ref1.some; |
|
3983 |
||
3984 |
exports.extend = extend; |
|
3985 |
||
3986 |
YES = function() { |
|
3987 |
return true; |
|
3988 |
}; |
|
3989 |
||
3990 |
NO = function() { |
|
3991 |
return false; |
|
3992 |
}; |
|
3993 |
||
3994 |
THIS = function() { |
|
3995 |
return this; |
|
3996 |
}; |
|
3997 |
||
3998 |
NEGATE = function() { |
|
3999 |
this.negated = !this.negated; |
|
4000 |
return this; |
|
4001 |
}; |
|
4002 |
||
4003 |
exports.Base = Base = (function() { |
|
4004 |
||
4005 |
function Base() {} |
|
4006 |
||
4007 |
Base.prototype.compile = function(o, lvl) { |
|
4008 |
var node; |
|
4009 |
o = extend({}, o); |
|
4010 |
if (lvl) { |
|
4011 |
o.level = lvl; |
|
4012 |
} |
|
4013 |
node = this.unfoldSoak(o) || this; |
|
4014 |
node.tab = o.indent; |
|
4015 |
if (o.level === LEVEL_TOP || !node.isStatement(o)) { |
|
4016 |
return node.compileNode(o); |
|
4017 |
} else { |
|
4018 |
return node.compileClosure(o); |
|
4019 |
} |
|
4020 |
}; |
|
4021 |
||
4022 |
Base.prototype.compileClosure = function(o) { |
|
4023 |
if (this.jumps()) { |
|
4024 |
throw SyntaxError('cannot use a pure statement in an expression.'); |
|
4025 |
} |
|
4026 |
o.sharedScope = true; |
|
4027 |
return Closure.wrap(this).compileNode(o); |
|
4028 |
}; |
|
4029 |
||
4030 |
Base.prototype.cache = function(o, level, reused) { |
|
4031 |
var ref, sub; |
|
4032 |
if (!this.isComplex()) { |
|
4033 |
ref = level ? this.compile(o, level) : this; |
|
4034 |
return [ref, ref]; |
|
4035 |
} else { |
|
4036 |
ref = new Literal(reused || o.scope.freeVariable('ref')); |
|
4037 |
sub = new Assign(ref, this); |
|
4038 |
if (level) { |
|
4039 |
return [sub.compile(o, level), ref.value]; |
|
4040 |
} else { |
|
4041 |
return [sub, ref]; |
|
4042 |
} |
|
4043 |
} |
|
4044 |
}; |
|
4045 |
||
4046 |
Base.prototype.compileLoopReference = function(o, name) { |
|
4047 |
var src, tmp; |
|
4048 |
src = tmp = this.compile(o, LEVEL_LIST); |
|
4049 |
if (!((-Infinity < +src && +src < Infinity) || IDENTIFIER.test(src) && o.scope.check(src, true))) { |
|
4050 |
src = "" + (tmp = o.scope.freeVariable(name)) + " = " + src; |
|
4051 |
} |
|
4052 |
return [src, tmp]; |
|
4053 |
}; |
|
4054 |
||
4055 |
Base.prototype.makeReturn = function(res) { |
|
4056 |
var me; |
|
4057 |
me = this.unwrapAll(); |
|
4058 |
if (res) { |
|
4059 |
return new Call(new Literal("" + res + ".push"), [me]); |
|
4060 |
} else { |
|
4061 |
return new Return(me); |
|
4062 |
} |
|
4063 |
}; |
|
4064 |
||
4065 |
Base.prototype.contains = function(pred) { |
|
4066 |
var contains; |
|
4067 |
contains = false; |
|
4068 |
this.traverseChildren(false, function(node) { |
|
4069 |
if (pred(node)) { |
|
4070 |
contains = true; |
|
4071 |
return false; |
|
4072 |
} |
|
4073 |
}); |
|
4074 |
return contains; |
|
4075 |
}; |
|
4076 |
||
4077 |
Base.prototype.containsType = function(type) { |
|
4078 |
return this instanceof type || this.contains(function(node) { |
|
4079 |
return node instanceof type; |
|
4080 |
}); |
|
4081 |
}; |
|
4082 |
||
4083 |
Base.prototype.lastNonComment = function(list) { |
|
4084 |
var i; |
|
4085 |
i = list.length; |
|
4086 |
while (i--) { |
|
4087 |
if (!(list[i] instanceof Comment)) { |
|
4088 |
return list[i]; |
|
4089 |
} |
|
4090 |
} |
|
4091 |
return null; |
|
4092 |
}; |
|
4093 |
||
4094 |
Base.prototype.toString = function(idt, name) { |
|
4095 |
var tree; |
|
4096 |
if (idt == null) { |
|
4097 |
idt = ''; |
|
4098 |
} |
|
4099 |
if (name == null) { |
|
4100 |
name = this.constructor.name; |
|
4101 |
} |
|
4102 |
tree = '\n' + idt + name; |
|
4103 |
if (this.soak) { |
|
4104 |
tree += '?'; |
|
4105 |
} |
|
4106 |
this.eachChild(function(node) { |
|
4107 |
return tree += node.toString(idt + TAB); |
|
4108 |
}); |
|
4109 |
return tree; |
|
4110 |
}; |
|
4111 |
||
4112 |
Base.prototype.eachChild = function(func) { |
|
4113 |
var attr, child, _i, _j, _len, _len1, _ref2, _ref3; |
|
4114 |
if (!this.children) { |
|
4115 |
return this; |
|
4116 |
} |
|
4117 |
_ref2 = this.children; |
|
4118 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
4119 |
attr = _ref2[_i]; |
|
4120 |
if (this[attr]) { |
|
4121 |
_ref3 = flatten([this[attr]]); |
|
4122 |
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { |
|
4123 |
child = _ref3[_j]; |
|
4124 |
if (func(child) === false) { |
|
4125 |
return this; |
|
4126 |
} |
|
4127 |
} |
|
4128 |
} |
|
4129 |
} |
|
4130 |
return this; |
|
4131 |
}; |
|
4132 |
||
4133 |
Base.prototype.traverseChildren = function(crossScope, func) { |
|
4134 |
return this.eachChild(function(child) { |
|
4135 |
if (func(child) === false) { |
|
4136 |
return false; |
|
4137 |
} |
|
4138 |
return child.traverseChildren(crossScope, func); |
|
4139 |
}); |
|
4140 |
}; |
|
4141 |
||
4142 |
Base.prototype.invert = function() { |
|
4143 |
return new Op('!', this); |
|
4144 |
}; |
|
4145 |
||
4146 |
Base.prototype.unwrapAll = function() { |
|
4147 |
var node; |
|
4148 |
node = this; |
|
4149 |
while (node !== (node = node.unwrap())) { |
|
4150 |
continue; |
|
4151 |
} |
|
4152 |
return node; |
|
4153 |
}; |
|
4154 |
||
4155 |
Base.prototype.children = []; |
|
4156 |
||
4157 |
Base.prototype.isStatement = NO; |
|
4158 |
||
4159 |
Base.prototype.jumps = NO; |
|
4160 |
||
4161 |
Base.prototype.isComplex = YES; |
|
4162 |
||
4163 |
Base.prototype.isChainable = NO; |
|
4164 |
||
4165 |
Base.prototype.isAssignable = NO; |
|
4166 |
||
4167 |
Base.prototype.unwrap = THIS; |
|
4168 |
||
4169 |
Base.prototype.unfoldSoak = NO; |
|
4170 |
||
4171 |
Base.prototype.assigns = NO; |
|
4172 |
||
4173 |
return Base; |
|
4174 |
||
4175 |
})(); |
|
4176 |
||
4177 |
exports.Block = Block = (function(_super) { |
|
4178 |
||
4179 |
__extends(Block, _super); |
|
4180 |
||
4181 |
function Block(nodes) { |
|
4182 |
this.expressions = compact(flatten(nodes || [])); |
|
4183 |
} |
|
4184 |
||
4185 |
Block.prototype.children = ['expressions']; |
|
4186 |
||
4187 |
Block.prototype.push = function(node) { |
|
4188 |
this.expressions.push(node); |
|
4189 |
return this; |
|
4190 |
}; |
|
4191 |
||
4192 |
Block.prototype.pop = function() { |
|
4193 |
return this.expressions.pop(); |
|
4194 |
}; |
|
4195 |
||
4196 |
Block.prototype.unshift = function(node) { |
|
4197 |
this.expressions.unshift(node); |
|
4198 |
return this; |
|
4199 |
}; |
|
4200 |
||
4201 |
Block.prototype.unwrap = function() { |
|
4202 |
if (this.expressions.length === 1) { |
|
4203 |
return this.expressions[0]; |
|
4204 |
} else { |
|
4205 |
return this; |
|
4206 |
} |
|
4207 |
}; |
|
4208 |
||
4209 |
Block.prototype.isEmpty = function() { |
|
4210 |
return !this.expressions.length; |
|
4211 |
}; |
|
4212 |
||
4213 |
Block.prototype.isStatement = function(o) { |
|
4214 |
var exp, _i, _len, _ref2; |
|
4215 |
_ref2 = this.expressions; |
|
4216 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
4217 |
exp = _ref2[_i]; |
|
4218 |
if (exp.isStatement(o)) { |
|
4219 |
return true; |
|
4220 |
} |
|
4221 |
} |
|
4222 |
return false; |
|
4223 |
}; |
|
4224 |
||
4225 |
Block.prototype.jumps = function(o) { |
|
4226 |
var exp, _i, _len, _ref2; |
|
4227 |
_ref2 = this.expressions; |
|
4228 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
4229 |
exp = _ref2[_i]; |
|
4230 |
if (exp.jumps(o)) { |
|
4231 |
return exp; |
|
4232 |
} |
|
4233 |
} |
|
4234 |
}; |
|
4235 |
||
4236 |
Block.prototype.makeReturn = function(res) { |
|
4237 |
var expr, len; |
|
4238 |
len = this.expressions.length; |
|
4239 |
while (len--) { |
|
4240 |
expr = this.expressions[len]; |
|
4241 |
if (!(expr instanceof Comment)) { |
|
4242 |
this.expressions[len] = expr.makeReturn(res); |
|
4243 |
if (expr instanceof Return && !expr.expression) { |
|
4244 |
this.expressions.splice(len, 1); |
|
4245 |
} |
|
4246 |
break; |
|
4247 |
} |
|
4248 |
} |
|
4249 |
return this; |
|
4250 |
}; |
|
4251 |
||
4252 |
Block.prototype.compile = function(o, level) { |
|
4253 |
if (o == null) { |
|
4254 |
o = {}; |
|
4255 |
} |
|
4256 |
if (o.scope) { |
|
4257 |
return Block.__super__.compile.call(this, o, level); |
|
4258 |
} else { |
|
4259 |
return this.compileRoot(o); |
|
4260 |
} |
|
4261 |
}; |
|
4262 |
||
4263 |
Block.prototype.compileNode = function(o) { |
|
4264 |
var code, codes, node, top, _i, _len, _ref2; |
|
4265 |
this.tab = o.indent; |
|
4266 |
top = o.level === LEVEL_TOP; |
|
4267 |
codes = []; |
|
4268 |
_ref2 = this.expressions; |
|
4269 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
4270 |
node = _ref2[_i]; |
|
4271 |
node = node.unwrapAll(); |
|
4272 |
node = node.unfoldSoak(o) || node; |
|
4273 |
if (node instanceof Block) { |
|
4274 |
codes.push(node.compileNode(o)); |
|
4275 |
} else if (top) { |
|
4276 |
node.front = true; |
|
4277 |
code = node.compile(o); |
|
4278 |
if (!node.isStatement(o)) { |
|
4279 |
code = "" + this.tab + code + ";"; |
|
4280 |
if (node instanceof Literal) { |
|
4281 |
code = "" + code + "\n"; |
|
4282 |
} |
|
4283 |
} |
|
4284 |
codes.push(code); |
|
4285 |
} else { |
|
4286 |
codes.push(node.compile(o, LEVEL_LIST)); |
|
4287 |
} |
|
4288 |
} |
|
4289 |
if (top) { |
|
4290 |
if (this.spaced) { |
|
4291 |
return "\n" + (codes.join('\n\n')) + "\n"; |
|
4292 |
} else { |
|
4293 |
return codes.join('\n'); |
|
4294 |
} |
|
4295 |
} |
|
4296 |
code = codes.join(', ') || 'void 0'; |
|
4297 |
if (codes.length > 1 && o.level >= LEVEL_LIST) { |
|
4298 |
return "(" + code + ")"; |
|
4299 |
} else { |
|
4300 |
return code; |
|
4301 |
} |
|
4302 |
}; |
|
4303 |
||
4304 |
Block.prototype.compileRoot = function(o) { |
|
4305 |
var code, exp, i, prelude, preludeExps, rest; |
|
4306 |
o.indent = o.bare ? '' : TAB; |
|
4307 |
o.scope = new Scope(null, this, null); |
|
4308 |
o.level = LEVEL_TOP; |
|
4309 |
this.spaced = true; |
|
4310 |
prelude = ""; |
|
4311 |
if (!o.bare) { |
|
4312 |
preludeExps = (function() { |
|
4313 |
var _i, _len, _ref2, _results; |
|
4314 |
_ref2 = this.expressions; |
|
4315 |
_results = []; |
|
4316 |
for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { |
|
4317 |
exp = _ref2[i]; |
|
4318 |
if (!(exp.unwrap() instanceof Comment)) { |
|
4319 |
break; |
|
4320 |
} |
|
4321 |
_results.push(exp); |
|
4322 |
} |
|
4323 |
return _results; |
|
4324 |
}).call(this); |
|
4325 |
rest = this.expressions.slice(preludeExps.length); |
|
4326 |
this.expressions = preludeExps; |
|
4327 |
if (preludeExps.length) { |
|
4328 |
prelude = "" + (this.compileNode(merge(o, { |
|
4329 |
indent: '' |
|
4330 |
}))) + "\n"; |
|
4331 |
} |
|
4332 |
this.expressions = rest; |
|
4333 |
} |
|
4334 |
code = this.compileWithDeclarations(o); |
|
4335 |
if (o.bare) { |
|
4336 |
return code; |
|
4337 |
} |
|
4338 |
return "" + prelude + "(function() {\n" + code + "\n}).call(this);\n"; |
|
4339 |
}; |
|
4340 |
||
4341 |
Block.prototype.compileWithDeclarations = function(o) { |
|
4342 |
var assigns, code, declars, exp, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4; |
|
4343 |
code = post = ''; |
|
4344 |
_ref2 = this.expressions; |
|
4345 |
for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { |
|
4346 |
exp = _ref2[i]; |
|
4347 |
exp = exp.unwrap(); |
|
4348 |
if (!(exp instanceof Comment || exp instanceof Literal)) { |
|
4349 |
break; |
|
4350 |
} |
|
4351 |
} |
|
4352 |
o = merge(o, { |
|
4353 |
level: LEVEL_TOP |
|
4354 |
}); |
|
4355 |
if (i) { |
|
4356 |
rest = this.expressions.splice(i, 9e9); |
|
4357 |
_ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1]; |
|
4358 |
_ref4 = [this.compileNode(o), spaced], code = _ref4[0], this.spaced = _ref4[1]; |
|
4359 |
this.expressions = rest; |
|
4360 |
} |
|
4361 |
post = this.compileNode(o); |
|
4362 |
scope = o.scope; |
|
4363 |
if (scope.expressions === this) { |
|
4364 |
declars = o.scope.hasDeclarations(); |
|
4365 |
assigns = scope.hasAssignments; |
|
4366 |
if (declars || assigns) { |
|
4367 |
if (i) { |
|
4368 |
code += '\n'; |
|
4369 |
} |
|
4370 |
code += "" + this.tab + "var "; |
|
4371 |
if (declars) { |
|
4372 |
code += scope.declaredVariables().join(', '); |
|
4373 |
} |
|
4374 |
if (assigns) { |
|
4375 |
if (declars) { |
|
4376 |
code += ",\n" + (this.tab + TAB); |
|
4377 |
} |
|
4378 |
code += scope.assignedVariables().join(",\n" + (this.tab + TAB)); |
|
4379 |
} |
|
4380 |
code += ';\n'; |
|
4381 |
} |
|
4382 |
} |
|
4383 |
return code + post; |
|
4384 |
}; |
|
4385 |
||
4386 |
Block.wrap = function(nodes) { |
|
4387 |
if (nodes.length === 1 && nodes[0] instanceof Block) { |
|
4388 |
return nodes[0]; |
|
4389 |
} |
|
4390 |
return new Block(nodes); |
|
4391 |
}; |
|
4392 |
||
4393 |
return Block; |
|
4394 |
||
4395 |
})(Base); |
|
4396 |
||
4397 |
exports.Literal = Literal = (function(_super) { |
|
4398 |
||
4399 |
__extends(Literal, _super); |
|
4400 |
||
4401 |
function Literal(value) { |
|
4402 |
this.value = value; |
|
4403 |
} |
|
4404 |
||
4405 |
Literal.prototype.makeReturn = function() { |
|
4406 |
if (this.isStatement()) { |
|
4407 |
return this; |
|
4408 |
} else { |
|
4409 |
return Literal.__super__.makeReturn.apply(this, arguments); |
|
4410 |
} |
|
4411 |
}; |
|
4412 |
||
4413 |
Literal.prototype.isAssignable = function() { |
|
4414 |
return IDENTIFIER.test(this.value); |
|
4415 |
}; |
|
4416 |
||
4417 |
Literal.prototype.isStatement = function() { |
|
4418 |
var _ref2; |
|
4419 |
return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger'; |
|
4420 |
}; |
|
4421 |
||
4422 |
Literal.prototype.isComplex = NO; |
|
4423 |
||
4424 |
Literal.prototype.assigns = function(name) { |
|
4425 |
return name === this.value; |
|
4426 |
}; |
|
4427 |
||
4428 |
Literal.prototype.jumps = function(o) { |
|
4429 |
if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) { |
|
4430 |
return this; |
|
4431 |
} |
|
4432 |
if (this.value === 'continue' && !(o != null ? o.loop : void 0)) { |
|
4433 |
return this; |
|
4434 |
} |
|
4435 |
}; |
|
4436 |
||
4437 |
Literal.prototype.compileNode = function(o) { |
|
4438 |
var code, _ref2; |
|
4439 |
code = this.value === 'this' ? ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0) ? o.scope.method.context : this.value : this.value.reserved ? "\"" + this.value + "\"" : this.value; |
|
4440 |
if (this.isStatement()) { |
|
4441 |
return "" + this.tab + code + ";"; |
|
4442 |
} else { |
|
4443 |
return code; |
|
4444 |
} |
|
4445 |
}; |
|
4446 |
||
4447 |
Literal.prototype.toString = function() { |
|
4448 |
return ' "' + this.value + '"'; |
|
4449 |
}; |
|
4450 |
||
4451 |
return Literal; |
|
4452 |
||
4453 |
})(Base); |
|
4454 |
||
4455 |
exports.Undefined = (function(_super) { |
|
4456 |
||
4457 |
__extends(Undefined, _super); |
|
4458 |
||
4459 |
function Undefined() { |
|
4460 |
return Undefined.__super__.constructor.apply(this, arguments); |
|
4461 |
} |
|
4462 |
||
4463 |
Undefined.prototype.isAssignable = NO; |
|
4464 |
||
4465 |
Undefined.prototype.isComplex = NO; |
|
4466 |
||
4467 |
Undefined.prototype.compileNode = function(o) { |
|
4468 |
if (o.level >= LEVEL_ACCESS) { |
|
4469 |
return '(void 0)'; |
|
4470 |
} else { |
|
4471 |
return 'void 0'; |
|
4472 |
} |
|
4473 |
}; |
|
4474 |
||
4475 |
return Undefined; |
|
4476 |
||
4477 |
})(Base); |
|
4478 |
||
4479 |
exports.Null = (function(_super) { |
|
4480 |
||
4481 |
__extends(Null, _super); |
|
4482 |
||
4483 |
function Null() { |
|
4484 |
return Null.__super__.constructor.apply(this, arguments); |
|
4485 |
} |
|
4486 |
||
4487 |
Null.prototype.isAssignable = NO; |
|
4488 |
||
4489 |
Null.prototype.isComplex = NO; |
|
4490 |
||
4491 |
Null.prototype.compileNode = function() { |
|
4492 |
return "null"; |
|
4493 |
}; |
|
4494 |
||
4495 |
return Null; |
|
4496 |
||
4497 |
})(Base); |
|
4498 |
||
4499 |
exports.Bool = (function(_super) { |
|
4500 |
||
4501 |
__extends(Bool, _super); |
|
4502 |
||
4503 |
Bool.prototype.isAssignable = NO; |
|
4504 |
||
4505 |
Bool.prototype.isComplex = NO; |
|
4506 |
||
4507 |
Bool.prototype.compileNode = function() { |
|
4508 |
return this.val; |
|
4509 |
}; |
|
4510 |
||
4511 |
function Bool(val) { |
|
4512 |
this.val = val; |
|
4513 |
} |
|
4514 |
||
4515 |
return Bool; |
|
4516 |
||
4517 |
})(Base); |
|
4518 |
||
4519 |
exports.Return = Return = (function(_super) { |
|
4520 |
||
4521 |
__extends(Return, _super); |
|
4522 |
||
4523 |
function Return(expr) { |
|
4524 |
if (expr && !expr.unwrap().isUndefined) { |
|
4525 |
this.expression = expr; |
|
4526 |
} |
|
4527 |
} |
|
4528 |
||
4529 |
Return.prototype.children = ['expression']; |
|
4530 |
||
4531 |
Return.prototype.isStatement = YES; |
|
4532 |
||
4533 |
Return.prototype.makeReturn = THIS; |
|
4534 |
||
4535 |
Return.prototype.jumps = THIS; |
|
4536 |
||
4537 |
Return.prototype.compile = function(o, level) { |
|
4538 |
var expr, _ref2; |
|
4539 |
expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0; |
|
4540 |
if (expr && !(expr instanceof Return)) { |
|
4541 |
return expr.compile(o, level); |
|
4542 |
} else { |
|
4543 |
return Return.__super__.compile.call(this, o, level); |
|
4544 |
} |
|
4545 |
}; |
|
4546 |
||
4547 |
Return.prototype.compileNode = function(o) { |
|
4548 |
return this.tab + ("return" + [this.expression ? " " + (this.expression.compile(o, LEVEL_PAREN)) : void 0] + ";"); |
|
4549 |
}; |
|
4550 |
||
4551 |
return Return; |
|
4552 |
||
4553 |
})(Base); |
|
4554 |
||
4555 |
exports.Value = Value = (function(_super) { |
|
4556 |
||
4557 |
__extends(Value, _super); |
|
4558 |
||
4559 |
function Value(base, props, tag) { |
|
4560 |
if (!props && base instanceof Value) { |
|
4561 |
return base; |
|
4562 |
} |
|
4563 |
this.base = base; |
|
4564 |
this.properties = props || []; |
|
4565 |
if (tag) { |
|
4566 |
this[tag] = true; |
|
4567 |
} |
|
4568 |
return this; |
|
4569 |
} |
|
4570 |
||
4571 |
Value.prototype.children = ['base', 'properties']; |
|
4572 |
||
4573 |
Value.prototype.add = function(props) { |
|
4574 |
this.properties = this.properties.concat(props); |
|
4575 |
return this; |
|
4576 |
}; |
|
4577 |
||
4578 |
Value.prototype.hasProperties = function() { |
|
4579 |
return !!this.properties.length; |
|
4580 |
}; |
|
4581 |
||
4582 |
Value.prototype.isArray = function() { |
|
4583 |
return !this.properties.length && this.base instanceof Arr; |
|
4584 |
}; |
|
4585 |
||
4586 |
Value.prototype.isComplex = function() { |
|
4587 |
return this.hasProperties() || this.base.isComplex(); |
|
4588 |
}; |
|
4589 |
||
4590 |
Value.prototype.isAssignable = function() { |
|
4591 |
return this.hasProperties() || this.base.isAssignable(); |
|
4592 |
}; |
|
4593 |
||
4594 |
Value.prototype.isSimpleNumber = function() { |
|
4595 |
return this.base instanceof Literal && SIMPLENUM.test(this.base.value); |
|
4596 |
}; |
|
4597 |
||
4598 |
Value.prototype.isString = function() { |
|
4599 |
return this.base instanceof Literal && IS_STRING.test(this.base.value); |
|
4600 |
}; |
|
4601 |
||
4602 |
Value.prototype.isAtomic = function() { |
|
4603 |
var node, _i, _len, _ref2; |
|
4604 |
_ref2 = this.properties.concat(this.base); |
|
4605 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
4606 |
node = _ref2[_i]; |
|
4607 |
if (node.soak || node instanceof Call) { |
|
4608 |
return false; |
|
4609 |
} |
|
4610 |
} |
|
4611 |
return true; |
|
4612 |
}; |
|
4613 |
||
4614 |
Value.prototype.isStatement = function(o) { |
|
4615 |
return !this.properties.length && this.base.isStatement(o); |
|
4616 |
}; |
|
4617 |
||
4618 |
Value.prototype.assigns = function(name) { |
|
4619 |
return !this.properties.length && this.base.assigns(name); |
|
4620 |
}; |
|
4621 |
||
4622 |
Value.prototype.jumps = function(o) { |
|
4623 |
return !this.properties.length && this.base.jumps(o); |
|
4624 |
}; |
|
4625 |
||
4626 |
Value.prototype.isObject = function(onlyGenerated) { |
|
4627 |
if (this.properties.length) { |
|
4628 |
return false; |
|
4629 |
} |
|
4630 |
return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated); |
|
4631 |
}; |
|
4632 |
||
4633 |
Value.prototype.isSplice = function() { |
|
4634 |
return last(this.properties) instanceof Slice; |
|
4635 |
}; |
|
4636 |
||
4637 |
Value.prototype.unwrap = function() { |
|
4638 |
if (this.properties.length) { |
|
4639 |
return this; |
|
4640 |
} else { |
|
4641 |
return this.base; |
|
4642 |
} |
|
4643 |
}; |
|
4644 |
||
4645 |
Value.prototype.cacheReference = function(o) { |
|
4646 |
var base, bref, name, nref; |
|
4647 |
name = last(this.properties); |
|
4648 |
if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) { |
|
4649 |
return [this, this]; |
|
4650 |
} |
|
4651 |
base = new Value(this.base, this.properties.slice(0, -1)); |
|
4652 |
if (base.isComplex()) { |
|
4653 |
bref = new Literal(o.scope.freeVariable('base')); |
|
4654 |
base = new Value(new Parens(new Assign(bref, base))); |
|
4655 |
} |
|
4656 |
if (!name) { |
|
4657 |
return [base, bref]; |
|
4658 |
} |
|
4659 |
if (name.isComplex()) { |
|
4660 |
nref = new Literal(o.scope.freeVariable('name')); |
|
4661 |
name = new Index(new Assign(nref, name.index)); |
|
4662 |
nref = new Index(nref); |
|
4663 |
} |
|
4664 |
return [base.add(name), new Value(bref || base.base, [nref || name])]; |
|
4665 |
}; |
|
4666 |
||
4667 |
Value.prototype.compileNode = function(o) { |
|
4668 |
var code, prop, props, _i, _len; |
|
4669 |
this.base.front = this.front; |
|
4670 |
props = this.properties; |
|
4671 |
code = this.base.compile(o, props.length ? LEVEL_ACCESS : null); |
|
4672 |
if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(code)) { |
|
4673 |
code = "" + code + "."; |
|
4674 |
} |
|
4675 |
for (_i = 0, _len = props.length; _i < _len; _i++) { |
|
4676 |
prop = props[_i]; |
|
4677 |
code += prop.compile(o); |
|
4678 |
} |
|
4679 |
return code; |
|
4680 |
}; |
|
4681 |
||
4682 |
Value.prototype.unfoldSoak = function(o) { |
|
4683 |
var result, |
|
4684 |
_this = this; |
|
4685 |
if (this.unfoldedSoak != null) { |
|
4686 |
return this.unfoldedSoak; |
|
4687 |
} |
|
4688 |
result = (function() { |
|
4689 |
var fst, i, ifn, prop, ref, snd, _i, _len, _ref2; |
|
4690 |
if (ifn = _this.base.unfoldSoak(o)) { |
|
4691 |
Array.prototype.push.apply(ifn.body.properties, _this.properties); |
|
4692 |
return ifn; |
|
4693 |
} |
|
4694 |
_ref2 = _this.properties; |
|
4695 |
for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { |
|
4696 |
prop = _ref2[i]; |
|
4697 |
if (!prop.soak) { |
|
4698 |
continue; |
|
4699 |
} |
|
4700 |
prop.soak = false; |
|
4701 |
fst = new Value(_this.base, _this.properties.slice(0, i)); |
|
4702 |
snd = new Value(_this.base, _this.properties.slice(i)); |
|
4703 |
if (fst.isComplex()) { |
|
4704 |
ref = new Literal(o.scope.freeVariable('ref')); |
|
4705 |
fst = new Parens(new Assign(ref, fst)); |
|
4706 |
snd.base = ref; |
|
4707 |
} |
|
4708 |
return new If(new Existence(fst), snd, { |
|
4709 |
soak: true |
|
4710 |
}); |
|
4711 |
} |
|
4712 |
return null; |
|
4713 |
})(); |
|
4714 |
return this.unfoldedSoak = result || false; |
|
4715 |
}; |
|
4716 |
||
4717 |
return Value; |
|
4718 |
||
4719 |
})(Base); |
|
4720 |
||
4721 |
exports.Comment = Comment = (function(_super) { |
|
4722 |
||
4723 |
__extends(Comment, _super); |
|
4724 |
||
4725 |
function Comment(comment) { |
|
4726 |
this.comment = comment; |
|
4727 |
} |
|
4728 |
||
4729 |
Comment.prototype.isStatement = YES; |
|
4730 |
||
4731 |
Comment.prototype.makeReturn = THIS; |
|
4732 |
||
4733 |
Comment.prototype.compileNode = function(o, level) { |
|
4734 |
var code; |
|
4735 |
code = '/*' + multident(this.comment, this.tab) + ("\n" + this.tab + "*/\n"); |
|
4736 |
if ((level || o.level) === LEVEL_TOP) { |
|
4737 |
code = o.indent + code; |
|
4738 |
} |
|
4739 |
return code; |
|
4740 |
}; |
|
4741 |
||
4742 |
return Comment; |
|
4743 |
||
4744 |
})(Base); |
|
4745 |
||
4746 |
exports.Call = Call = (function(_super) { |
|
4747 |
||
4748 |
__extends(Call, _super); |
|
4749 |
||
4750 |
function Call(variable, args, soak) { |
|
4751 |
this.args = args != null ? args : []; |
|
4752 |
this.soak = soak; |
|
4753 |
this.isNew = false; |
|
4754 |
this.isSuper = variable === 'super'; |
|
4755 |
this.variable = this.isSuper ? null : variable; |
|
4756 |
} |
|
4757 |
||
4758 |
Call.prototype.children = ['variable', 'args']; |
|
4759 |
||
4760 |
Call.prototype.newInstance = function() { |
|
4761 |
var base, _ref2; |
|
4762 |
base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable; |
|
4763 |
if (base instanceof Call && !base.isNew) { |
|
4764 |
base.newInstance(); |
|
4765 |
} else { |
|
4766 |
this.isNew = true; |
|
4767 |
} |
|
4768 |
return this; |
|
4769 |
}; |
|
4770 |
||
4771 |
Call.prototype.superReference = function(o) { |
|
4772 |
var accesses, method, name; |
|
4773 |
method = o.scope.namedMethod(); |
|
4774 |
if (!method) { |
|
4775 |
throw SyntaxError('cannot call super outside of a function.'); |
|
4776 |
} |
|
4777 |
name = method.name; |
|
4778 |
if (name == null) { |
|
4779 |
throw SyntaxError('cannot call super on an anonymous function.'); |
|
4780 |
} |
|
4781 |
if (method.klass) { |
|
4782 |
accesses = [new Access(new Literal('__super__'))]; |
|
4783 |
if (method["static"]) { |
|
4784 |
accesses.push(new Access(new Literal('constructor'))); |
|
4785 |
} |
|
4786 |
accesses.push(new Access(new Literal(name))); |
|
4787 |
return (new Value(new Literal(method.klass), accesses)).compile(o); |
|
4788 |
} else { |
|
4789 |
return "" + name + ".__super__.constructor"; |
|
4790 |
} |
|
4791 |
}; |
|
4792 |
||
4793 |
Call.prototype.superThis = function(o) { |
|
4794 |
var method; |
|
4795 |
method = o.scope.method; |
|
4796 |
return (method && !method.klass && method.context) || "this"; |
|
4797 |
}; |
|
4798 |
||
4799 |
Call.prototype.unfoldSoak = function(o) { |
|
4800 |
var call, ifn, left, list, rite, _i, _len, _ref2, _ref3; |
|
4801 |
if (this.soak) { |
|
4802 |
if (this.variable) { |
|
4803 |
if (ifn = unfoldSoak(o, this, 'variable')) { |
|
4804 |
return ifn; |
|
4805 |
} |
|
4806 |
_ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1]; |
|
4807 |
} else { |
|
4808 |
left = new Literal(this.superReference(o)); |
|
4809 |
rite = new Value(left); |
|
4810 |
} |
|
4811 |
rite = new Call(rite, this.args); |
|
4812 |
rite.isNew = this.isNew; |
|
4813 |
left = new Literal("typeof " + (left.compile(o)) + " === \"function\""); |
|
4814 |
return new If(left, new Value(rite), { |
|
4815 |
soak: true |
|
4816 |
}); |
|
4817 |
} |
|
4818 |
call = this; |
|
4819 |
list = []; |
|
4820 |
while (true) { |
|
4821 |
if (call.variable instanceof Call) { |
|
4822 |
list.push(call); |
|
4823 |
call = call.variable; |
|
4824 |
continue; |
|
4825 |
} |
|
4826 |
if (!(call.variable instanceof Value)) { |
|
4827 |
break; |
|
4828 |
} |
|
4829 |
list.push(call); |
|
4830 |
if (!((call = call.variable.base) instanceof Call)) { |
|
4831 |
break; |
|
4832 |
} |
|
4833 |
} |
|
4834 |
_ref3 = list.reverse(); |
|
4835 |
for (_i = 0, _len = _ref3.length; _i < _len; _i++) { |
|
4836 |
call = _ref3[_i]; |
|
4837 |
if (ifn) { |
|
4838 |
if (call.variable instanceof Call) { |
|
4839 |
call.variable = ifn; |
|
4840 |
} else { |
|
4841 |
call.variable.base = ifn; |
|
4842 |
} |
|
4843 |
} |
|
4844 |
ifn = unfoldSoak(o, call, 'variable'); |
|
4845 |
} |
|
4846 |
return ifn; |
|
4847 |
}; |
|
4848 |
||
4849 |
Call.prototype.filterImplicitObjects = function(list) { |
|
4850 |
var node, nodes, obj, prop, properties, _i, _j, _len, _len1, _ref2; |
|
4851 |
nodes = []; |
|
4852 |
for (_i = 0, _len = list.length; _i < _len; _i++) { |
|
4853 |
node = list[_i]; |
|
4854 |
if (!((typeof node.isObject === "function" ? node.isObject() : void 0) && node.base.generated)) { |
|
4855 |
nodes.push(node); |
|
4856 |
continue; |
|
4857 |
} |
|
4858 |
obj = null; |
|
4859 |
_ref2 = node.base.properties; |
|
4860 |
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { |
|
4861 |
prop = _ref2[_j]; |
|
4862 |
if (prop instanceof Assign || prop instanceof Comment) { |
|
4863 |
if (!obj) { |
|
4864 |
nodes.push(obj = new Obj(properties = [], true)); |
|
4865 |
} |
|
4866 |
properties.push(prop); |
|
4867 |
} else { |
|
4868 |
nodes.push(prop); |
|
4869 |
obj = null; |
|
4870 |
} |
|
4871 |
} |
|
4872 |
} |
|
4873 |
return nodes; |
|
4874 |
}; |
|
4875 |
||
4876 |
Call.prototype.compileNode = function(o) { |
|
4877 |
var arg, args, code, _ref2; |
|
4878 |
if ((_ref2 = this.variable) != null) { |
|
4879 |
_ref2.front = this.front; |
|
4880 |
} |
|
4881 |
if (code = Splat.compileSplattedArray(o, this.args, true)) { |
|
4882 |
return this.compileSplat(o, code); |
|
4883 |
} |
|
4884 |
args = this.filterImplicitObjects(this.args); |
|
4885 |
args = ((function() { |
|
4886 |
var _i, _len, _results; |
|
4887 |
_results = []; |
|
4888 |
for (_i = 0, _len = args.length; _i < _len; _i++) { |
|
4889 |
arg = args[_i]; |
|
4890 |
_results.push(arg.compile(o, LEVEL_LIST)); |
|
4891 |
} |
|
4892 |
return _results; |
|
4893 |
})()).join(', '); |
|
4894 |
if (this.isSuper) { |
|
4895 |
return this.superReference(o) + (".call(" + (this.superThis(o)) + (args && ', ' + args) + ")"); |
|
4896 |
} else { |
|
4897 |
return (this.isNew ? 'new ' : '') + this.variable.compile(o, LEVEL_ACCESS) + ("(" + args + ")"); |
|
4898 |
} |
|
4899 |
}; |
|
4900 |
||
4901 |
Call.prototype.compileSuper = function(args, o) { |
|
4902 |
return "" + (this.superReference(o)) + ".call(" + (this.superThis(o)) + (args.length ? ', ' : '') + args + ")"; |
|
4903 |
}; |
|
4904 |
||
4905 |
Call.prototype.compileSplat = function(o, splatArgs) { |
|
4906 |
var base, fun, idt, name, ref; |
|
4907 |
if (this.isSuper) { |
|
4908 |
return "" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", " + splatArgs + ")"; |
|
4909 |
} |
|
4910 |
if (this.isNew) { |
|
4911 |
idt = this.tab + TAB; |
|
4912 |
return "(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args), t = typeof result;\n" + idt + "return t == \"object\" || t == \"function\" ? result || child : child;\n" + this.tab + "})(" + (this.variable.compile(o, LEVEL_LIST)) + ", " + splatArgs + ", function(){})"; |
|
4913 |
} |
|
4914 |
base = new Value(this.variable); |
|
4915 |
if ((name = base.properties.pop()) && base.isComplex()) { |
|
4916 |
ref = o.scope.freeVariable('ref'); |
|
4917 |
fun = "(" + ref + " = " + (base.compile(o, LEVEL_LIST)) + ")" + (name.compile(o)); |
|
4918 |
} else { |
|
4919 |
fun = base.compile(o, LEVEL_ACCESS); |
|
4920 |
if (SIMPLENUM.test(fun)) { |
|
4921 |
fun = "(" + fun + ")"; |
|
4922 |
} |
|
4923 |
if (name) { |
|
4924 |
ref = fun; |
|
4925 |
fun += name.compile(o); |
|
4926 |
} else { |
|
4927 |
ref = 'null'; |
|
4928 |
} |
|
4929 |
} |
|
4930 |
return "" + fun + ".apply(" + ref + ", " + splatArgs + ")"; |
|
4931 |
}; |
|
4932 |
||
4933 |
return Call; |
|
4934 |
||
4935 |
})(Base); |
|
4936 |
||
4937 |
exports.Extends = Extends = (function(_super) { |
|
4938 |
||
4939 |
__extends(Extends, _super); |
|
4940 |
||
4941 |
function Extends(child, parent) { |
|
4942 |
this.child = child; |
|
4943 |
this.parent = parent; |
|
4944 |
} |
|
4945 |
||
4946 |
Extends.prototype.children = ['child', 'parent']; |
|
4947 |
||
4948 |
Extends.prototype.compile = function(o) { |
|
4949 |
return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compile(o); |
|
4950 |
}; |
|
4951 |
||
4952 |
return Extends; |
|
4953 |
||
4954 |
})(Base); |
|
4955 |
||
4956 |
exports.Access = Access = (function(_super) { |
|
4957 |
||
4958 |
__extends(Access, _super); |
|
4959 |
||
4960 |
function Access(name, tag) { |
|
4961 |
this.name = name; |
|
4962 |
this.name.asKey = true; |
|
4963 |
this.soak = tag === 'soak'; |
|
4964 |
} |
|
4965 |
||
4966 |
Access.prototype.children = ['name']; |
|
4967 |
||
4968 |
Access.prototype.compile = function(o) { |
|
4969 |
var name; |
|
4970 |
name = this.name.compile(o); |
|
4971 |
if (IDENTIFIER.test(name)) { |
|
4972 |
return "." + name; |
|
4973 |
} else { |
|
4974 |
return "[" + name + "]"; |
|
4975 |
} |
|
4976 |
}; |
|
4977 |
||
4978 |
Access.prototype.isComplex = NO; |
|
4979 |
||
4980 |
return Access; |
|
4981 |
||
4982 |
})(Base); |
|
4983 |
||
4984 |
exports.Index = Index = (function(_super) { |
|
4985 |
||
4986 |
__extends(Index, _super); |
|
4987 |
||
4988 |
function Index(index) { |
|
4989 |
this.index = index; |
|
4990 |
} |
|
4991 |
||
4992 |
Index.prototype.children = ['index']; |
|
4993 |
||
4994 |
Index.prototype.compile = function(o) { |
|
4995 |
return "[" + (this.index.compile(o, LEVEL_PAREN)) + "]"; |
|
4996 |
}; |
|
4997 |
||
4998 |
Index.prototype.isComplex = function() { |
|
4999 |
return this.index.isComplex(); |
|
5000 |
}; |
|
5001 |
||
5002 |
return Index; |
|
5003 |
||
5004 |
})(Base); |
|
5005 |
||
5006 |
exports.Range = Range = (function(_super) { |
|
5007 |
||
5008 |
__extends(Range, _super); |
|
5009 |
||
5010 |
Range.prototype.children = ['from', 'to']; |
|
5011 |
||
5012 |
function Range(from, to, tag) { |
|
5013 |
this.from = from; |
|
5014 |
this.to = to; |
|
5015 |
this.exclusive = tag === 'exclusive'; |
|
5016 |
this.equals = this.exclusive ? '' : '='; |
|
5017 |
} |
|
5018 |
||
5019 |
Range.prototype.compileVariables = function(o) { |
|
5020 |
var step, _ref2, _ref3, _ref4, _ref5; |
|
5021 |
o = merge(o, { |
|
5022 |
top: true |
|
5023 |
}); |
|
5024 |
_ref2 = this.from.cache(o, LEVEL_LIST), this.fromC = _ref2[0], this.fromVar = _ref2[1]; |
|
5025 |
_ref3 = this.to.cache(o, LEVEL_LIST), this.toC = _ref3[0], this.toVar = _ref3[1]; |
|
5026 |
if (step = del(o, 'step')) { |
|
5027 |
_ref4 = step.cache(o, LEVEL_LIST), this.step = _ref4[0], this.stepVar = _ref4[1]; |
|
5028 |
} |
|
5029 |
_ref5 = [this.fromVar.match(SIMPLENUM), this.toVar.match(SIMPLENUM)], this.fromNum = _ref5[0], this.toNum = _ref5[1]; |
|
5030 |
if (this.stepVar) { |
|
5031 |
return this.stepNum = this.stepVar.match(SIMPLENUM); |
|
5032 |
} |
|
5033 |
}; |
|
5034 |
||
5035 |
Range.prototype.compileNode = function(o) { |
|
5036 |
var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3; |
|
5037 |
if (!this.fromVar) { |
|
5038 |
this.compileVariables(o); |
|
5039 |
} |
|
5040 |
if (!o.index) { |
|
5041 |
return this.compileArray(o); |
|
5042 |
} |
|
5043 |
known = this.fromNum && this.toNum; |
|
5044 |
idx = del(o, 'index'); |
|
5045 |
idxName = del(o, 'name'); |
|
5046 |
namedIndex = idxName && idxName !== idx; |
|
5047 |
varPart = "" + idx + " = " + this.fromC; |
|
5048 |
if (this.toC !== this.toVar) { |
|
5049 |
varPart += ", " + this.toC; |
|
5050 |
} |
|
5051 |
if (this.step !== this.stepVar) { |
|
5052 |
varPart += ", " + this.step; |
|
5053 |
} |
|
5054 |
_ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1]; |
|
5055 |
condPart = this.stepNum ? +this.stepNum > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [+this.fromNum, +this.toNum], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar); |
|
5056 |
stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--"; |
|
5057 |
if (namedIndex) { |
|
5058 |
varPart = "" + idxName + " = " + varPart; |
|
5059 |
} |
|
5060 |
if (namedIndex) { |
|
5061 |
stepPart = "" + idxName + " = " + stepPart; |
|
5062 |
} |
|
5063 |
return "" + varPart + "; " + condPart + "; " + stepPart; |
|
5064 |
}; |
|
5065 |
||
5066 |
Range.prototype.compileArray = function(o) { |
|
5067 |
var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results; |
|
5068 |
if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) { |
|
5069 |
range = (function() { |
|
5070 |
_results = []; |
|
5071 |
for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); } |
|
5072 |
return _results; |
|
5073 |
}).apply(this); |
|
5074 |
if (this.exclusive) { |
|
5075 |
range.pop(); |
|
5076 |
} |
|
5077 |
return "[" + (range.join(', ')) + "]"; |
|
5078 |
} |
|
5079 |
idt = this.tab + TAB; |
|
5080 |
i = o.scope.freeVariable('i'); |
|
5081 |
result = o.scope.freeVariable('results'); |
|
5082 |
pre = "\n" + idt + result + " = [];"; |
|
5083 |
if (this.fromNum && this.toNum) { |
|
5084 |
o.index = i; |
|
5085 |
body = this.compileNode(o); |
|
5086 |
} else { |
|
5087 |
vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : ''); |
|
5088 |
cond = "" + this.fromVar + " <= " + this.toVar; |
|
5089 |
body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--"; |
|
5090 |
} |
|
5091 |
post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent; |
|
5092 |
hasArgs = function(node) { |
|
5093 |
return node != null ? node.contains(function(n) { |
|
5094 |
return n instanceof Literal && n.value === 'arguments' && !n.asKey; |
|
5095 |
}) : void 0; |
|
5096 |
}; |
|
5097 |
if (hasArgs(this.from) || hasArgs(this.to)) { |
|
5098 |
args = ', arguments'; |
|
5099 |
} |
|
5100 |
return "(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")"; |
|
5101 |
}; |
|
5102 |
||
5103 |
return Range; |
|
5104 |
||
5105 |
})(Base); |
|
5106 |
||
5107 |
exports.Slice = Slice = (function(_super) { |
|
5108 |
||
5109 |
__extends(Slice, _super); |
|
5110 |
||
5111 |
Slice.prototype.children = ['range']; |
|
5112 |
||
5113 |
function Slice(range) { |
|
5114 |
this.range = range; |
|
5115 |
Slice.__super__.constructor.call(this); |
|
5116 |
} |
|
5117 |
||
5118 |
Slice.prototype.compileNode = function(o) { |
|
5119 |
var compiled, from, fromStr, to, toStr, _ref2; |
|
5120 |
_ref2 = this.range, to = _ref2.to, from = _ref2.from; |
|
5121 |
fromStr = from && from.compile(o, LEVEL_PAREN) || '0'; |
|
5122 |
compiled = to && to.compile(o, LEVEL_PAREN); |
|
5123 |
if (to && !(!this.range.exclusive && +compiled === -1)) { |
|
5124 |
toStr = ', ' + (this.range.exclusive ? compiled : SIMPLENUM.test(compiled) ? "" + (+compiled + 1) : (compiled = to.compile(o, LEVEL_ACCESS), "+" + compiled + " + 1 || 9e9")); |
|
5125 |
} |
|
5126 |
return ".slice(" + fromStr + (toStr || '') + ")"; |
|
5127 |
}; |
|
5128 |
||
5129 |
return Slice; |
|
5130 |
||
5131 |
})(Base); |
|
5132 |
||
5133 |
exports.Obj = Obj = (function(_super) { |
|
5134 |
||
5135 |
__extends(Obj, _super); |
|
5136 |
||
5137 |
function Obj(props, generated) { |
|
5138 |
this.generated = generated != null ? generated : false; |
|
5139 |
this.objects = this.properties = props || []; |
|
5140 |
} |
|
5141 |
||
5142 |
Obj.prototype.children = ['properties']; |
|
5143 |
||
5144 |
Obj.prototype.compileNode = function(o) { |
|
5145 |
var i, idt, indent, join, lastNoncom, node, obj, prop, props, _i, _len; |
|
5146 |
props = this.properties; |
|
5147 |
if (!props.length) { |
|
5148 |
return (this.front ? '({})' : '{}'); |
|
5149 |
} |
|
5150 |
if (this.generated) { |
|
5151 |
for (_i = 0, _len = props.length; _i < _len; _i++) { |
|
5152 |
node = props[_i]; |
|
5153 |
if (node instanceof Value) { |
|
5154 |
throw new Error('cannot have an implicit value in an implicit object'); |
|
5155 |
} |
|
5156 |
} |
|
5157 |
} |
|
5158 |
idt = o.indent += TAB; |
|
5159 |
lastNoncom = this.lastNonComment(this.properties); |
|
5160 |
props = (function() { |
|
5161 |
var _j, _len1, _results; |
|
5162 |
_results = []; |
|
5163 |
for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) { |
|
5164 |
prop = props[i]; |
|
5165 |
join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n'; |
|
5166 |
indent = prop instanceof Comment ? '' : idt; |
|
5167 |
if (prop instanceof Value && prop["this"]) { |
|
5168 |
prop = new Assign(prop.properties[0].name, prop, 'object'); |
|
5169 |
} |
|
5170 |
if (!(prop instanceof Comment)) { |
|
5171 |
if (!(prop instanceof Assign)) { |
|
5172 |
prop = new Assign(prop, prop, 'object'); |
|
5173 |
} |
|
5174 |
(prop.variable.base || prop.variable).asKey = true; |
|
5175 |
} |
|
5176 |
_results.push(indent + prop.compile(o, LEVEL_TOP) + join); |
|
5177 |
} |
|
5178 |
return _results; |
|
5179 |
})(); |
|
5180 |
props = props.join(''); |
|
5181 |
obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}"; |
|
5182 |
if (this.front) { |
|
5183 |
return "(" + obj + ")"; |
|
5184 |
} else { |
|
5185 |
return obj; |
|
5186 |
} |
|
5187 |
}; |
|
5188 |
||
5189 |
Obj.prototype.assigns = function(name) { |
|
5190 |
var prop, _i, _len, _ref2; |
|
5191 |
_ref2 = this.properties; |
|
5192 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5193 |
prop = _ref2[_i]; |
|
5194 |
if (prop.assigns(name)) { |
|
5195 |
return true; |
|
5196 |
} |
|
5197 |
} |
|
5198 |
return false; |
|
5199 |
}; |
|
5200 |
||
5201 |
return Obj; |
|
5202 |
||
5203 |
})(Base); |
|
5204 |
||
5205 |
exports.Arr = Arr = (function(_super) { |
|
5206 |
||
5207 |
__extends(Arr, _super); |
|
5208 |
||
5209 |
function Arr(objs) { |
|
5210 |
this.objects = objs || []; |
|
5211 |
} |
|
5212 |
||
5213 |
Arr.prototype.children = ['objects']; |
|
5214 |
||
5215 |
Arr.prototype.filterImplicitObjects = Call.prototype.filterImplicitObjects; |
|
5216 |
||
5217 |
Arr.prototype.compileNode = function(o) { |
|
5218 |
var code, obj, objs; |
|
5219 |
if (!this.objects.length) { |
|
5220 |
return '[]'; |
|
5221 |
} |
|
5222 |
o.indent += TAB; |
|
5223 |
objs = this.filterImplicitObjects(this.objects); |
|
5224 |
if (code = Splat.compileSplattedArray(o, objs)) { |
|
5225 |
return code; |
|
5226 |
} |
|
5227 |
code = ((function() { |
|
5228 |
var _i, _len, _results; |
|
5229 |
_results = []; |
|
5230 |
for (_i = 0, _len = objs.length; _i < _len; _i++) { |
|
5231 |
obj = objs[_i]; |
|
5232 |
_results.push(obj.compile(o, LEVEL_LIST)); |
|
5233 |
} |
|
5234 |
return _results; |
|
5235 |
})()).join(', '); |
|
5236 |
if (code.indexOf('\n') >= 0) { |
|
5237 |
return "[\n" + o.indent + code + "\n" + this.tab + "]"; |
|
5238 |
} else { |
|
5239 |
return "[" + code + "]"; |
|
5240 |
} |
|
5241 |
}; |
|
5242 |
||
5243 |
Arr.prototype.assigns = function(name) { |
|
5244 |
var obj, _i, _len, _ref2; |
|
5245 |
_ref2 = this.objects; |
|
5246 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5247 |
obj = _ref2[_i]; |
|
5248 |
if (obj.assigns(name)) { |
|
5249 |
return true; |
|
5250 |
} |
|
5251 |
} |
|
5252 |
return false; |
|
5253 |
}; |
|
5254 |
||
5255 |
return Arr; |
|
5256 |
||
5257 |
})(Base); |
|
5258 |
||
5259 |
exports.Class = Class = (function(_super) { |
|
5260 |
||
5261 |
__extends(Class, _super); |
|
5262 |
||
5263 |
function Class(variable, parent, body) { |
|
5264 |
this.variable = variable; |
|
5265 |
this.parent = parent; |
|
5266 |
this.body = body != null ? body : new Block; |
|
5267 |
this.boundFuncs = []; |
|
5268 |
this.body.classBody = true; |
|
5269 |
} |
|
5270 |
||
5271 |
Class.prototype.children = ['variable', 'parent', 'body']; |
|
5272 |
||
5273 |
Class.prototype.determineName = function() { |
|
5274 |
var decl, tail; |
|
5275 |
if (!this.variable) { |
|
5276 |
return null; |
|
5277 |
} |
|
5278 |
decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value; |
|
5279 |
if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) { |
|
5280 |
throw SyntaxError("variable name may not be " + decl); |
|
5281 |
} |
|
5282 |
return decl && (decl = IDENTIFIER.test(decl) && decl); |
|
5283 |
}; |
|
5284 |
||
5285 |
Class.prototype.setContext = function(name) { |
|
5286 |
return this.body.traverseChildren(false, function(node) { |
|
5287 |
if (node.classBody) { |
|
5288 |
return false; |
|
5289 |
} |
|
5290 |
if (node instanceof Literal && node.value === 'this') { |
|
5291 |
return node.value = name; |
|
5292 |
} else if (node instanceof Code) { |
|
5293 |
node.klass = name; |
|
5294 |
if (node.bound) { |
|
5295 |
return node.context = name; |
|
5296 |
} |
|
5297 |
} |
|
5298 |
}); |
|
5299 |
}; |
|
5300 |
||
5301 |
Class.prototype.addBoundFunctions = function(o) { |
|
5302 |
var bvar, lhs, _i, _len, _ref2, _results; |
|
5303 |
if (this.boundFuncs.length) { |
|
5304 |
_ref2 = this.boundFuncs; |
|
5305 |
_results = []; |
|
5306 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5307 |
bvar = _ref2[_i]; |
|
5308 |
lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o); |
|
5309 |
_results.push(this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"))); |
|
5310 |
} |
|
5311 |
return _results; |
|
5312 |
} |
|
5313 |
}; |
|
5314 |
||
5315 |
Class.prototype.addProperties = function(node, name, o) { |
|
5316 |
var assign, base, exprs, func, props; |
|
5317 |
props = node.base.properties.slice(0); |
|
5318 |
exprs = (function() { |
|
5319 |
var _results; |
|
5320 |
_results = []; |
|
5321 |
while (assign = props.shift()) { |
|
5322 |
if (assign instanceof Assign) { |
|
5323 |
base = assign.variable.base; |
|
5324 |
delete assign.context; |
|
5325 |
func = assign.value; |
|
5326 |
if (base.value === 'constructor') { |
|
5327 |
if (this.ctor) { |
|
5328 |
throw new Error('cannot define more than one constructor in a class'); |
|
5329 |
} |
|
5330 |
if (func.bound) { |
|
5331 |
throw new Error('cannot define a constructor as a bound function'); |
|
5332 |
} |
|
5333 |
if (func instanceof Code) { |
|
5334 |
assign = this.ctor = func; |
|
5335 |
} else { |
|
5336 |
this.externalCtor = o.scope.freeVariable('class'); |
|
5337 |
assign = new Assign(new Literal(this.externalCtor), func); |
|
5338 |
} |
|
5339 |
} else { |
|
5340 |
if (assign.variable["this"]) { |
|
5341 |
func["static"] = true; |
|
5342 |
if (func.bound) { |
|
5343 |
func.context = name; |
|
5344 |
} |
|
5345 |
} else { |
|
5346 |
assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]); |
|
5347 |
if (func instanceof Code && func.bound) { |
|
5348 |
this.boundFuncs.push(base); |
|
5349 |
func.bound = false; |
|
5350 |
} |
|
5351 |
} |
|
5352 |
} |
|
5353 |
} |
|
5354 |
_results.push(assign); |
|
5355 |
} |
|
5356 |
return _results; |
|
5357 |
}).call(this); |
|
5358 |
return compact(exprs); |
|
5359 |
}; |
|
5360 |
||
5361 |
Class.prototype.walkBody = function(name, o) { |
|
5362 |
var _this = this; |
|
5363 |
return this.traverseChildren(false, function(child) { |
|
5364 |
var exps, i, node, _i, _len, _ref2; |
|
5365 |
if (child instanceof Class) { |
|
5366 |
return false; |
|
5367 |
} |
|
5368 |
if (child instanceof Block) { |
|
5369 |
_ref2 = exps = child.expressions; |
|
5370 |
for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) { |
|
5371 |
node = _ref2[i]; |
|
5372 |
if (node instanceof Value && node.isObject(true)) { |
|
5373 |
exps[i] = _this.addProperties(node, name, o); |
|
5374 |
} |
|
5375 |
} |
|
5376 |
return child.expressions = exps = flatten(exps); |
|
5377 |
} |
|
5378 |
}); |
|
5379 |
}; |
|
5380 |
||
5381 |
Class.prototype.hoistDirectivePrologue = function() { |
|
5382 |
var expressions, index, node; |
|
5383 |
index = 0; |
|
5384 |
expressions = this.body.expressions; |
|
5385 |
while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) { |
|
5386 |
++index; |
|
5387 |
} |
|
5388 |
return this.directives = expressions.splice(0, index); |
|
5389 |
}; |
|
5390 |
||
5391 |
Class.prototype.ensureConstructor = function(name) { |
|
5392 |
if (!this.ctor) { |
|
5393 |
this.ctor = new Code; |
|
5394 |
if (this.parent) { |
|
5395 |
this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)")); |
|
5396 |
} |
|
5397 |
if (this.externalCtor) { |
|
5398 |
this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)")); |
|
5399 |
} |
|
5400 |
this.ctor.body.makeReturn(); |
|
5401 |
this.body.expressions.unshift(this.ctor); |
|
5402 |
} |
|
5403 |
this.ctor.ctor = this.ctor.name = name; |
|
5404 |
this.ctor.klass = null; |
|
5405 |
return this.ctor.noReturn = true; |
|
5406 |
}; |
|
5407 |
||
5408 |
Class.prototype.compileNode = function(o) { |
|
5409 |
var call, decl, klass, lname, name, params, _ref2; |
|
5410 |
decl = this.determineName(); |
|
5411 |
name = decl || '_Class'; |
|
5412 |
if (name.reserved) { |
|
5413 |
name = "_" + name; |
|
5414 |
} |
|
5415 |
lname = new Literal(name); |
|
5416 |
this.hoistDirectivePrologue(); |
|
5417 |
this.setContext(name); |
|
5418 |
this.walkBody(name, o); |
|
5419 |
this.ensureConstructor(name); |
|
5420 |
this.body.spaced = true; |
|
5421 |
if (!(this.ctor instanceof Code)) { |
|
5422 |
this.body.expressions.unshift(this.ctor); |
|
5423 |
} |
|
5424 |
this.body.expressions.push(lname); |
|
5425 |
(_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives); |
|
5426 |
this.addBoundFunctions(o); |
|
5427 |
call = Closure.wrap(this.body); |
|
5428 |
if (this.parent) { |
|
5429 |
this.superClass = new Literal(o.scope.freeVariable('super', false)); |
|
5430 |
this.body.expressions.unshift(new Extends(lname, this.superClass)); |
|
5431 |
call.args.push(this.parent); |
|
5432 |
params = call.variable.params || call.variable.base.params; |
|
5433 |
params.push(new Param(this.superClass)); |
|
5434 |
} |
|
5435 |
klass = new Parens(call, true); |
|
5436 |
if (this.variable) { |
|
5437 |
klass = new Assign(this.variable, klass); |
|
5438 |
} |
|
5439 |
return klass.compile(o); |
|
5440 |
}; |
|
5441 |
||
5442 |
return Class; |
|
5443 |
||
5444 |
})(Base); |
|
5445 |
||
5446 |
exports.Assign = Assign = (function(_super) { |
|
5447 |
||
5448 |
__extends(Assign, _super); |
|
5449 |
||
5450 |
function Assign(variable, value, context, options) { |
|
5451 |
var forbidden, name, _ref2; |
|
5452 |
this.variable = variable; |
|
5453 |
this.value = value; |
|
5454 |
this.context = context; |
|
5455 |
this.param = options && options.param; |
|
5456 |
this.subpattern = options && options.subpattern; |
|
5457 |
forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0); |
|
5458 |
if (forbidden && this.context !== 'object') { |
|
5459 |
throw SyntaxError("variable name may not be \"" + name + "\""); |
|
5460 |
} |
|
5461 |
} |
|
5462 |
||
5463 |
Assign.prototype.children = ['variable', 'value']; |
|
5464 |
||
5465 |
Assign.prototype.isStatement = function(o) { |
|
5466 |
return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0; |
|
5467 |
}; |
|
5468 |
||
5469 |
Assign.prototype.assigns = function(name) { |
|
5470 |
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name); |
|
5471 |
}; |
|
5472 |
||
5473 |
Assign.prototype.unfoldSoak = function(o) { |
|
5474 |
return unfoldSoak(o, this, 'variable'); |
|
5475 |
}; |
|
5476 |
||
5477 |
Assign.prototype.compileNode = function(o) { |
|
5478 |
var isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5; |
|
5479 |
if (isValue = this.variable instanceof Value) { |
|
5480 |
if (this.variable.isArray() || this.variable.isObject()) { |
|
5481 |
return this.compilePatternMatch(o); |
|
5482 |
} |
|
5483 |
if (this.variable.isSplice()) { |
|
5484 |
return this.compileSplice(o); |
|
5485 |
} |
|
5486 |
if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') { |
|
5487 |
return this.compileConditional(o); |
|
5488 |
} |
|
5489 |
} |
|
5490 |
name = this.variable.compile(o, LEVEL_LIST); |
|
5491 |
if (!this.context) { |
|
5492 |
if (!(varBase = this.variable.unwrapAll()).isAssignable()) { |
|
5493 |
throw SyntaxError("\"" + (this.variable.compile(o)) + "\" cannot be assigned."); |
|
5494 |
} |
|
5495 |
if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) { |
|
5496 |
if (this.param) { |
|
5497 |
o.scope.add(name, 'var'); |
|
5498 |
} else { |
|
5499 |
o.scope.find(name); |
|
5500 |
} |
|
5501 |
} |
|
5502 |
} |
|
5503 |
if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) { |
|
5504 |
if (match[1]) { |
|
5505 |
this.value.klass = match[1]; |
|
5506 |
} |
|
5507 |
this.value.name = (_ref3 = (_ref4 = (_ref5 = match[2]) != null ? _ref5 : match[3]) != null ? _ref4 : match[4]) != null ? _ref3 : match[5]; |
|
5508 |
} |
|
5509 |
val = this.value.compile(o, LEVEL_LIST); |
|
5510 |
if (this.context === 'object') { |
|
5511 |
return "" + name + ": " + val; |
|
5512 |
} |
|
5513 |
val = name + (" " + (this.context || '=') + " ") + val; |
|
5514 |
if (o.level <= LEVEL_LIST) { |
|
5515 |
return val; |
|
5516 |
} else { |
|
5517 |
return "(" + val + ")"; |
|
5518 |
} |
|
5519 |
}; |
|
5520 |
||
5521 |
Assign.prototype.compilePatternMatch = function(o) { |
|
5522 |
var acc, assigns, code, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, splat, top, val, value, vvar, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; |
|
5523 |
top = o.level === LEVEL_TOP; |
|
5524 |
value = this.value; |
|
5525 |
objects = this.variable.base.objects; |
|
5526 |
if (!(olen = objects.length)) { |
|
5527 |
code = value.compile(o); |
|
5528 |
if (o.level >= LEVEL_OP) { |
|
5529 |
return "(" + code + ")"; |
|
5530 |
} else { |
|
5531 |
return code; |
|
5532 |
} |
|
5533 |
} |
|
5534 |
isObject = this.variable.isObject(); |
|
5535 |
if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) { |
|
5536 |
if (obj instanceof Assign) { |
|
5537 |
_ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value; |
|
5538 |
} else { |
|
5539 |
if (obj.base instanceof Parens) { |
|
5540 |
_ref4 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref4[0], idx = _ref4[1]; |
|
5541 |
} else { |
|
5542 |
idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0); |
|
5543 |
} |
|
5544 |
} |
|
5545 |
acc = IDENTIFIER.test(idx.unwrap().value || 0); |
|
5546 |
value = new Value(value); |
|
5547 |
value.properties.push(new (acc ? Access : Index)(idx)); |
|
5548 |
if (_ref5 = obj.unwrap().value, __indexOf.call(RESERVED, _ref5) >= 0) { |
|
5549 |
throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (value.compile(o))); |
|
5550 |
} |
|
5551 |
return new Assign(obj, value, null, { |
|
5552 |
param: this.param |
|
5553 |
}).compile(o, LEVEL_TOP); |
|
5554 |
} |
|
5555 |
vvar = value.compile(o, LEVEL_LIST); |
|
5556 |
assigns = []; |
|
5557 |
splat = false; |
|
5558 |
if (!IDENTIFIER.test(vvar) || this.variable.assigns(vvar)) { |
|
5559 |
assigns.push("" + (ref = o.scope.freeVariable('ref')) + " = " + vvar); |
|
5560 |
vvar = ref; |
|
5561 |
} |
|
5562 |
for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) { |
|
5563 |
obj = objects[i]; |
|
5564 |
idx = i; |
|
5565 |
if (isObject) { |
|
5566 |
if (obj instanceof Assign) { |
|
5567 |
_ref6 = obj, (_ref7 = _ref6.variable, idx = _ref7.base), obj = _ref6.value; |
|
5568 |
} else { |
|
5569 |
if (obj.base instanceof Parens) { |
|
5570 |
_ref8 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref8[0], idx = _ref8[1]; |
|
5571 |
} else { |
|
5572 |
idx = obj["this"] ? obj.properties[0].name : obj; |
|
5573 |
} |
|
5574 |
} |
|
5575 |
} |
|
5576 |
if (!splat && obj instanceof Splat) { |
|
5577 |
name = obj.name.unwrap().value; |
|
5578 |
obj = obj.unwrap(); |
|
5579 |
val = "" + olen + " <= " + vvar + ".length ? " + (utility('slice')) + ".call(" + vvar + ", " + i; |
|
5580 |
if (rest = olen - i - 1) { |
|
5581 |
ivar = o.scope.freeVariable('i'); |
|
5582 |
val += ", " + ivar + " = " + vvar + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])"; |
|
5583 |
} else { |
|
5584 |
val += ") : []"; |
|
5585 |
} |
|
5586 |
val = new Literal(val); |
|
5587 |
splat = "" + ivar + "++"; |
|
5588 |
} else { |
|
5589 |
name = obj.unwrap().value; |
|
5590 |
if (obj instanceof Splat) { |
|
5591 |
obj = obj.name.compile(o); |
|
5592 |
throw new SyntaxError("multiple splats are disallowed in an assignment: " + obj + "..."); |
|
5593 |
} |
|
5594 |
if (typeof idx === 'number') { |
|
5595 |
idx = new Literal(splat || idx); |
|
5596 |
acc = false; |
|
5597 |
} else { |
|
5598 |
acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0); |
|
5599 |
} |
|
5600 |
val = new Value(new Literal(vvar), [new (acc ? Access : Index)(idx)]); |
|
5601 |
} |
|
5602 |
if ((name != null) && __indexOf.call(RESERVED, name) >= 0) { |
|
5603 |
throw new SyntaxError("assignment to a reserved word: " + (obj.compile(o)) + " = " + (val.compile(o))); |
|
5604 |
} |
|
5605 |
assigns.push(new Assign(obj, val, null, { |
|
5606 |
param: this.param, |
|
5607 |
subpattern: true |
|
5608 |
}).compile(o, LEVEL_LIST)); |
|
5609 |
} |
|
5610 |
if (!(top || this.subpattern)) { |
|
5611 |
assigns.push(vvar); |
|
5612 |
} |
|
5613 |
code = assigns.join(', '); |
|
5614 |
if (o.level < LEVEL_LIST) { |
|
5615 |
return code; |
|
5616 |
} else { |
|
5617 |
return "(" + code + ")"; |
|
5618 |
} |
|
5619 |
}; |
|
5620 |
||
5621 |
Assign.prototype.compileConditional = function(o) { |
|
5622 |
var left, right, _ref2; |
|
5623 |
_ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1]; |
|
5624 |
if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) { |
|
5625 |
throw new Error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been defined."); |
|
5626 |
} |
|
5627 |
if (__indexOf.call(this.context, "?") >= 0) { |
|
5628 |
o.isExistentialEquals = true; |
|
5629 |
} |
|
5630 |
return new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compile(o); |
|
5631 |
}; |
|
5632 |
||
5633 |
Assign.prototype.compileSplice = function(o) { |
|
5634 |
var code, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4; |
|
5635 |
_ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive; |
|
5636 |
name = this.variable.compile(o); |
|
5637 |
_ref3 = (from != null ? from.cache(o, LEVEL_OP) : void 0) || ['0', '0'], fromDecl = _ref3[0], fromRef = _ref3[1]; |
|
5638 |
if (to) { |
|
5639 |
if ((from != null ? from.isSimpleNumber() : void 0) && to.isSimpleNumber()) { |
|
5640 |
to = +to.compile(o) - +fromRef; |
|
5641 |
if (!exclusive) { |
|
5642 |
to += 1; |
|
5643 |
} |
|
5644 |
} else { |
|
5645 |
to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef; |
|
5646 |
if (!exclusive) { |
|
5647 |
to += ' + 1'; |
|
5648 |
} |
|
5649 |
} |
|
5650 |
} else { |
|
5651 |
to = "9e9"; |
|
5652 |
} |
|
5653 |
_ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1]; |
|
5654 |
code = "[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat(" + valDef + ")), " + valRef; |
|
5655 |
if (o.level > LEVEL_TOP) { |
|
5656 |
return "(" + code + ")"; |
|
5657 |
} else { |
|
5658 |
return code; |
|
5659 |
} |
|
5660 |
}; |
|
5661 |
||
5662 |
return Assign; |
|
5663 |
||
5664 |
})(Base); |
|
5665 |
||
5666 |
exports.Code = Code = (function(_super) { |
|
5667 |
||
5668 |
__extends(Code, _super); |
|
5669 |
||
5670 |
function Code(params, body, tag) { |
|
5671 |
this.params = params || []; |
|
5672 |
this.body = body || new Block; |
|
5673 |
this.bound = tag === 'boundfunc'; |
|
5674 |
if (this.bound) { |
|
5675 |
this.context = '_this'; |
|
5676 |
} |
|
5677 |
} |
|
5678 |
||
5679 |
Code.prototype.children = ['params', 'body']; |
|
5680 |
||
5681 |
Code.prototype.isStatement = function() { |
|
5682 |
return !!this.ctor; |
|
5683 |
}; |
|
5684 |
||
5685 |
Code.prototype.jumps = NO; |
|
5686 |
||
5687 |
Code.prototype.compileNode = function(o) { |
|
5688 |
var code, exprs, i, idt, lit, name, p, param, params, ref, splats, uniqs, val, wasEmpty, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8; |
|
5689 |
o.scope = new Scope(o.scope, this.body, this); |
|
5690 |
o.scope.shared = del(o, 'sharedScope'); |
|
5691 |
o.indent += TAB; |
|
5692 |
delete o.bare; |
|
5693 |
delete o.isExistentialEquals; |
|
5694 |
params = []; |
|
5695 |
exprs = []; |
|
5696 |
_ref2 = this.paramNames(); |
|
5697 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5698 |
name = _ref2[_i]; |
|
5699 |
if (!o.scope.check(name)) { |
|
5700 |
o.scope.parameter(name); |
|
5701 |
} |
|
5702 |
} |
|
5703 |
_ref3 = this.params; |
|
5704 |
for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) { |
|
5705 |
param = _ref3[_j]; |
|
5706 |
if (!param.splat) { |
|
5707 |
continue; |
|
5708 |
} |
|
5709 |
_ref4 = this.params; |
|
5710 |
for (_k = 0, _len2 = _ref4.length; _k < _len2; _k++) { |
|
5711 |
p = _ref4[_k].name; |
|
5712 |
if (p["this"]) { |
|
5713 |
p = p.properties[0].name; |
|
5714 |
} |
|
5715 |
if (p.value) { |
|
5716 |
o.scope.add(p.value, 'var', true); |
|
5717 |
} |
|
5718 |
} |
|
5719 |
splats = new Assign(new Value(new Arr((function() { |
|
5720 |
var _l, _len3, _ref5, _results; |
|
5721 |
_ref5 = this.params; |
|
5722 |
_results = []; |
|
5723 |
for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { |
|
5724 |
p = _ref5[_l]; |
|
5725 |
_results.push(p.asReference(o)); |
|
5726 |
} |
|
5727 |
return _results; |
|
5728 |
}).call(this))), new Value(new Literal('arguments'))); |
|
5729 |
break; |
|
5730 |
} |
|
5731 |
_ref5 = this.params; |
|
5732 |
for (_l = 0, _len3 = _ref5.length; _l < _len3; _l++) { |
|
5733 |
param = _ref5[_l]; |
|
5734 |
if (param.isComplex()) { |
|
5735 |
val = ref = param.asReference(o); |
|
5736 |
if (param.value) { |
|
5737 |
val = new Op('?', ref, param.value); |
|
5738 |
} |
|
5739 |
exprs.push(new Assign(new Value(param.name), val, '=', { |
|
5740 |
param: true |
|
5741 |
})); |
|
5742 |
} else { |
|
5743 |
ref = param; |
|
5744 |
if (param.value) { |
|
5745 |
lit = new Literal(ref.name.value + ' == null'); |
|
5746 |
val = new Assign(new Value(param.name), param.value, '='); |
|
5747 |
exprs.push(new If(lit, val)); |
|
5748 |
} |
|
5749 |
} |
|
5750 |
if (!splats) { |
|
5751 |
params.push(ref); |
|
5752 |
} |
|
5753 |
} |
|
5754 |
wasEmpty = this.body.isEmpty(); |
|
5755 |
if (splats) { |
|
5756 |
exprs.unshift(splats); |
|
5757 |
} |
|
5758 |
if (exprs.length) { |
|
5759 |
(_ref6 = this.body.expressions).unshift.apply(_ref6, exprs); |
|
5760 |
} |
|
5761 |
for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) { |
|
5762 |
p = params[i]; |
|
5763 |
o.scope.parameter(params[i] = p.compile(o)); |
|
5764 |
} |
|
5765 |
uniqs = []; |
|
5766 |
_ref7 = this.paramNames(); |
|
5767 |
for (_n = 0, _len5 = _ref7.length; _n < _len5; _n++) { |
|
5768 |
name = _ref7[_n]; |
|
5769 |
if (__indexOf.call(uniqs, name) >= 0) { |
|
5770 |
throw SyntaxError("multiple parameters named '" + name + "'"); |
|
5771 |
} |
|
5772 |
uniqs.push(name); |
|
5773 |
} |
|
5774 |
if (!(wasEmpty || this.noReturn)) { |
|
5775 |
this.body.makeReturn(); |
|
5776 |
} |
|
5777 |
if (this.bound) { |
|
5778 |
if ((_ref8 = o.scope.parent.method) != null ? _ref8.bound : void 0) { |
|
5779 |
this.bound = this.context = o.scope.parent.method.context; |
|
5780 |
} else if (!this["static"]) { |
|
5781 |
o.scope.parent.assign('_this', 'this'); |
|
5782 |
} |
|
5783 |
} |
|
5784 |
idt = o.indent; |
|
5785 |
code = 'function'; |
|
5786 |
if (this.ctor) { |
|
5787 |
code += ' ' + this.name; |
|
5788 |
} |
|
5789 |
code += '(' + params.join(', ') + ') {'; |
|
5790 |
if (!this.body.isEmpty()) { |
|
5791 |
code += "\n" + (this.body.compileWithDeclarations(o)) + "\n" + this.tab; |
|
5792 |
} |
|
5793 |
code += '}'; |
|
5794 |
if (this.ctor) { |
|
5795 |
return this.tab + code; |
|
5796 |
} |
|
5797 |
if (this.front || (o.level >= LEVEL_ACCESS)) { |
|
5798 |
return "(" + code + ")"; |
|
5799 |
} else { |
|
5800 |
return code; |
|
5801 |
} |
|
5802 |
}; |
|
5803 |
||
5804 |
Code.prototype.paramNames = function() { |
|
5805 |
var names, param, _i, _len, _ref2; |
|
5806 |
names = []; |
|
5807 |
_ref2 = this.params; |
|
5808 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5809 |
param = _ref2[_i]; |
|
5810 |
names.push.apply(names, param.names()); |
|
5811 |
} |
|
5812 |
return names; |
|
5813 |
}; |
|
5814 |
||
5815 |
Code.prototype.traverseChildren = function(crossScope, func) { |
|
5816 |
if (crossScope) { |
|
5817 |
return Code.__super__.traverseChildren.call(this, crossScope, func); |
|
5818 |
} |
|
5819 |
}; |
|
5820 |
||
5821 |
return Code; |
|
5822 |
||
5823 |
})(Base); |
|
5824 |
||
5825 |
exports.Param = Param = (function(_super) { |
|
5826 |
||
5827 |
__extends(Param, _super); |
|
5828 |
||
5829 |
function Param(name, value, splat) { |
|
5830 |
var _ref2; |
|
5831 |
this.name = name; |
|
5832 |
this.value = value; |
|
5833 |
this.splat = splat; |
|
5834 |
if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { |
|
5835 |
throw SyntaxError("parameter name \"" + name + "\" is not allowed"); |
|
5836 |
} |
|
5837 |
} |
|
5838 |
||
5839 |
Param.prototype.children = ['name', 'value']; |
|
5840 |
||
5841 |
Param.prototype.compile = function(o) { |
|
5842 |
return this.name.compile(o, LEVEL_LIST); |
|
5843 |
}; |
|
5844 |
||
5845 |
Param.prototype.asReference = function(o) { |
|
5846 |
var node; |
|
5847 |
if (this.reference) { |
|
5848 |
return this.reference; |
|
5849 |
} |
|
5850 |
node = this.name; |
|
5851 |
if (node["this"]) { |
|
5852 |
node = node.properties[0].name; |
|
5853 |
if (node.value.reserved) { |
|
5854 |
node = new Literal(o.scope.freeVariable(node.value)); |
|
5855 |
} |
|
5856 |
} else if (node.isComplex()) { |
|
5857 |
node = new Literal(o.scope.freeVariable('arg')); |
|
5858 |
} |
|
5859 |
node = new Value(node); |
|
5860 |
if (this.splat) { |
|
5861 |
node = new Splat(node); |
|
5862 |
} |
|
5863 |
return this.reference = node; |
|
5864 |
}; |
|
5865 |
||
5866 |
Param.prototype.isComplex = function() { |
|
5867 |
return this.name.isComplex(); |
|
5868 |
}; |
|
5869 |
||
5870 |
Param.prototype.names = function(name) { |
|
5871 |
var atParam, names, obj, _i, _len, _ref2; |
|
5872 |
if (name == null) { |
|
5873 |
name = this.name; |
|
5874 |
} |
|
5875 |
atParam = function(obj) { |
|
5876 |
var value; |
|
5877 |
value = obj.properties[0].name.value; |
|
5878 |
if (value.reserved) { |
|
5879 |
return []; |
|
5880 |
} else { |
|
5881 |
return [value]; |
|
5882 |
} |
|
5883 |
}; |
|
5884 |
if (name instanceof Literal) { |
|
5885 |
return [name.value]; |
|
5886 |
} |
|
5887 |
if (name instanceof Value) { |
|
5888 |
return atParam(name); |
|
5889 |
} |
|
5890 |
names = []; |
|
5891 |
_ref2 = name.objects; |
|
5892 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
5893 |
obj = _ref2[_i]; |
|
5894 |
if (obj instanceof Assign) { |
|
5895 |
names.push(obj.value.unwrap().value); |
|
5896 |
} else if (obj instanceof Splat) { |
|
5897 |
names.push(obj.name.unwrap().value); |
|
5898 |
} else if (obj instanceof Value) { |
|
5899 |
if (obj.isArray() || obj.isObject()) { |
|
5900 |
names.push.apply(names, this.names(obj.base)); |
|
5901 |
} else if (obj["this"]) { |
|
5902 |
names.push.apply(names, atParam(obj)); |
|
5903 |
} else { |
|
5904 |
names.push(obj.base.value); |
|
5905 |
} |
|
5906 |
} else { |
|
5907 |
throw SyntaxError("illegal parameter " + (obj.compile())); |
|
5908 |
} |
|
5909 |
} |
|
5910 |
return names; |
|
5911 |
}; |
|
5912 |
||
5913 |
return Param; |
|
5914 |
||
5915 |
})(Base); |
|
5916 |
||
5917 |
exports.Splat = Splat = (function(_super) { |
|
5918 |
||
5919 |
__extends(Splat, _super); |
|
5920 |
||
5921 |
Splat.prototype.children = ['name']; |
|
5922 |
||
5923 |
Splat.prototype.isAssignable = YES; |
|
5924 |
||
5925 |
function Splat(name) { |
|
5926 |
this.name = name.compile ? name : new Literal(name); |
|
5927 |
} |
|
5928 |
||
5929 |
Splat.prototype.assigns = function(name) { |
|
5930 |
return this.name.assigns(name); |
|
5931 |
}; |
|
5932 |
||
5933 |
Splat.prototype.compile = function(o) { |
|
5934 |
if (this.index != null) { |
|
5935 |
return this.compileParam(o); |
|
5936 |
} else { |
|
5937 |
return this.name.compile(o); |
|
5938 |
} |
|
5939 |
}; |
|
5940 |
||
5941 |
Splat.prototype.unwrap = function() { |
|
5942 |
return this.name; |
|
5943 |
}; |
|
5944 |
||
5945 |
Splat.compileSplattedArray = function(o, list, apply) { |
|
5946 |
var args, base, code, i, index, node, _i, _len; |
|
5947 |
index = -1; |
|
5948 |
while ((node = list[++index]) && !(node instanceof Splat)) { |
|
5949 |
continue; |
|
5950 |
} |
|
5951 |
if (index >= list.length) { |
|
5952 |
return ''; |
|
5953 |
} |
|
5954 |
if (list.length === 1) { |
|
5955 |
code = list[0].compile(o, LEVEL_LIST); |
|
5956 |
if (apply) { |
|
5957 |
return code; |
|
5958 |
} |
|
5959 |
return "" + (utility('slice')) + ".call(" + code + ")"; |
|
5960 |
} |
|
5961 |
args = list.slice(index); |
|
5962 |
for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) { |
|
5963 |
node = args[i]; |
|
5964 |
code = node.compile(o, LEVEL_LIST); |
|
5965 |
args[i] = node instanceof Splat ? "" + (utility('slice')) + ".call(" + code + ")" : "[" + code + "]"; |
|
5966 |
} |
|
5967 |
if (index === 0) { |
|
5968 |
return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")"); |
|
5969 |
} |
|
5970 |
base = (function() { |
|
5971 |
var _j, _len1, _ref2, _results; |
|
5972 |
_ref2 = list.slice(0, index); |
|
5973 |
_results = []; |
|
5974 |
for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) { |
|
5975 |
node = _ref2[_j]; |
|
5976 |
_results.push(node.compile(o, LEVEL_LIST)); |
|
5977 |
} |
|
5978 |
return _results; |
|
5979 |
})(); |
|
5980 |
return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")"; |
|
5981 |
}; |
|
5982 |
||
5983 |
return Splat; |
|
5984 |
||
5985 |
})(Base); |
|
5986 |
||
5987 |
exports.While = While = (function(_super) { |
|
5988 |
||
5989 |
__extends(While, _super); |
|
5990 |
||
5991 |
function While(condition, options) { |
|
5992 |
this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition; |
|
5993 |
this.guard = options != null ? options.guard : void 0; |
|
5994 |
} |
|
5995 |
||
5996 |
While.prototype.children = ['condition', 'guard', 'body']; |
|
5997 |
||
5998 |
While.prototype.isStatement = YES; |
|
5999 |
||
6000 |
While.prototype.makeReturn = function(res) { |
|
6001 |
if (res) { |
|
6002 |
return While.__super__.makeReturn.apply(this, arguments); |
|
6003 |
} else { |
|
6004 |
this.returns = !this.jumps({ |
|
6005 |
loop: true |
|
6006 |
}); |
|
6007 |
return this; |
|
6008 |
} |
|
6009 |
}; |
|
6010 |
||
6011 |
While.prototype.addBody = function(body) { |
|
6012 |
this.body = body; |
|
6013 |
return this; |
|
6014 |
}; |
|
6015 |
||
6016 |
While.prototype.jumps = function() { |
|
6017 |
var expressions, node, _i, _len; |
|
6018 |
expressions = this.body.expressions; |
|
6019 |
if (!expressions.length) { |
|
6020 |
return false; |
|
6021 |
} |
|
6022 |
for (_i = 0, _len = expressions.length; _i < _len; _i++) { |
|
6023 |
node = expressions[_i]; |
|
6024 |
if (node.jumps({ |
|
6025 |
loop: true |
|
6026 |
})) { |
|
6027 |
return node; |
|
6028 |
} |
|
6029 |
} |
|
6030 |
return false; |
|
6031 |
}; |
|
6032 |
||
6033 |
While.prototype.compileNode = function(o) { |
|
6034 |
var body, code, rvar, set; |
|
6035 |
o.indent += TAB; |
|
6036 |
set = ''; |
|
6037 |
body = this.body; |
|
6038 |
if (body.isEmpty()) { |
|
6039 |
body = ''; |
|
6040 |
} else { |
|
6041 |
if (this.returns) { |
|
6042 |
body.makeReturn(rvar = o.scope.freeVariable('results')); |
|
6043 |
set = "" + this.tab + rvar + " = [];\n"; |
|
6044 |
} |
|
6045 |
if (this.guard) { |
|
6046 |
if (body.expressions.length > 1) { |
|
6047 |
body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); |
|
6048 |
} else { |
|
6049 |
if (this.guard) { |
|
6050 |
body = Block.wrap([new If(this.guard, body)]); |
|
6051 |
} |
|
6052 |
} |
|
6053 |
} |
|
6054 |
body = "\n" + (body.compile(o, LEVEL_TOP)) + "\n" + this.tab; |
|
6055 |
} |
|
6056 |
code = set + this.tab + ("while (" + (this.condition.compile(o, LEVEL_PAREN)) + ") {" + body + "}"); |
|
6057 |
if (this.returns) { |
|
6058 |
code += "\n" + this.tab + "return " + rvar + ";"; |
|
6059 |
} |
|
6060 |
return code; |
|
6061 |
}; |
|
6062 |
||
6063 |
return While; |
|
6064 |
||
6065 |
})(Base); |
|
6066 |
||
6067 |
exports.Op = Op = (function(_super) { |
|
6068 |
var CONVERSIONS, INVERSIONS; |
|
6069 |
||
6070 |
__extends(Op, _super); |
|
6071 |
||
6072 |
function Op(op, first, second, flip) { |
|
6073 |
if (op === 'in') { |
|
6074 |
return new In(first, second); |
|
6075 |
} |
|
6076 |
if (op === 'do') { |
|
6077 |
return this.generateDo(first); |
|
6078 |
} |
|
6079 |
if (op === 'new') { |
|
6080 |
if (first instanceof Call && !first["do"] && !first.isNew) { |
|
6081 |
return first.newInstance(); |
|
6082 |
} |
|
6083 |
if (first instanceof Code && first.bound || first["do"]) { |
|
6084 |
first = new Parens(first); |
|
6085 |
} |
|
6086 |
} |
|
6087 |
this.operator = CONVERSIONS[op] || op; |
|
6088 |
this.first = first; |
|
6089 |
this.second = second; |
|
6090 |
this.flip = !!flip; |
|
6091 |
return this; |
|
6092 |
} |
|
6093 |
||
6094 |
CONVERSIONS = { |
|
6095 |
'==': '===', |
|
6096 |
'!=': '!==', |
|
6097 |
'of': 'in' |
|
6098 |
}; |
|
6099 |
||
6100 |
INVERSIONS = { |
|
6101 |
'!==': '===', |
|
6102 |
'===': '!==' |
|
6103 |
}; |
|
6104 |
||
6105 |
Op.prototype.children = ['first', 'second']; |
|
6106 |
||
6107 |
Op.prototype.isSimpleNumber = NO; |
|
6108 |
||
6109 |
Op.prototype.isUnary = function() { |
|
6110 |
return !this.second; |
|
6111 |
}; |
|
6112 |
||
6113 |
Op.prototype.isComplex = function() { |
|
6114 |
var _ref2; |
|
6115 |
return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex(); |
|
6116 |
}; |
|
6117 |
||
6118 |
Op.prototype.isChainable = function() { |
|
6119 |
var _ref2; |
|
6120 |
return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!=='; |
|
6121 |
}; |
|
6122 |
||
6123 |
Op.prototype.invert = function() { |
|
6124 |
var allInvertable, curr, fst, op, _ref2; |
|
6125 |
if (this.isChainable() && this.first.isChainable()) { |
|
6126 |
allInvertable = true; |
|
6127 |
curr = this; |
|
6128 |
while (curr && curr.operator) { |
|
6129 |
allInvertable && (allInvertable = curr.operator in INVERSIONS); |
|
6130 |
curr = curr.first; |
|
6131 |
} |
|
6132 |
if (!allInvertable) { |
|
6133 |
return new Parens(this).invert(); |
|
6134 |
} |
|
6135 |
curr = this; |
|
6136 |
while (curr && curr.operator) { |
|
6137 |
curr.invert = !curr.invert; |
|
6138 |
curr.operator = INVERSIONS[curr.operator]; |
|
6139 |
curr = curr.first; |
|
6140 |
} |
|
6141 |
return this; |
|
6142 |
} else if (op = INVERSIONS[this.operator]) { |
|
6143 |
this.operator = op; |
|
6144 |
if (this.first.unwrap() instanceof Op) { |
|
6145 |
this.first.invert(); |
|
6146 |
} |
|
6147 |
return this; |
|
6148 |
} else if (this.second) { |
|
6149 |
return new Parens(this).invert(); |
|
6150 |
} else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) { |
|
6151 |
return fst; |
|
6152 |
} else { |
|
6153 |
return new Op('!', this); |
|
6154 |
} |
|
6155 |
}; |
|
6156 |
||
6157 |
Op.prototype.unfoldSoak = function(o) { |
|
6158 |
var _ref2; |
|
6159 |
return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first'); |
|
6160 |
}; |
|
6161 |
||
6162 |
Op.prototype.generateDo = function(exp) { |
|
6163 |
var call, func, param, passedParams, ref, _i, _len, _ref2; |
|
6164 |
passedParams = []; |
|
6165 |
func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp; |
|
6166 |
_ref2 = func.params || []; |
|
6167 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
6168 |
param = _ref2[_i]; |
|
6169 |
if (param.value) { |
|
6170 |
passedParams.push(param.value); |
|
6171 |
delete param.value; |
|
6172 |
} else { |
|
6173 |
passedParams.push(param); |
|
6174 |
} |
|
6175 |
} |
|
6176 |
call = new Call(exp, passedParams); |
|
6177 |
call["do"] = true; |
|
6178 |
return call; |
|
6179 |
}; |
|
6180 |
||
6181 |
Op.prototype.compileNode = function(o) { |
|
6182 |
var code, isChain, _ref2, _ref3; |
|
6183 |
isChain = this.isChainable() && this.first.isChainable(); |
|
6184 |
if (!isChain) { |
|
6185 |
this.first.front = this.front; |
|
6186 |
} |
|
6187 |
if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) { |
|
6188 |
throw SyntaxError('delete operand may not be argument or var'); |
|
6189 |
} |
|
6190 |
if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) { |
|
6191 |
throw SyntaxError('prefix increment/decrement may not have eval or arguments operand'); |
|
6192 |
} |
|
6193 |
if (this.isUnary()) { |
|
6194 |
return this.compileUnary(o); |
|
6195 |
} |
|
6196 |
if (isChain) { |
|
6197 |
return this.compileChain(o); |
|
6198 |
} |
|
6199 |
if (this.operator === '?') { |
|
6200 |
return this.compileExistence(o); |
|
6201 |
} |
|
6202 |
code = this.first.compile(o, LEVEL_OP) + ' ' + this.operator + ' ' + this.second.compile(o, LEVEL_OP); |
|
6203 |
if (o.level <= LEVEL_OP) { |
|
6204 |
return code; |
|
6205 |
} else { |
|
6206 |
return "(" + code + ")"; |
|
6207 |
} |
|
6208 |
}; |
|
6209 |
||
6210 |
Op.prototype.compileChain = function(o) { |
|
6211 |
var code, fst, shared, _ref2; |
|
6212 |
_ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1]; |
|
6213 |
fst = this.first.compile(o, LEVEL_OP); |
|
6214 |
code = "" + fst + " " + (this.invert ? '&&' : '||') + " " + (shared.compile(o)) + " " + this.operator + " " + (this.second.compile(o, LEVEL_OP)); |
|
6215 |
return "(" + code + ")"; |
|
6216 |
}; |
|
6217 |
||
6218 |
Op.prototype.compileExistence = function(o) { |
|
6219 |
var fst, ref; |
|
6220 |
if (this.first.isComplex()) { |
|
6221 |
ref = new Literal(o.scope.freeVariable('ref')); |
|
6222 |
fst = new Parens(new Assign(ref, this.first)); |
|
6223 |
} else { |
|
6224 |
fst = this.first; |
|
6225 |
ref = fst; |
|
6226 |
} |
|
6227 |
return new If(new Existence(fst), ref, { |
|
6228 |
type: 'if' |
|
6229 |
}).addElse(this.second).compile(o); |
|
6230 |
}; |
|
6231 |
||
6232 |
Op.prototype.compileUnary = function(o) { |
|
6233 |
var op, parts, plusMinus; |
|
6234 |
if (o.level >= LEVEL_ACCESS) { |
|
6235 |
return (new Parens(this)).compile(o); |
|
6236 |
} |
|
6237 |
parts = [op = this.operator]; |
|
6238 |
plusMinus = op === '+' || op === '-'; |
|
6239 |
if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) { |
|
6240 |
parts.push(' '); |
|
6241 |
} |
|
6242 |
if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) { |
|
6243 |
this.first = new Parens(this.first); |
|
6244 |
} |
|
6245 |
parts.push(this.first.compile(o, LEVEL_OP)); |
|
6246 |
if (this.flip) { |
|
6247 |
parts.reverse(); |
|
6248 |
} |
|
6249 |
return parts.join(''); |
|
6250 |
}; |
|
6251 |
||
6252 |
Op.prototype.toString = function(idt) { |
|
6253 |
return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator); |
|
6254 |
}; |
|
6255 |
||
6256 |
return Op; |
|
6257 |
||
6258 |
})(Base); |
|
6259 |
||
6260 |
exports.In = In = (function(_super) { |
|
6261 |
||
6262 |
__extends(In, _super); |
|
6263 |
||
6264 |
function In(object, array) { |
|
6265 |
this.object = object; |
|
6266 |
this.array = array; |
|
6267 |
} |
|
6268 |
||
6269 |
In.prototype.children = ['object', 'array']; |
|
6270 |
||
6271 |
In.prototype.invert = NEGATE; |
|
6272 |
||
6273 |
In.prototype.compileNode = function(o) { |
|
6274 |
var hasSplat, obj, _i, _len, _ref2; |
|
6275 |
if (this.array instanceof Value && this.array.isArray()) { |
|
6276 |
_ref2 = this.array.base.objects; |
|
6277 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
6278 |
obj = _ref2[_i]; |
|
6279 |
if (!(obj instanceof Splat)) { |
|
6280 |
continue; |
|
6281 |
} |
|
6282 |
hasSplat = true; |
|
6283 |
break; |
|
6284 |
} |
|
6285 |
if (!hasSplat) { |
|
6286 |
return this.compileOrTest(o); |
|
6287 |
} |
|
6288 |
} |
|
6289 |
return this.compileLoopTest(o); |
|
6290 |
}; |
|
6291 |
||
6292 |
In.prototype.compileOrTest = function(o) { |
|
6293 |
var cmp, cnj, i, item, ref, sub, tests, _ref2, _ref3; |
|
6294 |
if (this.array.base.objects.length === 0) { |
|
6295 |
return "" + (!!this.negated); |
|
6296 |
} |
|
6297 |
_ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1]; |
|
6298 |
_ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1]; |
|
6299 |
tests = (function() { |
|
6300 |
var _i, _len, _ref4, _results; |
|
6301 |
_ref4 = this.array.base.objects; |
|
6302 |
_results = []; |
|
6303 |
for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) { |
|
6304 |
item = _ref4[i]; |
|
6305 |
_results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_ACCESS)); |
|
6306 |
} |
|
6307 |
return _results; |
|
6308 |
}).call(this); |
|
6309 |
tests = tests.join(cnj); |
|
6310 |
if (o.level < LEVEL_OP) { |
|
6311 |
return tests; |
|
6312 |
} else { |
|
6313 |
return "(" + tests + ")"; |
|
6314 |
} |
|
6315 |
}; |
|
6316 |
||
6317 |
In.prototype.compileLoopTest = function(o) { |
|
6318 |
var code, ref, sub, _ref2; |
|
6319 |
_ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1]; |
|
6320 |
code = utility('indexOf') + (".call(" + (this.array.compile(o, LEVEL_LIST)) + ", " + ref + ") ") + (this.negated ? '< 0' : '>= 0'); |
|
6321 |
if (sub === ref) { |
|
6322 |
return code; |
|
6323 |
} |
|
6324 |
code = sub + ', ' + code; |
|
6325 |
if (o.level < LEVEL_LIST) { |
|
6326 |
return code; |
|
6327 |
} else { |
|
6328 |
return "(" + code + ")"; |
|
6329 |
} |
|
6330 |
}; |
|
6331 |
||
6332 |
In.prototype.toString = function(idt) { |
|
6333 |
return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : '')); |
|
6334 |
}; |
|
6335 |
||
6336 |
return In; |
|
6337 |
||
6338 |
})(Base); |
|
6339 |
||
6340 |
exports.Try = Try = (function(_super) { |
|
6341 |
||
6342 |
__extends(Try, _super); |
|
6343 |
||
6344 |
function Try(attempt, error, recovery, ensure) { |
|
6345 |
this.attempt = attempt; |
|
6346 |
this.error = error; |
|
6347 |
this.recovery = recovery; |
|
6348 |
this.ensure = ensure; |
|
6349 |
} |
|
6350 |
||
6351 |
Try.prototype.children = ['attempt', 'recovery', 'ensure']; |
|
6352 |
||
6353 |
Try.prototype.isStatement = YES; |
|
6354 |
||
6355 |
Try.prototype.jumps = function(o) { |
|
6356 |
var _ref2; |
|
6357 |
return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0); |
|
6358 |
}; |
|
6359 |
||
6360 |
Try.prototype.makeReturn = function(res) { |
|
6361 |
if (this.attempt) { |
|
6362 |
this.attempt = this.attempt.makeReturn(res); |
|
6363 |
} |
|
6364 |
if (this.recovery) { |
|
6365 |
this.recovery = this.recovery.makeReturn(res); |
|
6366 |
} |
|
6367 |
return this; |
|
6368 |
}; |
|
6369 |
||
6370 |
Try.prototype.compileNode = function(o) { |
|
6371 |
var catchPart, ensurePart, errorPart, tryPart; |
|
6372 |
o.indent += TAB; |
|
6373 |
errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' '; |
|
6374 |
tryPart = this.attempt.compile(o, LEVEL_TOP); |
|
6375 |
catchPart = (function() { |
|
6376 |
var _ref2; |
|
6377 |
if (this.recovery) { |
|
6378 |
if (_ref2 = this.error.value, __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) { |
|
6379 |
throw SyntaxError("catch variable may not be \"" + this.error.value + "\""); |
|
6380 |
} |
|
6381 |
if (!o.scope.check(this.error.value)) { |
|
6382 |
o.scope.add(this.error.value, 'param'); |
|
6383 |
} |
|
6384 |
return " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}"; |
|
6385 |
} else if (!(this.ensure || this.recovery)) { |
|
6386 |
return ' catch (_error) {}'; |
|
6387 |
} |
|
6388 |
}).call(this); |
|
6389 |
ensurePart = this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : ''; |
|
6390 |
return "" + this.tab + "try {\n" + tryPart + "\n" + this.tab + "}" + (catchPart || '') + ensurePart; |
|
6391 |
}; |
|
6392 |
||
6393 |
return Try; |
|
6394 |
||
6395 |
})(Base); |
|
6396 |
||
6397 |
exports.Throw = Throw = (function(_super) { |
|
6398 |
||
6399 |
__extends(Throw, _super); |
|
6400 |
||
6401 |
function Throw(expression) { |
|
6402 |
this.expression = expression; |
|
6403 |
} |
|
6404 |
||
6405 |
Throw.prototype.children = ['expression']; |
|
6406 |
||
6407 |
Throw.prototype.isStatement = YES; |
|
6408 |
||
6409 |
Throw.prototype.jumps = NO; |
|
6410 |
||
6411 |
Throw.prototype.makeReturn = THIS; |
|
6412 |
||
6413 |
Throw.prototype.compileNode = function(o) { |
|
6414 |
return this.tab + ("throw " + (this.expression.compile(o)) + ";"); |
|
6415 |
}; |
|
6416 |
||
6417 |
return Throw; |
|
6418 |
||
6419 |
})(Base); |
|
6420 |
||
6421 |
exports.Existence = Existence = (function(_super) { |
|
6422 |
||
6423 |
__extends(Existence, _super); |
|
6424 |
||
6425 |
function Existence(expression) { |
|
6426 |
this.expression = expression; |
|
6427 |
} |
|
6428 |
||
6429 |
Existence.prototype.children = ['expression']; |
|
6430 |
||
6431 |
Existence.prototype.invert = NEGATE; |
|
6432 |
||
6433 |
Existence.prototype.compileNode = function(o) { |
|
6434 |
var cmp, cnj, code, _ref2; |
|
6435 |
this.expression.front = this.front; |
|
6436 |
code = this.expression.compile(o, LEVEL_OP); |
|
6437 |
if (IDENTIFIER.test(code) && !o.scope.check(code)) { |
|
6438 |
_ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1]; |
|
6439 |
code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null"; |
|
6440 |
} else { |
|
6441 |
code = "" + code + " " + (this.negated ? '==' : '!=') + " null"; |
|
6442 |
} |
|
6443 |
if (o.level <= LEVEL_COND) { |
|
6444 |
return code; |
|
6445 |
} else { |
|
6446 |
return "(" + code + ")"; |
|
6447 |
} |
|
6448 |
}; |
|
6449 |
||
6450 |
return Existence; |
|
6451 |
||
6452 |
})(Base); |
|
6453 |
||
6454 |
exports.Parens = Parens = (function(_super) { |
|
6455 |
||
6456 |
__extends(Parens, _super); |
|
6457 |
||
6458 |
function Parens(body) { |
|
6459 |
this.body = body; |
|
6460 |
} |
|
6461 |
||
6462 |
Parens.prototype.children = ['body']; |
|
6463 |
||
6464 |
Parens.prototype.unwrap = function() { |
|
6465 |
return this.body; |
|
6466 |
}; |
|
6467 |
||
6468 |
Parens.prototype.isComplex = function() { |
|
6469 |
return this.body.isComplex(); |
|
6470 |
}; |
|
6471 |
||
6472 |
Parens.prototype.compileNode = function(o) { |
|
6473 |
var bare, code, expr; |
|
6474 |
expr = this.body.unwrap(); |
|
6475 |
if (expr instanceof Value && expr.isAtomic()) { |
|
6476 |
expr.front = this.front; |
|
6477 |
return expr.compile(o); |
|
6478 |
} |
|
6479 |
code = expr.compile(o, LEVEL_PAREN); |
|
6480 |
bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns)); |
|
6481 |
if (bare) { |
|
6482 |
return code; |
|
6483 |
} else { |
|
6484 |
return "(" + code + ")"; |
|
6485 |
} |
|
6486 |
}; |
|
6487 |
||
6488 |
return Parens; |
|
6489 |
||
6490 |
})(Base); |
|
6491 |
||
6492 |
exports.For = For = (function(_super) { |
|
6493 |
||
6494 |
__extends(For, _super); |
|
6495 |
||
6496 |
function For(body, source) { |
|
6497 |
var _ref2; |
|
6498 |
this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index; |
|
6499 |
this.body = Block.wrap([body]); |
|
6500 |
this.own = !!source.own; |
|
6501 |
this.object = !!source.object; |
|
6502 |
if (this.object) { |
|
6503 |
_ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1]; |
|
6504 |
} |
|
6505 |
if (this.index instanceof Value) { |
|
6506 |
throw SyntaxError('index cannot be a pattern matching expression'); |
|
6507 |
} |
|
6508 |
this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length; |
|
6509 |
this.pattern = this.name instanceof Value; |
|
6510 |
if (this.range && this.index) { |
|
6511 |
throw SyntaxError('indexes do not apply to range loops'); |
|
6512 |
} |
|
6513 |
if (this.range && this.pattern) { |
|
6514 |
throw SyntaxError('cannot pattern match over range loops'); |
|
6515 |
} |
|
6516 |
this.returns = false; |
|
6517 |
} |
|
6518 |
||
6519 |
For.prototype.children = ['body', 'source', 'guard', 'step']; |
|
6520 |
||
6521 |
For.prototype.compileNode = function(o) { |
|
6522 |
var body, defPart, forPart, forVarPart, guardPart, idt1, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, stepPart, stepvar, svar, varPart, _ref2; |
|
6523 |
body = Block.wrap([this.body]); |
|
6524 |
lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0; |
|
6525 |
if (lastJumps && lastJumps instanceof Return) { |
|
6526 |
this.returns = false; |
|
6527 |
} |
|
6528 |
source = this.range ? this.source.base : this.source; |
|
6529 |
scope = o.scope; |
|
6530 |
name = this.name && this.name.compile(o, LEVEL_LIST); |
|
6531 |
index = this.index && this.index.compile(o, LEVEL_LIST); |
|
6532 |
if (name && !this.pattern) { |
|
6533 |
scope.find(name); |
|
6534 |
} |
|
6535 |
if (index) { |
|
6536 |
scope.find(index); |
|
6537 |
} |
|
6538 |
if (this.returns) { |
|
6539 |
rvar = scope.freeVariable('results'); |
|
6540 |
} |
|
6541 |
ivar = (this.object && index) || scope.freeVariable('i'); |
|
6542 |
kvar = (this.range && name) || index || ivar; |
|
6543 |
kvarAssign = kvar !== ivar ? "" + kvar + " = " : ""; |
|
6544 |
if (this.step && !this.range) { |
|
6545 |
stepvar = scope.freeVariable("step"); |
|
6546 |
} |
|
6547 |
if (this.pattern) { |
|
6548 |
name = ivar; |
|
6549 |
} |
|
6550 |
varPart = ''; |
|
6551 |
guardPart = ''; |
|
6552 |
defPart = ''; |
|
6553 |
idt1 = this.tab + TAB; |
|
6554 |
if (this.range) { |
|
6555 |
forPart = source.compile(merge(o, { |
|
6556 |
index: ivar, |
|
6557 |
name: name, |
|
6558 |
step: this.step |
|
6559 |
})); |
|
6560 |
} else { |
|
6561 |
svar = this.source.compile(o, LEVEL_LIST); |
|
6562 |
if ((name || this.own) && !IDENTIFIER.test(svar)) { |
|
6563 |
defPart = "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n"; |
|
6564 |
svar = ref; |
|
6565 |
} |
|
6566 |
if (name && !this.pattern) { |
|
6567 |
namePart = "" + name + " = " + svar + "[" + kvar + "]"; |
|
6568 |
} |
|
6569 |
if (!this.object) { |
|
6570 |
lvar = scope.freeVariable('len'); |
|
6571 |
forVarPart = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length"; |
|
6572 |
if (this.step) { |
|
6573 |
forVarPart += ", " + stepvar + " = " + (this.step.compile(o, LEVEL_OP)); |
|
6574 |
} |
|
6575 |
stepPart = "" + kvarAssign + (this.step ? "" + ivar + " += " + stepvar : (kvar !== ivar ? "++" + ivar : "" + ivar + "++")); |
|
6576 |
forPart = "" + forVarPart + "; " + ivar + " < " + lvar + "; " + stepPart; |
|
6577 |
} |
|
6578 |
} |
|
6579 |
if (this.returns) { |
|
6580 |
resultPart = "" + this.tab + rvar + " = [];\n"; |
|
6581 |
returnResult = "\n" + this.tab + "return " + rvar + ";"; |
|
6582 |
body.makeReturn(rvar); |
|
6583 |
} |
|
6584 |
if (this.guard) { |
|
6585 |
if (body.expressions.length > 1) { |
|
6586 |
body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue"))); |
|
6587 |
} else { |
|
6588 |
if (this.guard) { |
|
6589 |
body = Block.wrap([new If(this.guard, body)]); |
|
6590 |
} |
|
6591 |
} |
|
6592 |
} |
|
6593 |
if (this.pattern) { |
|
6594 |
body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]"))); |
|
6595 |
} |
|
6596 |
defPart += this.pluckDirectCall(o, body); |
|
6597 |
if (namePart) { |
|
6598 |
varPart = "\n" + idt1 + namePart + ";"; |
|
6599 |
} |
|
6600 |
if (this.object) { |
|
6601 |
forPart = "" + kvar + " in " + svar; |
|
6602 |
if (this.own) { |
|
6603 |
guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;"; |
|
6604 |
} |
|
6605 |
} |
|
6606 |
body = body.compile(merge(o, { |
|
6607 |
indent: idt1 |
|
6608 |
}), LEVEL_TOP); |
|
6609 |
if (body) { |
|
6610 |
body = '\n' + body + '\n'; |
|
6611 |
} |
|
6612 |
return "" + defPart + (resultPart || '') + this.tab + "for (" + forPart + ") {" + guardPart + varPart + body + this.tab + "}" + (returnResult || ''); |
|
6613 |
}; |
|
6614 |
||
6615 |
For.prototype.pluckDirectCall = function(o, body) { |
|
6616 |
var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7; |
|
6617 |
defs = ''; |
|
6618 |
_ref2 = body.expressions; |
|
6619 |
for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) { |
|
6620 |
expr = _ref2[idx]; |
|
6621 |
expr = expr.unwrapAll(); |
|
6622 |
if (!(expr instanceof Call)) { |
|
6623 |
continue; |
|
6624 |
} |
|
6625 |
val = expr.variable.unwrapAll(); |
|
6626 |
if (!((val instanceof Code) || (val instanceof Value && ((_ref3 = val.base) != null ? _ref3.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref4 = (_ref5 = val.properties[0].name) != null ? _ref5.value : void 0) === 'call' || _ref4 === 'apply')))) { |
|
6627 |
continue; |
|
6628 |
} |
|
6629 |
fn = ((_ref6 = val.base) != null ? _ref6.unwrapAll() : void 0) || val; |
|
6630 |
ref = new Literal(o.scope.freeVariable('fn')); |
|
6631 |
base = new Value(ref); |
|
6632 |
if (val.base) { |
|
6633 |
_ref7 = [base, val], val.base = _ref7[0], base = _ref7[1]; |
|
6634 |
} |
|
6635 |
body.expressions[idx] = new Call(base, expr.args); |
|
6636 |
defs += this.tab + new Assign(ref, fn).compile(o, LEVEL_TOP) + ';\n'; |
|
6637 |
} |
|
6638 |
return defs; |
|
6639 |
}; |
|
6640 |
||
6641 |
return For; |
|
6642 |
||
6643 |
})(While); |
|
6644 |
||
6645 |
exports.Switch = Switch = (function(_super) { |
|
6646 |
||
6647 |
__extends(Switch, _super); |
|
6648 |
||
6649 |
function Switch(subject, cases, otherwise) { |
|
6650 |
this.subject = subject; |
|
6651 |
this.cases = cases; |
|
6652 |
this.otherwise = otherwise; |
|
6653 |
} |
|
6654 |
||
6655 |
Switch.prototype.children = ['subject', 'cases', 'otherwise']; |
|
6656 |
||
6657 |
Switch.prototype.isStatement = YES; |
|
6658 |
||
6659 |
Switch.prototype.jumps = function(o) { |
|
6660 |
var block, conds, _i, _len, _ref2, _ref3, _ref4; |
|
6661 |
if (o == null) { |
|
6662 |
o = { |
|
6663 |
block: true |
|
6664 |
}; |
|
6665 |
} |
|
6666 |
_ref2 = this.cases; |
|
6667 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
6668 |
_ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1]; |
|
6669 |
if (block.jumps(o)) { |
|
6670 |
return block; |
|
6671 |
} |
|
6672 |
} |
|
6673 |
return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0; |
|
6674 |
}; |
|
6675 |
||
6676 |
Switch.prototype.makeReturn = function(res) { |
|
6677 |
var pair, _i, _len, _ref2, _ref3; |
|
6678 |
_ref2 = this.cases; |
|
6679 |
for (_i = 0, _len = _ref2.length; _i < _len; _i++) { |
|
6680 |
pair = _ref2[_i]; |
|
6681 |
pair[1].makeReturn(res); |
|
6682 |
} |
|
6683 |
if (res) { |
|
6684 |
this.otherwise || (this.otherwise = new Block([new Literal('void 0')])); |
|
6685 |
} |
|
6686 |
if ((_ref3 = this.otherwise) != null) { |
|
6687 |
_ref3.makeReturn(res); |
|
6688 |
} |
|
6689 |
return this; |
|
6690 |
}; |
|
6691 |
||
6692 |
Switch.prototype.compileNode = function(o) { |
|
6693 |
var block, body, code, cond, conditions, expr, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4, _ref5; |
|
6694 |
idt1 = o.indent + TAB; |
|
6695 |
idt2 = o.indent = idt1 + TAB; |
|
6696 |
code = this.tab + ("switch (" + (((_ref2 = this.subject) != null ? _ref2.compile(o, LEVEL_PAREN) : void 0) || false) + ") {\n"); |
|
6697 |
_ref3 = this.cases; |
|
6698 |
for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) { |
|
6699 |
_ref4 = _ref3[i], conditions = _ref4[0], block = _ref4[1]; |
|
6700 |
_ref5 = flatten([conditions]); |
|
6701 |
for (_j = 0, _len1 = _ref5.length; _j < _len1; _j++) { |
|
6702 |
cond = _ref5[_j]; |
|
6703 |
if (!this.subject) { |
|
6704 |
cond = cond.invert(); |
|
6705 |
} |
|
6706 |
code += idt1 + ("case " + (cond.compile(o, LEVEL_PAREN)) + ":\n"); |
|
6707 |
} |
|
6708 |
if (body = block.compile(o, LEVEL_TOP)) { |
|
6709 |
code += body + '\n'; |
|
6710 |
} |
|
6711 |
if (i === this.cases.length - 1 && !this.otherwise) { |
|
6712 |
break; |
|
6713 |
} |
|
6714 |
expr = this.lastNonComment(block.expressions); |
|
6715 |
if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) { |
|
6716 |
continue; |
|
6717 |
} |
|
6718 |
code += idt2 + 'break;\n'; |
|
6719 |
} |
|
6720 |
if (this.otherwise && this.otherwise.expressions.length) { |
|
6721 |
code += idt1 + ("default:\n" + (this.otherwise.compile(o, LEVEL_TOP)) + "\n"); |
|
6722 |
} |
|
6723 |
return code + this.tab + '}'; |
|
6724 |
}; |
|
6725 |
||
6726 |
return Switch; |
|
6727 |
||
6728 |
})(Base); |
|
6729 |
||
6730 |
exports.If = If = (function(_super) { |
|
6731 |
||
6732 |
__extends(If, _super); |
|
6733 |
||
6734 |
function If(condition, body, options) { |
|
6735 |
this.body = body; |
|
6736 |
if (options == null) { |
|
6737 |
options = {}; |
|
6738 |
} |
|
6739 |
this.condition = options.type === 'unless' ? condition.invert() : condition; |
|
6740 |
this.elseBody = null; |
|
6741 |
this.isChain = false; |
|
6742 |
this.soak = options.soak; |
|
6743 |
} |
|
6744 |
||
6745 |
If.prototype.children = ['condition', 'body', 'elseBody']; |
|
6746 |
||
6747 |
If.prototype.bodyNode = function() { |
|
6748 |
var _ref2; |
|
6749 |
return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0; |
|
6750 |
}; |
|
6751 |
||
6752 |
If.prototype.elseBodyNode = function() { |
|
6753 |
var _ref2; |
|
6754 |
return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0; |
|
6755 |
}; |
|
6756 |
||
6757 |
If.prototype.addElse = function(elseBody) { |
|
6758 |
if (this.isChain) { |
|
6759 |
this.elseBodyNode().addElse(elseBody); |
|
6760 |
} else { |
|
6761 |
this.isChain = elseBody instanceof If; |
|
6762 |
this.elseBody = this.ensureBlock(elseBody); |
|
6763 |
} |
|
6764 |
return this; |
|
6765 |
}; |
|
6766 |
||
6767 |
If.prototype.isStatement = function(o) { |
|
6768 |
var _ref2; |
|
6769 |
return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0); |
|
6770 |
}; |
|
6771 |
||
6772 |
If.prototype.jumps = function(o) { |
|
6773 |
var _ref2; |
|
6774 |
return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0); |
|
6775 |
}; |
|
6776 |
||
6777 |
If.prototype.compileNode = function(o) { |
|
6778 |
if (this.isStatement(o)) { |
|
6779 |
return this.compileStatement(o); |
|
6780 |
} else { |
|
6781 |
return this.compileExpression(o); |
|
6782 |
} |
|
6783 |
}; |
|
6784 |
||
6785 |
If.prototype.makeReturn = function(res) { |
|
6786 |
if (res) { |
|
6787 |
this.elseBody || (this.elseBody = new Block([new Literal('void 0')])); |
|
6788 |
} |
|
6789 |
this.body && (this.body = new Block([this.body.makeReturn(res)])); |
|
6790 |
this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)])); |
|
6791 |
return this; |
|
6792 |
}; |
|
6793 |
||
6794 |
If.prototype.ensureBlock = function(node) { |
|
6795 |
if (node instanceof Block) { |
|
6796 |
return node; |
|
6797 |
} else { |
|
6798 |
return new Block([node]); |
|
6799 |
} |
|
6800 |
}; |
|
6801 |
||
6802 |
If.prototype.compileStatement = function(o) { |
|
6803 |
var body, child, cond, exeq, ifPart; |
|
6804 |
child = del(o, 'chainChild'); |
|
6805 |
exeq = del(o, 'isExistentialEquals'); |
|
6806 |
if (exeq) { |
|
6807 |
return new If(this.condition.invert(), this.elseBodyNode(), { |
|
6808 |
type: 'if' |
|
6809 |
}).compile(o); |
|
6810 |
} |
|
6811 |
cond = this.condition.compile(o, LEVEL_PAREN); |
|
6812 |
o.indent += TAB; |
|
6813 |
body = this.ensureBlock(this.body); |
|
6814 |
ifPart = "if (" + cond + ") {\n" + (body.compile(o)) + "\n" + this.tab + "}"; |
|
6815 |
if (!child) { |
|
6816 |
ifPart = this.tab + ifPart; |
|
6817 |
} |
|
6818 |
if (!this.elseBody) { |
|
6819 |
return ifPart; |
|
6820 |
} |
|
6821 |
return ifPart + ' else ' + (this.isChain ? (o.indent = this.tab, o.chainChild = true, this.elseBody.unwrap().compile(o, LEVEL_TOP)) : "{\n" + (this.elseBody.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}"); |
|
6822 |
}; |
|
6823 |
||
6824 |
If.prototype.compileExpression = function(o) { |
|
6825 |
var alt, body, code, cond; |
|
6826 |
cond = this.condition.compile(o, LEVEL_COND); |
|
6827 |
body = this.bodyNode().compile(o, LEVEL_LIST); |
|
6828 |
alt = this.elseBodyNode() ? this.elseBodyNode().compile(o, LEVEL_LIST) : 'void 0'; |
|
6829 |
code = "" + cond + " ? " + body + " : " + alt; |
|
6830 |
if (o.level >= LEVEL_COND) { |
|
6831 |
return "(" + code + ")"; |
|
6832 |
} else { |
|
6833 |
return code; |
|
6834 |
} |
|
6835 |
}; |
|
6836 |
||
6837 |
If.prototype.unfoldSoak = function() { |
|
6838 |
return this.soak && this; |
|
6839 |
}; |
|
6840 |
||
6841 |
return If; |
|
6842 |
||
6843 |
})(Base); |
|
6844 |
||
6845 |
Closure = { |
|
6846 |
wrap: function(expressions, statement, noReturn) { |
|
6847 |
var args, call, func, mentionsArgs, meth; |
|
6848 |
if (expressions.jumps()) { |
|
6849 |
return expressions; |
|
6850 |
} |
|
6851 |
func = new Code([], Block.wrap([expressions])); |
|
6852 |
args = []; |
|
6853 |
if ((mentionsArgs = expressions.contains(this.literalArgs)) || expressions.contains(this.literalThis)) { |
|
6854 |
meth = new Literal(mentionsArgs ? 'apply' : 'call'); |
|
6855 |
args = [new Literal('this')]; |
|
6856 |
if (mentionsArgs) { |
|
6857 |
args.push(new Literal('arguments')); |
|
6858 |
} |
|
6859 |
func = new Value(func, [new Access(meth)]); |
|
6860 |
} |
|
6861 |
func.noReturn = noReturn; |
|
6862 |
call = new Call(func, args); |
|
6863 |
if (statement) { |
|
6864 |
return Block.wrap([call]); |
|
6865 |
} else { |
|
6866 |
return call; |
|
6867 |
} |
|
6868 |
}, |
|
6869 |
literalArgs: function(node) { |
|
6870 |
return node instanceof Literal && node.value === 'arguments' && !node.asKey; |
|
6871 |
}, |
|
6872 |
literalThis: function(node) { |
|
6873 |
return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper); |
|
6874 |
} |
|
6875 |
}; |
|
6876 |
||
6877 |
unfoldSoak = function(o, parent, name) { |
|
6878 |
var ifn; |
|
6879 |
if (!(ifn = parent[name].unfoldSoak(o))) { |
|
6880 |
return; |
|
6881 |
} |
|
6882 |
parent[name] = ifn.body; |
|
6883 |
ifn.body = new Value(parent); |
|
6884 |
return ifn; |
|
6885 |
}; |
|
6886 |
||
6887 |
UTILITIES = { |
|
6888 |
"extends": function() { |
|
6889 |
return "function(child, parent) { for (var key in parent) { if (" + (utility('hasProp')) + ".call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }"; |
|
6890 |
}, |
|
6891 |
bind: function() { |
|
6892 |
return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }'; |
|
6893 |
}, |
|
6894 |
indexOf: function() { |
|
6895 |
return "[].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }"; |
|
6896 |
}, |
|
6897 |
hasProp: function() { |
|
6898 |
return '{}.hasOwnProperty'; |
|
6899 |
}, |
|
6900 |
slice: function() { |
|
6901 |
return '[].slice'; |
|
6902 |
} |
|
6903 |
}; |
|
6904 |
||
6905 |
LEVEL_TOP = 1; |
|
6906 |
||
6907 |
LEVEL_PAREN = 2; |
|
6908 |
||
6909 |
LEVEL_LIST = 3; |
|
6910 |
||
6911 |
LEVEL_COND = 4; |
|
6912 |
||
6913 |
LEVEL_OP = 5; |
|
6914 |
||
6915 |
LEVEL_ACCESS = 6; |
|
6916 |
||
6917 |
TAB = ' '; |
|
6918 |
||
6919 |
IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*"; |
|
6920 |
||
6921 |
IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$"); |
|
6922 |
||
6923 |
SIMPLENUM = /^[+-]?\d+$/; |
|
6924 |
||
6925 |
METHOD_DEF = RegExp("^(?:(" + IDENTIFIER_STR + ")\\.prototype(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\]))|(" + IDENTIFIER_STR + ")$"); |
|
6926 |
||
6927 |
IS_STRING = /^['"]/; |
|
6928 |
||
6929 |
utility = function(name) { |
|
6930 |
var ref; |
|
6931 |
ref = "__" + name; |
|
6932 |
Scope.root.assign(ref, UTILITIES[name]()); |
|
6933 |
return ref; |
|
6934 |
}; |
|
6935 |
||
6936 |
multident = function(code, tab) { |
|
6937 |
code = code.replace(/\n/g, '$&' + tab); |
|
6938 |
return code.replace(/\s+$/, ''); |
|
6939 |
}; |
|
6940 |
||
6941 |
||
6942 |
});
|
|
6943 |
||
6944 |
define('ace/mode/coffee/scope', ['require', 'exports', 'module' , 'ace/mode/coffee/helpers'], function(require, exports, module) { |
|
6945 |
||
6946 |
var Scope, extend, last, _ref; |
|
6947 |
||
6948 |
_ref = require('./helpers'), extend = _ref.extend, last = _ref.last; |
|
6949 |
||
6950 |
exports.Scope = Scope = (function() { |
|
6951 |
||
6952 |
Scope.root = null; |
|
6953 |
||
6954 |
function Scope(parent, expressions, method) { |
|
6955 |
this.parent = parent; |
|
6956 |
this.expressions = expressions; |
|
6957 |
this.method = method; |
|
6958 |
this.variables = [ |
|
6959 |
{ |
|
6960 |
name: 'arguments', |
|
6961 |
type: 'arguments' |
|
6962 |
} |
|
6963 |
]; |
|
6964 |
this.positions = {}; |
|
6965 |
if (!this.parent) { |
|
6966 |
Scope.root = this; |
|
6967 |
} |
|
6968 |
} |
|
6969 |
||
6970 |
Scope.prototype.add = function(name, type, immediate) { |
|
6971 |
if (this.shared && !immediate) { |
|
6972 |
return this.parent.add(name, type, immediate); |
|
6973 |
} |
|
6974 |
if (Object.prototype.hasOwnProperty.call(this.positions, name)) { |
|
6975 |
return this.variables[this.positions[name]].type = type; |
|
6976 |
} else { |
|
6977 |
return this.positions[name] = this.variables.push({ |
|
6978 |
name: name, |
|
6979 |
type: type |
|
6980 |
}) - 1; |
|
6981 |
} |
|
6982 |
}; |
|
6983 |
||
6984 |
Scope.prototype.namedMethod = function() { |
|
6985 |
if (this.method.name || !this.parent) { |
|
6986 |
return this.method; |
|
6987 |
} |
|
6988 |
return this.parent.namedMethod(); |
|
6989 |
}; |
|
6990 |
||
6991 |
Scope.prototype.find = function(name) { |
|
6992 |
if (this.check(name)) { |
|
6993 |
return true; |
|
6994 |
} |
|
6995 |
this.add(name, 'var'); |
|
6996 |
return false; |
|
6997 |
}; |
|
6998 |
||
6999 |
Scope.prototype.parameter = function(name) { |
|
7000 |
if (this.shared && this.parent.check(name, true)) { |
|
7001 |
return; |
|
7002 |
} |
|
7003 |
return this.add(name, 'param'); |
|
7004 |
}; |
|
7005 |
||
7006 |
Scope.prototype.check = function(name) { |
|
7007 |
var _ref1; |
|
7008 |
return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0)); |
|
7009 |
}; |
|
7010 |
||
7011 |
Scope.prototype.temporary = function(name, index) { |
|
7012 |
if (name.length > 1) { |
|
7013 |
return '_' + name + (index > 1 ? index - 1 : ''); |
|
7014 |
} else { |
|
7015 |
return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a'); |
|
7016 |
} |
|
7017 |
}; |
|
7018 |
||
7019 |
Scope.prototype.type = function(name) { |
|
7020 |
var v, _i, _len, _ref1; |
|
7021 |
_ref1 = this.variables; |
|
7022 |
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { |
|
7023 |
v = _ref1[_i]; |
|
7024 |
if (v.name === name) { |
|
7025 |
return v.type; |
|
7026 |
} |
|
7027 |
} |
|
7028 |
return null; |
|
7029 |
}; |
|
7030 |
||
7031 |
Scope.prototype.freeVariable = function(name, reserve) { |
|
7032 |
var index, temp; |
|
7033 |
if (reserve == null) { |
|
7034 |
reserve = true; |
|
7035 |
} |
|
7036 |
index = 0; |
|
7037 |
while (this.check((temp = this.temporary(name, index)))) { |
|
7038 |
index++; |
|
7039 |
} |
|
7040 |
if (reserve) { |
|
7041 |
this.add(temp, 'var', true); |
|
7042 |
} |
|
7043 |
return temp; |
|
7044 |
}; |
|
7045 |
||
7046 |
Scope.prototype.assign = function(name, value) { |
|
7047 |
this.add(name, { |
|
7048 |
value: value, |
|
7049 |
assigned: true |
|
7050 |
}, true); |
|
7051 |
return this.hasAssignments = true; |
|
7052 |
}; |
|
7053 |
||
7054 |
Scope.prototype.hasDeclarations = function() { |
|
7055 |
return !!this.declaredVariables().length; |
|
7056 |
}; |
|
7057 |
||
7058 |
Scope.prototype.declaredVariables = function() { |
|
7059 |
var realVars, tempVars, v, _i, _len, _ref1; |
|
7060 |
realVars = []; |
|
7061 |
tempVars = []; |
|
7062 |
_ref1 = this.variables; |
|
7063 |
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { |
|
7064 |
v = _ref1[_i]; |
|
7065 |
if (v.type === 'var') { |
|
7066 |
(v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name); |
|
7067 |
} |
|
7068 |
} |
|
7069 |
return realVars.sort().concat(tempVars.sort()); |
|
7070 |
}; |
|
7071 |
||
7072 |
Scope.prototype.assignedVariables = function() { |
|
7073 |
var v, _i, _len, _ref1, _results; |
|
7074 |
_ref1 = this.variables; |
|
7075 |
_results = []; |
|
7076 |
for (_i = 0, _len = _ref1.length; _i < _len; _i++) { |
|
7077 |
v = _ref1[_i]; |
|
7078 |
if (v.type.assigned) { |
|
7079 |
_results.push("" + v.name + " = " + v.type.value); |
|
7080 |
} |
|
7081 |
} |
|
7082 |
return _results; |
|
7083 |
}; |
|
7084 |
||
7085 |
return Scope; |
|
7086 |
||
7087 |
})(); |
|
7088 |
||
7089 |
||
7090 |
});
|