diff --git a/dist/globals.js.map b/dist/globals.js.map
index bced2f4c5..b2d4a224a 100644
--- a/dist/globals.js.map
+++ b/dist/globals.js.map
@@ -1 +1 @@
-{"version":3,"file":"globals.js","sourceRoot":"","sources":["../lib/globals"],"names":[],"mappings":""}
\ No newline at end of file
+{"version":3,"file":"globals.js","sourceRoot":"","sources":["../lib/globals.ts"],"names":[],"mappings":"AA6CC"}
\ No newline at end of file
diff --git a/dist/linter.js b/dist/linter.js
index f5a5a32cb..5ba2e8052 100644
--- a/dist/linter.js
+++ b/dist/linter.js
@@ -1,44 +1,35 @@
-var parent = require('./worker/parent');
-var fs = require('fs');
-var linterPath = atom.packages.getLoadedPackage("linter").path;
-var Linter = require(linterPath + "/lib/linter");
-var path = require("path");
-var Rng = require("atom").Range;
-var LinterTslint, __hasProp = {}.hasOwnProperty, __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;
-};
-LinterTslint = (function (_super) {
- __extends(LinterTslint, _super);
- function LinterTslint() {
- return Linter.apply(this, arguments);
- }
- LinterTslint.syntax = ['source.ts'];
- LinterTslint.prototype.lintFile = function (filePath, callback) {
- if (!this.editor.buffer.file || !this.editor.buffer.file.path || !fs.existsSync(this.editor.buffer.file.path))
- return callback([]);
- filePath = this.editor.buffer.file.path;
- parent.errorsForFileFiltered({ filePath: filePath }).then(function (resp) {
- var linterErrors = resp.errors.map(function (err) { return {
- message: err.message,
- line: err.startPos.line + 1,
- range: new Rng([err.startPos.line, err.startPos.ch], [err.endPos.line, err.endPos.ch]),
- level: 'error',
- linter: 'TypeScript'
- }; });
- return callback(linterErrors);
- });
- };
- return LinterTslint;
-})(Linter);
-module.exports = LinterTslint;
+var parent = require('./worker/parent');
+var fs = require('fs');
+var linterPath = atom.packages.getLoadedPackage("linter").path;
+var Linter = require(linterPath + "/lib/linter");
+var path = require("path");
+var Rng = require("atom").Range;
+var LinterTslint, __hasProp = {}.hasOwnProperty, __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; };
+LinterTslint = (function (_super) {
+ __extends(LinterTslint, _super);
+ function LinterTslint() {
+ return Linter.apply(this, arguments);
+ }
+ LinterTslint.syntax = ['source.ts'];
+ LinterTslint.prototype.lintFile = function (filePath, callback) {
+ if (!this.editor.buffer.file || !this.editor.buffer.file.path || !fs.existsSync(this.editor.buffer.file.path))
+ return callback([]);
+ filePath = this.editor.buffer.file.path;
+ parent.errorsForFileFiltered({ filePath: filePath }).then(function (resp) {
+ var linterErrors = resp.errors.map(function (err) { return {
+ message: err.message,
+ line: err.startPos.line + 1,
+ range: new Rng([err.startPos.line, err.startPos.ch], [err.endPos.line, err.endPos.ch]),
+ level: 'error',
+ linter: 'TypeScript'
+ }; });
+ return callback(linterErrors);
+ });
+ };
+ return LinterTslint;
+})(Linter);
+module.exports = LinterTslint;
//# sourceMappingURL=linter.js.map
\ No newline at end of file
diff --git a/dist/linter.js.map b/dist/linter.js.map
index 2e637f051..5b5f6b4bc 100644
--- a/dist/linter.js.map
+++ b/dist/linter.js.map
@@ -1 +1 @@
-{"version":3,"file":"linter.js","sourceRoot":"","sources":["../lib/linter.ts"],"names":["ctor","LinterTslint"],"mappings":"AASA,IAAO,MAAM,WAAW,iBAAiB,CAAC,CAAC;AAE3C,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAE1B,IAAI,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC;AAC/D,IAAI,MAAM,GAAG,OAAO,CAAC,UAAU,GAAG,aAAa,CAAC,CAAC;AACjD,IAAI,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AAC3B,IA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B,CAAC,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAAC,MAAM,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QAEzE,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QAExC,MAAM,CAAC,qBAAqB,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC,IAAI,CAAC,UAAC,IAAI;YAC3D,IAAI,YAAY,GAAkB,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,UAAC,GAAG,IAAK,OAAa;gBACpE,OAAO,EAAE,GAAG,CAAC,OAAO;gBACpB,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,IAAI,GAAG,CAAC;gBAC3B,KAAK,EAAE,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,EAAE,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;gBACtF,KAAK,EAAE,OAAO;gBACd,MAAM,EAAE,YAAY;aACvB,EAN0D,CAM1D,CAAC,CAAC;YAEH,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAClC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC;IAEF,MAAM,CAAC,YAAY,CAAC;AAExB,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAEX,MAAM,CAAC,OAAO,GAAG,YAAY,CAAC"}
\ No newline at end of file
diff --git a/dist/main/atom/atomConfig.js b/dist/main/atom/atomConfig.js
index 05f157dcd..5e550328d 100644
--- a/dist/main/atom/atomConfig.js
+++ b/dist/main/atom/atomConfig.js
@@ -5,11 +5,6 @@ function getConfig(name) {
var Config = (function () {
function Config() {
this.schema = {
- compileOnSave: {
- title: 'Compile on save',
- type: 'boolean',
- default: true
- },
debugAtomTs: {
title: 'Debug: Atom-TypeScript. Please do not use.',
type: 'boolean',
@@ -17,24 +12,13 @@ var Config = (function () {
}
};
}
- Object.defineProperty(Config.prototype, "compileOnSave", {
- get: function () {
- return getConfig('compileOnSave');
- },
- enumerable: true,
- configurable: true
- });
Object.defineProperty(Config.prototype, "debugAtomTs", {
- get: function () {
- return getConfig('debugAtomTs');
- },
+ get: function () { return getConfig('debugAtomTs'); },
enumerable: true,
configurable: true
});
Object.defineProperty(Config.prototype, "maxSuggestions", {
- get: function () {
- return atom.config.get('autocomplete-plus.maxSuggestions');
- },
+ get: function () { return atom.config.get('autocomplete-plus.maxSuggestions'); },
enumerable: true,
configurable: true
});
diff --git a/dist/main/atom/atomConfig.js.map b/dist/main/atom/atomConfig.js.map
index a007d3dc3..dddf9c855 100644
--- a/dist/main/atom/atomConfig.js.map
+++ b/dist/main/atom/atomConfig.js.map
@@ -1 +1 @@
-{"version":3,"file":"atomConfig.js","sourceRoot":"","sources":["../../../lib/main/atom/atomConfig.ts"],"names":["getConfig","Config","Config.constructor","Config.compileOnSave","Config.debugAtomTs","Config.maxSuggestions"],"mappings":"AAQA,IAAI,WAAW,GAAG,iBAAiB,CAAC;AACpC,SAAS,SAAS,CAAI,IAAY;IAC9BA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,GAAGA,CAACA,WAAWA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,CAACA;AACrDA,CAACA;AAED,IAAM,MAAM;IAAZC,SAAMA,MAAMA;QACRC,WAAMA,GAAGA;YACLA,aAAaA,EAAEA;gBACXA,KAAKA,EAAEA,iBAAiBA;gBACxBA,IAAIA,EAAEA,SAASA;gBACfA,OAAOA,EAAEA,IAAIA;aAChBA;YACDA,WAAWA,EAAEA;gBACTA,KAAKA,EAAEA,4CAA4CA;gBACnDA,IAAIA,EAAEA,SAASA;gBACfA,OAAOA,EAAEA,KAAKA;aACjBA;SACJA,CAAAA;IAILA,CAACA;IAHGD,sBAAIA,iCAAaA;aAAjBA;YAAsBE,MAAMA,CAACA,SAASA,CAAUA,eAAeA,CAACA,CAAAA;QAACA,CAACA;;;OAAAF;IAClEA,sBAAIA,+BAAWA;aAAfA;YAAoBG,MAAMA,CAACA,SAASA,CAAUA,aAAaA,CAACA,CAAAA;QAACA,CAACA;;;OAAAH;IAC9DA,sBAAIA,kCAAcA;aAAlBA;YAA+BI,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,GAAGA,CAACA,kCAAkCA,CAACA,CAAAA;QAACA,CAACA;;;OAAAJ;IAC/FA,aAACA;AAADA,CAACA,AAhBD,IAgBC;AACD,IAAI,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AACV,AAAhB,iBAAS,MAAM,CAAC"}
\ No newline at end of file
+{"version":3,"file":"atomConfig.js","sourceRoot":"","sources":["../../../lib/main/atom/atomConfig.ts"],"names":["getConfig","Config","Config.constructor","Config.debugAtomTs","Config.maxSuggestions"],"mappings":"AAQA,IAAI,WAAW,GAAG,iBAAiB,CAAC;AACpC,SAAS,SAAS,CAAI,IAAY;IAC9BA,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,GAAGA,CAACA,WAAWA,GAAGA,GAAGA,GAAGA,IAAIA,CAACA,CAACA;AACrDA,CAACA;AAED,IAAM,MAAM;IAAZC,SAAMA,MAAMA;QACRC,WAAMA,GAAGA;YACLA,WAAWA,EAAEA;gBACTA,KAAKA,EAAEA,4CAA4CA;gBACnDA,IAAIA,EAAEA,SAASA;gBACfA,OAAOA,EAAEA,KAAKA;aACjBA;SACJA,CAAAA;IAGLA,CAACA;IAFGD,sBAAIA,+BAAWA;aAAfA,cAAoBE,MAAMA,CAACA,SAASA,CAAUA,aAAaA,CAACA,CAAAA,CAACA,CAACA;;;OAAAF;IAC9DA,sBAAIA,kCAAcA;aAAlBA,cAA+BG,MAAMA,CAACA,IAAIA,CAACA,MAAMA,CAACA,GAAGA,CAACA,kCAAkCA,CAACA,CAAAA,CAACA,CAACA;;;OAAAH;IAC/FA,aAACA;AAADA,CAACA,AAVD,IAUC;AACD,IAAI,MAAM,GAAG,IAAI,MAAM,EAAE,CAAC;AACV,AAAhB,iBAAS,MAAM,CAAC"}
\ No newline at end of file
diff --git a/dist/main/atom/atomUtils.js b/dist/main/atom/atomUtils.js
index 971364d36..0f9797cfc 100644
--- a/dist/main/atom/atomUtils.js
+++ b/dist/main/atom/atomUtils.js
@@ -61,11 +61,18 @@ function getTypeScriptEditorsWithPaths() {
return atom.workspace.getEditors().filter(function (editor) { return !!editor.getPath(); }).filter(function (editor) { return (path.extname(editor.getPath()) === '.ts'); });
}
exports.getTypeScriptEditorsWithPaths = getTypeScriptEditorsWithPaths;
-function quickNotify(htmlMessage) {
+function quickNotifySuccess(htmlMessage) {
var notification = atom.notifications.addSuccess(htmlMessage, { dismissable: true });
setTimeout(function () {
notification.dismiss();
- }, 600);
+ }, 800);
}
-exports.quickNotify = quickNotify;
+exports.quickNotifySuccess = quickNotifySuccess;
+function quickNotifyWarning(htmlMessage) {
+ var notification = atom.notifications.addWarning(htmlMessage, { dismissable: true });
+ setTimeout(function () {
+ notification.dismiss();
+ }, 800);
+}
+exports.quickNotifyWarning = quickNotifyWarning;
//# sourceMappingURL=atomUtils.js.map
\ No newline at end of file
diff --git a/dist/main/atom/atomUtils.js.map b/dist/main/atom/atomUtils.js.map
index cc190f40f..7bb66e7bf 100644
--- a/dist/main/atom/atomUtils.js.map
+++ b/dist/main/atom/atomUtils.js.map
@@ -1 +1 @@
-{"version":3,"file":"atomUtils.js","sourceRoot":"","sources":["../../../lib/main/atom/atomUtils.ts"],"names":["getEditorPosition","getEditorPositionForBufferPosition","onDiskAndTs","getFilePathPosition","getEditorsForAllPaths","getEditorsForAllPaths.addConsistentlyToMap","getRangeForTextSpan","getTypeScriptEditorsWithPaths","quickNotify"],"mappings":"AAGA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,IAAI,CAAC,C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UAAUA,CAACA;QACPA,YAAYA,CAACA,OAAOA,EAAEA,CAAAA;IAC1BA,CAACA,EAAEA,GAAGA,CAACA,CAACA;AACZA,CAACA;AALe,mBAAW,GAAX,WAKf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"atomUtils.js","sourceRoot":"","sources":["../../../lib/main/atom/atomUtils.ts"],"names":["getEditorPosition","getEditorPositionForBufferPosition","onDiskAndTs","getFilePathPosition","getEditorsForAllPaths","getEditorsForAllPaths.addConsistentlyToMap","getRangeForTextSpan","getTypeScriptEditorsWithPaths","quickNotifySuccess","quickNotifyWarning"],"mappings":"AAGA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,KAAK,WAAW,MAAM,CAAC,CAAC;AAC/B,IAAO,QAAQ,WAAW,sBAAsB,CAAC,CAAC;AAGlD,SAAgB,iBAAiB,CAAC,MAAwB;IACtDA,IAAIA,SAASA,GAAGA,MAAMA,CAACA,uBAAuBA,EAAEA,CAACA;IACjDA,MAAMA,CAACA,kCAAkCA,CAACA,MAAMA,EAAEA,SAASA,CAACA,CAACA;AACjEA,CAACA;AAHe,yBAAiB,GAAjB,iBAGf,CAAA;AAGD,SAAgB,kCAAkC,CAAC,MAAwB,EAAE,SAA4B;IACrGC,IAAIA,MAAMA,GAAGA,MAAMA,CAACA,SAASA,EAAEA,CAACA;IAChCA,MAAMA,CAACA,MAAMA,CAACA,yBAAyBA,CAACA,SAASA,CAACA,CAACA;AACvDA,CAACA;AAHe,0CAAkC,GAAlC,kCAGf,CAAA;AAED,SAAgB,WAAW,CAAC,MAAwB;IAChDC,EAAEA,CAACA,CAACA,MAAMA,YAAYA,OAAOA,CAACA,MAAMA,CAACA,CAACA,UAAUA,CAACA,CAACA,CAACA;QAC/CA,IAAIA,QAAQA,GAAGA,MAAMA,CAACA,OAAOA,EAAEA,CAACA;QAChCA,IAAIA,GAAGA,GAAGA,IAAIA,CAACA,O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AAA,MAAMA,IAAGA,QAACA,CAACA,MAAMA,CAACA,OAAOA,EAAEA,EAAlBA,CAAkBA,CAACA,CACnCA,MAAMA,CAACA,UAAAA,MAAMA,IAAGA,QAACA,IAAIA,CAACA,OAAOA,CAACA,MAAMA,CAACA,OAAOA,EAAEA,CAACA,KAAKA,KAAKA,CAACA,EAA1CA,CAA0CA,CAACA,CAACA;AACrEA,CAACA;AAJe,qCAA6B,GAA7B,6BAIf,CAAA;AAED,SAAgB,kBAAkB,CAAC,WAAmB;IAClDC,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,aAAaA,CAACA,UAAUA,CAACA,WAAWA,EAAEA,EAAEA,WAAWA,EAAEA,IAAIA,EAAEA,CAACA,CAACA;IACrFA,UAAUA,CAACA;QACPA,YAAYA,CAACA,OAAOA,EAAEA,CAAAA;IAC1BA,CAACA,EAAEA,GAAGA,CAACA,CAACA;AACZA,CAACA;AALe,0BAAkB,GAAlB,kBAKf,CAAA;AAED,SAAgB,kBAAkB,CAAC,WAAmB;IAClDC,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,aAAaA,CAACA,UAAUA,CAACA,WAAWA,EAAEA,EAAEA,WAAWA,EAAEA,IAAIA,EAAEA,CAACA,CAACA;IACrFA,UAAUA,CAACA;QACPA,YAAYA,CAACA,OAAOA,EAAEA,CAAAA;IAC1BA,CAACA,EAAEA,GAAGA,CAACA,CAACA;AACZA,CAACA;AALe,0BAAkB,GAAlB,kBAKf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/autoCompleteProvider.js b/dist/main/atom/autoCompleteProvider.js
index 6ec563b6e..ed8befa27 100644
--- a/dist/main/atom/autoCompleteProvider.js
+++ b/dist/main/atom/autoCompleteProvider.js
@@ -20,7 +20,7 @@ function triggerAutocompletePlus() {
atom.commands.dispatch(atom.views.getView(atom.workspace.getActiveTextEditor()), 'autocomplete-plus:activate');
}
exports.triggerAutocompletePlus = triggerAutocompletePlus;
-var tsSnipPrefixLookup = {};
+var tsSnipPrefixLookup = Object.create(null);
function loadSnippets() {
var confPath = atom.getConfigDirPath();
CSON.readFile(confPath + "/packages/atom-typescript/snippets/typescript-snippets.cson", function (err, snippetsRoot) {
@@ -74,12 +74,12 @@ exports.provider = {
}
else {
var position = atomUtils.getEditorPositionForBufferPosition(options.editor, options.bufferPosition);
- var promisedSuggestions = parent.updateText({ filePath: filePath, text: options.editor.getText() }).then(function () { return parent.getCompletionsAtPosition({
+ var promisedSuggestions = parent.getCompletionsAtPosition({
filePath: filePath,
position: position,
prefix: options.prefix,
maxSuggestions: atomConfig.maxSuggestions
- }); }).then(function (resp) {
+ }).then(function (resp) {
var completionList = resp.completions;
var suggestions = completionList.map(function (c) {
return {
@@ -89,12 +89,12 @@ exports.provider = {
};
});
if (tsSnipPrefixLookup[options.prefix]) {
- suggestions.unshift({
- text: null,
+ var suggestion = {
snippet: tsSnipPrefixLookup[options.prefix].body,
replacementPrefix: options.prefix,
rightLabelHTML: "snippet: " + options.prefix,
- });
+ };
+ suggestions.unshift(suggestion);
}
return suggestions;
});
@@ -106,14 +106,10 @@ exports.provider = {
options.editor.moveToBeginningOfLine();
options.editor.selectToEndOfLine();
if (options.suggestion.atomTS_IsReference)
- options.editor.replaceSelectedText(null, function () {
- return "/// ";
- });
+ options.editor.replaceSelectedText(null, function () { return "/// "; });
if (options.suggestion.atomTS_IsImport) {
var alias = options.editor.getSelectedText().match(/^import\s*(\w*)\s*=/)[1];
- options.editor.replaceSelectedText(null, function () {
- return "import " + alias + " = require('" + options.suggestion.atomTS_IsImport.relativePath + "');";
- });
+ options.editor.replaceSelectedText(null, function () { return "import " + alias + " = require('" + options.suggestion.atomTS_IsImport.relativePath + "');"; });
}
options.editor.moveToEndOfLine();
}
diff --git a/dist/main/atom/autoCompleteProvider.js.map b/dist/main/atom/autoCompleteProvider.js.map
index a1a5fd1f7..2700d27cb 100644
--- a/dist/main/atom/autoCompleteProvider.js.map
+++ b/dist/main/atom/autoCompleteProvider.js.map
@@ -1 +1 @@
-{"version":3,"file":"autoCompleteProvider.js","sourceRoot":"","sources":["../../../lib/main/atom/autoCompleteProvider.ts"],"names":["kindToColor","triggerAutocompletePlus","loadSnippets"],"mappings":"AAKA,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAE/C,IAAO,UAAU,WAAW,cAAc,CAAC,CAAC;AAE5C,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAE1B,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAG1C,IAAI,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAwC7B,SAAS,WAAW,CAAC,IAAY;IAC7BA,MAAMA,CAACA,CAACA,IAAIA,CAACA,CAACA,CAACA;QACXA,KAAKA,WAAWA;YACZA,MAAMA,CAACA,iBAAiBA,CAACA;QAC7BA,KAAKA,SAASA;YACVA,MAAMA,CAACA,kBAAkBA,CAACA;QAC9BA,KAAKA,OAAOA;YACRA,MAAMA,CAACA,kBAAkBA,CAACA;QAC9BA;YACIA,MAAMA,CAACA,OAAOA,CAACA;IACvBA,CAACA;AACLA,CAACA;AAED,SAAgB,uBAAuB;IACnCC,IAAIA,CAACA,QAAQA,CAACA,QAAQA,CAClBA,IAAIA,CAACA,KAAKA,CAACA,OAAOA,CAACA,IAAIA,CAACA,SAASA,CAACA,mBAAmBA,EAAEA,CAACA,EACxDA,4BAA4BA,CAACA,CAACA;AACtCA,CAACA;AAJe,+BAAuB,GAAvB,uBAIf,CAAA;AAuBD,IAAI,kBAAkB,GAAyC,EAAE,CAAC;AAClE,SAAS,YAAY;IACjBC,IAAIA,QAAQA,GAAGA,IAAIA,CAACA,gBAAgBA,EAAEA,CAACA;IACvCA,IAAIA,CAACA,QAAQA,CAACA,QAAQA,GAAGA,6DAA6DA,EAClFA,UAACA,GAAGA,EAAEA,YAAYA;QACdA,EAAEA,CAACA,CAACA,GAAGA,CAACA;YAACA,MAAMA,CAACA;Q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AAC;YACvC,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,CAAC;YAEnC,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC;gBACtC,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE;oBAAa,MAAM,CAAC,uBAAuB,GAAG,OAAO,CAAC,UAAU,CAAC,kBAAkB,CAAC,YAAY,GAAG,KAAK,CAAC;gBAAC,CAAC,CAAC,CAAC;YAC1J,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,CAAC,CAAC;gBACrC,IAAI,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAAC;gBAC7E,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE;oBAAa,MAAM,CAAC,SAAS,GAAG,KAAK,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,YAAY,GAAG,KAAK,CAAC;gBAAC,CAAC,CAAC,CAAC;YAClK,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACrC,CAAC;IACL,CAAC;CACJ,CAAA"}
\ No newline at end of file
+{"version":3,"file":"autoCompleteProvider.js","sourceRoot":"","sources":["../../../lib/main/atom/autoCompleteProvider.ts"],"names":["kindToColor","triggerAutocompletePlus","loadSnippets"],"mappings":"AAKA,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAE/C,IAAO,UAAU,WAAW,cAAc,CAAC,CAAC;AAE5C,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAE1B,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAG1C,IAAI,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AACvC,IAAI,IAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;AAwC7B,SAAS,WAAW,CAAC,IAAY;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AM,CAAC,SAAS,GAAG,KAAK,GAAG,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,YAAY,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;YAClK,CAAC;YACD,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACrC,CAAC;IACL,CAAC;CACJ,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/commands.js b/dist/main/atom/commands.js
index c388ff8ce..7567f724d 100644
--- a/dist/main/atom/commands.js
+++ b/dist/main/atom/commands.js
@@ -3,7 +3,6 @@ var buildView = require('./buildView');
var atomUtils = require('./atomUtils');
var autoCompleteProvider = require('./autoCompleteProvider');
var path = require('path');
-var documentationView = require('./views/documentationView');
var renameView = require('./views/renameView');
var apd = require('atom-package-dependencies');
var contextView = require('./views/contextView');
@@ -29,14 +28,18 @@ function registerCommands() {
if (result.formatted == currentText)
return;
var top = editor.getScrollTop();
- editor.setText(result.formatted);
+ editor.transact(function () {
+ editor.setText(result.formatted);
+ });
editor.setCursorBufferPosition([result.cursor.line, result.cursor.ch]);
editor.setScrollTop(top);
});
}
else {
parent.formatDocumentRange({ filePath: filePath, start: { line: selection.start.row, ch: selection.start.column }, end: { line: selection.end.row, ch: selection.end.column } }).then(function (res) {
- editor.setTextInBufferRange(selection, res.formatted);
+ editor.transact(function () {
+ editor.setTextInBufferRange(selection, res.formatted);
+ });
});
}
});
@@ -81,10 +84,10 @@ function registerCommands() {
atom.commands.add('atom-text-editor', 'typescript:autocomplete', function (e) {
autoCompleteProvider.triggerAutocompletePlus();
});
- atom.commands.add('atom-text-editor', 'typescript:here-for-development-testing', function (e) {
- documentationView.docView.hide();
- documentationView.docView.autoPosition();
- documentationView.testDocumentationView();
+ atom.commands.add('atom-text-editor', 'typescript:bas-development-testing', function (e) {
+ parent.debugLanguageServiceHostVersion({ filePath: atom.workspace.getActiveEditor().getPath() }).then(function (res) {
+ console.log(res.text.length);
+ });
});
atom.commands.add('atom-text-editor', 'typescript:rename-variable', function (e) {
parent.getRenameInfo(atomUtils.getFilePathPosition()).then(function (res) {
@@ -94,14 +97,17 @@ function registerCommands() {
}
renameView.panelView.renameThis({
text: res.displayName,
- onCancel: function () {
- },
+ onCancel: function () { },
onCommit: function (newText) {
- atomUtils.getEditorsForAllPaths(res.locations.map(function (l) { return l.filePath; })).then(function (editorMap) {
- res.locations.reverse().forEach(function (location) {
- var editor = editorMap[location.filePath];
- var range = atomUtils.getRangeForTextSpan(editor, location.textSpan);
- editor.setTextInBufferRange(range, newText);
+ atomUtils.getEditorsForAllPaths(Object.keys(res.locations)).then(function (editorMap) {
+ Object.keys(res.locations).forEach(function (filePath) {
+ var editor = editorMap[filePath];
+ editor.transact(function () {
+ res.locations[filePath].forEach(function (textSpan) {
+ var range = atomUtils.getRangeForTextSpan(editor, textSpan);
+ editor.setTextInBufferRange(range, newText);
+ });
+ });
});
});
}
diff --git a/dist/main/atom/commands.js.map b/dist/main/atom/commands.js.map
index bb3cd7173..7dbadca1a 100644
--- a/dist/main/atom/commands.js.map
+++ b/dist/main/atom/commands.js.map
@@ -1 +1 @@
-{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../lib/main/atom/commands.ts"],"names":["commandForTypeScript","registerCommands"],"mappings":"AACA,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAE/C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAE1C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAE1C,IAAO,oBAAoB,WAAW,wBAAwB,CAAC,CAAC;AAChE,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAI9B,IAAO,iBAAiB,WAAW,2BAA2B,CAAC,CAAC;AAEhE,IAAO,UAAU,WAAW,oBAAoB,CAAC,CAAC;AAClD,IAAI,GAAG,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC/C,IAAO,WAAW,WAAW,qBAAqB,CAAC,CAAC;AAGpD,SAAS,oBAAoB,CAAC,CAAC;IAC3BA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AIA,CAACA,QAAQA,CAACA,GAAGA,CAACA,kBAAkBA,EAAEA,4BAA4BA,EAACA,UAACA,CAACA;QACjEA,MAAMA,CAACA,aAAaA,CAACA,SAASA,CAACA,mBAAmBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAACA,GAAGA;YAC3DA,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,SAASA,CAACA,CAACA,CAACA;gBACjBA,IAAIA,CAACA,aAAaA,CAACA,OAAOA,CAACA,iDAAiDA,CAACA,CAACA;gBAC9EA,MAAMA,CAACA;YACXA,CAACA;YAEDA,UAAUA,CAACA,SAASA,CAACA,UAAUA,CAACA;gBAC5BA,IAAIA,EAAEA,GAAGA,CAACA,WAAWA;gBACrBA,QAAQA,EAAEA;gBAAQA,CAACA;gBACnBA,QAAQA,EAAEA,UAACA,OAAOA;oBAIdA,SAASA,CAACA,qBAAqBA,CAACA,GAAGA,CAACA,SAASA,CAACA,GAAGA,CAACA,UAAAA,CAACA,IAAGA,OAAAA,CAACA,CAACA,QAAQA,EAAVA,CAAUA,CAACA,CAACA,CAC7DA,IAAIA,CAACA,UAACA,SAASA;wBAEhBA,GAAGA,CAACA,SAASA,CAACA,OAAOA,EAAEA,CAACA,OAAOA,CAACA,UAACA,QAAQA;4BACrCA,IAAIA,MAAMA,GAAGA,SAASA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA;4BAC1CA,IAAIA,KAAKA,GAAGA,SAASA,CAACA,mBAAmBA,CAACA,MAAMA,EAAEA,QAAQA,CAACA,QAAQA,CAACA,CAACA;4BACrEA,MAAMA,CAACA,oBAAoBA,CAACA,KAAKA,EAAEA,OAAOA,CAACA,CAACA;wBAChDA,CAACA,CAACA,CAACA;oBACPA,CAACA,CAACA,CAACA;gBACPA,CAACA;aACJA,CAACA,CAACA;QACPA,CAACA,CAACA,CAACA;IACPA,CAACA,CAACA,CAACA;AAmCPA,CAACA;AArJe,wBAAgB,GAAhB,gBAqJf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"commands.js","sourceRoot":"","sources":["../../../lib/main/atom/commands.ts"],"names":["commandForTypeScript","registerCommands"],"mappings":"AACA,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAE/C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAE1C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAE1C,IAAO,oBAAoB,WAAW,wBAAwB,CAAC,CAAC;AAChE,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAM9B,IAAO,UAAU,WAAW,oBAAoB,CAAC,CAAC;AAClD,IAAI,GAAG,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAC/C,IAAO,WAAW,WAAW,qBAAqB,CAAC,CAAC;AAGpD,SAAS,oBAAoB,CAAC,CAAC;IAC3BA,IAAIA,MAAMA,GAAGA,IAAIA,CAACA,SAASA,CAACA,mBAAmBA,EAAEA,CAACA;IAClDA,EAAEA,CAACA,CAACA,CAACA,MAAMA,CAACA;QAACA,MAAMA,CAACA,CAACA,CAACA,eAAeA,EAAEA,IAAIA,KAAKA,CAACA;IACjDA,EAAEA,CAACA,CAACA,IAAIA,CAACA,OAAOA,CAACA,MAAMA,CAACA,OAAOA,EAAEA,CAACA,KAAKA,KAAKA,CAACA;QAACA,MAAMA,CAACA,CAACA,CAACA,eAAeA,EAAEA,IAAIA,KAAKA,CAACA;IAElFA,MAAMA,CAACA,IAAIA,CAACA;AAChBA,CAACA;AAED,SAAgB,gBAAgB;IAG5BC,IAAIA,CAACA,QAAQA,CAACA,GAAGA,CAACA,kBAAkBA,EAAEA,wBAAwBA,EAAEA,UAACA,CAACA;QAC9DA,EAAEA,CAACA,CAACA,CAACA,oBAAoBA,CAACA,CAACA,CAACA,CAACA;YAACA,MAAMA,CAACA;QAErCA,IAAIA,MAAMA,GAAGA,IAAIA,CAACA,SAASA,CAACA,mBAAmBA,EAAEA,CAACA;QAClDA,IAAIA,QAAQA,GAAGA,MAAMA,CAACA,OAAOA,EAA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EAAEA,UAACA,OAAOA;oBAIdA,SAASA,CAACA,qBAAqBA,CAACA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,SAASA,CAACA,CAACA,CACtDA,IAAIA,CAACA,UAACA,SAASA;wBAChBA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,SAASA,CAACA,CAACA,OAAOA,CAACA,UAACA,QAAQA;4BACxCA,IAAIA,MAAMA,GAAGA,SAASA,CAACA,QAAQA,CAACA,CAACA;4BACjCA,MAAMA,CAACA,QAAQA,CAACA;gCACZA,GAAGA,CAACA,SAASA,CAACA,QAAQA,CAACA,CAACA,OAAOA,CAACA,UAACA,QAAQA;oCACrCA,IAAIA,KAAKA,GAAGA,SAASA,CAACA,mBAAmBA,CAACA,MAAMA,EAAEA,QAAQA,CAACA,CAACA;oCAC5DA,MAAMA,CAACA,oBAAoBA,CAACA,KAAKA,EAAEA,OAAOA,CAACA,CAACA;gCAChDA,CAACA,CAACA,CAACA;4BACPA,CAACA,CAACA,CAAAA;wBACNA,CAACA,CAACA,CAACA;oBACPA,CAACA,CAACA,CAACA;gBACPA,CAACA;aACJA,CAACA,CAACA;QACPA,CAACA,CAACA,CAACA;IACPA,CAACA,CAACA,CAACA;AAmCPA,CAACA;AAjKe,wBAAgB,GAAhB,gBAiKf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/debugAtomTs.js b/dist/main/atom/debugAtomTs.js
index a3e40b6eb..27e326ce0 100644
--- a/dist/main/atom/debugAtomTs.js
+++ b/dist/main/atom/debugAtomTs.js
@@ -1,5 +1,4 @@
var atomConfig = require('./atomConfig');
-var ts = require('typescript');
function runDebugCode(details) {
if (!atomConfig.debugAtomTs)
return;
diff --git a/dist/main/atom/debugAtomTs.js.map b/dist/main/atom/debugAtomTs.js.map
index 5b45638a9..44b866fc7 100644
--- a/dist/main/atom/debugAtomTs.js.map
+++ b/dist/main/atom/debugAtomTs.js.map
@@ -1 +1 @@
-{"version":3,"file":"debugAtomTs.js","sourceRoot":"","sources":["../../../lib/main/atom/debugAtomTs.ts"],"names":["runDebugCode"],"mappings":"AAIA,IAAO,UAAU,WAAW,cAAc,CAAC,CAAC;AAI5C,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAQlC,SAAgB,YAAY,CAAC,OAAuD;IAChFA,EAAEA,CAACA,CAACA,CAACA,UAAUA,CAACA,WAAWA,CAACA;QAACA,MAAMA,CAACA;AAExCA,CAACA;AAHe,oBAAY,GAAZ,YAGf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"debugAtomTs.js","sourceRoot":"","sources":["../../../lib/main/atom/debugAtomTs.ts"],"names":["runDebugCode"],"mappings":"AAIA,IAAO,UAAU,WAAW,cAAc,CAAC,CAAC;AAY5C,SAAgB,YAAY,CAAC,OAAuD;IAChFA,EAAEA,CAACA,CAACA,CAACA,UAAUA,CAACA,WAAWA,CAACA;QAACA,MAAMA,CAACA;AAExCA,CAACA;AAHe,oBAAY,GAAZ,YAGf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/errorView.js b/dist/main/atom/errorView.js
index b16e8ac1f..03bdd4e42 100644
--- a/dist/main/atom/errorView.js
+++ b/dist/main/atom/errorView.js
@@ -11,8 +11,12 @@ var filePathErrors = new utils.Dict();
exports.setErrors = function (filePath, errorsForFile) {
if (!errorsForFile.length)
filePathErrors.clearValue(filePath);
- else
+ else {
+ if (errorsForFile.length > 50)
+ errorsForFile = errorsForFile.slice(0, 50);
filePathErrors.setValue(filePath, errorsForFile);
+ }
+ ;
mainPanelView.panelView.clearError();
var fileErrorCount = filePathErrors.keys().length;
if (!fileErrorCount) {
@@ -36,14 +40,14 @@ exports.setErrors = function (filePath, errorsForFile) {
};
function showEmittedMessage(output) {
if (output.success) {
- var message = 'TS emit succeeded';
- atomUtils.quickNotify(message);
+ var message = 'TS emit succeeded
' + output.outputFiles.join('
');
+ atomUtils.quickNotifySuccess(message);
}
else if (output.emitError) {
atom.notifications.addError('TS Emit Failed');
}
else {
- atom.notifications.addWarning('Compile failed but emit succeeded:
' + output.outputFiles.join('
'));
+ atomUtils.quickNotifyWarning('Compile failed but emit succeeded
' + output.outputFiles.join('
'));
}
}
exports.showEmittedMessage = showEmittedMessage;
diff --git a/dist/main/atom/errorView.js.map b/dist/main/atom/errorView.js.map
index f5affdf39..f1ce6d7a8 100644
--- a/dist/main/atom/errorView.js.map
+++ b/dist/main/atom/errorView.js.map
@@ -1 +1 @@
-{"version":3,"file":"errorView.js","sourceRoot":"","sources":["../../../lib/main/atom/errorView.ts"],"names":["start","showEmittedMessage"],"mappings":"AAIA,IAAO,KAAK,WAAW,eAAe,CAAC,CAAC;AAIxC,IAAO,aAAa,WAAW,uBAAuB,CAAC,CAAC;AACxD,IAAO,eAAe,WAAW,yBAAyB,CAAC,CAAC;AAE5D,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAI1C,SAAgB,KAAK;IACjBA,aAAaA,CAACA,MAAMA,EAAEA,CAACA;IACvBA,aAAaA,CAACA,SAASA,CAACA,uBAAuBA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;AAC1DA,CAACA;AAHe,aAAK,GAAL,KAGf,CAAA;AAED,IAAI,cAAc,GAAkC,IAAI,KAAK,CAAC,IAAI,EAAS,CAAC;AAEjE,iBAAS,GAAG,UAAC,QAAgB,EAAE,aAAgC;IACtE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC;QAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI;QAAC,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IAGtD,aAAa,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAErC,IAAI,cAAc,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;IAElD,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QAClB,aAAa,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CA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AkB,GAAlB,kBASf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"errorView.js","sourceRoot":"","sources":["../../../lib/main/atom/errorView.ts"],"names":["start","showEmittedMessage"],"mappings":"AAIA,IAAO,KAAK,WAAW,eAAe,CAAC,CAAC;AAIxC,IAAO,aAAa,WAAW,uBAAuB,CAAC,CAAC;AACxD,IAAO,eAAe,WAAW,yBAAyB,CAAC,CAAC;AAE5D,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAI1C,SAAgB,KAAK;IACjBA,aAAaA,CAACA,MAAMA,EAAEA,CAACA;IACvBA,aAAaA,CAACA,SAASA,CAACA,uBAAuBA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;AAC1DA,CAACA;AAHe,aAAK,GAAL,KAGf,CAAA;AAED,IAAI,cAAc,GAAkC,IAAI,KAAK,CAAC,IAAI,EAAS,CAAC;AAEjE,iBAAS,GAAG,UAAC,QAAgB,EAAE,aAAgC;IACtE,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC;QAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAC/D,IAAI,CAAC,CAAC;QAGF,EAAE,CAAC,CAAC,aAAa,CAAC,MAAM,GAAG,EAAE,CAAC;YAAC,aAAa,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE1E,cAAc,CAAC,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAA;IACpD,CAAC;IAAA,CAAC;IAGF,aAAa,CAAC,SAAS,CAAC,UAAU,EAAE,CAAC;IAErC,IAAI,cAAc,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;IAElD,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QAClB,aAAa,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;IACD,IAAI,CAAC,CAAC;QACF,IAAI,e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,GAAlB,kBASf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/onSaveHandler.js b/dist/main/atom/onSaveHandler.js
index 900b2c94a..84feaac3c 100644
--- a/dist/main/atom/onSaveHandler.js
+++ b/dist/main/atom/onSaveHandler.js
@@ -1,11 +1,12 @@
-var atomConfig = require('./atomConfig');
var parent = require('../../worker/parent');
var errorView = require('./errorView');
function handle(event) {
var textUpdated = parent.updateText({ filePath: event.filePath, text: event.editor.getText() });
- if (atomConfig.compileOnSave) {
+ parent.getProjectFileDetails({ filePath: event.filePath }).then(function (fileDetails) {
+ if (!fileDetails.project.compileOnSave)
+ return;
textUpdated.then(function () { return parent.emitFile({ filePath: event.filePath }); }).then(function (res) { return errorView.showEmittedMessage(res); });
- }
+ });
}
exports.handle = handle;
//# sourceMappingURL=onSaveHandler.js.map
\ No newline at end of file
diff --git a/dist/main/atom/onSaveHandler.js.map b/dist/main/atom/onSaveHandler.js.map
index 0f9a1a835..6d6621e16 100644
--- a/dist/main/atom/onSaveHandler.js.map
+++ b/dist/main/atom/onSaveHandler.js.map
@@ -1 +1 @@
-{"version":3,"file":"onSaveHandler.js","sourceRoot":"","sources":["../../../lib/main/atom/onSaveHandler.ts"],"names":["handle"],"mappings":"AAIA,IAAO,UAAU,WAAW,cAAc,CAAC,CAAC;AAG5C,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAG/C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAK1C,SAAgB,MAAM,CAAC,KAAqD;IACxEA,IAAIA,WAAWA,GAAGA,MAAMA,CAACA,UAAUA,CAACA,EAAEA,QAAQA,EAAEA,KAAKA,CAACA,QAAQA,EAAEA,IAAIA,EAAEA,KAAKA,CAACA,MAAMA,CAACA,OAAOA,EAAEA,EAAEA,CAACA,CAACA;IAEhGA,EAAEA,CAACA,CAACA,UAAUA,CAACA,aAAaA,CAACA,CAACA,CAACA;QAC3BA,WAAWA,CAACA,IAAIA,CAACA,cAAMA,OAAAA,MAAMA,CAACA,QAAQA,CAACA,EAAEA,QAAQA,EAAEA,KAAKA,CAACA,QAAQA,EAAEA,CAACA,EAA7CA,CAA6CA,CAACA,CAChEA,IAAIA,CAACA,UAACA,GAAGA,IAAKA,OAAAA,SAASA,CAACA,kBAAkBA,CAACA,GAAGA,CAACA,EAAjCA,CAAiCA,CAACA,CAACA;IAC1DA,CAACA;AACLA,CAACA;AAPe,cAAM,GAAN,MAOf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"onSaveHandler.js","sourceRoot":"","sources":["../../../lib/main/atom/onSaveHandler.ts"],"names":["handle"],"mappings":"AAOA,IAAO,MAAM,WAAW,qBAAqB,CAAC,CAAC;AAG/C,IAAO,SAAS,WAAW,aAAa,CAAC,CAAC;AAK1C,SAAgB,MAAM,CAAC,KAAqD;IAExEA,IAAIA,WAAWA,GAAGA,MAAMA,CAACA,UAAUA,CAACA,EAAEA,QAAQA,EAAEA,KAAKA,CAACA,QAAQA,EAAEA,IAAIA,EAAEA,KAAKA,CAACA,MAAMA,CAACA,OAAOA,EAAEA,EAAEA,CAACA,CAACA;IAGhGA,MAAMA,CAACA,qBAAqBA,CAACA,EAAEA,QAAQA,EAAEA,KAAKA,CAACA,QAAQA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAAA,WAAWA;QACvEA,EAAEA,CAACA,CAACA,CAACA,WAAWA,CAACA,OAAOA,CAACA,aAAaA,CAACA;YAACA,MAAMA,CAACA;QAE/CA,WAAWA,CAACA,IAAIA,CAACA,cAAMA,OAAAA,MAAMA,CAACA,QAAQA,CAACA,EAAEA,QAAQA,EAAEA,KAAKA,CAACA,QAAQA,EAAEA,CAACA,EAA7CA,CAA6CA,CAACA,CAChEA,IAAIA,CAACA,UAACA,GAAGA,IAAKA,OAAAA,SAASA,CAACA,kBAAkBA,CAACA,GAAGA,CAACA,EAAjCA,CAAiCA,CAACA,CAACA;IAC1DA,CAACA,CAACA,CAACA;AACPA,CAACA;AAXe,cAAM,GAAN,MAWf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/typescriptGrammar.js b/dist/main/atom/typescriptGrammar.js
index 8fbff9610..dcccd91ea 100644
--- a/dist/main/atom/typescriptGrammar.js
+++ b/dist/main/atom/typescriptGrammar.js
@@ -19,7 +19,7 @@ var TypeScriptSemanticGrammar = (function (_super) {
});
this.registry = registry;
this.trailingWhiteSpaceLength = 0;
- this.classifier = ts.createClassifier({ log: function () { return undefined; } });
+ this.classifier = ts.createClassifier();
this.fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
this.importRequireRegex = /^import\s*(\w*)\s*=\s*require\((?:'|")(\S*)(?:'|")\.*\)/;
}
@@ -31,8 +31,8 @@ var TypeScriptSemanticGrammar = (function (_super) {
else {
this.trailingWhiteSpaceLength = 0;
}
- var finalLexState = firstLine ? ts.EndOfLineState.Start : ruleStack.length ? ruleStack[0] : ts.EndOfLineState.Start;
- if (finalLexState !== ts.EndOfLineState.Start) {
+ var finalLexState = firstLine ? 0 : ruleStack.length ? ruleStack[0] : 0;
+ if (finalLexState !== 0) {
return this.getAtomTokensForLine(line, finalLexState);
}
if (line.match(this.fullTripleSlashReferencePathRegEx)) {
@@ -81,7 +81,7 @@ var TypeScriptSemanticGrammar = (function (_super) {
return this.convertTsTokensToAtomTokens(tsTokensWithRuleStack);
};
TypeScriptSemanticGrammar.prototype.getTsTokensForLine = function (line, finalLexState) {
- if (finalLexState === void 0) { finalLexState = ts.EndOfLineState.Start; }
+ if (finalLexState === void 0) { finalLexState = 0; }
var output = this.classifier.getClassificationsForLine(line, finalLexState, true);
var ruleStack = [output.finalLexState];
var classificationResults = output.entries;
@@ -114,7 +114,7 @@ var TypeScriptSemanticGrammar = (function (_super) {
exports.TypeScriptSemanticGrammar = TypeScriptSemanticGrammar;
function getAtomStyleForToken(token, str) {
switch (token.classification) {
- case TokenClass.Punctuation:
+ case 0:
switch (str) {
case '{':
return "punctuation.section.scope.begin.ts";
@@ -127,7 +127,7 @@ function getAtomStyleForToken(token, str) {
default:
return 'punctuation';
}
- case TokenClass.Keyword:
+ case 1:
switch (str) {
case 'static':
case 'public':
@@ -150,21 +150,19 @@ function getAtomStyleForToken(token, str) {
default:
return 'keyword';
}
- case TokenClass.Operator:
+ case 2:
return 'keyword.operator.js';
- case TokenClass.Comment:
+ case 3:
return 'comment';
- case TokenClass.Whitespace:
+ case 4:
return 'whitespace';
- case TokenClass.Identifier:
- if (!str.trim())
- return '';
+ case 5:
return 'identifier';
- case TokenClass.NumberLiteral:
+ case 6:
return 'constant.numeric';
- case TokenClass.StringLiteral:
+ case 7:
return 'string';
- case TokenClass.RegExpLiteral:
+ case 8:
return 'constant.character';
default:
return null;
diff --git a/dist/main/atom/typescriptGrammar.js.map b/dist/main/atom/typescriptGrammar.js.map
index b2c926e31..fa1fa7f48 100644
--- a/dist/main/atom/typescriptGrammar.js.map
+++ b/dist/main/atom/typescriptGrammar.js.map
@@ -1 +1 @@
-{"version":3,"file":"typescriptGrammar.js","sourceRoot":"","sources":["../../../lib/main/atom/typescriptGrammar.ts"],"names":["TypeScriptSemanticGrammar","TypeScriptSemanticGrammar.constructor","TypeScriptSemanticGrammar.tokenizeLine","TypeScriptSemanticGrammar.getfullTripleSlashReferencePathTokensForLine","TypeScriptSemanticGrammar.getImportRequireTokensForLine","TypeScriptSemanticGrammar.getTsTokensForLine","TypeScriptSemanticGrammar.getAtomTokensForLine","TypeScriptSemanticGrammar.convertTsTokensToAtomTokens","getAtomStyleForToken"],"mappings":";;;;;;AAQA,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAO,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAElC,IAAI,KAAK,GAAyB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAYpD,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAQ,IAAK,CAAC,MAAM,CAAC,YAAY,GAAG,yCAAyC,CAAC,CAAC;AAEjH,IAAa,yBAAyB;IAASA,UAAlCA,yBAAyBA,UAA0BA;IA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;QACrBA,KAAKA,UAAUA,CAACA,UAAUA;YACtBA,MAAMA,CAACA,YAAYA,CAACA;QACxBA,KAAKA,UAAUA,CAACA,UAAUA;YACtBA,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,IAAIA,EAAEA,CAACA;gBAACA,MAAMA,CAACA,EAAEA,CAACA;YAC3BA,MAAMA,CAACA,YAAYA,CAACA;QACxBA,KAAKA,UAAUA,CAACA,aAAaA;YACzBA,MAAMA,CAACA,kBAAkBA,CAACA;QAC9BA,KAAKA,UAAUA,CAACA,aAAaA;YACzBA,MAAMA,CAACA,QAAQA,CAACA;QACpBA,KAAKA,UAAUA,CAACA,aAAaA;YACzBA,MAAMA,CAACA,oBAAoBA,CAACA;QAChCA;YACIA,MAAMA,CAACA,IAAIA,CAACA;IACpBA,CAACA;AACLA,CAACA"}
\ No newline at end of file
+{"version":3,"file":"typescriptGrammar.js","sourceRoot":"","sources":["../../../lib/main/atom/typescriptGrammar.ts"],"names":["TypeScriptSemanticGrammar","TypeScriptSemanticGrammar.constructor","TypeScriptSemanticGrammar.tokenizeLine","TypeScriptSemanticGrammar.getfullTripleSlashReferencePathTokensForLine","TypeScriptSemanticGrammar.getImportRequireTokensForLine","TypeScriptSemanticGrammar.getTsTokensForLine","TypeScriptSemanticGrammar.getAtomTokensForLine","TypeScriptSemanticGrammar.convertTsTokensToAtomTokens","getAtomStyleForToken"],"mappings":";;;;;;AAQA,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAO,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC;AAElC,IAAI,KAAK,GAAyB,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;AAYpD,MAAM,CAAC,iBAAiB,GAAG,OAAO,CAAQ,IAAK,CAAC,MAAM,CAAC,YAAY,GAAG,yCAAyC,CAAC,CAAC;AAEjH,IAAa,yBAAyB;IAASA,UAAlCA,yBAAyBA,UAA0BA;IAC5DA,SADSA,yBAAyBA,CACfA,QAAQA;QAC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ACzBA,MAAMA,CAACA,oBAAoBA,CAACA;QAChCA;YACIA,MAAMA,CAACA,IAAIA,CAACA;IACpBA,CAACA;AACLA,CAACA"}
\ No newline at end of file
diff --git a/dist/main/atom/views/contextView.js b/dist/main/atom/views/contextView.js
index b50f37379..8e2ddf265 100644
--- a/dist/main/atom/views/contextView.js
+++ b/dist/main/atom/views/contextView.js
@@ -19,9 +19,7 @@ var ContextView = (function (_super) {
enumerable: true,
configurable: true
});
- ContextView.prototype.setItems = function (items) {
- _super.prototype.setItems.call(this, items);
- };
+ ContextView.prototype.setItems = function (items) { _super.prototype.setItems.call(this, items); };
ContextView.prototype.viewForItem = function (item) {
return "
" + item.title + "";
};
@@ -29,9 +27,7 @@ var ContextView = (function (_super) {
console.log(item);
this.hide();
};
- ContextView.prototype.getFilterKey = function () {
- return 'title';
- };
+ ContextView.prototype.getFilterKey = function () { return 'title'; };
ContextView.prototype.show = function () {
this.storeFocusedElement();
if (!this.panel)
diff --git a/dist/main/atom/views/contextView.js.map b/dist/main/atom/views/contextView.js.map
index 9e5f9cf02..d60253837 100644
--- a/dist/main/atom/views/contextView.js.map
+++ b/dist/main/atom/views/contextView.js.map
@@ -1 +1 @@
-{"version":3,"file":"contextView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/contextView.ts"],"names":["ContextView","ContextView.constructor","ContextView.$","ContextView.setItems","ContextView.viewForItem","ContextView.confirmed","ContextView.getFilterKey","ContextView.show","ContextView.hide","ContextView.cancelled"],"mappings":";;;;;;AAAA,IAAO,EAAE,WAAW,sBAAsB,CAAC,CAAC;AAM5C,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAKhI,IAAa,WAAW;IAASA,UAApBA,WAAWA,UAA0BA;IAAlDA,SAAaA,WAAWA;QAASC,8BAAiBA;QAqB9CA,UAAKA,GAA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,EAsCjD;AAtCY,mBAAW,GAAX,WAsCZ,CAAA"}
\ No newline at end of file
+{"version":3,"file":"contextView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/contextView.ts"],"names":["ContextView","ContextView.constructor","ContextView.$","ContextView.setItems","ContextView.viewForItem","ContextView.confirmed","ContextView.getFilterKey","ContextView.show","ContextView.hide","ContextView.cancelled"],"mappings":";;;;;;AAAA,IAAO,EAAE,WAAW,sBAAsB,CAAC,CAAC;AAM5C,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,yBAAyB,EAAE,EAAE,EAAE,KAAK,EAAE,2BAA2B,EAAE,EAAE,EAAE,KAAK,EAAE,wBAAwB,EAAE,CAAC,CAAC;AAKhI,IAAa,WAAW;IAASA,UAApBA,WAAWA,UAA0BA;IAAlDA,SAAaA,WAAWA;QAASC,8BAAiBA;QAqB9CA,UAAKA,GAAmBA,IAAIA,CAACA;IAiBjCA,CAACA;IApCGD,sBAAIA,0BAACA;aAALA;YACIE,MAAMA,CAAMA,IAAIA,CAACA;QACrBA,CAACA;;;OAAAF;IAEMA,8BAAQA,GAAfA,UAAgBA,KAAwBA,IAAIG,gBAAKA,CAACA,QAAQA,YAACA,KAAKA,CAACA,CAAAA,CAACA,CAACA;IAGnEH,iCAAWA,GAAXA,UAAYA,IAAqBA;QAC7BI,MAAMA,CAACA,SAAOA,IAAIA,CAACA,KAAKA,UAAOA,CAACA;IACpCA,CAACA;IAGDJ,+BAASA,GAATA,UAAUA,IAAqBA;QAC3BK,OAAOA,CAACA,GAAGA,CAACA,IAAIA,CAACA,CAACA;QAClBA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAChBA,CAACA;IAEDL,kCAAYA,GAAZA,cAAiBM,MAAMA,CAACA,OAAOA,CAACA,CAACA,CAACA;IAGlCN,0BAAIA,GAAJA;QACIO,IAAIA,CAACA,mBAAmBA,EAAEA,CAACA;QAC3BA,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA;YAACA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,CAACA,SAASA,CAACA,aAAaA,CAACA,EAAEA,IAAIA,EAAEA,IAAIA,EAAEA,CAACA,CAACA;QAC3EA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,EAAEA,CAAAA;QAEjBA,IAAIA,CAACA,QAAQA,CAACA,KAAKA,CAACA,CAACA;QACrBA,IAAIA,CAACA,iBAAiBA,EAAEA,CAACA;IAC7BA,CAACA;IACDP,0BAAIA,GAAJA;QACIQ,IAAIA,CAACA,KAAKA,CAACA,IAAIA,EAAEA,CAACA;QAClBA,IAAIA,CAACA,YAAYA,EAAEA,CAACA;IACxBA,CAACA;IAEDR,+BAASA,GAATA;QACIS,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAChBA,CAACA;IACLT,kBAACA;AAADA,CAACA,AAtCD,EAAiC,EAAE,CAAC,cAAc,EAsCjD;AAtCY,mBAAW,GAAX,WAsCZ,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/views/documentationView.js b/dist/main/atom/views/documentationView.js
index dcb843012..4f291cfaa 100644
--- a/dist/main/atom/views/documentationView.js
+++ b/dist/main/atom/views/documentationView.js
@@ -19,22 +19,14 @@ var DocumentationView = (function (_super) {
_this.p({ outlet: 'documentation' });
}); });
};
- DocumentationView.prototype.show = function () {
- this.$.addClass('active');
- this.shown = true;
- };
- DocumentationView.prototype.hide = function () {
- this.$.removeClass('active');
- this.shown = false;
- };
- DocumentationView.prototype.toggle = function () {
- if (this.shown) {
- this.hide();
- }
- else {
- this.show();
- }
- };
+ DocumentationView.prototype.show = function () { this.$.addClass('active'); this.shown = true; };
+ DocumentationView.prototype.hide = function () { this.$.removeClass('active'); this.shown = false; };
+ DocumentationView.prototype.toggle = function () { if (this.shown) {
+ this.hide();
+ }
+ else {
+ this.show();
+ } };
DocumentationView.prototype.setContent = function (content) {
this.header.html(content.display);
content.documentation = content.documentation.replace(/(?:\r\n|\r|\n)/g, '
');
@@ -67,9 +59,7 @@ function attach() {
exports.attach = attach;
function testDocumentationView() {
exports.docView.setContent({
- display: "this is awesome",
- documentation: "\n some docs\n over\n many\n many li\n\n lines\n long\n so\n long\n that\n it\n should\n\n start\n to\n scroll\n ",
- filePath: "some filepath"
+ display: "this is awesome", documentation: "\n some docs\n over\n many\n many li\n\n lines\n long\n so\n long\n that\n it\n should\n\n start\n to\n scroll\n ", filePath: "some filepath"
});
exports.docView.show();
}
diff --git a/dist/main/atom/views/documentationView.js.map b/dist/main/atom/views/documentationView.js.map
index b170fda34..0171ffb73 100644
--- a/dist/main/atom/views/documentationView.js.map
+++ b/dist/main/atom/views/documentationView.js.map
@@ -1 +1 @@
-{"version":3,"file":"documentationView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/documentationView.ts"],"names":["DocumentationView","DocumentationView.constructor","DocumentationView.content","DocumentationView.show","DocumentationView.hide","DocumentationView.toggle","DocumentationView.setContent","DocumentationView.autoPosition","attach","testDocumentationView"],"mappings":";;;;;;AAAA,IAAO,IAAI,WAAW,QAAQ,CAAC,CAAC;AAChC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAEf,IAAa,iBAAiB;IAASA,UAA1BA,iBAAiBA,UAAuBA;IAArDA,SAAaA,iBAAiBA;QAASC,8BAAcA;QAezCA,UAAKA,GAAGA,KAAKA,CAACA;IA0B1BA,CAACA;IArCUD,yBAAOA,GAAdA;QAAAE,iBAQCA;QAPGA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,EAAEA,KAAKA,EAAEA,kCAAkCA,EAAEA,EACzDA,cAAMA,OAAAA,KAAIA,CAACA,GAAGA,CACVA;YACIA,KAAIA,CAACA,EAAEA,CAACA,EAAEA,MAAMA,EAAEA,QAAQA,EAAEA,CAACA,CAACA;YAC9BA,KAAIA,CAACA,CAACA,CAACA,EAAEA,MAAMA,EAAEA,eAAeA,EAAEA,CAACA,CAACA;QACxCA,CAACA,CAACA,EAJAA,CAIAA,CACLA,CAACA;IACVA,CA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,GAAGA,CAACA,CAACA,CAACA;YACjCA,IAAIA,CAACA,CAACA,CAACA,WAAWA,CAACA,QAAQA,CAACA,CAACA;YAC7BA,IAAIA,CAACA,CAACA,CAACA,QAAQA,CAACA,KAAKA,CAACA,CAACA;QAC3BA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,IAAIA,CAACA,CAACA,CAACA,WAAWA,CAACA,KAAKA,CAACA,CAACA;YAC1BA,IAAIA,CAACA,CAACA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAAAA;QAC7BA,CAACA;IACLA,CAACA;IACLP,wBAACA;AAADA,CAACA,AAzCD,EAAuC,IAAI,CAAC,IAAI,EAyC/C;AAzCY,yBAAiB,GAAjB,iBAyCZ,CAAA;AAEU,eAA0B,CAAC;AAEtC,SAAgB,MAAM;IAClBQ,EAAEA,CAACA,CAACA,eAAOA,CAACA;QAACA,MAAMA,CAACA;IACpBA,eAAOA,GAAGA,IAAIA,iBAAiBA,EAAEA,CAACA;IAClCA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,OAAOA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA,MAAMA,CAACA,eAAOA,CAACA,CAACA,CAACA,CAACA;AAE5DA,CAACA;AALe,cAAM,GAAN,MAKf,CAAA;AAED,SAAgB,qBAAqB;IACjCC,eAAOA,CAACA,UAAUA,CAACA;QACfA,OAAOA,EAAEA,iBAAiBA;QAAEA,aAAaA,EAAEA,gKAiB9CA;QAAEA,QAAQA,EAAEA,eAAeA;KAC3BA,CAACA,CAACA;IACHA,eAAOA,CAACA,IAAIA,EAAEA,CAACA;AACnBA,CAACA;AAtBe,6BAAqB,GAArB,qBAsBf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"documentationView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/documentationView.ts"],"names":["DocumentationView","DocumentationView.constructor","DocumentationView.content","DocumentationView.show","DocumentationView.hide","DocumentationView.toggle","DocumentationView.setContent","DocumentationView.autoPosition","attach","testDocumentationView"],"mappings":";;;;;;AAAA,IAAO,IAAI,WAAW,QAAQ,CAAC,CAAC;AAChC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAEf,IAAa,iBAAiB;IAASA,UAA1BA,iBAAiBA,UAAuBA;IAArDA,SAAaA,iBAAiBA;QAASC,8BAAcA;QAezCA,UAAKA,GAAGA,KAAKA,CAACA;IA0B1BA,CAACA;IArCUD,yBAAOA,GAAdA;QAAAE,iBAQCA;QAPGA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,EAAEA,KAAKA,EAAEA,kCAAkCA,EAAEA,EACzDA,cAAMA,OAAAA,KAAIA,CAACA,GAAGA,CACVA;YACIA,KAAIA,CAACA,EAAEA,CAACA,EAAEA,MAAMA,EAAEA,QAAQA,EAAEA,CAACA,CAACA;YAC9BA,KAAIA,CAACA,CAACA,CAACA,EAAEA,MAAMA,EAAEA,eAAeA,EAAEA,CAACA,CAACA;QACxCA,CAACA,CAACA,EAJAA,CAIAA,CACLA,CAACA;IACVA,CAACA;IAIDF,gCAAIA,GAAJA,cAASG,IAAIA,CAACA,CAACA,CAACA,QAAQA,CAACA,QAAQA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,CAACA,CAACA,CAACA;IACxDH,gCAAIA,GAAJA,cAASI,IAAIA,CAACA,CAACA,CAACA,WAAWA,CAACA,QAAQA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,GAAGA,KAAKA,CAACA,CAACA,CAACA;IAC5DJ,kCAAMA,GAANA,cAAWK,EAAEA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA,CAACA;QAACA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAACA,CAACA;IAACA,IAAIA,CAACA,CAACA;QAACA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAACA,CAACA,CAACA,CAACA;IAEnEL,sCAAUA,GAAVA,UAAWA,OAAqEA;QAC5EM,IAAIA,CA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AAIA,iBAAiBA,EAAEA,CAACA;IAClCA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA,OAAOA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA,MAAMA,CAACA,eAAOA,CAACA,CAACA,CAACA,CAACA;AAE5DA,CAACA;AALe,cAAM,GAAN,MAKf,CAAA;AAED,SAAgB,qBAAqB;IACjCC,eAAOA,CAACA,UAAUA,CAACA;QACfA,OAAOA,EAAEA,iBAAiBA,EAAEA,aAAaA,EAAEA,gKAiB9CA,EAAEA,QAAQA,EAAEA,eAAeA;KAC3BA,CAACA,CAACA;IACHA,eAAOA,CAACA,IAAIA,EAAEA,CAACA;AACnBA,CAACA;AAtBe,6BAAqB,GAArB,qBAsBf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/views/mainPanelView.js b/dist/main/atom/views/mainPanelView.js
index 8b9512051..7a416e579 100644
--- a/dist/main/atom/views/mainPanelView.js
+++ b/dist/main/atom/views/mainPanelView.js
@@ -23,8 +23,8 @@ var MainPanelView = (function (_super) {
if (className === void 0) { className = ''; }
return _this.button({
'class': "btn " + className,
- 'click': "" + view + "PanelSelected",
- 'outlet': "" + view + "PanelBtn",
+ 'click': view + "PanelSelected",
+ 'outlet': view + "PanelBtn",
'style': 'top:-2px!important'
}, text);
};
@@ -83,7 +83,7 @@ var MainPanelView = (function (_super) {
});
};
MainPanelView.prototype.init = function () {
- this.buildPanelBtn.html("" + panelHeaders.build + " ( No Build )");
+ this.buildPanelBtn.html(panelHeaders.build + " ( No Build )");
this.buildBody.html(' No Build. Press (ctrl+shift+b / cmd+shift+b ) to start a build for an active TypeScript file\'s project. ');
};
MainPanelView.prototype.errorPanelSelected = function () {
@@ -141,9 +141,9 @@ var MainPanelView = (function (_super) {
}
};
MainPanelView.prototype.setErrorPanelErrorCount = function (fileErrorCount, totalErrorCount) {
- var title = "" + panelHeaders.error + " ( No Errors )";
+ var title = panelHeaders.error + " ( No Errors )";
if (totalErrorCount > 0) {
- title = "" + panelHeaders.error + " (\n " + fileErrorCount + " \n file" + (fileErrorCount === 1 ? "" : "s") + " \n " + totalErrorCount + " \n error" + (totalErrorCount === 1 ? "" : "s") + " \n )";
+ title = panelHeaders.error + " (\n " + fileErrorCount + " \n file" + (fileErrorCount === 1 ? "" : "s") + " \n " + totalErrorCount + " \n error" + (totalErrorCount === 1 ? "" : "s") + " \n )";
}
else {
this.summary.html('');
@@ -152,9 +152,9 @@ var MainPanelView = (function (_super) {
this.errorPanelBtn.html(title);
};
MainPanelView.prototype.setBuildPanelCount = function (errorCount) {
- var title = "" + panelHeaders.build + " ( No Errors )";
+ var title = panelHeaders.build + " ( No Errors )";
if (errorCount > 0) {
- title = "" + panelHeaders.build + " (\n " + errorCount + " \n error" + (errorCount === 1 ? "" : "s") + " \n )";
+ title = panelHeaders.build + " (\n " + errorCount + " \n error" + (errorCount === 1 ? "" : "s") + " \n )";
}
else {
this.buildBody.html('No errors in last build \u2665');
diff --git a/dist/main/atom/views/mainPanelView.js.map b/dist/main/atom/views/mainPanelView.js.map
index 97093b267..c82176089 100644
--- a/dist/main/atom/views/mainPanelView.js.map
+++ b/dist/main/atom/views/mainPanelView.js.map
@@ -1 +1 @@
-{"version":3,"file":"mainPanelView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/mainPanelView.ts"],"names":["MainPanelView","MainPanelView.constructor","MainPanelView.content","MainPanelView.init","MainPanelView.errorPanelSelected","MainPanelView.buildPanelSelected","MainPanelView.setActivePanel","MainPanelView.toggle","MainPanelView.clearError","MainPanelView.addError","MainPanelView.setErrorSummary","MainPanelView.setErrorPanelErrorCount","MainPanelView.setBuildPanelCount","MainPanelView.clearBuild","MainPanelView.addBuild","attach"],"mappings":";;;;;;AAAA,IAAO,IAAI,WAAW,QAAQ,CAAC,CAAC;AAChC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAKf,IAAI,YAAY,GAAG;IACf,KAAK,EAAE,sBAAsB;IAC7B,KAAK,EAAE,mBAA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A,CAACA,IAAIA,CAACA,8IAA8IA,CAACA,CAAAA;IACvKA,CAACA;IAEDH,0CAAkBA,GAAlBA;QACII,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA;QACxCA,IAAIA,CAACA,aAAaA,CAACA,WAAWA,CAACA,UAAUA,CAACA,CAACA;QAC3CA,IAAIA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,CAACA,cAAcA,EAAEA,CAACA;IAC1BA,CAACA;IAEDJ,0CAAkBA,GAAlBA;QACIK,IAAIA,CAACA,aAAaA,CAACA,WAAWA,CAACA,UAAUA,CAACA,CAACA;QAC3CA,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA;QACxCA,IAAIA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,CAACA,cAAcA,EAAEA,CAACA;IAC1BA,CAACA;IAEOL,sCAAcA,GAAtBA;QACIM,EAAEA,CAACA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA,CAACA;YAChBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA;gBAC1CA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAChCA,CAACA;YACDA,IAAIA,CAACA,CAACA;gBACFA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAChCA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAC5BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,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A,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA;IACnCA,CAACA;IAEDZ,kCAAUA,GAAVA;QACIa,IAAIA,CAACA,SAASA,CAACA,KAAKA,EAAEA,CAACA;IAC3BA,CAACA;IAEDb,gCAAQA,GAARA,UAASA,IAAqCA;QAC1Cc,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;IAClCA,CAACA;IACLd,oBAACA;AAADA,CAACA,AAtMD,EAAmC,IAAI,CAAC,IAAI,EAsM3C;AAtMY,qBAAa,GAAb,aAsMZ,CAAA;AAEU,iBAAwB,CAAC;AACpC,IAAI,KAAqB,CAAC;AAC1B,SAAgB,MAAM;IAGlBe,EAAEA,CAACA,CAACA,iBAASA,CAACA;QAACA,MAAMA,CAACA;IAEtBA,iBAASA,GAAGA,IAAIA,aAAaA,EAAEA,CAACA;IAChCA,KAAKA,GAAGA,IAAIA,CAACA,SAASA,CAACA,cAAcA,CAACA,EAAEA,IAAIA,EAAEA,iBAASA,EAAEA,QAAQA,EAAEA,IAAIA,EAAEA,OAAOA,EAAEA,IAAIA,EAAEA,CAACA,CAACA;AAC9FA,CAACA;AAPe,cAAM,GAAN,MAOf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"mainPanelView.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/mainPanelView.ts"],"names":["MainPanelView","MainPanelView.constructor","MainPanelView.content","MainPanelView.init","MainPanelView.errorPanelSelected","MainPanelView.buildPanelSelected","MainPanelView.setActivePanel","MainPanelView.toggle","MainPanelView.clearError","MainPanelView.addError","MainPanelView.setErrorSummary","MainPanelView.setErrorPanelErrorCount","MainPanelView.setBuildPanelCount","MainPanelView.clearBuild","MainPanelView.addBuild","attach"],"mappings":";;;;;;AAAA,IAAO,IAAI,WAAW,QAAQ,CAAC,CAAC;AAChC,IAAI,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;AAKf,IAAI,YAAY,GAAG;IACf,KAAK,EAAE,s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,CAACA,SAASA,CAACA,IAAIA,CAACA,8IAA8IA,CAACA,CAAAA;IACvKA,CAACA;IAEDH,0CAAkBA,GAAlBA;QACII,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA;QACxCA,IAAIA,CAACA,aAAaA,CAACA,WAAWA,CAACA,UAAUA,CAACA,CAACA;QAC3CA,IAAIA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,CAACA,cAAcA,EAAEA,CAACA;IAC1BA,CAACA;IAEDJ,0CAAkBA,GAAlBA;QACIK,IAAIA,CAACA,aAAaA,CAACA,WAAWA,CAACA,UAAUA,CAACA,CAACA;QAC3CA,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA;QACxCA,IAAIA,CAACA,QAAQA,GAAGA,IAAIA,CAACA;QACrBA,IAAIA,CAACA,cAAcA,EAAEA,CAACA;IAC1BA,CAACA;IAEOL,sCAAcA,GAAtBA;QACIM,EAAEA,CAACA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA,CAACA;YAChBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,aAAaA,CAACA,QAAQA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA;gBAC1CA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAChCA,CAACA;YACDA,IAAIA,CAACA,CAACA;gBACFA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;gBAC5BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAChCA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,MAAMA,CAACA,CAACA;YAC5BA,IAAIA,CAACA,SAASA,CAACA,IA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ACA,KAAKA,CAACA,CAACA;IACnCA,CAACA;IAEDZ,kCAAUA,GAAVA;QACIa,IAAIA,CAACA,SAASA,CAACA,KAAKA,EAAEA,CAACA;IAC3BA,CAACA;IAEDb,gCAAQA,GAARA,UAASA,IAAqCA;QAC1Cc,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA,CAACA,CAACA;IAClCA,CAACA;IACLd,oBAACA;AAADA,CAACA,AAtMD,EAAmC,IAAI,CAAC,IAAI,EAsM3C;AAtMY,qBAAa,GAAb,aAsMZ,CAAA;AAEU,iBAAwB,CAAC;AACpC,IAAI,KAAqB,CAAC;AAC1B,SAAgB,MAAM;IAGlBe,EAAEA,CAACA,CAACA,iBAASA,CAACA;QAACA,MAAMA,CAACA;IAEtBA,iBAASA,GAAGA,IAAIA,aAAaA,EAAEA,CAACA;IAChCA,KAAKA,GAAGA,IAAIA,CAACA,SAASA,CAACA,cAAcA,CAACA,EAAEA,IAAIA,EAAEA,iBAASA,EAAEA,QAAQA,EAAEA,IAAIA,EAAEA,OAAOA,EAAEA,IAAIA,EAAEA,CAACA,CAACA;AAC9FA,CAACA;AAPe,cAAM,GAAN,MAOf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/atom/views/view.js b/dist/main/atom/views/view.js
index 64a8a6364..e3967863f 100644
--- a/dist/main/atom/views/view.js
+++ b/dist/main/atom/views/view.js
@@ -23,8 +23,7 @@ var View = (function (_super) {
View.content = function () {
throw new Error('Must override the base View static content member');
};
- View.prototype.init = function () {
- };
+ View.prototype.init = function () { };
return View;
})(atom.View);
exports.View = View;
diff --git a/dist/main/atom/views/view.js.map b/dist/main/atom/views/view.js.map
index 0e4d0c1e8..0b4ad0db5 100644
--- a/dist/main/atom/views/view.js.map
+++ b/dist/main/atom/views/view.js.map
@@ -1 +1 @@
-{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/view.ts"],"names":["View","View.constructor","View.$","View.content","View.init"],"mappings":";;;;;;AAGA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,IAAa,IAAI;IAAkBA,UAAtBA,IAAIA,UAA2BA;IASxCA,SATSA,IAAIA,CASMA,OAA0BA;QAAjCC,uBAAiCA,GAAjCA,UAA+BA,EAAEA;QACzCA,iBAAOA,CAACA;QADOA,YAAOA,GAAPA,OAAOA,CAAmBA;QAEzCA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAChBA,CAACA;IAXDD,sBAAIA,mBAACA;aAALA;YACIE,MAAMA,CAAMA,IAAIA,CAACA;QACrBA,CAACA;;;OAAAF;IAEMA,YAAOA,GAAdA;QACIG,MAAMA,IAAIA,KAAKA,CAACA,mDAAmDA,CAACA,CAACA;IACzEA,CAACA;IAMDH,mBAAIA,GAAJA;IAASI,CAACA;IACdJ,WAACA;AAADA,CAACA,AAdD,EAAmC,IAAI,CAAC,IAAI,EAc3C;AAdY,YAAI,GAAJ,IAcZ,CAAA;AAEU,SAAC,GAAiB,IAAI,CAAC,CAAC,CAAC"}
\ No newline at end of file
+{"version":3,"file":"view.js","sourceRoot":"","sources":["../../../../lib/main/atom/views/view.ts"],"names":["View","View.constructor","View.$","View.content","View.init"],"mappings":";;;;;;AAGA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,IAAa,IAAI;IAAkBA,UAAtBA,IAAIA,UAA2BA;IASxCA,SATSA,IAAIA,CASMA,OAA0BA;QAAjCC,uBAAiCA,GAAjCA,UAA+BA,EAAEA;QACzCA,iBAAOA,CAACA;QADOA,YAAOA,GAAPA,OAAOA,CAAmBA;QAEzCA,IAAIA,CAACA,IAAIA,EAAEA,CAACA;IAChBA,CAACA;IAXDD,sBAAIA,mBAACA;aAALA;YACIE,MAAMA,CAAMA,IAAIA,CAACA;QACrBA,CAACA;;;OAAAF;IAEMA,YAAOA,GAAdA;QACIG,MAAMA,IAAIA,KAAKA,CAACA,mDAAmDA,CAACA,CAACA;IACzEA,CAACA;IAMDH,mBAAIA,GAAJA,cAASI,CAACA;IACdJ,WAACA;AAADA,CAACA,AAdD,EAAmC,IAAI,CAAC,IAAI,EAc3C;AAdY,YAAI,GAAJ,IAcZ,CAAA;AAEU,SAAC,GAAiB,IAAI,CAAC,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/main/atomts.js b/dist/main/atomts.js
index 5b93d55ac..d47e2a37d 100644
--- a/dist/main/atomts.js
+++ b/dist/main/atomts.js
@@ -43,16 +43,24 @@ function readyToActivate() {
}
errorView.start();
debugAtomTs.runDebugCode({ filePath: filePath, editor: editor });
+ if (onDisk) {
+ parent.updateText({ filePath: filePath, text: editor.getText() }).then(function () { return parent.errorsForFile({ filePath: filePath }); }).then(function (resp) { return errorView.setErrors(filePath, resp.errors); });
+ }
var changeObserver = editor.onDidStopChanging(function () {
if (!onDisk) {
var root = { line: 0, ch: 0 };
errorView.setErrors(filePath, [{ startPos: root, endPos: root, filePath: filePath, message: "Please save file for it be processed by TypeScript", preview: "" }]);
return;
}
- var text = editor.getText();
- parent.updateText({ filePath: filePath, text: text }).then(function () { return parent.errorsForFile({ filePath: filePath }); }).then(function (resp) { return errorView.setErrors(filePath, resp.errors); });
+ parent.errorsForFile({ filePath: filePath }).then(function (resp) { return errorView.setErrors(filePath, resp.errors); });
});
- var fasterChangeObserver = editor.getBuffer().onDidChange(function (diff) {
+ var buffer = editor.buffer;
+ var fasterChangeObserver = editor.buffer.onDidChange(function (diff) {
+ var newText = diff.newText;
+ newText = editor.buffer.getTextInRange(diff.newRange);
+ var minChar = buffer.characterIndexForPosition(diff.oldRange.start);
+ var limChar = minChar + diff.oldText.length;
+ var promise = parent.editText({ filePath: filePath, minChar: minChar, limChar: limChar, newText: newText });
});
var saveObserver = editor.onDidSave(function (event) {
onDisk = true;
diff --git a/dist/main/atomts.js.map b/dist/main/atomts.js.map
index e90e2099a..fdca2930d 100644
--- a/dist/main/atomts.js.map
+++ b/dist/main/atomts.js.map
@@ -1 +1 @@
-{"version":3,"file":"atomts.js","sourceRoot":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AX,WAEf,CAAA;AAGD,SAAgB,OAAO;IACnBC,MAAMA,CAACA,CAACA,oBAAoBA,CAACA,QAAQA,CAACA,CAACA;AAC3CA,CAACA;AAFe,eAAO,GAAP,OAEf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"atomts.js","sourceRoot":"","sources":["../../lib/main/atomts.ts"],"names":["readyToActivate","activate","deactivate","serialize","deserialize","provide"],"mappings":"AAGA,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAI1B,IAAI,GAAG,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;AAG/C,IAAO,SAAS,WAAW,kBAAkB,CAAC,CAAC;AAE/C,IAAO,oBAAoB,WAAW,6BAA6B,CAAC,CAAC;AAErE,IAAO,cAAc,WAAW,uBAAuB,CAAC,CAAC;AAIzD,IAAO,SAAS,WAAW,kBAAkB,CAAC,CAAC;AAE/C,IAAO,QAAQ,WAAW,iBAAiB,CAAC,CAAC;AAE7C,IAAO,aAAa,WAAW,sBAAsB,CAAC,CAAC;AAEvD,IAAO,WAAW,WAAW,oBAAoB,CAAC,CAAC;AAEnD,IAAO,iBAAiB,WAAW,0BAA0B,CAAC,CAAC;AAC/D,IAAO,KAAK,WAAW,MAAM,CAAC,CAAC;AAG/B,IAAO,iBAAiB,WAAW,gCAAgC,CAAC,CAAC;AACrE,IAAO,UAAU,WAAW,yBAAyB,CAAC,CAAC;AAIvD,IAAI,SAAS,CAAC;AACd,IAAI,gBAAgB,CAAC;AACrB,IAAI,WAAgC,CAAC;AACrC,IAAI,iBAAsC,CAAC;AAK3C,IAAO,MAAM,WAAW,kBAAkB,CAAC,CAAC;AAG5C,IAAO,UAAU,WAAW,mBAAmB,CAAC,CAAC;AACtC,cAAM,GAAG,UAAU,CAAC,MAAM,CAAC;AAGtC,SAAS,eAAe;IAEpBA,iBAAiBA,CAACA,MAAMA,EAAEA,CAACA;IAG3BA,UAAUA,CAACA,MAAMA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AAE,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;gBAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,mBAAmB,CAAC,CAAC;YAGtF,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,cAAM,OAAA,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,mBAAmB,CAAC,EAAlD,CAAkD,CAAC,CAAC,IAAI,CAAC,cAAM,OAAA,eAAe,EAAE,EAAjB,CAAiB,CAAC,CAAC;QACzI,CAAC,CAACA,CAACA;QAEHA,MAAMA,CAACA;IACXA,CAACA;IAEDA,eAAeA,EAAEA,CAACA;AACtBA,CAACA;AAxBe,gBAAQ,GAAR,QAwBf,CAAA;AAED,SAAgB,UAAU;IACtBC,EAAEA,CAACA,CAACA,gBAAgBA,CAACA;QAACA,gBAAgBA,CAACA,OAAOA,EAAEA,CAACA;IACjDA,EAAEA,CAACA,CAACA,WAAWA,CAACA;QAACA,WAAWA,CAACA,OAAOA,EAAEA,CAACA;IACvCA,EAAEA,CAACA,CAACA,iBAAiBA,CAACA;QAACA,iBAAiBA,CAACA,OAAOA,EAAEA,CAACA;IAEnDA,MAAMA,CAACA,UAAUA,EAAEA,CAACA;AACxBA,CAACA;AANe,kBAAU,GAAV,UAMf,CAAA;AAED,SAAgB,SAAS;IACrBC,MAAMA,CAACA,EAAEA,CAACA;AACdA,CAACA;AAFe,iBAAS,GAAT,SAEf,CAAA;AAED,SAAgB,WAAW;AAE3BC,CAACA;AAFe,mBAAW,GAAX,WAEf,CAAA;AAGD,SAAgB,OAAO;IACnBC,MAAMA,CAACA,CAACA,oBAAoBA,CAACA,QAAQA,CAACA,CAACA;AAC3CA,CAACA;AAFe,eAAO,GAAP,OAEf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/languageServiceHost.js b/dist/main/lang/languageServiceHost.js
index 72230d8e5..6955e6f3b 100644
--- a/dist/main/lang/languageServiceHost.js
+++ b/dist/main/lang/languageServiceHost.js
@@ -1,92 +1,976 @@
-'use strict';
+var __extends = this.__extends || function (d, b) {
+ for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
+ function __() { this.constructor = d; }
+ __.prototype = b.prototype;
+ d.prototype = new __();
+};
var ts = require('typescript');
-var path = require('path');
-var utils = require('./utils');
-var fs = require('fs');
-function createScriptInfo(fileName, content, isOpen) {
- if (isOpen === void 0) { isOpen = false; }
- var version = 1;
- var editRanges = [];
- var _lineStarts;
- var _lineStartIsDirty = true;
- function getLineStarts() {
- if (_lineStartIsDirty) {
- _lineStarts = ts.computeLineStarts(content);
- _lineStartIsDirty = false;
- }
- return _lineStarts;
- }
- function updateContent(newContent) {
- content = newContent;
- _lineStartIsDirty = true;
- editRanges = [];
- version++;
- }
- function editContent(minChar, limChar, newText) {
- var prefix = content.substring(0, minChar);
- var middle = newText;
- var suffix = content.substring(limChar);
- content = prefix + middle + suffix;
- _lineStartIsDirty = true;
- editRanges.push(new ts.TextChangeRange(ts.TextSpan.fromBounds(minChar, limChar), newText.length));
- version++;
- }
- function getPositionFromLine(line, ch) {
- return getLineStarts()[line] + ch;
- }
- function getLineAndColForPositon(position) {
- if (position < 0 || position > content.length) {
- throw new RangeError('Argument out of range: position');
- }
- var lineStarts = getLineStarts();
- var lineNumber = utils.binarySearch(lineStarts, position);
- if (lineNumber < 0) {
- lineNumber = (~lineNumber) - 1;
+var debug;
+(function (debug) {
+ function stack() {
+ console.error((new Error()).stack);
+ }
+ debug.stack = stack;
+})(debug || (debug = {}));
+function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+}
+function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+}
+function textSpanEnd(span) {
+ return span.start + span.length;
+}
+function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+}
+function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+}
+var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+function hasProperty(map, key) {
+ return hasOwnProperty.call(map, key);
+}
+function lookUp(map, key) {
+ return hasProperty(map, key) ? map[key] : undefined;
+}
+var _fs = require('fs');
+var sys;
+(function (sys) {
+ function readFile(fileName) {
+ if (!_fs.existsSync(fileName)) {
+ return undefined;
+ }
+ var buffer = _fs.readFileSync(fileName);
+ var len = buffer.length;
+ if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) {
+ len &= ~1;
+ for (var i = 0; i < len; i += 2) {
+ var temp = buffer[i];
+ buffer[i] = buffer[i + 1];
+ buffer[i + 1] = temp;
+ }
+ return buffer.toString("utf16le", 2);
+ }
+ if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) {
+ return buffer.toString("utf16le", 2);
+ }
+ if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
+ return buffer.toString("utf8", 3);
+ }
+ return buffer.toString("utf8");
+ }
+ sys.readFile = readFile;
+ function writeFile(fileName, data, writeByteOrderMark) {
+ if (writeByteOrderMark) {
+ data = '\uFEFF' + data;
+ }
+ _fs.writeFileSync(fileName, data, "utf8");
+ }
+ sys.writeFile = writeFile;
+})(sys || (sys = {}));
+var LineLeaf = (function () {
+ function LineLeaf(text) {
+ this.text = text;
+ }
+ LineLeaf.prototype.setUdata = function (data) {
+ this.udata = data;
+ };
+ LineLeaf.prototype.getUdata = function () {
+ return this.udata;
+ };
+ LineLeaf.prototype.isLeaf = function () {
+ return true;
+ };
+ LineLeaf.prototype.walk = function (rangeStart, rangeLength, walkFns) {
+ walkFns.leaf(rangeStart, rangeLength, this);
+ };
+ LineLeaf.prototype.charCount = function () {
+ return this.text.length;
+ };
+ LineLeaf.prototype.lineCount = function () {
+ return 1;
+ };
+ return LineLeaf;
+})();
+var CharRangeSection;
+(function (CharRangeSection) {
+ CharRangeSection[CharRangeSection["PreStart"] = 0] = "PreStart";
+ CharRangeSection[CharRangeSection["Start"] = 1] = "Start";
+ CharRangeSection[CharRangeSection["Entire"] = 2] = "Entire";
+ CharRangeSection[CharRangeSection["Mid"] = 3] = "Mid";
+ CharRangeSection[CharRangeSection["End"] = 4] = "End";
+ CharRangeSection[CharRangeSection["PostEnd"] = 5] = "PostEnd";
+})(CharRangeSection || (CharRangeSection = {}));
+var lineCollectionCapacity = 4;
+var LineNode = (function () {
+ function LineNode() {
+ this.totalChars = 0;
+ this.totalLines = 0;
+ this.children = [];
+ }
+ LineNode.prototype.isLeaf = function () {
+ return false;
+ };
+ LineNode.prototype.updateCounts = function () {
+ this.totalChars = 0;
+ this.totalLines = 0;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ var child = this.children[i];
+ this.totalChars += child.charCount();
+ this.totalLines += child.lineCount();
+ }
+ };
+ LineNode.prototype.execWalk = function (rangeStart, rangeLength, walkFns, childIndex, nodeType) {
+ if (walkFns.pre) {
+ walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType);
+ }
+ if (walkFns.goSubtree) {
+ this.children[childIndex].walk(rangeStart, rangeLength, walkFns);
+ if (walkFns.post) {
+ walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType);
+ }
+ }
+ else {
+ walkFns.goSubtree = true;
+ }
+ return walkFns.done;
+ };
+ LineNode.prototype.skipChild = function (relativeStart, relativeLength, childIndex, walkFns, nodeType) {
+ if (walkFns.pre && (!walkFns.done)) {
+ walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType);
+ walkFns.goSubtree = true;
+ }
+ };
+ LineNode.prototype.walk = function (rangeStart, rangeLength, walkFns) {
+ var childIndex = 0;
+ var child = this.children[0];
+ var childCharCount = child.charCount();
+ var adjustedStart = rangeStart;
+ while (adjustedStart >= childCharCount) {
+ this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, 0);
+ adjustedStart -= childCharCount;
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ }
+ if ((adjustedStart + rangeLength) <= childCharCount) {
+ if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, 2)) {
+ return;
+ }
+ }
+ else {
+ if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, 1)) {
+ return;
+ }
+ var adjustedLength = rangeLength - (childCharCount - adjustedStart);
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ while (adjustedLength > childCharCount) {
+ if (this.execWalk(0, childCharCount, walkFns, childIndex, 3)) {
+ return;
+ }
+ adjustedLength -= childCharCount;
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ }
+ if (adjustedLength > 0) {
+ if (this.execWalk(0, adjustedLength, walkFns, childIndex, 4)) {
+ return;
+ }
+ }
+ }
+ if (walkFns.pre) {
+ var clen = this.children.length;
+ if (childIndex < (clen - 1)) {
+ for (var ej = childIndex + 1; ej < clen; ej++) {
+ this.skipChild(0, 0, ej, walkFns, 5);
+ }
+ }
+ }
+ };
+ LineNode.prototype.charOffsetToLineNumberAndPos = function (lineNumber, charOffset) {
+ var childInfo = this.childFromCharOffset(lineNumber, charOffset);
+ if (!childInfo.child) {
+ return {
+ line: lineNumber,
+ col: charOffset,
+ };
+ }
+ else if (childInfo.childIndex < this.children.length) {
+ if (childInfo.child.isLeaf()) {
+ return {
+ line: childInfo.lineNumber,
+ col: childInfo.charOffset,
+ text: (childInfo.child).text,
+ leaf: (childInfo.child)
+ };
+ }
+ else {
+ var lineNode = (childInfo.child);
+ return lineNode.charOffsetToLineNumberAndPos(childInfo.lineNumber, childInfo.charOffset);
+ }
+ }
+ else {
+ var lineInfo = this.lineNumberToInfo(this.lineCount(), 0);
+ var col = 1;
+ if (lineInfo.leaf)
+ col = lineInfo.leaf.charCount();
+ return { line: this.lineCount(), col: col };
+ }
+ };
+ LineNode.prototype.lineNumberToInfo = function (lineNumber, charOffset) {
+ var childInfo = this.childFromLineNumber(lineNumber, charOffset);
+ if (!childInfo.child) {
+ return {
+ line: lineNumber,
+ col: charOffset
+ };
+ }
+ else if (childInfo.child.isLeaf()) {
+ return {
+ line: lineNumber,
+ col: childInfo.charOffset,
+ text: (childInfo.child).text,
+ leaf: (childInfo.child)
+ };
+ }
+ else {
+ var lineNode = (childInfo.child);
+ return lineNode.lineNumberToInfo(childInfo.relativeLineNumber, childInfo.charOffset);
+ }
+ };
+ LineNode.prototype.childFromLineNumber = function (lineNumber, charOffset) {
+ var child;
+ var relativeLineNumber = lineNumber;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ child = this.children[i];
+ var childLineCount = child.lineCount();
+ if (childLineCount >= relativeLineNumber) {
+ break;
+ }
+ else {
+ relativeLineNumber -= childLineCount;
+ charOffset += child.charCount();
+ }
}
return {
- line: lineNumber,
- ch: position - lineStarts[lineNumber]
- };
- }
- return {
- getFileName: function () { return fileName; },
- getContent: function () { return content; },
- getVersion: function () { return version; },
- getIsOpen: function () { return isOpen; },
- setIsOpen: function (val) { return isOpen = val; },
- getEditRanges: function () { return editRanges; },
- getLineStarts: getLineStarts,
- updateContent: updateContent,
- editContent: editContent,
- getPositionFromLine: getPositionFromLine,
- getLineAndColForPositon: getLineAndColForPositon
+ child: child,
+ childIndex: i,
+ relativeLineNumber: relativeLineNumber,
+ charOffset: charOffset
+ };
};
-}
-function getScriptSnapShot(scriptInfo) {
- var lineStarts = scriptInfo.getLineStarts();
- var textSnapshot = scriptInfo.getContent();
- var version = scriptInfo.getVersion();
- var editRanges = scriptInfo.getEditRanges();
- function getChangeRange(oldSnapshot) {
- var scriptVersion = oldSnapshot.version || 0;
- if (scriptVersion === version) {
- return ts.TextChangeRange.unchanged;
- }
- var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
- if (initialEditRangeIndex < 0) {
- return null;
+ LineNode.prototype.childFromCharOffset = function (lineNumber, charOffset) {
+ var child;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ child = this.children[i];
+ if (child.charCount() > charOffset) {
+ break;
+ }
+ else {
+ charOffset -= child.charCount();
+ lineNumber += child.lineCount();
+ }
+ }
+ return {
+ child: child,
+ childIndex: i,
+ charOffset: charOffset,
+ lineNumber: lineNumber
+ };
+ };
+ LineNode.prototype.splitAfter = function (childIndex) {
+ var splitNode;
+ var clen = this.children.length;
+ childIndex++;
+ var endLength = childIndex;
+ if (childIndex < clen) {
+ splitNode = new LineNode();
+ while (childIndex < clen) {
+ splitNode.add(this.children[childIndex++]);
+ }
+ splitNode.updateCounts();
+ }
+ this.children.length = endLength;
+ return splitNode;
+ };
+ LineNode.prototype.remove = function (child) {
+ var childIndex = this.findChildIndex(child);
+ var clen = this.children.length;
+ if (childIndex < (clen - 1)) {
+ for (var i = childIndex; i < (clen - 1); i++) {
+ this.children[i] = this.children[i + 1];
+ }
+ }
+ this.children.length--;
+ };
+ LineNode.prototype.findChildIndex = function (child) {
+ var childIndex = 0;
+ var clen = this.children.length;
+ while ((this.children[childIndex] != child) && (childIndex < clen))
+ childIndex++;
+ return childIndex;
+ };
+ LineNode.prototype.insertAt = function (child, nodes) {
+ var childIndex = this.findChildIndex(child);
+ var clen = this.children.length;
+ var nodeCount = nodes.length;
+ if ((clen < lineCollectionCapacity) && (childIndex == (clen - 1)) && (nodeCount == 1)) {
+ this.add(nodes[0]);
+ this.updateCounts();
+ return [];
}
- var entries = editRanges.slice(initialEditRangeIndex);
- return ts.TextChangeRange.collapseChangesAcrossMultipleVersions(entries);
+ else {
+ var shiftNode = this.splitAfter(childIndex);
+ var nodeIndex = 0;
+ childIndex++;
+ while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) {
+ this.children[childIndex++] = nodes[nodeIndex++];
+ }
+ var splitNodes = [];
+ var splitNodeCount = 0;
+ if (nodeIndex < nodeCount) {
+ splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity);
+ splitNodes = new Array(splitNodeCount);
+ var splitNodeIndex = 0;
+ for (var i = 0; i < splitNodeCount; i++) {
+ splitNodes[i] = new LineNode();
+ }
+ var splitNode = splitNodes[0];
+ while (nodeIndex < nodeCount) {
+ splitNode.add(nodes[nodeIndex++]);
+ if (splitNode.children.length == lineCollectionCapacity) {
+ splitNodeIndex++;
+ splitNode = splitNodes[splitNodeIndex];
+ }
+ }
+ for (i = splitNodes.length - 1; i >= 0; i--) {
+ if (splitNodes[i].children.length == 0) {
+ splitNodes.length--;
+ }
+ }
+ }
+ if (shiftNode) {
+ splitNodes[splitNodes.length] = shiftNode;
+ }
+ this.updateCounts();
+ for (i = 0; i < splitNodeCount; i++) {
+ splitNodes[i].updateCounts();
+ }
+ return splitNodes;
+ }
+ };
+ LineNode.prototype.add = function (collection) {
+ this.children[this.children.length] = collection;
+ return (this.children.length < lineCollectionCapacity);
+ };
+ LineNode.prototype.charCount = function () {
+ return this.totalChars;
+ };
+ LineNode.prototype.lineCount = function () {
+ return this.totalLines;
+ };
+ return LineNode;
+})();
+exports.LineNode = LineNode;
+var BaseLineIndexWalker = (function () {
+ function BaseLineIndexWalker() {
+ this.goSubtree = true;
+ this.done = false;
}
- return {
- getText: function (start, end) { return textSnapshot.substring(start, end); },
- getLength: function () { return textSnapshot.length; },
- getChangeRange: getChangeRange,
- getLineStartPositions: function () { return lineStarts; },
- version: version
+ BaseLineIndexWalker.prototype.leaf = function (rangeStart, rangeLength, ll) {
};
-}
+ return BaseLineIndexWalker;
+})();
+var EditWalker = (function (_super) {
+ __extends(EditWalker, _super);
+ function EditWalker() {
+ _super.call(this);
+ this.lineIndex = new LineIndex();
+ this.endBranch = [];
+ this.state = 2;
+ this.initialText = "";
+ this.trailingText = "";
+ this.suppressTrailingText = false;
+ this.lineIndex.root = new LineNode();
+ this.startPath = [this.lineIndex.root];
+ this.stack = [this.lineIndex.root];
+ }
+ EditWalker.prototype.insertLines = function (insertedText) {
+ if (this.suppressTrailingText) {
+ this.trailingText = "";
+ }
+ if (insertedText) {
+ insertedText = this.initialText + insertedText + this.trailingText;
+ }
+ else {
+ insertedText = this.initialText + this.trailingText;
+ }
+ var lm = LineIndex.linesFromText(insertedText);
+ var lines = lm.lines;
+ if (lines.length > 1) {
+ if (lines[lines.length - 1] == "") {
+ lines.length--;
+ }
+ }
+ var branchParent;
+ var lastZeroCount;
+ for (var k = this.endBranch.length - 1; k >= 0; k--) {
+ this.endBranch[k].updateCounts();
+ if (this.endBranch[k].charCount() == 0) {
+ lastZeroCount = this.endBranch[k];
+ if (k > 0) {
+ branchParent = this.endBranch[k - 1];
+ }
+ else {
+ branchParent = this.branchNode;
+ }
+ }
+ }
+ if (lastZeroCount) {
+ branchParent.remove(lastZeroCount);
+ }
+ var insertionNode = this.startPath[this.startPath.length - 2];
+ var leafNode = this.startPath[this.startPath.length - 1];
+ var len = lines.length;
+ if (len > 0) {
+ leafNode.text = lines[0];
+ if (len > 1) {
+ var insertedNodes = new Array(len - 1);
+ var startNode = leafNode;
+ for (var i = 1, len = lines.length; i < len; i++) {
+ insertedNodes[i - 1] = new LineLeaf(lines[i]);
+ }
+ var pathIndex = this.startPath.length - 2;
+ while (pathIndex >= 0) {
+ insertionNode = this.startPath[pathIndex];
+ insertedNodes = insertionNode.insertAt(startNode, insertedNodes);
+ pathIndex--;
+ startNode = insertionNode;
+ }
+ var insertedNodesLen = insertedNodes.length;
+ while (insertedNodesLen > 0) {
+ var newRoot = new LineNode();
+ newRoot.add(this.lineIndex.root);
+ insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes);
+ insertedNodesLen = insertedNodes.length;
+ this.lineIndex.root = newRoot;
+ }
+ this.lineIndex.root.updateCounts();
+ }
+ else {
+ for (var j = this.startPath.length - 2; j >= 0; j--) {
+ this.startPath[j].updateCounts();
+ }
+ }
+ }
+ else {
+ insertionNode.remove(leafNode);
+ for (var j = this.startPath.length - 2; j >= 0; j--) {
+ this.startPath[j].updateCounts();
+ }
+ }
+ return this.lineIndex;
+ };
+ EditWalker.prototype.post = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ if (lineCollection == this.lineCollectionAtBranch) {
+ this.state = 4;
+ }
+ this.stack.length--;
+ return undefined;
+ };
+ EditWalker.prototype.pre = function (relativeStart, relativeLength, lineCollection, parent, nodeType) {
+ var currentNode = this.stack[this.stack.length - 1];
+ if ((this.state == 2) && (nodeType == 1)) {
+ this.state = 1;
+ this.branchNode = currentNode;
+ this.lineCollectionAtBranch = lineCollection;
+ }
+ var child;
+ function fresh(node) {
+ if (node.isLeaf()) {
+ return new LineLeaf("");
+ }
+ else
+ return new LineNode();
+ }
+ switch (nodeType) {
+ case 0:
+ this.goSubtree = false;
+ if (this.state != 4) {
+ currentNode.add(lineCollection);
+ }
+ break;
+ case 1:
+ if (this.state == 4) {
+ this.goSubtree = false;
+ }
+ else {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.startPath[this.startPath.length] = child;
+ }
+ break;
+ case 2:
+ if (this.state != 4) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.startPath[this.startPath.length] = child;
+ }
+ else {
+ if (!lineCollection.isLeaf()) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.endBranch[this.endBranch.length] = child;
+ }
+ }
+ break;
+ case 3:
+ this.goSubtree = false;
+ break;
+ case 4:
+ if (this.state != 4) {
+ this.goSubtree = false;
+ }
+ else {
+ if (!lineCollection.isLeaf()) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.endBranch[this.endBranch.length] = child;
+ }
+ }
+ break;
+ case 5:
+ this.goSubtree = false;
+ if (this.state != 1) {
+ currentNode.add(lineCollection);
+ }
+ break;
+ }
+ if (this.goSubtree) {
+ this.stack[this.stack.length] = child;
+ }
+ return lineCollection;
+ };
+ EditWalker.prototype.leaf = function (relativeStart, relativeLength, ll) {
+ if (this.state == 1) {
+ this.initialText = ll.text.substring(0, relativeStart);
+ }
+ else if (this.state == 2) {
+ this.initialText = ll.text.substring(0, relativeStart);
+ this.trailingText = ll.text.substring(relativeStart + relativeLength);
+ }
+ else {
+ this.trailingText = ll.text.substring(relativeStart + relativeLength);
+ }
+ };
+ return EditWalker;
+})(BaseLineIndexWalker);
+var LineIndex = (function () {
+ function LineIndex() {
+ this.checkEdits = false;
+ }
+ LineIndex.prototype.charOffsetToLineNumberAndPos = function (charOffset) {
+ return this.root.charOffsetToLineNumberAndPos(1, charOffset);
+ };
+ LineIndex.prototype.lineNumberToInfo = function (lineNumber) {
+ var lineCount = this.root.lineCount();
+ if (lineNumber <= lineCount) {
+ var lineInfo = this.root.lineNumberToInfo(lineNumber, 0);
+ lineInfo.line = lineNumber;
+ return lineInfo;
+ }
+ else {
+ return {
+ line: lineNumber,
+ col: this.root.charCount()
+ };
+ }
+ };
+ LineIndex.prototype.load = function (lines) {
+ if (lines.length > 0) {
+ var leaves = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ leaves[i] = new LineLeaf(lines[i]);
+ }
+ this.root = LineIndex.buildTreeFromBottom(leaves);
+ }
+ else {
+ this.root = new LineNode();
+ }
+ };
+ LineIndex.prototype.walk = function (rangeStart, rangeLength, walkFns) {
+ this.root.walk(rangeStart, rangeLength, walkFns);
+ };
+ LineIndex.prototype.getText = function (rangeStart, rangeLength) {
+ var accum = "";
+ if ((rangeLength > 0) && (rangeStart < this.root.charCount())) {
+ this.walk(rangeStart, rangeLength, {
+ goSubtree: true,
+ done: false,
+ leaf: function (relativeStart, relativeLength, ll) {
+ accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength));
+ }
+ });
+ }
+ return accum;
+ };
+ LineIndex.prototype.every = function (f, rangeStart, rangeEnd) {
+ if (!rangeEnd) {
+ rangeEnd = this.root.charCount();
+ }
+ var walkFns = {
+ goSubtree: true,
+ done: false,
+ leaf: function (relativeStart, relativeLength, ll) {
+ if (!f(ll, relativeStart, relativeLength)) {
+ this.done = true;
+ }
+ }
+ };
+ this.walk(rangeStart, rangeEnd - rangeStart, walkFns);
+ return !walkFns.done;
+ };
+ LineIndex.prototype.edit = function (pos, deleteLength, newText) {
+ function editFlat(source, s, dl, nt) {
+ if (nt === void 0) { nt = ""; }
+ return source.substring(0, s) + nt + source.substring(s + dl, source.length);
+ }
+ if (this.root.charCount() == 0) {
+ if (newText) {
+ this.load(LineIndex.linesFromText(newText).lines);
+ return this;
+ }
+ }
+ else {
+ if (this.checkEdits) {
+ var checkText = editFlat(this.getText(0, this.root.charCount()), pos, deleteLength, newText);
+ }
+ var walker = new EditWalker();
+ if (pos >= this.root.charCount()) {
+ pos = this.root.charCount() - 1;
+ var endString = this.getText(pos, 1);
+ if (newText) {
+ newText = endString + newText;
+ }
+ else {
+ newText = endString;
+ }
+ deleteLength = 0;
+ walker.suppressTrailingText = true;
+ }
+ else if (deleteLength > 0) {
+ var e = pos + deleteLength;
+ var lineInfo = this.charOffsetToLineNumberAndPos(e);
+ if ((lineInfo && (lineInfo.col == 0))) {
+ deleteLength += lineInfo.text.length;
+ if (newText) {
+ newText = newText + lineInfo.text;
+ }
+ else {
+ newText = lineInfo.text;
+ }
+ }
+ }
+ if (pos < this.root.charCount()) {
+ this.root.walk(pos, deleteLength, walker);
+ walker.insertLines(newText);
+ }
+ if (this.checkEdits) {
+ var updatedText = this.getText(0, this.root.charCount());
+ }
+ return walker.lineIndex;
+ }
+ };
+ LineIndex.buildTreeFromBottom = function (nodes) {
+ var nodeCount = Math.ceil(nodes.length / lineCollectionCapacity);
+ var interiorNodes = [];
+ var nodeIndex = 0;
+ for (var i = 0; i < nodeCount; i++) {
+ interiorNodes[i] = new LineNode();
+ var charCount = 0;
+ var lineCount = 0;
+ for (var j = 0; j < lineCollectionCapacity; j++) {
+ if (nodeIndex < nodes.length) {
+ interiorNodes[i].add(nodes[nodeIndex]);
+ charCount += nodes[nodeIndex].charCount();
+ lineCount += nodes[nodeIndex].lineCount();
+ }
+ else {
+ break;
+ }
+ nodeIndex++;
+ }
+ interiorNodes[i].totalChars = charCount;
+ interiorNodes[i].totalLines = lineCount;
+ }
+ if (interiorNodes.length == 1) {
+ return interiorNodes[0];
+ }
+ else {
+ return this.buildTreeFromBottom(interiorNodes);
+ }
+ };
+ LineIndex.linesFromText = function (text) {
+ var lineStarts = ts.computeLineStarts(text);
+ if (lineStarts.length == 0) {
+ return { lines: [], lineMap: lineStarts };
+ }
+ var lines = new Array(lineStarts.length);
+ var lc = lineStarts.length - 1;
+ for (var lmi = 0; lmi < lc; lmi++) {
+ lines[lmi] = text.substring(lineStarts[lmi], lineStarts[lmi + 1]);
+ }
+ var endText = text.substring(lineStarts[lc]);
+ if (endText.length > 0) {
+ lines[lc] = endText;
+ }
+ else {
+ lines.length--;
+ }
+ return { lines: lines, lineMap: lineStarts };
+ };
+ return LineIndex;
+})();
+exports.LineIndex = LineIndex;
+var LineIndexSnapshot = (function () {
+ function LineIndexSnapshot(version, cache) {
+ this.version = version;
+ this.cache = cache;
+ this.changesSincePreviousVersion = [];
+ }
+ LineIndexSnapshot.prototype.getText = function (rangeStart, rangeEnd) {
+ return this.index.getText(rangeStart, rangeEnd - rangeStart);
+ };
+ LineIndexSnapshot.prototype.getLength = function () {
+ return this.index.root.charCount();
+ };
+ LineIndexSnapshot.prototype.getLineStartPositions = function () {
+ var starts = [-1];
+ var count = 1;
+ var pos = 0;
+ this.index.every(function (ll, s, len) {
+ starts[count++] = pos;
+ pos += ll.text.length;
+ return true;
+ }, 0);
+ return starts;
+ };
+ LineIndexSnapshot.prototype.getLineMapper = function () {
+ var _this = this;
+ return (function (line) {
+ return _this.index.lineNumberToInfo(line).col;
+ });
+ };
+ LineIndexSnapshot.prototype.getTextChangeRangeSinceVersion = function (scriptVersion) {
+ if (this.version <= scriptVersion) {
+ return unchangedTextChangeRange;
+ }
+ else {
+ return this.cache.getTextChangesBetweenVersions(scriptVersion, this.version);
+ }
+ };
+ LineIndexSnapshot.prototype.getChangeRange = function (oldSnapshot) {
+ var oldSnap = oldSnapshot;
+ return this.getTextChangeRangeSinceVersion(oldSnap.version);
+ };
+ return LineIndexSnapshot;
+})();
+exports.LineIndexSnapshot = LineIndexSnapshot;
+var TextChange = (function () {
+ function TextChange(pos, deleteLen, insertedText) {
+ this.pos = pos;
+ this.deleteLen = deleteLen;
+ this.insertedText = insertedText;
+ }
+ TextChange.prototype.getTextChangeRange = function () {
+ return createTextChangeRange(createTextSpan(this.pos, this.deleteLen), this.insertedText ? this.insertedText.length : 0);
+ };
+ return TextChange;
+})();
+exports.TextChange = TextChange;
+var ScriptVersionCache = (function () {
+ function ScriptVersionCache() {
+ this.changes = [];
+ this.versions = [];
+ this.minVersion = 0;
+ this.currentVersion = 0;
+ }
+ ScriptVersionCache.prototype.edit = function (pos, deleteLen, insertedText) {
+ this.changes[this.changes.length] = new TextChange(pos, deleteLen, insertedText);
+ if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) ||
+ (deleteLen > ScriptVersionCache.changeLengthThreshold) ||
+ (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) {
+ this.getSnapshot();
+ }
+ };
+ ScriptVersionCache.prototype.latest = function () {
+ return this.versions[this.currentVersion];
+ };
+ ScriptVersionCache.prototype.latestVersion = function () {
+ if (this.changes.length > 0) {
+ this.getSnapshot();
+ }
+ return this.currentVersion;
+ };
+ ScriptVersionCache.prototype.reloadFromFile = function (filename, cb) {
+ var content = sys.readFile(filename);
+ this.reload(content);
+ if (cb)
+ cb();
+ };
+ ScriptVersionCache.prototype.reload = function (script) {
+ this.currentVersion++;
+ this.changes = [];
+ var snap = new LineIndexSnapshot(this.currentVersion, this);
+ this.versions[this.currentVersion] = snap;
+ snap.index = new LineIndex();
+ var lm = LineIndex.linesFromText(script);
+ snap.index.load(lm.lines);
+ for (var i = this.minVersion; i < this.currentVersion; i++) {
+ this.versions[i] = undefined;
+ }
+ this.minVersion = this.currentVersion;
+ };
+ ScriptVersionCache.prototype.getSnapshot = function () {
+ var snap = this.versions[this.currentVersion];
+ if (this.changes.length > 0) {
+ var snapIndex = this.latest().index;
+ for (var i = 0, len = this.changes.length; i < len; i++) {
+ var change = this.changes[i];
+ snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText);
+ }
+ snap = new LineIndexSnapshot(this.currentVersion + 1, this);
+ snap.index = snapIndex;
+ snap.changesSincePreviousVersion = this.changes;
+ this.currentVersion = snap.version;
+ this.versions[snap.version] = snap;
+ this.changes = [];
+ if ((this.currentVersion - this.minVersion) >= ScriptVersionCache.maxVersions) {
+ var oldMin = this.minVersion;
+ this.minVersion = (this.currentVersion - ScriptVersionCache.maxVersions) + 1;
+ for (var j = oldMin; j < this.minVersion; j++) {
+ this.versions[j] = undefined;
+ }
+ }
+ }
+ return snap;
+ };
+ ScriptVersionCache.prototype.getTextChangesBetweenVersions = function (oldVersion, newVersion) {
+ if (oldVersion < newVersion) {
+ if (oldVersion >= this.minVersion) {
+ var textChangeRanges = [];
+ for (var i = oldVersion + 1; i <= newVersion; i++) {
+ var snap = this.versions[i];
+ for (var j = 0, len = snap.changesSincePreviousVersion.length; j < len; j++) {
+ var textChange = snap.changesSincePreviousVersion[j];
+ textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange();
+ }
+ }
+ return collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges);
+ }
+ else {
+ return undefined;
+ }
+ }
+ else {
+ return unchangedTextChangeRange;
+ }
+ };
+ ScriptVersionCache.fromString = function (script) {
+ var svc = new ScriptVersionCache();
+ var snap = new LineIndexSnapshot(0, svc);
+ snap.index = new LineIndex();
+ var lm = LineIndex.linesFromText(script);
+ snap.index.load(lm.lines);
+ svc.versions[svc.currentVersion] = snap;
+ return svc;
+ };
+ ScriptVersionCache.changeNumberThreshold = 8;
+ ScriptVersionCache.changeLengthThreshold = 256;
+ ScriptVersionCache.maxVersions = 8;
+ return ScriptVersionCache;
+})();
+exports.ScriptVersionCache = ScriptVersionCache;
+var ScriptInfo = (function () {
+ function ScriptInfo(fileName, content, isOpen) {
+ if (isOpen === void 0) { isOpen = false; }
+ this.fileName = fileName;
+ this.content = content;
+ this.isOpen = isOpen;
+ this.children = [];
+ this.svc = ScriptVersionCache.fromString(content);
+ }
+ ScriptInfo.prototype.close = function () {
+ this.isOpen = false;
+ };
+ ScriptInfo.prototype.open = function () {
+ this.isOpen = true;
+ };
+ ScriptInfo.prototype.getIsOpen = function () {
+ return this.isOpen;
+ };
+ ScriptInfo.prototype.addChild = function (childInfo) {
+ this.children.push(childInfo);
+ };
+ ScriptInfo.prototype.snap = function () {
+ return this.svc.getSnapshot();
+ };
+ ScriptInfo.prototype.getText = function () {
+ var snap = this.snap();
+ return snap.getText(0, snap.getLength());
+ };
+ ScriptInfo.prototype.getLineInfo = function (line) {
+ var snap = this.snap();
+ return snap.index.lineNumberToInfo(line);
+ };
+ ScriptInfo.prototype.editContent = function (start, end, newText) {
+ this.svc.edit(start, end - start, newText);
+ };
+ ScriptInfo.prototype.getTextChangeRangeBetweenVersions = function (startVersion, endVersion) {
+ return this.svc.getTextChangesBetweenVersions(startVersion, endVersion);
+ };
+ ScriptInfo.prototype.getChangeRange = function (oldSnapshot) {
+ return this.snap().getChangeRange(oldSnapshot);
+ };
+ return ScriptInfo;
+})();
+exports.ScriptInfo = ScriptInfo;
+var path = require('path');
+var fs = require('fs');
+exports.defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
var LanguageServiceHost = (function () {
function LanguageServiceHost(config) {
var _this = this;
@@ -100,7 +984,7 @@ var LanguageServiceHost = (function () {
catch (ex) {
content = '';
}
- var script = createScriptInfo(fileName, content);
+ var script = new ScriptInfo(fileName, content);
_this.fileNameToScript[fileName] = script;
};
this.removeScript = function (fileName) {
@@ -112,7 +996,10 @@ var LanguageServiceHost = (function () {
this.updateScript = function (fileName, content) {
var script = _this.fileNameToScript[fileName];
if (script) {
- script.updateContent(content);
+ if (script.getText() == content) {
+ return;
+ }
+ script.editContent(0, script.snap().getLength(), content);
return;
}
else {
@@ -130,7 +1017,7 @@ var LanguageServiceHost = (function () {
this.setScriptIsOpen = function (fileName, isOpen) {
var script = _this.fileNameToScript[fileName];
if (script) {
- script.setIsOpen(isOpen);
+ script.open();
return;
}
throw new Error('No script with name \'' + fileName + '\'');
@@ -138,35 +1025,27 @@ var LanguageServiceHost = (function () {
this.getScriptContent = function (fileName) {
var script = _this.fileNameToScript[fileName];
if (script) {
- return script.getContent();
+ return script.getText();
}
return null;
};
this.hasScript = function (fileName) {
return !!_this.fileNameToScript[fileName];
};
- this.getIndexFromPosition = function (fileName, position) {
- var script = _this.fileNameToScript[fileName];
- if (script) {
- return script.getPositionFromLine(position.line, position.ch);
- }
- return -1;
- };
this.getPositionFromIndex = function (fileName, index) {
- if (!_this.fileNameToScript[fileName])
- _this.addScript(fileName);
- var script = _this.fileNameToScript[fileName];
- if (script) {
- return script.getLineAndColForPositon(index);
- }
- return null;
+ var result = _this.positionToLineCol(fileName, index);
+ return { line: result.line - 1, ch: result.col - 1 };
+ };
+ this.getIndexFromPosition = function (fileName, position) {
+ var newPos = { ch: position.ch + 1, line: position.line + 1 };
+ return _this.lineColToPosition(fileName, newPos.line, newPos.ch);
};
this.getCompilationSettings = function () { return _this.config.project.compilerOptions; };
this.getScriptFileNames = function () { return Object.keys(_this.fileNameToScript); };
this.getScriptVersion = function (fileName) {
var script = _this.fileNameToScript[fileName];
if (script) {
- return '' + script.getVersion();
+ return script.svc.latestVersion().toString();
}
return '0';
};
@@ -180,23 +1059,31 @@ var LanguageServiceHost = (function () {
this.getScriptSnapshot = function (fileName) {
var script = _this.fileNameToScript[fileName];
if (script) {
- return getScriptSnapShot(script);
+ return script.snap();
}
return null;
};
this.getCurrentDirectory = function () {
return _this.config.projectFileDirectory;
};
- this.getDefaultLibFilename = function () {
+ this.getDefaultLibFileName = function () {
return 'lib.d.ts';
};
- this.log = function () { return void 0; };
- this.error = function () { return void 0; };
- this.trace = function () { return void 0; };
config.project.files.forEach(function (file) { return _this.addScript(file); });
- var libFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts'));
- this.addScript(libFile);
+ this.addScript(exports.defaultLibFile);
}
+ LanguageServiceHost.prototype.lineColToPosition = function (filename, line, col) {
+ var script = this.fileNameToScript[filename];
+ var index = script.snap().index;
+ var lineInfo = index.lineNumberToInfo(line);
+ return (lineInfo.col + col - 1);
+ };
+ LanguageServiceHost.prototype.positionToLineCol = function (filename, position) {
+ var script = this.fileNameToScript[filename];
+ var index = script.snap().index;
+ var lineCol = index.charOffsetToLineNumberAndPos(position);
+ return { line: lineCol.line, col: lineCol.col + 1 };
+ };
return LanguageServiceHost;
})();
exports.LanguageServiceHost = LanguageServiceHost;
diff --git a/dist/main/lang/languageServiceHost.js.map b/dist/main/lang/languageServiceHost.js.map
index 2cea8b885..8dc5906f8 100644
--- a/dist/main/lang/languageServiceHost.js.map
+++ b/dist/main/lang/languageServiceHost.js.map
@@ -1 +1 @@
-{"version":3,"file":"languageServiceHost.js","sourceRoot":"","sources":["../../../lib/main/lang/languageServiceHost.ts"],"names":["createScriptInfo","createScriptInfo.getLineStarts","createScriptInfo.updateContent","createScriptInfo.editContent","createScriptInfo.getPositionFromLine","createScriptInfo.getLineAndColForPositon","getScriptSnapShot","getScriptSnapShot.getChangeRange","LanguageServiceHost","L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,oBAAoBA,CAACA;QAC5CA,CAACA,CAAAA;QACDA,0BAAqBA,GAAGA;YACpBA,MAAMA,CAACA,UAAUA,CAACA;QACtBA,CAACA,CAAAA;QAGDA,QAAGA,GAAGA,cAAMA,YAAKA,CAACA,EAANA,CAAMA,CAAAA;QAClBA,UAAKA,GAAGA,cAAMA,YAAKA,CAACA,EAANA,CAAMA,CAAAA;QACpBA,UAAKA,GAAGA,cAAMA,YAAKA,CAACA,EAANA,CAAMA,CAAAA;QAnIhBA,MAAMA,CAACA,OAAOA,CAACA,KAAKA,CAACA,OAAOA,CAACA,UAACA,IAAIA,IAAKA,OAAAA,KAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,EAApBA,CAAoBA,CAACA,CAACA;QAG7DA,IAAIA,OAAOA,GAAGA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,OAAOA,CAACA,OAAOA,CAACA,OAAOA,CAACA,YAAYA,CAACA,CAACA,EAAEA,UAAUA,CAACA,CAACA,CAACA;QACnFA,IAAIA,CAACA,SAASA,CAACA,OAAOA,CAACA,CAACA;IAC5BA,CAACA;IA+HLD,0BAACA;AAADA,CAACA,AA7ID,IA6IC;AA7IY,2BAAmB,GAAnB,mBA6IZ,CAAA"}
\ No newline at end of file
+{"version":3,"file":"languageServiceHost.js","sourceRoot":"","sources":["../../../lib/main/lang/languageServiceHost.ts"],"names":["debug","debug.stack","createTextSpan","createTextChangeRange","textSpanEnd","collapseTextChangeRangesAcrossMultipleVersions","createTextSpanFromBounds","hasProperty","lookUp","sys","sys.readFile","sys.writeFile","LineLeaf","LineLeaf.constructor","LineLeaf.setUdata","LineLeaf.getUdata","LineLeaf.isLeaf","LineLeaf.walk","LineLeaf.charCount","LineLeaf.lineCount","CharRangeSection","LineNode","LineNode.constructor","LineNode.isLeaf","LineNode.updateCounts","LineNode.execWalk","LineNode.skipChild","LineNode.walk","LineNode.charOffsetToLineNumberAndPos","LineNode.lineNumberToInfo","LineNode.childFromLineNumber","LineNode.childFromCharOffset","LineNode.splitAfter","LineNode.remove","LineNode.findChildIndex","LineNode.insertAt","LineNode.add","LineNode.charCount","LineNode.lineCount","BaseLineIndexWalker","BaseLineIndexWalker.constructor","BaseLineIndexWalker.leaf","EditWalker","EditWalker.constructor","EditWalker.insertLines","EditWalker.post","EditWalker.pre","EditWalker.pre.fresh","EditWalker.leaf","LineIndex","LineIndex.constructor","LineIndex.charOffsetToLineNumberAndPos","LineIndex.lineNumberToInfo","LineIndex.load","LineIndex.walk","LineIndex.getText","LineIndex.every","LineIndex.edit","LineIndex.edit.editFlat","LineIndex.buildTreeFromBottom","LineIndex.linesFromText","LineIndexSnapshot","LineIndexSnapshot.constructor","LineIndexSnapshot.getText","LineIndexSnapshot.getLength","LineIndexSnapshot.getLineStartPositions","LineIndexSnapshot.getLineMapper","LineIndexSnapshot.getTextChangeRangeSinceVersion","LineIndexSnapshot.getChangeRange","TextChange","TextChange.constructor","TextChange.getTextChangeRange","ScriptVersionCache","ScriptVersionCache.constructor","ScriptVersionCache.edit","ScriptVersionCache.latest","ScriptVersionCache.latestVersion","ScriptVersionCache.reloadFromFile","ScriptVersionCache.reload","ScriptVersionCache.getSnapshot","ScriptVersionCache.getTextChangesBetweenVersions","ScriptVersionCache.fromString","ScriptInfo","ScriptInfo.constructor","ScriptInfo.close","ScriptInfo.open","ScriptInfo.getIsOpen","ScriptInfo.addChild","ScriptInfo.snap","ScriptInfo.getText","ScriptInfo.getLineInfo","ScriptInfo.editContent","ScriptInfo.getTextChangeRangeBetweenVersions","ScriptInfo.getChangeRange","LanguageServiceHost","LanguageServiceHost.constructor","LanguageServiceHost.lineColToPosition","LanguageServiceHost.positionToLineCol"],"mappings":";;;;;;AAAA,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAElC,IAAO,KAAK,CAIX;AAJD,WAAO,KAAK,EAAA,CAAC;IACTA,SAAgBA,KAAKA;QACjBC,OAAOA,CAACA,KAAKA,CAAOA,CAACA,IAAIA,KAAKA,EAA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AACA,CAACA;YACVA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,GAAGA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA;gBAC9BA,IAAIA,IAAIA,GAAGA,MAAMA,CAACA,CAACA,CAACA,CAACA;gBACrBA,MAAMA,CAACA,CAACA,CAACA,GAAGA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;gBAC1BA,MAAMA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA;YACzBA,CAACA;YACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;QACzCA,CAACA;QACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;YACvDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;QACzCA,CAACA;QACDA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,CAACA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,IAAIA,MAAMA,CAACA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA;YAC7EA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;QACtCA,CAACA;QACDA,MAAMA,CAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA;IACnCA,CAACA;IAtBeD,YAAQA,GAARA,QAsBfA,CAAAA;IACDA,SAAgBA,SAASA,CAACA,QAAQA,EAAEA,IAAIA,EAAEA,kBAAkBA;QACxDE,EAAEA,CAACA,CAACA,kBAAkBA,CAACA,CAACA,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rDA,CAACA;YACDA,IAAIA,UAAUA,GAAeA,EAAEA,CAACA;YAChCA,IAAIA,cAAcA,GAAGA,CAACA,CAACA;YACvBA,EAAEA,CAACA,CAACA,SAASA,GAAGA,SAASA,CAACA,CAACA,CAACA;gBACxBA,cAAcA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,CAACA,SAASA,GAAGA,SAASA,CAACA,GAAGA,sBAAsBA,CAACA,CAACA;gBAC7EA,UAAUA,GAAeA,IAAIA,KAAKA,CAACA,cAAcA,CAACA,CAACA;gBACnDA,IAAIA,cAAcA,GAAGA,CAACA,CAACA;gBACvBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,cAAcA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBACtCA,UAAUA,CAACA,CAACA,CAACA,GAAGA,IAAIA,QAAQA,EAAEA,CAACA;gBACnCA,CAACA;gBACDA,IAAIA,SAASA,GAAaA,UAAUA,CAACA,CAACA,CAACA,CAACA;gBACxCA,OAAOA,SAASA,GAAGA,SAASA,EAAEA,CAACA;oBAC3BA,SAASA,CAACA,GAAGA,CAACA,KAAKA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;oBAClCA,EAAEA,CAACA,CAACA,SAASA,CAACA,QAAQA,CAACA,MAAMA,IAAIA,sBAAsBA,CAACA,CAACA,CAACA;wBACtDA,cAAcA,EAAEA,CAACA;wBACjBA,SAASA,GAAaA,UAAUA,CAACA,cAAcA,CAACA,CAACA;oBACrDA,CAACA;gBACLA,CAACA;gBACDA,GAAGA,CAACA,CAACA,CAACA,GAAGA,UAAUA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;oBAC1CA,EAAEA,CAACA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA,QAAQA,CAACA,MAAMA,IAAIA,CAACA,CAACA,CAACA,CAACA;wBACrCA,UAAUA,CA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KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,IAAIA,EAAEA,CAACA,CAACA,CAACA;gBAChCA,KAAKA,CAACA,MAAMA,EAAEA,CAACA;YACnBA,CAACA;QACLA,CAACA;QACDA,IAAIA,YAAsBA,CAACA;QAC3BA,IAAIA,aAA6BA,CAACA;QAElCA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,IAAIA,CAACA,SAASA,CAACA,MAAMA,GAAGA,CAACA,EAAEA,CAACA,IAAIA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YACvCA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAAEA,CAACA,YAAYA,EAAEA,CAACA;YAC7CA,EAAEA,CAACA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA,CAACA,SAASA,EAAEA,IAAIA,CAACA,CAACA,CAACA,CAACA;gBACrCA,aAAaA,GAAGA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA,CAACA;gBAClCA,EAAEA,CAACA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA,CAACA;oBACRA,YAAYA,GAAaA,IAAIA,CAACA,SAASA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;gBACnDA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBACFA,YAAYA,GAAGA,IAAIA,CAACA,UAAUA,CAACA;gBACnCA,CAACA;YACLA,CAACA;QACLA,CAACA;QACDA,EAAEA,CAACA,CAACA,aAAaA,CAACA,CAACA,CAACA;YAChBA,YAAYA,CAACA,MAAMA,CAACA,aAAaA,CAACA,CAACA;QACvCA,CAACA;QAGDA,IAAIA,aAAaA,GAAaA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACxEA,IAAIA,QAAQA,GAAaA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;QACnEA,IAA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ACDA,KAAKA,CAACA;YACVA,KAAKA,CAAsBA;gBACvBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,KAAKA,IAAIA,CAAoBA,CAACA,CAACA,CAACA;oBACrCA,IAAIA,CAACA,SAASA,GAAGA,KAAKA,CAACA;gBAC3BA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBACFA,KAAKA,GAAGA,KAAKA,CAACA,cAAcA,CAACA,CAACA;oBAC9BA,WAAWA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;oBACvBA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,GAAGA,KAAKA,CAACA;gBAClDA,CAACA;gBACDA,KAAKA,CAACA;YACVA,KAAKA,CAAuBA;gBACxBA,EAAEA,CAACA,CAACA,IAAIA,CAACA,KAAKA,IAAIA,CAAoBA,CAACA,CAACA,CAACA;oBACrCA,KAAKA,GAAGA,KAAKA,CAACA,cAAcA,CAACA,CAACA;oBAC9BA,WAAWA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;oBACvBA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,GAAGA,KAAKA,CAACA;gBAClDA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBACFA,EAAEA,CAACA,CAACA,CAACA,cAAcA,CAACA,MAAMA,EAAEA,CAACA,CAACA,CAACA;wBAC3BA,KAAKA,GAAGA,KAAKA,CAACA,cAAcA,CAACA,CAACA;wBAC9BA,WAAWA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;wBACvBA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,GAAGA,KAAKA,CAACA;oBAClDA,CAACA;gBACLA,CAACA;gBACDA,KAAKA,CAACA;YACVA,KAAKA,CAAoBA;gBACrBA,IAAIA,CAACA,SAASA,GAAGA,KAAKA,CAACA;gBACvBA,KAAKA,CAACA;YACVA,KAAKA,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kBAAOA,GAAPA,OAAOA;YAC5DA,MAAMA,CAACA,MAAMA,CAACA,SAASA,CAACA,CAACA,EAAEA,CAACA,CAACA,GAAGA,EAAEA,GAAGA,MAAMA,CAACA,SAASA,CAACA,CAACA,GAAGA,EAAEA,EAAEA,MAAMA,CAACA,MAAMA,CAACA,CAACA;QACjFA,CAACA;QACDD,EAAEA,CAACA,CAACA,IAAIA,CAACA,IAAIA,CAACA,SAASA,EAAEA,IAAIA,CAACA,CAACA,CAACA,CAACA;YAE7BA,EAAEA,CAACA,CAACA,OAAOA,CAACA,CAACA,CAACA;gBACVA,IAAIA,CAACA,IAAIA,CAACA,SAASA,CAACA,aAAaA,CAACA,OAAOA,CAACA,CAACA,KAAKA,CAACA,CAACA;gBAClDA,MAAMA,CAACA,IAAIA,CAACA;YAChBA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA,CAACA;gBAClBA,IAAIA,SAASA,GAAGA,QAAQA,CAACA,IAAIA,CAACA,OAAOA,CAACA,CAACA,EAAEA,IAAIA,CAACA,IAAIA,CAACA,SAASA,EAAEA,CAACA,EAAEA,GAAGA,EAAEA,YAAYA,EAAEA,OAAOA,CAACA,CAACA;YACjGA,CAACA;YACDA,IAAIA,MAAMA,GAAGA,IAAIA,UAAUA,EAAEA,CAACA;YAC9BA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,IAAIA,CAACA,IAAIA,CAACA,SAASA,EAAEA,CAACA,CAACA,CAACA;gBAE/BA,GAAGA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,SAASA,EAAEA,GAAGA,CAACA,CAACA;gBAChCA,IAAIA,SAASA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,GAAGA,EAAEA,CAACA,CAACA,CAACA;gBACrCA,EAAEA,CAACA,CAACA,OAAOA,CAACA,CAACA,CAACA;oBACVA,OAAOA,GAAGA,SAASA,GAAGA,OAAOA,CAAC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,CAACA,IAAIA,CAACA,SAASA,EAAEA,CAACA,CAACA;YAC7DA,CAACA;YACDA,MAAMA,CAACA,MAAMA,CAACA,SAASA,CAACA;QAC5BA,CAACA;IACLA,CAACA;IAEMR,6BAAmBA,GAA1BA,UAA2BA,KAAuBA;QAC9CU,IAAIA,SAASA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,sBAAsBA,CAACA,CAACA;QACjEA,IAAIA,aAAaA,GAAeA,EAAEA,CAACA;QACnCA,IAAIA,SAASA,GAAGA,CAACA,CAACA;QAClBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,SAASA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YACjCA,aAAaA,CAACA,CAACA,CAACA,GAAGA,IAAIA,QAAQA,EAAEA,CAACA;YAClCA,IAAIA,SAASA,GAAGA,CAACA,CAACA;YAClBA,IAAIA,SAASA,GAAGA,CAACA,CAACA;YAClBA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,sBAAsBA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;gBAC9CA,EAAEA,CAACA,CAACA,SAASA,GAAGA,KAAKA,CAACA,MAAMA,CAACA,CAACA,CAACA;oBAC3BA,aAAaA,CAACA,CAACA,CAACA,CAACA,GAAGA,CAACA,KAAKA,CAACA,SAASA,CAACA,CAACA,CAACA;oBACvCA,SAASA,IAAIA,KAAKA,CAACA,SAASA,CAACA,CAACA,SAASA,EAAEA,CAACA;oBAC1CA,SAASA,IAAIA,KAAKA,CAACA,SAASA,CAACA,CAACA,SAASA,EAAEA,CAACA;gBAC9CA,CAACA;gBACDA,IAAIA,CAACA,CAACA;oBACFA,KAAKA,CAACA;gBACVA,CAACA;gBACDA,SAASA,EAAEA,CAACA;YAChBA,CAACA;YACDA,aAAaA,CAACA,CAACA,CAACA,CAACA,UAAUA,GAAGA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A,EAAEA,IAAIA,EAAEA,OAAOA,CAACA,IAAIA,EAAEA,GAAGA,EAAEA,OAAOA,CAACA,GAAGA,GAAGA,CAACA,EAAEA,CAACA;IACxDA,CAACA;IA+CLH,0BAACA;AAADA,CAACA,AA1JD,IA0JC;AA1JY,2BAAmB,GAAnB,mBA0JZ,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/languageServiceHost2.js b/dist/main/lang/languageServiceHost2.js
new file mode 100644
index 000000000..2c359558a
--- /dev/null
+++ b/dist/main/lang/languageServiceHost2.js
@@ -0,0 +1,228 @@
+'use strict';
+var path = require('path');
+var fs = require('fs');
+var textBuffer = require('basarat-text-buffer');
+function createScriptInfo(fileName, text, isOpen) {
+ if (isOpen === void 0) { isOpen = false; }
+ var version = 1;
+ var editRanges = [];
+ var _lineStarts;
+ var _lineStartIsDirty = true;
+ var buffer = new textBuffer(text);
+ function getLineStarts() {
+ if (_lineStartIsDirty) {
+ _lineStarts = [];
+ var totalLength = 0;
+ buffer.lines.forEach(function (line, index) {
+ _lineStarts.push(totalLength);
+ var lineLength = line.length;
+ totalLength = totalLength + lineLength + buffer.lineEndings[index];
+ });
+ _lineStartIsDirty = false;
+ }
+ return _lineStarts;
+ }
+ function updateContent(newContent) {
+ buffer = new textBuffer(newContent);
+ _lineStartIsDirty = true;
+ editRanges = [];
+ version++;
+ }
+ function editContent(minChar, limChar, newText) {
+ var start = getLineAndColForPositon(minChar);
+ var end = getLineAndColForPositon(limChar);
+ buffer.setTextInRange([[start.line, start.ch], [end.line, end.ch]], newText);
+ _lineStartIsDirty = true;
+ editRanges.push({
+ span: { start: minChar, length: limChar - minChar },
+ newLength: newText.length
+ });
+ version++;
+ }
+ function getPositionFromLine(line, ch) {
+ return buffer.characterIndexForPosition([line, ch]);
+ }
+ function getLineAndColForPositon(position) {
+ var _a = buffer.positionForCharacterIndex(position), row = _a.row, column = _a.column;
+ return {
+ line: row,
+ ch: column
+ };
+ }
+ return {
+ getFileName: function () { return fileName; },
+ getContent: function () { return buffer.getText(); },
+ getVersion: function () { return version; },
+ getIsOpen: function () { return isOpen; },
+ setIsOpen: function (val) { return isOpen = val; },
+ getEditRanges: function () { return editRanges; },
+ getLineStarts: getLineStarts,
+ updateContent: updateContent,
+ editContent: editContent,
+ getPositionFromLine: getPositionFromLine,
+ getLineAndColForPositon: getLineAndColForPositon
+ };
+}
+function getScriptSnapShot(scriptInfo) {
+ var lineStarts = scriptInfo.getLineStarts();
+ var textSnapshot = scriptInfo.getContent();
+ var version = scriptInfo.getVersion();
+ var editRanges = scriptInfo.getEditRanges();
+ function getChangeRange(oldSnapshot) {
+ var unchanged = { span: { start: 0, length: 0 }, newLength: 0 };
+ function collapseChangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return unchanged;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = change0.span.start + change0.span.length;
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = nextChange.span.start + nextChange.span.length;
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return { span: { start: oldStartN, length: oldEndN - oldStartN }, newLength: newEndN - oldStartN };
+ }
+ ;
+ var scriptVersion = oldSnapshot.version || 0;
+ if (scriptVersion === version) {
+ return unchanged;
+ }
+ var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
+ if (initialEditRangeIndex < 0) {
+ return null;
+ }
+ var entries = editRanges.slice(initialEditRangeIndex);
+ return collapseChangesAcrossMultipleVersions(entries);
+ }
+ return {
+ getText: function (start, end) { return textSnapshot.substring(start, end); },
+ getLength: function () { return textSnapshot.length; },
+ getChangeRange: getChangeRange,
+ getLineStartPositions: function () { return lineStarts; },
+ version: version
+ };
+}
+exports.defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
+var LanguageServiceHost = (function () {
+ function LanguageServiceHost(config) {
+ var _this = this;
+ this.config = config;
+ this.fileNameToScript = Object.create(null);
+ this.addScript = function (fileName, content) {
+ try {
+ if (!content)
+ content = fs.readFileSync(fileName).toString();
+ }
+ catch (ex) {
+ content = '';
+ }
+ var script = createScriptInfo(fileName, content);
+ _this.fileNameToScript[fileName] = script;
+ };
+ this.removeScript = function (fileName) {
+ delete _this.fileNameToScript[fileName];
+ };
+ this.removeAll = function () {
+ _this.fileNameToScript = Object.create(null);
+ };
+ this.updateScript = function (fileName, content) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.updateContent(content);
+ return;
+ }
+ else {
+ _this.addScript(fileName, content);
+ }
+ };
+ this.editScript = function (fileName, minChar, limChar, newText) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.editContent(minChar, limChar, newText);
+ return;
+ }
+ throw new Error('No script with name \'' + fileName + '\'');
+ };
+ this.setScriptIsOpen = function (fileName, isOpen) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.setIsOpen(isOpen);
+ return;
+ }
+ throw new Error('No script with name \'' + fileName + '\'');
+ };
+ this.getScriptContent = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getContent();
+ }
+ return null;
+ };
+ this.hasScript = function (fileName) {
+ return !!_this.fileNameToScript[fileName];
+ };
+ this.getIndexFromPosition = function (fileName, position) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getPositionFromLine(position.line, position.ch);
+ }
+ return -1;
+ };
+ this.getPositionFromIndex = function (fileName, index) {
+ if (!_this.fileNameToScript[fileName])
+ _this.addScript(fileName);
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getLineAndColForPositon(index);
+ }
+ return null;
+ };
+ this.getCompilationSettings = function () { return _this.config.project.compilerOptions; };
+ this.getScriptFileNames = function () { return Object.keys(_this.fileNameToScript); };
+ this.getScriptVersion = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return '' + script.getVersion();
+ }
+ return '0';
+ };
+ this.getScriptIsOpen = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getIsOpen();
+ }
+ return false;
+ };
+ this.getScriptSnapshot = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return getScriptSnapShot(script);
+ }
+ return null;
+ };
+ this.getCurrentDirectory = function () {
+ return _this.config.projectFileDirectory;
+ };
+ this.getDefaultLibFileName = function () {
+ return 'lib.d.ts';
+ };
+ config.project.files.forEach(function (file) { return _this.addScript(file); });
+ this.addScript(exports.defaultLibFile);
+ }
+ return LanguageServiceHost;
+})();
+exports.LanguageServiceHost = LanguageServiceHost;
+//# sourceMappingURL=languageServiceHost2.js.map
\ No newline at end of file
diff --git a/dist/main/lang/languageServiceHost2.js.map b/dist/main/lang/languageServiceHost2.js.map
new file mode 100644
index 000000000..0e6a119a6
--- /dev/null
+++ b/dist/main/lang/languageServiceHost2.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"languageServiceHost2.js","sourceRoot":"","sources":["../../../lib/main/lang/languageServiceHost2.ts"],"names":["createScriptInfo","createScriptInfo.getLineStarts","createScriptInfo.updateContent","createScriptInfo.editContent","createScriptInfo.getPositionFromLine","createScriptInfo.getLineAndColForPositon","getScriptSnapShot","getScriptSnapShot.getChangeRange","getScriptSnapShot.getChangeRange.collapseChangesAcrossMultipleVersions","LanguageServiceHost","LanguageServiceHost.constructor"],"mappings":"AAEA,YAAY,CAAC;AAGb,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,UAAU,W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,2BAAmB,GAAnB,mBAuIZ,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/languageServiceHostOld.js b/dist/main/lang/languageServiceHostOld.js
new file mode 100644
index 000000000..1cf2b0ce8
--- /dev/null
+++ b/dist/main/lang/languageServiceHostOld.js
@@ -0,0 +1,230 @@
+'use strict';
+var ts = require('typescript');
+var path = require('path');
+var utils = require('./utils');
+var fs = require('fs');
+function createScriptInfo(fileName, content, isOpen) {
+ if (isOpen === void 0) { isOpen = false; }
+ var version = 1;
+ var editRanges = [];
+ var _lineStarts;
+ var _lineStartIsDirty = true;
+ function getLineStarts() {
+ if (_lineStartIsDirty) {
+ _lineStarts = ts.computeLineStarts(content);
+ _lineStartIsDirty = false;
+ }
+ return _lineStarts;
+ }
+ function updateContent(newContent) {
+ content = newContent;
+ _lineStartIsDirty = true;
+ editRanges = [];
+ version++;
+ }
+ function editContent(minChar, limChar, newText) {
+ var prefix = content.substring(0, minChar);
+ var middle = newText;
+ var suffix = content.substring(limChar);
+ content = prefix + middle + suffix;
+ _lineStartIsDirty = true;
+ editRanges.push({
+ span: { start: minChar, length: limChar - minChar },
+ newLength: newText.length
+ });
+ version++;
+ }
+ function getPositionFromLine(line, ch) {
+ return getLineStarts()[line] + ch;
+ }
+ function getLineAndColForPositon(position) {
+ if (position < 0 || position > content.length) {
+ throw new RangeError('Argument out of range: position');
+ }
+ var lineStarts = getLineStarts();
+ var lineNumber = utils.binarySearch(lineStarts, position);
+ if (lineNumber < 0) {
+ lineNumber = (~lineNumber) - 1;
+ }
+ return {
+ line: lineNumber,
+ ch: position - lineStarts[lineNumber]
+ };
+ }
+ return {
+ getFileName: function () { return fileName; },
+ getContent: function () { return content; },
+ getVersion: function () { return version; },
+ getIsOpen: function () { return isOpen; },
+ setIsOpen: function (val) { return isOpen = val; },
+ getEditRanges: function () { return editRanges; },
+ getLineStarts: getLineStarts,
+ updateContent: updateContent,
+ editContent: editContent,
+ getPositionFromLine: getPositionFromLine,
+ getLineAndColForPositon: getLineAndColForPositon
+ };
+}
+function getScriptSnapShot(scriptInfo) {
+ var lineStarts = scriptInfo.getLineStarts();
+ var textSnapshot = scriptInfo.getContent();
+ var version = scriptInfo.getVersion();
+ var editRanges = scriptInfo.getEditRanges();
+ function getChangeRange(oldSnapshot) {
+ var unchanged = { span: { start: 0, length: 0 }, newLength: 0 };
+ function collapseChangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return unchanged;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = change0.span.start + change0.span.length;
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = nextChange.span.start + nextChange.span.length;
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return { span: { start: oldStartN, length: oldEndN - oldStartN }, newLength: newEndN - oldStartN };
+ }
+ ;
+ var scriptVersion = oldSnapshot.version || 0;
+ if (scriptVersion === version) {
+ return unchanged;
+ }
+ var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
+ if (initialEditRangeIndex < 0) {
+ return null;
+ }
+ var entries = editRanges.slice(initialEditRangeIndex);
+ return collapseChangesAcrossMultipleVersions(entries);
+ }
+ return {
+ getText: function (start, end) { return textSnapshot.substring(start, end); },
+ getLength: function () { return textSnapshot.length; },
+ getChangeRange: getChangeRange,
+ getLineStartPositions: function () { return lineStarts; },
+ version: version
+ };
+}
+exports.defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
+var LanguageServiceHost = (function () {
+ function LanguageServiceHost(config) {
+ var _this = this;
+ this.config = config;
+ this.fileNameToScript = Object.create(null);
+ this.addScript = function (fileName, content) {
+ try {
+ if (!content)
+ content = fs.readFileSync(fileName).toString();
+ }
+ catch (ex) {
+ content = '';
+ }
+ var script = createScriptInfo(fileName, content);
+ _this.fileNameToScript[fileName] = script;
+ };
+ this.removeScript = function (fileName) {
+ delete _this.fileNameToScript[fileName];
+ };
+ this.removeAll = function () {
+ _this.fileNameToScript = Object.create(null);
+ };
+ this.updateScript = function (fileName, content) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.updateContent(content);
+ return;
+ }
+ else {
+ _this.addScript(fileName, content);
+ }
+ };
+ this.editScript = function (fileName, minChar, limChar, newText) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.editContent(minChar, limChar, newText);
+ return;
+ }
+ throw new Error('No script with name \'' + fileName + '\'');
+ };
+ this.setScriptIsOpen = function (fileName, isOpen) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ script.setIsOpen(isOpen);
+ return;
+ }
+ throw new Error('No script with name \'' + fileName + '\'');
+ };
+ this.getScriptContent = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getContent();
+ }
+ return null;
+ };
+ this.hasScript = function (fileName) {
+ return !!_this.fileNameToScript[fileName];
+ };
+ this.getIndexFromPosition = function (fileName, position) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getPositionFromLine(position.line, position.ch);
+ }
+ return -1;
+ };
+ this.getPositionFromIndex = function (fileName, index) {
+ if (!_this.fileNameToScript[fileName])
+ _this.addScript(fileName);
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getLineAndColForPositon(index);
+ }
+ return null;
+ };
+ this.getCompilationSettings = function () { return _this.config.project.compilerOptions; };
+ this.getScriptFileNames = function () { return Object.keys(_this.fileNameToScript); };
+ this.getScriptVersion = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return '' + script.getVersion();
+ }
+ return '0';
+ };
+ this.getScriptIsOpen = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return script.getIsOpen();
+ }
+ return false;
+ };
+ this.getScriptSnapshot = function (fileName) {
+ var script = _this.fileNameToScript[fileName];
+ if (script) {
+ return getScriptSnapShot(script);
+ }
+ return null;
+ };
+ this.getCurrentDirectory = function () {
+ return _this.config.projectFileDirectory;
+ };
+ this.getDefaultLibFileName = function () {
+ return 'lib.d.ts';
+ };
+ config.project.files.forEach(function (file) { return _this.addScript(file); });
+ this.addScript(exports.defaultLibFile);
+ }
+ return LanguageServiceHost;
+})();
+exports.LanguageServiceHost = LanguageServiceHost;
+//# sourceMappingURL=languageServiceHostOld.js.map
\ No newline at end of file
diff --git a/dist/main/lang/languageServiceHostOld.js.map b/dist/main/lang/languageServiceHostOld.js.map
new file mode 100644
index 000000000..ea13c2e96
--- /dev/null
+++ b/dist/main/lang/languageServiceHostOld.js.map
@@ -0,0 +1 @@
+{"version":3,"file":"languageServiceHostOld.js","sourceRoot":"","sources":["../../../lib/main/lang/languageServiceHostOld.ts"],"names":["createScriptInfo","createScriptInfo.getLineStarts","createScriptInfo.updateContent","createScriptInfo.editContent","createScriptInfo.getPositionFromLine","createScriptInfo.getLineAndColForPositon","getScriptSnapShot","getScriptSnapShot.getChangeRange","getScriptSnapShot.getChangeRange.collapseChangesAcrossMultipleVersions","LanguageServiceHost","LanguageServiceHost.constructor"],"mappings":"AAsBA,YAAY,CAAC;AAEb,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,KAAK,WAAW,SAAS,CAAC,CAAC;AAClC,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AA6B1B,SAAS,gBAAgB,CAAC,QAAgB,EAAE,OAAe,EAAE,MAAc;IAAdA,sBAAcA,GAAdA,cAAcA;IAGvEA,IAAIA,OAAOA,GAAWA,CAACA,CAACA;IAC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MA,CAACA,MAAMA,CAACA,SAASA,EAAEA,CAACA;YAC9BA,CAACA;YACDA,MAAMA,CAACA,KAAKA,CAACA;QACjBA,CAACA,CAAAA;QACDA,sBAAiBA,GAAGA,UAACA,QAAgBA;YACjCA,IAAIA,MAAMA,GAAGA,KAAIA,CAACA,gBAAgBA,CAACA,QAAQA,CAACA,CAACA;YAC7CA,EAAEA,CAACA,CAACA,MAAMA,CAACA,CAACA,CAACA;gBACTA,MAAMA,CAACA,iBAAiBA,CAACA,MAAMA,CAACA,CAACA;YACrCA,CAACA;YACDA,MAAMA,CAACA,IAAIA,CAACA;QAChBA,CAACA,CAAAA;QACDA,wBAAmBA,GAAGA;YAClBA,MAAMA,CAACA,KAAIA,CAACA,MAAMA,CAACA,oBAAoBA,CAACA;QAC5CA,CAACA,CAAAA;QACDA,0BAAqBA,GAAGA;YACpBA,MAAMA,CAACA,UAAUA,CAACA;QACtBA,CAACA,CAAAA;QA7HGA,MAAMA,CAACA,OAAOA,CAACA,KAAKA,CAACA,OAAOA,CAACA,UAACA,IAAIA,IAAKA,OAAAA,KAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,EAApBA,CAAoBA,CAACA,CAACA;QAG7DA,IAAIA,CAACA,SAASA,CAACA,sBAAcA,CAACA,CAACA;IACnCA,CAACA;IA0HLD,0BAACA;AAADA,CAACA,AAvID,IAuIC;AAvIY,2BAAmB,GAAnB,mBAuIZ,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/project.js b/dist/main/lang/project.js
index 0f2b5990f..9b6f445b1 100644
--- a/dist/main/lang/project.js
+++ b/dist/main/lang/project.js
@@ -2,7 +2,7 @@ var ts = require('typescript');
var path = require('path');
var mkdirp = require('mkdirp');
var fs = require('fs');
-var languageServiceHost = require('./languageServiceHost');
+exports.languageServiceHost = require('./languageServiceHost2');
var utils = require('./utils');
var Project = (function () {
function Project(projectFile) {
@@ -11,17 +11,15 @@ var Project = (function () {
this.emitFile = function (filePath) {
var services = _this.languageService;
var output = services.getEmitOutput(filePath);
- var success = output.emitOutputStatus === ts.EmitReturnStatus.Succeeded;
+ var emitDone = !output.emitSkipped;
var errors = [];
- if (!success) {
- var allDiagnostics = services.getCompilerOptionsDiagnostics().concat(services.getSyntacticDiagnostics(filePath)).concat(services.getSemanticDiagnostics(filePath));
- allDiagnostics.forEach(function (diagnostic) {
- if (!diagnostic.file)
- return;
- var startPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
- errors.push(diagnosticToTSError(diagnostic));
- });
- }
+ var allDiagnostics = services.getCompilerOptionsDiagnostics().concat(services.getSyntacticDiagnostics(filePath)).concat(services.getSemanticDiagnostics(filePath));
+ allDiagnostics.forEach(function (diagnostic) {
+ if (!diagnostic.file)
+ return;
+ var startPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
+ errors.push(diagnosticToTSError(diagnostic));
+ });
output.outputFiles.forEach(function (o) {
mkdirp.sync(path.dirname(o.name));
fs.writeFileSync(o.name, o.text, "utf8");
@@ -32,12 +30,12 @@ var Project = (function () {
}
return {
outputFiles: outputFiles,
- success: success,
+ success: emitDone && !errors.length,
errors: errors,
- emitError: !success && outputFiles.length === 0
+ emitError: !emitDone
};
};
- this.languageServiceHost = new languageServiceHost.LanguageServiceHost(projectFile);
+ this.languageServiceHost = new exports.languageServiceHost.LanguageServiceHost(projectFile);
this.languageService = ts.createLanguageService(this.languageServiceHost, ts.createDocumentRegistry());
}
Project.prototype.build = function () {
@@ -56,17 +54,16 @@ var Project = (function () {
};
};
Project.prototype.formatDocument = function (filePath, cursor) {
- var textChanges = this.languageService.getFormattingEditsForDocument(filePath, this.projectFile.project.format);
+ var textChanges = this.languageService.getFormattingEditsForDocument(filePath, this.projectFile.project.formatCodeOptions);
var formatted = this.formatCode(this.languageServiceHost.getScriptContent(filePath), textChanges);
var newCursor = this.formatCursor(this.languageServiceHost.getIndexFromPosition(filePath, cursor), textChanges);
- this.languageServiceHost.updateScript(filePath, formatted);
return { formatted: formatted, cursor: this.languageServiceHost.getPositionFromIndex(filePath, newCursor) };
};
Project.prototype.formatDocumentRange = function (filePath, start, end) {
var st = this.languageServiceHost.getIndexFromPosition(filePath, start);
var ed = this.languageServiceHost.getIndexFromPosition(filePath, end);
- var textChanges = this.languageService.getFormattingEditsForRange(filePath, st, ed, this.projectFile.project.format);
- textChanges.forEach(function (change) { return change.span = new ts.TextSpan(change.span.start() - st, change.span.length()); });
+ var textChanges = this.languageService.getFormattingEditsForRange(filePath, st, ed, this.projectFile.project.formatCodeOptions);
+ textChanges.forEach(function (change) { return change.span = { start: change.span.start - st, length: change.span.length }; });
var formatted = this.formatCode(this.languageServiceHost.getScriptContent(filePath).substring(st, ed), textChanges);
return formatted;
};
@@ -74,34 +71,34 @@ var Project = (function () {
var result = orig;
for (var i = changes.length - 1; i >= 0; i--) {
var change = changes[i];
- var head = result.slice(0, change.span.start());
- var tail = result.slice(change.span.start() + change.span.length());
+ var head = result.slice(0, change.span.start);
+ var tail = result.slice(change.span.start + change.span.length);
result = head + change.newText + tail;
}
return result;
};
Project.prototype.formatCursor = function (cursor, changes) {
- var cursorInsideChange = changes.filter(function (change) { return (change.span.start() < cursor) && ((change.span.end()) > cursor); })[0];
+ var cursorInsideChange = changes.filter(function (change) { return (change.span.start < cursor) && ((change.span.start + change.span.length) > cursor); })[0];
if (cursorInsideChange) {
- cursor = cursorInsideChange.span.end();
+ cursor = cursorInsideChange.span.start + cursorInsideChange.span.length;
}
- var beforeCursorChanges = changes.filter(function (change) { return change.span.start() < cursor; });
+ var beforeCursorChanges = changes.filter(function (change) { return change.span.start < cursor; });
var netChange = 0;
- beforeCursorChanges.forEach(function (change) { return netChange = netChange - (change.span.length() - change.newText.length); });
+ beforeCursorChanges.forEach(function (change) { return netChange = netChange - (change.span.length - change.newText.length); });
return cursor + netChange;
};
return Project;
})();
exports.Project = Project;
function diagnosticToTSError(diagnostic) {
- var filePath = diagnostic.file.filename;
- var startPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
- var endPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start + diagnostic.length);
+ var filePath = diagnostic.file.fileName;
+ var startPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
+ var endPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start + diagnostic.length);
return {
filePath: filePath,
- startPos: { line: startPosition.line - 1, ch: startPosition.character - 1 },
- endPos: { line: endPosition.line - 1, ch: endPosition.character - 1 },
- message: diagnostic.messageText,
+ startPos: { line: startPosition.line, ch: startPosition.character },
+ endPos: { line: endPosition.line, ch: endPosition.character },
+ message: ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'),
preview: diagnostic.file.text.substr(diagnostic.start, diagnostic.length),
};
}
diff --git a/dist/main/lang/project.js.map b/dist/main/lang/project.js.map
index 2529a6012..483e80975 100644
--- a/dist/main/lang/project.js.map
+++ b/dist/main/lang/project.js.map
@@ -1 +1 @@
-{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../lib/main/lang/project.ts"],"names":["Project","Project.constructor","Project.build","Project.formatDocument","Project.formatDocumentRange","Project.formatCode","Project.formatCursor","diagnosticToTSError"],"mappings":"AAGA,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAClC,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAG1B,IAAO,mBAAmB,WAAW,uBAAuB,CAAC,CAAC;AAE9D,IAAO,KAAK,WAAW,SAAS,CAAC,CAAC;AAElC,IAAa,OAAO;IAIhBA,SAJSA,OAAOA,CAIGA,WAAkDA;QAJzEC,iBA+GCA;QA3GsBA,gBAAWA,GAAXA,WAAWA,CAAuCA;QAqBrEA,aAAQA,GAAGA,UAACA,QAAgBA;YACxBA,IAAIA,QAAQA,GAAGA,KAAIA,CAACA,eAAeA,CAACA;YACpCA,IAAIA,MAAMA,GAAGA,QAAQA,CAACA,aA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Y,eAAO,GAAP,OA+GZ,CAAA;AA0BD,SAAgB,mBAAmB,CAAC,UAAyB;IACzDO,IAAIA,QAAQA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACxCA,IAAIA,aAAaA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,+BAA+BA,CAACA,UAAUA,CAACA,KAAKA,CAACA,CAACA;IACtFA,IAAIA,WAAWA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,+BAA+BA,CAACA,UAAUA,CAACA,KAAKA,GAAGA,UAAUA,CAACA,MAAMA,CAACA,CAACA;IACxGA,MAAMA,CAACA;QACHA,QAAQA,EAAEA,QAAQA;QAElBA,QAAQA,EAAEA,EAAEA,IAAIA,EAAEA,aAAaA,CAACA,IAAIA,GAAGA,CAACA,EAAEA,EAAEA,EAAEA,aAAaA,CAACA,SAASA,GAAGA,CAACA,EAAEA;QAC3EA,MAAMA,EAAEA,EAAEA,IAAIA,EAAEA,WAAWA,CAACA,IAAIA,GAAGA,CAACA,EAAEA,EAAEA,EAAEA,WAAWA,CAACA,SAASA,GAAGA,CAACA,EAAEA;QACrEA,OAAOA,EAAEA,UAAUA,CAACA,WAAWA;QAC/BA,OAAOA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,CAACA,UAAUA,CAACA,KAAKA,EAAEA,UAAUA,CAACA,MAAMA,CAACA;KAC5EA,CAACA;AACNA,CAACA;AAZe,2BAAmB,GAAnB,mBAYf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../lib/main/lang/project.ts"],"names":["Project","Project.constructor","Project.build","Project.formatDocument","Project.formatDocumentRange","Project.formatCode","Project.formatCursor","diagnosticToTSError"],"mappings":"AAGA,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAO,MAAM,WAAW,QAAQ,CAAC,CAAC;AAClC,IAAO,EAAE,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MAAMA,GAAGA,MAAMA,CAACA,OAAOA,CAACA,MAAMA,CAACA,EAApEA,CAAoEA,CAACA,CAACA;QAE5GA,MAAMA,CAACA,MAAMA,GAAGA,SAASA,CAACA;IAC9BA,CAACA;IACLN,cAACA;AAADA,CAACA,AA7GD,IA6GC;AA7GY,eAAO,GAAP,OA6GZ,CAAA;AA0BD,SAAgB,mBAAmB,CAAC,UAAyB;IACzDO,IAAIA,QAAQA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACxCA,IAAIA,aAAaA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,6BAA6BA,CAACA,UAAUA,CAACA,KAAKA,CAACA,CAACA;IACpFA,IAAIA,WAAWA,GAAGA,UAAUA,CAACA,IAAIA,CAACA,6BAA6BA,CAACA,UAAUA,CAACA,KAAKA,GAAGA,UAAUA,CAACA,MAAMA,CAACA,CAACA;IAEtGA,MAAMA,CAACA;QACHA,QAAQA,EAAEA,QAAQA;QAClBA,QAAQA,EAAEA,EAAEA,IAAIA,EAAEA,aAAaA,CAACA,IAAIA,EAAEA,EAAEA,EAAEA,aAAaA,CAACA,SAASA,EAAEA;QACnEA,MAAMA,EAAEA,EAAEA,IAAIA,EAAEA,WAAWA,CAACA,IAAIA,EAAEA,EAAEA,EAAEA,WAAWA,CAACA,SAASA,EAAEA;QAC7DA,OAAOA,EAAEA,EAAEA,CAACA,4BAA4BA,CAACA,UAAUA,CAACA,WAAWA,EAAEA,IAAIA,CAACA;QACtEA,OAAOA,EAAEA,UAAUA,CAACA,IAAIA,CAACA,IAAIA,CAACA,MAAMA,CAACA,UAAUA,CAACA,KAAKA,EAAEA,UAAUA,CAACA,MAAMA,CAACA;KAC5EA,CAACA;AACNA,CAACA;AAZe,2BAAmB,GAAnB,mBAYf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/projectService.js b/dist/main/lang/projectService.js
index 3a1cabed2..b63073653 100644
--- a/dist/main/lang/projectService.js
+++ b/dist/main/lang/projectService.js
@@ -6,6 +6,7 @@ var tsconfig = require('../tsconfig/tsconfig');
var utils = require('./utils');
var project = require('./project');
var Project = project.Project;
+var languageServiceHost = project.languageServiceHost;
var resolve = Promise.resolve.bind(Promise);
var queryParent = require('../../worker/queryParent');
var child;
@@ -13,13 +14,18 @@ function fixChild(childInjected) {
child = childInjected;
queryParent.echoNumWithModification = child.sendToIpc(queryParent.echoNumWithModification);
queryParent.getUpdatedTextForUnsavedEditors = child.sendToIpc(queryParent.getUpdatedTextForUnsavedEditors);
- queryParent.setProjectFileParsedResult = child.sendToIpc(queryParent.setProjectFileParsedResult);
+ queryParent.getOpenEditorPaths = child.sendToIpc(queryParent.getOpenEditorPaths);
+ queryParent.setConfigurationError = child.sendToIpc(queryParent.setConfigurationError);
+ queryParent.notifySuccess = child.sendToIpc(queryParent.notifySuccess);
}
exports.fixChild = fixChild;
var projectByProjectFilePath = {};
var projectByFilePath = {};
var watchingProjectFile = {};
function watchProjectFileIfNotDoingItAlready(projectFilePath) {
+ if (!fs.existsSync(projectFilePath)) {
+ return;
+ }
if (watchingProjectFile[projectFilePath])
return;
watchingProjectFile[projectFilePath] = true;
@@ -36,58 +42,100 @@ function watchProjectFileIfNotDoingItAlready(projectFilePath) {
try {
var projectFile = getOrCreateProjectFile(projectFilePath);
cacheAndCreateProject(projectFile);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
}
catch (ex) {
}
});
}
+var chokidar = require('chokidar');
+var watchingTheFilesInTheProject = {};
+function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile) {
+ var projectFilePath = projectFile.projectFilePath;
+ if (!fs.existsSync(projectFilePath)) {
+ return;
+ }
+ if (watchingTheFilesInTheProject[projectFilePath])
+ return;
+ watchingTheFilesInTheProject[projectFilePath] = true;
+ var watcher = chokidar.watch(projectFile.project.files || projectFile.project.filesGlob);
+ watcher.on('add', function () {
+ });
+ watcher.on('unlink', function (filePath) {
+ });
+ watcher.on('change', function (filePath) {
+ filePath = tsconfig.consistentPath(filePath);
+ queryParent.getOpenEditorPaths({}).then(function (res) {
+ var openPaths = res.filePaths;
+ if (openPaths.some(function (x) { return x == filePath; })) {
+ return;
+ }
+ var project = projectByFilePath[filePath];
+ if (!project) {
+ return;
+ }
+ var contents = fs.readFileSync(filePath).toString();
+ project.languageServiceHost.updateScript(filePath, contents);
+ });
+ });
+}
function cacheAndCreateProject(projectFile) {
var project = projectByProjectFilePath[projectFile.projectFilePath] = new Project(projectFile);
projectFile.project.files.forEach(function (file) { return projectByFilePath[file] = project; });
queryParent.getUpdatedTextForUnsavedEditors({}).then(function (resp) {
resp.editors.forEach(function (e) {
+ consistentPath(e);
project.languageServiceHost.updateScript(e.filePath, e.text);
});
});
watchProjectFileIfNotDoingItAlready(projectFile.projectFilePath);
+ watchTheFilesInTheProjectIfNotDoingItAlready(projectFile);
return project;
}
function getOrCreateProjectFile(filePath) {
try {
+ if (path.dirname(filePath) == path.dirname(languageServiceHost.defaultLibFile)) {
+ return tsconfig.getDefaultProject(filePath);
+ }
var projectFile = tsconfig.getProjectSync(filePath);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
return projectFile;
}
catch (ex) {
var err = ex;
if (err.message === tsconfig.errors.GET_PROJECT_NO_PROJECT_FOUND) {
- var projectFile = tsconfig.createProjectRootSync(filePath);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
- return projectFile;
+ if (tsconfig.endsWith(filePath.toLowerCase(), '.d.ts')) {
+ return tsconfig.getDefaultProject(filePath);
+ }
+ else {
+ var projectFile = tsconfig.createProjectRootSync(filePath);
+ queryParent.notifySuccess({ message: 'AtomTS: tsconfig.json file created:
' + projectFile.projectFilePath });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
+ return projectFile;
+ }
}
else {
if (ex.message === tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
- var invalidJSONErrorDetails = ex.details;
- queryParent.setProjectFileParsedResult({
- projectFilePath: invalidJSONErrorDetails.projectFilePath,
+ var details = ex.details;
+ queryParent.setConfigurationError({
+ projectFilePath: details.projectFilePath,
error: {
message: ex.message,
details: ex.details
}
});
- watchProjectFileIfNotDoingItAlready(invalidJSONErrorDetails.projectFilePath);
+ watchProjectFileIfNotDoingItAlready(details.projectFilePath);
}
if (ex.message === tsconfig.errors.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS) {
- var invalidOptionDetails = ex.details;
- queryParent.setProjectFileParsedResult({
- projectFilePath: invalidOptionDetails.projectFilePath,
+ var _details = ex.details;
+ queryParent.setConfigurationError({
+ projectFilePath: _details.projectFilePath,
error: {
message: ex.message,
- details: ex.details
+ _details: ex.details
}
});
- watchProjectFileIfNotDoingItAlready(invalidOptionDetails.projectFilePath);
+ watchProjectFileIfNotDoingItAlready(_details.projectFilePath);
}
throw ex;
}
@@ -106,10 +154,15 @@ function getOrCreateProject(filePath) {
}
function textSpan(span) {
return {
- start: span.start(),
- length: span.length()
+ start: span.start,
+ length: span.length
};
}
+function consistentPath(query) {
+ if (!query.filePath)
+ return;
+ query.filePath = tsconfig.consistentPath(query.filePath);
+}
function echo(data) {
return queryParent.echoNumWithModification({ num: data.num }).then(function (resp) {
data.num = resp.num;
@@ -118,6 +171,7 @@ function echo(data) {
}
exports.echo = echo;
function quickInfo(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var info = project.languageService.getQuickInfoAtPosition(query.filePath, query.position);
if (!info)
@@ -131,19 +185,24 @@ function quickInfo(query) {
}
exports.quickInfo = quickInfo;
function build(query) {
+ consistentPath(query);
return resolve({
outputs: getOrCreateProject(query.filePath).build()
});
}
exports.build = build;
function errorsForFileFiltered(query) {
+ consistentPath(query);
var fileName = path.basename(query.filePath);
- return errorsForFile({ filePath: query.filePath }).then(function (resp) { return { errors: resp.errors.filter(function (error) { return path.basename(error.filePath) == fileName; }) }; });
+ return errorsForFile({ filePath: query.filePath }).then(function (resp) {
+ return { errors: resp.errors.filter(function (error) { return path.basename(error.filePath) == fileName; }) };
+ });
}
exports.errorsForFileFiltered = errorsForFileFiltered;
var punctuations = utils.createMap([';', '{', '}', '(', ')', '.', ':', '<', '>', "'", '"']);
var prefixEndsInPunctuation = function (prefix) { return prefix.length && prefix.trim().length && punctuations[prefix.trim()[prefix.trim().length - 1]]; };
function getCompletionsAtPosition(query) {
+ consistentPath(query);
var filePath = query.filePath, position = query.position, prefix = query.prefix;
var project = getOrCreateProject(filePath);
var completions = project.languageService.getCompletionsAtPosition(filePath, position);
@@ -184,6 +243,7 @@ function getCompletionsAtPosition(query) {
}
exports.getCompletionsAtPosition = getCompletionsAtPosition;
function getSignatureHelps(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var signatureHelpItems = project.languageService.getSignatureHelpItems(query.filePath, query.position);
if (!signatureHelpItems || !signatureHelpItems.items || !signatureHelpItems.items.length)
@@ -192,20 +252,24 @@ function getSignatureHelps(query) {
}
exports.getSignatureHelps = getSignatureHelps;
function emitFile(query) {
+ consistentPath(query);
return resolve(getOrCreateProject(query.filePath).emitFile(query.filePath));
}
exports.emitFile = emitFile;
function formatDocument(query) {
+ consistentPath(query);
var prog = getOrCreateProject(query.filePath);
return resolve(prog.formatDocument(query.filePath, query.cursor));
}
exports.formatDocument = formatDocument;
function formatDocumentRange(query) {
+ consistentPath(query);
var prog = getOrCreateProject(query.filePath);
return resolve({ formatted: prog.formatDocumentRange(query.filePath, query.start, query.end) });
}
exports.formatDocumentRange = formatDocumentRange;
function getDefinitionsAtPosition(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var definitions = project.languageService.getDefinitionAtPosition(query.filePath, query.position);
var projectFileDirectory = project.projectFile.projectFileDirectory;
@@ -214,7 +278,7 @@ function getDefinitionsAtPosition(query) {
return resolve({
projectFileDirectory: projectFileDirectory,
definitions: definitions.map(function (d) {
- var pos = project.languageServiceHost.getPositionFromIndex(d.fileName, d.textSpan.start());
+ var pos = project.languageServiceHost.getPositionFromIndex(d.fileName, d.textSpan.start);
return {
filePath: d.fileName,
position: pos
@@ -224,11 +288,19 @@ function getDefinitionsAtPosition(query) {
}
exports.getDefinitionsAtPosition = getDefinitionsAtPosition;
function updateText(query) {
+ consistentPath(query);
getOrCreateProject(query.filePath).languageServiceHost.updateScript(query.filePath, query.text);
return resolve({});
}
exports.updateText = updateText;
+function editText(query) {
+ consistentPath(query);
+ getOrCreateProject(query.filePath).languageServiceHost.editScript(query.filePath, query.minChar, query.limChar, query.newText);
+ return resolve({});
+}
+exports.editText = editText;
function errorsForFile(query) {
+ consistentPath(query);
var program = getOrCreateProject(query.filePath);
var diagnostics = program.languageService.getSyntacticDiagnostics(query.filePath);
if (diagnostics.length === 0) {
@@ -238,15 +310,16 @@ function errorsForFile(query) {
}
exports.errorsForFile = errorsForFile;
function getRenameInfo(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var findInStrings = false, findInComments = false;
var info = project.languageService.getRenameInfo(query.filePath, query.position);
if (info && info.canRename) {
- var locations = project.languageService.findRenameLocations(query.filePath, query.position, findInStrings, findInComments).map(function (loc) {
- return {
- textSpan: textSpan(loc.textSpan),
- filePath: loc.fileName
- };
+ var locations = {};
+ project.languageService.findRenameLocations(query.filePath, query.position, findInStrings, findInComments).forEach(function (loc) {
+ if (!locations[loc.fileName])
+ locations[loc.fileName] = [];
+ locations[loc.fileName].unshift(textSpan(loc.textSpan));
});
return resolve({
canRename: true,
@@ -271,8 +344,8 @@ function filePathWithoutExtension(query) {
return path.dirname(query) + '/' + base;
}
function getRelativePathsInProject(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
- query.filePath = tsconfig.consistentPath(query.filePath);
var sourceDir = path.dirname(query.filePath);
var filePaths = project.projectFile.project.files.filter(function (p) { return p !== query.filePath; });
var files = filePaths.map(function (p) {
@@ -293,9 +366,22 @@ function getRelativePathsInProject(query) {
}
exports.getRelativePathsInProject = getRelativePathsInProject;
function getIndentationAtPosition(query) {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
- var indent = project.languageService.getIndentationAtPosition(query.filePath, query.position, project.projectFile.project.format);
+ var indent = project.languageService.getIndentationAtPosition(query.filePath, query.position, project.projectFile.project.formatCodeOptions);
return resolve({ indent: indent });
}
exports.getIndentationAtPosition = getIndentationAtPosition;
+function debugLanguageServiceHostVersion(query) {
+ consistentPath(query);
+ var project = getOrCreateProject(query.filePath);
+ return resolve({ text: project.languageServiceHost.getScriptContent(query.filePath) });
+}
+exports.debugLanguageServiceHostVersion = debugLanguageServiceHostVersion;
+function getProjectFileDetails(query) {
+ consistentPath(query);
+ var project = getOrCreateProject(query.filePath);
+ return resolve(project.projectFile);
+}
+exports.getProjectFileDetails = getProjectFileDetails;
//# sourceMappingURL=projectService.js.map
\ No newline at end of file
diff --git a/dist/main/lang/projectService.js.map b/dist/main/lang/projectService.js.map
index 43452ec02..84cfbdd1b 100644
--- a/dist/main/lang/projectService.js.map
+++ b/dist/main/lang/projectService.js.map
@@ -1 +1 @@
-{"version":3,"file":"projectService.js","sourceRoot":"","sources":["../../../lib/main/lang/projectService.ts"],"names":["fixChild","watchProjectFileIfNotDoingItAlready","cacheAndCreateProject","getOrCreateProjectFile","getOrCreateProject","textSpan","echo","quickInfo","build","errorsForFileFiltered","getCompletionsAtPosition","getCompletionsAtPosition.docComment","getSignatureHelps","emitFile","formatDocument","formatDocumentRange","getDefinitionsAtPosition","updateText","errorsForFile","getRenameInfo","filePathWithoutExtension","getRelativePathsInProject","getIndentationAtPosition"],"mappings":"AAGA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAI,UAAU,GAAiF,OAAO,CAAC,YAAY,CAAC,CAAC;AAErH,IAAO,QAAQ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EA,OAAOA,CAACA,WAAWA,CAACA,OAAOA,CAACA,MAAMA,CAACA,CAACA;IAElIA,MAAMA,CAACA,OAAOA,CAACA,EAAEA,MAAMA,QAAAA,EAAEA,CAACA,CAACA;AAC/BA,CAACA;AALe,gCAAwB,GAAxB,wBAKf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"projectService.js","sourceRoot":"","sources":["../../../lib/main/lang/projectService.ts"],"names":["fixChild","watchProjectFileIfNotDoingItAlready","watchTheFilesInTheProjectIfNotDoingItAlready","cacheAndCreateProject","getOrCreateProjectFile","getOrCreateProject","textSpan","consistentPath","echo","quickInfo","build","errorsForFileFiltered","getCompletionsAtPosition","getCompletionsAtPosition.docComment","getSignatureHelps","emitFile","formatDocument","formatDocumentRange","getDefinitionsAtPosition","updateText","editText","errorsForFile","getRenameInfo","filePathWithoutExtension","getRelativePathsInProject","getIndentationAtPosition","debugLanguageServiceHostVersion","getProjectFileDetails"],"mappings":"AAGA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,IAAO,EAAE,WAAW,YAAY,CAAC,CAAC;AAClC,IAAI,UAAU,GAAiF,OAAO,CAAC,YAAY,CAAC,CAAC;AAErH,IAAO,QAAQ,WAAW,sBAAsB,CAAC,CAAC;AAElD,IAAO,KAAK,WAAW,SAAS,CAAC,CAAC;AAClC,IAAO,OAAO,WAAW,WAAW,CAAC,CAAC;AACtC,IAAO,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;AACjC,IAAO,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AAEzD,IAAI,OAAO,GAA2B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAOpE,IAAO,WAAW,WAAW,0BAA0B,CAAC,CAAC;AAKzD,IAAI,KAAsB,CAAC;AAC3B,SAAgB,QAAQ,CAAC,aAA2B;IAChDA,KAAKA,GAAGA,aAAaA,CAACA;IACtB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,CAACA,EAAEA,IAAIA,EAAEA,OAAOA,CAACA,mBAAmBA,CAACA,gBAAgBA,CAACA,KAAKA,CAACA,QAAQA,CAACA,EAAEA,CAACA,CAACA;AAC3FA,CAACA;AAJe,uCAA+B,GAA/B,+BAIf,CAAA;AAID,SAAgB,qBAAqB,CAAC,KAAiC;IACnEC,cAAcA,CAACA,KAAKA,CAACA,CAACA;IACtBA,IAAIA,OAAOA,GAAGA,kBAAkBA,CAACA,KAAKA,CAACA,QAAQA,CAACA,CAACA;IACjDA,MAAMA,CAACA,OAAOA,CAACA,OAAOA,CAACA,WAAWA,CAACA,CAACA;AACxCA,CAACA;AAJe,6BAAqB,GAArB,qBAIf,CAAA"}
\ No newline at end of file
diff --git a/dist/main/lang/utils.js b/dist/main/lang/utils.js
index b7e24fe0d..fbb93208f 100644
--- a/dist/main/lang/utils.js
+++ b/dist/main/lang/utils.js
@@ -125,18 +125,12 @@ var Dict = (function () {
Dict.prototype.setValue = function (key, item) {
this.table[key] = item;
};
- Dict.prototype.getValue = function (key) {
- return this.table[key];
- };
+ Dict.prototype.getValue = function (key) { return this.table[key]; };
Dict.prototype.clearValue = function (key) {
delete this.table[key];
};
- Dict.prototype.clearAll = function () {
- this.table = Object.create(null);
- };
- Dict.prototype.keys = function () {
- return Object.keys(this.table);
- };
+ Dict.prototype.clearAll = function () { this.table = Object.create(null); };
+ Dict.prototype.keys = function () { return Object.keys(this.table); };
Dict.prototype.values = function () {
var array = [];
for (var key in this.table) {
diff --git a/dist/main/lang/utils.js.map b/dist/main/lang/utils.js.map
index 22118f910..fb9acb7c6 100644
--- a/dist/main/lang/utils.js.map
+++ b/dist/main/lang/utils.js.map
@@ -1 +1 @@
-{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/main/lang/utils.ts"],"names":["mapValues","assign","clone","createMap","pathResolve","Signal","Signal.constructor","Signal.add","Signal.remove","Signal.dispatch","Signal.clear","Signal.hasListeners","binarySearch","selectMany","pathIsRelative","Dict","Dict.constructor","Dict.setValue","Dict.getValue","Dict.clearValue","Dict.clearAll","Dict.keys","Dict.values","delay","delayMilliseconds","debounce"],"mappings":"AAcA,YAAY,CAAC;AAEb,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,SAAgB,SAAS,CAAI,GAA2B;IACpDA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,MAAMA,CAACA,UAACA,MAAWA,EAAEA,GAAWA;QACpDA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA;QACtBA,MAAMA,CAACA,MAAMA,CAACA;IAClBA,CAACA,EAAEA,EAAEA,CAACA,CAACA;AACXA,CAACA;AALe,iBAAS,GAAT,SAKf,CAAA;AAOD,SAAgB,MAAM,CAAC,MAAW;IAAEC,eAAeA;SAAfA,WAAeA,CAAfA,sBAAeA,CAAfA,IAAeA;QAAfA,8BAAeA;;IAC/CA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,CAACA,UAASA,MAAWA,EAAEA,MAAWA;QACjD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,MAAW,EAAE,GAAW;YACvD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1B,MAAM,CAAC,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC,CAAC;IACf,CAAC,EAAEA,MAAMA,CAACA,CAACA;AACfA,CAACA;AAPe,cAAM,GAAN,MAOf,CAAA;AAMD,SAAgB,KAAK,CAAI,MAAS;IAC9BC,MAAMA,CAACA,MAAMA,CAACA,KAAKA,CAACA,OAAOA,CAACA,MAAMA,CAACA,GAAGA,EAAEA,GAAGA,EAAEA,EAAEA,MAAMA,CAACA,CAACA;AAC3DA,CAACA;AAFe,aAAK,GAAL,KAEf,CAAA;AAGD,SAAgB,SAAS,CAAC,GAAa;IACnCC,MAAMA,CAACA,GAAGA,C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A,CAACA,UAAUA,CAACA,CAACA,CAACA,GAAGA,QAAQA,CAACA,CAACA,CAACA;gBAChCA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,CAACA,CAACA,EAAEA,CAACA,EAAEA,QAAQA,CAACA,CAACA;gBACvCA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA,EAAEA,CAACA,EAAEA,QAAQA,CAACA,CAACA;gBACtCA,MAAMA,CAACA;YACXA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,UAAUA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;QAC/BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IAClCA,CAACA;IAODF,uBAAMA,GAANA,UAAOA,QAA+BA;QAClCG,IAAIA,KAAKA,GAAGA,IAAIA,CAACA,SAASA,CAACA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QAC7CA,EAAEA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA,CAACA;YACbA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA,CAACA,CAACA;YACjCA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA,CAACA,CAACA;QACpCA,CAACA;IACLA,CAACA;IAODH,yBAAQA,GAARA,UAASA,SAAaA;QAClBI,IAAIA,eAAeA,GAAGA,IAAIA,CAACA,SAASA,CAACA,KAAKA,CAACA,UAACA,QAA+BA;YACvEA,IAAIA,MAAMA,GAAGA,QAAQA,CAACA,SAASA,CAACA,CAACA;YACjCA,MAAMA,CAACA,MAAMA,KAAKA,KAAKA,CAACA;QAC5BA,CAACA,CAACA,CAACA;QAEHA,MAAMA,CAACA,eAAeA,CAACA;IAC3BA,CAACA;IAKDJ,sBAAKA,GAALA;QACIK,IAAIA,CAACA,SAASA,GAAGA,EAAEA,CAACA;QACpBA,IAAIA,CAACA,UAAUA,GAAGA,EAAEA,CAACA;IACz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MAAM,CAAC;IAClB,CAAC,CAACA;AACNA,CAACA;AAhCe,gBAAQ,GAAR,QAgCf,CAAA;AAAA,CAAC"}
\ No newline at end of file
+{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../lib/main/lang/utils.ts"],"names":["mapValues","assign","clone","createMap","pathResolve","Signal","Signal.constructor","Signal.add","Signal.remove","Signal.dispatch","Signal.clear","Signal.hasListeners","binarySearch","selectMany","pathIsRelative","Dict","Dict.constructor","Dict.setValue","Dict.getValue","Dict.clearValue","Dict.clearAll","Dict.keys","Dict.values","delay","delayMilliseconds","debounce"],"mappings":"AAcA,YAAY,CAAC;AAEb,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAE9B,SAAgB,SAAS,CAAI,GAA2B;IACpDA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,CAACA,MAAMA,CAACA,UAACA,MAAWA,EAAEA,GAAWA;QACpDA,MAAMA,CAACA,IAAIA,CAACA,GAAGA,CAACA,GAAGA,CAACA,CAACA,CAACA;QACtBA,MAAMA,CAACA,MAAMA,CAACA;IAClBA,CAACA,EAAEA,EAAEA,CAACA,CAACA;AACXA,CAACA;AALe,iBAAS,GAAT,SAKf,CAAA;AAOD,SAAgB,MAAM,CAAC,MAAW;IAAEC,eAAeA;SAAfA,WAAeA,CAAfA,sBAAeA,CAAfA,IAAeA;QAAfA,8BAAeA;;IAC/CA,MAAMA,CAACA,KAAKA,CAACA,MAAMA,CAACA,UAASA,MAAWA,EAAEA,MAAWA;QACjD,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,UAAC,MAAW,EAAE,GAAW;YACvD,MAAM,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YAC1B,MAAM,CAAC,MAAM,CAAC;QAClB,CAAC,EAAE,MAAM,CAAC,CAAC;IACf,CAAC,EAAEA,MAAMA,CAACA,CAACA;AACfA,CAACA;AAPe,cA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AACA,UAAUA,CAACA,KAAKA,CAACA,GAAGA,QAAQA,CAACA;YAClCA,MAAMA,CAACA;QACXA,CAACA;QACDA,GAAGA,CAACA,CAACA,GAAGA,CAACA,CAACA,GAAGA,CAACA,EAAEA,CAACA,GAAGA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,EAAEA,CAACA,GAAGA,CAACA,EAAEA,CAACA,EAAEA,EAAEA,CAACA;YACrDA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA,CAACA,GAAGA,QAAQA,CAACA,CAACA,CAACA;gBAChCA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,CAACA,CAACA,EAAEA,CAACA,EAAEA,QAAQA,CAACA,CAACA;gBACvCA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,CAACA,EAAEA,CAACA,EAAEA,QAAQA,CAACA,CAACA;gBACtCA,MAAMA,CAACA;YACXA,CAACA;QACLA,CAACA;QACDA,IAAIA,CAACA,UAAUA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;QAC/BA,IAAIA,CAACA,SAASA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA;IAClCA,CAACA;IAODF,uBAAMA,GAANA,UAAOA,QAA+BA;QAClCG,IAAIA,KAAKA,GAAGA,IAAIA,CAACA,SAASA,CAACA,OAAOA,CAACA,QAAQA,CAACA,CAACA;QAC7CA,EAAEA,CAACA,CAACA,KAAKA,IAAIA,CAACA,CAACA,CAACA,CAACA;YACbA,IAAIA,CAACA,UAAUA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA,CAACA,CAACA;YACjCA,IAAIA,CAACA,SAASA,CAACA,MAAMA,CAACA,KAAKA,EAAEA,CAACA,CAACA,CAACA;QACpCA,CAACA;IACLA,CAACA;IAODH,yBAAQA,GAARA,UAASA,SAAaA;QAClBI,IAAIA,eAAeA,GAAGA,IAAIA,CAACA,SAASA,CAACA,KAAKA,CAACA,UAACA,QAA+BA;YACvEA,IAAIA,M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EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;YAAC,OAAO,GAAG,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QAChD,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;YACV,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;YACnC,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;QAC1B,CAAC;QAED,MAAM,CAAC,MAAM,CAAC;IAClB,CAAC,CAACA;AACNA,CAACA;AAhCe,gBAAQ,GAAR,QAgCf,CAAA;AAAA,CAAC"}
\ No newline at end of file
diff --git a/dist/main/tsconfig/tsconfig.js b/dist/main/tsconfig/tsconfig.js
index 611247276..4d9ea999a 100644
--- a/dist/main/tsconfig/tsconfig.js
+++ b/dist/main/tsconfig/tsconfig.js
@@ -52,8 +52,8 @@ var projectFileName = 'tsconfig.json';
var defaultFilesGlob = ["./**/*.ts", "!./node_modules/**/*.ts"];
var typeScriptVersion = '1.4.1';
exports.defaults = {
- target: ts.ScriptTarget.ES5,
- module: ts.ModuleKind.CommonJS,
+ target: 1,
+ module: 1,
declaration: false,
noImplicitAny: false,
removeComments: true,
@@ -70,31 +70,31 @@ var deprecatedKeys = {
};
var typescriptEnumMap = {
target: {
- 'es3': ts.ScriptTarget.ES3,
- 'es5': ts.ScriptTarget.ES5,
- 'es6': ts.ScriptTarget.ES6,
- 'latest': ts.ScriptTarget.Latest
+ 'es3': 0,
+ 'es5': 1,
+ 'es6': 2,
+ 'latest': 2
},
module: {
- 'none': ts.ModuleKind.None,
- 'commonjs': ts.ModuleKind.CommonJS,
- 'amd': ts.ModuleKind.AMD
+ 'none': 0,
+ 'commonjs': 1,
+ 'amd': 2
}
};
var jsonEnumMap = {
target: (function () {
var map = {};
- map[ts.ScriptTarget.ES3] = 'es3';
- map[ts.ScriptTarget.ES5] = 'es5';
- map[ts.ScriptTarget.ES6] = 'es6';
- map[ts.ScriptTarget.Latest] = 'latest';
+ map[0] = 'es3';
+ map[1] = 'es5';
+ map[2] = 'es6';
+ map[2] = 'latest';
return map;
})(),
module: (function () {
var map = {};
- map[ts.ModuleKind.None] = 'none';
- map[ts.ModuleKind.CommonJS] = 'commonjs';
- map[ts.ModuleKind.AMD] = 'amd';
+ map[0] = 'none';
+ map[1] = 'commonjs';
+ map[2] = 'amd';
return map;
})()
};
@@ -135,35 +135,32 @@ function tsToRawCompilerOptions(compilerOptions) {
}
return jsonOptions;
}
+function getDefaultProject(srcFile) {
+ var dir = fs.lstatSync(srcFile).isDirectory() ? srcFile : path.dirname(srcFile);
+ return {
+ projectFileDirectory: dir,
+ projectFilePath: dir + '/' + projectFileName,
+ project: {
+ compilerOptions: exports.defaults,
+ files: [srcFile],
+ formatCodeOptions: formatting.defaultFormatCodeOptions(),
+ compileOnSave: true
+ }
+ };
+}
+exports.getDefaultProject = getDefaultProject;
function getProjectSync(pathOrSrcFile) {
if (!fs.existsSync(pathOrSrcFile))
throw new Error(exports.errors.GET_PROJECT_INVALID_PATH);
var dir = fs.lstatSync(pathOrSrcFile).isDirectory() ? pathOrSrcFile : path.dirname(pathOrSrcFile);
- if (dir !== pathOrSrcFile) {
- if (endsWith(pathOrSrcFile.toLowerCase(), '.d.ts')) {
- return {
- projectFileDirectory: dir,
- projectFilePath: dir + '/' + projectFileName,
- project: {
- compilerOptions: exports.defaults,
- files: [pathOrSrcFile],
- format: formatting.defaultFormatCodeOptions()
- },
- };
- }
- }
var projectFile = '';
- while (fs.existsSync(dir)) {
- var potentialProjectFile = dir + '/' + projectFileName;
- if (fs.existsSync(potentialProjectFile)) {
- projectFile = potentialProjectFile;
- break;
- }
- else {
- var before = dir;
- dir = path.dirname(dir);
- if (dir == before)
- throw new Error(exports.errors.GET_PROJECT_NO_PROJECT_FOUND);
+ try {
+ projectFile = travelUpTheDirectoryTreeTillYouFindFile(dir, projectFileName);
+ }
+ catch (e) {
+ var err = e;
+ if (err.message == "not found") {
+ throw new Error(exports.errors.GET_PROJECT_NO_PROJECT_FOUND);
}
}
projectFile = path.normalize(projectFile);
@@ -203,7 +200,9 @@ function getProjectSync(pathOrSrcFile) {
var project = {
compilerOptions: {},
files: projectSpec.files,
- format: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
+ filesGlob: projectSpec.filesGlob,
+ formatCodeOptions: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
+ compileOnSave: projectSpec.compileOnSave == undefined ? true : projectSpec.compileOnSave
};
var validationResult = validator.validate(projectSpec.compilerOptions);
if (validationResult.errorMessage) {
@@ -262,10 +261,22 @@ function increaseProjectForReferenceAndImports(files) {
return;
}
var preProcessedFileInfo = ts.preProcessFile(content, true), dir = path.dirname(file);
- referenced.push(preProcessedFileInfo.referencedFiles.map(function (fileReference) { return path.resolve(dir, fileReference.filename); }).concat(preProcessedFileInfo.importedFiles.filter(function (fileReference) { return pathIsRelative(fileReference.filename); }).map(function (fileReference) {
- var file = path.resolve(dir, fileReference.filename + '.ts');
+ referenced.push(preProcessedFileInfo.referencedFiles.map(function (fileReference) {
+ var file = path.resolve(dir, fileReference.fileName);
+ if (fs.existsSync(file)) {
+ return file;
+ }
+ if (fs.existsSync(file + '.ts')) {
+ return file + '.ts';
+ }
+ if (fs.existsSync(file + '.d.ts')) {
+ return file + '.d.ts';
+ }
+ return null;
+ }).filter(function (file) { return !!file; }).concat(preProcessedFileInfo.importedFiles.filter(function (fileReference) { return pathIsRelative(fileReference.fileName); }).map(function (fileReference) {
+ var file = path.resolve(dir, fileReference.fileName + '.ts');
if (!fs.existsSync(file)) {
- file = path.resolve(dir, fileReference.filename + '.d.ts');
+ file = path.resolve(dir, fileReference.fileName + '.d.ts');
}
return file;
})));
@@ -309,6 +320,7 @@ function selectMany(arr) {
function endsWith(str, suffix) {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
+exports.endsWith = endsWith;
function uniq(arr) {
var map = simpleValidator.createMap(arr);
return Object.keys(map);
@@ -333,4 +345,19 @@ function removeTrailingSlash(filePath) {
return filePath;
}
exports.removeTrailingSlash = removeTrailingSlash;
+function travelUpTheDirectoryTreeTillYouFindFile(dir, fileName) {
+ while (fs.existsSync(dir)) {
+ var potentialFile = dir + '/' + fileName;
+ if (fs.existsSync(potentialFile)) {
+ return potentialFile;
+ }
+ else {
+ var before = dir;
+ dir = path.dirname(dir);
+ if (dir == before)
+ throw new Error("not found");
+ }
+ }
+}
+exports.travelUpTheDirectoryTreeTillYouFindFile = travelUpTheDirectoryTreeTillYouFindFile;
//# sourceMappingURL=tsconfig.js.map
\ No newline at end of file
diff --git a/dist/main/tsconfig/tsconfig.js.map b/dist/main/tsconfig/tsconfig.js.map
index 36259c7f9..0683d6bfb 100644
--- a/dist/main/tsconfig/tsconfig.js.map
+++ b/dist/main/tsconfig/tsconfig.js.map
@@ -1 +1 @@
-{"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../lib/main/tsconfig/tsconfig.ts"],"names":["errorWithDetails","mixin","rawToTsCompilerOptions","tsToRawCompilerOptions","getProjectSync","createProjectRootSync","consistentPath","increaseProjectForReferenceAndImports","prettyJSON","pathIsRelative","selectMany","endsWith","uniq","makeRelativePath","removeExt","removeTrailingSlash"],"mappings":"AAGA,IAAO,eAAe,WAAW,mBAAmB,CAAC,CAAC;AACtD,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAmClC,IAAI,yBAAyB,GAAmC;IAC5D,oBAAoB,EAAE,EAAE,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,OAAO,EAAE;IAC7D,OAAO,EAAE,EAAE,IAAI,EAAE,eAAe,CAAC,KAAK,CAAC,MAAM,EAAE;IAC/C,QAAQ,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,MAAM,EAAE;IAChC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE;IACpC,WAAW,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,EAAE;IACpC,OAAO,EAAE,EAAE,IAAI,EAAE,KAA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ACA,CAACA,YAAYA,CAACA,CAACA,CAACA,KAAKA,GAAGA,CAACA,CAACA,CAACA;QAC1BA,YAAYA,GAAGA,IAAIA,GAAGA,YAAYA,CAACA;IACvCA,CAACA;IACDA,MAAMA,CAACA,YAAYA,CAACA;AACxBA,CAACA;AANe,wBAAgB,GAAhB,gBAMf,CAAA;AAED,SAAgB,SAAS,CAAC,QAAgB;IACtCC,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,EAAEA,QAAQA,CAACA,WAAWA,CAACA,GAAGA,CAACA,CAACA,CAACA;AACzDA,CAACA;AAFe,iBAAS,GAAT,SAEf,CAAA;AAED,SAAgB,mBAAmB,CAAC,QAAgB;IAChDC,EAAEA,CAACA,CAACA,CAACA,QAAQA,CAACA;QAACA,MAAMA,CAACA,QAAQA,CAACA;IAC/BA,EAAEA,CAACA,CAACA,QAAQA,CAACA,QAAQA,EAAEA,GAAGA,CAACA,CAACA;QAACA,MAAMA,CAACA,QAAQA,CAACA,MAAMA,CAACA,CAACA,EAAEA,QAAQA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;IAC5EA,MAAMA,CAACA,QAAQA,CAACA;AACpBA,CAACA;AAJe,2BAAmB,GAAnB,mBAIf,CAAA"}
\ No newline at end of file
+{"version":3,"file":"tsconfig.js","sourceRoot":"","sources":["../../../lib/main/tsconfig/tsconfig.ts"],"names":["errorWithDetails","mixin","rawToTsCompilerOptions","tsToRawCompilerOptions","getDefaultProject","getProjectSync","createProjectRootSync","consistentPath","increaseProjectForReferenceAndImports","prettyJSON","pathIsRelative","selectMany","endsWith","uniq","makeRelativePath","removeExt","removeTrailingSlash","travelUpTheDirectoryTreeTillYouFindFile"],"mappings":"AAGA,IAAO,eAAe,WAAW,mBAAmB,CAAC,CAAC;AACtD,IAAI,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC;AAmClC,IAAI,yBAAyB,GAAmC;IAC5D,oBAAoB,EAAE,EAAE,IAAI,EAAE,eAAe,CAAC,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AAGA,CAACA,CAACA,CAACA;IAC5EA,MAAMA,CAACA,QAAQA,CAACA;AACpBA,CAACA;AAJe,2BAAmB,GAAnB,mBAIf,CAAA;AAGD,SAAgB,uCAAuC,CAAC,GAAW,EAAE,QAAgB;IACjFC,OAAOA,EAAEA,CAACA,UAAUA,CAACA,GAAGA,CAACA,EAAEA,CAACA;QAExBA,IAAIA,aAAaA,GAAGA,GAAGA,GAAGA,GAAGA,GAAGA,QAAQA,CAACA;QACzCA,EAAEA,CAACA,CAACA,EAAEA,CAACA,UAAUA,CAACA,aAAaA,CAACA,CAACA,CAACA,CAACA;YAC/BA,MAAMA,CAACA,aAAaA,CAACA;QACzBA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,IAAIA,MAAMA,GAAGA,GAAGA,CAACA;YACjBA,GAAGA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,GAAGA,CAACA,CAACA;YAExBA,EAAEA,CAACA,CAACA,GAAGA,IAAIA,MAAMA,CAACA;gBAACA,MAAMA,IAAIA,KAAKA,CAACA,WAAWA,CAACA,CAACA;QACpDA,CAACA;IACLA,CAACA;AACLA,CAACA;AAde,+CAAuC,GAAvC,uCAcf,CAAA"}
\ No newline at end of file
diff --git a/dist/worker/lib/workerLib.js b/dist/worker/lib/workerLib.js
index b37b3d26b..21291e92a 100644
--- a/dist/worker/lib/workerLib.js
+++ b/dist/worker/lib/workerLib.js
@@ -18,10 +18,7 @@ var orphanExitCode = 100;
var RequesterResponder = (function () {
function RequesterResponder() {
var _this = this;
- this.getProcess = function () {
- throw new Error('getProcess is abstract');
- return null;
- };
+ this.getProcess = function () { throw new Error('getProcess is abstract'); return null; };
this.currentListeners = {};
this.responders = {};
this.processRequest = function (m) {
diff --git a/dist/worker/lib/workerLib.js.map b/dist/worker/lib/workerLib.js.map
index bbf9d0006..affbc9bf4 100644
--- a/dist/worker/lib/workerLib.js.map
+++ b/dist/worker/lib/workerLib.js.map
@@ -1 +1 @@
-{"version":3,"file":"workerLib.js","sourceRoot":"","sources":["../../../lib/worker/lib/workerLib.ts"],"names":["createId","RequesterResponder","RequesterResponder.constructor","RequesterResponder.processResponse","RequesterResponder.sendToIpc","RequesterResponder.addToResponders","RequesterResponder.registerAllFunctionsExportedFromAsResponders","Parent","Parent.constructor","Parent.startWorker","Parent.stopWorker","Child","Child.constructor","Child.keepAlive"],"mappings":";;;;;;AAIA,IAAO,YAAY,WAAW,eAAe,CAAC,CAAC;AAC/C,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;AAC7B,IAAI,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAC/B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAwB9B,SAAS,QAAQ;IACbA,MAAMA,CAACA,sCAAsCA,CAACA,OAAOA,CAACA,OAAOA,EAAEA,UAASA,CAACA;QACrE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC;QACnE,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC,CAACA,CAACA;AACPA,CAACA;AAGD,IAAI,cAAc,GAAG,GAAG,CAAC;AAEzB,IAAM,kBAAkB;IAAxBC,SAAMA,kBAAkBA;QAAxBC,iBAkHCA;QA/GaA,eAAUA,GAGlBA;YAAQA,MAAMA,IAAIA,KAAKA,CAACA,wBAAwBA,CAACA,CAACA;YAACA,MAAMA,CAACA,IAAIA,CAACA;QAACA,CAACA,CAAAA;QAK3DA,qBAAgBA,GAAmEA,EAAEA,CAACA;QAuDtFA,eAAUA,GAAgFA,EAAEA,CAACA;QAE3FA,mBAAcA,GAAGA,UAACA,CAAMA;YAC9BA,IAAIA,MAAMA,GAAiBA,CAACA,CAACA;YAC7BA,EAAEA,CAACA,CAACA,CAACA,MAAMA,CAACA,OAAOA,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ACA;QACPA,CAACA,CAAAA;IAWLA,CAACA;IApGaD,4CAAeA,GAAzBA,UAA0BA,CAAMA;QAC5BE,IAAIA,MAAMA,GAAiBA,CAACA,CAACA;QAE7BA,EAAEA,CAACA,CAACA,CAACA,MAAMA,CAACA,OAAOA,IAAIA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,CAACA;YAChCA,OAAOA,CAACA,GAAGA,CAACA,2CAA2CA,EAAEA,CAACA,CAACA,CAACA;QAChEA,CAACA;QACDA,IAAIA,CAACA,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,gBAAgBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,IAAIA,CAACA,IAAIA,CAACA,gBAAgBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,CAACA,CAACA;YACnGA,OAAOA,CAACA,GAAGA,CAACA,mCAAmCA,EAAEA,MAAMA,CAACA,OAAOA,EAAEA,MAAMA,CAACA,IAAIA,CAACA,CAACA;QAClFA,CAACA;QACDA,IAAIA,CAACA,CAACA;YACFA,EAAEA,CAACA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA,CAACA;gBACfA,IAAIA,CAACA,gBAAgBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,MAAMA,CAACA,MAAMA,CAACA,KAAKA,CAACA,CAACA;YAC1EA,CAACA;YACDA,IAAIA,CAACA,CAACA;gBACFA,IAAIA,CAACA,gBAAgBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA,OAAOA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;YAC1EA,CAACA;YACDA,OAAOA,IAAIA,CAACA,gBAAgBA,CAACA,MAAMA,CAACA,OAAOA,CAACA,CAACA,MAAMA,CAACA,EAAEA,CAACA,CAACA;QAC5DA,CAACA;IACLA,CAACA;IAODF,sCAASA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,CAACA;gBAClBA,KAAIA,CAACA,cAAcA,CAACA,OAAOA,CAACA,CAACA;YACjCA,CAACA;YACDA,IAAIA,CAACA,CAACA;gBACFA,KAAIA,CAACA,eAAeA,CAACA,OAAOA,CAACA,CAACA;YAClCA,CAACA;QACLA,CAACA,CAACA,CAACA;IACPA,CAACA;IAGOD,yBAASA,GAAjBA;QACIE,WAAWA,CAACA;YAERA,EAAEA,CAACA,CAACA,CAAOA,OAAQA,CAACA,SAASA,CAACA,CAACA,CAACA;gBAC5BA,OAAOA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA;YACjCA,CAACA;QACLA,CAACA,EAAEA,IAAIA,CAACA,CAACA;IACbA,CAACA;IACLF,YAACA;AAADA,CAACA,AA9BD,EAA2B,kBAAkB,EA8B5C;AA9BY,aAAK,GAAL,KA8BZ,CAAA"}
\ No newline at end of file
+{"version":3,"file":"workerLib.js","sourceRoot":"","sources":["../../../lib/worker/lib/workerLib.ts"],"names":["createId","RequesterResponder","RequesterResponder.constructor","RequesterResponder.processResponse","RequesterResponder.sendToIpc","RequesterResponder.addToResponders","RequesterResponder.registerAllFunctionsExportedFromAsResponders","Parent","Parent.constructor","Parent.startWorker","Parent.stopWorker","Child","Child.constructor","Child.keepAlive"],"mappings":";;;;;;AAIA,IAAO,YAAY,WAAW,eAAe,CAAC,CAAC;AAC/C,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;AAC7B,IAAI,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAC/B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAwB9B,SAAS,QAAQ;IACbA,MAAMA,CAACA,sCAAsCA,CAACA,OAAOA,CAACA,OAAOA,EAAEA,UAASA,CAACA;QACrE,IAAI,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,GAAG,GAAG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A,EAAEA,CAACA,MAAMA,EAACA,UAACA,GAAGA;gBAC5BA,OAAOA,CAACA,GAAGA,CAACA,mBAAmBA,EAAEA,GAAGA,CAACA,QAAQA,EAAEA,CAACA,CAACA;YACrDA,CAACA,CAACA,CAACA;YACHA,IAAIA,CAACA,KAAKA,CAACA,EAAEA,CAACA,OAAOA,EAACA,UAACA,IAAIA;gBAEvBA,OAAOA,CAACA,GAAGA,CAACA,6BAA6BA,EAAEA,IAAIA,CAACA,CAACA;gBAGjDA,EAAEA,CAACA,CAACA,IAAIA,KAAKA,cAAcA,CAACA,CAACA,CAACA;oBAC1BA,OAAOA,CAACA,GAAGA,CAACA,sBAAsBA,CAACA,CAACA;oBACpCA,KAAIA,CAACA,WAAWA,CAACA,WAAWA,EAAEA,aAAaA,CAACA,CAACA;gBACjDA,CAACA;gBAEDA,IAAIA,CAACA,EAAEA,CAACA,CAACA,KAAIA,CAACA,oBAAoBA,CAACA,CAACA,CAACA;oBACjCA,aAAaA,CAACA,IAAIA,KAAKA,CAACA,sBAAsBA,CAACA,CAACA,CAACA;gBACrDA,CAACA;gBAEDA,IAAIA,CAACA,CAACA;oBACFA,OAAOA,CAACA,GAAGA,CAACA,sBAAsBA,CAACA,CAACA;oBACpCA,KAAIA,CAACA,WAAWA,CAACA,WAAWA,EAAEA,aAAaA,CAACA,CAACA;gBACjDA,CAACA;YACLA,CAACA,CAACA,CAACA;QACPA,CAAEA;QAAAA,KAAKA,CAACA,CAACA,GAAGA,CAACA,CAACA,CAACA;YACXA,aAAaA,CAACA,GAAGA,CAACA,CAACA;QACvBA,CAACA;IACLA,CAACA;IAGDF,2BAAUA,GAAVA;QACIG,EAAEA,CAACA,CAACA,CAACA,IAAIA,CAACA,KAAKA,CAACA;YAACA,MAAMA,CAACA;QACxBA,IAAIA,CAACA;YACDA,IAAIA,CAACA,KAAKA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA;QAC/BA,CACAA;QAAAA,KAAKA,CAACA,CAACA,EAAEA,CAACA,CAACA,CAACA;YACRA,OAAOA,CAACA,KAAKA,CAACA,6BAA6BA,CAACA,CAACA;QACjDA,CAACA;QACDA,IAAIA,CAACA,KAAKA,GAAGA,IAAIA,CAACA;IACtBA,CAACA;IACLH,aAACA;AAADA,CAACA,AAxED,EAA4B,kBAAkB,EAwE7C;AAxEY,cAAM,GAAN,MAwEZ,CAAA;AAED,IAAa,KAAK;IAASI,UAAdA,KAAKA,UAA2BA;IAIzCA,SAJSA,KAAKA;QAAlBC,iBA8BCA;QAzBOA,iBAAOA,CAACA;QAHFA,eAAUA,GAAGA,cAAMA,cAAOA,EAAPA,CAAOA,CAACA;QAMjCA,IAAIA,CAACA,SAASA,EAAEA,CAACA;QAGjBA,OAAOA,CAACA,EAAEA,CAACA,SAASA,EAACA,UAACA,OAAqBA;YACvCA,EAAEA,CAACA,CAACA,OAAOA,CAACA,OAAOA,CAACA,CAACA,CAACA;gBAClBA,KAAIA,CAACA,cAAcA,CAACA,OAAOA,CAACA,CAACA;YACjCA,CAACA;YACDA,IAAIA,CAACA,CAACA;gBACFA,KAAIA,CAACA,eAAeA,CAACA,OAAOA,CAACA,CAACA;YAClCA,CAACA;QACLA,CAACA,CAACA,CAACA;IACPA,CAACA;IAGOD,yBAASA,GAAjBA;QACIE,WAAWA,CAACA;YAERA,EAAEA,CAACA,CAACA,CAAOA,OAAQA,CAACA,SAASA,CAACA,CAACA,CAACA;gBAC5BA,OAAOA,CAACA,IAAIA,CAACA,cAAcA,CAACA,CAACA;YACjCA,CAACA;QACLA,CAACA,EAAEA,IAAIA,CAACA,CAACA;IACbA,CAACA;IACLF,YAACA;AAADA,CAACA,AA9BD,EAA2B,kBAAkB,EA8B5C;AA9BY,aAAK,GAAL,KA8BZ,CAAA"}
\ No newline at end of file
diff --git a/dist/worker/parent.js b/dist/worker/parent.js
index 0493a7e41..081e31b23 100644
--- a/dist/worker/parent.js
+++ b/dist/worker/parent.js
@@ -38,10 +38,13 @@ exports.formatDocument = catchCommonErrors(parent.sendToIpc(projectService.forma
exports.formatDocumentRange = catchCommonErrors(parent.sendToIpc(projectService.formatDocumentRange));
exports.getDefinitionsAtPosition = catchCommonErrors(parent.sendToIpc(projectService.getDefinitionsAtPosition));
exports.updateText = catchCommonErrors(parent.sendToIpc(projectService.updateText));
+exports.editText = catchCommonErrors(parent.sendToIpc(projectService.editText));
exports.errorsForFile = catchCommonErrors(parent.sendToIpc(projectService.errorsForFile));
exports.getSignatureHelps = catchCommonErrors(parent.sendToIpc(projectService.getSignatureHelps));
exports.getRenameInfo = catchCommonErrors(parent.sendToIpc(projectService.getRenameInfo));
exports.getRelativePathsInProject = catchCommonErrors(parent.sendToIpc(projectService.getRelativePathsInProject));
+exports.debugLanguageServiceHostVersion = parent.sendToIpc(projectService.debugLanguageServiceHostVersion);
+exports.getProjectFileDetails = parent.sendToIpc(projectService.getProjectFileDetails);
var queryParent = require('./queryParent');
parent.registerAllFunctionsExportedFromAsResponders(queryParent);
//# sourceMappingURL=parent.js.map
\ No newline at end of file
diff --git a/dist/worker/parent.js.map b/dist/worker/parent.js.map
index 89adbc233..1b7c55606 100644
--- a/dist/worker/parent.js.map
+++ b/dist/worker/parent.js.map
@@ -1 +1 @@
-{"version":3,"file":"parent.js","sourceRoot":"","sources":["../../lib/worker/parent.ts"],"names":["startWorker","stopWorker","showError","catchCommonErrors"],"mappings":"AAGA,IAAO,YAAY,WAAW,eAAe,CAAC,CAAC;AAC/C,IAAI,IAAI,GAAG,YAAY,CAAC,IAAI,CAAC;AAC7B,IAAI,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC;AAE/B,IAAO,SAAS,WAAW,iBAAiB,CAAC,CAAC;AAG9C,IAAI,MAAM,GAAG,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC;AACpC,SAAgB,WAAW;IACvBA,MAAMA,CAACA,WAAWA,CAACA,SAASA,GAAGA,WAAWA,EAAEA,SAASA,CAACA,CAACA;IACvDA,OAAOA,CAACA,GAAGA,CAACA,uBAAuBA,CAACA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Ac,CAAC,aAAa,CAAC,CAAC,CAAC;AAClF,yBAAiB,GAAG,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;AAC1F,qBAAa,GAAG,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;AAClF,iCAAyB,GAAG,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,yBAAyB,CAAC,CAAC,CAAC;AAC1G,uCAA+B,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,+BAA+B,CAAC,CAAC;AACnG,6BAAqB,GAAG,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,qBAAqB,CAAC,CAAC;AAG1F,IAAO,WAAW,WAAW,eAAe,CAAC,CAAC;AAC9C,MAAM,CAAC,4CAA4C,CAAC,WAAW,CAAC,CAAC"}
\ No newline at end of file
diff --git a/dist/worker/queryParent.js b/dist/worker/queryParent.js
index 714587899..701b844a9 100644
--- a/dist/worker/queryParent.js
+++ b/dist/worker/queryParent.js
@@ -22,30 +22,37 @@ function getUpdatedTextForUnsavedEditors(query) {
});
}
exports.getUpdatedTextForUnsavedEditors = getUpdatedTextForUnsavedEditors;
-function setProjectFileParsedResult(query) {
+function getOpenEditorPaths(query) {
+ var editors = atomUtils.getTypeScriptEditorsWithPaths();
+ return resolve({
+ filePaths: editors.map(function (e) { return tsconfig.consistentPath(e.getPath()); })
+ });
+}
+exports.getOpenEditorPaths = getOpenEditorPaths;
+function setConfigurationError(query) {
var errors = [];
if (query.error) {
if (query.error.message == tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
- var invalidJSONDetails = query.error.details;
+ var details = query.error.details;
errors = [
{
- filePath: invalidJSONDetails.projectFilePath,
+ filePath: details.projectFilePath,
startPos: { line: 0, ch: 0 },
endPos: { line: 0, ch: 0 },
message: "The project file contains invalid JSON",
- preview: invalidJSONDetails.projectFilePath,
+ preview: details.projectFilePath,
}
];
}
if (query.error.message == tsconfig.errors.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS) {
- var invalidOptionDetails = query.error.details;
+ var _details = query.error.details;
errors = [
{
- filePath: invalidOptionDetails.projectFilePath,
+ filePath: _details.projectFilePath,
startPos: { line: 0, ch: 0 },
endPos: { line: 0, ch: 0 },
message: "The project file contains invalid options",
- preview: invalidOptionDetails.errorMessage,
+ preview: _details.errorMessage,
}
];
}
@@ -53,5 +60,10 @@ function setProjectFileParsedResult(query) {
errorView.setErrors(query.projectFilePath, errors);
return resolve({});
}
-exports.setProjectFileParsedResult = setProjectFileParsedResult;
+exports.setConfigurationError = setConfigurationError;
+function notifySuccess(query) {
+ atom.notifications.addSuccess(query.message);
+ return resolve({});
+}
+exports.notifySuccess = notifySuccess;
//# sourceMappingURL=queryParent.js.map
\ No newline at end of file
diff --git a/dist/worker/queryParent.js.map b/dist/worker/queryParent.js.map
index ca40e4593..8e9d63a70 100644
--- a/dist/worker/queryParent.js.map
+++ b/dist/worker/queryParent.js.map
@@ -1 +1 @@
-{"version":3,"file":"queryParent.js","sourceRoot":"","sources":["../../lib/worker/queryParent.ts"],"names":["echoNumWithModification","getUpdatedTextForUnsavedEditors","setProjectFileParsedResult"],"mappings":"AAEA,IAAI,OAAO,GAA2B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAGpE,IAAO,QAAQ,WAAW,2BAA2B,CAAC,CAAC;AAKvD,IAAI,SAA4B,CAAC;AAEjC,IAAI,SAA4B,CAAC;AAEjC,IAAA,CAAC;IACG,OAAO,CAAC,MAAM,CAAC,CAAC;IAEhB,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;IAC9C,SAAS,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAAC;AAClD,CACA;AAAA,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAEZ,CAAC;AAED,SAAgB,uBAAuB,CAAC,KAAsB;IA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AEA,EAAEA,CAACA,EAAEA;oBAC1BA,OAAOA,EAAEA,wCAAwCA;oBACjDA,OAAOA,EAAEA,kBAAkBA,CAACA,eAAeA;iBAC9CA;aACJA,CAAAA;QACLA,CAACA;QACDA,EAAEA,CAACA,CAACA,KAAKA,CAACA,KAAKA,CAACA,OAAOA,IAAIA,QAAQA,CAACA,MAAMA,CAACA,wCAAwCA,CAACA,CAACA,CAACA;YAClFA,IAAIA,oBAAoBA,GAA8DA,KAAKA,CAACA,KAAKA,CAACA,OAAOA,CAACA;YAC1GA,MAAMA,GAAGA;gBACLA;oBACIA,QAAQA,EAAEA,oBAAoBA,CAACA,eAAeA;oBAC9CA,QAAQA,EAAEA,EAAEA,IAAIA,EAAEA,CAACA,EAAEA,EAAEA,EAAEA,CAACA,EAAEA;oBAC5BA,MAAMA,EAAEA,EAAEA,IAAIA,EAAEA,CAACA,EAAEA,EAAEA,EAAEA,CAACA,EAAEA;oBAC1BA,OAAOA,EAAEA,2CAA2CA;oBACpDA,OAAOA,EAAEA,oBAAoBA,CAACA,YAAYA;iBAC7CA;aACJA,CAAAA;QACLA,CAACA;IACLA,CAACA;IAEDA,SAASA,CAACA,SAASA,CAACA,KAAKA,CAACA,eAAeA,EAAEA,MAAMA,CAACA,CAACA;IACnDA,MAAMA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAACA;AACvBA,CAACA;AA/Be,kCAA0B,GAA1B,0BA+Bf,CAAA;AAEwB"}
\ No newline at end of file
+{"version":3,"file":"queryParent.js","sourceRoot":"","sources":["../../lib/worker/queryParent.ts"],"names":["echoNumWithModification","getUpdatedTextForUnsavedEditors","getOpenEditorPaths","setConfigurationError","notifySuccess"],"mappings":"AAEA,IAAI,OAAO,GAA2B,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAGpE,IAAO,QAAQ,WAAW,2BAA2B,CAAC,CAAC;AAKvD,IAAI,SAA4B,CAAC;AAEjC,IAAI,SAA4B,CAAC;AAEjC,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OA,CAACA,YAAYA;iBAChCA;aACJA,CAAAA;QACLA,CAACA;IACLA,CAACA;IAEDA,SAASA,CAACA,SAASA,CAACA,KAAKA,CAACA,eAAeA,EAAEA,MAAMA,CAACA,CAACA;IACnDA,MAAMA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAACA;AACvBA,CAACA;AA/Be,6BAAqB,GAArB,qBA+Bf,CAAA;AAED,SAAgB,aAAa,CAAC,KAA0B;IACpDC,IAAIA,CAACA,aAAaA,CAACA,UAAUA,CAACA,KAAKA,CAACA,OAAOA,CAACA,CAACA;IAC7CA,MAAMA,CAACA,OAAOA,CAACA,EAAEA,CAACA,CAACA;AACvBA,CAACA;AAHe,qBAAa,GAAb,aAGf,CAAA;AAEwB"}
\ No newline at end of file
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index 09ed60045..1746e81bf 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -4,6 +4,7 @@ We only plan strictly document the breaking changes. The rest is optional.
# v1
* `format` -> `formatCodeOptions` https://github.com/TypeStrong/atom-typescript/issues/178
+* `compileOnSave` is now a tsconfig option : https://github.com/TypeStrong/atom-typescript/issues/187
# Planned
-* No breaking changes yet.
+* No breaking changes yet.
diff --git a/docs/packages.md b/docs/packages.md
index 811d9c317..3e246587d 100644
--- a/docs/packages.md
+++ b/docs/packages.md
@@ -13,7 +13,7 @@ We don't install these but highly recommend them
### Manage your projects
https://github.com/danielbrodin/atom-project-manager
-Atom works on the basis of "folder" based project. It remembers the settings / state for when you open a project.
+Atom works on the basis of "folder" based project. It remembers the settings / state for when you open a project.
This package allows you to quickly open a specific folder. You can even store config options specific to a project e.g. at my work we don't remove whitespace or add a new line to allow people to use whatever editor and not get insignificant diffs on legacy code:
@@ -28,7 +28,7 @@ This package allows you to quickly open a specific folder. You can even store co
'whitespace.ensureSingleTrailingNewline': false
```
-It also allows you to configure options of `atom-typescript` on a per project basis e.g.
+It also allows you to configure options of `atom-typescript` on a per project basis e.g.
```cson
'work':
'title': 'work'
@@ -36,11 +36,11 @@ It also allows you to configure options of `atom-typescript` on a per project ba
'C:\\dev\\work'
],
'settings':
- 'atom-typescript.compileOnSave': false
+ 'atom-typescript.debugAtomTs': false
```
### Jumpy
https://atom.io/packages/jumpy saves a lot of wrist pain.
### Find selection
-https://atom.io/packages/find-selection who has time to bring up the find and replace dialog for a quick find word.
\ No newline at end of file
+https://atom.io/packages/find-selection who has time to bring up the find and replace dialog for a quick find word.
diff --git a/docs/tsconfig.md b/docs/tsconfig.md
index bac6759f2..50844b2f9 100644
--- a/docs/tsconfig.md
+++ b/docs/tsconfig.md
@@ -2,7 +2,7 @@
A unified project format for TypeScript ([see merged PR on Microsoft/TypeScript](https://github.com/Microsoft/TypeScript/pull/1692)). The TypeScript compiler (`1.4` and above) only cares about `compilerOptions` and `files`. We add additional features to this [with the typescript team's approval to extend the file as long as we don't conflict](https://github.com/Microsoft/TypeScript/issues/1955)
# Basic
-The minimal `tsconfig.json` file you need is:
+The minimal `tsconfig.json` file you need is:
```json
{}
```
@@ -12,7 +12,8 @@ i.e. an empty JSON file at the *root* of your project :heart: This will be suffi
* [`compilerOptions`](https://github.com/TypeStrong/atom-typescript/blob/e2fa67c4715189b71430f766ed9a92d9fb3255f9/lib/main/tsconfig/tsconfig.ts#L8-L35): similar to what you would pass on the commandline to `tsc`.
* [`filesGlob`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#filesglob): To make it easier for you to just add / remove files in your project we add `filesGlob` which accepts an array of `glob / minimatch / RegExp` patterns (similar to grunt) to specify source files.
-* [`formatCodeOptions`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#format) : Code formatting options
+* [`formatCodeOptions`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#formatcodeoptions) : Code formatting options
+* [`compileOnSave`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#compileonsave) : Should AtomTS compile on save
* [`version`](https://github.com/TypeStrong/atom-typescript/blob/master/docs/tsconfig.md#version): The TypeScript version
@@ -68,5 +69,8 @@ We pass these to the TypeScript language service as code formatting options.
}
```
+### compileOnSave
+We highly recommend you leave it as the default (true). But if you want you can can disable compile on save from IDEs. This allows you to leave the compilation to external tools. [This is planned to be supported by other IDEs as well.](https://github.com/Microsoft/TypeScript/issues/2326)
+
### version
This exists simply to make it easier for the future you to know which TypeScript version was used when this project file was created. You can read more here [Microsoft/TypeScript#2113](https://github.com/Microsoft/TypeScript/issues/2133)
diff --git a/lib/globals.ts b/lib/globals.ts
index 58b7cd98b..cfbdca88d 100644
--- a/lib/globals.ts
+++ b/lib/globals.ts
@@ -26,7 +26,21 @@ declare module 'escape-html' {
}
-declare module 'atom-space-pen-views'{
+declare module 'atom-space-pen-views' {
import atom = require('atom');
- export class SelectListView extends atom.SelectListView{}
+ export class SelectListView extends atom.SelectListView { }
+}
+
+/** https://github.com/paulmillr/chokidar */
+declare module 'chokidar' {
+ export interface Watcher {
+ on: (event: string, callback: (path: string) => any) => any;
+ }
+
+ export function watch(path, options?: any): Watcher;
+}
+
+declare module 'basarat-text-buffer'{
+ var options;
+ export = options;
}
diff --git a/lib/main/atom/atomConfig.ts b/lib/main/atom/atomConfig.ts
index 1fd940e69..6b5ecfa5b 100644
--- a/lib/main/atom/atomConfig.ts
+++ b/lib/main/atom/atomConfig.ts
@@ -13,18 +13,12 @@ function getConfig(name: string): T {
class Config {
schema = {
- compileOnSave: {
- title: 'Compile on save',
- type: 'boolean',
- default: true
- },
debugAtomTs: {
title: 'Debug: Atom-TypeScript. Please do not use.',
type: 'boolean',
default: false
}
}
- get compileOnSave() { return getConfig('compileOnSave') }
get debugAtomTs() { return getConfig('debugAtomTs') }
get maxSuggestions(): number { return atom.config.get('autocomplete-plus.maxSuggestions') }
}
diff --git a/lib/main/atom/atomUtils.ts b/lib/main/atom/atomUtils.ts
index 8889e0891..af60d98e4 100644
--- a/lib/main/atom/atomUtils.ts
+++ b/lib/main/atom/atomUtils.ts
@@ -76,9 +76,16 @@ export function getTypeScriptEditorsWithPaths() {
.filter(editor=> (path.extname(editor.getPath()) === '.ts'));
}
-export function quickNotify(htmlMessage: string) {
+export function quickNotifySuccess(htmlMessage: string) {
var notification = atom.notifications.addSuccess(htmlMessage, { dismissable: true });
setTimeout(() => {
notification.dismiss()
- }, 600);
+ }, 800);
+}
+
+export function quickNotifyWarning(htmlMessage: string) {
+ var notification = atom.notifications.addWarning(htmlMessage, { dismissable: true });
+ setTimeout(() => {
+ notification.dismiss()
+ }, 800);
}
diff --git a/lib/main/atom/autoCompleteProvider.ts b/lib/main/atom/autoCompleteProvider.ts
index 261b7fce7..0ba76eabf 100644
--- a/lib/main/atom/autoCompleteProvider.ts
+++ b/lib/main/atom/autoCompleteProvider.ts
@@ -93,7 +93,7 @@ interface SnippetDetail {
name: string;
}
-var tsSnipPrefixLookup: { [prefix: string]: SnippetDetail; } = {};
+var tsSnipPrefixLookup: { [prefix: string]: SnippetDetail; } = Object.create(null);
function loadSnippets() {
var confPath = atom.getConfigDirPath();
CSON.readFile(confPath + "/packages/atom-typescript/snippets/typescript-snippets.cson",
@@ -163,17 +163,15 @@ export var provider: autocompleteplus.Provider = {
var position = atomUtils.getEditorPositionForBufferPosition(options.editor, options.bufferPosition);
var promisedSuggestions: Promise
- // TODO: remove updateText once we have edit on change in place
- = parent.updateText({ filePath: filePath, text: options.editor.getText() })
- .then(() => parent.getCompletionsAtPosition({
+ = parent.getCompletionsAtPosition({
filePath: filePath,
position: position,
prefix: options.prefix,
maxSuggestions: atomConfig.maxSuggestions
- }))
+ })
.then((resp) => {
var completionList = resp.completions;
- var suggestions = completionList.map(c => {
+ var suggestions = completionList.map((c):autocompleteplus.Suggestion => {
return {
text: c.name,
replacementPrefix: resp.endsInPunctuation ? '' : options.prefix,
@@ -187,12 +185,12 @@ export var provider: autocompleteplus.Provider = {
// you only get the snippet suggested after you have typed
// the full trigger word/ prefex
// and then it replaces a keyword/match that might also be present, e.g. "class"
- suggestions.unshift({
- text: null, // BUG IN THE TS COMPILER. text is optional but TS is refusing.
+ let suggestion:autocompleteplus.Suggestion = {
snippet: tsSnipPrefixLookup[options.prefix].body,
replacementPrefix: options.prefix,
rightLabelHTML: "snippet: " + options.prefix,
- });
+ };
+ suggestions.unshift(suggestion);
}
return suggestions;
diff --git a/lib/main/atom/commands.ts b/lib/main/atom/commands.ts
index 61ddefb1d..acde88e60 100644
--- a/lib/main/atom/commands.ts
+++ b/lib/main/atom/commands.ts
@@ -28,7 +28,7 @@ function commandForTypeScript(e) {
export function registerCommands() {
// Setup custom commands NOTE: these need to be added to the keymaps
- atom.commands.add('atom-text-editor', 'typescript:format-code',(e) => {
+ atom.commands.add('atom-text-editor', 'typescript:format-code', (e) => {
if (!commandForTypeScript(e)) return;
var editor = atom.workspace.getActiveTextEditor();
@@ -42,18 +42,22 @@ export function registerCommands() {
if (result.formatted == currentText) return;
var top = editor.getScrollTop();
- editor.setText(result.formatted);
+ editor.transact(()=>{
+ editor.setText(result.formatted);
+ });
editor.setCursorBufferPosition([result.cursor.line, result.cursor.ch]);
editor.setScrollTop(top);
});
} else {
parent.formatDocumentRange({ filePath: filePath, start: { line: selection.start.row, ch: selection.start.column }, end: { line: selection.end.row, ch: selection.end.column } }).then((res) => {
- editor.setTextInBufferRange(selection, res.formatted);
+ editor.transact(()=>{
+ editor.setTextInBufferRange(selection, res.formatted);
+ });
});
}
});
- atom.commands.add('atom-workspace', 'typescript:build',(e) => {
+ atom.commands.add('atom-workspace', 'typescript:build', (e) => {
if (!commandForTypeScript(e)) return;
var editor = atom.workspace.getActiveTextEditor();
@@ -97,23 +101,28 @@ export function registerCommands() {
atom.commands.add('atom-text-editor', 'symbols-view:go-to-declaration', handleGoToDeclaration);
var theContextView: contextView.ContextView;
- atom.commands.add('atom-text-editor', 'typescript:context-actions',(e) => {
- if(!theContextView) theContextView = new contextView.ContextView();
+ atom.commands.add('atom-text-editor', 'typescript:context-actions', (e) => {
+ if (!theContextView) theContextView = new contextView.ContextView();
theContextView.show();
atom.notifications.addSuccess('Context options coming soon!');
});
- atom.commands.add('atom-text-editor', 'typescript:autocomplete',(e) => {
+ atom.commands.add('atom-text-editor', 'typescript:autocomplete', (e) => {
autoCompleteProvider.triggerAutocompletePlus();
});
- atom.commands.add('atom-text-editor', 'typescript:here-for-development-testing',(e) => {
- documentationView.docView.hide();
- documentationView.docView.autoPosition();
- documentationView.testDocumentationView();
+ atom.commands.add('atom-text-editor', 'typescript:bas-development-testing', (e) => {
+ // documentationView.docView.hide();
+ // documentationView.docView.autoPosition();
+ // documentationView.testDocumentationView();
+ parent.debugLanguageServiceHostVersion({ filePath: atom.workspace.getActiveEditor().getPath() })
+ .then((res) => {
+ console.log(res.text.length);
+ // console.log(JSON.stringify({txt:res.text}))
+ });
});
- atom.commands.add('atom-text-editor', 'typescript:rename-variable',(e) => {
+ atom.commands.add('atom-text-editor', 'typescript:rename-variable', (e) => {
parent.getRenameInfo(atomUtils.getFilePathPosition()).then((res) => {
if (!res.canRename) {
atom.notifications.addInfo('AtomTS: Rename not available at cursor location');
@@ -127,13 +136,16 @@ export function registerCommands() {
// if file is open change in buffer
// otherwise open the file and change the buffer range
- atomUtils.getEditorsForAllPaths(res.locations.map(l=> l.filePath))
+ atomUtils.getEditorsForAllPaths(Object.keys(res.locations))
.then((editorMap) => {
- // Reverse as we want to make the bottom changes first
- res.locations.reverse().forEach((location) => {
- var editor = editorMap[location.filePath];
- var range = atomUtils.getRangeForTextSpan(editor, location.textSpan);
- editor.setTextInBufferRange(range, newText);
+ Object.keys(res.locations).forEach((filePath) => {
+ var editor = editorMap[filePath];
+ editor.transact(() => {
+ res.locations[filePath].forEach((textSpan) => {
+ var range = atomUtils.getRangeForTextSpan(editor, textSpan);
+ editor.setTextInBufferRange(range, newText);
+ });
+ })
});
});
}
diff --git a/lib/main/atom/errorView.ts b/lib/main/atom/errorView.ts
index 28e1d5aeb..61dfe6ecc 100644
--- a/lib/main/atom/errorView.ts
+++ b/lib/main/atom/errorView.ts
@@ -22,7 +22,13 @@ var filePathErrors: utils.Dict = new utils.Dict();
export var setErrors = (filePath: string, errorsForFile: project.TSError[]) => {
if (!errorsForFile.length) filePathErrors.clearValue(filePath);
- else filePathErrors.setValue(filePath, errorsForFile);
+ else {
+ // Currently we are limiting errors
+ // To many errors crashes our display
+ if (errorsForFile.length > 50) errorsForFile = errorsForFile.slice(0, 50);
+
+ filePathErrors.setValue(filePath, errorsForFile)
+ };
// TODO: this needs to be optimized at some point
mainPanelView.panelView.clearError();
@@ -51,11 +57,11 @@ export var setErrors = (filePath: string, errorsForFile: project.TSError[]) => {
export function showEmittedMessage(output: project.EmitOutput) {
if (output.success) {
- var message = 'TS emit succeeded';
- atomUtils.quickNotify(message);
+ var message = 'TS emit succeeded
' + output.outputFiles.join('
');
+ atomUtils.quickNotifySuccess(message);
} else if (output.emitError) {
atom.notifications.addError('TS Emit Failed');
} else {
- atom.notifications.addWarning('Compile failed but emit succeeded:
' + output.outputFiles.join('
'));
+ atomUtils.quickNotifyWarning('Compile failed but emit succeeded
' + output.outputFiles.join('
'));
}
}
diff --git a/lib/main/atom/onSaveHandler.ts b/lib/main/atom/onSaveHandler.ts
index aa92772b1..fee247aee 100644
--- a/lib/main/atom/onSaveHandler.ts
+++ b/lib/main/atom/onSaveHandler.ts
@@ -14,10 +14,14 @@ import errorView = require('./errorView'); ///ts:import:generated
import debugAtomTs = require('./debugAtomTs'); ///ts:import:generated
export function handle(event: { filePath: string; editor: AtomCore.IEditor }) {
+ // As a fall back to make sure we sync up in case of anything bad happening elsewhere.
var textUpdated = parent.updateText({ filePath: event.filePath, text: event.editor.getText() });
- if (atomConfig.compileOnSave) {
+ // Compile on save
+ parent.getProjectFileDetails({ filePath: event.filePath }).then(fileDetails => {
+ if (!fileDetails.project.compileOnSave) return;
+
textUpdated.then(() => parent.emitFile({ filePath: event.filePath }))
.then((res) => errorView.showEmittedMessage(res));
- }
+ });
}
diff --git a/lib/main/atom/typescriptGrammar.ts b/lib/main/atom/typescriptGrammar.ts
index dd9c1fc99..ec6e73c0d 100644
--- a/lib/main/atom/typescriptGrammar.ts
+++ b/lib/main/atom/typescriptGrammar.ts
@@ -82,7 +82,7 @@ export class TypeScriptSemanticGrammar extends AtomTSBaseGrammar {
////////////////////////////////// THE REMAINING CODE IS SPECIFIC TO US ////////////////////////////////////////
///////////////////
- classifier: ts.Classifier = ts.createClassifier({ log: () => undefined });
+ classifier: ts.Classifier = ts.createClassifier();
// Useful to tokenize these differently for autocomplete ease
fullTripleSlashReferencePathRegEx = /^(\/\/\/\s*/;
@@ -219,7 +219,6 @@ function getAtomStyleForToken(token: ts.ClassificationInfo, str: string): string
case TokenClass.Whitespace:
return 'whitespace';
case TokenClass.Identifier:
- if (!str.trim()) return ''; // Hacky fix for https://github.com/Microsoft/TypeScript/issues/1997
return 'identifier';
case TokenClass.NumberLiteral:
return 'constant.numeric';
diff --git a/lib/main/atomts.ts b/lib/main/atomts.ts
index 934f6a54e..a55b88822 100644
--- a/lib/main/atomts.ts
+++ b/lib/main/atomts.ts
@@ -3,6 +3,7 @@
import path = require('path');
import fs = require('fs');
+import os = require('os');
// Make sure we have the packages we depend upon
var apd = require('atom-package-dependencies');
@@ -111,6 +112,13 @@ function readyToActivate() {
errorView.start();
debugAtomTs.runDebugCode({ filePath, editor });
+ // Set errors in project per file
+ if(onDisk){
+ parent.updateText({ filePath: filePath, text: editor.getText() })
+ .then(() => parent.errorsForFile({ filePath: filePath }))
+ .then((resp) => errorView.setErrors(filePath, resp.errors));
+ }
+
// Observe editors changing
var changeObserver = editor.onDidStopChanging(() => {
@@ -123,12 +131,8 @@ function readyToActivate() {
return;
}
- var text = editor.getText();
-
- // Update the file in the worker
- parent.updateText({ filePath: filePath, text: text })
// Set errors in project per file
- .then(() => parent.errorsForFile({ filePath: filePath }))
+ parent.errorsForFile({ filePath: filePath })
.then((resp) => errorView.setErrors(filePath, resp.errors));
// TODO: provide function completions
@@ -142,8 +146,38 @@ function readyToActivate() {
});
- var fasterChangeObserver: AtomCore.Disposable = (editor.getBuffer()).onDidChange((diff: { oldRange; newRange; oldText: string; newText: string }) => {
- // TODO: use this for faster language service host
+ var buffer = editor.buffer;
+ var fasterChangeObserver: AtomCore.Disposable = (editor.buffer).onDidChange((diff: { oldRange; newRange; oldText: string; newText: string }) => {
+
+ //// For debugging
+ // console.log(buffer.characterIndexForPosition(diff.oldRange.start), buffer.characterIndexForPosition(diff.oldRange.end), diff.oldText,
+ // buffer.characterIndexForPosition(diff.newRange.start), buffer.characterIndexForPosition(diff.newRange.end), diff.newText);
+ //// Examples
+ //// 20 20 "aaaa" 20 20 ""
+ //// 23 23 "" 23 24 "a"
+ //// 20 20 "" 20 24 "aaaa"
+
+ // Atom only gives you an `\n` as diff but it sometimes inserts \r\n. Facepalm.
+ var newText = diff.newText;
+ // console.log(JSON.stringify({txt:newText}));
+ // This works reliably
+ newText = editor.buffer.getTextInRange(diff.newRange);
+
+ // use this for faster language service host
+ var minChar = buffer.characterIndexForPosition(diff.oldRange.start);
+ var limChar = minChar + diff.oldText.length;
+
+ var promise = parent.editText({ filePath, minChar, limChar, newText });
+
+ // For debugging the language service going out of sync
+ // promise.then(()=>{
+ // parent.debugLanguageServiceHostVersion({filePath:atom.workspace.getActiveEditor().getPath()})
+ // .then((res)=>{
+ // console.log(JSON.stringify({real:editor.getText()}));
+ // console.log(JSON.stringify({lang:res.text}));
+ // console.log(editor.getText() == res.text);
+ // });
+ // });
});
// Observe editors saving
diff --git a/lib/main/lang/languageServiceHost.ts b/lib/main/lang/languageServiceHost.ts
index bada507c3..571767c96 100644
--- a/lib/main/lang/languageServiceHost.ts
+++ b/lib/main/lang/languageServiceHost.ts
@@ -1,200 +1,1104 @@
-// Copyright 2013-2014 François de Campredon
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-///ts:ref=atom.d
-/// ///ts:ref:generated
-
-'use strict';
-
import ts = require('typescript');
-import path = require('path');
-import utils = require('./utils');
-import fs = require('fs');
-import tsconfig = require('../tsconfig/tsconfig');
+module debug{
+ export function stack(){
+ console.error(((new Error())).stack);
+ }
+}
-export interface Position {
+// For additional fixes we needed to do, look for
+// atom
+
+////////////////// STUFF FROM TS NOT EXPORTED
+function createTextSpan(start, length) {
+ if (start < 0) {
+ throw new Error("start < 0");
+ }
+ if (length < 0) {
+ throw new Error("length < 0");
+ }
+ return { start: start, length: length };
+}
+function createTextChangeRange(span, newLength) {
+ if (newLength < 0) {
+ throw new Error("newLength < 0");
+ }
+ return { span: span, newLength: newLength };
+}
+function textSpanEnd(span) {
+ return span.start + span.length;
+}
+function collapseTextChangeRangesAcrossMultipleVersions(changes) {
+ if (changes.length === 0) {
+ return unchangedTextChangeRange;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = textSpanEnd(change0.span);
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = textSpanEnd(nextChange.span);
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return createTextChangeRange(createTextSpanFromBounds(oldStartN, oldEndN), newEndN - oldStartN);
+}
+function createTextSpanFromBounds(start, end) {
+ return createTextSpan(start, end - start);
+}
+var unchangedTextChangeRange = createTextChangeRange(createTextSpan(0, 0), 0);
+
+// Map stuff
+var hasOwnProperty = Object.prototype.hasOwnProperty;
+function hasProperty(map, key) {
+ return hasOwnProperty.call(map, key);
+}
+function lookUp(map, key) {
+ return hasProperty(map, key) ? map[key] : undefined;
+}
+////////////////// END STUFF FROM TS
+
+////////////////// STUFF FROM SYS
+import _fs = require('fs');
+module sys{
+ export function readFile(fileName) {
+ if (!_fs.existsSync(fileName)) {
+ return undefined;
+ }
+ var buffer = _fs.readFileSync(fileName);
+ var len = buffer.length;
+ if (len >= 2 && buffer[0] === 0xFE && buffer[1] === 0xFF) {
+ len &= ~1;
+ for (var i = 0; i < len; i += 2) {
+ var temp = buffer[i];
+ buffer[i] = buffer[i + 1];
+ buffer[i + 1] = temp;
+ }
+ return buffer.toString("utf16le", 2);
+ }
+ if (len >= 2 && buffer[0] === 0xFF && buffer[1] === 0xFE) {
+ return buffer.toString("utf16le", 2);
+ }
+ if (len >= 3 && buffer[0] === 0xEF && buffer[1] === 0xBB && buffer[2] === 0xBF) {
+ return buffer.toString("utf8", 3);
+ }
+ return buffer.toString("utf8");
+ }
+ export function writeFile(fileName, data, writeByteOrderMark) {
+ if (writeByteOrderMark) {
+ data = '\uFEFF' + data;
+ }
+ _fs.writeFileSync(fileName, data, "utf8");
+ }
+}
+///////////////// END STUFF FROM SYS
+
+class LineLeaf implements LineCollection {
+ udata: any;
+
+ constructor(public text: string) {
+
+ }
+
+ setUdata(data: any) {
+ this.udata = data;
+ }
+
+ getUdata() {
+ return this.udata;
+ }
+
+ isLeaf() {
+ return true;
+ }
+
+ walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker) {
+ walkFns.leaf(rangeStart, rangeLength, this);
+ }
+
+ charCount() {
+ return this.text.length;
+ }
+
+ lineCount() {
+ return 1;
+ }
+}
+
+enum CharRangeSection {
+ PreStart,
+ Start,
+ Entire,
+ Mid,
+ End,
+ PostEnd
+}
+
+interface ILineIndexWalker {
+ goSubtree: boolean;
+ done: boolean;
+ leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void;
+ pre? (relativeStart: number, relativeLength: number, lineCollection: LineCollection,
+ parent: LineNode, nodeType: CharRangeSection): LineCollection;
+ post? (relativeStart: number, relativeLength: number, lineCollection: LineCollection,
+ parent: LineNode, nodeType: CharRangeSection): LineCollection;
+}
+
+interface LineCollection {
+ charCount(): number;
+ lineCount(): number;
+ isLeaf(): boolean;
+ walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker): void;
+}
+
+export interface ILineInfo {
line: number;
- ch: number;
+ col: number;
+ text?: string;
+ leaf?: LineLeaf;
}
-interface ScriptInfo {
- getFileName(): string;
- getContent(): string;
- getVersion(): number;
- getIsOpen(): boolean;
- setIsOpen(val: boolean): void;
- getEditRanges(): ts.TextChangeRange[];
- getLineStarts(): number[];
+var lineCollectionCapacity = 4;
+
+export class LineNode implements LineCollection {
+ totalChars = 0;
+ totalLines = 0;
+ children: LineCollection[] = [];
+
+ isLeaf() {
+ return false;
+ }
+
+ updateCounts() {
+ this.totalChars = 0;
+ this.totalLines = 0;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ var child = this.children[i];
+ this.totalChars += child.charCount();
+ this.totalLines += child.lineCount();
+ }
+ }
+
+ execWalk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker, childIndex: number, nodeType: CharRangeSection) {
+ if (walkFns.pre) {
+ walkFns.pre(rangeStart, rangeLength, this.children[childIndex], this, nodeType);
+ }
+ if (walkFns.goSubtree) {
+ this.children[childIndex].walk(rangeStart, rangeLength, walkFns);
+ if (walkFns.post) {
+ walkFns.post(rangeStart, rangeLength, this.children[childIndex], this, nodeType);
+ }
+ }
+ else {
+ walkFns.goSubtree = true;
+ }
+ return walkFns.done;
+ }
+
+ skipChild(relativeStart: number, relativeLength: number, childIndex: number, walkFns: ILineIndexWalker, nodeType: CharRangeSection) {
+ if (walkFns.pre && (!walkFns.done)) {
+ walkFns.pre(relativeStart, relativeLength, this.children[childIndex], this, nodeType);
+ walkFns.goSubtree = true;
+ }
+ }
+
+ walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker) {
+ // assume (rangeStart < this.totalChars) && (rangeLength <= this.totalChars)
+ var childIndex = 0;
+ var child = this.children[0];
+ var childCharCount = child.charCount();
+ // find sub-tree containing start
+ var adjustedStart = rangeStart;
+ while (adjustedStart >= childCharCount) {
+ this.skipChild(adjustedStart, rangeLength, childIndex, walkFns, CharRangeSection.PreStart);
+ adjustedStart -= childCharCount;
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ }
+ // Case I: both start and end of range in same subtree
+ if ((adjustedStart + rangeLength) <= childCharCount) {
+ if (this.execWalk(adjustedStart, rangeLength, walkFns, childIndex, CharRangeSection.Entire)) {
+ return;
+ }
+ }
+ else {
+ // Case II: start and end of range in different subtrees (possibly with subtrees in the middle)
+ if (this.execWalk(adjustedStart, childCharCount - adjustedStart, walkFns, childIndex, CharRangeSection.Start)) {
+ return;
+ }
+ var adjustedLength = rangeLength - (childCharCount - adjustedStart);
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ while (adjustedLength > childCharCount) {
+ if (this.execWalk(0, childCharCount, walkFns, childIndex, CharRangeSection.Mid)) {
+ return;
+ }
+ adjustedLength -= childCharCount;
+ child = this.children[++childIndex];
+ childCharCount = child.charCount();
+ }
+ if (adjustedLength > 0) {
+ if (this.execWalk(0, adjustedLength, walkFns, childIndex, CharRangeSection.End)) {
+ return;
+ }
+ }
+ }
+ // Process any subtrees after the one containing range end
+ if (walkFns.pre) {
+ var clen = this.children.length;
+ if (childIndex < (clen - 1)) {
+ for (var ej = childIndex + 1; ej < clen; ej++) {
+ this.skipChild(0, 0, ej, walkFns, CharRangeSection.PostEnd);
+ }
+ }
+ }
+ }
+
+ charOffsetToLineNumberAndPos(lineNumber: number, charOffset: number): ILineInfo {
+ var childInfo = this.childFromCharOffset(lineNumber, charOffset);
+ if (!childInfo.child) {
+ return {
+ line: lineNumber,
+ col: charOffset,
+ }
+ }
+ else if (childInfo.childIndex < this.children.length) {
+ if (childInfo.child.isLeaf()) {
+ return {
+ line: childInfo.lineNumber,
+ col: childInfo.charOffset,
+ text: ((childInfo.child)).text,
+ leaf: ((childInfo.child))
+ };
+ }
+ else {
+ var lineNode = (childInfo.child);
+ return lineNode.charOffsetToLineNumberAndPos(childInfo.lineNumber, childInfo.charOffset);
+ }
+ }
+ else {
+ var lineInfo = this.lineNumberToInfo(this.lineCount(), 0);
+ // atom start
+ var col = 1;
+ if(lineInfo.leaf) col = lineInfo.leaf.charCount();
+ return { line: this.lineCount(), col: col };
+ // atom old
+ // return { line: this.lineCount(), col: lineInfo.leaf.charCount() };
+ // atom end
+ }
+ }
+
+ lineNumberToInfo(lineNumber: number, charOffset: number): ILineInfo {
+ var childInfo = this.childFromLineNumber(lineNumber, charOffset);
+ if (!childInfo.child) {
+ return {
+ line: lineNumber,
+ col: charOffset
+ }
+ }
+ else if (childInfo.child.isLeaf()) {
+ return {
+ line: lineNumber,
+ col: childInfo.charOffset,
+ text: ((childInfo.child)).text,
+ leaf: ((childInfo.child))
+ }
+ }
+ else {
+ var lineNode = (childInfo.child);
+ return lineNode.lineNumberToInfo(childInfo.relativeLineNumber, childInfo.charOffset);
+ }
+ }
+
+ childFromLineNumber(lineNumber: number, charOffset: number) {
+ var child: LineCollection;
+ var relativeLineNumber = lineNumber;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ child = this.children[i];
+ var childLineCount = child.lineCount();
+ if (childLineCount >= relativeLineNumber) {
+ break;
+ }
+ else {
+ relativeLineNumber -= childLineCount;
+ charOffset += child.charCount();
+ }
+ }
+ return {
+ child: child,
+ childIndex: i,
+ relativeLineNumber: relativeLineNumber,
+ charOffset: charOffset
+ };
+ }
+
+ childFromCharOffset(lineNumber: number, charOffset: number) {
+ var child: LineCollection;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ child = this.children[i];
+ if (child.charCount() > charOffset) {
+ break;
+ }
+ else {
+ charOffset -= child.charCount();
+ lineNumber += child.lineCount();
+ }
+ }
+ return {
+ child: child,
+ childIndex: i,
+ charOffset: charOffset,
+ lineNumber: lineNumber
+ }
+ }
+
+ splitAfter(childIndex: number) {
+ var splitNode: LineNode;
+ var clen = this.children.length;
+ childIndex++;
+ var endLength = childIndex;
+ if (childIndex < clen) {
+ splitNode = new LineNode();
+ while (childIndex < clen) {
+ splitNode.add(this.children[childIndex++]);
+ }
+ splitNode.updateCounts();
+ }
+ this.children.length = endLength;
+ return splitNode;
+ }
+ remove(child: LineCollection) {
+ var childIndex = this.findChildIndex(child);
+ var clen = this.children.length;
+ if (childIndex < (clen - 1)) {
+ for (var i = childIndex; i < (clen - 1); i++) {
+ this.children[i] = this.children[i + 1];
+ }
+ }
+ this.children.length--;
+ }
- updateContent(newContent: string): void;
- editContent(minChar: number, limChar: number, newText: string): void;
- getPositionFromLine(line: number, ch: number): number;
- getLineAndColForPositon(position: number): Position;
+ findChildIndex(child: LineCollection) {
+ var childIndex = 0;
+ var clen = this.children.length;
+ while ((this.children[childIndex] != child) && (childIndex < clen)) childIndex++;
+ return childIndex;
+ }
+
+ insertAt(child: LineCollection, nodes: LineCollection[]) {
+ var childIndex = this.findChildIndex(child);
+ var clen = this.children.length;
+ var nodeCount = nodes.length;
+ // if child is last and there is more room and only one node to place, place it
+ if ((clen < lineCollectionCapacity) && (childIndex == (clen - 1)) && (nodeCount == 1)) {
+ this.add(nodes[0]);
+ this.updateCounts();
+ return [];
+ }
+ else {
+ var shiftNode = this.splitAfter(childIndex);
+ var nodeIndex = 0;
+ childIndex++;
+ while ((childIndex < lineCollectionCapacity) && (nodeIndex < nodeCount)) {
+ this.children[childIndex++] = nodes[nodeIndex++];
+ }
+ var splitNodes: LineNode[] = [];
+ var splitNodeCount = 0;
+ if (nodeIndex < nodeCount) {
+ splitNodeCount = Math.ceil((nodeCount - nodeIndex) / lineCollectionCapacity);
+ splitNodes = new Array(splitNodeCount);
+ var splitNodeIndex = 0;
+ for (var i = 0; i < splitNodeCount; i++) {
+ splitNodes[i] = new LineNode();
+ }
+ var splitNode = splitNodes[0];
+ while (nodeIndex < nodeCount) {
+ splitNode.add(nodes[nodeIndex++]);
+ if (splitNode.children.length == lineCollectionCapacity) {
+ splitNodeIndex++;
+ splitNode = splitNodes[splitNodeIndex];
+ }
+ }
+ for (i = splitNodes.length - 1; i >= 0; i--) {
+ if (splitNodes[i].children.length == 0) {
+ splitNodes.length--;
+ }
+ }
+ }
+ if (shiftNode) {
+ splitNodes[splitNodes.length] = shiftNode;
+ }
+ this.updateCounts();
+ for (i = 0; i < splitNodeCount; i++) {
+ (splitNodes[i]).updateCounts();
+ }
+ return splitNodes;
+ }
+ }
+
+ // assume there is room for the item; return true if more room
+ add(collection: LineCollection) {
+ this.children[this.children.length] = collection;
+ return (this.children.length < lineCollectionCapacity);
+ }
+
+ charCount() {
+ return this.totalChars;
+ }
+
+ lineCount() {
+ return this.totalLines;
+ }
}
-interface ITextBuffer extends TextBuffer.ITextBuffer{}
-/**
- * Manage a script in the language service host
- */
-function createScriptInfo(fileName: string, content: string, isOpen = false): ScriptInfo {
+class BaseLineIndexWalker implements ILineIndexWalker {
+ goSubtree = true;
+ done = false;
+ leaf(rangeStart: number, rangeLength: number, ll: LineLeaf) {
+ }
+}
+class EditWalker extends BaseLineIndexWalker {
+ lineIndex = new LineIndex();
+ // path to start of range
+ startPath: LineCollection[];
+ endBranch: LineCollection[] = [];
+ branchNode: LineNode;
+ // path to current node
+ stack: LineNode[];
+ state = CharRangeSection.Entire;
+ lineCollectionAtBranch: LineCollection;
+ initialText = "";
+ trailingText = "";
+ suppressTrailingText = false;
- var version: number = 1;
- var editRanges: ts.TextChangeRange[] = [];
+ constructor() {
+ super();
+ this.lineIndex.root = new LineNode();
+ this.startPath = [this.lineIndex.root];
+ this.stack = [this.lineIndex.root];
+ }
- var _lineStarts: number[];
- var _lineStartIsDirty = true;
+ insertLines(insertedText: string) {
+ if (this.suppressTrailingText) {
+ this.trailingText = "";
+ }
+ if (insertedText) {
+ insertedText = this.initialText + insertedText + this.trailingText;
+ }
+ else {
+ insertedText = this.initialText + this.trailingText;
+ }
+ var lm = LineIndex.linesFromText(insertedText);
+ var lines = lm.lines;
+ if (lines.length > 1) {
+ if (lines[lines.length - 1] == "") {
+ lines.length--;
+ }
+ }
+ var branchParent: LineNode;
+ var lastZeroCount: LineCollection;
- function getLineStarts() {
- if (_lineStartIsDirty) {
- // TODO: pref
- _lineStarts = ts.computeLineStarts(content);
- _lineStartIsDirty = false;
+ for (var k = this.endBranch.length - 1; k >= 0; k--) {
+ (this.endBranch[k]).updateCounts();
+ if (this.endBranch[k].charCount() == 0) {
+ lastZeroCount = this.endBranch[k];
+ if (k > 0) {
+ branchParent = this.endBranch[k - 1];
+ }
+ else {
+ branchParent = this.branchNode;
+ }
+ }
}
- return _lineStarts;
+ if (lastZeroCount) {
+ branchParent.remove(lastZeroCount);
+ }
+
+ // path at least length two (root and leaf)
+ var insertionNode = this.startPath[this.startPath.length - 2];
+ var leafNode = this.startPath[this.startPath.length - 1];
+ var len = lines.length;
+
+ if (len > 0) {
+ leafNode.text = lines[0];
+
+ if (len > 1) {
+ var insertedNodes = new Array(len - 1);
+ var startNode = leafNode;
+ for (var i = 1, len = lines.length; i < len; i++) {
+ insertedNodes[i - 1] = new LineLeaf(lines[i]);
+ }
+ var pathIndex = this.startPath.length - 2;
+ while (pathIndex >= 0) {
+ insertionNode = this.startPath[pathIndex];
+ insertedNodes = insertionNode.insertAt(startNode, insertedNodes);
+ pathIndex--;
+ startNode = insertionNode;
+ }
+ var insertedNodesLen = insertedNodes.length;
+ while (insertedNodesLen > 0) {
+ var newRoot = new LineNode();
+ newRoot.add(this.lineIndex.root);
+ insertedNodes = newRoot.insertAt(this.lineIndex.root, insertedNodes);
+ insertedNodesLen = insertedNodes.length;
+ this.lineIndex.root = newRoot;
+ }
+ this.lineIndex.root.updateCounts();
+ }
+ else {
+ for (var j = this.startPath.length - 2; j >= 0; j--) {
+ (this.startPath[j]).updateCounts();
+ }
+ }
+ }
+ else {
+ // no content for leaf node, so delete it
+ insertionNode.remove(leafNode);
+ for (var j = this.startPath.length - 2; j >= 0; j--) {
+ (this.startPath[j]).updateCounts();
+ }
+ }
+
+ return this.lineIndex;
}
- /**
- * update the content of the script
- *
- * @param newContent the new script content
- */
- function updateContent(newContent: string): void {
- content = newContent;
- _lineStartIsDirty = true;
- editRanges = [];
- version++;
+ post(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineCollection, nodeType: CharRangeSection): LineCollection {
+ // have visited the path for start of range, now looking for end
+ // if range is on single line, we will never make this state transition
+ if (lineCollection == this.lineCollectionAtBranch) {
+ this.state = CharRangeSection.End;
+ }
+ // always pop stack because post only called when child has been visited
+ this.stack.length--;
+ return undefined;
}
+ pre(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineCollection, nodeType: CharRangeSection) {
+ // currentNode corresponds to parent, but in the new tree
+ var currentNode = this.stack[this.stack.length - 1];
- /**
- * edit the script content
- *
- * @param minChar the index in the file content where the edition begins
- * @param limChar the index in the file content where the edition ends
- * @param newText the text inserted
- */
- function editContent(minChar: number, limChar: number, newText: string): void {
- // Apply edits
- var prefix = content.substring(0, minChar);
- var middle = newText;
- var suffix = content.substring(limChar);
- content = prefix + middle + suffix;
- _lineStartIsDirty = true;
+ if ((this.state == CharRangeSection.Entire) && (nodeType == CharRangeSection.Start)) {
+ // if range is on single line, we will never make this state transition
+ this.state = CharRangeSection.Start;
+ this.branchNode = currentNode;
+ this.lineCollectionAtBranch = lineCollection;
+ }
+ var child: LineCollection;
+ function fresh(node: LineCollection): LineCollection {
+ if (node.isLeaf()) {
+ return new LineLeaf("");
+ }
+ else return new LineNode();
+ }
+ switch (nodeType) {
+ case CharRangeSection.PreStart:
+ this.goSubtree = false;
+ if (this.state != CharRangeSection.End) {
+ currentNode.add(lineCollection);
+ }
+ break;
+ case CharRangeSection.Start:
+ if (this.state == CharRangeSection.End) {
+ this.goSubtree = false;
+ }
+ else {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.startPath[this.startPath.length] = child;
+ }
+ break;
+ case CharRangeSection.Entire:
+ if (this.state != CharRangeSection.End) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.startPath[this.startPath.length] = child;
+ }
+ else {
+ if (!lineCollection.isLeaf()) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.endBranch[this.endBranch.length] = child;
+ }
+ }
+ break;
+ case CharRangeSection.Mid:
+ this.goSubtree = false;
+ break;
+ case CharRangeSection.End:
+ if (this.state != CharRangeSection.End) {
+ this.goSubtree = false;
+ }
+ else {
+ if (!lineCollection.isLeaf()) {
+ child = fresh(lineCollection);
+ currentNode.add(child);
+ this.endBranch[this.endBranch.length] = child;
+ }
+ }
+ break;
+ case CharRangeSection.PostEnd:
+ this.goSubtree = false;
+ if (this.state != CharRangeSection.Start) {
+ currentNode.add(lineCollection);
+ }
+ break;
+ }
+ if (this.goSubtree) {
+ this.stack[this.stack.length] = child;
+ }
+ return lineCollection;
+ }
+ // just gather text from the leaves
+ leaf(relativeStart: number, relativeLength: number, ll: LineLeaf) {
+ if (this.state == CharRangeSection.Start) {
+ this.initialText = ll.text.substring(0, relativeStart);
+ }
+ else if (this.state == CharRangeSection.Entire) {
+ this.initialText = ll.text.substring(0, relativeStart);
+ this.trailingText = ll.text.substring(relativeStart + relativeLength);
+ }
+ else {
+ // state is CharRangeSection.End
+ this.trailingText = ll.text.substring(relativeStart + relativeLength);
+ }
+ }
+}
- // Store edit range + new length of script
- editRanges.push(new ts.TextChangeRange(
- ts.TextSpan.fromBounds(minChar, limChar),
- newText.length
- ));
+export class LineIndex {
+ root: LineNode;
+ // set this to true to check each edit for accuracy
+ checkEdits = false;
- // Update version #
- version++;
+ charOffsetToLineNumberAndPos(charOffset: number) {
+ return this.root.charOffsetToLineNumberAndPos(1, charOffset);
}
+ lineNumberToInfo(lineNumber: number): ILineInfo {
+ var lineCount = this.root.lineCount();
+ if (lineNumber <= lineCount) {
+ var lineInfo = this.root.lineNumberToInfo(lineNumber, 0);
+ lineInfo.line = lineNumber;
+ return lineInfo;
+ }
+ else {
+ return {
+ line: lineNumber,
+ col: this.root.charCount()
+ }
+ }
+ }
+
+ load(lines: string[]) {
+ if (lines.length > 0) {
+ var leaves: LineLeaf[] = [];
+ for (var i = 0, len = lines.length; i < len; i++) {
+ leaves[i] = new LineLeaf(lines[i]);
+ }
+ this.root = LineIndex.buildTreeFromBottom(leaves);
+ }
+ else {
+ this.root = new LineNode();
+ }
+ }
+ walk(rangeStart: number, rangeLength: number, walkFns: ILineIndexWalker) {
+ this.root.walk(rangeStart, rangeLength, walkFns);
+ }
- /**
- * return an index position from line an character position
- *
- * @param line line number
- * @param character charecter poisiton in the line
- */
- function getPositionFromLine(line: number, ch: number) {
- return getLineStarts()[line] + ch;
+ getText(rangeStart: number, rangeLength: number) {
+ var accum = "";
+ if ((rangeLength > 0) && (rangeStart < this.root.charCount())) {
+ this.walk(rangeStart, rangeLength, {
+ goSubtree: true,
+ done: false,
+ leaf: (relativeStart: number, relativeLength: number, ll: LineLeaf) => {
+ accum = accum.concat(ll.text.substring(relativeStart, relativeStart + relativeLength));
+ }
+ });
+ }
+ return accum;
}
- /**
- * return line and chararacter position from index position
- *
- * @param position
- */
- function getLineAndColForPositon(position: number) {
- if (position < 0 || position > content.length) {
- throw new RangeError('Argument out of range: position');
+ every(f: (ll: LineLeaf, s: number, len: number) => boolean, rangeStart: number, rangeEnd?: number) {
+ if (!rangeEnd) {
+ rangeEnd = this.root.charCount();
}
- var lineStarts = getLineStarts();
- var lineNumber = utils.binarySearch(lineStarts, position);
- if (lineNumber < 0) {
- lineNumber = (~lineNumber) - 1;
+ var walkFns = {
+ goSubtree: true,
+ done: false,
+ leaf: function (relativeStart: number, relativeLength: number, ll: LineLeaf) {
+ if (!f(ll, relativeStart, relativeLength)) {
+ this.done = true;
+ }
+ }
}
- return {
- line: lineNumber,
- ch: position - lineStarts[lineNumber]
- };
+ this.walk(rangeStart, rangeEnd - rangeStart, walkFns);
+ return !walkFns.done;
}
+ edit(pos: number, deleteLength: number, newText?: string) {
+ function editFlat(source: string, s: number, dl: number, nt = "") {
+ return source.substring(0, s) + nt + source.substring(s + dl, source.length);
+ }
+ if (this.root.charCount() == 0) {
+ // TODO: assert deleteLength == 0
+ if (newText) {
+ this.load(LineIndex.linesFromText(newText).lines);
+ return this;
+ }
+ }
+ else {
+ if (this.checkEdits) {
+ var checkText = editFlat(this.getText(0, this.root.charCount()), pos, deleteLength, newText);
+ }
+ var walker = new EditWalker();
+ if (pos >= this.root.charCount()) {
+ // insert at end
+ pos = this.root.charCount() - 1;
+ var endString = this.getText(pos, 1);
+ if (newText) {
+ newText = endString + newText;
+ }
+ else {
+ newText = endString;
+ }
+ deleteLength = 0;
+ walker.suppressTrailingText = true;
+ }
+ else if (deleteLength > 0) {
+ // check whether last characters deleted are line break
+ var e = pos + deleteLength;
+ var lineInfo = this.charOffsetToLineNumberAndPos(e);
+ if ((lineInfo && (lineInfo.col == 0))) {
+ // move range end just past line that will merge with previous line
+ deleteLength += lineInfo.text.length;
+ // store text by appending to end of insertedText
+ if (newText) {
+ newText = newText + lineInfo.text;
+ }
+ else {
+ newText = lineInfo.text;
+ }
+ }
+ }
+ if (pos < this.root.charCount()) {
+ this.root.walk(pos, deleteLength, walker);
+ walker.insertLines(newText);
+ }
+ if (this.checkEdits) {
+ var updatedText = this.getText(0, this.root.charCount());
+ }
+ return walker.lineIndex;
+ }
+ }
+ static buildTreeFromBottom(nodes: LineCollection[]): LineNode {
+ var nodeCount = Math.ceil(nodes.length / lineCollectionCapacity);
+ var interiorNodes: LineNode[] = [];
+ var nodeIndex = 0;
+ for (var i = 0; i < nodeCount; i++) {
+ interiorNodes[i] = new LineNode();
+ var charCount = 0;
+ var lineCount = 0;
+ for (var j = 0; j < lineCollectionCapacity; j++) {
+ if (nodeIndex < nodes.length) {
+ interiorNodes[i].add(nodes[nodeIndex]);
+ charCount += nodes[nodeIndex].charCount();
+ lineCount += nodes[nodeIndex].lineCount();
+ }
+ else {
+ break;
+ }
+ nodeIndex++;
+ }
+ interiorNodes[i].totalChars = charCount;
+ interiorNodes[i].totalLines = lineCount;
+ }
+ if (interiorNodes.length == 1) {
+ return interiorNodes[0];
+ }
+ else {
+ return this.buildTreeFromBottom(interiorNodes);
+ }
+ }
+ static linesFromText(text: string) {
+ var lineStarts = ts.computeLineStarts(text);
- return {
- getFileName: () => fileName,
- getContent: () => content,
- getVersion: () => version,
- getIsOpen: () => isOpen,
- setIsOpen: val => isOpen = val,
- getEditRanges: () => editRanges,
- getLineStarts: getLineStarts,
+ if (lineStarts.length == 0) {
+ return { lines: [], lineMap: lineStarts };
+ }
+ var lines = new Array(lineStarts.length);
+ var lc = lineStarts.length - 1;
+ for (var lmi = 0; lmi < lc; lmi++) {
+ lines[lmi] = text.substring(lineStarts[lmi], lineStarts[lmi + 1]);
+ }
- updateContent: updateContent,
- editContent: editContent,
- getPositionFromLine: getPositionFromLine,
- getLineAndColForPositon: getLineAndColForPositon
+ var endText = text.substring(lineStarts[lc]);
+ if (endText.length > 0) {
+ lines[lc] = endText;
+ }
+ else {
+ lines.length--;
+ }
+ return { lines: lines, lineMap: lineStarts };
}
}
+export class LineIndexSnapshot implements ts.IScriptSnapshot {
+ index: LineIndex;
+ changesSincePreviousVersion: TextChange[] = [];
+
+ constructor(public version: number, public cache: ScriptVersionCache) {
+ }
+
+ getText(rangeStart: number, rangeEnd: number) {
+ return this.index.getText(rangeStart, rangeEnd - rangeStart);
+ }
+
+ getLength() {
+ return this.index.root.charCount();
+ }
+
+ // this requires linear space so don't hold on to these
+ getLineStartPositions(): number[] {
+ var starts: number[] = [-1];
+ var count = 1;
+ var pos = 0;
+ this.index.every((ll, s, len) => {
+ starts[count++] = pos;
+ pos += ll.text.length;
+ return true;
+ }, 0);
+ return starts;
+ }
+
+ getLineMapper() {
+ return ((line: number) => {
+ return this.index.lineNumberToInfo(line).col;
+ });
+ }
+
+ getTextChangeRangeSinceVersion(scriptVersion: number) {
+ if (this.version <= scriptVersion) {
+ return unchangedTextChangeRange;
+ }
+ else {
+ return this.cache.getTextChangesBetweenVersions(scriptVersion, this.version);
+ }
+ }
+ getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
+ var oldSnap = oldSnapshot;
+ return this.getTextChangeRangeSinceVersion(oldSnap.version);
+ }
+}
+
+export class TextChange {
+ constructor(public pos: number, public deleteLen: number, public insertedText?: string) {
+ }
+
+ getTextChangeRange() {
+ return createTextChangeRange(createTextSpan(this.pos, this.deleteLen),
+ this.insertedText ? this.insertedText.length : 0);
+ }
+}
+
+export class ScriptVersionCache {
+ changes: TextChange[] = [];
+ versions: LineIndexSnapshot[] = [];
+ minVersion = 0; // no versions earlier than min version will maintain change history
+ private currentVersion = 0;
+
+ static changeNumberThreshold = 8;
+ static changeLengthThreshold = 256;
+ static maxVersions = 8;
+
+ // REVIEW: can optimize by coalescing simple edits
+ edit(pos: number, deleteLen: number, insertedText?: string) {
+ this.changes[this.changes.length] = new TextChange(pos, deleteLen, insertedText);
+ if ((this.changes.length > ScriptVersionCache.changeNumberThreshold) ||
+ (deleteLen > ScriptVersionCache.changeLengthThreshold) ||
+ (insertedText && (insertedText.length > ScriptVersionCache.changeLengthThreshold))) {
+ this.getSnapshot();
+ }
+ }
+
+ latest() {
+ return this.versions[this.currentVersion];
+ }
+
+ latestVersion() {
+ if (this.changes.length > 0) {
+ this.getSnapshot();
+ }
+ return this.currentVersion;
+ }
+ reloadFromFile(filename: string, cb?: () => any) {
+ var content = sys.readFile(filename);
+ this.reload(content);
+ if (cb)
+ cb();
+ }
-function getScriptSnapShot(scriptInfo: ScriptInfo): ts.IScriptSnapshot {
- var lineStarts = scriptInfo.getLineStarts();
- var textSnapshot = scriptInfo.getContent();
- var version = scriptInfo.getVersion()
- var editRanges = scriptInfo.getEditRanges()
+ // reload whole script, leaving no change history behind reload
+ reload(script: string) {
+ this.currentVersion++;
+ this.changes = []; // history wiped out by reload
+ var snap = new LineIndexSnapshot(this.currentVersion, this);
+ this.versions[this.currentVersion] = snap;
+ snap.index = new LineIndex();
+ var lm = LineIndex.linesFromText(script);
+ snap.index.load(lm.lines);
+ // REVIEW: could use linked list
+ for (var i = this.minVersion; i < this.currentVersion; i++) {
+ this.versions[i] = undefined;
+ }
+ this.minVersion = this.currentVersion;
+ }
- function getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
- var scriptVersion: number = (oldSnapshot).version || 0;
- if (scriptVersion === version) {
- return ts.TextChangeRange.unchanged;
+ getSnapshot() {
+ var snap = this.versions[this.currentVersion];
+ if (this.changes.length > 0) {
+ var snapIndex = this.latest().index;
+ for (var i = 0, len = this.changes.length; i < len; i++) {
+ var change = this.changes[i];
+ snapIndex = snapIndex.edit(change.pos, change.deleteLen, change.insertedText);
+ }
+ snap = new LineIndexSnapshot(this.currentVersion + 1, this);
+ snap.index = snapIndex;
+ snap.changesSincePreviousVersion = this.changes;
+ this.currentVersion = snap.version;
+ this.versions[snap.version] = snap;
+ this.changes = [];
+ if ((this.currentVersion - this.minVersion) >= ScriptVersionCache.maxVersions) {
+ var oldMin = this.minVersion;
+ this.minVersion = (this.currentVersion - ScriptVersionCache.maxVersions) + 1;
+ for (var j = oldMin; j < this.minVersion; j++) {
+ this.versions[j] = undefined;
+ }
+ }
}
- var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
+ return snap;
+ }
- if (initialEditRangeIndex < 0) {
- return null;
+ getTextChangesBetweenVersions(oldVersion: number, newVersion: number) {
+ if (oldVersion < newVersion) {
+ if (oldVersion >= this.minVersion) {
+ var textChangeRanges: ts.TextChangeRange[] = [];
+ for (var i = oldVersion + 1; i <= newVersion; i++) {
+ var snap = this.versions[i];
+ for (var j = 0, len = snap.changesSincePreviousVersion.length; j < len; j++) {
+ var textChange = snap.changesSincePreviousVersion[j];
+ textChangeRanges[textChangeRanges.length] = textChange.getTextChangeRange();
+ }
+ }
+ return collapseTextChangeRangesAcrossMultipleVersions(textChangeRanges);
+ }
+ else {
+ return undefined;
+ }
+ }
+ else {
+ return unchangedTextChangeRange;
}
+ }
+
+ static fromString(script: string) {
+ var svc = new ScriptVersionCache();
+ var snap = new LineIndexSnapshot(0, svc);
+ snap.index = new LineIndex();
+ var lm = LineIndex.linesFromText(script);
+ snap.index.load(lm.lines);
+ svc.versions[svc.currentVersion] = snap;
+ return svc;
+ }
+}
+
+export class ScriptInfo {
+ svc: ScriptVersionCache;
+ children: ScriptInfo[] = []; // files referenced by this file
+
+ constructor(public fileName: string, public content: string, public isOpen = false) {
+ this.svc = ScriptVersionCache.fromString(content);
+ }
+
+ close() {
+ this.isOpen = false;
+ }
- var entries = editRanges.slice(initialEditRangeIndex);
- return ts.TextChangeRange.collapseChangesAcrossMultipleVersions(entries);
+ open() {
+ this.isOpen = true;
}
- return {
- getText: (start: number, end: number) => textSnapshot.substring(start, end),
- getLength: () => textSnapshot.length,
- getChangeRange: getChangeRange,
- getLineStartPositions: () => lineStarts,
- version: version
+ getIsOpen() {
+ return this.isOpen;
+ }
+
+ addChild(childInfo: ScriptInfo) {
+ this.children.push(childInfo);
+ }
+
+ snap() {
+ return this.svc.getSnapshot();
+ }
+
+ getText() {
+ var snap = this.snap();
+ return snap.getText(0, snap.getLength());
+ }
+
+ getLineInfo(line: number) {
+ var snap = this.snap();
+ return snap.index.lineNumberToInfo(line);
+ }
+
+ editContent(start: number, end: number, newText: string): void {
+ this.svc.edit(start, end - start, newText);
+ }
+
+ getTextChangeRangeBetweenVersions(startVersion: number, endVersion: number): ts.TextChangeRange {
+ return this.svc.getTextChangesBetweenVersions(startVersion, endVersion);
+ }
+
+ getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
+ return this.snap().getChangeRange(oldSnapshot);
}
}
-// NOTES:
-// * fileName is * always * the absolute path to the file
-// * content is *always* the string content of the file
-export class LanguageServiceHost implements ts.LanguageServiceHost {
+//////////////////////////////////////////// ACTUAL STUFF WE CARE ABOUT
+
+// Note: All the magic code is really behind the ScripInfo class
+import tsconfig = require('../tsconfig/tsconfig');
+import path = require('path');
+import fs = require('fs');
+
+export interface Position {
+ line: number;
+ ch: number;
+}
+
+export var defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
+
+/**
+ * This is the only class I really brought in. Everything else came from the dependency tree of this one class.
+ */
+export class LanguageServiceHost implements ts.LanguageServiceHost {
/**
* a map associating file absolute path to ScriptInfo
*/
@@ -205,13 +1109,10 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
config.project.files.forEach((file) => this.addScript(file));
// Also add the `lib.d.ts`
- var libFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts'));
- this.addScript(libFile);
+ this.addScript(defaultLibFile);
}
addScript = (fileName: string, content?: string) => {
-
-
try {
if (!content)
content = fs.readFileSync(fileName).toString();
@@ -221,8 +1122,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
// For now its just an empty string
content = '';
}
-
- var script = createScriptInfo(fileName, content);
+ var script = new ScriptInfo(fileName, content);
this.fileNameToScript[fileName] = script;
}
@@ -237,7 +1137,13 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
updateScript = (fileName: string, content: string) => {
var script = this.fileNameToScript[fileName];
if (script) {
- script.updateContent(content);
+
+ // BAD THINGS HAPPEN IF YOU DON'T DO THIS
+ if (script.getText() == content) {
+ return;
+ }
+
+ script.editContent(0, script.snap().getLength(), content);
return;
}
else {
@@ -258,7 +1164,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
setScriptIsOpen = (fileName: string, isOpen: boolean) => {
var script = this.fileNameToScript[fileName];
if (script) {
- script.setIsOpen(isOpen);
+ script.open();
return;
}
@@ -268,7 +1174,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
getScriptContent = (fileName: string): string => {
var script = this.fileNameToScript[fileName];
if (script) {
- return script.getContent();
+ return script.getText();
}
return null;
}
@@ -277,24 +1183,41 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
return !!this.fileNameToScript[fileName];
}
- getIndexFromPosition = (fileName: string, position: { ch: number; line: number }): number => {
- var script = this.fileNameToScript[fileName];
- if (script) {
- return script.getPositionFromLine(position.line, position.ch);
- }
- return -1;
+ /**
+ * @param line 1 based index
+ * @param col 1 based index
+ */
+ lineColToPosition(filename: string, line: number, col: number): number {
+ var script: ScriptInfo = this.fileNameToScript[filename];
+ var index = script.snap().index;
+
+ var lineInfo = index.lineNumberToInfo(line);
+ // TODO: assert this column is actually on the line
+ return (lineInfo.col + col - 1);
}
- getPositionFromIndex = (fileName: string, index: number): { ch: number; line: number } => {
- if (!this.fileNameToScript[fileName]) this.addScript(fileName);
- var script = this.fileNameToScript[fileName];
- if (script) {
- return script.getLineAndColForPositon(index);
- }
- return null;
+ /**
+ * @param line 1-based index
+ * @param col 1-based index
+ */
+ positionToLineCol(filename: string, position: number): ILineInfo {
+ var script: ScriptInfo = this.fileNameToScript[filename];
+ var index = script.snap().index;
+ var lineCol = index.charOffsetToLineNumberAndPos(position);
+ return { line: lineCol.line, col: lineCol.col + 1 };
}
+ /** 0 based */
+ getPositionFromIndex = (fileName: string, index: number): { ch: number; line: number } => {
+ var result = this.positionToLineCol(fileName, index);
+ return { line: result.line - 1, ch: result.col - 1 };
+ }
+ /** 0 based */
+ getIndexFromPosition = (fileName: string, position: { ch: number; line: number }): number => {
+ var newPos = {ch:position.ch+1,line:position.line+1}
+ return this.lineColToPosition(fileName, newPos.line, newPos.ch);
+ }
////////////////////////////////////////
// ts.LanguageServiceHost implementation
@@ -305,7 +1228,7 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
getScriptVersion = (fileName: string): string => {
var script = this.fileNameToScript[fileName];
if (script) {
- return '' + script.getVersion();
+ return script.svc.latestVersion().toString();
}
return '0';
}
@@ -319,19 +1242,14 @@ export class LanguageServiceHost implements ts.LanguageServiceHost {
getScriptSnapshot = (fileName: string): ts.IScriptSnapshot => {
var script = this.fileNameToScript[fileName];
if (script) {
- return getScriptSnapShot(script);
+ return script.snap();
}
return null;
}
getCurrentDirectory = (): string => {
return this.config.projectFileDirectory;
}
- getDefaultLibFilename = (): string => {
+ getDefaultLibFileName = (): string => {
return 'lib.d.ts'; // TODO: this.config.project.compilerOptions.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
}
-
- // ts.Logger implementation
- log = () => void 0
- error = () => void 0
- trace = () => void 0
}
diff --git a/lib/main/lang/languageServiceHost2.ts b/lib/main/lang/languageServiceHost2.ts
new file mode 100644
index 000000000..f00994a99
--- /dev/null
+++ b/lib/main/lang/languageServiceHost2.ts
@@ -0,0 +1,354 @@
+///
+
+'use strict';
+
+import ts = require('typescript');
+import path = require('path');
+import utils = require('./utils');
+import fs = require('fs');
+import textBuffer = require('basarat-text-buffer');
+
+import tsconfig = require('../tsconfig/tsconfig');
+
+export interface Position {
+ line: number;
+ ch: number;
+}
+
+interface ScriptInfo {
+ getFileName(): string;
+ getContent(): string;
+ getVersion(): number;
+ getIsOpen(): boolean;
+ setIsOpen(val: boolean): void;
+ getEditRanges(): ts.TextChangeRange[];
+ getLineStarts(): number[];
+
+
+ updateContent(newContent: string): void;
+ editContent(minChar: number, limChar: number, newText: string): void;
+ getPositionFromLine(line: number, ch: number): number;
+ getLineAndColForPositon(position: number): Position;
+}
+interface ITextBuffer extends TextBuffer.ITextBuffer{}
+
+/**
+ * Manage a script in the language service host
+ */
+function createScriptInfo(fileName: string, text: string, isOpen = false): ScriptInfo {
+
+
+ var version: number = 1;
+ var editRanges: ts.TextChangeRange[] = [];
+
+ var _lineStarts: number[];
+ var _lineStartIsDirty = true;
+ var buffer = new textBuffer(text);
+
+ function getLineStarts() {
+ if (_lineStartIsDirty) {
+ // TODO: pref
+ _lineStarts = [];
+ var totalLength = 0;
+ buffer.lines.forEach((line,index)=>{
+ _lineStarts.push(totalLength);
+ var lineLength = line.length;
+ totalLength = totalLength + lineLength + buffer.lineEndings[index];
+ });
+
+ _lineStartIsDirty = false;
+ }
+ return _lineStarts;
+ }
+
+ /**
+ * update the content of the script
+ *
+ * @param newContent the new script content
+ */
+ function updateContent(newContent: string): void {
+ buffer = new textBuffer(newContent);
+ _lineStartIsDirty = true;
+ editRanges = [];
+ version++;
+ }
+
+
+ /**
+ * edit the script content
+ *
+ * @param minChar the index in the file content where the edition begins
+ * @param limChar the index in the file content where the edition ends
+ * @param newText the text inserted
+ */
+ function editContent(minChar: number, limChar: number, newText: string): void {
+
+ // Apply edits
+ var start = getLineAndColForPositon(minChar);
+ var end = getLineAndColForPositon(limChar);
+
+ // console.error('initial text:',buffer.getText()==newText);
+ // console.error({minChar,limChar,newText:newText.length});
+ // console.error(start,end);
+ buffer.setTextInRange([[start.line,start.ch],[end.line,end.ch]],newText);
+ // console.error(buffer.getText().length);
+
+ _lineStartIsDirty = true;
+
+ // Store edit range + new length of script
+ editRanges.push({
+ span: { start: minChar, length: limChar - minChar },
+ newLength: newText.length
+ });
+
+ // Update version #
+ version++;
+ }
+
+
+
+ /**
+ * return an index position from line an character position
+ *
+ * @param line line number
+ * @param character charecter poisiton in the line
+ */
+ function getPositionFromLine(line: number, ch: number) {
+ return buffer.characterIndexForPosition([line,ch]);
+ }
+
+ /**
+ * return line and chararacter position from index position
+ *
+ * @param position
+ */
+ function getLineAndColForPositon(position: number) {
+ var {row,column} = buffer.positionForCharacterIndex(position);
+ return {
+ line:row,
+ ch:column
+ };
+ }
+
+
+
+
+ return {
+ getFileName: () => fileName,
+ getContent: () => buffer.getText(),
+ getVersion: () => version,
+ getIsOpen: () => isOpen,
+ setIsOpen: val => isOpen = val,
+ getEditRanges: () => editRanges,
+ getLineStarts: getLineStarts,
+
+ updateContent: updateContent,
+ editContent: editContent,
+ getPositionFromLine: getPositionFromLine,
+ getLineAndColForPositon: getLineAndColForPositon
+ }
+}
+
+
+
+function getScriptSnapShot(scriptInfo: ScriptInfo): ts.IScriptSnapshot {
+ var lineStarts = scriptInfo.getLineStarts();
+ var textSnapshot = scriptInfo.getContent();
+ var version = scriptInfo.getVersion()
+ var editRanges = scriptInfo.getEditRanges()
+
+
+ function getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
+ var unchanged = { span: { start: 0, length: 0 }, newLength: 0 };
+
+ function collapseChangesAcrossMultipleVersions(changes: ts.TextChangeRange[]) {
+ if (changes.length === 0) {
+ return unchanged;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = change0.span.start + change0.span.length;
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = nextChange.span.start + nextChange.span.length;
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return { span: { start: oldStartN, length: oldEndN - oldStartN }, newLength: newEndN - oldStartN };
+ };
+
+ var scriptVersion: number = (oldSnapshot).version || 0;
+ if (scriptVersion === version) {
+ return unchanged;
+ }
+ var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
+
+ if (initialEditRangeIndex < 0) {
+ return null;
+ }
+
+ var entries = editRanges.slice(initialEditRangeIndex);
+ return collapseChangesAcrossMultipleVersions(entries);
+ }
+
+ return {
+ getText: (start: number, end: number) => textSnapshot.substring(start, end),
+ getLength: () => textSnapshot.length,
+ getChangeRange: getChangeRange,
+ getLineStartPositions: () => lineStarts,
+ version: version
+ }
+}
+
+export var defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
+
+
+// NOTES:
+// * fileName is * always * the absolute path to the file
+// * content is *always* the string content of the file
+export class LanguageServiceHost implements ts.LanguageServiceHost {
+
+ /**
+ * a map associating file absolute path to ScriptInfo
+ */
+ fileNameToScript: { [fileName: string]: ScriptInfo } = Object.create(null);
+
+ constructor(private config: tsconfig.TypeScriptProjectFileDetails) {
+ // Add all the files
+ config.project.files.forEach((file) => this.addScript(file));
+
+ // Also add the `lib.d.ts`
+ this.addScript(defaultLibFile);
+ }
+
+ addScript = (fileName: string, content?: string) => {
+
+
+ try {
+ if (!content)
+ content = fs.readFileSync(fileName).toString();
+ }
+ catch (ex) { // if we cannot read the file for whatever reason
+ // TODO: in next version of TypeScript langauge service we would add it with "undefined"
+ // For now its just an empty string
+ content = '';
+ }
+
+ var script = createScriptInfo(fileName, content);
+ this.fileNameToScript[fileName] = script;
+ }
+
+ removeScript = (fileName: string) => {
+ delete this.fileNameToScript[fileName];
+ }
+
+ removeAll = () => {
+ this.fileNameToScript = Object.create(null);
+ }
+
+ updateScript = (fileName: string, content: string) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.updateContent(content);
+ return;
+ }
+ else {
+ this.addScript(fileName, content);
+ }
+ }
+
+ editScript = (fileName: string, minChar: number, limChar: number, newText: string) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.editContent(minChar, limChar, newText);
+ return;
+ }
+
+ throw new Error('No script with name \'' + fileName + '\'');
+ }
+
+ setScriptIsOpen = (fileName: string, isOpen: boolean) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.setIsOpen(isOpen);
+ return;
+ }
+
+ throw new Error('No script with name \'' + fileName + '\'');
+ }
+
+ getScriptContent = (fileName: string): string => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getContent();
+ }
+ return null;
+ }
+
+ hasScript = (fileName: string) => {
+ return !!this.fileNameToScript[fileName];
+ }
+
+ getIndexFromPosition = (fileName: string, position: { ch: number; line: number }): number => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getPositionFromLine(position.line, position.ch);
+ }
+ return -1;
+ }
+
+ getPositionFromIndex = (fileName: string, index: number): { ch: number; line: number } => {
+ if (!this.fileNameToScript[fileName]) this.addScript(fileName);
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getLineAndColForPositon(index);
+ }
+ return null;
+ }
+
+
+
+ ////////////////////////////////////////
+ // ts.LanguageServiceHost implementation
+ ////////////////////////////////////////
+
+ getCompilationSettings = () => this.config.project.compilerOptions;
+ getScriptFileNames = (): string[]=> Object.keys(this.fileNameToScript);
+ getScriptVersion = (fileName: string): string => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return '' + script.getVersion();
+ }
+ return '0';
+ }
+ getScriptIsOpen = (fileName: string): boolean => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getIsOpen();
+ }
+ return false;
+ }
+ getScriptSnapshot = (fileName: string): ts.IScriptSnapshot => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return getScriptSnapShot(script);
+ }
+ return null;
+ }
+ getCurrentDirectory = (): string => {
+ return this.config.projectFileDirectory;
+ }
+ getDefaultLibFileName = (): string => {
+ return 'lib.d.ts'; // TODO: this.config.project.compilerOptions.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+}
diff --git a/lib/main/lang/languageServiceHostOld.ts b/lib/main/lang/languageServiceHostOld.ts
new file mode 100644
index 000000000..37bb1c1e9
--- /dev/null
+++ b/lib/main/lang/languageServiceHostOld.ts
@@ -0,0 +1,367 @@
+/**
+ * THIS FILE IS NO LONGER USED.
+ * This is kept as a reference implementation for a simpler language service shot + ScriptInfo
+ */
+
+// Copyright 2013-2014 François de Campredon
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+///ts:ref=atom.d
+/// ///ts:ref:generated
+
+'use strict';
+
+import ts = require('typescript');
+import path = require('path');
+import utils = require('./utils');
+import fs = require('fs');
+
+import tsconfig = require('../tsconfig/tsconfig');
+
+export interface Position {
+ line: number;
+ ch: number;
+}
+
+interface ScriptInfo {
+ getFileName(): string;
+ getContent(): string;
+ getVersion(): number;
+ getIsOpen(): boolean;
+ setIsOpen(val: boolean): void;
+ getEditRanges(): ts.TextChangeRange[];
+ getLineStarts(): number[];
+
+
+ updateContent(newContent: string): void;
+ editContent(minChar: number, limChar: number, newText: string): void;
+ getPositionFromLine(line: number, ch: number): number;
+ getLineAndColForPositon(position: number): Position;
+}
+interface ITextBuffer extends TextBuffer.ITextBuffer{}
+
+/**
+ * Manage a script in the language service host
+ */
+function createScriptInfo(fileName: string, content: string, isOpen = false): ScriptInfo {
+
+
+ var version: number = 1;
+ var editRanges: ts.TextChangeRange[] = [];
+
+ var _lineStarts: number[];
+ var _lineStartIsDirty = true;
+
+ function getLineStarts() {
+ if (_lineStartIsDirty) {
+ // TODO: pref
+ _lineStarts = ts.computeLineStarts(content);
+ _lineStartIsDirty = false;
+ }
+ return _lineStarts;
+ }
+
+ /**
+ * update the content of the script
+ *
+ * @param newContent the new script content
+ */
+ function updateContent(newContent: string): void {
+ content = newContent;
+ _lineStartIsDirty = true;
+ editRanges = [];
+ version++;
+ }
+
+
+ /**
+ * edit the script content
+ *
+ * @param minChar the index in the file content where the edition begins
+ * @param limChar the index in the file content where the edition ends
+ * @param newText the text inserted
+ */
+ function editContent(minChar: number, limChar: number, newText: string): void {
+ // Apply edits
+ var prefix = content.substring(0, minChar);
+ var middle = newText;
+ var suffix = content.substring(limChar);
+ content = prefix + middle + suffix;
+ _lineStartIsDirty = true;
+
+
+ // Store edit range + new length of script
+ editRanges.push({
+ span: { start: minChar, length: limChar - minChar },
+ newLength: newText.length
+ });
+
+ // Update version #
+ version++;
+ }
+
+
+
+ /**
+ * return an index position from line an character position
+ *
+ * @param line line number
+ * @param character charecter poisiton in the line
+ */
+ function getPositionFromLine(line: number, ch: number) {
+ return getLineStarts()[line] + ch;
+ }
+
+ /**
+ * return line and chararacter position from index position
+ *
+ * @param position
+ */
+ function getLineAndColForPositon(position: number) {
+ if (position < 0 || position > content.length) {
+ throw new RangeError('Argument out of range: position');
+ }
+ var lineStarts = getLineStarts();
+ var lineNumber = utils.binarySearch(lineStarts, position);
+ if (lineNumber < 0) {
+ lineNumber = (~lineNumber) - 1;
+ }
+ return {
+ line: lineNumber,
+ ch: position - lineStarts[lineNumber]
+ };
+ }
+
+
+
+
+ return {
+ getFileName: () => fileName,
+ getContent: () => content,
+ getVersion: () => version,
+ getIsOpen: () => isOpen,
+ setIsOpen: val => isOpen = val,
+ getEditRanges: () => editRanges,
+ getLineStarts: getLineStarts,
+
+ updateContent: updateContent,
+ editContent: editContent,
+ getPositionFromLine: getPositionFromLine,
+ getLineAndColForPositon: getLineAndColForPositon
+ }
+}
+
+
+
+function getScriptSnapShot(scriptInfo: ScriptInfo): ts.IScriptSnapshot {
+ var lineStarts = scriptInfo.getLineStarts();
+ var textSnapshot = scriptInfo.getContent();
+ var version = scriptInfo.getVersion()
+ var editRanges = scriptInfo.getEditRanges()
+
+
+ function getChangeRange(oldSnapshot: ts.IScriptSnapshot): ts.TextChangeRange {
+ var unchanged = { span: { start: 0, length: 0 }, newLength: 0 };
+
+ function collapseChangesAcrossMultipleVersions(changes: ts.TextChangeRange[]) {
+ if (changes.length === 0) {
+ return unchanged;
+ }
+ if (changes.length === 1) {
+ return changes[0];
+ }
+ var change0 = changes[0];
+ var oldStartN = change0.span.start;
+ var oldEndN = change0.span.start + change0.span.length;
+ var newEndN = oldStartN + change0.newLength;
+ for (var i = 1; i < changes.length; i++) {
+ var nextChange = changes[i];
+ var oldStart1 = oldStartN;
+ var oldEnd1 = oldEndN;
+ var newEnd1 = newEndN;
+ var oldStart2 = nextChange.span.start;
+ var oldEnd2 = nextChange.span.start + nextChange.span.length;
+ var newEnd2 = oldStart2 + nextChange.newLength;
+ oldStartN = Math.min(oldStart1, oldStart2);
+ oldEndN = Math.max(oldEnd1, oldEnd1 + (oldEnd2 - newEnd1));
+ newEndN = Math.max(newEnd2, newEnd2 + (newEnd1 - oldEnd2));
+ }
+ return { span: { start: oldStartN, length: oldEndN - oldStartN }, newLength: newEndN - oldStartN };
+ };
+
+ var scriptVersion: number = (oldSnapshot).version || 0;
+ if (scriptVersion === version) {
+ return unchanged;
+ }
+ var initialEditRangeIndex = editRanges.length - (version - scriptVersion);
+
+ if (initialEditRangeIndex < 0) {
+ return null;
+ }
+
+ var entries = editRanges.slice(initialEditRangeIndex);
+ return collapseChangesAcrossMultipleVersions(entries);
+ }
+
+ return {
+ getText: (start: number, end: number) => textSnapshot.substring(start, end),
+ getLength: () => textSnapshot.length,
+ getChangeRange: getChangeRange,
+ getLineStartPositions: () => lineStarts,
+ version: version
+ }
+}
+
+export var defaultLibFile = (path.join(path.dirname(require.resolve('typescript')), 'lib.d.ts')).split('\\').join('/');
+
+
+// NOTES:
+// * fileName is * always * the absolute path to the file
+// * content is *always* the string content of the file
+export class LanguageServiceHost implements ts.LanguageServiceHost {
+
+ /**
+ * a map associating file absolute path to ScriptInfo
+ */
+ fileNameToScript: { [fileName: string]: ScriptInfo } = Object.create(null);
+
+ constructor(private config: tsconfig.TypeScriptProjectFileDetails) {
+ // Add all the files
+ config.project.files.forEach((file) => this.addScript(file));
+
+ // Also add the `lib.d.ts`
+ this.addScript(defaultLibFile);
+ }
+
+ addScript = (fileName: string, content?: string) => {
+
+
+ try {
+ if (!content)
+ content = fs.readFileSync(fileName).toString();
+ }
+ catch (ex) { // if we cannot read the file for whatever reason
+ // TODO: in next version of TypeScript langauge service we would add it with "undefined"
+ // For now its just an empty string
+ content = '';
+ }
+
+ var script = createScriptInfo(fileName, content);
+ this.fileNameToScript[fileName] = script;
+ }
+
+ removeScript = (fileName: string) => {
+ delete this.fileNameToScript[fileName];
+ }
+
+ removeAll = () => {
+ this.fileNameToScript = Object.create(null);
+ }
+
+ updateScript = (fileName: string, content: string) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.updateContent(content);
+ return;
+ }
+ else {
+ this.addScript(fileName, content);
+ }
+ }
+
+ editScript = (fileName: string, minChar: number, limChar: number, newText: string) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.editContent(minChar, limChar, newText);
+ return;
+ }
+
+ throw new Error('No script with name \'' + fileName + '\'');
+ }
+
+ setScriptIsOpen = (fileName: string, isOpen: boolean) => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ script.setIsOpen(isOpen);
+ return;
+ }
+
+ throw new Error('No script with name \'' + fileName + '\'');
+ }
+
+ getScriptContent = (fileName: string): string => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getContent();
+ }
+ return null;
+ }
+
+ hasScript = (fileName: string) => {
+ return !!this.fileNameToScript[fileName];
+ }
+
+ getIndexFromPosition = (fileName: string, position: { ch: number; line: number }): number => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getPositionFromLine(position.line, position.ch);
+ }
+ return -1;
+ }
+
+ getPositionFromIndex = (fileName: string, index: number): { ch: number; line: number } => {
+ if (!this.fileNameToScript[fileName]) this.addScript(fileName);
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getLineAndColForPositon(index);
+ }
+ return null;
+ }
+
+
+
+ ////////////////////////////////////////
+ // ts.LanguageServiceHost implementation
+ ////////////////////////////////////////
+
+ getCompilationSettings = () => this.config.project.compilerOptions;
+ getScriptFileNames = (): string[]=> Object.keys(this.fileNameToScript);
+ getScriptVersion = (fileName: string): string => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return '' + script.getVersion();
+ }
+ return '0';
+ }
+ getScriptIsOpen = (fileName: string): boolean => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return script.getIsOpen();
+ }
+ return false;
+ }
+ getScriptSnapshot = (fileName: string): ts.IScriptSnapshot => {
+ var script = this.fileNameToScript[fileName];
+ if (script) {
+ return getScriptSnapShot(script);
+ }
+ return null;
+ }
+ getCurrentDirectory = (): string => {
+ return this.config.projectFileDirectory;
+ }
+ getDefaultLibFileName = (): string => {
+ return 'lib.d.ts'; // TODO: this.config.project.compilerOptions.target === ts.ScriptTarget.ES6 ? "lib.es6.d.ts" : "lib.d.ts";
+ }
+}
diff --git a/lib/main/lang/project.ts b/lib/main/lang/project.ts
index a40ee12df..8bd0ec558 100644
--- a/lib/main/lang/project.ts
+++ b/lib/main/lang/project.ts
@@ -7,7 +7,7 @@ import mkdirp = require('mkdirp');
import fs = require('fs');
import os = require('os');
-import languageServiceHost = require('./languageServiceHost');
+export import languageServiceHost = require('./languageServiceHost2');
import tsconfig = require('../tsconfig/tsconfig');
import utils = require('./utils');
@@ -39,22 +39,21 @@ export class Project {
emitFile = (filePath: string): EmitOutput => {
var services = this.languageService;
var output = services.getEmitOutput(filePath);
- var success = output.emitOutputStatus === ts.EmitReturnStatus.Succeeded;
+ var emitDone = !output.emitSkipped;
var errors: TSError[] = [];
+ // Emit is no guarantee that there are no errors
+ var allDiagnostics = services.getCompilerOptionsDiagnostics()
+ .concat(services.getSyntacticDiagnostics(filePath))
+ .concat(services.getSemanticDiagnostics(filePath));
- if (!success) {
- var allDiagnostics = services.getCompilerOptionsDiagnostics()
- .concat(services.getSyntacticDiagnostics(filePath))
- .concat(services.getSemanticDiagnostics(filePath));
+ allDiagnostics.forEach(diagnostic => {
+ // happens only for 'lib.d.ts' for some reason
+ if (!diagnostic.file) return;
- allDiagnostics.forEach(diagnostic => {
- if (!diagnostic.file) return; // TODO: happens only for 'lib.d.ts' for now
-
- var startPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
- errors.push(diagnosticToTSError(diagnostic));
- });
- }
+ var startPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
+ errors.push(diagnosticToTSError(diagnostic));
+ });
output.outputFiles.forEach(o => {
mkdirp.sync(path.dirname(o.name));
@@ -68,19 +67,18 @@ export class Project {
return {
outputFiles: outputFiles,
- success: success,
+ success: emitDone && !errors.length,
errors: errors,
- emitError: !success && outputFiles.length === 0
+ emitError: !emitDone
};
}
formatDocument(filePath: string, cursor: languageServiceHost.Position): { formatted: string; cursor: languageServiceHost.Position } {
- var textChanges = this.languageService.getFormattingEditsForDocument(filePath, this.projectFile.project.format);
+ var textChanges = this.languageService.getFormattingEditsForDocument(filePath, this.projectFile.project.formatCodeOptions);
var formatted = this.formatCode(this.languageServiceHost.getScriptContent(filePath), textChanges);
// Get new cursor based on new content
var newCursor = this.formatCursor(this.languageServiceHost.getIndexFromPosition(filePath, cursor), textChanges);
- this.languageServiceHost.updateScript(filePath, formatted);
return { formatted: formatted, cursor: this.languageServiceHost.getPositionFromIndex(filePath, newCursor) };
}
@@ -88,10 +86,10 @@ export class Project {
formatDocumentRange(filePath: string, start: languageServiceHost.Position, end: languageServiceHost.Position): string {
var st = this.languageServiceHost.getIndexFromPosition(filePath, start);
var ed = this.languageServiceHost.getIndexFromPosition(filePath, end);
- var textChanges = this.languageService.getFormattingEditsForRange(filePath, st, ed, this.projectFile.project.format);
+ var textChanges = this.languageService.getFormattingEditsForRange(filePath, st, ed, this.projectFile.project.formatCodeOptions);
// Sadly ^ these changes are still relative to *start* of file. So lets fix that.
- textChanges.forEach((change) => change.span = new ts.TextSpan(change.span.start() - st, change.span.length()));
+ textChanges.forEach((change) => change.span = { start: change.span.start - st, length: change.span.length });
var formatted = this.formatCode(this.languageServiceHost.getScriptContent(filePath).substring(st, ed), textChanges);
return formatted;
@@ -102,8 +100,8 @@ export class Project {
var result = orig;
for (var i = changes.length - 1; i >= 0; i--) {
var change = changes[i];
- var head = result.slice(0, change.span.start());
- var tail = result.slice(change.span.start() + change.span.length());
+ var head = result.slice(0, change.span.start);
+ var tail = result.slice(change.span.start + change.span.length);
result = head + change.newText + tail;
}
return result;
@@ -111,14 +109,14 @@ export class Project {
private formatCursor(cursor: number, changes: ts.TextChange[]): number {
// If cursor is inside a text change move it to the end of that text change
- var cursorInsideChange = changes.filter((change) => (change.span.start() < cursor) && ((change.span.end()) > cursor))[0];
+ var cursorInsideChange = changes.filter((change) => (change.span.start < cursor) && ((change.span.start + change.span.length) > cursor))[0];
if (cursorInsideChange) {
- cursor = cursorInsideChange.span.end();
+ cursor = cursorInsideChange.span.start + cursorInsideChange.span.length;
}
// Get all text changes that are *before* the cursor and determine the net *addition / subtraction* and apply that to the cursor.
- var beforeCursorChanges = changes.filter(change => change.span.start() < cursor);
+ var beforeCursorChanges = changes.filter(change => change.span.start < cursor);
var netChange = 0;
- beforeCursorChanges.forEach(change => netChange = netChange - (change.span.length() - change.newText.length));
+ beforeCursorChanges.forEach(change => netChange = netChange - (change.span.length - change.newText.length));
return cursor + netChange;
}
@@ -149,15 +147,15 @@ export interface TSError {
}
export function diagnosticToTSError(diagnostic: ts.Diagnostic): TSError {
- var filePath = diagnostic.file.filename;
- var startPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start);
- var endPosition = diagnostic.file.getLineAndCharacterFromPosition(diagnostic.start + diagnostic.length);
+ var filePath = diagnostic.file.fileName;
+ var startPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);
+ var endPosition = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start + diagnostic.length);
+
return {
filePath: filePath,
- // NOTE: the bases of indexes are different
- startPos: { line: startPosition.line - 1, ch: startPosition.character - 1 },
- endPos: { line: endPosition.line - 1, ch: endPosition.character - 1 },
- message: diagnostic.messageText,
+ startPos: { line: startPosition.line, ch: startPosition.character },
+ endPos: { line: endPosition.line, ch: endPosition.character },
+ message: ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'),
preview: diagnostic.file.text.substr(diagnostic.start, diagnostic.length),
};
}
diff --git a/lib/main/lang/projectService.ts b/lib/main/lang/projectService.ts
index 94ef47cef..4e92038e4 100644
--- a/lib/main/lang/projectService.ts
+++ b/lib/main/lang/projectService.ts
@@ -12,7 +12,7 @@ import tsconfig = require('../tsconfig/tsconfig');
import utils = require('./utils');
import project = require('./project');
import Project = project.Project;
-import languageServiceHost = require('./languageServiceHost');
+import languageServiceHost = project.languageServiceHost;
var resolve: typeof Promise.resolve = Promise.resolve.bind(Promise);
@@ -31,7 +31,9 @@ export function fixChild(childInjected: typeof child) {
child = childInjected;
queryParent.echoNumWithModification = child.sendToIpc(queryParent.echoNumWithModification);
queryParent.getUpdatedTextForUnsavedEditors = child.sendToIpc(queryParent.getUpdatedTextForUnsavedEditors);
- queryParent.setProjectFileParsedResult = child.sendToIpc(queryParent.setProjectFileParsedResult);
+ queryParent.getOpenEditorPaths = child.sendToIpc(queryParent.getOpenEditorPaths);
+ queryParent.setConfigurationError = child.sendToIpc(queryParent.setConfigurationError);
+ queryParent.notifySuccess = child.sendToIpc(queryParent.notifySuccess);
}
////////////////////////////////////////////////////////////////////////////////////////
@@ -46,10 +48,16 @@ var projectByFilePath: { [filePath: string]: Project } = {}
var watchingProjectFile: { [projectFilePath: string]: boolean } = {}
function watchProjectFileIfNotDoingItAlready(projectFilePath: string) {
+ // Don't watch lib.d.ts and other
+ // projects that are "in memory" only
+ if (!fs.existsSync(projectFilePath)) {
+ return;
+ }
+
if (watchingProjectFile[projectFilePath]) return; // Only watch once
watchingProjectFile[projectFilePath] = true;
- fs.watch(projectFilePath, { persistent: false, recursive: false },() => {
+ fs.watch(projectFilePath, { persistent: false, recursive: false }, () => {
// if file no longer exists
if (!fs.existsSync(projectFilePath)) {
// if we have a cache for it then clear it
@@ -67,7 +75,7 @@ function watchProjectFileIfNotDoingItAlready(projectFilePath: string) {
try {
var projectFile = getOrCreateProjectFile(projectFilePath);
cacheAndCreateProject(projectFile);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
}
catch (ex) {
// Keep failing silently
@@ -76,6 +84,51 @@ function watchProjectFileIfNotDoingItAlready(projectFilePath: string) {
});
}
+
+import chokidar = require('chokidar');
+var watchingTheFilesInTheProject: { [projectFilePath: string]: boolean } = {}
+function watchTheFilesInTheProjectIfNotDoingItAlready(projectFile: tsconfig.TypeScriptProjectFileDetails) {
+ var projectFilePath = projectFile.projectFilePath;
+ // Don't watch lib.d.ts and other
+ // projects that are "in memory" only
+ if (!fs.existsSync(projectFilePath)) {
+ return;
+ }
+
+ if (watchingTheFilesInTheProject[projectFilePath]) return; // Only watch once
+ watchingTheFilesInTheProject[projectFilePath] = true;
+
+ var watcher = chokidar.watch(projectFile.project.files || projectFile.project.filesGlob);
+ watcher.on('add', () => {
+ // TODO: add file to project:
+ // files + language service, and then the language service will automatically call LSHost
+ });
+ watcher.on('unlink', (filePath: string) => {
+ // TODO: remove from language service + files
+ });
+ watcher.on('change', (filePath: string) => {
+ filePath = tsconfig.consistentPath(filePath);
+ queryParent.getOpenEditorPaths({}).then((res) => {
+ var openPaths = res.filePaths;
+
+ // If we have it open, we will get this change from ATOM.
+ if (openPaths.some(x => x == filePath)) {
+ return;
+ }
+
+ // If we don't have it cached. Then we ain't gonna do anything with this as it can get hairy
+ var project = projectByFilePath[filePath];
+ if (!project) {
+ // console.error('file change ignored. No Project!:', filePath);
+ return;
+ }
+
+ var contents = fs.readFileSync(filePath).toString();
+ project.languageServiceHost.updateScript(filePath, contents);
+ });
+ })
+}
+
/** We are loading the project from file system.
This might not match what we have in the editor memory, so query those as well
*/
@@ -88,11 +141,13 @@ function cacheAndCreateProject(projectFile: tsconfig.TypeScriptProjectFileDetail
queryParent.getUpdatedTextForUnsavedEditors({})
.then(resp=> {
resp.editors.forEach(e=> {
+ consistentPath(e);
project.languageServiceHost.updateScript(e.filePath, e.text);
});
});
watchProjectFileIfNotDoingItAlready(projectFile.projectFilePath);
+ watchTheFilesInTheProjectIfNotDoingItAlready(projectFile);
return project;
}
@@ -103,40 +158,53 @@ function cacheAndCreateProject(projectFile: tsconfig.TypeScriptProjectFileDetail
*/
function getOrCreateProjectFile(filePath: string): tsconfig.TypeScriptProjectFileDetails {
try {
+ // If we are asked to look at stuff in lib.d.ts create its own project
+ if (path.dirname(filePath) == path.dirname(languageServiceHost.defaultLibFile)) {
+ return tsconfig.getDefaultProject(filePath);
+ }
+
var projectFile = tsconfig.getProjectSync(filePath);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
return projectFile;
} catch (ex) {
var err: Error = ex;
if (err.message === tsconfig.errors.GET_PROJECT_NO_PROJECT_FOUND) {
- var projectFile = tsconfig.createProjectRootSync(filePath);
- queryParent.setProjectFileParsedResult({ projectFilePath: projectFile.projectFilePath, error: null });
- return projectFile;
+ // If we have a .d.ts file then it is its own project and return
+ if (tsconfig.endsWith(filePath.toLowerCase(), '.d.ts')) {
+ return tsconfig.getDefaultProject(filePath);
+ }
+ // Otherwise create one on disk
+ else {
+ var projectFile = tsconfig.createProjectRootSync(filePath);
+ queryParent.notifySuccess({ message: 'AtomTS: tsconfig.json file created:
' + projectFile.projectFilePath });
+ queryParent.setConfigurationError({ projectFilePath: projectFile.projectFilePath, error: null });
+ return projectFile;
+ }
}
else {
if (ex.message === tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
- var invalidJSONErrorDetails: tsconfig.GET_PROJECT_JSON_PARSE_FAILED_Details = ex.details;
- queryParent.setProjectFileParsedResult({
- projectFilePath: invalidJSONErrorDetails.projectFilePath,
+ let details: tsconfig.GET_PROJECT_JSON_PARSE_FAILED_Details = ex.details;
+ queryParent.setConfigurationError({
+ projectFilePath: details.projectFilePath,
error: {
message: ex.message,
details: ex.details
}
});
// Watch this project file to see if user fixes errors
- watchProjectFileIfNotDoingItAlready(invalidJSONErrorDetails.projectFilePath);
+ watchProjectFileIfNotDoingItAlready(details.projectFilePath);
}
if (ex.message === tsconfig.errors.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS) {
- var invalidOptionDetails: tsconfig.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS_Details = ex.details;
- queryParent.setProjectFileParsedResult({
- projectFilePath: invalidOptionDetails.projectFilePath,
+ let details: tsconfig.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS_Details = ex.details;
+ queryParent.setConfigurationError({
+ projectFilePath: details.projectFilePath,
error: {
message: ex.message,
details: ex.details
}
});
// Watch this project file to see if user fixes errors
- watchProjectFileIfNotDoingItAlready(invalidOptionDetails.projectFilePath);
+ watchProjectFileIfNotDoingItAlready(details.projectFilePath);
}
throw ex;
}
@@ -179,11 +247,17 @@ interface TextSpan {
}
function textSpan(span: ts.TextSpan): TextSpan {
return {
- start: span.start(),
- length: span.length()
+ start: span.start,
+ length: span.length
}
}
+/** mutate and fix the filePath silently */
+function consistentPath(query: FilePathQuery) {
+ if (!query.filePath) return;
+ query.filePath = tsconfig.consistentPath(query.filePath);
+}
+
////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////// QUERY / RESPONSE //////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////
@@ -206,6 +280,7 @@ export interface QuickInfoResponse {
comment?: string;
}
export function quickInfo(query: QuickInfoQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var info = project.languageService.getQuickInfoAtPosition(query.filePath, query.position);
if (!info) return Promise.resolve({ valid: false });
@@ -221,6 +296,7 @@ export interface BuildResponse {
outputs: project.BuildOutput;
}
export function build(query: BuildQuery): Promise {
+ consistentPath(query);
return resolve({
outputs: getOrCreateProject(query.filePath).build()
});
@@ -232,8 +308,7 @@ export interface ErrorsForFileFilteredResponse {
errors: project.TSError[];
}
export function errorsForFileFiltered(query: ErrorsForFileFilteredQuery): Promise {
- // We have inconsistent Unix slashes.
- // TODO: Make slashes consistent all around. Something in language service is funny
+ consistentPath(query);
var fileName = path.basename(query.filePath);
return errorsForFile({ filePath: query.filePath })
@@ -259,6 +334,7 @@ var punctuations = utils.createMap([';', '{', '}', '(', ')', '.', ':', '<', '>',
var prefixEndsInPunctuation = (prefix) => prefix.length && prefix.trim().length && punctuations[prefix.trim()[prefix.trim().length - 1]];
/** gets the first 10 completions only */
export function getCompletionsAtPosition(query: GetCompletionsAtPositionQuery): Promise {
+ consistentPath(query);
var filePath = query.filePath, position = query.position, prefix = query.prefix;
var project = getOrCreateProject(filePath);
@@ -317,6 +393,7 @@ export interface GetSignatureHelpResponse {
signatureHelps: SignatureHelp[];
}
export function getSignatureHelps(query: GetSignatureHelpQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var signatureHelpItems = project.languageService.getSignatureHelpItems(query.filePath, query.position);
@@ -330,6 +407,7 @@ export function getSignatureHelps(query: GetSignatureHelpQuery): Promise {
+ consistentPath(query);
return resolve(getOrCreateProject(query.filePath).emitFile(query.filePath));
}
@@ -341,6 +419,7 @@ export interface FormatDocumentResponse {
cursor: languageServiceHost.Position
}
export function formatDocument(query: FormatDocumentQuery): Promise {
+ consistentPath(query);
var prog = getOrCreateProject(query.filePath);
return resolve(prog.formatDocument(query.filePath, query.cursor));
}
@@ -351,6 +430,7 @@ export interface FormatDocumentRangeQuery extends FilePathQuery {
}
export interface FormatDocumentRangeResponse { formatted: string; }
export function formatDocumentRange(query: FormatDocumentRangeQuery): Promise {
+ consistentPath(query);
var prog = getOrCreateProject(query.filePath);
return resolve({ formatted: prog.formatDocumentRange(query.filePath, query.start, query.end) });
}
@@ -364,6 +444,7 @@ export interface GetDefinitionsAtPositionResponse {
}[]
}
export function getDefinitionsAtPosition(query: GetDefinitionsAtPositionQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var definitions = project.languageService.getDefinitionAtPosition(query.filePath, query.position);
var projectFileDirectory = project.projectFile.projectFileDirectory;
@@ -373,7 +454,7 @@ export function getDefinitionsAtPosition(query: GetDefinitionsAtPositionQuery):
projectFileDirectory: projectFileDirectory,
definitions: definitions.map(d=> {
// If we can get the filename *we are in the same program :P*
- var pos = project.languageServiceHost.getPositionFromIndex(d.fileName, d.textSpan.start());
+ var pos = project.languageServiceHost.getPositionFromIndex(d.fileName, d.textSpan.start);
return {
filePath: d.fileName,
position: pos
@@ -386,13 +467,26 @@ export interface UpdateTextQuery extends FilePathQuery {
text: string;
}
export function updateText(query: UpdateTextQuery): Promise {
+ consistentPath(query);
getOrCreateProject(query.filePath).languageServiceHost.updateScript(query.filePath, query.text);
return resolve({});
}
+export interface EditTextQuery extends FilePathQuery {
+ minChar: number;
+ limChar: number;
+ newText: string;
+}
+export function editText(query: EditTextQuery): Promise {
+ consistentPath(query);
+ getOrCreateProject(query.filePath).languageServiceHost.editScript(query.filePath, query.minChar, query.limChar, query.newText);
+ return resolve({});
+}
+
export function errorsForFile(query: FilePathQuery): Promise<{
errors: project.TSError[]
}> {
+ consistentPath(query);
var program = getOrCreateProject(query.filePath);
var diagnostics = program.languageService.getSyntacticDiagnostics(query.filePath);
if (diagnostics.length === 0) {
@@ -412,21 +506,23 @@ export interface GetRenameInfoResponse {
kindModifiers?: string;
triggerSpan?: TextSpan;
locations?: {
- textSpan: TextSpan;
- filePath: string;
- }[];
+ /** Note that the Text Spans are from bottom of file to top of file */
+ [filePath: string]: TextSpan[]
+ };
}
export function getRenameInfo(query: GetRenameInfoQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
var findInStrings = false, findInComments = false;
var info = project.languageService.getRenameInfo(query.filePath, query.position);
if (info && info.canRename) {
- var locations = project.languageService.findRenameLocations(query.filePath, query.position, findInStrings, findInComments)
- .map(loc=> {
- return {
- textSpan: textSpan(loc.textSpan),
- filePath: loc.fileName
- };
+ var locations: { [filePath: string]: TextSpan[] } = {};
+ project.languageService.findRenameLocations(query.filePath, query.position, findInStrings, findInComments)
+ .forEach(loc=> {
+ if (!locations[loc.fileName]) locations[loc.fileName] = [];
+
+ // Using unshift makes them with maximum value on top ;)
+ locations[loc.fileName].unshift(textSpan(loc.textSpan));
});
return resolve({
canRename: true,
@@ -462,8 +558,8 @@ function filePathWithoutExtension(query: string) {
return path.dirname(query) + '/' + base;
}
export function getRelativePathsInProject(query: GetRelativePathsInProjectQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
- query.filePath = tsconfig.consistentPath(query.filePath);
var sourceDir = path.dirname(query.filePath);
var filePaths = project.projectFile.project.files.filter(p=> p !== query.filePath);
@@ -493,8 +589,25 @@ export interface GetIndentaionAtPositionResponse {
indent: number;
}
export function getIndentationAtPosition(query: GetIndentionAtPositionQuery): Promise {
+ consistentPath(query);
var project = getOrCreateProject(query.filePath);
- var indent = project.languageService.getIndentationAtPosition(query.filePath, query.position, project.projectFile.project.format);
+ var indent = project.languageService.getIndentationAtPosition(query.filePath, query.position, project.projectFile.project.formatCodeOptions);
return resolve({ indent });
}
+
+export interface DebugLanguageServiceHostVersionQuery extends FilePathQuery { }
+export interface DebugLanguageServiceHostVersionResponse { text: string }
+export function debugLanguageServiceHostVersion(query: DebugLanguageServiceHostVersionQuery): Promise {
+ consistentPath(query);
+ var project = getOrCreateProject(query.filePath);
+ return resolve({ text: project.languageServiceHost.getScriptContent(query.filePath) });
+}
+
+export interface GetProjectFileDetailsQuery extends FilePathQuery { }
+export interface GetProjectFileDetailsResponse extends tsconfig.TypeScriptProjectFileDetails { }
+export function getProjectFileDetails(query: GetProjectFileDetailsQuery): Promise {
+ consistentPath(query);
+ var project = getOrCreateProject(query.filePath);
+ return resolve(project.projectFile);
+}
diff --git a/lib/main/tsconfig/tsconfig.ts b/lib/main/tsconfig/tsconfig.ts
index 3686c9a6f..f12747ae4 100644
--- a/lib/main/tsconfig/tsconfig.ts
+++ b/lib/main/tsconfig/tsconfig.ts
@@ -72,21 +72,24 @@ interface TypeScriptProjectRawSpecification {
compilerOptions?: CompilerOptions;
files?: string[]; // optional: paths to files
filesGlob?: string[]; // optional: An array of 'glob / minimatch / RegExp' patterns to specify source files
- formatCodeOptions?: formatting.FormatCodeOptions; // optional: formatting options
+ formatCodeOptions?: formatting.FormatCodeOptions; // optional: formatting options
+ compileOnSave?: boolean; // optional: compile on save. Ignored to build tools. Used by IDEs
}
// Main configuration
export interface TypeScriptProjectSpecification {
compilerOptions: ts.CompilerOptions;
files: string[];
- format: ts.FormatCodeOptions;
+ filesGlob?: string[];
+ formatCodeOptions: ts.FormatCodeOptions;
+ compileOnSave: boolean;
}
///////// FOR USE WITH THE API /////////////
export interface TypeScriptProjectFileDetails {
/** The path to the project file. This acts as the baseDIR */
- projectFileDirectory: string;
+ projectFileDirectory: string;
/** The actual path of the project file (including tsconfig.json) */
projectFilePath: string;
project: TypeScriptProjectSpecification;
@@ -233,6 +236,20 @@ function tsToRawCompilerOptions(compilerOptions: ts.CompilerOptions): CompilerOp
return jsonOptions;
}
+export function getDefaultProject(srcFile: string): TypeScriptProjectFileDetails {
+ var dir = fs.lstatSync(srcFile).isDirectory() ? srcFile : path.dirname(srcFile);
+ return {
+ projectFileDirectory: dir,
+ projectFilePath: dir + '/' + projectFileName,
+ project: {
+ compilerOptions: defaults,
+ files: [srcFile],
+ formatCodeOptions: formatting.defaultFormatCodeOptions(),
+ compileOnSave: true
+ }
+ };
+}
+
/** Given an src (source file or directory) goes up the directory tree to find the project specifications.
* Use this to bootstrap the UI for what project the user might want to work on.
* Note: Definition files (.d.ts) are considered thier own project
@@ -245,35 +262,15 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
// Get the path directory
var dir = fs.lstatSync(pathOrSrcFile).isDirectory() ? pathOrSrcFile : path.dirname(pathOrSrcFile);
- // If we have a .d.ts file then it is its own project and return
- if (dir !== pathOrSrcFile) { // Not a directory
- if (endsWith(pathOrSrcFile.toLowerCase(), '.d.ts')) {
- return {
- projectFileDirectory: dir,
- projectFilePath: dir + '/' + projectFileName,
- project: {
- compilerOptions: defaults,
- files: [pathOrSrcFile],
- format: formatting.defaultFormatCodeOptions()
- },
- }
- }
- }
-
// Keep going up till we find the project file
var projectFile = '';
- while (fs.existsSync(dir)) { // while directory exists
-
- var potentialProjectFile = dir + '/' + projectFileName;
- if (fs.existsSync(potentialProjectFile)) { // found it
- projectFile = potentialProjectFile;
- break;
- }
- else { // go up
- var before = dir;
- dir = path.dirname(dir);
- // At root:
- if (dir == before) throw new Error(errors.GET_PROJECT_NO_PROJECT_FOUND);
+ try {
+ projectFile = travelUpTheDirectoryTreeTillYouFindFile(dir, projectFileName);
+ }
+ catch (e) {
+ let err: Error = e;
+ if (err.message == "not found") {
+ throw new Error(errors.GET_PROJECT_NO_PROJECT_FOUND);
}
}
projectFile = path.normalize(projectFile);
@@ -324,10 +321,12 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
var project: TypeScriptProjectSpecification = {
compilerOptions: {},
files: projectSpec.files,
- format: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
+ filesGlob: projectSpec.filesGlob,
+ formatCodeOptions: formatting.makeFormatCodeOptions(projectSpec.formatCodeOptions),
+ compileOnSave: projectSpec.compileOnSave == undefined ? true : projectSpec.compileOnSave
};
-
- // Validate the raw compiler options before converting them to TS compiler options
+
+ // Validate the raw compiler options before converting them to TS compiler options
var validationResult = validator.validate(projectSpec.compilerOptions);
if (validationResult.errorMessage) {
throw errorWithDetails(
@@ -335,7 +334,7 @@ export function getProjectSync(pathOrSrcFile: string): TypeScriptProjectFileDeta
{ projectFilePath: consistentPath(projectFile), errorMessage: validationResult.errorMessage }
);
}
-
+
// Convert the raw options to TS options
project.compilerOptions = rawToTsCompilerOptions(projectSpec.compilerOptions, projectFileDirectory);
@@ -415,14 +414,28 @@ function increaseProjectForReferenceAndImports(files: string[]) {
dir = path.dirname(file);
referenced.push(
- preProcessedFileInfo.referencedFiles.map(fileReference => path.resolve(dir, fileReference.filename))
+ preProcessedFileInfo.referencedFiles.map(fileReference => {
+ // We assume reference paths are always relative
+ var file = path.resolve(dir, fileReference.fileName);
+ // Try all three, by itself, .ts, .d.ts
+ if (fs.existsSync(file)) {
+ return file;
+ }
+ if (fs.existsSync(file + '.ts')) {
+ return file + '.ts';
+ }
+ if (fs.existsSync(file + '.d.ts')) {
+ return file + '.d.ts';
+ }
+ return null;
+ }).filter(file=> !!file)
.concat(
preProcessedFileInfo.importedFiles
- .filter((fileReference) => pathIsRelative(fileReference.filename))
+ .filter((fileReference) => pathIsRelative(fileReference.fileName))
.map(fileReference => {
- var file = path.resolve(dir, fileReference.filename + '.ts');
+ var file = path.resolve(dir, fileReference.fileName + '.ts');
if (!fs.existsSync(file)) {
- file = path.resolve(dir, fileReference.filename + '.d.ts');
+ file = path.resolve(dir, fileReference.fileName + '.d.ts');
}
return file;
})
@@ -481,7 +494,7 @@ function selectMany(arr: T[][]): T[] {
return result;
}
-function endsWith(str: string, suffix: string): boolean {
+export function endsWith(str: string, suffix: string): boolean {
return str.indexOf(suffix, str.length - suffix.length) !== -1;
}
@@ -507,4 +520,21 @@ export function removeTrailingSlash(filePath: string) {
if (!filePath) return filePath;
if (endsWith(filePath, '/')) return filePath.substr(0, filePath.length - 1);
return filePath;
-}
\ No newline at end of file
+}
+
+/** returns the path if found or throws an error "not found" if not found */
+export function travelUpTheDirectoryTreeTillYouFindFile(dir: string, fileName: string): string {
+ while (fs.existsSync(dir)) { // while directory exists
+
+ var potentialFile = dir + '/' + fileName;
+ if (fs.existsSync(potentialFile)) { // found it
+ return potentialFile;
+ }
+ else { // go up
+ var before = dir;
+ dir = path.dirname(dir);
+ // At root:
+ if (dir == before) throw new Error("not found");
+ }
+ }
+}
diff --git a/lib/tsconfig.json b/lib/tsconfig.json
index 48fce3e31..50b9c3ccb 100644
--- a/lib/tsconfig.json
+++ b/lib/tsconfig.json
@@ -39,6 +39,8 @@
"./main/atom/views/view.ts",
"./main/atomts.ts",
"./main/lang/languageServiceHost.ts",
+ "./main/lang/languageServiceHost2.ts",
+ "./main/lang/languageServiceHostOld.ts",
"./main/lang/project.ts",
"./main/lang/projectService.ts",
"./main/lang/utils.ts",
diff --git a/lib/worker/parent.ts b/lib/worker/parent.ts
index ad4b8bad3..cb76301bf 100644
--- a/lib/worker/parent.ts
+++ b/lib/worker/parent.ts
@@ -36,9 +36,9 @@ function showError(error: Error) {
/** Doesn't mess with any data. Just shows it nicely in the UI */
function catchCommonErrors(func: workerLib.QRFunction): workerLib.QRFunction {
return (q) => func(q).catch((err: Error) => {
- // Left only as a sample
+ // Left only as a sample
// We handle these errors elsewhere now
- /*if (err.message == tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
+ /*if (err.message == tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
atom.notifications.addError('The tsconfig.json file for this TypeScript file contains invalid JSON');
}*/
return Promise.reject(err);
@@ -58,10 +58,13 @@ export var formatDocument = catchCommonErrors(parent.sendToIpc(projectService.fo
export var formatDocumentRange = catchCommonErrors(parent.sendToIpc(projectService.formatDocumentRange));
export var getDefinitionsAtPosition = catchCommonErrors(parent.sendToIpc(projectService.getDefinitionsAtPosition));
export var updateText = catchCommonErrors(parent.sendToIpc(projectService.updateText));
+export var editText = catchCommonErrors(parent.sendToIpc(projectService.editText));
export var errorsForFile = catchCommonErrors(parent.sendToIpc(projectService.errorsForFile));
export var getSignatureHelps = catchCommonErrors(parent.sendToIpc(projectService.getSignatureHelps));
export var getRenameInfo = catchCommonErrors(parent.sendToIpc(projectService.getRenameInfo));
export var getRelativePathsInProject = catchCommonErrors(parent.sendToIpc(projectService.getRelativePathsInProject));
+export var debugLanguageServiceHostVersion = parent.sendToIpc(projectService.debugLanguageServiceHostVersion);
+export var getProjectFileDetails = parent.sendToIpc(projectService.getProjectFileDetails);
// Automatically include all functions from "parentResponses" as responders
import queryParent = require('./queryParent');
diff --git a/lib/worker/queryParent.ts b/lib/worker/queryParent.ts
index 55c5434ae..515011ebc 100644
--- a/lib/worker/queryParent.ts
+++ b/lib/worker/queryParent.ts
@@ -14,7 +14,7 @@ var errorView: typeof _errorView;
try {
require('atom');
- // We are in a safe context:
+ // We are in a safe context:
atomUtils = require('../main/atom/atomUtils');
errorView = require('../main/atom/errorView');
}
@@ -35,30 +35,37 @@ export function getUpdatedTextForUnsavedEditors(query: {}): Promise<{ editors: {
});
}
-export function setProjectFileParsedResult(query: { projectFilePath: string; error: { message: string; details: any } }): Promise<{}> {
+export function getOpenEditorPaths(query: {}): Promise<{ filePaths: string[] }> {
+ var editors = atomUtils.getTypeScriptEditorsWithPaths();
+ return resolve({
+ filePaths: editors.map(e=>tsconfig.consistentPath(e.getPath()))
+ });
+}
+
+export function setConfigurationError(query: { projectFilePath: string; error: { message: string; details: any } }): Promise<{}> {
var errors: project.TSError[] = [];
if (query.error) {
if (query.error.message == tsconfig.errors.GET_PROJECT_JSON_PARSE_FAILED) {
- var invalidJSONDetails: tsconfig.GET_PROJECT_JSON_PARSE_FAILED_Details = query.error.details;
+ let details: tsconfig.GET_PROJECT_JSON_PARSE_FAILED_Details = query.error.details;
errors = [
{
- filePath: invalidJSONDetails.projectFilePath,
+ filePath: details.projectFilePath,
startPos: { line: 0, ch: 0 },
endPos: { line: 0, ch: 0 },
message: "The project file contains invalid JSON",
- preview: invalidJSONDetails.projectFilePath,
+ preview: details.projectFilePath,
}
]
}
if (query.error.message == tsconfig.errors.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS) {
- var invalidOptionDetails: tsconfig.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS_Details = query.error.details;
+ let details: tsconfig.GET_PROJECT_PROJECT_FILE_INVALID_OPTIONS_Details = query.error.details;
errors = [
{
- filePath: invalidOptionDetails.projectFilePath,
+ filePath: details.projectFilePath,
startPos: { line: 0, ch: 0 },
endPos: { line: 0, ch: 0 },
message: "The project file contains invalid options",
- preview: invalidOptionDetails.errorMessage,
+ preview: details.errorMessage,
}
]
}
@@ -68,4 +75,9 @@ export function setProjectFileParsedResult(query: { projectFilePath: string; err
return resolve({});
}
-export interface Test { }
\ No newline at end of file
+export function notifySuccess(query: { message: string }): Promise<{}> {
+ atom.notifications.addSuccess(query.message);
+ return resolve({});
+}
+
+export interface Test { }
diff --git a/node_modules/basarat-text-buffer/LICENSE.md b/node_modules/basarat-text-buffer/LICENSE.md
new file mode 100644
index 000000000..493db50ed
--- /dev/null
+++ b/node_modules/basarat-text-buffer/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/README.md b/node_modules/basarat-text-buffer/README.md
new file mode 100644
index 000000000..aa3d64839
--- /dev/null
+++ b/node_modules/basarat-text-buffer/README.md
@@ -0,0 +1,7 @@
+FORK: - pathwatcher
+
+# Atom TextBuffer Core [](https://travis-ci.org/atom/text-buffer)
+
+This is the core of the Atom text buffer, separated into its own module so its
+tests can be run headless. It handles the storage and manipulation of text and
+associated regions (markers).
diff --git a/node_modules/basarat-text-buffer/api.json b/node_modules/basarat-text-buffer/api.json
new file mode 100644
index 000000000..b6a5c12f8
--- /dev/null
+++ b/node_modules/basarat-text-buffer/api.json
@@ -0,0 +1,2757 @@
+{
+ "classes": {
+ "Point": {
+ "name": "Point",
+ "filename": "src\\point.coffee",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L14",
+ "sections": [
+ {
+ "name": "Construction",
+ "description": ""
+ },
+ {
+ "name": "Comparison",
+ "description": ""
+ },
+ {
+ "name": "Construction",
+ "description": ""
+ },
+ {
+ "name": "Operations",
+ "description": ""
+ },
+ {
+ "name": "Comparison",
+ "description": ""
+ },
+ {
+ "name": "Conversion",
+ "description": ""
+ }
+ ],
+ "classMethods": [
+ {
+ "name": "fromObject",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L28",
+ "visibility": "Public",
+ "summary": "Convert any point-compatible object to a {Point}.",
+ "description": "Convert any point-compatible object to a {Point}.",
+ "arguments": [
+ {
+ "name": "object",
+ "description": "This can be an object that's already a {Point}, in which case it's simply returned, or an array containing two {Number}s representing the row and column.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "copy",
+ "description": "An optional boolean indicating whether to force the copying of objects that are already points.",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns: A {Point} based on the given object."
+ }
+ ]
+ },
+ {
+ "name": "min",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L47",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "point1",
+ "description": "{Point}",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "point2",
+ "description": "{Point} ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns the given {Point} that is earlier in the buffer."
+ }
+ ]
+ }
+ ],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L63",
+ "visibility": "Public",
+ "summary": "Construct a {Point} object",
+ "description": "Construct a {Point} object",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "{Number} row",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "column",
+ "description": "{Number} column ",
+ "type": "Number",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "copy",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L66",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a new {Point} with the same row and column."
+ }
+ ]
+ },
+ {
+ "name": "negate",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L70",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a new {Point} with the row and column negated."
+ }
+ ]
+ },
+ {
+ "name": "freeze",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L80",
+ "visibility": "Public",
+ "summary": "Makes this point immutable and returns itself.",
+ "description": "Makes this point immutable and returns itself.",
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns an immutable version of this {Point}"
+ }
+ ]
+ },
+ {
+ "name": "translate",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L90",
+ "visibility": "Public",
+ "summary": "Build and return a new point by adding the rows and columns of\nthe given point.",
+ "description": "Build and return a new point by adding the rows and columns of\nthe given point.",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} whose row and column will be added to this point's row and column to build the returned point.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a {Point}."
+ }
+ ]
+ },
+ {
+ "name": "traverse",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L114",
+ "visibility": "Public",
+ "summary": "Build and return a new {Point} by traversing the rows and columns\nspecified by the given point.",
+ "description": "Build and return a new {Point} by traversing the rows and columns\nspecified by the given point.\n\nThis method differs from the direct, vector-style addition offered by\n{::translate}. Rather than adding the rows and columns directly, it derives\nthe new point from traversing in \"typewriter space\". At the end of every row\ntraversed, a carriage return occurs that returns the columns to 0 before\ncontinuing the traversal.",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} providing the rows and columns to traverse by.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a {Point}."
+ }
+ ]
+ },
+ {
+ "name": "compare",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L147",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns `-1` if this point precedes the argument."
+ },
+ {
+ "type": null,
+ "description": "Returns `0` if this point is equivalent to the argument."
+ },
+ {
+ "type": null,
+ "description": "Returns `1` if this point follows the argument."
+ }
+ ]
+ },
+ {
+ "name": "isEqual",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L164",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}. ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this point has the same row\nand column as the given {Point} or point-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "isLessThan",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L173",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}. ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this point precedes the given\n{Point} or point-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "isLessThanOrEqual",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L180",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}. ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this point precedes or is\nequal to the given {Point} or point-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "isGreaterThan",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L187",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}. ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this point follows the given\n{Point} or point-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "isGreaterThanOrEqual",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L194",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "other",
+ "description": "A {Point} or point-compatible {Array}. ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this point follows or is\nequal to the given {Point} or point-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "toArray",
+ "sectionName": "Conversion",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L202",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns an array of this point's row and column."
+ }
+ ]
+ },
+ {
+ "name": "serialize",
+ "sectionName": "Conversion",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L206",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns an array of this point's row and column."
+ }
+ ]
+ },
+ {
+ "name": "toString",
+ "sectionName": "Conversion",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\point.coffee#L210",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a string representation of the point."
+ }
+ ]
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Public",
+ "summary": "Represents a point in a buffer in row/column coordinates.",
+ "description": "Represents a point in a buffer in row/column coordinates.\n\nEvery public method that takes a point also accepts a *point-compatible*\n{Array}. This means a 2-element array containing {Number}s representing the\nrow and column. So the following are equivalent:\n\n```coffee\nnew Point(1, 2)\n[1, 2] # Point compatible Array\n```"
+ },
+ "Range": {
+ "name": "Range",
+ "filename": "src\\range.coffee",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L19",
+ "sections": [
+ {
+ "name": "Construction",
+ "description": ""
+ },
+ {
+ "name": "Serialization and Deserialization",
+ "description": ""
+ },
+ {
+ "name": "Construction",
+ "description": ""
+ },
+ {
+ "name": "Serialization and Deserialization",
+ "description": ""
+ },
+ {
+ "name": "Range Details",
+ "description": ""
+ },
+ {
+ "name": "Operations",
+ "description": ""
+ },
+ {
+ "name": "Comparison",
+ "description": ""
+ },
+ {
+ "name": "Conversion",
+ "description": ""
+ }
+ ],
+ "classMethods": [
+ {
+ "name": "fromObject",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L34",
+ "visibility": "Public",
+ "summary": "Convert any range-compatible object to a {Range}.",
+ "description": "Convert any range-compatible object to a {Range}.",
+ "arguments": [
+ {
+ "name": "object",
+ "description": "This can be an object that's already a {Range}, in which case it's simply returned, or an array containing two {Point}s or point-compatible arrays.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "copy",
+ "description": "An optional boolean indicating whether to force the copying of objects that are already ranges.˚",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns: A {Range} based on the given object."
+ }
+ ]
+ },
+ {
+ "name": "deserialize",
+ "sectionName": "Serialization and Deserialization",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L87",
+ "visibility": "Public",
+ "summary": "Call this with the result of {Range::serialize} to construct a new Range.",
+ "description": "Call this with the result of {Range::serialize} to construct a new Range.",
+ "arguments": [
+ {
+ "name": "array",
+ "description": "{array} of params to pass to the {::constructor} ",
+ "type": "array",
+ "isOptional": false
+ }
+ ]
+ }
+ ],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L101",
+ "visibility": "Public",
+ "summary": "Construct a {Range} object",
+ "description": "Construct a {Range} object",
+ "arguments": [
+ {
+ "name": "pointA",
+ "description": "{Point} or Point compatible {Array} (default: [0,0])",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "pointB",
+ "description": "{Point} or Point compatible {Array} (default: [0,0]) ",
+ "type": "Point",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "copy",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L113",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a new range with the same start and end positions."
+ }
+ ]
+ },
+ {
+ "name": "negate",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L117",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a new range with the start and end positions negated."
+ }
+ ]
+ },
+ {
+ "name": "serialize",
+ "sectionName": "Serialization and Deserialization",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L125",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a plain javascript object representation of the range."
+ }
+ ]
+ },
+ {
+ "name": "isEmpty",
+ "sectionName": "Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L135",
+ "visibility": "Public",
+ "summary": "Is the start position of this range equal to the end position?",
+ "description": "Is the start position of this range equal to the end position?",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "isSingleLine",
+ "sectionName": "Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L140",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range starts and ends on\nthe same row."
+ }
+ ]
+ },
+ {
+ "name": "getRowCount",
+ "sectionName": "Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L146",
+ "visibility": "Public",
+ "summary": "Get the number of rows in this range.",
+ "description": "Get the number of rows in this range.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "getRows",
+ "sectionName": "Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L150",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns an array of all rows in the range."
+ }
+ ]
+ },
+ {
+ "name": "freeze",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L161",
+ "visibility": "Public",
+ "summary": "Freezes the range and its start and end point so it becomes\nimmutable and returns itself.",
+ "description": "Freezes the range and its start and end point so it becomes\nimmutable and returns itself.",
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns an immutable version of this {Range}"
+ }
+ ]
+ },
+ {
+ "name": "union",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L169",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array} ",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a new range that contains this range and the given range."
+ }
+ ]
+ },
+ {
+ "name": "translate",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L182",
+ "visibility": "Public",
+ "summary": "Build and return a new range by translating this range's start and\nend points by the given delta(s).",
+ "description": "Build and return a new range by translating this range's start and\nend points by the given delta(s).",
+ "arguments": [
+ {
+ "name": "startDelta",
+ "description": "A {Point} by which to translate the start of this range.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "endDelta",
+ "description": "A {Point} to by which to translate the end of this range. If omitted, the `startDelta` will be used instead.",
+ "type": "Point",
+ "isOptional": true
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns a {Range}."
+ }
+ ]
+ },
+ {
+ "name": "traverse",
+ "sectionName": "Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L194",
+ "visibility": "Public",
+ "summary": "Build and return a new range by traversing this range's start and\nend points by the given delta.",
+ "description": "Build and return a new range by traversing this range's start and\nend points by the given delta.\n\nSee {Point::traverse} for details of how traversal differs from translation.",
+ "arguments": [
+ {
+ "name": "delta",
+ "description": "A {Point} containing the rows and columns to traverse to derive the new range.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns a {Range}."
+ }
+ ]
+ },
+ {
+ "name": "compare",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L213",
+ "visibility": "Public",
+ "summary": "Compare two Ranges",
+ "description": "Compare two Ranges",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array}.",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns `-1` if this range starts before the argument or contains it."
+ },
+ {
+ "type": null,
+ "description": "Returns `0` if this range is equivalent to the argument."
+ },
+ {
+ "type": null,
+ "description": "Returns `1` if this range starts after the argument or is contained by it."
+ }
+ ]
+ },
+ {
+ "name": "isEqual",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L224",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array}. ",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range has the same start\nand end points as the given {Range} or range-compatible {Array}."
+ }
+ ]
+ },
+ {
+ "name": "coversSameRows",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L233",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array}. ",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range starts and ends on\nthe same row as the argument."
+ }
+ ]
+ },
+ {
+ "name": "intersectsWith",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L243",
+ "visibility": "Public",
+ "summary": "Determines whether this range intersects with the argument.",
+ "description": "Determines whether this range intersects with the argument.",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array}",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "exclusive",
+ "description": "{Boolean} indicating whether to exclude endpoints when testing for intersection. Defaults to `false`.",
+ "type": "Boolean",
+ "isOptional": true
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "containsRange",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L255",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "otherRange",
+ "description": "A {Range} or range-compatible {Array}",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "exclusive",
+ "description": "A boolean value including that the containment should be exclusive of endpoints. Defaults to false. ",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range contains the given\nrange."
+ }
+ ]
+ },
+ {
+ "name": "containsPoint",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L265",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "point",
+ "description": "A {Point} or point-compatible {Array}",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "exclusive",
+ "description": "A boolean value including that the containment should be exclusive of endpoints. Defaults to false. ",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range contains the given\npoint."
+ }
+ ]
+ },
+ {
+ "name": "intersectsRow",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L281",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "Row {Number} ",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range intersects the\ngiven row {Number}."
+ }
+ ]
+ },
+ {
+ "name": "intersectsRowRange",
+ "sectionName": "Comparison",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L289",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "arguments": [
+ {
+ "name": "startRow",
+ "description": "{Number} start row",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "endRow",
+ "description": "{Number} end row ",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether this range intersects the\nrow range indicated by the given startRow and endRow {Number}s."
+ }
+ ]
+ },
+ {
+ "name": "toString",
+ "sectionName": "Conversion",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\range.coffee#L306",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a string representation of the range."
+ }
+ ]
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Public",
+ "summary": "Represents a region in a buffer in row/column coordinates.",
+ "description": "Represents a region in a buffer in row/column coordinates.\n\nEvery public method that takes a range also accepts a *range-compatible*\n{Array}. This means a 2-element array containing {Point}s or point-compatible\narrays. So the following are equivalent:",
+ "examples": [
+ {
+ "description": "",
+ "lang": "coffee",
+ "code": "new Range(new Point(0, 1), new Point(2, 3))\nnew Range([0, 1], [2, 3])\n[[0, 1], [2, 3]] # Range compatible array",
+ "raw": "```coffee\nnew Range(new Point(0, 1), new Point(2, 3))\nnew Range([0, 1], [2, 3])\n[[0, 1], [2, 3]] # Range compatible array\n```"
+ }
+ ]
+ },
+ "TextBuffer": {
+ "name": "TextBuffer",
+ "filename": "src\\text-buffer.coffee",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L21",
+ "sections": [
+ {
+ "name": "Construction",
+ "description": ""
+ },
+ {
+ "name": "Event Subscription",
+ "description": ""
+ },
+ {
+ "name": "File Details",
+ "description": ""
+ },
+ {
+ "name": "Reading Text",
+ "description": ""
+ },
+ {
+ "name": "Mutating Text",
+ "description": ""
+ },
+ {
+ "name": "Markers",
+ "description": ""
+ },
+ {
+ "name": "History",
+ "description": ""
+ },
+ {
+ "name": "Search And Replace",
+ "description": ""
+ },
+ {
+ "name": "Buffer Range Details",
+ "description": ""
+ },
+ {
+ "name": "Buffer Operations",
+ "description": ""
+ }
+ ],
+ "classMethods": [],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L54",
+ "visibility": "Public",
+ "summary": "Create a new buffer with the given params.",
+ "description": "Create a new buffer with the given params.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "load",
+ "description": "A {Boolean}, `true` to asynchronously load the buffer from disk after initialization.",
+ "type": "Boolean",
+ "isOptional": false
+ },
+ {
+ "name": "text",
+ "description": "The initial {String} text of the buffer. ",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "name": "params",
+ "description": "{Object} or {String} of text",
+ "type": "Object",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "onDidChange",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L110",
+ "visibility": "Public",
+ "summary": "Invoke the given callback synchronously when the content of the\nbuffer changes.",
+ "description": "Invoke the given callback synchronously when the content of the\nbuffer changes.\n\nBecause observers are invoked synchronously, it's important not to perform\nany expensive operations via this method. Consider {::onDidStopChanging} to\ndelay expensive operations until after changes stop occurring.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "children": [
+ {
+ "name": "oldRange",
+ "description": "{Range} of the old text.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "newRange",
+ "description": "{Range} of the new text.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "oldText",
+ "description": "{String} containing the text that was replaced.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "newText",
+ "description": "{String} containing the text that was inserted.",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "name": "event",
+ "description": "{Object} with the following keys:",
+ "type": "Object",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called when the buffer changes.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidStopChanging",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L127",
+ "visibility": "Public",
+ "summary": "Invoke the given callback asynchronously following one or more\nchanges after {::getStoppedChangingDelay} milliseconds elapse without an\nadditional change.",
+ "description": "Invoke the given callback asynchronously following one or more\nchanges after {::getStoppedChangingDelay} milliseconds elapse without an\nadditional change.\n\nThis method can be used to perform potentially expensive operations that\ndon't need to be performed synchronously. If you need to run your callback\nsynchronously, use {::onDidChange} instead.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called when the buffer stops changing.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidConflict",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L136",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when the in-memory contents of the\nbuffer become in conflict with the contents of the file on disk.",
+ "description": "Invoke the given callback when the in-memory contents of the\nbuffer become in conflict with the contents of the file on disk.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called when the buffer enters conflict.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidChangeModified",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L145",
+ "visibility": "Public",
+ "summary": "Invoke the given callback the value of {::isModified} changes.",
+ "description": "Invoke the given callback the value of {::isModified} changes.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "modified",
+ "description": "{Boolean} indicating whether the buffer is modified.",
+ "type": "Boolean",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called when {::isModified} changes.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidUpdateMarkers",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L166",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when all marker `::onDidChange`\nobservers have been notified following a change to the buffer.",
+ "description": "Invoke the given callback when all marker `::onDidChange`\nobservers have been notified following a change to the buffer.\n\nThe order of events following a buffer change is as follows:\n\n* The text of the buffer is changed\n* All markers are updated accordingly, but their `::onDidChange` observers\n are not notified.\n* `TextBuffer::onDidChange` observers are notified.\n* `Marker::onDidChange` observers are notified.\n* `TextBuffer::onDidUpdateMarkers` observers are notified.\n\nBasically, this method gives you a way to take action after both a buffer\nchange and all associated marker changes.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called after markers are updated.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidCreateMarker",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L175",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when a marker is created.",
+ "description": "Invoke the given callback when a marker is created.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "marker",
+ "description": "{Marker} that was created.",
+ "type": "Marker",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called when a marker is created.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidChangePath",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L184",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when the value of {::getPath} changes.",
+ "description": "Invoke the given callback when the value of {::getPath} changes.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "path",
+ "description": "{String} representing the buffer's current path on disk.",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called when the path changes.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidChangeEncoding",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L193",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when the value of {::getEncoding} changes.",
+ "description": "Invoke the given callback when the value of {::getEncoding} changes.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "encoding",
+ "description": "{String} character set encoding of the buffer.",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called when the encoding changes.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onWillSave",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L201",
+ "visibility": "Public",
+ "summary": "Invoke the given callback before the buffer is saved to disk.",
+ "description": "Invoke the given callback before the buffer is saved to disk.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called before the buffer is saved.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidSave",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L211",
+ "visibility": "Public",
+ "summary": "Invoke the given callback after the buffer is saved to disk.",
+ "description": "Invoke the given callback after the buffer is saved to disk.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "children": [
+ {
+ "name": "path",
+ "description": "The path to which the buffer was saved.",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "name": "event",
+ "description": "{Object} with the following keys:",
+ "type": "Object",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} to be called after the buffer is saved.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onWillReload",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L220",
+ "visibility": "Public",
+ "summary": "Invoke the given callback before the buffer is reloaded from the\ncontents of its file on disk.",
+ "description": "Invoke the given callback before the buffer is reloaded from the\ncontents of its file on disk.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called before the buffer is reloaded.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidReload",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L229",
+ "visibility": "Public",
+ "summary": "Invoke the given callback after the buffer is reloaded from the\ncontents of its file on disk.",
+ "description": "Invoke the given callback after the buffer is reloaded from the\ncontents of its file on disk.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called after the buffer is reloaded.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onDidDestroy",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L237",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when the buffer is destroyed.",
+ "description": "Invoke the given callback when the buffer is destroyed.",
+ "arguments": [
+ {
+ "name": "callback",
+ "description": "{Function} to be called when the buffer is destroyed.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "onWillThrowWatchError",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L250",
+ "visibility": "Public",
+ "summary": "Invoke the given callback when there is an error in watching the\nfile.",
+ "description": "Invoke the given callback when there is an error in watching the\nfile.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "children": [
+ {
+ "name": "error",
+ "description": "{Object} the error object",
+ "type": "Object",
+ "isOptional": false
+ },
+ {
+ "name": "handle",
+ "description": "{Function} call this to indicate you have handled the error. The error will not be thrown if this function is called.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "name": "errorObject",
+ "description": "{Object}",
+ "type": "Object",
+ "isOptional": false
+ }
+ ],
+ "name": "callback",
+ "description": "{Function} callback",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "getStoppedChangingDelay",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L257",
+ "visibility": "Public",
+ "summary": "Get the number of milliseconds that will elapse without a change\nbefore {::onDidStopChanging} observers are invoked following a change.",
+ "description": "Get the number of milliseconds that will elapse without a change\nbefore {::onDidStopChanging} observers are invoked following a change.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "isModified",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L300",
+ "visibility": "Public",
+ "summary": "Determine if the in-memory contents of the buffer differ from its\ncontents on disk.",
+ "description": "Determine if the in-memory contents of the buffer differ from its\ncontents on disk.\n\nIf the buffer is unsaved, always returns `true` unless the buffer is empty.",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "isInConflict",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L314",
+ "visibility": "Public",
+ "summary": "Determine if the in-memory contents of the buffer conflict with the\non-disk contents of its associated file.",
+ "description": "Determine if the in-memory contents of the buffer conflict with the\non-disk contents of its associated file.",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "getPath",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L319",
+ "visibility": "Public",
+ "summary": "Get the path of the associated file.",
+ "description": "Get the path of the associated file.",
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}."
+ }
+ ]
+ },
+ {
+ "name": "setPath",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L325",
+ "visibility": "Public",
+ "summary": "Set the path for the buffer's associated file.",
+ "description": "Set the path for the buffer's associated file.",
+ "arguments": [
+ {
+ "name": "filePath",
+ "description": "A {String} representing the new file path ",
+ "type": "String",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "setEncoding",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L341",
+ "visibility": "Public",
+ "summary": "Sets the character set encoding for this buffer.",
+ "description": "Sets the character set encoding for this buffer.",
+ "arguments": [
+ {
+ "name": "encoding",
+ "description": "The {String} encoding to use (default: 'utf8'). ",
+ "type": "String",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "getEncoding",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L359",
+ "visibility": "Public",
+ "summary": "",
+ "description": "",
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns the {String} encoding of this buffer."
+ }
+ ]
+ },
+ {
+ "name": "getUri",
+ "sectionName": "File Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L364",
+ "visibility": "Public",
+ "summary": "Get the path of the associated file.",
+ "description": "Get the path of the associated file.",
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}."
+ }
+ ]
+ },
+ {
+ "name": "isEmpty",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L383",
+ "visibility": "Public",
+ "summary": "Determine whether the buffer is empty.",
+ "description": "Determine whether the buffer is empty.",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "getText",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L389",
+ "visibility": "Public",
+ "summary": "Get the entire text of the buffer.",
+ "description": "Get the entire text of the buffer.",
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}."
+ }
+ ]
+ },
+ {
+ "name": "getTextInRange",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L403",
+ "visibility": "Public",
+ "summary": "Get the text in a range.",
+ "description": "Get the text in a range.",
+ "arguments": [
+ {
+ "name": "range",
+ "description": "A {Range}",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}"
+ }
+ ]
+ },
+ {
+ "name": "getLines",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L427",
+ "visibility": "Public",
+ "summary": "Get the text of all lines in the buffer, without their line endings.",
+ "description": "Get the text of all lines in the buffer, without their line endings.",
+ "returnValues": [
+ {
+ "type": "Array",
+ "description": "Returns an {Array} of {String}s."
+ }
+ ]
+ },
+ {
+ "name": "getLastLine",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L434",
+ "visibility": "Public",
+ "summary": "Get the text of the last line of the buffer, without its line\nending.",
+ "description": "Get the text of the last line of the buffer, without its line\nending.",
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}."
+ }
+ ]
+ },
+ {
+ "name": "lineForRow",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L442",
+ "visibility": "Public",
+ "summary": "Get the text of the line at the given row, without its line ending.",
+ "description": "Get the text of the line at the given row, without its line ending.",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} representing a 0-indexed row.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}."
+ }
+ ]
+ },
+ {
+ "name": "lineEndingForRow",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L452",
+ "visibility": "Public",
+ "summary": "Get the line ending for the given 0-indexed row.",
+ "description": "Get the line ending for the given 0-indexed row.",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} indicating the row.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "String",
+ "description": "Returns a {String}. The returned newline is represented as a literal string:\n`'\\n'`, `'\\r'`, `'\\r\\n'`, or `''` for the last line of the buffer, which\ndoesn't end in a newline."
+ }
+ ]
+ },
+ {
+ "name": "lineLengthForRow",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L461",
+ "visibility": "Public",
+ "summary": "Get the length of the line for the given 0-indexed row, without its\nline ending.",
+ "description": "Get the length of the line for the given 0-indexed row, without its\nline ending.",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} indicating the row.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "isRowBlank",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L469",
+ "visibility": "Public",
+ "summary": "Determine if the given row contains only whitespace.",
+ "description": "Determine if the given row contains only whitespace.",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} representing a 0-indexed row.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean}."
+ }
+ ]
+ },
+ {
+ "name": "previousNonBlankRow",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L477",
+ "visibility": "Public",
+ "summary": "Given a row, find the first preceding row that's not blank.",
+ "description": "Given a row, find the first preceding row that's not blank.",
+ "arguments": [
+ {
+ "name": "startRow",
+ "description": "A {Number} identifying the row to start checking at.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number} or `null` if there's no preceding non-blank row."
+ }
+ ]
+ },
+ {
+ "name": "nextNonBlankRow",
+ "sectionName": "Reading Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L490",
+ "visibility": "Public",
+ "summary": "Given a row, find the next row that's not blank.",
+ "description": "Given a row, find the next row that's not blank.",
+ "arguments": [
+ {
+ "name": "startRow",
+ "description": "A {Number} identifying the row to start checking at.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number} or `null` if there's no next non-blank row."
+ }
+ ]
+ },
+ {
+ "name": "setText",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L506",
+ "visibility": "Public",
+ "summary": "Replace the entire contents of the buffer with the given text.",
+ "description": "Replace the entire contents of the buffer with the given text.",
+ "arguments": [
+ {
+ "name": "text",
+ "description": "A {String}",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns a {Range} spanning the new buffer contents."
+ }
+ ]
+ },
+ {
+ "name": "setTextViaDiff",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L513",
+ "visibility": "Public",
+ "summary": "Replace the current buffer contents by applying a diff based on the\ngiven text.",
+ "description": "Replace the current buffer contents by applying a diff based on the\ngiven text.",
+ "arguments": [
+ {
+ "name": "text",
+ "description": "A {String} containing the new buffer contents. ",
+ "type": "String",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "setTextInRange",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L565",
+ "visibility": "Public",
+ "summary": "Set the text in the given range.",
+ "description": "Set the text in the given range.",
+ "arguments": [
+ {
+ "name": "range",
+ "description": "A {Range}",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "text",
+ "description": "A {String}",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "normalizeLineEndings",
+ "description": "{Boolean} (default: true)",
+ "type": "Boolean",
+ "isOptional": true
+ },
+ {
+ "name": "undo",
+ "description": "{String} 'skip' will skip the undo system",
+ "type": "String",
+ "isOptional": true
+ }
+ ],
+ "name": "options",
+ "description": "{Object}",
+ "type": "Object",
+ "isOptional": true
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the {Range} of the inserted text."
+ }
+ ]
+ },
+ {
+ "name": "insert",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L588",
+ "visibility": "Public",
+ "summary": "Insert text at the given position.",
+ "description": "Insert text at the given position.",
+ "arguments": [
+ {
+ "name": "position",
+ "description": "A {Point} representing the insertion location. The position is clipped before insertion.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "text",
+ "description": "A {String} representing the text to insert.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "normalizeLineEndings",
+ "description": "{Boolean} (default: true)",
+ "type": "Boolean",
+ "isOptional": true
+ },
+ {
+ "name": "undo",
+ "description": "{String} 'skip' will skip the undo system",
+ "type": "String",
+ "isOptional": true
+ }
+ ],
+ "name": "options",
+ "description": "{Object}",
+ "type": "Object",
+ "isOptional": true
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the {Range} of the inserted text."
+ }
+ ]
+ },
+ {
+ "name": "append",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L599",
+ "visibility": "Public",
+ "summary": "Append text to the end of the buffer.",
+ "description": "Append text to the end of the buffer.",
+ "arguments": [
+ {
+ "name": "text",
+ "description": "A {String} representing the text text to append.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "normalizeLineEndings",
+ "description": "{Boolean} (default: true)",
+ "type": "Boolean",
+ "isOptional": true
+ },
+ {
+ "name": "undo",
+ "description": "{String} 'skip' will skip the undo system",
+ "type": "String",
+ "isOptional": true
+ }
+ ],
+ "name": "options",
+ "description": "{Object}",
+ "type": "Object",
+ "isOptional": true
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the {Range} of the inserted text"
+ }
+ ]
+ },
+ {
+ "name": "delete",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L680",
+ "visibility": "Public",
+ "summary": "Delete the text in the given range.",
+ "description": "Delete the text in the given range.",
+ "arguments": [
+ {
+ "name": "range",
+ "description": "A {Range} in which to delete. The range is clipped before deleting.",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns an empty {Range} starting at the start of deleted range."
+ }
+ ]
+ },
+ {
+ "name": "deleteRow",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L688",
+ "visibility": "Public",
+ "summary": "Delete the line associated with a specified row.",
+ "description": "Delete the line associated with a specified row.",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} representing the 0-indexed row to delete.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the {Range} of the deleted text."
+ }
+ ]
+ },
+ {
+ "name": "deleteRows",
+ "sectionName": "Mutating Text",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L700",
+ "visibility": "Public",
+ "summary": "Delete the lines associated with the specified row range.",
+ "description": "Delete the lines associated with the specified row range.\n\nIf the row range is out of bounds, it will be clipped. If the startRow is\ngreater than the end row, they will be reordered.",
+ "arguments": [
+ {
+ "name": "startRow",
+ "description": "A {Number} representing the first row to delete.",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "endRow",
+ "description": "A {Number} representing the last row to delete, inclusive.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the {Range} of the deleted text."
+ }
+ ]
+ },
+ {
+ "name": "markRange",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L756",
+ "visibility": "Public",
+ "summary": "Create a marker with the given range. This marker will maintain\nits logical location as the buffer is changed, so if you mark a particular\nword, the marker will remain over that word even if the word's location in\nthe buffer changes.",
+ "description": "Create a marker with the given range. This marker will maintain\nits logical location as the buffer is changed, so if you mark a particular\nword, the marker will remain over that word even if the word's location in\nthe buffer changes.",
+ "arguments": [
+ {
+ "name": "range",
+ "description": "A {Range} or range-compatible {Array}",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "reversed",
+ "description": "Creates the marker in a reversed orientation. (default: false)",
+ "type": null,
+ "isOptional": true
+ },
+ {
+ "name": "persistent",
+ "description": "Whether to include this marker when serializing the buffer. (default: true)",
+ "type": null,
+ "isOptional": true
+ },
+ {
+ "name": "invalidate",
+ "description": "Determines the rules by which changes to the buffer *invalidate* the marker. (default: 'overlap') It can be any of the following strategies, in order of fragility\n* __never__: The marker is never marked as invalid. This is a good choice for\n markers representing selections in an editor.\n* __surround__: The marker is invalidated by changes that completely surround it.\n* __overlap__: The marker is invalidated by changes that surround the\n start or end of the marker. This is the default.\n* __inside__: The marker is invalidated by changes that extend into the\n inside of the marker. Changes that end at the marker's start or\n start at the marker's end do not invalidate the marker.\n* __touch__: The marker is invalidated by a change that touches the marked\n region in any way, including changes that end at the marker's\n start or start at the marker's end. This is the most fragile strategy.",
+ "type": null,
+ "isOptional": true
+ }
+ ],
+ "name": "properties",
+ "description": "A hash of key-value pairs to associate with the marker. There are also reserved property names that have marker-specific meaning.",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Marker",
+ "description": "Returns a {Marker}."
+ }
+ ]
+ },
+ {
+ "name": "markPosition",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L764",
+ "visibility": "Public",
+ "summary": "Create a marker at the given position with no tail.",
+ "description": "Create a marker at the given position with no tail.",
+ "arguments": [
+ {
+ "name": "position",
+ "description": "{Point} or point-compatible {Array}",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "properties",
+ "description": "This is the same as the `properties` parameter in {::markRange}",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Marker",
+ "description": "Returns a {Marker}."
+ }
+ ]
+ },
+ {
+ "name": "getMarkers",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L769",
+ "visibility": "Public",
+ "summary": "Get all existing markers on the buffer.",
+ "description": "Get all existing markers on the buffer.",
+ "returnValues": [
+ {
+ "type": "Array",
+ "description": "Returns an {Array} of {Marker}s."
+ }
+ ]
+ },
+ {
+ "name": "getMarker",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L776",
+ "visibility": "Public",
+ "summary": "Get an existing marker by its id.",
+ "description": "Get an existing marker by its id.",
+ "arguments": [
+ {
+ "name": "id",
+ "description": "{Number} id of the marker to retrieve",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Marker",
+ "description": "Returns a {Marker}."
+ }
+ ]
+ },
+ {
+ "name": "findMarkers",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L796",
+ "visibility": "Public",
+ "summary": "Find markers conforming to the given parameters.",
+ "description": "Find markers conforming to the given parameters.\n\nMarkers are sorted based on their position in the buffer. If two markers\nstart at the same position, the larger marker comes first.",
+ "arguments": [
+ {
+ "children": [
+ {
+ "name": "startPosition",
+ "description": "Only include markers that start at the given {Point}.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "endPosition",
+ "description": "Only include markers that end at the given {Point}.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "containsPoint",
+ "description": "Only include markers that contain the given {Point}, inclusive.",
+ "type": "Point",
+ "isOptional": false
+ },
+ {
+ "name": "containsRange",
+ "description": "Only include markers that contain the given {Range}, inclusive.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "startRow",
+ "description": "Only include markers that start at the given row {Number}.",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "endRow",
+ "description": "Only include markers that end at the given row {Number}.",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "intersectsRow",
+ "description": "Only include markers that intersect the given row {Number}.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "name": "params",
+ "description": "A hash of key-value pairs constraining the set of returned markers. You can query against custom marker properties by listing the desired key-value pairs here. In addition, the following keys are reserved and have special semantics:",
+ "type": null,
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Array",
+ "description": "Returns an {Array} of {Marker}s."
+ }
+ ]
+ },
+ {
+ "name": "getMarkerCount",
+ "sectionName": "Markers",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L801",
+ "visibility": "Public",
+ "summary": "Get the number of markers in the buffer.",
+ "description": "Get the number of markers in the buffer.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "undo",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L811",
+ "visibility": "Public",
+ "summary": "Undo the last operation. If a transaction is in progress, aborts it. ",
+ "description": "Undo the last operation. If a transaction is in progress, aborts it. "
+ },
+ {
+ "name": "redo",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L814",
+ "visibility": "Public",
+ "summary": "Redo the last operation ",
+ "description": "Redo the last operation "
+ },
+ {
+ "name": "transact",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L829",
+ "visibility": "Public",
+ "summary": "Batch multiple operations as a single undo/redo step.",
+ "description": "Batch multiple operations as a single undo/redo step.\n\nAny group of operations that are logically grouped from the perspective of\nundoing and redoing should be performed in a transaction. If you want to\nabort the transaction, call {::abortTransaction} to terminate the function's\nexecution and revert any changes performed up to the abortion.",
+ "arguments": [
+ {
+ "name": "groupingInterval",
+ "description": "The {Number} of milliseconds for which this transaction should be considered 'open for grouping' after it begins. If a transaction with a positive `groupingInterval` is committed while the previous transaction is still open for grouping, the two transactions are merged with respect to undo and redo.",
+ "type": "Number",
+ "isOptional": true
+ },
+ {
+ "name": "fn",
+ "description": "A {Function} to call inside the transaction. ",
+ "type": "Function",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "clearUndoStack",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L850",
+ "visibility": "Public",
+ "summary": "Clear the undo stack. ",
+ "description": "Clear the undo stack. "
+ },
+ {
+ "name": "createCheckpoint",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L856",
+ "visibility": "Public",
+ "summary": "Create a pointer to the current state of the buffer for use\nwith {::revertToCheckpoint} and {::groupChangesSinceCheckpoint}.",
+ "description": "Create a pointer to the current state of the buffer for use\nwith {::revertToCheckpoint} and {::groupChangesSinceCheckpoint}.",
+ "returnValues": [
+ {
+ "type": null,
+ "description": "Returns a checkpoint value."
+ }
+ ]
+ },
+ {
+ "name": "revertToCheckpoint",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L867",
+ "visibility": "Public",
+ "summary": "Revert the buffer to the state it was in when the given\ncheckpoint was created.",
+ "description": "Revert the buffer to the state it was in when the given\ncheckpoint was created.\n\nThe redo stack will be empty following this operation, so changes since the\ncheckpoint will be lost. If the given checkpoint is no longer present in the\nundo history, no changes will be made to the buffer and this method will\nreturn `false`.",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether the operation succeeded."
+ }
+ ]
+ },
+ {
+ "name": "groupChangesSinceCheckpoint",
+ "sectionName": "History",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L876",
+ "visibility": "Public",
+ "summary": "Group all changes since the given checkpoint into a single\ntransaction for purposes of undo/redo.",
+ "description": "Group all changes since the given checkpoint into a single\ntransaction for purposes of undo/redo.\n\nIf the given checkpoint is no longer present in the undo history, no\ngrouping will be performed and this method will return `false`.",
+ "returnValues": [
+ {
+ "type": "Boolean",
+ "description": "Returns a {Boolean} indicating whether the operation succeeded."
+ }
+ ]
+ },
+ {
+ "name": "scan",
+ "sectionName": "Search And Replace",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L896",
+ "visibility": "Public",
+ "summary": "Scan regular expression matches in the entire buffer, calling the\ngiven iterator function on each match.",
+ "description": "Scan regular expression matches in the entire buffer, calling the\ngiven iterator function on each match.\n\nIf you're programmatically modifying the results, you may want to try\n{::backwardsScan} to avoid tripping over your own changes.",
+ "arguments": [
+ {
+ "name": "regex",
+ "description": "A {RegExp} to search for.",
+ "type": "RegExp",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "match",
+ "description": "The current regular expression match.",
+ "type": null,
+ "isOptional": false
+ },
+ {
+ "name": "matchText",
+ "description": "A {String} with the text of the match.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "The {Range} of the match.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "stop",
+ "description": "Call this {Function} to terminate the scan.",
+ "type": "Function",
+ "isOptional": false
+ },
+ {
+ "name": "replace",
+ "description": "Call this {Function} with a {String} to replace the match. ",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "name": "iterator",
+ "description": "A {Function} that's called on each match with an {Object} containing the following keys:",
+ "type": "Function",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "backwardsScan",
+ "sectionName": "Search And Replace",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L913",
+ "visibility": "Public",
+ "summary": "Scan regular expression matches in the entire buffer in reverse\norder, calling the given iterator function on each match.",
+ "description": "Scan regular expression matches in the entire buffer in reverse\norder, calling the given iterator function on each match.",
+ "arguments": [
+ {
+ "name": "regex",
+ "description": "A {RegExp} to search for.",
+ "type": "RegExp",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "match",
+ "description": "The current regular expression match.",
+ "type": null,
+ "isOptional": false
+ },
+ {
+ "name": "matchText",
+ "description": "A {String} with the text of the match.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "The {Range} of the match.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "stop",
+ "description": "Call this {Function} to terminate the scan.",
+ "type": "Function",
+ "isOptional": false
+ },
+ {
+ "name": "replace",
+ "description": "Call this {Function} with a {String} to replace the match. ",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "name": "iterator",
+ "description": "A {Function} that's called on each match with an {Object} containing the following keys:",
+ "type": "Function",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "scanInRange",
+ "sectionName": "Search And Replace",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L931",
+ "visibility": "Public",
+ "summary": "Scan regular expression matches in a given range , calling the given\niterator function on each match.",
+ "description": "Scan regular expression matches in a given range , calling the given\niterator function on each match.",
+ "arguments": [
+ {
+ "name": "regex",
+ "description": "A {RegExp} to search for.",
+ "type": "RegExp",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "A {Range} in which to search.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "match",
+ "description": "The current regular expression match.",
+ "type": null,
+ "isOptional": false
+ },
+ {
+ "name": "matchText",
+ "description": "A {String} with the text of the match.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "The {Range} of the match.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "stop",
+ "description": "Call this {Function} to terminate the scan.",
+ "type": "Function",
+ "isOptional": false
+ },
+ {
+ "name": "replace",
+ "description": "Call this {Function} with a {String} to replace the match. ",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "name": "iterator",
+ "description": "A {Function} that's called on each match with an {Object} containing the following keys:",
+ "type": "Function",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "backwardsScanInRange",
+ "sectionName": "Search And Replace",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L981",
+ "visibility": "Public",
+ "summary": "Scan regular expression matches in a given range in reverse order,\ncalling the given iterator function on each match.",
+ "description": "Scan regular expression matches in a given range in reverse order,\ncalling the given iterator function on each match.",
+ "arguments": [
+ {
+ "name": "regex",
+ "description": "A {RegExp} to search for.",
+ "type": "RegExp",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "A {Range} in which to search.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "children": [
+ {
+ "name": "match",
+ "description": "The current regular expression match.",
+ "type": null,
+ "isOptional": false
+ },
+ {
+ "name": "matchText",
+ "description": "A {String} with the text of the match.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "range",
+ "description": "The {Range} of the match.",
+ "type": "Range",
+ "isOptional": false
+ },
+ {
+ "name": "stop",
+ "description": "Call this {Function} to terminate the scan.",
+ "type": "Function",
+ "isOptional": false
+ },
+ {
+ "name": "replace",
+ "description": "Call this {Function} with a {String} to replace the match. ",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "name": "iterator",
+ "description": "A {Function} that's called on each match with an {Object} containing the following keys:",
+ "type": "Function",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "replace",
+ "sectionName": "Search And Replace",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L990",
+ "visibility": "Public",
+ "summary": "Replace all regular expression matches in the entire buffer.",
+ "description": "Replace all regular expression matches in the entire buffer.",
+ "arguments": [
+ {
+ "name": "regex",
+ "description": "A {RegExp} representing the matches to be replaced.",
+ "type": "RegExp",
+ "isOptional": false
+ },
+ {
+ "name": "replacementText",
+ "description": "A {String} representing the text to replace each match.",
+ "type": "String",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number} representing the number of replacements made."
+ }
+ ]
+ },
+ {
+ "name": "getRange",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1040",
+ "visibility": "Public",
+ "summary": "Get the range spanning from `[0, 0]` to {::getEndPosition}.",
+ "description": "Get the range spanning from `[0, 0]` to {::getEndPosition}.",
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns a {Range}."
+ }
+ ]
+ },
+ {
+ "name": "getLineCount",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1046",
+ "visibility": "Public",
+ "summary": "Get the number of lines in the buffer.",
+ "description": "Get the number of lines in the buffer.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "getLastRow",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1052",
+ "visibility": "Public",
+ "summary": "Get the last 0-indexed row in the buffer.",
+ "description": "Get the last 0-indexed row in the buffer.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "getFirstPosition",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1058",
+ "visibility": "Public",
+ "summary": "Get the first position in the buffer, which is always `[0, 0]`.",
+ "description": "Get the first position in the buffer, which is always `[0, 0]`.",
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a {Point}."
+ }
+ ]
+ },
+ {
+ "name": "getEndPosition",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1065",
+ "visibility": "Public",
+ "summary": "Get the maximal position in the buffer, where new text would be\nappended.",
+ "description": "Get the maximal position in the buffer, where new text would be\nappended.",
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a {Point}."
+ }
+ ]
+ },
+ {
+ "name": "getMaxCharacterIndex",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1072",
+ "visibility": "Public",
+ "summary": "Get the length of the buffer in characters.",
+ "description": "Get the length of the buffer in characters.",
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "rangeForRow",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1083",
+ "visibility": "Public",
+ "summary": "Get the range for the given row",
+ "description": "Get the range for the given row",
+ "arguments": [
+ {
+ "name": "row",
+ "description": "A {Number} representing a 0-indexed row.",
+ "type": "Number",
+ "isOptional": false
+ },
+ {
+ "name": "includeNewline",
+ "description": "A {Boolean} indicating whether or not to include the newline, which results in a range that extends to the start of the next line.",
+ "type": "Boolean",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns a {Range}."
+ }
+ ]
+ },
+ {
+ "name": "characterIndexForPosition",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1102",
+ "visibility": "Public",
+ "summary": "Convert a position in the buffer in row/column coordinates to an\nabsolute character offset, inclusive of line ending characters.",
+ "description": "Convert a position in the buffer in row/column coordinates to an\nabsolute character offset, inclusive of line ending characters.\n\nThe position is clipped prior to translating.",
+ "arguments": [
+ {
+ "name": "position",
+ "description": "A {Point}.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Number",
+ "description": "Returns a {Number}."
+ }
+ ]
+ },
+ {
+ "name": "positionForCharacterIndex",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1119",
+ "visibility": "Public",
+ "summary": "Convert an absolute character offset, inclusive of newlines, to a\nposition in the buffer in row/column coordinates.",
+ "description": "Convert an absolute character offset, inclusive of newlines, to a\nposition in the buffer in row/column coordinates.\n\nThe offset is clipped prior to translating.",
+ "arguments": [
+ {
+ "name": "offset",
+ "description": "A {Number}.",
+ "type": "Number",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a {Point}."
+ }
+ ]
+ },
+ {
+ "name": "clipRange",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1138",
+ "visibility": "Public",
+ "summary": "Clip the given range so it starts and ends at valid positions.",
+ "description": "Clip the given range so it starts and ends at valid positions.\n\nFor example, the position `[1, 100]` is out of bounds if the line at row 1 is\nonly 10 characters long, and it would be clipped to `(1, 10)`.",
+ "arguments": [
+ {
+ "name": "range",
+ "description": "A {Range} or range-compatible {Array} to clip.",
+ "type": "Range",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Range",
+ "description": "Returns the given {Range} if it is already in bounds, or a new clipped\n{Range} if the given range is out-of-bounds."
+ }
+ ]
+ },
+ {
+ "name": "clipPosition",
+ "sectionName": "Buffer Range Details",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1156",
+ "visibility": "Public",
+ "summary": "Clip the given point so it is at a valid position in the buffer.",
+ "description": "Clip the given point so it is at a valid position in the buffer.\n\nFor example, the position (1, 100) is out of bounds if the line at row 1 is\nonly 10 characters long, and it would be clipped to (1, 10)",
+ "arguments": [
+ {
+ "name": "position",
+ "description": "A {Point} or point-compatible {Array}.",
+ "type": "Point",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Point",
+ "description": "Returns a new {Point} if the given position is invalid, otherwise returns\nthe given position."
+ }
+ ]
+ },
+ {
+ "name": "save",
+ "sectionName": "Buffer Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1176",
+ "visibility": "Public",
+ "summary": "Save the buffer. ",
+ "description": "Save the buffer. "
+ },
+ {
+ "name": "saveAs",
+ "sectionName": "Buffer Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1182",
+ "visibility": "Public",
+ "summary": "Save the buffer at a specific path.",
+ "description": "Save the buffer at a specific path.",
+ "arguments": [
+ {
+ "name": "filePath",
+ "description": "The path to save at. ",
+ "type": null,
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "reload",
+ "sectionName": "Buffer Operations",
+ "srcUrl": "https://github.com/atom/text-buffer\\blob\\v4.1.5\\src\\text-buffer.coffee#L1198",
+ "visibility": "Public",
+ "summary": "Reload the buffer's contents from disk.",
+ "description": "Reload the buffer's contents from disk.\n\nSets the buffer's content to the cached disk contents "
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Extended",
+ "summary": "A mutable text container with undo/redo support and the ability to\nannotate logical regions in the text. ",
+ "description": "A mutable text container with undo/redo support and the ability to\nannotate logical regions in the text. "
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/lib/buffer-patch.js b/node_modules/basarat-text-buffer/lib/buffer-patch.js
new file mode 100644
index 000000000..80bcd7688
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/buffer-patch.js
@@ -0,0 +1,85 @@
+(function() {
+ var BufferPatch, Range, Serializable,
+ __hasProp = {}.hasOwnProperty,
+ __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; };
+
+ Serializable = require('serializable');
+
+ Range = require('./range');
+
+ module.exports = BufferPatch = (function(_super) {
+ __extends(BufferPatch, _super);
+
+ function BufferPatch(oldRange, newRange, oldText, newText, normalizeLineEndings, markerPatches) {
+ this.oldRange = oldRange;
+ this.newRange = newRange;
+ this.oldText = oldText;
+ this.newText = newText;
+ this.normalizeLineEndings = normalizeLineEndings;
+ this.markerPatches = markerPatches != null ? markerPatches : {};
+ }
+
+ BufferPatch.prototype.serializeParams = function() {
+ var id, markerPatches, newRange, oldRange, patch, _i, _len, _ref;
+ oldRange = this.oldRange.serialize();
+ newRange = this.newRange.serialize();
+ markerPatches = {};
+ _ref = this.markerPatches;
+ for (patch = _i = 0, _len = _ref.length; _i < _len; patch = ++_i) {
+ id = _ref[patch];
+ markerPatches[id] = patch.serialize();
+ }
+ return {
+ oldRange: oldRange,
+ newRange: newRange,
+ oldText: this.oldText,
+ newText: this.newText,
+ normalizeLineEndings: this.normalizeLineEndings,
+ markerPatches: markerPatches
+ };
+ };
+
+ BufferPatch.prototype.deserializeParams = function(params) {
+ var id, patchState, _i, _len, _ref;
+ params.oldRange = Range.deserialize(params.oldRange);
+ params.newRange = Range.deserialize(params.newRange);
+ _ref = params.markerPatches;
+ for (patchState = _i = 0, _len = _ref.length; _i < _len; patchState = ++_i) {
+ id = _ref[patchState];
+ params.markerPatches[id] = MarkerPatch.deserialize(patchState);
+ }
+ return params;
+ };
+
+ BufferPatch.prototype.invert = function(buffer) {
+ var id, invertedPatch, marker, markerPatches, patch, _i, _len, _ref, _ref1;
+ markerPatches = {};
+ _ref = this.markerPatches;
+ for (id in _ref) {
+ patch = _ref[id];
+ markerPatches[id] = patch.invert();
+ }
+ invertedPatch = new this.constructor(this.newRange, this.oldRange, this.newText, this.oldText, this.normalizeLineEndings, markerPatches);
+ _ref1 = buffer.getMarkers();
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ marker = _ref1[_i];
+ if (this.markerPatches[marker.id] == null) {
+ marker.handleBufferChange(invertedPatch);
+ }
+ }
+ return invertedPatch;
+ };
+
+ BufferPatch.prototype.applyTo = function(buffer) {
+ return buffer.applyPatch(this);
+ };
+
+ BufferPatch.prototype.addMarkerPatch = function(patch) {
+ return this.markerPatches[patch.id] = patch;
+ };
+
+ return BufferPatch;
+
+ })(Serializable);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/checkpoint.js b/node_modules/basarat-text-buffer/lib/checkpoint.js
new file mode 100644
index 000000000..dca001644
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/checkpoint.js
@@ -0,0 +1,21 @@
+(function() {
+ var Checkpoint, Serializable,
+ __hasProp = {}.hasOwnProperty,
+ __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; };
+
+ Serializable = require('serializable');
+
+ module.exports = Checkpoint = (function(_super) {
+ __extends(Checkpoint, _super);
+
+ function Checkpoint() {
+ return Checkpoint.__super__.constructor.apply(this, arguments);
+ }
+
+ Checkpoint.registerDeserializers(Checkpoint);
+
+ return Checkpoint;
+
+ })(Serializable);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/helpers.js b/node_modules/basarat-text-buffer/lib/helpers.js
new file mode 100644
index 000000000..b81eba12b
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/helpers.js
@@ -0,0 +1,28 @@
+(function() {
+ var SpliceArrayChunkSize,
+ __slice = [].slice;
+
+ SpliceArrayChunkSize = 100000;
+
+ module.exports = {
+ spliceArray: function(originalArray, start, length, insertedArray) {
+ var chunk, chunkEnd, chunkStart, removedValues, _i, _ref;
+ if (insertedArray == null) {
+ insertedArray = [];
+ }
+ if (insertedArray.length < SpliceArrayChunkSize) {
+ return originalArray.splice.apply(originalArray, [start, length].concat(__slice.call(insertedArray)));
+ } else {
+ removedValues = originalArray.splice(start, length);
+ for (chunkStart = _i = 0, _ref = insertedArray.length; SpliceArrayChunkSize > 0 ? _i <= _ref : _i >= _ref; chunkStart = _i += SpliceArrayChunkSize) {
+ chunkEnd = chunkStart + SpliceArrayChunkSize;
+ chunk = insertedArray.slice(chunkStart, chunkEnd);
+ originalArray.splice.apply(originalArray, [start + chunkStart, 0].concat(__slice.call(chunk)));
+ }
+ return removedValues;
+ }
+ },
+ newlineRegex: /\r\n|\n|\r/g
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/history.js b/node_modules/basarat-text-buffer/lib/history.js
new file mode 100644
index 000000000..75a52cd35
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/history.js
@@ -0,0 +1,234 @@
+(function() {
+ var BufferPatch, Checkpoint, History, Serializable, Transaction, TransactionAborted, last,
+ __hasProp = {}.hasOwnProperty,
+ __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; },
+ __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; };
+
+ Serializable = require('serializable');
+
+ Transaction = require('./transaction');
+
+ BufferPatch = require('./buffer-patch');
+
+ Checkpoint = require('./checkpoint');
+
+ last = require('underscore-plus').last;
+
+ TransactionAborted = new Error("Transaction Aborted");
+
+ module.exports = History = (function(_super) {
+ __extends(History, _super);
+
+ History.registerDeserializers(Transaction, BufferPatch);
+
+ History.prototype.currentTransaction = null;
+
+ History.prototype.transactionDepth = 0;
+
+ History.prototype.transactCallDepth = 0;
+
+ function History(buffer, undoStack, redoStack) {
+ this.buffer = buffer;
+ this.undoStack = undoStack != null ? undoStack : [];
+ this.redoStack = redoStack != null ? redoStack : [];
+ }
+
+ History.prototype.serializeParams = function() {
+ return {
+ undoStack: this.undoStack.map(function(patch) {
+ return patch.serialize();
+ }),
+ redoStack: this.redoStack.map(function(patch) {
+ return patch.serialize();
+ })
+ };
+ };
+
+ History.prototype.deserializeParams = function(params) {
+ params.undoStack = params.undoStack.map((function(_this) {
+ return function(patchState) {
+ return _this.constructor.deserialize(patchState);
+ };
+ })(this));
+ params.redoStack = params.redoStack.map((function(_this) {
+ return function(patchState) {
+ return _this.constructor.deserialize(patchState);
+ };
+ })(this));
+ return params;
+ };
+
+ History.prototype.recordNewPatch = function(patch) {
+ if (this.currentTransaction != null) {
+ this.currentTransaction.push(patch);
+ if (patch instanceof BufferPatch) {
+ return this.clearRedoStack();
+ }
+ } else {
+ this.undoStack.push(patch);
+ return this.clearRedoStack();
+ }
+ };
+
+ History.prototype.undo = function() {
+ var inverse, patch;
+ if (this.currentTransaction != null) {
+ throw new Error("Can't undo with an open transaction");
+ }
+ if (last(this.undoStack) instanceof Checkpoint) {
+ if (!(this.undoStack.length > 1)) {
+ return;
+ }
+ this.redoStack.push(this.undoStack.pop());
+ }
+ if (patch = this.undoStack.pop()) {
+ inverse = patch.invert(this.buffer);
+ this.redoStack.push(inverse);
+ return inverse.applyTo(this.buffer);
+ }
+ };
+
+ History.prototype.redo = function() {
+ var inverse, patch;
+ if (this.currentTransaction != null) {
+ throw new Error("Can't redo with an open transaction");
+ }
+ if (patch = this.redoStack.pop()) {
+ inverse = patch.invert(this.buffer);
+ this.undoStack.push(inverse);
+ inverse.applyTo(this.buffer);
+ if (last(this.redoStack) instanceof Checkpoint) {
+ return this.undoStack.push(this.redoStack.pop());
+ }
+ }
+ };
+
+ History.prototype.transact = function(groupingInterval, fn) {
+ var error, result;
+ if (fn == null) {
+ fn = groupingInterval;
+ groupingInterval = void 0;
+ }
+ this.beginTransaction(groupingInterval);
+ try {
+ ++this.transactCallDepth;
+ result = fn();
+ --this.transactCallDepth;
+ this.commitTransaction();
+ return result;
+ } catch (_error) {
+ error = _error;
+ if (--this.transactCallDepth === 0) {
+ this.abortTransaction();
+ if (error !== TransactionAborted) {
+ throw error;
+ }
+ } else {
+ throw error;
+ }
+ }
+ };
+
+ History.prototype.beginTransaction = function(groupingInterval) {
+ if (++this.transactionDepth === 1) {
+ return this.currentTransaction = new Transaction([], groupingInterval);
+ }
+ };
+
+ History.prototype.commitTransaction = function() {
+ var lastTransaction, _base;
+ if (!(this.transactionDepth > 0)) {
+ throw new Error("No transaction is open");
+ }
+ if (--this.transactionDepth === 0) {
+ if (this.currentTransaction.hasBufferPatches()) {
+ lastTransaction = last(this.undoStack);
+ if ((typeof (_base = this.currentTransaction).isOpenForGrouping === "function" ? _base.isOpenForGrouping() : void 0) && (lastTransaction != null ? typeof lastTransaction.isOpenForGrouping === "function" ? lastTransaction.isOpenForGrouping() : void 0 : void 0)) {
+ lastTransaction.merge(this.currentTransaction);
+ } else {
+ this.undoStack.push(this.currentTransaction);
+ }
+ }
+ return this.currentTransaction = null;
+ }
+ };
+
+ History.prototype.abortTransaction = function() {
+ var inverse;
+ if (!(this.transactionDepth > 0)) {
+ throw new Error("No transaction is open");
+ }
+ if (this.transactCallDepth === 0) {
+ inverse = this.currentTransaction.invert(this.buffer);
+ this.currentTransaction = null;
+ this.transactionDepth = 0;
+ return inverse.applyTo(this.buffer);
+ } else {
+ throw TransactionAborted;
+ }
+ };
+
+ History.prototype.createCheckpoint = function() {
+ var checkpoint;
+ if (this.isTransacting()) {
+ throw new Error("Cannot create a checkpoint inside of a transaction");
+ }
+ if (last(this.undoStack) instanceof Checkpoint) {
+ return last(this.undoStack);
+ } else {
+ checkpoint = new Checkpoint;
+ this.undoStack.push(checkpoint);
+ return checkpoint;
+ }
+ };
+
+ History.prototype.revertToCheckpoint = function(checkpoint) {
+ if (__indexOf.call(this.undoStack, checkpoint) >= 0) {
+ while (last(this.undoStack) !== checkpoint) {
+ this.undo();
+ }
+ this.clearRedoStack();
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ History.prototype.groupChangesSinceCheckpoint = function(checkpoint) {
+ var groupedTransaction, index, patch, _i, _len, _ref;
+ groupedTransaction = new Transaction;
+ index = this.undoStack.indexOf(checkpoint) + 1;
+ if (index === 0) {
+ return false;
+ }
+ if (index === this.undoStack.length) {
+ return false;
+ }
+ _ref = this.undoStack.splice(index, this.undoStack.length - index);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ patch = _ref[_i];
+ if (!(patch instanceof Checkpoint)) {
+ groupedTransaction.merge(patch);
+ }
+ }
+ this.undoStack.push(groupedTransaction);
+ return true;
+ };
+
+ History.prototype.isTransacting = function() {
+ return this.currentTransaction != null;
+ };
+
+ History.prototype.clearUndoStack = function() {
+ return this.undoStack.length = 0;
+ };
+
+ History.prototype.clearRedoStack = function() {
+ return this.redoStack.length = 0;
+ };
+
+ return History;
+
+ })(Serializable);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/marker-manager.js b/node_modules/basarat-text-buffer/lib/marker-manager.js
new file mode 100644
index 000000000..878991d43
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/marker-manager.js
@@ -0,0 +1,244 @@
+(function() {
+ var Delegator, IntervalSkipList, Marker, MarkerManager, Point, Range, Serializable, clone, compact, defaults, intersection, keys, max, omit, size, values, _ref;
+
+ IntervalSkipList = require('interval-skip-list');
+
+ Serializable = require('serializable');
+
+ Delegator = require('delegato');
+
+ _ref = require('underscore-plus'), omit = _ref.omit, defaults = _ref.defaults, values = _ref.values, clone = _ref.clone, compact = _ref.compact, intersection = _ref.intersection, keys = _ref.keys, max = _ref.max, size = _ref.size;
+
+ Marker = require('./marker');
+
+ Point = require('./point');
+
+ Range = require('./range');
+
+ module.exports = MarkerManager = (function() {
+ Serializable.includeInto(MarkerManager);
+
+ Delegator.includeInto(MarkerManager);
+
+ MarkerManager.delegatesMethods('clipPosition', 'clipRange', {
+ toProperty: 'buffer'
+ });
+
+ MarkerManager.prototype.nextMarkerId = 1;
+
+ function MarkerManager(buffer, markers) {
+ this.buffer = buffer;
+ this.markers = markers;
+ if (this.intervals == null) {
+ this.intervals = this.buildIntervals();
+ }
+ if (this.markers != null) {
+ this.nextMarkerId = max(keys(this.markers).map(function(id) {
+ return parseInt(id);
+ })) + 1;
+ } else {
+ this.markers = {};
+ }
+ }
+
+ MarkerManager.prototype.buildIntervals = function() {
+ return new IntervalSkipList({
+ compare: function(a, b) {
+ return a.compare(b);
+ },
+ minIndex: new Point(-Infinity, -Infinity),
+ maxIndex: new Point(Infinity, Infinity)
+ });
+ };
+
+ MarkerManager.prototype.serializeParams = function() {
+ var id, marker, markers, _ref1;
+ markers = {};
+ _ref1 = this.markers;
+ for (id in _ref1) {
+ marker = _ref1[id];
+ if (marker.persistent) {
+ markers[id] = marker.serialize();
+ }
+ }
+ return {
+ markers: markers
+ };
+ };
+
+ MarkerManager.prototype.deserializeParams = function(state) {
+ var id, markerState, _ref1;
+ this.intervals = this.buildIntervals();
+ _ref1 = state.markers;
+ for (id in _ref1) {
+ markerState = _ref1[id];
+ state.markers[id] = Marker.deserialize(markerState, {
+ manager: this
+ });
+ }
+ return state;
+ };
+
+ MarkerManager.prototype.markRange = function(range, properties) {
+ var params;
+ range = this.clipRange(Range.fromObject(range, true)).freeze();
+ params = Marker.extractParams(properties);
+ params.range = range;
+ return this.createMarker(params);
+ };
+
+ MarkerManager.prototype.markPosition = function(position, properties) {
+ return this.markRange(new Range(position, position), defaults({
+ tailed: false
+ }, properties));
+ };
+
+ MarkerManager.prototype.getMarker = function(id) {
+ return this.markers[id];
+ };
+
+ MarkerManager.prototype.getMarkers = function() {
+ return values(this.markers);
+ };
+
+ MarkerManager.prototype.getMarkerCount = function() {
+ return size(this.markers);
+ };
+
+ MarkerManager.prototype.findMarkers = function(params) {
+ var candidateIds, candidates, endRow, key, markers, range, startRow, value;
+ params = clone(params);
+ candidateIds = [];
+ for (key in params) {
+ value = params[key];
+ switch (key) {
+ case 'startPosition':
+ candidateIds.push(this.intervals.findStartingAt(Point.fromObject(value)));
+ delete params[key];
+ break;
+ case 'endPosition':
+ candidateIds.push(this.intervals.findEndingAt(Point.fromObject(value)));
+ delete params[key];
+ break;
+ case 'containsPoint':
+ candidateIds.push(this.intervals.findContaining(Point.fromObject(value)));
+ delete params[key];
+ break;
+ case 'containsRange':
+ range = Range.fromObject(value);
+ candidateIds.push(this.intervals.findContaining(range.start, range.end));
+ delete params[key];
+ break;
+ case 'intersectsRange':
+ range = Range.fromObject(value);
+ candidateIds.push(this.intervals.findIntersecting(range.start, range.end));
+ delete params[key];
+ break;
+ case 'containedInRange':
+ range = Range.fromObject(value);
+ candidateIds.push(this.intervals.findContainedIn(range.start, range.end));
+ delete params[key];
+ break;
+ case 'startRow':
+ candidateIds.push(this.intervals.findStartingIn(new Point(value, 0), new Point(value, Infinity)));
+ delete params[key];
+ break;
+ case 'endRow':
+ candidateIds.push(this.intervals.findEndingIn(new Point(value, 0), new Point(value, Infinity)));
+ delete params[key];
+ break;
+ case 'intersectsRow':
+ candidateIds.push(this.intervals.findIntersecting(new Point(value, 0), new Point(value, Infinity)));
+ delete params[key];
+ break;
+ case 'intersectsRowRange':
+ startRow = value[0], endRow = value[1];
+ candidateIds.push(this.intervals.findIntersecting(new Point(startRow, 0), new Point(endRow, Infinity)));
+ delete params[key];
+ }
+ }
+ if (candidateIds.length > 0) {
+ candidates = compact(intersection.apply(null, candidateIds).map((function(_this) {
+ return function(id) {
+ return _this.getMarker(id);
+ };
+ })(this)));
+ } else {
+ candidates = this.getMarkers();
+ }
+ markers = candidates.filter(function(marker) {
+ return marker.matchesParams(params);
+ });
+ return markers.sort(function(a, b) {
+ return a.compare(b);
+ });
+ };
+
+ MarkerManager.prototype.createMarker = function(params) {
+ var marker;
+ params.manager = this;
+ params.id = this.nextMarkerId++;
+ marker = new Marker(params);
+ this.markers[marker.id] = marker;
+ this.buffer.markerCreated(marker);
+ return marker;
+ };
+
+ MarkerManager.prototype.removeMarker = function(id) {
+ return delete this.markers[id];
+ };
+
+ MarkerManager.prototype.recordMarkerPatch = function(patch) {
+ if (this.buffer.isTransacting()) {
+ return this.buffer.history.recordNewPatch(patch);
+ }
+ };
+
+ MarkerManager.prototype.handleBufferChange = function(patch) {
+ var id, marker, _ref1, _results;
+ _ref1 = this.markers;
+ _results = [];
+ for (id in _ref1) {
+ marker = _ref1[id];
+ _results.push(marker.handleBufferChange(patch));
+ }
+ return _results;
+ };
+
+ MarkerManager.prototype.applyPatches = function(markerPatches, textChanged) {
+ var id, patch, _ref1, _results;
+ _results = [];
+ for (id in markerPatches) {
+ patch = markerPatches[id];
+ _results.push((_ref1 = this.getMarker(id)) != null ? _ref1.applyPatch(patch, textChanged) : void 0);
+ }
+ return _results;
+ };
+
+ MarkerManager.prototype.pauseChangeEvents = function() {
+ var marker, _i, _len, _ref1, _results;
+ _ref1 = this.getMarkers();
+ _results = [];
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ marker = _ref1[_i];
+ _results.push(marker.pauseChangeEvents());
+ }
+ return _results;
+ };
+
+ MarkerManager.prototype.resumeChangeEvents = function() {
+ var marker, _i, _len, _ref1, _results;
+ _ref1 = this.getMarkers();
+ _results = [];
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ marker = _ref1[_i];
+ _results.push(marker.resumeChangeEvents());
+ }
+ return _results;
+ };
+
+ return MarkerManager;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/marker-patch.js b/node_modules/basarat-text-buffer/lib/marker-patch.js
new file mode 100644
index 000000000..c2c238fff
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/marker-patch.js
@@ -0,0 +1,57 @@
+(function() {
+ var MarkerPatch, Range, Serializable, clone,
+ __hasProp = {}.hasOwnProperty,
+ __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; };
+
+ clone = require('underscore-plus').clone;
+
+ Serializable = require('serializable');
+
+ Range = require('./range');
+
+ module.exports = MarkerPatch = (function(_super) {
+ __extends(MarkerPatch, _super);
+
+ function MarkerPatch(id, oldParams, newParams) {
+ this.id = id;
+ this.oldParams = oldParams;
+ this.newParams = newParams;
+ }
+
+ MarkerPatch.prototype.serializeParams = function() {
+ var newParams, oldParams;
+ oldParams = clone(this.oldParams);
+ if (this.oldParams.range != null) {
+ oldParams.range = this.oldParams.range.serialize();
+ }
+ newParams = clone(this.newParams);
+ if (this.newParams.range != null) {
+ newParams.range = this.newParams.range.serialize();
+ }
+ return {
+ id: this.id,
+ oldParams: oldParams,
+ newParams: newParams
+ };
+ };
+
+ MarkerPatch.prototype.deserializeParams = function(params) {
+ params.oldParams.range = Range.deserialize(params.oldParams.range);
+ params.newParams.range = Range.deserialize(params.newParams.range);
+ return params;
+ };
+
+ MarkerPatch.prototype.invert = function() {
+ return new this.constructor(this.id, this.newParams, this.oldParams);
+ };
+
+ MarkerPatch.prototype.applyTo = function(buffer) {
+ var _ref;
+ return (_ref = buffer.getMarker(this.id)) != null ? _ref.update(this.newParams) : void 0;
+ };
+
+ return MarkerPatch;
+
+ })(Serializable);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/marker.js b/node_modules/basarat-text-buffer/lib/marker.js
new file mode 100644
index 000000000..ecaa670b9
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/marker.js
@@ -0,0 +1,570 @@
+(function() {
+ var Delegator, Emitter, EmitterMixin, Grim, Marker, MarkerPatch, OptionKeys, Point, Range, Serializable, extend, isEqual, omit, pick, size, _ref,
+ __slice = [].slice;
+
+ _ref = require('underscore-plus'), extend = _ref.extend, isEqual = _ref.isEqual, omit = _ref.omit, pick = _ref.pick, size = _ref.size;
+
+ EmitterMixin = require('emissary').Emitter;
+
+ Emitter = require('event-kit').Emitter;
+
+ Grim = require('grim');
+
+ Delegator = require('delegato');
+
+ Serializable = require('serializable');
+
+ MarkerPatch = require('./marker-patch');
+
+ Point = require('./point');
+
+ Range = require('./range');
+
+ OptionKeys = ['reversed', 'tailed', 'invalidate', 'persistent'];
+
+ module.exports = Marker = (function() {
+ EmitterMixin.includeInto(Marker);
+
+ Delegator.includeInto(Marker);
+
+ Serializable.includeInto(Marker);
+
+ Marker.extractParams = function(inputParams) {
+ var outputParams, properties;
+ outputParams = {};
+ if (inputParams != null) {
+ this.handleDeprecatedParams(inputParams);
+ extend(outputParams, pick(inputParams, OptionKeys));
+ properties = omit(inputParams, OptionKeys);
+ if (size(properties) > 0) {
+ outputParams.properties = properties;
+ }
+ }
+ return outputParams;
+ };
+
+ Marker.handleDeprecatedParams = function(params) {
+ if (params.isReversed != null) {
+ Grim.deprecate("The option `isReversed` is deprecated, use `reversed` instead");
+ params.reversed = params.isReversed;
+ delete params.isReversed;
+ }
+ if (params.hasTail != null) {
+ Grim.deprecate("The option `hasTail` is deprecated, use `tailed` instead");
+ params.tailed = params.hasTail;
+ delete params.hasTail;
+ }
+ if (params.persist != null) {
+ Grim.deprecate("The option `persist` is deprecated, use `persistent` instead");
+ params.persistent = params.persist;
+ delete params.persist;
+ }
+ if (params.invalidation) {
+ Grim.deprecate("The option `invalidation` is deprecated, use `invalidate` instead");
+ params.invalidate = params.invalidation;
+ return delete params.invalidation;
+ }
+ };
+
+ Marker.delegatesMethods('containsPoint', 'containsRange', 'intersectsRow', {
+ toProperty: 'range'
+ });
+
+ Marker.delegatesMethods('clipPosition', 'clipRange', {
+ toProperty: 'manager'
+ });
+
+ Marker.prototype.deferredChangeEvents = null;
+
+ function Marker(params) {
+ this.manager = params.manager, this.id = params.id, this.range = params.range, this.tailed = params.tailed, this.reversed = params.reversed;
+ this.valid = params.valid, this.invalidate = params.invalidate, this.persistent = params.persistent, this.properties = params.properties;
+ this.emitter = new Emitter;
+ if (this.tailed == null) {
+ this.tailed = true;
+ }
+ if (this.reversed == null) {
+ this.reversed = false;
+ }
+ if (this.valid == null) {
+ this.valid = true;
+ }
+ if (this.invalidate == null) {
+ this.invalidate = 'overlap';
+ }
+ if (this.persistent == null) {
+ this.persistent = true;
+ }
+ if (this.properties == null) {
+ this.properties = {};
+ }
+ this.destroyed = false;
+ Object.freeze(this.properties);
+ this.updateIntervals();
+ }
+
+ Marker.prototype.serializeParams = function() {
+ var range;
+ range = this.range.serialize();
+ return {
+ id: this.id,
+ range: range,
+ tailed: this.tailed,
+ reversed: this.reversed,
+ valid: this.valid,
+ invalidate: this.invalidate,
+ persistent: this.persistent,
+ properties: this.properties
+ };
+ };
+
+ Marker.prototype.deserializeParams = function(state) {
+ state.range = Range.deserialize(state.range);
+ return state;
+ };
+
+ Marker.prototype.onDidDestroy = function(callback) {
+ return this.emitter.on('did-destroy', callback);
+ };
+
+ Marker.prototype.onDidChange = function(callback) {
+ return this.emitter.on('did-change', callback);
+ };
+
+ Marker.prototype.on = function(eventName) {
+ switch (eventName) {
+ case 'changed':
+ Grim.deprecate("Use Marker::onDidChange instead");
+ break;
+ case 'destroyed':
+ Grim.deprecate("Use Marker::onDidDestroy instead");
+ break;
+ default:
+ Grim.deprecate("Marker::on is deprecated. Use event subscription methods instead.");
+ }
+ return EmitterMixin.prototype.on.apply(this, arguments);
+ };
+
+ Marker.prototype.getRange = function() {
+ return this.range;
+ };
+
+ Marker.prototype.setRange = function(range, properties) {
+ var params;
+ params = this.extractParams(properties);
+ params.tailed = true;
+ params.range = this.clipRange(Range.fromObject(range, true));
+ return this.update(params);
+ };
+
+ Marker.prototype.getHeadPosition = function() {
+ if (this.reversed) {
+ return this.range.start;
+ } else {
+ return this.range.end;
+ }
+ };
+
+ Marker.prototype.setHeadPosition = function(position, properties) {
+ var params;
+ position = this.clipPosition(Point.fromObject(position, true));
+ params = this.extractParams(properties);
+ if (this.hasTail()) {
+ if (this.isReversed()) {
+ if (position.isLessThan(this.range.end)) {
+ params.range = new Range(position, this.range.end);
+ } else {
+ params.reversed = false;
+ params.range = new Range(this.range.end, position);
+ }
+ } else {
+ if (position.isLessThan(this.range.start)) {
+ params.reversed = true;
+ params.range = new Range(position, this.range.start);
+ } else {
+ params.range = new Range(this.range.start, position);
+ }
+ }
+ } else {
+ params.range = new Range(position, position);
+ }
+ return this.update(params);
+ };
+
+ Marker.prototype.getTailPosition = function() {
+ if (this.hasTail()) {
+ if (this.reversed) {
+ return this.range.end;
+ } else {
+ return this.range.start;
+ }
+ } else {
+ return this.getHeadPosition();
+ }
+ };
+
+ Marker.prototype.setTailPosition = function(position, properties) {
+ var params;
+ position = this.clipPosition(Point.fromObject(position, true));
+ params = this.extractParams(properties);
+ params.tailed = true;
+ if (this.reversed) {
+ if (position.isLessThan(this.range.start)) {
+ params.reversed = false;
+ params.range = new Range(position, this.range.start);
+ } else {
+ params.range = new Range(this.range.start, position);
+ }
+ } else {
+ if (position.isLessThan(this.range.end)) {
+ params.range = new Range(position, this.range.end);
+ } else {
+ params.reversed = true;
+ params.range = new Range(this.range.end, position);
+ }
+ }
+ return this.update(params);
+ };
+
+ Marker.prototype.getStartPosition = function() {
+ if (this.reversed) {
+ return this.getHeadPosition();
+ } else {
+ return this.getTailPosition();
+ }
+ };
+
+ Marker.prototype.getEndPosition = function() {
+ if (this.reversed) {
+ return this.getTailPosition();
+ } else {
+ return this.getHeadPosition();
+ }
+ };
+
+ Marker.prototype.clearTail = function(properties) {
+ var headPosition, params;
+ params = this.extractParams(properties);
+ params.tailed = false;
+ headPosition = this.getHeadPosition();
+ params.range = new Range(headPosition, headPosition);
+ return this.update(params);
+ };
+
+ Marker.prototype.plantTail = function(properties) {
+ var params;
+ params = this.extractParams(properties);
+ if (!this.hasTail()) {
+ params.tailed = true;
+ params.range = new Range(this.getHeadPosition(), this.getHeadPosition());
+ }
+ return this.update(params);
+ };
+
+ Marker.prototype.isReversed = function() {
+ return this.tailed && this.reversed;
+ };
+
+ Marker.prototype.hasTail = function() {
+ return this.tailed;
+ };
+
+ Marker.prototype.isValid = function() {
+ return !this.isDestroyed() && this.valid;
+ };
+
+ Marker.prototype.isDestroyed = function() {
+ return this.destroyed;
+ };
+
+ Marker.prototype.isEqual = function(other) {
+ return isEqual(this.toParams(true), other.toParams(true));
+ };
+
+ Marker.prototype.getInvalidationStrategy = function() {
+ return this.invalidate;
+ };
+
+ Marker.prototype.getAttributes = function() {
+ Grim.deprecate("Use Marker::getProperties instead.");
+ return this.getProperties();
+ };
+
+ Marker.prototype.setAttributes = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ Grim.deprecate("Use Marker::setProperties instead.");
+ return this.setProperties.apply(this, args);
+ };
+
+ Marker.prototype.getProperties = function() {
+ return this.properties;
+ };
+
+ Marker.prototype.setProperties = function(properties) {
+ return this.update({
+ properties: extend({}, this.getProperties(), properties)
+ });
+ };
+
+ Marker.prototype.copy = function(params) {
+ return this.manager.createMarker(extend(this.toParams(), this.extractParams(params)));
+ };
+
+ Marker.prototype.destroy = function() {
+ this.destroyed = true;
+ this.manager.removeMarker(this.id);
+ this.manager.intervals.remove(this.id);
+ this.emitter.emit('did-destroy');
+ return this.emit('destroyed');
+ };
+
+ Marker.prototype.extractParams = function(params) {
+ params = this.constructor.extractParams(params);
+ if (params.properties != null) {
+ params.properties = extend({}, this.properties, params.properties);
+ }
+ return params;
+ };
+
+ Marker.prototype.compare = function(other) {
+ return this.range.compare(other.range);
+ };
+
+ Marker.prototype.matchesAttributes = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return this.matchesParams.apply(this, args);
+ };
+
+ Marker.prototype.matchesParams = function(params) {
+ var key, value;
+ for (key in params) {
+ value = params[key];
+ if (!this.matchesParam(key, value)) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ Marker.prototype.matchesParam = function(key, value) {
+ switch (key) {
+ case 'startPosition':
+ return this.getStartPosition().isEqual(value);
+ case 'endPosition':
+ return this.getEndPosition().isEqual(value);
+ case 'containsPoint':
+ case 'containsPosition':
+ return this.containsPoint(value);
+ case 'containsRange':
+ return this.containsRange(value);
+ case 'startRow':
+ return this.getStartPosition().row === value;
+ case 'endRow':
+ return this.getEndPosition().row === value;
+ case 'intersectsRow':
+ return this.intersectsRow(value);
+ case 'invalidate':
+ case 'reversed':
+ case 'tailed':
+ case 'persistent':
+ return isEqual(this[key], value);
+ default:
+ return isEqual(this.properties[key], value);
+ }
+ };
+
+ Marker.prototype.toParams = function(omitId) {
+ var params;
+ params = {
+ range: this.range,
+ reversed: this.reversed,
+ tailed: this.tailed,
+ invalidate: this.invalidate,
+ persistent: this.persistent,
+ properties: this.properties
+ };
+ if (!omitId) {
+ params.id = this.id;
+ }
+ return params;
+ };
+
+ Marker.prototype.update = function(params) {
+ var patch;
+ if (patch = this.buildPatch(params)) {
+ this.manager.recordMarkerPatch(patch);
+ this.applyPatch(patch);
+ return true;
+ } else {
+ return false;
+ }
+ };
+
+ Marker.prototype.handleBufferChange = function(patch) {
+ var changePrecedesMarkerEnd, changePrecedesMarkerStart, changeSurroundsMarkerEnd, changeSurroundsMarkerStart, columnDelta, exclusive, markerEnd, markerPatch, markerStart, newMarkerRange, newRange, oldRange, rowDelta, valid;
+ oldRange = patch.oldRange, newRange = patch.newRange;
+ rowDelta = newRange.end.row - oldRange.end.row;
+ columnDelta = newRange.end.column - oldRange.end.column;
+ markerStart = this.range.start;
+ markerEnd = this.range.end;
+ if (markerEnd.isLessThan(oldRange.start)) {
+ return;
+ }
+ switch (this.getInvalidationStrategy()) {
+ case 'never':
+ valid = true;
+ break;
+ case 'surround':
+ valid = markerStart.isLessThan(oldRange.start) || oldRange.end.isLessThanOrEqual(markerEnd);
+ break;
+ case 'overlap':
+ valid = !oldRange.containsPoint(markerStart, true) && !oldRange.containsPoint(markerEnd, true);
+ break;
+ case 'inside':
+ if (this.hasTail()) {
+ valid = oldRange.end.isLessThanOrEqual(markerStart) || markerEnd.isLessThanOrEqual(oldRange.start);
+ } else {
+ valid = this.valid;
+ }
+ break;
+ case 'touch':
+ valid = oldRange.end.isLessThan(markerStart) || markerEnd.isLessThan(oldRange.start);
+ }
+ newMarkerRange = this.range.copy();
+ exclusive = !this.hasTail() || this.getInvalidationStrategy() === 'inside';
+ changePrecedesMarkerStart = oldRange.end.isLessThan(markerStart) || (exclusive && oldRange.end.isLessThanOrEqual(markerStart));
+ changeSurroundsMarkerStart = !changePrecedesMarkerStart && oldRange.start.isLessThan(markerStart);
+ changePrecedesMarkerEnd = changePrecedesMarkerStart || oldRange.end.isLessThan(markerEnd) || (!exclusive && oldRange.end.isLessThanOrEqual(markerEnd));
+ changeSurroundsMarkerEnd = !changePrecedesMarkerEnd && oldRange.start.isLessThan(markerEnd);
+ if (changePrecedesMarkerStart) {
+ newMarkerRange.start.row += rowDelta;
+ if (oldRange.end.row === markerStart.row) {
+ newMarkerRange.start.column += columnDelta;
+ }
+ } else if (changeSurroundsMarkerStart) {
+ newMarkerRange.start = newRange.end;
+ }
+ if (changePrecedesMarkerEnd) {
+ newMarkerRange.end.row += rowDelta;
+ if (oldRange.end.row === markerEnd.row) {
+ newMarkerRange.end.column += columnDelta;
+ }
+ } else if (changeSurroundsMarkerEnd) {
+ newMarkerRange.end = newRange.end;
+ }
+ if (markerPatch = this.buildPatch({
+ valid: valid,
+ range: newMarkerRange
+ })) {
+ return patch.addMarkerPatch(markerPatch);
+ }
+ };
+
+ Marker.prototype.buildPatch = function(newParams) {
+ var name, oldParams, value;
+ oldParams = {};
+ for (name in newParams) {
+ value = newParams[name];
+ if (isEqual(this[name], value)) {
+ delete newParams[name];
+ } else {
+ oldParams[name] = this[name];
+ }
+ }
+ if (size(newParams)) {
+ return new MarkerPatch(this.id, oldParams, newParams);
+ }
+ };
+
+ Marker.prototype.applyPatch = function(patch, textChanged) {
+ var event, hadTail, hasTail, isValid, newHeadPosition, newProperties, newTailPosition, oldHeadPosition, oldProperties, oldTailPosition, properties, range, reversed, tailed, updated, valid, wasValid, _ref1;
+ if (textChanged == null) {
+ textChanged = false;
+ }
+ oldHeadPosition = this.getHeadPosition();
+ oldTailPosition = this.getTailPosition();
+ wasValid = this.isValid();
+ hadTail = this.hasTail();
+ oldProperties = this.getProperties();
+ updated = false;
+ _ref1 = patch.newParams, range = _ref1.range, reversed = _ref1.reversed, tailed = _ref1.tailed, valid = _ref1.valid, properties = _ref1.properties;
+ if ((range != null) && !range.isEqual(this.range)) {
+ this.range = range.freeze();
+ this.updateIntervals();
+ updated = true;
+ }
+ if ((reversed != null) && reversed !== this.reversed) {
+ this.reversed = reversed;
+ updated = true;
+ }
+ if ((tailed != null) && tailed !== this.tailed) {
+ this.tailed = tailed;
+ updated = true;
+ }
+ if ((valid != null) && valid !== this.valid) {
+ this.valid = valid;
+ updated = true;
+ }
+ if ((properties != null) && !isEqual(properties, this.properties)) {
+ this.properties = Object.freeze(properties);
+ updated = true;
+ }
+ if (!updated) {
+ return false;
+ }
+ newHeadPosition = this.getHeadPosition();
+ newTailPosition = this.getTailPosition();
+ isValid = this.isValid();
+ hasTail = this.hasTail();
+ newProperties = this.getProperties();
+ event = {
+ oldHeadPosition: oldHeadPosition,
+ newHeadPosition: newHeadPosition,
+ oldTailPosition: oldTailPosition,
+ newTailPosition: newTailPosition,
+ wasValid: wasValid,
+ isValid: isValid,
+ hadTail: hadTail,
+ hasTail: hasTail,
+ oldProperties: oldProperties,
+ newProperties: newProperties,
+ textChanged: textChanged
+ };
+ if (this.deferredChangeEvents != null) {
+ this.deferredChangeEvents.push(event);
+ } else {
+ this.emitter.emit('did-change', event);
+ this.emit('changed', event);
+ }
+ return true;
+ };
+
+ Marker.prototype.updateIntervals = function() {
+ return this.manager.intervals.update(this.id, this.range.start, this.range.end);
+ };
+
+ Marker.prototype.pauseChangeEvents = function() {
+ return this.deferredChangeEvents = [];
+ };
+
+ Marker.prototype.resumeChangeEvents = function() {
+ var deferredChangeEvents, event, _i, _len, _results;
+ if (deferredChangeEvents = this.deferredChangeEvents) {
+ this.deferredChangeEvents = null;
+ _results = [];
+ for (_i = 0, _len = deferredChangeEvents.length; _i < _len; _i++) {
+ event = deferredChangeEvents[_i];
+ this.emitter.emit('did-change', event);
+ _results.push(this.emit('changed', event));
+ }
+ return _results;
+ }
+ };
+
+ return Marker;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/point.js b/node_modules/basarat-text-buffer/lib/point.js
new file mode 100644
index 000000000..a9b64af64
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/point.js
@@ -0,0 +1,170 @@
+(function() {
+ var Point, deprecate;
+
+ deprecate = require('grim').deprecate;
+
+ module.exports = Point = (function() {
+
+ /*
+ Section: Construction
+ */
+ Point.fromObject = function(object, copy) {
+ var column, row;
+ if (object instanceof Point) {
+ if (copy) {
+ return object.copy();
+ } else {
+ return object;
+ }
+ } else {
+ if (Array.isArray(object)) {
+ row = object[0], column = object[1];
+ } else {
+ row = object.row, column = object.column;
+ }
+ return new Point(row, column);
+ }
+ };
+
+
+ /*
+ Section: Comparison
+ */
+
+ Point.min = function(point1, point2) {
+ point1 = this.fromObject(point1);
+ point2 = this.fromObject(point2);
+ if (point1.isLessThanOrEqual(point2)) {
+ return point1;
+ } else {
+ return point2;
+ }
+ };
+
+
+ /*
+ Section: Construction
+ */
+
+ function Point(row, column) {
+ this.row = row != null ? row : 0;
+ this.column = column != null ? column : 0;
+ }
+
+ Point.prototype.copy = function() {
+ return new Point(this.row, this.column);
+ };
+
+ Point.prototype.negate = function() {
+ return new Point(-this.row, -this.column);
+ };
+
+
+ /*
+ Section: Operations
+ */
+
+ Point.prototype.freeze = function() {
+ return Object.freeze(this);
+ };
+
+ Point.prototype.translate = function(other) {
+ var column, row, _ref;
+ _ref = Point.fromObject(other), row = _ref.row, column = _ref.column;
+ return new Point(this.row + row, this.column + column);
+ };
+
+ Point.prototype.traverse = function(other) {
+ var column, row;
+ other = Point.fromObject(other);
+ row = this.row + other.row;
+ if (other.row === 0) {
+ column = this.column + other.column;
+ } else {
+ column = other.column;
+ }
+ return new Point(row, column);
+ };
+
+ Point.prototype.add = function(other) {
+ deprecate("Use Point::traverse instead");
+ return this.traverse(other);
+ };
+
+ Point.prototype.splitAt = function(column) {
+ var rightColumn;
+ if (this.row === 0) {
+ rightColumn = this.column - column;
+ } else {
+ rightColumn = this.column;
+ }
+ return [new Point(0, column), new Point(this.row, rightColumn)];
+ };
+
+
+ /*
+ Section: Comparison
+ */
+
+ Point.prototype.compare = function(other) {
+ if (this.row > other.row) {
+ return 1;
+ } else if (this.row < other.row) {
+ return -1;
+ } else {
+ if (this.column > other.column) {
+ return 1;
+ } else if (this.column < other.column) {
+ return -1;
+ } else {
+ return 0;
+ }
+ }
+ };
+
+ Point.prototype.isEqual = function(other) {
+ if (!other) {
+ return false;
+ }
+ other = Point.fromObject(other);
+ return this.row === other.row && this.column === other.column;
+ };
+
+ Point.prototype.isLessThan = function(other) {
+ return this.compare(other) < 0;
+ };
+
+ Point.prototype.isLessThanOrEqual = function(other) {
+ return this.compare(other) <= 0;
+ };
+
+ Point.prototype.isGreaterThan = function(other) {
+ return this.compare(other) > 0;
+ };
+
+ Point.prototype.isGreaterThanOrEqual = function(other) {
+ return this.compare(other) >= 0;
+ };
+
+
+ /*
+ Section: Conversion
+ */
+
+ Point.prototype.toArray = function() {
+ return [this.row, this.column];
+ };
+
+ Point.prototype.serialize = function() {
+ return this.toArray();
+ };
+
+ Point.prototype.toString = function() {
+ return "(" + this.row + ", " + this.column + ")";
+ };
+
+ return Point;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/range.js b/node_modules/basarat-text-buffer/lib/range.js
new file mode 100644
index 000000000..7c36cfcc3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/range.js
@@ -0,0 +1,261 @@
+(function() {
+ var Grim, Point, Range, newlineRegex,
+ __slice = [].slice;
+
+ Grim = require('grim');
+
+ Point = require('./point');
+
+ newlineRegex = require('./helpers').newlineRegex;
+
+ module.exports = Range = (function() {
+
+ /*
+ Section: Construction
+ */
+ Range.fromObject = function(object, copy) {
+ if (Array.isArray(object)) {
+ return new this(object[0], object[1]);
+ } else if (object instanceof this) {
+ if (copy) {
+ return object.copy();
+ } else {
+ return object;
+ }
+ } else {
+ return new this(object.start, object.end);
+ }
+ };
+
+ Range.fromText = function() {
+ var args, endPoint, lastIndex, lines, startPoint, text;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (args.length > 1) {
+ startPoint = Point.fromObject(args.shift());
+ } else {
+ startPoint = new Point(0, 0);
+ }
+ text = args.shift();
+ endPoint = startPoint.copy();
+ lines = text.split(newlineRegex);
+ if (lines.length > 1) {
+ lastIndex = lines.length - 1;
+ endPoint.row += lastIndex;
+ endPoint.column = lines[lastIndex].length;
+ } else {
+ endPoint.column += lines[0].length;
+ }
+ return new this(startPoint, endPoint);
+ };
+
+ Range.fromPointWithDelta = function(startPoint, rowDelta, columnDelta) {
+ var endPoint;
+ startPoint = Point.fromObject(startPoint);
+ endPoint = new Point(startPoint.row + rowDelta, startPoint.column + columnDelta);
+ return new this(startPoint, endPoint);
+ };
+
+
+ /*
+ Section: Serialization and Deserialization
+ */
+
+ Range.deserialize = function(array) {
+ if (Array.isArray(array)) {
+ return new this(array[0], array[1]);
+ } else {
+ return new this();
+ }
+ };
+
+
+ /*
+ Section: Construction
+ */
+
+ function Range(pointA, pointB) {
+ if (pointA == null) {
+ pointA = new Point(0, 0);
+ }
+ if (pointB == null) {
+ pointB = new Point(0, 0);
+ }
+ pointA = Point.fromObject(pointA);
+ pointB = Point.fromObject(pointB);
+ if (pointA.isLessThanOrEqual(pointB)) {
+ this.start = pointA;
+ this.end = pointB;
+ } else {
+ this.start = pointB;
+ this.end = pointA;
+ }
+ }
+
+ Range.prototype.copy = function() {
+ return new this.constructor(this.start.copy(), this.end.copy());
+ };
+
+ Range.prototype.negate = function() {
+ return new this.constructor(this.start.negate(), this.end.negate());
+ };
+
+
+ /*
+ Section: Serialization and Deserialization
+ */
+
+ Range.prototype.serialize = function() {
+ return [this.start.serialize(), this.end.serialize()];
+ };
+
+
+ /*
+ Section: Range Details
+ */
+
+ Range.prototype.isEmpty = function() {
+ return this.start.isEqual(this.end);
+ };
+
+ Range.prototype.isSingleLine = function() {
+ return this.start.row === this.end.row;
+ };
+
+ Range.prototype.getRowCount = function() {
+ return this.end.row - this.start.row + 1;
+ };
+
+ Range.prototype.getRows = function() {
+ var _i, _ref, _ref1, _results;
+ return (function() {
+ _results = [];
+ for (var _i = _ref = this.start.row, _ref1 = this.end.row; _ref <= _ref1 ? _i <= _ref1 : _i >= _ref1; _ref <= _ref1 ? _i++ : _i--){ _results.push(_i); }
+ return _results;
+ }).apply(this);
+ };
+
+
+ /*
+ Section: Operations
+ */
+
+ Range.prototype.freeze = function() {
+ this.start.freeze();
+ this.end.freeze();
+ return Object.freeze(this);
+ };
+
+ Range.prototype.union = function(otherRange) {
+ var end, start;
+ start = this.start.isLessThan(otherRange.start) ? this.start : otherRange.start;
+ end = this.end.isGreaterThan(otherRange.end) ? this.end : otherRange.end;
+ return new this.constructor(start, end);
+ };
+
+ Range.prototype.translate = function(startDelta, endDelta) {
+ if (endDelta == null) {
+ endDelta = startDelta;
+ }
+ return new this.constructor(this.start.translate(startDelta), this.end.translate(endDelta));
+ };
+
+ Range.prototype.traverse = function(delta) {
+ return new this.constructor(this.start.traverse(delta), this.end.traverse(delta));
+ };
+
+ Range.prototype.add = function(delta) {
+ Grim.deprecate("Use Range::traverse instead");
+ return this.traverse(delta);
+ };
+
+
+ /*
+ Section: Comparison
+ */
+
+ Range.prototype.compare = function(other) {
+ var value;
+ other = this.constructor.fromObject(other);
+ if (value = this.start.compare(other.start)) {
+ return value;
+ } else {
+ return other.end.compare(this.end);
+ }
+ };
+
+ Range.prototype.isEqual = function(other) {
+ if (other == null) {
+ return false;
+ }
+ other = this.constructor.fromObject(other);
+ return other.start.isEqual(this.start) && other.end.isEqual(this.end);
+ };
+
+ Range.prototype.coversSameRows = function(other) {
+ return this.start.row === other.start.row && this.end.row === other.end.row;
+ };
+
+ Range.prototype.intersectsWith = function(otherRange, exclusive) {
+ if (exclusive) {
+ return !(this.end.isLessThanOrEqual(otherRange.start) || this.start.isGreaterThanOrEqual(otherRange.end));
+ } else {
+ return !(this.end.isLessThan(otherRange.start) || this.start.isGreaterThan(otherRange.end));
+ }
+ };
+
+ Range.prototype.containsRange = function(otherRange, exclusive) {
+ var end, start, _ref;
+ _ref = this.constructor.fromObject(otherRange), start = _ref.start, end = _ref.end;
+ return this.containsPoint(start, exclusive) && this.containsPoint(end, exclusive);
+ };
+
+ Range.prototype.containsPoint = function(point, exclusive) {
+ if ((exclusive != null) && typeof exclusive === 'object') {
+ Grim.deprecate("The second param is no longer an object, it's a boolean argument named `exclusive`.");
+ exclusive = exclusive.exclusive;
+ }
+ point = Point.fromObject(point);
+ if (exclusive) {
+ return point.isGreaterThan(this.start) && point.isLessThan(this.end);
+ } else {
+ return point.isGreaterThanOrEqual(this.start) && point.isLessThanOrEqual(this.end);
+ }
+ };
+
+ Range.prototype.intersectsRow = function(row) {
+ return (this.start.row <= row && row <= this.end.row);
+ };
+
+ Range.prototype.intersectsRowRange = function(startRow, endRow) {
+ var _ref;
+ if (startRow > endRow) {
+ _ref = [endRow, startRow], startRow = _ref[0], endRow = _ref[1];
+ }
+ return this.end.row >= startRow && endRow >= this.start.row;
+ };
+
+
+ /*
+ Section: Conversion
+ */
+
+ Range.prototype.toDelta = function() {
+ var columns, rows;
+ rows = this.end.row - this.start.row;
+ if (rows === 0) {
+ columns = this.end.column - this.start.column;
+ } else {
+ columns = this.end.column;
+ }
+ return new Point(rows, columns);
+ };
+
+ Range.prototype.toString = function() {
+ return "[" + this.start + " - " + this.end + "]";
+ };
+
+ return Range;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/text-buffer.js b/node_modules/basarat-text-buffer/lib/text-buffer.js
new file mode 100644
index 000000000..c25691be5
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/text-buffer.js
@@ -0,0 +1,1210 @@
+(function() {
+ var BufferPatch, CompositeDisposable, Delegator, Emitter, EmitterMixin, Grim, History, MarkerManager, Point, Q, Range, Serializable, SpanSkipList, Subscriber, TextBuffer, diff, newlineRegex, spliceArray, _, _ref, _ref1;
+
+ _ = require('underscore-plus');
+
+ Delegator = require('delegato');
+
+ Grim = require('grim');
+
+ Serializable = require('serializable');
+
+ Subscriber = require('emissary').Subscriber;
+
+ EmitterMixin = require('emissary').Emitter;
+
+ _ref = require('event-kit'), Emitter = _ref.Emitter, CompositeDisposable = _ref.CompositeDisposable;
+
+ SpanSkipList = require('span-skip-list');
+
+ diff = require('atom-diff');
+
+ Q = require('q');
+
+ Point = require('./point');
+
+ Range = require('./range');
+
+ History = require('./history');
+
+ MarkerManager = require('./marker-manager');
+
+ BufferPatch = require('./buffer-patch');
+
+ _ref1 = require('./helpers'), spliceArray = _ref1.spliceArray, newlineRegex = _ref1.newlineRegex;
+
+ module.exports = TextBuffer = (function() {
+ TextBuffer.Point = Point;
+
+ TextBuffer.Range = Range;
+
+ TextBuffer.newlineRegex = newlineRegex;
+
+ Delegator.includeInto(TextBuffer);
+
+ EmitterMixin.includeInto(TextBuffer);
+
+ Serializable.includeInto(TextBuffer);
+
+ Subscriber.includeInto(TextBuffer);
+
+ TextBuffer.prototype.cachedText = null;
+
+ TextBuffer.prototype.encoding = null;
+
+ TextBuffer.prototype.stoppedChangingDelay = 300;
+
+ TextBuffer.prototype.stoppedChangingTimeout = null;
+
+ TextBuffer.prototype.cachedDiskContents = null;
+
+ TextBuffer.prototype.conflict = false;
+
+ TextBuffer.prototype.file = null;
+
+ TextBuffer.prototype.refcount = 0;
+
+ TextBuffer.prototype.fileSubscriptions = null;
+
+ TextBuffer.delegatesMethods('undo', 'redo', 'transact', 'beginTransaction', 'commitTransaction', 'abortTransaction', 'isTransacting', 'clearUndoStack', {
+ toProperty: 'history'
+ });
+
+
+ /*
+ Section: Construction
+ */
+
+ function TextBuffer(params) {
+ var text, _ref2, _ref3, _ref4, _ref5, _ref6;
+ if (typeof params === 'string') {
+ text = params;
+ }
+ this.emitter = new Emitter;
+ this.lines = [''];
+ this.lineEndings = [''];
+ this.offsetIndex = new SpanSkipList('rows', 'characters');
+ this.setTextInRange([[0, 0], [0, 0]], (_ref2 = text != null ? text : params != null ? params.text : void 0) != null ? _ref2 : '', {
+ normalizeLineEndings: false
+ });
+ this.history = (_ref3 = params != null ? params.history : void 0) != null ? _ref3 : new History(this);
+ this.markers = (_ref4 = params != null ? params.markers : void 0) != null ? _ref4 : new MarkerManager(this);
+ this.setEncoding(params != null ? params.encoding : void 0);
+ this.loaded = false;
+ this.digestWhenLastPersisted = (_ref5 = params != null ? params.digestWhenLastPersisted : void 0) != null ? _ref5 : false;
+ this.modifiedWhenLastPersisted = (_ref6 = params != null ? params.modifiedWhenLastPersisted : void 0) != null ? _ref6 : false;
+ this.useSerializedText = this.modifiedWhenLastPersisted !== false;
+ if (params != null ? params.filePath : void 0) {
+ this.setPath(params.filePath);
+ }
+ if (params != null ? params.load : void 0) {
+ this.load();
+ }
+ }
+
+ TextBuffer.prototype.deserializeParams = function(params) {
+ params.markers = MarkerManager.deserialize(params.markers, {
+ buffer: this
+ });
+ params.history = History.deserialize(params.history, {
+ buffer: this
+ });
+ params.load = true;
+ return params;
+ };
+
+ TextBuffer.prototype.serializeParams = function() {
+ var _ref2;
+ return {
+ text: this.getText(),
+ markers: this.markers.serialize(),
+ history: this.history.serialize(),
+ encoding: this.getEncoding(),
+ filePath: this.getPath(),
+ modifiedWhenLastPersisted: this.isModified(),
+ digestWhenLastPersisted: (_ref2 = this.file) != null ? _ref2.getDigest() : void 0
+ };
+ };
+
+
+ /*
+ Section: Event Subscription
+ */
+
+ TextBuffer.prototype.onDidChange = function(callback) {
+ return this.emitter.on('did-change', callback);
+ };
+
+ TextBuffer.prototype.preemptDidChange = function(callback) {
+ return this.emitter.preempt('did-change', callback);
+ };
+
+ TextBuffer.prototype.onDidStopChanging = function(callback) {
+ return this.emitter.on('did-stop-changing', callback);
+ };
+
+ TextBuffer.prototype.onDidConflict = function(callback) {
+ return this.emitter.on('did-conflict', callback);
+ };
+
+ TextBuffer.prototype.onDidChangeModified = function(callback) {
+ return this.emitter.on('did-change-modified', callback);
+ };
+
+ TextBuffer.prototype.onDidUpdateMarkers = function(callback) {
+ return this.emitter.on('did-update-markers', callback);
+ };
+
+ TextBuffer.prototype.onDidCreateMarker = function(callback) {
+ return this.emitter.on('did-create-marker', callback);
+ };
+
+ TextBuffer.prototype.onDidChangePath = function(callback) {
+ return this.emitter.on('did-change-path', callback);
+ };
+
+ TextBuffer.prototype.onDidChangeEncoding = function(callback) {
+ return this.emitter.on('did-change-encoding', callback);
+ };
+
+ TextBuffer.prototype.onWillSave = function(callback) {
+ return this.emitter.on('will-save', callback);
+ };
+
+ TextBuffer.prototype.onDidSave = function(callback) {
+ return this.emitter.on('did-save', callback);
+ };
+
+ TextBuffer.prototype.onWillReload = function(callback) {
+ return this.emitter.on('will-reload', callback);
+ };
+
+ TextBuffer.prototype.onDidReload = function(callback) {
+ return this.emitter.on('did-reload', callback);
+ };
+
+ TextBuffer.prototype.onDidDestroy = function(callback) {
+ return this.emitter.on('did-destroy', callback);
+ };
+
+ TextBuffer.prototype.onWillThrowWatchError = function(callback) {
+ return this.emitter.on('will-throw-watch-error', callback);
+ };
+
+ TextBuffer.prototype.getStoppedChangingDelay = function() {
+ return this.stoppedChangingDelay;
+ };
+
+ TextBuffer.prototype.on = function(eventName) {
+ switch (eventName) {
+ case 'changed':
+ Grim.deprecate("Use TextBuffer::onDidChange instead");
+ break;
+ case 'contents-modified':
+ Grim.deprecate("Use TextBuffer::onDidStopChanging instead. If you need the modified status, call TextBuffer::isModified yourself in your callback.");
+ break;
+ case 'contents-conflicted':
+ Grim.deprecate("Use TextBuffer::onDidConflict instead");
+ break;
+ case 'modified-status-changed':
+ Grim.deprecate("Use TextBuffer::onDidChangeModified instead");
+ break;
+ case 'markers-updated':
+ Grim.deprecate("Use TextBuffer::onDidUpdateMarkers instead");
+ break;
+ case 'marker-created':
+ Grim.deprecate("Use TextBuffer::onDidCreateMarker instead");
+ break;
+ case 'path-changed':
+ Grim.deprecate("Use TextBuffer::onDidChangePath instead. The path is now provided as a callback argument rather than a TextBuffer instance.");
+ break;
+ case 'will-be-saved':
+ Grim.deprecate("Use TextBuffer::onWillSave instead. A TextBuffer instance is no longer provided as a callback argument.");
+ break;
+ case 'saved':
+ Grim.deprecate("Use TextBuffer::onDidSave instead. A TextBuffer instance is no longer provided as a callback argument.");
+ break;
+ case 'will-reload':
+ Grim.deprecate("Use TextBuffer::onWillReload instead.");
+ break;
+ case 'reloaded':
+ Grim.deprecate("Use TextBuffer::onDidReload instead.");
+ break;
+ case 'destroyed':
+ Grim.deprecate("Use TextBuffer::onDidDestroy instead");
+ break;
+ default:
+ Grim.deprecate("TextBuffer::on is deprecated. Use event subscription methods instead.");
+ }
+ return EmitterMixin.prototype.on.apply(this, arguments);
+ };
+
+
+ /*
+ Section: File Details
+ */
+
+ TextBuffer.prototype.isModified = function() {
+ var _ref2;
+ if (!this.loaded) {
+ return false;
+ }
+ if (this.file) {
+ if (this.file.existsSync()) {
+ return this.getText() !== this.cachedDiskContents;
+ } else {
+ return (_ref2 = this.wasModifiedBeforeRemove) != null ? _ref2 : !this.isEmpty();
+ }
+ } else {
+ return !this.isEmpty();
+ }
+ };
+
+ TextBuffer.prototype.isInConflict = function() {
+ return this.conflict;
+ };
+
+ TextBuffer.prototype.getPath = function() {
+ var _ref2;
+ return (_ref2 = this.file) != null ? _ref2.getPath() : void 0;
+ };
+
+ TextBuffer.prototype.setPath = function(filePath) {
+ if (filePath === this.getPath()) {
+ return;
+ }
+ if (filePath) {
+ this.file = new File(filePath);
+ this.file.setEncoding(this.getEncoding());
+ this.subscribeToFile();
+ } else {
+ this.file = null;
+ }
+ this.emitter.emit('did-change-path', this.getPath());
+ return this.emit("path-changed", this);
+ };
+
+ TextBuffer.prototype.setEncoding = function(encoding) {
+ if (encoding == null) {
+ encoding = 'utf8';
+ }
+ if (encoding === this.getEncoding()) {
+ return;
+ }
+ this.encoding = encoding;
+ if (this.file != null) {
+ this.file.setEncoding(encoding);
+ this.emitter.emit('did-change-encoding', encoding);
+ if (!this.isModified()) {
+ this.updateCachedDiskContents(true, (function(_this) {
+ return function() {
+ _this.reload();
+ return _this.clearUndoStack();
+ };
+ })(this));
+ }
+ } else {
+ this.emitter.emit('did-change-encoding', encoding);
+ }
+ };
+
+ TextBuffer.prototype.getEncoding = function() {
+ var _ref2, _ref3;
+ return (_ref2 = this.encoding) != null ? _ref2 : (_ref3 = this.file) != null ? _ref3.getEncoding() : void 0;
+ };
+
+ TextBuffer.prototype.getUri = function() {
+ return this.getPath();
+ };
+
+ TextBuffer.prototype.getBaseName = function() {
+ var _ref2;
+ return (_ref2 = this.file) != null ? _ref2.getBaseName() : void 0;
+ };
+
+
+ /*
+ Section: Reading Text
+ */
+
+ TextBuffer.prototype.isEmpty = function() {
+ return this.getLastRow() === 0 && this.lineLengthForRow(0) === 0;
+ };
+
+ TextBuffer.prototype.getText = function() {
+ var row, text, _i, _ref2;
+ if (this.cachedText != null) {
+ return this.cachedText;
+ } else {
+ text = '';
+ for (row = _i = 0, _ref2 = this.getLastRow(); 0 <= _ref2 ? _i <= _ref2 : _i >= _ref2; row = 0 <= _ref2 ? ++_i : --_i) {
+ text += this.lineForRow(row) + this.lineEndingForRow(row);
+ }
+ return this.cachedText = text;
+ }
+ };
+
+ TextBuffer.prototype.getTextInRange = function(range) {
+ var endRow, line, row, startRow, text, _i;
+ range = this.clipRange(Range.fromObject(range));
+ startRow = range.start.row;
+ endRow = range.end.row;
+ if (startRow === endRow) {
+ return this.lineForRow(startRow).slice(range.start.column, range.end.column);
+ } else {
+ text = '';
+ for (row = _i = startRow; startRow <= endRow ? _i <= endRow : _i >= endRow; row = startRow <= endRow ? ++_i : --_i) {
+ line = this.lineForRow(row);
+ if (row === startRow) {
+ text += line.slice(range.start.column);
+ } else if (row === endRow) {
+ text += line.slice(0, range.end.column);
+ continue;
+ } else {
+ text += line;
+ }
+ text += this.lineEndingForRow(row);
+ }
+ return text;
+ }
+ };
+
+ TextBuffer.prototype.getLines = function() {
+ return this.lines.slice();
+ };
+
+ TextBuffer.prototype.getLastLine = function() {
+ return this.lineForRow(this.getLastRow());
+ };
+
+ TextBuffer.prototype.lineForRow = function(row) {
+ return this.lines[row];
+ };
+
+ TextBuffer.prototype.lineEndingForRow = function(row) {
+ return this.lineEndings[row];
+ };
+
+ TextBuffer.prototype.lineLengthForRow = function(row) {
+ return this.lines[row].length;
+ };
+
+ TextBuffer.prototype.isRowBlank = function(row) {
+ return !/\S/.test(this.lineForRow(row));
+ };
+
+ TextBuffer.prototype.previousNonBlankRow = function(startRow) {
+ var row, _i, _ref2;
+ if (startRow === 0) {
+ return null;
+ }
+ startRow = Math.min(startRow, this.getLastRow());
+ for (row = _i = _ref2 = startRow - 1; _ref2 <= 0 ? _i <= 0 : _i >= 0; row = _ref2 <= 0 ? ++_i : --_i) {
+ if (!this.isRowBlank(row)) {
+ return row;
+ }
+ }
+ return null;
+ };
+
+ TextBuffer.prototype.nextNonBlankRow = function(startRow) {
+ var lastRow, row, _i, _ref2;
+ lastRow = this.getLastRow();
+ if (startRow < lastRow) {
+ for (row = _i = _ref2 = startRow + 1; _ref2 <= lastRow ? _i <= lastRow : _i >= lastRow; row = _ref2 <= lastRow ? ++_i : --_i) {
+ if (!this.isRowBlank(row)) {
+ return row;
+ }
+ }
+ }
+ return null;
+ };
+
+
+ /*
+ Section: Mutating Text
+ */
+
+ TextBuffer.prototype.setText = function(text) {
+ return this.setTextInRange(this.getRange(), text, {
+ normalizeLineEndings: false
+ });
+ };
+
+ TextBuffer.prototype.setTextViaDiff = function(text) {
+ var computeBufferColumn, currentText, endsWithNewline;
+ currentText = this.getText();
+ if (currentText === text) {
+ return;
+ }
+ endsWithNewline = function(str) {
+ return /[\r\n]+$/g.test(str);
+ };
+ computeBufferColumn = function(str) {
+ var newlineIndex;
+ newlineIndex = Math.max(str.lastIndexOf('\n'), str.lastIndexOf('\r'));
+ if (endsWithNewline(str)) {
+ return 0;
+ } else if (newlineIndex === -1) {
+ return str.length;
+ } else {
+ return str.length - newlineIndex - 1;
+ }
+ };
+ return this.transact((function(_this) {
+ return function() {
+ var change, changeOptions, column, currentPosition, endColumn, endRow, lineCount, lineDiff, row, _i, _len, _ref2, _ref3, _results;
+ row = 0;
+ column = 0;
+ currentPosition = [0, 0];
+ lineDiff = diff.diffLines(currentText, text);
+ changeOptions = {
+ normalizeLineEndings: false
+ };
+ _results = [];
+ for (_i = 0, _len = lineDiff.length; _i < _len; _i++) {
+ change = lineDiff[_i];
+ lineCount = (_ref2 = (_ref3 = change.value.match(newlineRegex)) != null ? _ref3.length : void 0) != null ? _ref2 : 0;
+ currentPosition[0] = row;
+ currentPosition[1] = column;
+ if (change.added) {
+ _this.setTextInRange([currentPosition, currentPosition], change.value, changeOptions);
+ row += lineCount;
+ _results.push(column = computeBufferColumn(change.value));
+ } else if (change.removed) {
+ endRow = row + lineCount;
+ endColumn = column + computeBufferColumn(change.value);
+ _results.push(_this.setTextInRange([currentPosition, [endRow, endColumn]], '', changeOptions));
+ } else {
+ row += lineCount;
+ _results.push(column = computeBufferColumn(change.value));
+ }
+ }
+ return _results;
+ };
+ })(this));
+ };
+
+ TextBuffer.prototype.setTextInRange = function(range, text, options) {
+ var normalizeLineEndings, patch, undo, _ref2;
+ if (typeof options === 'boolean') {
+ normalizeLineEndings = options;
+ Grim.deprecate("The normalizeLineEndings argument is now an options hash. Use {normalizeLineEndings: " + options + "} instead");
+ } else if (options != null) {
+ normalizeLineEndings = options.normalizeLineEndings, undo = options.undo;
+ }
+ if (normalizeLineEndings == null) {
+ normalizeLineEndings = true;
+ }
+ patch = this.buildPatch(range, text, normalizeLineEndings);
+ if (undo !== 'skip') {
+ if ((_ref2 = this.history) != null) {
+ _ref2.recordNewPatch(patch);
+ }
+ }
+ this.applyPatch(patch);
+ return patch.newRange;
+ };
+
+ TextBuffer.prototype.insert = function(position, text, options) {
+ return this.setTextInRange(new Range(position, position), text, options);
+ };
+
+ TextBuffer.prototype.append = function(text, options) {
+ return this.insert(this.getEndPosition(), text, options);
+ };
+
+ TextBuffer.prototype.buildPatch = function(oldRange, newText, normalizeLineEndings) {
+ var newRange, oldText, patch, _ref2;
+ oldRange = this.clipRange(oldRange);
+ oldText = this.getTextInRange(oldRange);
+ newRange = Range.fromText(oldRange.start, newText);
+ patch = new BufferPatch(oldRange, newRange, oldText, newText, normalizeLineEndings);
+ if ((_ref2 = this.markers) != null) {
+ _ref2.handleBufferChange(patch);
+ }
+ return patch;
+ };
+
+ TextBuffer.prototype.applyPatch = function(_arg) {
+ var changeEvent, endRow, lastIndex, lastLine, lastLineEnding, lineEndings, lineStartIndex, lines, markerPatches, newRange, newText, normalizeLineEndings, normalizedEnding, offsets, oldRange, oldText, prefix, result, rowCount, startRow, suffix, _ref2, _ref3, _ref4;
+ oldRange = _arg.oldRange, newRange = _arg.newRange, oldText = _arg.oldText, newText = _arg.newText, normalizeLineEndings = _arg.normalizeLineEndings, markerPatches = _arg.markerPatches;
+ this.cachedText = null;
+ startRow = oldRange.start.row;
+ endRow = oldRange.end.row;
+ rowCount = endRow - startRow + 1;
+ if (normalizeLineEndings) {
+ normalizedEnding = this.lineEndingForRow(startRow);
+ if (normalizedEnding === '') {
+ if (startRow > 0) {
+ normalizedEnding = this.lineEndingForRow(startRow - 1);
+ } else {
+ normalizedEnding = null;
+ }
+ }
+ }
+ lines = [];
+ lineEndings = [];
+ lineStartIndex = 0;
+ while (result = newlineRegex.exec(newText)) {
+ lines.push(newText.slice(lineStartIndex, result.index));
+ lineEndings.push(normalizedEnding != null ? normalizedEnding : result[0]);
+ lineStartIndex = newlineRegex.lastIndex;
+ }
+ lastLine = newText.slice(lineStartIndex);
+ lines.push(lastLine);
+ lineEndings.push('');
+ prefix = this.lineForRow(startRow).slice(0, oldRange.start.column);
+ lines[0] = prefix + lines[0];
+ suffix = this.lineForRow(endRow).slice(oldRange.end.column);
+ lastIndex = lines.length - 1;
+ lines[lastIndex] += suffix;
+ lastLineEnding = this.lineEndingForRow(endRow);
+ if (lastLineEnding !== '' && (normalizedEnding != null)) {
+ lastLineEnding = normalizedEnding;
+ }
+ lineEndings[lastIndex] = lastLineEnding;
+ spliceArray(this.lines, startRow, rowCount, lines);
+ spliceArray(this.lineEndings, startRow, rowCount, lineEndings);
+ offsets = lines.map(function(line, index) {
+ return {
+ rows: 1,
+ characters: line.length + lineEndings[index].length
+ };
+ });
+ this.offsetIndex.spliceArray('rows', startRow, rowCount, offsets);
+ if ((_ref2 = this.markers) != null) {
+ _ref2.pauseChangeEvents();
+ }
+ if ((_ref3 = this.markers) != null) {
+ _ref3.applyPatches(markerPatches, true);
+ }
+ changeEvent = {
+ oldRange: oldRange,
+ newRange: newRange,
+ oldText: oldText,
+ newText: newText
+ };
+ if (this.conflict && !this.isModified()) {
+ this.conflict = false;
+ }
+ this.scheduleModifiedEvents();
+ this.emitter.emit('did-change', changeEvent);
+ this.emit('changed', changeEvent);
+ if ((_ref4 = this.markers) != null) {
+ _ref4.resumeChangeEvents();
+ }
+ this.emitter.emit('did-update-markers');
+ return this.emit('markers-updated');
+ };
+
+ TextBuffer.prototype["delete"] = function(range) {
+ return this.setTextInRange(range, '');
+ };
+
+ TextBuffer.prototype.deleteRow = function(row) {
+ return this.deleteRows(row, row);
+ };
+
+ TextBuffer.prototype.deleteRows = function(startRow, endRow) {
+ var endPoint, lastRow, startPoint, _ref2;
+ lastRow = this.getLastRow();
+ if (startRow > endRow) {
+ _ref2 = [endRow, startRow], startRow = _ref2[0], endRow = _ref2[1];
+ }
+ if (endRow < 0) {
+ return new Range(this.getFirstPosition(), this.getFirstPosition());
+ }
+ if (startRow > lastRow) {
+ return new Range(this.getEndPosition(), this.getEndPosition());
+ }
+ startRow = Math.max(0, startRow);
+ endRow = Math.min(lastRow, endRow);
+ if (endRow < lastRow) {
+ startPoint = new Point(startRow, 0);
+ endPoint = new Point(endRow + 1, 0);
+ } else {
+ if (startRow === 0) {
+ startPoint = new Point(startRow, 0);
+ } else {
+ startPoint = new Point(startRow - 1, this.lineLengthForRow(startRow - 1));
+ }
+ endPoint = new Point(endRow, this.lineLengthForRow(endRow));
+ }
+ return this["delete"](new Range(startPoint, endPoint));
+ };
+
+
+ /*
+ Section: Markers
+ */
+
+ TextBuffer.prototype.markRange = function(range, properties) {
+ return this.markers.markRange(range, properties);
+ };
+
+ TextBuffer.prototype.markPosition = function(position, properties) {
+ return this.markers.markPosition(position, properties);
+ };
+
+ TextBuffer.prototype.getMarkers = function() {
+ return this.markers.getMarkers();
+ };
+
+ TextBuffer.prototype.getMarker = function(id) {
+ return this.markers.getMarker(id);
+ };
+
+ TextBuffer.prototype.findMarkers = function(params) {
+ return this.markers.findMarkers(params);
+ };
+
+ TextBuffer.prototype.getMarkerCount = function() {
+ return this.markers.getMarkerCount();
+ };
+
+ TextBuffer.prototype.destroyMarker = function(id) {
+ var _ref2;
+ return (_ref2 = this.getMarker(id)) != null ? _ref2.destroy() : void 0;
+ };
+
+
+ /*
+ Section: History
+ */
+
+ TextBuffer.prototype.undo = function() {
+ return this.history.undo();
+ };
+
+ TextBuffer.prototype.redo = function() {
+ return this.history.redo();
+ };
+
+ TextBuffer.prototype.transact = function(groupingInterval, fn) {
+ return this.history.transact(groupingInterval, fn);
+ };
+
+ TextBuffer.prototype.beginTransaction = function(groupingInterval) {
+ Grim.deprecate("Open-ended transactions are deprecated. Use checkpoints instead.");
+ return this.history.beginTransaction(groupingInterval);
+ };
+
+ TextBuffer.prototype.commitTransaction = function() {
+ Grim.deprecate("Open-ended transactions are deprecated. Use checkpoints instead.");
+ return this.history.commitTransaction();
+ };
+
+ TextBuffer.prototype.abortTransaction = function() {
+ Grim.deprecate("Open-ended transactions are deprecated. Use checkpoints instead.");
+ return this.history.abortTransaction();
+ };
+
+ TextBuffer.prototype.clearUndoStack = function() {
+ return this.history.clearUndoStack();
+ };
+
+ TextBuffer.prototype.createCheckpoint = function() {
+ return this.history.createCheckpoint();
+ };
+
+ TextBuffer.prototype.revertToCheckpoint = function(checkpoint) {
+ return this.history.revertToCheckpoint(checkpoint);
+ };
+
+ TextBuffer.prototype.groupChangesSinceCheckpoint = function(checkpoint) {
+ return this.history.groupChangesSinceCheckpoint(checkpoint);
+ };
+
+
+ /*
+ Section: Search And Replace
+ */
+
+ TextBuffer.prototype.scan = function(regex, iterator) {
+ return this.scanInRange(regex, this.getRange(), (function(_this) {
+ return function(result) {
+ result.lineText = _this.lineForRow(result.range.start.row);
+ result.lineTextOffset = 0;
+ return iterator(result);
+ };
+ })(this));
+ };
+
+ TextBuffer.prototype.backwardsScan = function(regex, iterator) {
+ return this.backwardsScanInRange(regex, this.getRange(), (function(_this) {
+ return function(result) {
+ result.lineText = _this.lineForRow(result.range.start.row);
+ result.lineTextOffset = 0;
+ return iterator(result);
+ };
+ })(this));
+ };
+
+ TextBuffer.prototype.scanInRange = function(regex, range, iterator, reverse) {
+ var endIndex, endPosition, flags, global, keepLooping, lengthDelta, match, matchEndIndex, matchLength, matchStartIndex, matchText, matches, replace, replacementText, startIndex, startPosition, stop, _i, _len, _results;
+ if (reverse == null) {
+ reverse = false;
+ }
+ range = this.clipRange(range);
+ global = regex.global;
+ flags = "gm";
+ if (regex.ignoreCase) {
+ flags += "i";
+ }
+ regex = new RegExp(regex.source, flags);
+ startIndex = this.characterIndexForPosition(range.start);
+ endIndex = this.characterIndexForPosition(range.end);
+ matches = this.matchesInCharacterRange(regex, startIndex, endIndex);
+ lengthDelta = 0;
+ keepLooping = null;
+ replacementText = null;
+ stop = function() {
+ return keepLooping = false;
+ };
+ replace = function(text) {
+ return replacementText = text;
+ };
+ if (reverse) {
+ matches.reverse();
+ }
+ _results = [];
+ for (_i = 0, _len = matches.length; _i < _len; _i++) {
+ match = matches[_i];
+ matchLength = match[0].length;
+ matchStartIndex = match.index;
+ matchEndIndex = matchStartIndex + matchLength;
+ startPosition = this.positionForCharacterIndex(matchStartIndex + lengthDelta);
+ endPosition = this.positionForCharacterIndex(matchEndIndex + lengthDelta);
+ range = new Range(startPosition, endPosition);
+ keepLooping = true;
+ replacementText = null;
+ matchText = match[0];
+ iterator({
+ match: match,
+ matchText: matchText,
+ range: range,
+ stop: stop,
+ replace: replace
+ });
+ if (replacementText != null) {
+ this.setTextInRange(range, replacementText);
+ if (!reverse) {
+ lengthDelta += replacementText.length - matchLength;
+ }
+ }
+ if (!(global && keepLooping)) {
+ break;
+ } else {
+ _results.push(void 0);
+ }
+ }
+ return _results;
+ };
+
+ TextBuffer.prototype.backwardsScanInRange = function(regex, range, iterator) {
+ return this.scanInRange(regex, range, iterator, true);
+ };
+
+ TextBuffer.prototype.replace = function(regex, replacementText) {
+ var doSave, replacements;
+ doSave = !this.isModified();
+ replacements = 0;
+ this.transact((function(_this) {
+ return function() {
+ return _this.scan(regex, function(_arg) {
+ var matchText, replace;
+ matchText = _arg.matchText, replace = _arg.replace;
+ replace(matchText.replace(regex, replacementText));
+ return replacements++;
+ });
+ };
+ })(this));
+ if (doSave) {
+ this.save();
+ }
+ return replacements;
+ };
+
+ TextBuffer.prototype.matchesInCharacterRange = function(regex, startIndex, endIndex) {
+ var match, matchEndIndex, matchLength, matchStartIndex, matches, submatch, text;
+ text = this.getText();
+ matches = [];
+ regex.lastIndex = startIndex;
+ while (match = regex.exec(text)) {
+ matchLength = match[0].length;
+ matchStartIndex = match.index;
+ matchEndIndex = matchStartIndex + matchLength;
+ if (matchEndIndex > endIndex) {
+ regex.lastIndex = 0;
+ if (matchStartIndex < endIndex && (submatch = regex.exec(text.slice(matchStartIndex, endIndex)))) {
+ submatch.index = matchStartIndex;
+ matches.push(submatch);
+ }
+ break;
+ }
+ if (matchLength === 0) {
+ matchEndIndex++;
+ }
+ regex.lastIndex = matchEndIndex;
+ matches.push(match);
+ }
+ return matches;
+ };
+
+
+ /*
+ Section: Buffer Range Details
+ */
+
+ TextBuffer.prototype.getRange = function() {
+ return new Range(this.getFirstPosition(), this.getEndPosition());
+ };
+
+ TextBuffer.prototype.getLineCount = function() {
+ return this.lines.length;
+ };
+
+ TextBuffer.prototype.getLastRow = function() {
+ return this.getLineCount() - 1;
+ };
+
+ TextBuffer.prototype.getFirstPosition = function() {
+ return new Point(0, 0);
+ };
+
+ TextBuffer.prototype.getEndPosition = function() {
+ var lastRow;
+ lastRow = this.getLastRow();
+ return new Point(lastRow, this.lineLengthForRow(lastRow));
+ };
+
+ TextBuffer.prototype.getMaxCharacterIndex = function() {
+ return this.offsetIndex.totalTo(Infinity, 'rows').characters;
+ };
+
+ TextBuffer.prototype.rangeForRow = function(row, includeNewline) {
+ if (typeof includeNewline === 'object') {
+ Grim.deprecate("The second param is no longer an object, it's a boolean argument named `includeNewline`.");
+ includeNewline = includeNewline.includeNewline;
+ }
+ if (includeNewline && row < this.getLastRow()) {
+ return new Range(new Point(row, 0), new Point(row + 1, 0));
+ } else {
+ return new Range(new Point(row, 0), new Point(row, this.lineLengthForRow(row)));
+ }
+ };
+
+ TextBuffer.prototype.characterIndexForPosition = function(position) {
+ var characters, column, row, _ref2;
+ _ref2 = this.clipPosition(Point.fromObject(position)), row = _ref2.row, column = _ref2.column;
+ if (row < 0 || row > this.getLastRow() || column < 0 || column > this.lineLengthForRow(row)) {
+ throw new Error("Position " + position + " is invalid");
+ }
+ characters = this.offsetIndex.totalTo(row, 'rows').characters;
+ return characters + column;
+ };
+
+ TextBuffer.prototype.positionForCharacterIndex = function(offset) {
+ var characters, rows, _ref2;
+ offset = Math.max(0, offset);
+ offset = Math.min(this.getMaxCharacterIndex(), offset);
+ _ref2 = this.offsetIndex.totalTo(offset, 'characters'), rows = _ref2.rows, characters = _ref2.characters;
+ if (rows > this.getLastRow()) {
+ return this.getEndPosition();
+ } else {
+ return new Point(rows, offset - characters);
+ }
+ };
+
+ TextBuffer.prototype.clipRange = function(range) {
+ var end, start;
+ range = Range.fromObject(range);
+ start = this.clipPosition(range.start);
+ end = this.clipPosition(range.end);
+ if (range.start.isEqual(start) && range.end.isEqual(end)) {
+ return range;
+ } else {
+ return new Range(start, end);
+ }
+ };
+
+ TextBuffer.prototype.clipPosition = function(position) {
+ var column, row;
+ position = Point.fromObject(position);
+ row = position.row, column = position.column;
+ if (row < 0) {
+ return this.getFirstPosition();
+ } else if (row > this.getLastRow()) {
+ return this.getEndPosition();
+ } else {
+ column = Math.min(Math.max(column, 0), this.lineLengthForRow(row));
+ if (column === position.column) {
+ return position;
+ } else {
+ return new Point(row, column);
+ }
+ }
+ };
+
+
+ /*
+ Section: Buffer Operations
+ */
+
+ TextBuffer.prototype.save = function() {
+ return this.saveAs(this.getPath());
+ };
+
+ TextBuffer.prototype.saveAs = function(filePath) {
+ if (!filePath) {
+ throw new Error("Can't save buffer with no file path");
+ }
+ this.emitter.emit('will-save', {
+ path: filePath
+ });
+ this.emit('will-be-saved', this);
+ this.setPath(filePath);
+ this.file.write(this.getText());
+ this.cachedDiskContents = this.getText();
+ this.conflict = false;
+ this.emitModifiedStatusChanged(false);
+ this.emitter.emit('did-save', {
+ path: filePath
+ });
+ return this.emit('saved', this);
+ };
+
+ TextBuffer.prototype.reload = function() {
+ this.emitter.emit('will-reload');
+ this.emit('will-reload');
+ this.setTextViaDiff(this.cachedDiskContents);
+ this.emitModifiedStatusChanged(false);
+ this.emitter.emit('did-reload');
+ return this.emit('reloaded');
+ };
+
+ TextBuffer.prototype.updateCachedDiskContentsSync = function() {
+ var _ref2, _ref3;
+ return this.cachedDiskContents = (_ref2 = (_ref3 = this.file) != null ? _ref3.readSync() : void 0) != null ? _ref2 : "";
+ };
+
+ TextBuffer.prototype.updateCachedDiskContents = function(flushCache, callback) {
+ var _ref2, _ref3;
+ if (flushCache == null) {
+ flushCache = false;
+ }
+ return Q((_ref2 = (_ref3 = this.file) != null ? _ref3.read(flushCache) : void 0) != null ? _ref2 : "").then((function(_this) {
+ return function(contents) {
+ _this.cachedDiskContents = contents;
+ return typeof callback === "function" ? callback() : void 0;
+ };
+ })(this));
+ };
+
+
+ /*
+ Section: Private Utility Methods
+ */
+
+ TextBuffer.prototype.markerCreated = function(marker) {
+ this.emitter.emit('did-create-marker', marker);
+ return this.emit('marker-created', marker);
+ };
+
+ TextBuffer.prototype.loadSync = function() {
+ this.updateCachedDiskContentsSync();
+ return this.finishLoading();
+ };
+
+ TextBuffer.prototype.load = function() {
+ return this.updateCachedDiskContents().then((function(_this) {
+ return function() {
+ return _this.finishLoading();
+ };
+ })(this));
+ };
+
+ TextBuffer.prototype.finishLoading = function() {
+ var _ref2;
+ if (this.isAlive()) {
+ this.loaded = true;
+ if (this.useSerializedText && this.digestWhenLastPersisted === ((_ref2 = this.file) != null ? _ref2.getDigest() : void 0)) {
+ this.emitModifiedStatusChanged(true);
+ } else {
+ this.reload();
+ }
+ this.clearUndoStack();
+ }
+ return this;
+ };
+
+ TextBuffer.prototype.destroy = function() {
+ var _ref2;
+ if (!this.destroyed) {
+ this.cancelStoppedChangingTimeout();
+ if ((_ref2 = this.fileSubscriptions) != null) {
+ _ref2.dispose();
+ }
+ this.unsubscribe();
+ this.destroyed = true;
+ this.emitter.emit('did-destroy');
+ return this.emit('destroyed');
+ }
+ };
+
+ TextBuffer.prototype.isAlive = function() {
+ return !this.destroyed;
+ };
+
+ TextBuffer.prototype.isDestroyed = function() {
+ return this.destroyed;
+ };
+
+ TextBuffer.prototype.isRetained = function() {
+ return this.refcount > 0;
+ };
+
+ TextBuffer.prototype.retain = function() {
+ this.refcount++;
+ return this;
+ };
+
+ TextBuffer.prototype.release = function() {
+ this.refcount--;
+ if (!this.isRetained()) {
+ this.destroy();
+ }
+ return this;
+ };
+
+ TextBuffer.prototype.subscribeToFile = function() {
+ var _ref2;
+ if ((_ref2 = this.fileSubscriptions) != null) {
+ _ref2.dispose();
+ }
+ this.fileSubscriptions = new CompositeDisposable;
+ this.fileSubscriptions.add(this.file.onDidChange((function(_this) {
+ return function() {
+ var previousContents;
+ if (_this.isModified()) {
+ _this.conflict = true;
+ }
+ previousContents = _this.cachedDiskContents;
+ _this.updateCachedDiskContentsSync();
+ if (previousContents === _this.cachedDiskContents) {
+ return;
+ }
+ if (_this.conflict) {
+ _this.emitter.emit('did-conflict');
+ return _this.emit("contents-conflicted");
+ } else {
+ return _this.reload();
+ }
+ };
+ })(this)));
+ this.fileSubscriptions.add(this.file.onDidDelete((function(_this) {
+ return function() {
+ var modified;
+ modified = _this.getText() !== _this.cachedDiskContents;
+ _this.wasModifiedBeforeRemove = modified;
+ if (modified) {
+ return _this.updateCachedDiskContents();
+ } else {
+ return _this.destroy();
+ }
+ };
+ })(this)));
+ this.fileSubscriptions.add(this.file.onDidRename((function(_this) {
+ return function() {
+ _this.emitter.emit('did-change-path', _this.getPath());
+ return _this.emit("path-changed", _this);
+ };
+ })(this)));
+ return this.fileSubscriptions.add(this.file.onWillThrowWatchError((function(_this) {
+ return function(errorObject) {
+ return _this.emitter.emit('will-throw-watch-error', errorObject);
+ };
+ })(this)));
+ };
+
+ TextBuffer.prototype.hasMultipleEditors = function() {
+ return this.refcount > 1;
+ };
+
+ TextBuffer.prototype.cancelStoppedChangingTimeout = function() {
+ if (this.stoppedChangingTimeout) {
+ return clearTimeout(this.stoppedChangingTimeout);
+ }
+ };
+
+ TextBuffer.prototype.scheduleModifiedEvents = function() {
+ var stoppedChangingCallback;
+ this.cancelStoppedChangingTimeout();
+ stoppedChangingCallback = (function(_this) {
+ return function() {
+ var modifiedStatus;
+ _this.stoppedChangingTimeout = null;
+ modifiedStatus = _this.isModified();
+ _this.emitter.emit('did-stop-changing');
+ _this.emit('contents-modified', modifiedStatus);
+ return _this.emitModifiedStatusChanged(modifiedStatus);
+ };
+ })(this);
+ return this.stoppedChangingTimeout = setTimeout(stoppedChangingCallback, this.stoppedChangingDelay);
+ };
+
+ TextBuffer.prototype.emitModifiedStatusChanged = function(modifiedStatus) {
+ if (modifiedStatus === this.previousModifiedStatus) {
+ return;
+ }
+ this.previousModifiedStatus = modifiedStatus;
+ this.emitter.emit('did-change-modified', modifiedStatus);
+ return this.emit('modified-status-changed', modifiedStatus);
+ };
+
+ TextBuffer.prototype.usesSoftTabs = function() {
+ var match, row, _i, _ref2;
+ Grim.deprecate("Use Editor::usesSoftTabs instead. TextBuffer doesn't have enough context to determine this.");
+ for (row = _i = 0, _ref2 = this.getLastRow(); 0 <= _ref2 ? _i <= _ref2 : _i >= _ref2; row = 0 <= _ref2 ? ++_i : --_i) {
+ if (match = this.lineForRow(row).match(/^\s/)) {
+ return match[0][0] !== '\t';
+ }
+ }
+ return void 0;
+ };
+
+ TextBuffer.prototype.change = function(oldRange, newText, options) {
+ if (options == null) {
+ options = {};
+ }
+ Grim.deprecate("Use TextBuffer::setTextInRange instead.");
+ return this.setTextInRange(oldRange, newText, options.normalizeLineEndings);
+ };
+
+ TextBuffer.prototype.getEofPosition = function() {
+ Grim.deprecate("Use TextBuffer::getEndPosition instead.");
+ return this.getEndPosition();
+ };
+
+ TextBuffer.prototype.logLines = function(start, end) {
+ var line, row, _i, _results;
+ if (start == null) {
+ start = 0;
+ }
+ if (end == null) {
+ end = this.getLastRow();
+ }
+ _results = [];
+ for (row = _i = start; start <= end ? _i <= end : _i >= end; row = start <= end ? ++_i : --_i) {
+ line = this.lineForRow(row);
+ _results.push(console.log(row, line, line.length));
+ }
+ return _results;
+ };
+
+ return TextBuffer;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/lib/transaction.js b/node_modules/basarat-text-buffer/lib/transaction.js
new file mode 100644
index 000000000..0a755d52c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/lib/transaction.js
@@ -0,0 +1,93 @@
+(function() {
+ var BufferPatch, MarkerPatch, Serializable, Transaction, find,
+ __hasProp = {}.hasOwnProperty,
+ __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; };
+
+ find = require('underscore-plus').find;
+
+ Serializable = require('serializable');
+
+ BufferPatch = require('./buffer-patch');
+
+ MarkerPatch = require('./marker-patch');
+
+ module.exports = Transaction = (function(_super) {
+ __extends(Transaction, _super);
+
+ Transaction.registerDeserializers(BufferPatch, MarkerPatch);
+
+ function Transaction(patches, groupingInterval) {
+ this.patches = patches != null ? patches : [];
+ if (groupingInterval == null) {
+ groupingInterval = 0;
+ }
+ this.groupingExpirationTime = Date.now() + groupingInterval;
+ }
+
+ Transaction.prototype.serializeParams = function() {
+ return {
+ patches: this.patches.map(function(patch) {
+ return patch.serialize();
+ })
+ };
+ };
+
+ Transaction.prototype.deserializeParams = function(params) {
+ params.patches = params.patches.map((function(_this) {
+ return function(patchState) {
+ return _this.constructor.deserialize(patchState);
+ };
+ })(this));
+ return params;
+ };
+
+ Transaction.prototype.push = function(patch) {
+ return this.patches.push(patch);
+ };
+
+ Transaction.prototype.invert = function(buffer) {
+ return new this.constructor(this.patches.map(function(patch) {
+ return patch.invert(buffer);
+ }).reverse());
+ };
+
+ Transaction.prototype.applyTo = function(buffer) {
+ var patch, _i, _len, _ref, _results;
+ _ref = this.patches;
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ patch = _ref[_i];
+ _results.push(patch.applyTo(buffer));
+ }
+ return _results;
+ };
+
+ Transaction.prototype.hasBufferPatches = function() {
+ return find(this.patches, function(patch) {
+ return patch instanceof BufferPatch;
+ });
+ };
+
+ Transaction.prototype.merge = function(patch) {
+ var subpatch, _i, _len, _ref;
+ if (patch instanceof Transaction) {
+ _ref = patch.patches;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ subpatch = _ref[_i];
+ this.push(subpatch);
+ }
+ return this.groupingExpirationTime = patch.groupingExpirationTime, patch;
+ } else {
+ return this.push(patch);
+ }
+ };
+
+ Transaction.prototype.isOpenForGrouping = function() {
+ return this.groupingExpirationTime > Date.now();
+ };
+
+ return Transaction;
+
+ })(Serializable);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/atom-diff/README.md b/node_modules/basarat-text-buffer/node_modules/atom-diff/README.md
new file mode 100644
index 000000000..95bd8da29
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/atom-diff/README.md
@@ -0,0 +1,101 @@
+# jsdiff
+
+[](http://travis-ci.org/kpdecker/jsdiff)
+
+A javascript text differencing implementation.
+
+Based on the algorithm proposed in
+["An O(ND) Difference Algorithm and its Variations" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).
+
+## Installation
+
+ npm install diff
+
+or
+
+ git clone git://github.com/kpdecker/jsdiff.git
+
+## API
+
+* JsDiff.diffChars(oldStr, newStr)
+ Diffs two blocks of text, comparing character by character.
+
+ Returns a list of change objects (See below).
+
+* JsDiff.diffWords(oldStr, newStr)
+ Diffs two blocks of text, comparing word by word.
+
+ Returns a list of change objects (See below).
+
+* JsDiff.diffLines(oldStr, newStr)
+ Diffs two blocks of text, comparing line by line.
+
+ Returns a list of change objects (See below).
+
+* JsDiff.diffCss(oldStr, newStr)
+ Diffs two blocks of text, comparing CSS tokens.
+
+ Returns a list of change objects (See below).
+
+* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)
+ Creates a unified diff patch.
+
+ Parameters:
+ * fileName : String to be output in the filename sections of the patch
+ * oldStr : Original string value
+ * newStr : New string value
+ * oldHeader : Additional information to include in the old file header
+ * newHeader : Additional information to include in thew new file header
+
+* JsDiff.applyPatch(oldStr, diffStr)
+ Applies a unified diff patch.
+
+ Return a string containing new version of provided data.
+
+* convertChangesToXML(changes)
+ Converts a list of changes to a serialized XML format
+
+### Change Objects
+Many of the methods above return change objects. These objects are consist of the following fields:
+
+* value: Text content
+* added: True if the value was inserted into the new string
+* removed: True of the value was removed from the old string
+
+Note that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.
+
+## [Example](http://kpdecker.github.com/jsdiff)
+
+## License
+
+Software License Agreement (BSD License)
+
+Copyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com
+
+All rights reserved.
+
+Redistribution and use of this software in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the
+ following disclaimer.
+
+* Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the
+ following disclaimer in the documentation and/or other
+ materials provided with the distribution.
+
+* Neither the name of Kevin Decker nor the names of its
+ contributors may be used to endorse or promote products
+ derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
+IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
+OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/basarat-text-buffer/node_modules/atom-diff/diff.js b/node_modules/basarat-text-buffer/node_modules/atom-diff/diff.js
new file mode 100644
index 000000000..efab725ee
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/atom-diff/diff.js
@@ -0,0 +1,367 @@
+/* See LICENSE file for terms of use */
+
+/*
+ * Text diff implementation.
+ *
+ * This library supports the following APIS:
+ * JsDiff.diffChars: Character by character diff
+ * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
+ * JsDiff.diffLines: Line based diff
+ *
+ * JsDiff.diffCss: Diff targeted at CSS content
+ *
+ * These methods are based on the implementation proposed in
+ * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
+ * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
+ */
+var JsDiff = (function() {
+ /*jshint maxparams: 5*/
+ function clonePath(path) {
+ return { newPos: path.newPos, components: path.components.slice(0) };
+ }
+ function removeEmpty(array) {
+ var ret = [];
+ for (var i = 0; i < array.length; i++) {
+ if (array[i]) {
+ ret.push(array[i]);
+ }
+ }
+ return ret;
+ }
+ function escapeHTML(s) {
+ var n = s;
+ n = n.replace(/&/g, '&');
+ n = n.replace(//g, '>');
+ n = n.replace(/"/g, '"');
+
+ return n;
+ }
+
+ var Diff = function(ignoreWhitespace) {
+ this.ignoreWhitespace = ignoreWhitespace;
+ };
+ Diff.prototype = {
+ diff: function(oldString, newString) {
+ // Handle the identity case (this is due to unrolling editLength == 0
+ if (newString === oldString) {
+ return [{ value: newString }];
+ }
+ if (!newString) {
+ return [{ value: oldString, removed: true }];
+ }
+ if (!oldString) {
+ return [{ value: newString, added: true }];
+ }
+
+ newString = this.tokenize(newString);
+ oldString = this.tokenize(oldString);
+
+ var newLen = newString.length, oldLen = oldString.length;
+ var maxEditLength = newLen + oldLen;
+ var bestPath = [{ newPos: -1, components: [] }];
+
+ // Seed editLength = 0
+ var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
+ if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) {
+ return bestPath[0].components;
+ }
+
+ for (var editLength = 1; editLength <= maxEditLength; editLength++) {
+ for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {
+ var basePath;
+ var addPath = bestPath[diagonalPath-1],
+ removePath = bestPath[diagonalPath+1];
+ oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
+ if (addPath) {
+ // No one else is going to attempt to use this value, clear it
+ bestPath[diagonalPath-1] = undefined;
+ }
+
+ var canAdd = addPath && addPath.newPos+1 < newLen;
+ var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;
+ if (!canAdd && !canRemove) {
+ bestPath[diagonalPath] = undefined;
+ continue;
+ }
+
+ // Select the diagonal that we want to branch from. We select the prior
+ // path whose position in the new string is the farthest from the origin
+ // and does not pass the bounds of the diff graph
+ if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {
+ basePath = clonePath(removePath);
+ this.pushComponent(basePath.components, oldString[oldPos], undefined, true);
+ } else {
+ basePath = clonePath(addPath);
+ basePath.newPos++;
+ this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);
+ }
+
+ var oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);
+
+ if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {
+ return basePath.components;
+ } else {
+ bestPath[diagonalPath] = basePath;
+ }
+ }
+ }
+ },
+
+ pushComponent: function(components, value, added, removed) {
+ var last = components[components.length-1];
+ if (last && last.added === added && last.removed === removed) {
+ // We need to clone here as the component clone operation is just
+ // as shallow array clone
+ components[components.length-1] =
+ {value: this.join(last.value, value), added: added, removed: removed };
+ } else {
+ components.push({value: value, added: added, removed: removed });
+ }
+ },
+ extractCommon: function(basePath, newString, oldString, diagonalPath) {
+ var newLen = newString.length,
+ oldLen = oldString.length,
+ newPos = basePath.newPos,
+ oldPos = newPos - diagonalPath;
+ while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) {
+ newPos++;
+ oldPos++;
+
+ this.pushComponent(basePath.components, newString[newPos], undefined, undefined);
+ }
+ basePath.newPos = newPos;
+ return oldPos;
+ },
+
+ equals: function(left, right) {
+ var reWhitespace = /\S/;
+ if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) {
+ return true;
+ } else {
+ return left === right;
+ }
+ },
+ join: function(left, right) {
+ return left + right;
+ },
+ tokenize: function(value) {
+ return value;
+ }
+ };
+
+ var CharDiff = new Diff();
+
+ var WordDiff = new Diff(true);
+ var WordWithSpaceDiff = new Diff();
+ WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) {
+ return removeEmpty(value.split(/(\s+|\b)/));
+ };
+
+ var CssDiff = new Diff(true);
+ CssDiff.tokenize = function(value) {
+ return removeEmpty(value.split(/([{}:;,]|\s+)/));
+ };
+
+ var LineDiff = new Diff();
+ LineDiff.tokenize = function(value) {
+ var retLines = [];
+ var lines = value.split(/^/m);
+
+ for(var i = 0; i < lines.length; i++) {
+ var line = lines[i];
+ var lastLine = lines[i - 1];
+
+ if(line == '\n' && lastLine && lastLine.indexOf('\r') == lastLine.length - 1)
+ retLines[retLines.length - 1] += '\n';
+ else if(line)
+ retLines.push(line);
+ }
+
+ return retLines;
+ };
+
+ return {
+ Diff: Diff,
+
+ diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); },
+ diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); },
+ diffWordsWithSpace: function(oldStr, newStr) { return WordWithSpaceDiff.diff(oldStr, newStr); },
+ diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); },
+
+ diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); },
+
+ createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
+ var ret = [];
+
+ ret.push('Index: ' + fileName);
+ ret.push('===================================================================');
+ ret.push('--- ' + fileName + (typeof oldHeader === 'undefined' ? '' : '\t' + oldHeader));
+ ret.push('+++ ' + fileName + (typeof newHeader === 'undefined' ? '' : '\t' + newHeader));
+
+ var diff = LineDiff.diff(oldStr, newStr);
+ if (!diff[diff.length-1].value) {
+ diff.pop(); // Remove trailing newline add
+ }
+ diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier
+
+ function contextLines(lines) {
+ return lines.map(function(entry) { return ' ' + entry; });
+ }
+ function eofNL(curRange, i, current) {
+ var last = diff[diff.length-2],
+ isLast = i === diff.length-2,
+ isLastOfType = i === diff.length-3 && (current.added !== last.added || current.removed !== last.removed);
+
+ // Figure out if this is the last line for the given file and missing NL
+ if (!/\n$/.test(current.value) && (isLast || isLastOfType)) {
+ curRange.push('\\ No newline at end of file');
+ }
+ }
+
+ var oldRangeStart = 0, newRangeStart = 0, curRange = [],
+ oldLine = 1, newLine = 1;
+ for (var i = 0; i < diff.length; i++) {
+ var current = diff[i],
+ lines = current.lines || current.value.replace(/\n$/, '').split('\n');
+ current.lines = lines;
+
+ if (current.added || current.removed) {
+ if (!oldRangeStart) {
+ var prev = diff[i-1];
+ oldRangeStart = oldLine;
+ newRangeStart = newLine;
+
+ if (prev) {
+ curRange = contextLines(prev.lines.slice(-4));
+ oldRangeStart -= curRange.length;
+ newRangeStart -= curRange.length;
+ }
+ }
+ curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?'+':'-') + entry; }));
+ eofNL(curRange, i, current);
+
+ if (current.added) {
+ newLine += lines.length;
+ } else {
+ oldLine += lines.length;
+ }
+ } else {
+ if (oldRangeStart) {
+ // Close out any changes that have been output (or join overlapping)
+ if (lines.length <= 8 && i < diff.length-2) {
+ // Overlapping
+ curRange.push.apply(curRange, contextLines(lines));
+ } else {
+ // end the range and output
+ var contextSize = Math.min(lines.length, 4);
+ ret.push(
+ '@@ -' + oldRangeStart + ',' + (oldLine-oldRangeStart+contextSize)
+ + ' +' + newRangeStart + ',' + (newLine-newRangeStart+contextSize)
+ + ' @@');
+ ret.push.apply(ret, curRange);
+ ret.push.apply(ret, contextLines(lines.slice(0, contextSize)));
+ if (lines.length <= 4) {
+ eofNL(ret, i, current);
+ }
+
+ oldRangeStart = 0; newRangeStart = 0; curRange = [];
+ }
+ }
+ oldLine += lines.length;
+ newLine += lines.length;
+ }
+ }
+
+ return ret.join('\n') + '\n';
+ },
+
+ applyPatch: function(oldStr, uniDiff) {
+ var diffstr = uniDiff.split('\n');
+ var diff = [];
+ var remEOFNL = false,
+ addEOFNL = false;
+
+ for (var i = (diffstr[0][0]==='I'?4:0); i < diffstr.length; i++) {
+ if(diffstr[i][0] === '@') {
+ var meh = diffstr[i].split(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);
+ diff.unshift({
+ start:meh[3],
+ oldlength:meh[2],
+ oldlines:[],
+ newlength:meh[4],
+ newlines:[]
+ });
+ } else if(diffstr[i][0] === '+') {
+ diff[0].newlines.push(diffstr[i].substr(1));
+ } else if(diffstr[i][0] === '-') {
+ diff[0].oldlines.push(diffstr[i].substr(1));
+ } else if(diffstr[i][0] === ' ') {
+ diff[0].newlines.push(diffstr[i].substr(1));
+ diff[0].oldlines.push(diffstr[i].substr(1));
+ } else if(diffstr[i][0] === '\\') {
+ if (diffstr[i-1][0] === '+') {
+ remEOFNL = true;
+ } else if(diffstr[i-1][0] === '-') {
+ addEOFNL = true;
+ }
+ }
+ }
+
+ var str = oldStr.split('\n');
+ for (var i = diff.length - 1; i >= 0; i--) {
+ var d = diff[i];
+ for (var j = 0; j < d.oldlength; j++) {
+ if(str[d.start-1+j] !== d.oldlines[j]) {
+ return false;
+ }
+ }
+ Array.prototype.splice.apply(str,[d.start-1,+d.oldlength].concat(d.newlines));
+ }
+
+ if (remEOFNL) {
+ while (!str[str.length-1]) {
+ str.pop();
+ }
+ } else if (addEOFNL) {
+ str.push('');
+ }
+ return str.join('\n');
+ },
+
+ convertChangesToXML: function(changes){
+ var ret = [];
+ for ( var i = 0; i < changes.length; i++) {
+ var change = changes[i];
+ if (change.added) {
+ ret.push('');
+ } else if (change.removed) {
+ ret.push('');
+ }
+
+ ret.push(escapeHTML(change.value));
+
+ if (change.added) {
+ ret.push('');
+ } else if (change.removed) {
+ ret.push('');
+ }
+ }
+ return ret.join('');
+ },
+
+ // See: http://code.google.com/p/google-diff-match-patch/wiki/API
+ convertChangesToDMP: function(changes){
+ var ret = [], change;
+ for ( var i = 0; i < changes.length; i++) {
+ change = changes[i];
+ ret.push([(change.added ? 1 : change.removed ? -1 : 0), change.value]);
+ }
+ return ret;
+ }
+ };
+})();
+
+if (typeof module !== 'undefined') {
+ module.exports = JsDiff;
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/atom-diff/package.json b/node_modules/basarat-text-buffer/node_modules/atom-diff/package.json
new file mode 100644
index 000000000..6042cde38
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/atom-diff/package.json
@@ -0,0 +1,51 @@
+{
+ "name": "atom-diff",
+ "version": "2.0.0",
+ "description": "A javascript text diff implementation.",
+ "keywords": [
+ "diff",
+ "javascript"
+ ],
+ "maintainers": [
+ {
+ "name": "Kevin Decker",
+ "email": "kpdecker@gmail.com",
+ "url": "http://incaseofstairs.com"
+ }
+ ],
+ "bugs": {
+ "url": "http://github.com/atom/jsdiff/issues",
+ "email": "kpdecker@gmail.com"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://github.com/atom/jsdiff/blob/master/LICENSE"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/atom/jsdiff.git"
+ },
+ "engines": {
+ "node": ">=0.3.1"
+ },
+ "main": "./diff",
+ "scripts": {
+ "test": "mocha test/*.js"
+ },
+ "dependencies": {},
+ "devDependencies": {
+ "mocha": "~1.6",
+ "should": "~1.2"
+ },
+ "optionalDependencies": {},
+ "files": [
+ "diff.js"
+ ],
+ "readme": "# jsdiff\n\n[](http://travis-ci.org/kpdecker/jsdiff)\n\nA javascript text differencing implementation.\n\nBased on the algorithm proposed in\n[\"An O(ND) Difference Algorithm and its Variations\" (Myers, 1986)](http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927).\n\n## Installation\n\n npm install diff\n\nor\n\n git clone git://github.com/kpdecker/jsdiff.git\n\n## API\n\n* JsDiff.diffChars(oldStr, newStr)\n Diffs two blocks of text, comparing character by character.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffWords(oldStr, newStr)\n Diffs two blocks of text, comparing word by word.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffLines(oldStr, newStr)\n Diffs two blocks of text, comparing line by line.\n\n Returns a list of change objects (See below).\n\n* JsDiff.diffCss(oldStr, newStr)\n Diffs two blocks of text, comparing CSS tokens.\n\n Returns a list of change objects (See below).\n\n* JsDiff.createPatch(fileName, oldStr, newStr, oldHeader, newHeader)\n Creates a unified diff patch.\n\n Parameters:\n * fileName : String to be output in the filename sections of the patch\n * oldStr : Original string value\n * newStr : New string value\n * oldHeader : Additional information to include in the old file header\n * newHeader : Additional information to include in thew new file header\n\n* JsDiff.applyPatch(oldStr, diffStr)\n Applies a unified diff patch.\n\n Return a string containing new version of provided data.\n\n* convertChangesToXML(changes)\n Converts a list of changes to a serialized XML format\n\n### Change Objects\nMany of the methods above return change objects. These objects are consist of the following fields:\n\n* value: Text content\n* added: True if the value was inserted into the new string\n* removed: True of the value was removed from the old string\n\nNote that some cases may omit a particular flag field. Comparison on the flag fields should always be done in a truthy or falsy manner.\n\n## [Example](http://kpdecker.github.com/jsdiff)\n\n## License\n\nSoftware License Agreement (BSD License)\n\nCopyright (c) 2009-2011, Kevin Decker kpdecker@gmail.com\n\nAll rights reserved.\n\nRedistribution and use of this software in source and binary forms, with or without modification,\nare permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above\n copyright notice, this list of conditions and the\n following disclaimer.\n\n* Redistributions in binary form must reproduce the above\n copyright notice, this list of conditions and the\n following disclaimer in the documentation and/or other\n materials provided with the distribution.\n\n* Neither the name of Kevin Decker nor the names of its\n contributors may be used to endorse or promote products\n derived from this software without specific prior\n written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR\nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\nCONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER\nIN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT\nOF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/atom/jsdiff",
+ "_id": "atom-diff@2.0.0",
+ "_from": "atom-diff@^2"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/delegato/LICENSE.md
new file mode 100644
index 000000000..493db50ed
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/README.md b/node_modules/basarat-text-buffer/node_modules/delegato/README.md
new file mode 100644
index 000000000..d5aee074e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/README.md
@@ -0,0 +1,23 @@
+# delegato [](https://travis-ci.org/atom/delegato)
+
+## Delegate Methods
+
+```coffee
+Delegato = require 'delegato'
+
+class Ship
+ Delegato.includeInto(this)
+
+ @delegatesMethods 'dropAnchor', 'raiseAnchor', toProperty: 'winch'
+ @delegatesMethod 'leavePort', toMethod: 'getCaptain'
+```
+
+## Delegate Properties
+
+```coffee
+class MyClass
+ Delegato.includeInto(this)
+
+ @delegatesProperty 'steamPressure', toProperty: 'engineRoom'
+ @delegatesProperties 'heading', 'speed', toMethod: 'getVelocity'
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/lib/delegator.js b/node_modules/basarat-text-buffer/node_modules/delegato/lib/delegator.js
new file mode 100644
index 000000000..073751475
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/lib/delegator.js
@@ -0,0 +1,99 @@
+(function() {
+ var Delegator, Mixin, _ref,
+ __hasProp = {}.hasOwnProperty,
+ __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; },
+ __slice = [].slice;
+
+ Mixin = require('mixto');
+
+ module.exports = Delegator = (function(_super) {
+ __extends(Delegator, _super);
+
+ function Delegator() {
+ _ref = Delegator.__super__.constructor.apply(this, arguments);
+ return _ref;
+ }
+
+ Delegator.delegatesProperties = function() {
+ var propertyName, propertyNames, toMethod, toProperty, _arg, _i, _j, _len, _results,
+ _this = this;
+ propertyNames = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), _arg = arguments[_i++];
+ toProperty = _arg.toProperty, toMethod = _arg.toMethod;
+ _results = [];
+ for (_j = 0, _len = propertyNames.length; _j < _len; _j++) {
+ propertyName = propertyNames[_j];
+ _results.push((function(propertyName) {
+ return Object.defineProperty(_this.prototype, propertyName, (function() {
+ if (toProperty != null) {
+ return {
+ get: function() {
+ return this[toProperty][propertyName];
+ },
+ set: function(value) {
+ return this[toProperty][propertyName] = value;
+ }
+ };
+ } else if (toMethod != null) {
+ return {
+ get: function() {
+ return this[toMethod]()[propertyName];
+ },
+ set: function(value) {
+ return this[toMethod]()[propertyName] = value;
+ }
+ };
+ } else {
+ throw new Error("No delegation target specified");
+ }
+ })());
+ })(propertyName));
+ }
+ return _results;
+ };
+
+ Delegator.delegatesMethods = function() {
+ var methodName, methodNames, toMethod, toProperty, _arg, _i, _j, _len, _results,
+ _this = this;
+ methodNames = 2 <= arguments.length ? __slice.call(arguments, 0, _i = arguments.length - 1) : (_i = 0, []), _arg = arguments[_i++];
+ toProperty = _arg.toProperty, toMethod = _arg.toMethod;
+ _results = [];
+ for (_j = 0, _len = methodNames.length; _j < _len; _j++) {
+ methodName = methodNames[_j];
+ _results.push((function(methodName) {
+ if (toProperty != null) {
+ return _this.prototype[methodName] = function() {
+ var args, _ref1;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return (_ref1 = this[toProperty])[methodName].apply(_ref1, args);
+ };
+ } else if (toMethod != null) {
+ return _this.prototype[methodName] = function() {
+ var args, _ref1;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return (_ref1 = this[toMethod]())[methodName].apply(_ref1, args);
+ };
+ } else {
+ throw new Error("No delegation target specified");
+ }
+ })(methodName));
+ }
+ return _results;
+ };
+
+ Delegator.delegatesProperty = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return this.delegatesProperties.apply(this, args);
+ };
+
+ Delegator.delegatesMethod = function() {
+ var args;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ return this.delegatesMethods.apply(this, args);
+ };
+
+ return Delegator;
+
+ })(Mixin);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/LICENSE.md
new file mode 100644
index 000000000..493db50ed
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/README.md b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/README.md
new file mode 100644
index 000000000..7c450e3ec
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/README.md
@@ -0,0 +1,36 @@
+# Mixto: A simple mixin superclass [](https://travis-ci.org/atom/mixto)
+
+To create a mixin, subclass mixto:
+
+```coffee
+Mixin = require 'mixto'
+
+class MyMixin extends Mixin
+ @classMethod: -> console.log("foo")
+ instanceMethod: -> console.log("bar")
+```
+
+Then mix into classes with `.includeInto`:
+
+```coffee
+class MyClass
+ MyMixin.includeInto(this)
+
+MyClass.classMethod()
+(new MyClass).instanceMethod()
+```
+
+Or extend individual objects with `.extend`:
+
+```coffee-script
+myObject = {a: 1, b: 2}
+MyMixin.extend(myObject)
+myObject.instanceMethod()
+```
+
+Or build standalone instances of your 'mixin':
+
+```
+standalone = new MyMixin
+standalone.instanceMethod()
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/lib/mixin.js b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/lib/mixin.js
new file mode 100644
index 000000000..a6fdd4f97
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/lib/mixin.js
@@ -0,0 +1,51 @@
+(function() {
+ var ExcludedClassProperties, ExcludedPrototypeProperties, Mixin, name;
+
+ module.exports = Mixin = (function() {
+ Mixin.includeInto = function(constructor) {
+ var name, value, _ref;
+ this.extend(constructor.prototype);
+ for (name in this) {
+ value = this[name];
+ if (ExcludedClassProperties.indexOf(name) === -1) {
+ if (!constructor.hasOwnProperty(name)) {
+ constructor[name] = value;
+ }
+ }
+ }
+ return (_ref = this.included) != null ? _ref.call(constructor) : void 0;
+ };
+
+ Mixin.extend = function(object) {
+ var name, _i, _len, _ref, _ref1;
+ _ref = Object.getOwnPropertyNames(this.prototype);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ name = _ref[_i];
+ if (ExcludedPrototypeProperties.indexOf(name) === -1) {
+ if (!object.hasOwnProperty(name)) {
+ object[name] = this.prototype[name];
+ }
+ }
+ }
+ return (_ref1 = this.prototype.extended) != null ? _ref1.call(object) : void 0;
+ };
+
+ function Mixin() {
+ if (typeof this.extended === "function") {
+ this.extended();
+ }
+ }
+
+ return Mixin;
+
+ })();
+
+ ExcludedClassProperties = ['__super__'];
+
+ for (name in Mixin) {
+ ExcludedClassProperties.push(name);
+ }
+
+ ExcludedPrototypeProperties = ['constructor', 'extended'];
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/package.json b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/package.json
new file mode 100644
index 000000000..327bdea62
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/node_modules/mixto/package.json
@@ -0,0 +1,45 @@
+{
+ "name": "mixto",
+ "version": "1.0.0",
+ "description": "A mixin superclass. Its subclasses have `.extend` and `.includeInto` methods to mix behavior into other objects and classes.",
+ "main": "lib/mixin",
+ "scripts": {
+ "prepublish": "grunt clean coffee lint",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/atom/mixto"
+ },
+ "keywords": [
+ "mixin",
+ "trait"
+ ],
+ "bugs": {
+ "url": "https://github.com/atom/mixto/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/mixto/raw/master/LICENSE.md"
+ }
+ ],
+ "devDependencies": {
+ "coffee-script": "~1.6.3",
+ "jasmine-focused": "~0.19.0",
+ "grunt-contrib-coffee": "~0.7.0",
+ "grunt-cli": "~0.1.8",
+ "grunt": "~0.4.1",
+ "grunt-shell": "~0.2.2",
+ "grunt-coffeelint": "0.0.6",
+ "rimraf": "~2.2.2"
+ },
+ "author": {
+ "name": "Nathan Sobo"
+ },
+ "readme": "# Mixto: A simple mixin superclass [](https://travis-ci.org/atom/mixto)\n\nTo create a mixin, subclass mixto:\n\n```coffee\nMixin = require 'mixto'\n\nclass MyMixin extends Mixin\n @classMethod: -> console.log(\"foo\")\n instanceMethod: -> console.log(\"bar\")\n```\n\nThen mix into classes with `.includeInto`:\n\n```coffee\nclass MyClass\n MyMixin.includeInto(this)\n \nMyClass.classMethod()\n(new MyClass).instanceMethod()\n```\n\nOr extend individual objects with `.extend`:\n\n```coffee-script\nmyObject = {a: 1, b: 2}\nMyMixin.extend(myObject)\nmyObject.instanceMethod()\n```\n\nOr build standalone instances of your 'mixin':\n\n```\nstandalone = new MyMixin\nstandalone.instanceMethod()\n```\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/atom/mixto",
+ "_id": "mixto@1.0.0",
+ "_from": "mixto@1.x"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/delegato/package.json b/node_modules/basarat-text-buffer/node_modules/delegato/package.json
new file mode 100644
index 000000000..331d2bd11
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/delegato/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "delegato",
+ "version": "1.0.0",
+ "description": "A mixin that provides a @delegates class method.",
+ "main": "lib/delegator.js",
+ "scripts": {
+ "test": "grunt test",
+ "prepublish": "grunt clean lint coffee"
+ },
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/atom/delegato.git"
+ },
+ "bugs": {
+ "url": "https://github.com/atom/delegato/issues"
+ },
+ "homepage": "http://atom.github.io/delegato",
+ "keywords": [
+ "delegate",
+ "delegates"
+ ],
+ "author": {
+ "name": "Nathan Sobo"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/delegato/raw/master/LICENSE.md"
+ }
+ ],
+ "dependencies": {
+ "mixto": "1.x"
+ },
+ "devDependencies": {
+ "jasmine-focused": "~0.19.0",
+ "grunt-contrib-coffee": "~0.7.0",
+ "grunt-cli": "~0.1.8",
+ "grunt": "~0.4.1",
+ "grunt-shell": "~0.2.2",
+ "grunt-coffeelint": "0.0.6",
+ "rimraf": "~2.2.2"
+ },
+ "readme": "# delegato [](https://travis-ci.org/atom/delegato)\n\n## Delegate Methods\n\n```coffee\nDelegato = require 'delegato'\n\nclass Ship\n Delegato.includeInto(this)\n \n @delegatesMethods 'dropAnchor', 'raiseAnchor', toProperty: 'winch'\n @delegatesMethod 'leavePort', toMethod: 'getCaptain'\n```\n\n## Delegate Properties\n\n```coffee\nclass MyClass\n Delegato.includeInto(this)\n \n @delegatesProperty 'steamPressure', toProperty: 'engineRoom'\n @delegatesProperties 'heading', 'speed', toMethod: 'getVelocity'\n```\n",
+ "readmeFilename": "README.md",
+ "_id": "delegato@1.0.0",
+ "_from": "delegato@^1.0.0"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/event-kit/LICENSE.md
new file mode 100644
index 000000000..4d231b456
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2014 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/README.md b/node_modules/basarat-text-buffer/node_modules/event-kit/README.md
new file mode 100644
index 000000000..7840baab1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/README.md
@@ -0,0 +1,68 @@
+# event-kit [](https://travis-ci.org/atom/event-kit)
+
+This is a simple library for implementing event subscription APIs.
+
+## Implementing Event Subscription APIs
+
+```coffee
+{Emitter} = require 'event-kit'
+
+class User
+ constructor: ->
+ @emitter = new Emitter
+
+ onDidChangeName: (callback) ->
+ @emitter.on 'did-change-name', callback
+
+ setName: (name) ->
+ if name isnt @name
+ @name = name
+ @emitter.emit 'did-change-name', name
+ @name
+
+ destroy: ->
+ @emitter.dispose()
+```
+
+In the example above, we implement `::onDidChangeName` on the user object, which
+will register callbacks to be invoked whenever the user's name changes. To do
+so, we make use of an internal `Emitter` instance. We use `::on` to subscribe
+the given callback in `::onDidChangeName`, and `::emit` in `::setName` to notify
+subscribers. Finally, when the `User` instance is destroyed we call `::dispose`
+on the emitter to unsubscribe all subscribers.
+
+## Consuming Event Subscription APIs
+
+`Emitter::on` returns a `Disposable` instance, which has a `::dispose` method.
+To unsubscribe, simply call dispose on the returned object.
+
+```coffee
+subscription = user.onDidChangeName (name) -> console.log("My name is #{name}")
+# Later, to unsubscribe...
+subscription.dispose()
+```
+
+You can also use `CompositeDisposable` to combine disposable instances together.
+
+```coffee
+{CompositeDisposable} = require 'event-kit'
+
+subscriptions = new CompositeDisposable
+subscriptions.add user1.onDidChangeName (name) -> console.log("User 1: #{name}")
+subscriptions.add user2.onDidChangeName (name) -> console.log("User 2: #{name}")
+
+# Later, to unsubscribe from *both*...
+subscriptions.dispose()
+```
+
+## Creating Your Own Disposables
+
+Disposables are convenient ways to represent a resource you will no longer
+need at some point. You can instantiate a disposable with an action to take when
+no longer needed.
+
+```coffee
+{Disposable} = require 'event-kit'
+
+disposable = new Disposable => @destroyResource()
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/api.json b/node_modules/basarat-text-buffer/node_modules/event-kit/api.json
new file mode 100644
index 000000000..1cd93ad79
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/api.json
@@ -0,0 +1,255 @@
+{
+ "classes": {
+ "CompositeDisposable": {
+ "name": "CompositeDisposable",
+ "filename": "src/composite-disposable.coffee",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L22",
+ "sections": [
+ {
+ "name": "Construction and Destruction",
+ "description": ""
+ },
+ {
+ "name": "Managing Disposables",
+ "description": ""
+ }
+ ],
+ "classMethods": [],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L30",
+ "visibility": "Public",
+ "summary": "Construct an instance, optionally with one or more disposables ",
+ "description": "Construct an instance, optionally with one or more disposables "
+ },
+ {
+ "name": "dispose",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L37",
+ "visibility": "Public",
+ "summary": "Dispose all disposables added to this composite disposable.",
+ "description": "Dispose all disposables added to this composite disposable.\n\nIf this object has already been disposed, this method has no effect. "
+ },
+ {
+ "name": "add",
+ "sectionName": "Managing Disposables",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L53",
+ "visibility": "Public",
+ "summary": "Add a disposable to be disposed when the composite is disposed.",
+ "description": "Add a disposable to be disposed when the composite is disposed.\n\nIf this object has already been disposed, this method has no effect.",
+ "arguments": [
+ {
+ "name": "disposable",
+ "description": "{Disposable} instance or any object with a `.dispose()` method. ",
+ "type": "Disposable",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "remove",
+ "sectionName": "Managing Disposables",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L61",
+ "visibility": "Public",
+ "summary": "Remove a previously added disposable.",
+ "description": "Remove a previously added disposable.",
+ "arguments": [
+ {
+ "name": "disposable",
+ "description": "{Disposable} instance or any object with a `.dispose()` method. ",
+ "type": "Disposable",
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "clear",
+ "sectionName": "Managing Disposables",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/composite-disposable.coffee#L67",
+ "visibility": "Public",
+ "summary": "Clear all disposables. They will not be disposed by the next call\nto dispose. ",
+ "description": "Clear all disposables. They will not be disposed by the next call\nto dispose. "
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Essential",
+ "summary": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group.",
+ "description": "An object that aggregates multiple {Disposable} instances together\ninto a single disposable, so they can all be disposed as a group.\n\nThese are very useful when subscribing to multiple events.",
+ "examples": [
+ {
+ "description": "",
+ "lang": "coffee",
+ "code": "{CompositeDisposable} = require 'atom'\n\nclass Something\n constructor: ->\n @disposables = new CompositeDisposable\n editor = atom.workspace.getActiveTextEditor()\n @disposables.add editor.onDidChange ->\n @disposables.add editor.onDidChangePath ->\n\n destroy: ->\n @disposables.dispose()",
+ "raw": "```coffee\n{CompositeDisposable} = require 'atom'\n\nclass Something\n constructor: ->\n @disposables = new CompositeDisposable\n editor = atom.workspace.getActiveTextEditor()\n @disposables.add editor.onDidChange ->\n @disposables.add editor.onDidChangePath ->\n\n destroy: ->\n @disposables.dispose()\n```"
+ }
+ ]
+ },
+ "Disposable": {
+ "name": "Disposable",
+ "filename": "src/disposable.coffee",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/disposable.coffee#L6",
+ "sections": [
+ {
+ "name": "Construction and Destruction",
+ "description": ""
+ }
+ ],
+ "classMethods": [],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/disposable.coffee#L17",
+ "visibility": "Public",
+ "summary": "Construct a Disposable",
+ "description": "Construct a Disposable",
+ "arguments": [
+ {
+ "name": "disposalAction",
+ "description": "An action to perform when {::dispose} is called for the first time. ",
+ "type": null,
+ "isOptional": false
+ }
+ ]
+ },
+ {
+ "name": "dispose",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/disposable.coffee#L24",
+ "visibility": "Public",
+ "summary": "Perform the disposal action, indicating that the resource associated\nwith this disposable is no longer needed.",
+ "description": "Perform the disposal action, indicating that the resource associated\nwith this disposable is no longer needed.\n\nYou can call this method more than once, but the disposal action will only\nbe performed the first time. "
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Essential",
+ "summary": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. ",
+ "description": "A handle to a resource that can be disposed. For example,\n{Emitter::on} returns disposables representing subscriptions. "
+ },
+ "Emitter": {
+ "name": "Emitter",
+ "filename": "src/emitter.coffee",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L25",
+ "sections": [
+ {
+ "name": "Construction and Destruction",
+ "description": ""
+ },
+ {
+ "name": "Event Subscription",
+ "description": ""
+ },
+ {
+ "name": "Event Emission",
+ "description": ""
+ }
+ ],
+ "classMethods": [],
+ "instanceMethods": [
+ {
+ "name": "constructor",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L37",
+ "visibility": "Public",
+ "summary": "Construct an emitter.",
+ "description": "Construct an emitter.\n\n```coffee\n@emitter = new Emitter()\n```"
+ },
+ {
+ "name": "dispose",
+ "sectionName": "Construction and Destruction",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L41",
+ "visibility": "Public",
+ "summary": "Unsubscribe all handlers. ",
+ "description": "Unsubscribe all handlers. "
+ },
+ {
+ "name": "on",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L58",
+ "visibility": "Public",
+ "summary": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
+ "description": "Register the given handler function to be invoked whenever events by\nthe given name are emitted via {::emit}.",
+ "arguments": [
+ {
+ "name": "eventName",
+ "description": "{String} naming the event that you want to invoke the handler when emitted.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "handler",
+ "description": "{Function} to invoke when {::emit} is called with the given event name.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "preempt",
+ "sectionName": "Event Subscription",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L92",
+ "visibility": "Public",
+ "summary": "Register the given handler function to be invoked *before* all\nother handlers existing at the time of subscription whenever events by the\ngiven name are emitted via {::emit}.",
+ "description": "Register the given handler function to be invoked *before* all\nother handlers existing at the time of subscription whenever events by the\ngiven name are emitted via {::emit}.\n\nUse this method when you need to be the first to handle a given event. This\ncould be required when a data structure in a parent object needs to be\nupdated before third-party event handlers registered on a child object via a\npublic API are invoked. Your handler could itself be preempted via\nsubsequent calls to this method, but this can be controlled by keeping\nmethods based on `::preempt` private.",
+ "arguments": [
+ {
+ "name": "eventName",
+ "description": "{String} naming the event that you want to invoke the handler when emitted.",
+ "type": "String",
+ "isOptional": false
+ },
+ {
+ "name": "handler",
+ "description": "{Function} to invoke when {::emit} is called with the given event name.",
+ "type": "Function",
+ "isOptional": false
+ }
+ ],
+ "returnValues": [
+ {
+ "type": "Disposable",
+ "description": "Returns a {Disposable} on which `.dispose()` can be called to unsubscribe."
+ }
+ ]
+ },
+ {
+ "name": "emit",
+ "sectionName": "Event Emission",
+ "srcUrl": "https://github.com/atom/event-kit/blob/v1.0.3/src/emitter.coffee#L114",
+ "visibility": "Public",
+ "summary": "Invoke handlers registered via {::on} for the given event name.",
+ "description": "Invoke handlers registered via {::on} for the given event name.",
+ "arguments": [
+ {
+ "name": "eventName",
+ "description": "The name of the event to emit. Handlers registered with {::on} for the same name will be invoked.",
+ "type": null,
+ "isOptional": false
+ },
+ {
+ "name": "value",
+ "description": "Callbacks will be invoked with this value as an argument. ",
+ "type": null,
+ "isOptional": false
+ }
+ ]
+ }
+ ],
+ "classProperties": [],
+ "instanceProperties": [],
+ "visibility": "Essential",
+ "summary": "Utility class to be used when implementing event-based APIs that\nallows for handlers registered via `::on` to be invoked with calls to\n`::emit`. Instances of this class are intended to be used internally by\nclasses that expose an event-based API.",
+ "description": "Utility class to be used when implementing event-based APIs that\nallows for handlers registered via `::on` to be invoked with calls to\n`::emit`. Instances of this class are intended to be used internally by\nclasses that expose an event-based API.\n\nFor example:\n\n```coffee\nclass User\n constructor: ->\n @emitter = new Emitter\n\n onDidChangeName: (callback) ->\n @emitter.on 'did-change-name', callback\n\n setName: (name) ->\n if name isnt @name\n @name = name\n @emitter.emit 'did-change-name', name\n @name\n```"
+ }
+ }
+}
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/lib/composite-disposable.js b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/composite-disposable.js
new file mode 100644
index 000000000..3af310a75
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/composite-disposable.js
@@ -0,0 +1,60 @@
+(function() {
+ var CompositeDisposable;
+
+ module.exports = CompositeDisposable = (function() {
+ CompositeDisposable.prototype.disposed = false;
+
+
+ /*
+ Section: Construction and Destruction
+ */
+
+ function CompositeDisposable() {
+ var disposable, _i, _len;
+ this.disposables = [];
+ for (_i = 0, _len = arguments.length; _i < _len; _i++) {
+ disposable = arguments[_i];
+ this.add(disposable);
+ }
+ }
+
+ CompositeDisposable.prototype.dispose = function() {
+ var disposable, _results;
+ if (!this.disposed) {
+ this.disposed = true;
+ _results = [];
+ while (disposable = this.disposables.shift()) {
+ _results.push(disposable.dispose());
+ }
+ return _results;
+ }
+ };
+
+
+ /*
+ Section: Managing Disposables
+ */
+
+ CompositeDisposable.prototype.add = function(disposable) {
+ if (!this.disposed) {
+ return this.disposables.push(disposable);
+ }
+ };
+
+ CompositeDisposable.prototype.remove = function(disposable) {
+ var index;
+ index = this.disposables.indexOf(disposable);
+ if (index !== -1) {
+ return this.disposables.splice(index, 1);
+ }
+ };
+
+ CompositeDisposable.prototype.clear = function() {
+ return this.disposables.length = 0;
+ };
+
+ return CompositeDisposable;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/lib/disposable.js b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/disposable.js
new file mode 100644
index 000000000..413358131
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/disposable.js
@@ -0,0 +1,37 @@
+(function() {
+ var Disposable, Grim;
+
+ Grim = require('grim');
+
+ module.exports = Disposable = (function() {
+ Disposable.prototype.disposed = false;
+
+
+ /*
+ Section: Construction and Destruction
+ */
+
+ function Disposable(disposalAction) {
+ this.disposalAction = disposalAction;
+ }
+
+ Disposable.prototype.dispose = function() {
+ if (!this.disposed) {
+ this.disposed = true;
+ if (typeof this.disposalAction === "function") {
+ this.disposalAction();
+ }
+ return this.disposalAction = null;
+ }
+ };
+
+ Disposable.prototype.off = function() {
+ Grim.deprecate("Use ::dispose to cancel subscriptions instead of ::off");
+ return this.dispose();
+ };
+
+ return Disposable;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/lib/emitter.js b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/emitter.js
new file mode 100644
index 000000000..eb5872cc6
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/emitter.js
@@ -0,0 +1,91 @@
+(function() {
+ var Disposable, Emitter;
+
+ Disposable = require('./disposable');
+
+ module.exports = Emitter = (function() {
+ Emitter.prototype.isDisposed = false;
+
+
+ /*
+ Section: Construction and Destruction
+ */
+
+ function Emitter() {
+ this.handlersByEventName = {};
+ }
+
+ Emitter.prototype.dispose = function() {
+ this.handlersByEventName = null;
+ return this.isDisposed = true;
+ };
+
+
+ /*
+ Section: Event Subscription
+ */
+
+ Emitter.prototype.on = function(eventName, handler, unshift) {
+ var currentHandlers;
+ if (unshift == null) {
+ unshift = false;
+ }
+ if (this.isDisposed) {
+ throw new Error("Emitter has been disposed");
+ }
+ if (typeof handler !== 'function') {
+ throw new Error("Handler must be a function");
+ }
+ if (currentHandlers = this.handlersByEventName[eventName]) {
+ if (unshift) {
+ this.handlersByEventName[eventName] = [handler].concat(currentHandlers);
+ } else {
+ this.handlersByEventName[eventName] = currentHandlers.concat(handler);
+ }
+ } else {
+ this.handlersByEventName[eventName] = [handler];
+ }
+ return new Disposable(this.off.bind(this, eventName, handler));
+ };
+
+ Emitter.prototype.preempt = function(eventName, handler) {
+ return this.on(eventName, handler, true);
+ };
+
+ Emitter.prototype.off = function(eventName, handlerToRemove) {
+ var handler, newHandlers, oldHandlers, _i, _len;
+ if (this.isDisposed) {
+ return;
+ }
+ if (oldHandlers = this.handlersByEventName[eventName]) {
+ newHandlers = [];
+ for (_i = 0, _len = oldHandlers.length; _i < _len; _i++) {
+ handler = oldHandlers[_i];
+ if (handler !== handlerToRemove) {
+ newHandlers.push(handler);
+ }
+ }
+ return this.handlersByEventName[eventName] = newHandlers;
+ }
+ };
+
+
+ /*
+ Section: Event Emission
+ */
+
+ Emitter.prototype.emit = function(eventName, value) {
+ var handler, handlers, _i, _len, _ref;
+ if (handlers = (_ref = this.handlersByEventName) != null ? _ref[eventName] : void 0) {
+ for (_i = 0, _len = handlers.length; _i < _len; _i++) {
+ handler = handlers[_i];
+ handler(value);
+ }
+ }
+ };
+
+ return Emitter;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/lib/event-kit.js b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/event-kit.js
new file mode 100644
index 000000000..8250ea048
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/lib/event-kit.js
@@ -0,0 +1,8 @@
+(function() {
+ exports.Emitter = require('./emitter');
+
+ exports.Disposable = require('./disposable');
+
+ exports.CompositeDisposable = require('./composite-disposable');
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/event-kit/package.json b/node_modules/basarat-text-buffer/node_modules/event-kit/package.json
new file mode 100644
index 000000000..229ac13bf
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/event-kit/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "event-kit",
+ "version": "1.0.3",
+ "description": "Simple library for implementing and consuming evented APIs",
+ "main": "./lib/event-kit",
+ "scripts": {
+ "prepublish": "grunt clean lint coffee shell:update-atomdoc atomdoc",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/atom/event-kit.git"
+ },
+ "bugs": {
+ "url": "https://github.com/atom/event-kit/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/event-kit/raw/master/LICENSE.md"
+ }
+ ],
+ "dependencies": {
+ "grim": "^1.0.0"
+ },
+ "devDependencies": {
+ "coffee-cache": "^0.2.0",
+ "coffee-script": "^1.7.0",
+ "grunt": "^0.4.1",
+ "grunt-atomdoc": "^1.0.0",
+ "grunt-cli": "^0.1.8",
+ "grunt-coffeelint": "^0.0.6",
+ "grunt-contrib-coffee": "^0.9.0",
+ "grunt-shell": "^0.2.2",
+ "jasmine-focused": "^1.0.4",
+ "rimraf": "^2.2.2",
+ "temp": "^0.6.0"
+ },
+ "readme": "# event-kit [](https://travis-ci.org/atom/event-kit)\n\nThis is a simple library for implementing event subscription APIs.\n\n## Implementing Event Subscription APIs\n\n```coffee\n{Emitter} = require 'event-kit'\n\nclass User\n constructor: ->\n @emitter = new Emitter\n\n onDidChangeName: (callback) ->\n @emitter.on 'did-change-name', callback\n\n setName: (name) ->\n if name isnt @name\n @name = name\n @emitter.emit 'did-change-name', name\n @name\n\n destroy: ->\n @emitter.dispose()\n```\n\nIn the example above, we implement `::onDidChangeName` on the user object, which\nwill register callbacks to be invoked whenever the user's name changes. To do\nso, we make use of an internal `Emitter` instance. We use `::on` to subscribe\nthe given callback in `::onDidChangeName`, and `::emit` in `::setName` to notify\nsubscribers. Finally, when the `User` instance is destroyed we call `::dispose`\non the emitter to unsubscribe all subscribers.\n\n## Consuming Event Subscription APIs\n\n`Emitter::on` returns a `Disposable` instance, which has a `::dispose` method.\nTo unsubscribe, simply call dispose on the returned object.\n\n```coffee\nsubscription = user.onDidChangeName (name) -> console.log(\"My name is #{name}\")\n# Later, to unsubscribe...\nsubscription.dispose()\n```\n\nYou can also use `CompositeDisposable` to combine disposable instances together.\n\n```coffee\n{CompositeDisposable} = require 'event-kit'\n\nsubscriptions = new CompositeDisposable\nsubscriptions.add user1.onDidChangeName (name) -> console.log(\"User 1: #{name}\")\nsubscriptions.add user2.onDidChangeName (name) -> console.log(\"User 2: #{name}\")\n\n# Later, to unsubscribe from *both*...\nsubscriptions.dispose()\n```\n\n## Creating Your Own Disposables\n\nDisposables are convenient ways to represent a resource you will no longer\nneed at some point. You can instantiate a disposable with an action to take when\nno longer needed.\n\n```coffee\n{Disposable} = require 'event-kit'\n\ndisposable = new Disposable => @destroyResource()\n```\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/atom/event-kit",
+ "_id": "event-kit@1.0.3",
+ "_from": "event-kit@^1.0.2"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/fs-plus/LICENSE.md
new file mode 100644
index 000000000..493db50ed
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/README.md b/node_modules/basarat-text-buffer/node_modules/fs-plus/README.md
new file mode 100644
index 000000000..377aa9194
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/README.md
@@ -0,0 +1,15 @@
+# fs plus [](https://travis-ci.org/atom/fs-plus)
+
+Yet another filesystem helper based on node's [fs](http://nodejs.org/api/fs.html)
+module. This library exports everything from node's fs module but with some
+extra helpers.
+
+## Using
+
+```sh
+npm install fs-plus
+```
+
+```coffee
+fs = require 'fs-plus'
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/lib/fs-plus.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/lib/fs-plus.js
new file mode 100644
index 000000000..6a58ca751
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/lib/fs-plus.js
@@ -0,0 +1,532 @@
+(function() {
+ var Module, async, fs, fsPlus, isPathValid, lstatSyncNoException, mkdirp, path, rimraf, statSyncNoException, _,
+ __slice = [].slice;
+
+ fs = require('fs');
+
+ Module = require('module');
+
+ path = require('path');
+
+ _ = require('underscore-plus');
+
+ async = require('async');
+
+ mkdirp = require('mkdirp');
+
+ rimraf = require('rimraf');
+
+ fsPlus = {
+ getHomeDirectory: function() {
+ if (process.platform === 'win32') {
+ return process.env.USERPROFILE;
+ } else {
+ return process.env.HOME;
+ }
+ },
+ absolute: function(relativePath) {
+ var e, homeDir;
+ if (relativePath == null) {
+ return null;
+ }
+ homeDir = fsPlus.getHomeDirectory();
+ if (relativePath === '~') {
+ relativePath = homeDir;
+ } else if (relativePath.indexOf('~/') === 0) {
+ relativePath = "" + homeDir + (relativePath.substring(1));
+ }
+ try {
+ return fs.realpathSync(relativePath);
+ } catch (_error) {
+ e = _error;
+ return relativePath;
+ }
+ },
+ normalize: function(pathToNormalize) {
+ var home, normalizedPath;
+ if (pathToNormalize == null) {
+ return null;
+ }
+ normalizedPath = path.normalize(pathToNormalize.toString());
+ if (home = fsPlus.getHomeDirectory()) {
+ if (normalizedPath === '~') {
+ normalizedPath = home;
+ } else if (normalizedPath.indexOf("~" + path.sep) === 0) {
+ normalizedPath = "" + home + (normalizedPath.substring(1));
+ }
+ }
+ return normalizedPath;
+ },
+ getAppDataDirectory: function() {
+ switch (process.platform) {
+ case 'darwin':
+ return fsPlus.absolute('~/Library/Application Support');
+ case 'linux':
+ return '/var/lib';
+ case 'win32':
+ return process.env.APPDATA;
+ default:
+ return null;
+ }
+ },
+ isAbsolute: function(pathToCheck) {
+ if (pathToCheck == null) {
+ pathToCheck = '';
+ }
+ if (process.platform === 'win32') {
+ if (pathToCheck[1] === ':') {
+ return true;
+ }
+ if (pathToCheck[0] === '\\' && pathToCheck[1] === '\\') {
+ return true;
+ }
+ } else {
+ return pathToCheck[0] === '/';
+ }
+ return false;
+ },
+ existsSync: function(pathToCheck) {
+ return isPathValid(pathToCheck) && (statSyncNoException(pathToCheck) !== false);
+ },
+ isDirectorySync: function(directoryPath) {
+ var stat;
+ if (!isPathValid(directoryPath)) {
+ return false;
+ }
+ if (stat = statSyncNoException(directoryPath)) {
+ return stat.isDirectory();
+ } else {
+ return false;
+ }
+ },
+ isDirectory: function(directoryPath, done) {
+ if (!isPathValid(directoryPath)) {
+ return done(false);
+ }
+ return fs.exists(directoryPath, function(exists) {
+ if (exists) {
+ return fs.stat(directoryPath, function(error, stat) {
+ if (error != null) {
+ return done(false);
+ } else {
+ return done(stat.isDirectory());
+ }
+ });
+ } else {
+ return done(false);
+ }
+ });
+ },
+ isFileSync: function(filePath) {
+ var stat;
+ if (!isPathValid(filePath)) {
+ return false;
+ }
+ if (stat = statSyncNoException(filePath)) {
+ return stat.isFile();
+ } else {
+ return false;
+ }
+ },
+ isSymbolicLinkSync: function(symlinkPath) {
+ var stat;
+ if (!isPathValid(symlinkPath)) {
+ return false;
+ }
+ if (stat = lstatSyncNoException(symlinkPath)) {
+ return stat.isSymbolicLink();
+ } else {
+ return false;
+ }
+ },
+ isSymbolicLink: function(symlinkPath, callback) {
+ if (isPathValid(symlinkPath)) {
+ return fs.lstat(symlinkPath, function(error, stat) {
+ return typeof callback === "function" ? callback((stat != null) && stat.isSymbolicLink()) : void 0;
+ });
+ } else {
+ return process.nextTick(function() {
+ return typeof callback === "function" ? callback(false) : void 0;
+ });
+ }
+ },
+ isExecutableSync: function(pathToCheck) {
+ var stat;
+ if (!isPathValid(pathToCheck)) {
+ return false;
+ }
+ if (stat = statSyncNoException(pathToCheck)) {
+ return (stat.mode & 0x1ff & 1) !== 0;
+ } else {
+ return false;
+ }
+ },
+ getSizeSync: function(pathToCheck) {
+ var _ref;
+ if (isPathValid(pathToCheck)) {
+ return (_ref = statSyncNoException(pathToCheck).size) != null ? _ref : -1;
+ } else {
+ return -1;
+ }
+ },
+ listSync: function(rootPath, extensions) {
+ var paths;
+ if (!fsPlus.isDirectorySync(rootPath)) {
+ return [];
+ }
+ paths = fs.readdirSync(rootPath);
+ if (extensions) {
+ paths = fsPlus.filterExtensions(paths, extensions);
+ }
+ paths = paths.sort(function(a, b) {
+ return a.toLowerCase().localeCompare(b.toLowerCase());
+ });
+ paths = paths.map(function(childPath) {
+ return path.join(rootPath, childPath);
+ });
+ return paths;
+ },
+ list: function() {
+ var done, extensions, rest, rootPath;
+ rootPath = arguments[0], rest = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ if (rest.length > 1) {
+ extensions = rest.shift();
+ }
+ done = rest.shift();
+ return fs.readdir(rootPath, function(error, paths) {
+ if (error != null) {
+ return done(error);
+ } else {
+ if (extensions) {
+ paths = fsPlus.filterExtensions(paths, extensions);
+ }
+ paths = paths.sort(function(a, b) {
+ return a.toLowerCase().localeCompare(b.toLowerCase());
+ });
+ paths = paths.map(function(childPath) {
+ return path.join(rootPath, childPath);
+ });
+ return done(null, paths);
+ }
+ });
+ },
+ filterExtensions: function(paths, extensions) {
+ extensions = extensions.map(function(ext) {
+ if (ext === '') {
+ return ext;
+ } else {
+ return '.' + ext.replace(/^\./, '');
+ }
+ });
+ return paths.filter(function(pathToCheck) {
+ return _.include(extensions, path.extname(pathToCheck));
+ });
+ },
+ listTreeSync: function(rootPath) {
+ var onPath, paths;
+ paths = [];
+ onPath = function(childPath) {
+ paths.push(childPath);
+ return true;
+ };
+ fsPlus.traverseTreeSync(rootPath, onPath, onPath);
+ return paths;
+ },
+ moveSync: function(source, target) {
+ return fs.renameSync(source, target);
+ },
+ removeSync: function(pathToRemove) {
+ return rimraf.sync(pathToRemove);
+ },
+ writeFileSync: function(filePath, content, options) {
+ mkdirp.sync(path.dirname(filePath));
+ return fs.writeFileSync(filePath, content, options);
+ },
+ writeFile: function(filePath, content, options, callback) {
+ callback = _.last(arguments);
+ return mkdirp(path.dirname(filePath), function(error) {
+ if (error != null) {
+ return typeof callback === "function" ? callback(error) : void 0;
+ } else {
+ return fs.writeFile(filePath, content, options, callback);
+ }
+ });
+ },
+ copy: function(sourcePath, destinationPath, done) {
+ return mkdirp(path.dirname(destinationPath), function(error) {
+ var destinationStream, sourceStream;
+ if (error != null) {
+ if (typeof done === "function") {
+ done(error);
+ }
+ return;
+ }
+ sourceStream = fs.createReadStream(sourcePath);
+ sourceStream.on('error', function(error) {
+ if (typeof done === "function") {
+ done(error);
+ }
+ return done = null;
+ });
+ destinationStream = fs.createWriteStream(destinationPath);
+ destinationStream.on('error', function(error) {
+ if (typeof done === "function") {
+ done(error);
+ }
+ return done = null;
+ });
+ destinationStream.on('close', function() {
+ if (typeof done === "function") {
+ done();
+ }
+ return done = null;
+ });
+ return sourceStream.pipe(destinationStream);
+ });
+ },
+ copySync: function(sourcePath, destinationPath) {
+ var content, destinationFilePath, source, sourceFilePath, sources, _i, _len, _results;
+ sources = fs.readdirSync(sourcePath);
+ mkdirp.sync(destinationPath);
+ _results = [];
+ for (_i = 0, _len = sources.length; _i < _len; _i++) {
+ source = sources[_i];
+ sourceFilePath = path.join(sourcePath, source);
+ destinationFilePath = path.join(destinationPath, source);
+ if (fsPlus.isDirectorySync(sourceFilePath)) {
+ _results.push(fsPlus.copySync(sourceFilePath, destinationFilePath));
+ } else {
+ content = fs.readFileSync(sourceFilePath);
+ _results.push(fs.writeFileSync(destinationFilePath, content));
+ }
+ }
+ return _results;
+ },
+ makeTreeSync: function(directoryPath) {
+ if (!fsPlus.existsSync(directoryPath)) {
+ return mkdirp.sync(directoryPath);
+ }
+ },
+ makeTree: function(directoryPath, callback) {
+ return fs.exists(directoryPath, function(exists) {
+ if (exists) {
+ return typeof callback === "function" ? callback() : void 0;
+ }
+ return mkdirp(directoryPath, function(error) {
+ return typeof callback === "function" ? callback(error) : void 0;
+ });
+ });
+ },
+ traverseTreeSync: function(rootPath, onFile, onDirectory) {
+ var traverse;
+ if (onDirectory == null) {
+ onDirectory = onFile;
+ }
+ if (!fsPlus.isDirectorySync(rootPath)) {
+ return;
+ }
+ traverse = function(directoryPath, onFile, onDirectory) {
+ var childPath, file, linkStats, stats, _i, _len, _ref;
+ _ref = fs.readdirSync(directoryPath);
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ file = _ref[_i];
+ childPath = path.join(directoryPath, file);
+ stats = fs.lstatSync(childPath);
+ if (stats.isSymbolicLink()) {
+ if (linkStats = statSyncNoException(childPath)) {
+ stats = linkStats;
+ }
+ }
+ if (stats.isDirectory()) {
+ if (onDirectory(childPath)) {
+ traverse(childPath, onFile, onDirectory);
+ }
+ } else if (stats.isFile()) {
+ onFile(childPath);
+ }
+ }
+ return void 0;
+ };
+ return traverse(rootPath, onFile, onDirectory);
+ },
+ traverseTree: function(rootPath, onFile, onDirectory, onDone) {
+ return fs.readdir(rootPath, function(error, files) {
+ var file, queue, _i, _len, _results;
+ if (error) {
+ return typeof onDone === "function" ? onDone() : void 0;
+ } else {
+ queue = async.queue(function(childPath, callback) {
+ return fs.stat(childPath, function(error, stats) {
+ if (error) {
+ return callback(error);
+ } else if (stats.isFile()) {
+ onFile(childPath);
+ return callback();
+ } else if (stats.isDirectory()) {
+ if (onDirectory(childPath)) {
+ return fs.readdir(childPath, function(error, files) {
+ var file, _i, _len;
+ if (error) {
+ return callback(error);
+ } else {
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
+ file = files[_i];
+ queue.unshift(path.join(childPath, file));
+ }
+ return callback();
+ }
+ });
+ } else {
+ return callback();
+ }
+ }
+ });
+ });
+ queue.concurrency = 1;
+ queue.drain = onDone;
+ _results = [];
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
+ file = files[_i];
+ _results.push(queue.push(path.join(rootPath, file)));
+ }
+ return _results;
+ }
+ });
+ },
+ md5ForPath: function(pathToDigest) {
+ var contents;
+ contents = fs.readFileSync(pathToDigest);
+ return require('crypto').createHash('md5').update(contents).digest('hex');
+ },
+ resolve: function() {
+ var args, candidatePath, extensions, loadPath, loadPaths, pathToResolve, resolvedPath, _i, _len, _ref;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (_.isArray(_.last(args))) {
+ extensions = args.pop();
+ }
+ pathToResolve = (_ref = args.pop()) != null ? _ref.toString() : void 0;
+ loadPaths = args;
+ if (!pathToResolve) {
+ return void 0;
+ }
+ if (fsPlus.isAbsolute(pathToResolve)) {
+ if (extensions && (resolvedPath = fsPlus.resolveExtension(pathToResolve, extensions))) {
+ return resolvedPath;
+ } else {
+ if (fsPlus.existsSync(pathToResolve)) {
+ return pathToResolve;
+ }
+ }
+ }
+ for (_i = 0, _len = loadPaths.length; _i < _len; _i++) {
+ loadPath = loadPaths[_i];
+ candidatePath = path.join(loadPath, pathToResolve);
+ if (extensions) {
+ if (resolvedPath = fsPlus.resolveExtension(candidatePath, extensions)) {
+ return resolvedPath;
+ }
+ } else {
+ if (fsPlus.existsSync(candidatePath)) {
+ return fsPlus.absolute(candidatePath);
+ }
+ }
+ }
+ return void 0;
+ },
+ resolveOnLoadPath: function() {
+ var args, loadPaths;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ loadPaths = Module.globalPaths.concat(module.paths);
+ return fsPlus.resolve.apply(fsPlus, __slice.call(loadPaths).concat(__slice.call(args)));
+ },
+ resolveExtension: function(pathToResolve, extensions) {
+ var extension, pathWithExtension, _i, _len;
+ for (_i = 0, _len = extensions.length; _i < _len; _i++) {
+ extension = extensions[_i];
+ if (extension === "") {
+ if (fsPlus.existsSync(pathToResolve)) {
+ return fsPlus.absolute(pathToResolve);
+ }
+ } else {
+ pathWithExtension = pathToResolve + "." + extension.replace(/^\./, "");
+ if (fsPlus.existsSync(pathWithExtension)) {
+ return fsPlus.absolute(pathWithExtension);
+ }
+ }
+ }
+ return void 0;
+ },
+ isCompressedExtension: function(ext) {
+ return _.indexOf(['.bz2', '.epub', '.gz', '.jar', '.lz', '.lzma', '.lzo', '.tar', '.tgz', '.war', '.xz', '.z', '.zip'], ext, true) >= 0;
+ },
+ isImageExtension: function(ext) {
+ return _.indexOf(['.gif', '.ico', '.jpeg', '.jpg', '.png', '.tiff', '.webp'], ext, true) >= 0;
+ },
+ isPdfExtension: function(ext) {
+ return ext === '.pdf';
+ },
+ isBinaryExtension: function(ext) {
+ return _.indexOf(['.DS_Store', '.a', '.exe', '.o', '.pyc', '.pyo', '.so', '.woff'], ext, true) >= 0;
+ },
+ isReadmePath: function(readmePath) {
+ var base, extension;
+ extension = path.extname(readmePath);
+ base = path.basename(readmePath, extension).toLowerCase();
+ return base === 'readme' && (extension === '' || fsPlus.isMarkdownExtension(extension));
+ },
+ isMarkdownExtension: function(ext) {
+ return _.indexOf(['.markdown', '.md', '.mdown', '.mkd', '.mkdown', '.rmd', '.ron'], ext, true) >= 0;
+ },
+ isCaseInsensitive: function() {
+ var lowerCaseStat, upperCaseStat;
+ if (fsPlus.caseInsensitiveFs == null) {
+ lowerCaseStat = statSyncNoException(__filename.toLowerCase());
+ upperCaseStat = statSyncNoException(__filename.toUpperCase());
+ if (lowerCaseStat && upperCaseStat) {
+ fsPlus.caseInsensitiveFs = lowerCaseStat.dev === upperCaseStat.dev && lowerCaseStat.ino === upperCaseStat.ino;
+ } else {
+ fsPlus.caseInsensitiveFs = false;
+ }
+ }
+ return fsPlus.caseInsensitiveFs;
+ },
+ isCaseSensitive: function() {
+ return !fsPlus.isCaseInsensitive();
+ }
+ };
+
+ statSyncNoException = fs.statSyncNoException, lstatSyncNoException = fs.lstatSyncNoException;
+
+ if (statSyncNoException == null) {
+ statSyncNoException = function() {
+ var args, error;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ try {
+ return fs.statSync.apply(fs, args);
+ } catch (_error) {
+ error = _error;
+ return false;
+ }
+ };
+ }
+
+ if (lstatSyncNoException == null) {
+ lstatSyncNoException = function() {
+ var args, error;
+ args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ try {
+ return fs.lstatSync.apply(fs, args);
+ } catch (_error) {
+ error = _error;
+ return false;
+ }
+ };
+ }
+
+ isPathValid = function(pathToCheck) {
+ return (pathToCheck != null) && typeof pathToCheck === 'string' && pathToCheck.length > 0;
+ };
+
+ module.exports = _.extend({}, fs, fsPlus);
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf
new file mode 100644
index 000000000..71c355348
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=`dirname "$0"`
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../rimraf/bin.js" "$@"
+ ret=$?
+else
+ node "$basedir/../rimraf/bin.js" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf.cmd b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf.cmd
new file mode 100644
index 000000000..772a3ef3c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/.bin/rimraf.cmd
@@ -0,0 +1,5 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\rimraf\bin.js" %*
+) ELSE (
+ node "%~dp0\..\rimraf\bin.js" %*
+)
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/LICENSE b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/LICENSE
new file mode 100644
index 000000000..b7f9d5001
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Caolan McMahon
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/README.md b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/README.md
new file mode 100644
index 000000000..951f76e9f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/README.md
@@ -0,0 +1,1425 @@
+# Async.js
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [node.js](http://nodejs.org), it can also be used directly in the
+browser. Also supports [component](https://github.com/component/component).
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (map, reduce, filter, each…) as well as some common patterns
+for asynchronous control flow (parallel, series, waterfall…). All these
+functions assume you follow the node.js convention of providing a single
+callback as the last argument of your async function.
+
+
+## Quick Examples
+
+```javascript
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+
+async.parallel([
+ function(){ ... },
+ function(){ ... }
+], callback);
+
+async.series([
+ function(){ ... },
+ function(){ ... }
+]);
+```
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+## Common Pitfalls
+
+### Binding a context to an iterator
+
+This section is really about bind, not about async. If you are wondering how to
+make async execute your iterators in a given context, or are confused as to why
+a method of another library isn't working as an iterator, study this example:
+
+```js
+// Here is a simple object with an (unnecessarily roundabout) squaring method
+var AsyncSquaringLibrary = {
+ squareExponent: 2,
+ square: function(number, callback){
+ var result = Math.pow(number, this.squareExponent);
+ setTimeout(function(){
+ callback(null, result);
+ }, 200);
+ }
+};
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
+ // result is [NaN, NaN, NaN]
+ // This fails because the `this.squareExponent` expression in the square
+ // function is not evaluated in the context of AsyncSquaringLibrary, and is
+ // therefore undefined.
+});
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
+ // result is [1, 4, 9]
+ // With the help of bind we can attach a context to the iterator before
+ // passing it to async. Now the square function will be executed in its
+ // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
+ // will be as expected.
+});
+```
+
+## Download
+
+The source is available for download from
+[GitHub](http://github.com/caolan/async).
+Alternatively, you can install using Node Package Manager (npm):
+
+ npm install async
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
+
+## In the Browser
+
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5. Usage:
+
+```html
+
+
+```
+
+## Documentation
+
+### Collections
+
+* [each](#each)
+* [eachSeries](#eachSeries)
+* [eachLimit](#eachLimit)
+* [map](#map)
+* [mapSeries](#mapSeries)
+* [mapLimit](#mapLimit)
+* [filter](#filter)
+* [filterSeries](#filterSeries)
+* [reject](#reject)
+* [rejectSeries](#rejectSeries)
+* [reduce](#reduce)
+* [reduceRight](#reduceRight)
+* [detect](#detect)
+* [detectSeries](#detectSeries)
+* [sortBy](#sortBy)
+* [some](#some)
+* [every](#every)
+* [concat](#concat)
+* [concatSeries](#concatSeries)
+
+### Control Flow
+
+* [series](#series)
+* [parallel](#parallel)
+* [parallelLimit](#parallellimittasks-limit-callback)
+* [whilst](#whilst)
+* [doWhilst](#doWhilst)
+* [until](#until)
+* [doUntil](#doUntil)
+* [forever](#forever)
+* [waterfall](#waterfall)
+* [compose](#compose)
+* [applyEach](#applyEach)
+* [applyEachSeries](#applyEachSeries)
+* [queue](#queue)
+* [cargo](#cargo)
+* [auto](#auto)
+* [iterator](#iterator)
+* [apply](#apply)
+* [nextTick](#nextTick)
+* [times](#times)
+* [timesSeries](#timesSeries)
+
+### Utils
+
+* [memoize](#memoize)
+* [unmemoize](#unmemoize)
+* [log](#log)
+* [dir](#dir)
+* [noConflict](#noConflict)
+
+
+## Collections
+
+
+
+### each(arr, iterator, callback)
+
+Applies an iterator function to each item in an array, in parallel.
+The iterator is called with an item from the list and a callback for when it
+has finished. If the iterator passes an error to this callback, the main
+callback for the each function is immediately called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err) which must be called once it has
+ completed. If no error has occured, the callback should be run without
+ arguments or with an explicit null argument.
+* callback(err) - A callback which is called after all the iterator functions
+ have finished, or an error has occurred.
+
+__Example__
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+ // if any of the saves produced an error, err would equal that error
+});
+```
+
+---------------------------------------
+
+
+
+### eachSeries(arr, iterator, callback)
+
+The same as each only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. This means the iterator functions will complete in order.
+
+
+---------------------------------------
+
+
+
+### eachLimit(arr, limit, iterator, callback)
+
+The same as each only no more than "limit" iterators will be simultaneously
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are
+started.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* limit - The maximum number of iterators to run at any time.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err) which must be called once it has
+ completed. If no error has occured, the callback should be run without
+ arguments or with an explicit null argument.
+* callback(err) - A callback which is called after all the iterator functions
+ have finished, or an error has occurred.
+
+__Example__
+
+```js
+// Assume documents is an array of JSON objects and requestApi is a
+// function that interacts with a rate-limited REST api.
+
+async.eachLimit(documents, 20, requestApi, function(err){
+ // if any of the saves produced an error, err would equal that error
+});
+```
+
+---------------------------------------
+
+
+### map(arr, iterator, callback)
+
+Produces a new array of values by mapping each value in the given array through
+the iterator function. The iterator is called with an item from the array and a
+callback for when it has finished processing. The callback takes 2 arguments,
+an error and the transformed item from the array. If the iterator passes an
+error to this callback, the main callback for the map function is immediately
+called with the error.
+
+Note, that since this function applies the iterator to each item in parallel
+there is no guarantee that the iterator functions will complete in order, however
+the results array will be in the same order as the original array.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err, transformed) which must be called once
+ it has completed with an error (which can be null) and a transformed item.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is an array of the
+ transformed items from the original array.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+---------------------------------------
+
+
+### mapSeries(arr, iterator, callback)
+
+The same as map only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+
+---------------------------------------
+
+
+### mapLimit(arr, limit, iterator, callback)
+
+The same as map only no more than "limit" iterators will be simultaneously
+running at any time.
+
+Note that the items are not processed in batches, so there is no guarantee that
+ the first "limit" iterator functions will complete before any others are
+started.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* limit - The maximum number of iterators to run at any time.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err, transformed) which must be called once
+ it has completed with an error (which can be null) and a transformed item.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is an array of the
+ transformed items from the original array.
+
+__Example__
+
+```js
+async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+---------------------------------------
+
+
+### filter(arr, iterator, callback)
+
+__Alias:__ select
+
+Returns a new array of all the values which pass an async truth test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback(truthValue) which must be called with a
+ boolean argument once it has completed.
+* callback(results) - A callback which is called after all the iterator
+ functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+```
+
+---------------------------------------
+
+
+### filterSeries(arr, iterator, callback)
+
+__alias:__ selectSeries
+
+The same as filter only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+---------------------------------------
+
+
+### reject(arr, iterator, callback)
+
+The opposite of filter. Removes values that pass an async truth test.
+
+---------------------------------------
+
+
+### rejectSeries(arr, iterator, callback)
+
+The same as reject, only the iterator is applied to each item in the array
+in series.
+
+
+---------------------------------------
+
+
+### reduce(arr, memo, iterator, callback)
+
+__aliases:__ inject, foldl
+
+Reduces a list of values into a single value using an async iterator to return
+each successive step. Memo is the initial state of the reduction. This
+function only operates in series. For performance reasons, it may make sense to
+split a call to this function into a parallel map, then use the normal
+Array.prototype.reduce on the results. This function is for situations where
+each step in the reduction needs to be async, if you can get the data before
+reducing it then it's probably a good idea to do so.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* memo - The initial state of the reduction.
+* iterator(memo, item, callback) - A function applied to each item in the
+ array to produce the next step in the reduction. The iterator is passed a
+ callback(err, reduction) which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main callback is
+ immediately called with the error.
+* callback(err, result) - A callback which is called after all the iterator
+ functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+ // pointless async:
+ process.nextTick(function(){
+ callback(null, memo + item)
+ });
+}, function(err, result){
+ // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+
+### reduceRight(arr, memo, iterator, callback)
+
+__Alias:__ foldr
+
+Same as reduce, only operates on the items in the array in reverse order.
+
+
+---------------------------------------
+
+
+### detect(arr, iterator, callback)
+
+Returns the first value in a list that passes an async truth test. The
+iterator is applied in parallel, meaning the first iterator to return true will
+fire the detect callback with that result. That means the result might not be
+the first item in the original array (in terms of order) that passes the test.
+
+If order within the original array is important then look at detectSeries.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback(truthValue) which must be called with a
+ boolean argument once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+ true, or after all the iterator functions have finished. Result will be
+ the first item in the array that passes the truth test (iterator) or the
+ value undefined if none passed.
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+ // result now equals the first file in the list that exists
+});
+```
+
+---------------------------------------
+
+
+### detectSeries(arr, iterator, callback)
+
+The same as detect, only the iterator is applied to each item in the array
+in series. This means the result is always the first in the original array (in
+terms of array order) that passes the truth test.
+
+
+---------------------------------------
+
+
+### sortBy(arr, iterator, callback)
+
+Sorts a list by the results of running each value through an async iterator.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err, sortValue) which must be called once it
+ has completed with an error (which can be null) and a value to use as the sort
+ criteria.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is the items from
+ the original array sorted by the values returned by the iterator calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+ fs.stat(file, function(err, stats){
+ callback(err, stats.mtime);
+ });
+}, function(err, results){
+ // results is now the original array of files sorted by
+ // modified date
+});
+```
+
+---------------------------------------
+
+
+### some(arr, iterator, callback)
+
+__Alias:__ any
+
+Returns true if at least one element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists. Once any iterator
+call returns true, the main callback is immediately called.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback(truthValue) which must be called with a
+ boolean argument once it has completed.
+* callback(result) - A callback which is called as soon as any iterator returns
+ true, or after all the iterator functions have finished. Result will be
+ either true or false depending on the values of the async tests.
+
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then at least one of the files exists
+});
+```
+
+---------------------------------------
+
+
+### every(arr, iterator, callback)
+
+__Alias:__ all
+
+Returns true if every element in the array satisfies an async test.
+_The callback for each iterator call only accepts a single argument of true or
+false, it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like fs.exists.
+
+__Arguments__
+
+* arr - An array to iterate over.
+* iterator(item, callback) - A truth test to apply to each item in the array.
+ The iterator is passed a callback(truthValue) which must be called with a
+ boolean argument once it has completed.
+* callback(result) - A callback which is called after all the iterator
+ functions have finished. Result will be either true or false depending on
+ the values of the async tests.
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then every file exists
+});
+```
+
+---------------------------------------
+
+
+### concat(arr, iterator, callback)
+
+Applies an iterator to each item in a list, concatenating the results. Returns the
+concatenated list. The iterators are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of the arguments passed to the iterator function.
+
+__Arguments__
+
+* arr - An array to iterate over
+* iterator(item, callback) - A function to apply to each item in the array.
+ The iterator is passed a callback(err, results) which must be called once it
+ has completed with an error (which can be null) and an array of results.
+* callback(err, results) - A callback which is called after all the iterator
+ functions have finished, or an error has occurred. Results is an array containing
+ the concatenated results of the iterator function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+ // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+---------------------------------------
+
+
+### concatSeries(arr, iterator, callback)
+
+Same as async.concat, but executes in series instead of parallel.
+
+
+## Control Flow
+
+
+### series(tasks, [callback])
+
+Run an array of functions in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run and the callback for the series is
+immediately called with the value of the error. Once the tasks have completed,
+the results are passed to the final callback as an array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.series.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed
+ a callback(err, result) it must call on completion with an error (which can
+ be null) and an optional result value.
+* callback(err, results) - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.series([
+ function(callback){
+ // do some stuff ...
+ callback(null, 'one');
+ },
+ function(callback){
+ // do some more stuff ...
+ callback(null, 'two');
+ }
+],
+// optional callback
+function(err, results){
+ // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+
+### parallel(tasks, [callback])
+
+Run an array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main callback is immediately called with the value of the error.
+Once the tasks have completed, the results are passed to the final callback as an
+array.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final callback as an object
+instead of an array. This can be a more readable way of handling results from
+async.parallel.
+
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed
+ a callback(err, result) it must call on completion with an error (which can
+ be null) and an optional result value.
+* callback(err, results) - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'one');
+ }, 200);
+ },
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'two');
+ }, 100);
+ }
+],
+// optional callback
+function(err, results){
+ // the results array will equal ['one','two'] even though
+ // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equals to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+
+### parallelLimit(tasks, limit, [callback])
+
+The same as parallel only the tasks are executed in parallel with a maximum of "limit"
+tasks executing at any time.
+
+Note that the tasks are not executed in batches, so there is no guarantee that
+the first "limit" tasks will complete before any others are started.
+
+__Arguments__
+
+* tasks - An array or object containing functions to run, each function is passed
+ a callback(err, result) it must call on completion with an error (which can
+ be null) and an optional result value.
+* limit - The maximum number of tasks to run at any time.
+* callback(err, results) - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+---------------------------------------
+
+
+### whilst(test, fn, callback)
+
+Repeatedly call fn, while test returns true. Calls the callback when stopped,
+or an error occurs.
+
+__Arguments__
+
+* test() - synchronous truth test to perform before each execution of fn.
+* fn(callback) - A function to call each time the test passes. The function is
+ passed a callback(err) which must be called once it has completed with an
+ optional error argument.
+* callback(err) - A callback which is called after the test fails and repeated
+ execution of fn has stopped.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+);
+```
+
+---------------------------------------
+
+
+### doWhilst(fn, test, callback)
+
+The post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+
+### until(test, fn, callback)
+
+Repeatedly call fn, until test returns true. Calls the callback when stopped,
+or an error occurs.
+
+The inverse of async.whilst.
+
+---------------------------------------
+
+
+### doUntil(fn, test, callback)
+
+Like doWhilst except the test is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+
+### forever(fn, callback)
+
+Calls the asynchronous function 'fn' repeatedly, in series, indefinitely.
+If an error is passed to fn's callback then 'callback' is called with the
+error, otherwise it will never be called.
+
+---------------------------------------
+
+
+### waterfall(tasks, [callback])
+
+Runs an array of functions in series, each passing their results to the next in
+the array. However, if any of the functions pass an error to the callback, the
+next function is not executed and the main callback is immediately called with
+the error.
+
+__Arguments__
+
+* tasks - An array of functions to run, each function is passed a
+ callback(err, result1, result2, ...) it must call on completion. The first
+ argument is an error (which can be null) and any further arguments will be
+ passed as arguments in order to the next task.
+* callback(err, [results]) - An optional callback to run once all the functions
+ have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+ function(callback){
+ callback(null, 'one', 'two');
+ },
+ function(arg1, arg2, callback){
+ callback(null, 'three');
+ },
+ function(arg1, callback){
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+], function (err, result) {
+ // result now equals 'done'
+});
+```
+
+---------------------------------------
+
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions f(), g() and h() would produce the result of
+f(g(h())), only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* functions... - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+ setTimeout(function () {
+ callback(null, n + 1);
+ }, 10);
+}
+
+function mul3(n, callback) {
+ setTimeout(function () {
+ callback(null, n * 3);
+ }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+ // result now equals 15
+});
+```
+
+---------------------------------------
+
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling the
+callback after all functions have completed. If you only provide the first
+argument then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* fns - the asynchronous functions to all call with the same arguments
+* args... - any number of separate arguments to pass to the function
+* callback - the final argument should be the callback, called when all
+ functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+ buckets,
+ async.applyEach([enableSearch, updateSchema]),
+ callback
+);
+```
+
+---------------------------------------
+
+
+### applyEachSeries(arr, iterator, callback)
+
+The same as applyEach only the functions are applied in series.
+
+---------------------------------------
+
+
+### queue(worker, concurrency)
+
+Creates a queue object with the specified concurrency. Tasks added to the
+queue will be processed in parallel (up to the concurrency limit). If all
+workers are in progress, the task is queued until one is available. Once
+a worker has completed a task, the task's callback is called.
+
+__Arguments__
+
+* worker(task, callback) - An asynchronous function for processing a queued
+ task, which must call its callback(err) argument when finished, with an
+ optional error as an argument.
+* concurrency - An integer for determining how many worker functions should be
+ run in parallel.
+
+__Queue objects__
+
+The queue object returned by this function has the following properties and
+methods:
+
+* length() - a function returning the number of items waiting to be processed.
+* concurrency - an integer for determining how many worker functions should be
+ run in parallel. This property can be changed after a queue is created to
+ alter the concurrency on-the-fly.
+* push(task, [callback]) - add a new task to the queue, the callback is called
+ once the worker has finished processing the task.
+ instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
+* unshift(task, [callback]) - add a new task to the front of the queue.
+* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
+* empty - a callback that is called when the last item from the queue is given to a worker
+* drain - a callback that is called when the last item from the queue has returned from the worker
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+ console.log('hello ' + task.name);
+ callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+ console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+ console.log('finished processing bar');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+```
+
+---------------------------------------
+
+
+### cargo(worker, [payload])
+
+Creates a cargo object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the payload limit). If the
+worker is in progress, the task is queued until it is available. Once
+the worker has completed some tasks, each callback of those tasks is called.
+
+__Arguments__
+
+* worker(tasks, callback) - An asynchronous function for processing an array of
+ queued tasks, which must call its callback(err) argument when finished, with
+ an optional error as an argument.
+* payload - An optional integer for determining how many tasks should be
+ processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The cargo object returned by this function has the following properties and
+methods:
+
+* length() - a function returning the number of items waiting to be processed.
+* payload - an integer for determining how many tasks should be
+ process per round. This property can be changed after a cargo is created to
+ alter the payload on-the-fly.
+* push(task, [callback]) - add a new task to the queue, the callback is called
+ once the worker has finished processing the task.
+ instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.
+* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued
+* empty - a callback that is called when the last item from the queue is given to a worker
+* drain - a callback that is called when the last item from the queue has returned from the worker
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i
+### auto(tasks, [callback])
+
+Determines the best order for running functions based on their requirements.
+Each function can optionally depend on other functions being completed first,
+and each function is run as soon as its requirements are satisfied. If any of
+the functions pass an error to their callback, that function will not complete
+(so any other functions depending on it will not run) and the main callback
+will be called immediately with the error. Functions also receive an object
+containing the results of functions which have completed so far.
+
+Note, all functions are called with a results object as a second argument,
+so it is unsafe to pass functions in the tasks object which cannot handle the
+extra argument. For example, this snippet of code:
+
+```js
+async.auto({
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling readFile with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to readFile in a function which does not forward the
+results object:
+
+```js
+async.auto({
+ readData: function(cb, results){
+ fs.readFile('data.txt', 'utf-8', cb);
+ }
+}, callback);
+```
+
+__Arguments__
+
+* tasks - An object literal containing named functions or an array of
+ requirements, with the function itself the last item in the array. The key
+ used for each function or array is used when specifying requirements. The
+ function receives two arguments: (1) a callback(err, result) which must be
+ called when finished, passing an error (which can be null) and the result of
+ the function's execution, and (2) a results object, containing the results of
+ the previously executed functions.
+* callback(err, results) - An optional callback which is called when all the
+ tasks have been completed. The callback will receive an error as an argument
+ if any tasks pass an error to their callback. Results will always be passed
+ but if an error occurred, no other tasks will be performed, and the results
+ object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+ get_data: function(callback){
+ // async code to get some data
+ },
+ make_folder: function(callback){
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ },
+ write_file: ['get_data', 'make_folder', function(callback){
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ callback(null, filename);
+ }],
+ email_link: ['write_file', function(callback, results){
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ }]
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+ function(callback){
+ // async code to get some data
+ },
+ function(callback){
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ }
+],
+function(err, results){
+ async.series([
+ function(callback){
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ },
+ function(callback){
+ // once the file is written let's email a link to it...
+ }
+ ]);
+});
+```
+
+For a complicated series of async tasks using the auto function makes adding
+new tasks much easier and makes the code more readable.
+
+
+---------------------------------------
+
+
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the array,
+returning a continuation to call the next one after that. It's also possible to
+'peek' the next iterator by doing iterator.next().
+
+This function is used internally by the async module but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* tasks - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+ function(){ sys.p('one'); },
+ function(){ sys.p('two'); },
+ function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied, a useful
+shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to automatically apply when the
+ continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+ function(callback){
+ fs.writeFile('testfile1', 'test1', callback);
+ },
+ function(callback){
+ fs.writeFile('testfile2', 'test2', callback);
+ }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+
+### nextTick(callback)
+
+Calls the callback on a later loop around the event loop. In node.js this just
+calls process.nextTick, in the browser it falls back to setImmediate(callback)
+if available, otherwise setTimeout(callback, 0), which means other higher priority
+events may precede the execution of the callback.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* callback - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+ call_order.push('two');
+ // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+
+### times(n, callback)
+
+Calls the callback n times and accumulates results in the same manner
+you would use with async.map.
+
+__Arguments__
+
+* n - The number of times to run the function.
+* callback - The function to call n times.
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+ callback(null, {
+ id: 'user' + id
+ })
+}
+// generate 5 users
+async.times(5, function(n, next){
+ createUser(n, function(err, user) {
+ next(err, user)
+ })
+}, function(err, users) {
+ // we should now have 5 users
+});
+```
+
+
+### timesSeries(n, callback)
+
+The same as times only the iterator is applied to each item in the array in
+series. The next iterator is only called once the current one has completed
+processing. The results array will be in the same order as the original.
+
+
+## Utils
+
+
+### memoize(fn, [hasher])
+
+Caches the results of an async function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* fn - the function you to proxy and cache results from.
+* hasher - an optional function for generating a custom hash for storing
+ results, it has all the arguments applied to it apart from the callback, and
+ must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+ // do something
+ callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+ // callback
+});
+```
+
+
+### unmemoize(fn)
+
+Undoes a memoized function, reverting it to the original, unmemoized
+form. Comes handy in tests.
+
+__Arguments__
+
+* fn - the memoized function
+
+
+### log(function, arguments)
+
+Logs the result of an async function to the console. Only works in node.js or
+in browsers that support console.log and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.log is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, 'hello ' + name);
+ }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+
+### dir(function, arguments)
+
+Logs the result of an async function to the console using console.dir to
+display the properties of the resulting object. Only works in node.js or
+in browsers that support console.dir and console.error (such as FF and Chrome).
+If multiple arguments are returned from the async function, console.dir is
+called on each argument in order.
+
+__Arguments__
+
+* function - The function you want to eventually apply all arguments to.
+* arguments... - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, {hello: name});
+ }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+
+### noConflict()
+
+Changes the value of async back to its original value, returning a reference to the
+async object.
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/component.json b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/component.json
new file mode 100644
index 000000000..bbb011548
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/component.json
@@ -0,0 +1,11 @@
+{
+ "name": "async",
+ "repo": "caolan/async",
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "version": "0.1.23",
+ "keywords": [],
+ "dependencies": {},
+ "development": {},
+ "main": "lib/async.js",
+ "scripts": [ "lib/async.js" ]
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/lib/async.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/lib/async.js
new file mode 100644
index 000000000..1eebb153f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/async/lib/async.js
@@ -0,0 +1,958 @@
+/*global setImmediate: false, setTimeout: false, console: false */
+(function () {
+
+ var async = {};
+
+ // global on the server, window in the browser
+ var root, previous_async;
+
+ root = this;
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ var called = false;
+ return function() {
+ if (called) throw new Error("Callback was already called.");
+ called = true;
+ fn.apply(root, arguments);
+ }
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _each = function (arr, iterator) {
+ if (arr.forEach) {
+ return arr.forEach(iterator);
+ }
+ for (var i = 0; i < arr.length; i += 1) {
+ iterator(arr[i], i, arr);
+ }
+ };
+
+ var _map = function (arr, iterator) {
+ if (arr.map) {
+ return arr.map(iterator);
+ }
+ var results = [];
+ _each(arr, function (x, i, a) {
+ results.push(iterator(x, i, a));
+ });
+ return results;
+ };
+
+ var _reduce = function (arr, iterator, memo) {
+ if (arr.reduce) {
+ return arr.reduce(iterator, memo);
+ }
+ _each(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ };
+
+ var _keys = function (obj) {
+ if (Object.keys) {
+ return Object.keys(obj);
+ }
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+ if (typeof process === 'undefined' || !(process.nextTick)) {
+ if (typeof setImmediate === 'function') {
+ async.nextTick = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
+ async.setImmediate = async.nextTick;
+ }
+ else {
+ async.nextTick = function (fn) {
+ setTimeout(fn, 0);
+ };
+ async.setImmediate = async.nextTick;
+ }
+ }
+ else {
+ async.nextTick = process.nextTick;
+ if (typeof setImmediate !== 'undefined') {
+ async.setImmediate = function (fn) {
+ // not a direct alias for IE10 compatibility
+ setImmediate(fn);
+ };
+ }
+ else {
+ async.setImmediate = async.nextTick;
+ }
+ }
+
+ async.each = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ _each(arr, function (x) {
+ iterator(x, only_once(function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed >= arr.length) {
+ callback(null);
+ }
+ }
+ }));
+ });
+ };
+ async.forEach = async.each;
+
+ async.eachSeries = function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length) {
+ return callback();
+ }
+ var completed = 0;
+ var iterate = function () {
+ iterator(arr[completed], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ if (completed >= arr.length) {
+ callback(null);
+ }
+ else {
+ iterate();
+ }
+ }
+ });
+ };
+ iterate();
+ };
+ async.forEachSeries = async.eachSeries;
+
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ var fn = _eachLimit(limit);
+ fn.apply(null, [arr, iterator, callback]);
+ };
+ async.forEachLimit = async.eachLimit;
+
+ var _eachLimit = function (limit) {
+
+ return function (arr, iterator, callback) {
+ callback = callback || function () {};
+ if (!arr.length || limit <= 0) {
+ return callback();
+ }
+ var completed = 0;
+ var started = 0;
+ var running = 0;
+
+ (function replenish () {
+ if (completed >= arr.length) {
+ return callback();
+ }
+
+ while (running < limit && started < arr.length) {
+ started += 1;
+ running += 1;
+ iterator(arr[started - 1], function (err) {
+ if (err) {
+ callback(err);
+ callback = function () {};
+ }
+ else {
+ completed += 1;
+ running -= 1;
+ if (completed >= arr.length) {
+ callback();
+ }
+ else {
+ replenish();
+ }
+ }
+ });
+ }
+ })();
+ };
+ };
+
+
+ var doParallel = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.each].concat(args));
+ };
+ };
+ var doParallelLimit = function(limit, fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [_eachLimit(limit)].concat(args));
+ };
+ };
+ var doSeries = function (fn) {
+ return function () {
+ var args = Array.prototype.slice.call(arguments);
+ return fn.apply(null, [async.eachSeries].concat(args));
+ };
+ };
+
+
+ var _asyncMap = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (err, v) {
+ results[x.index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ };
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = function (arr, limit, iterator, callback) {
+ return _mapLimit(limit)(arr, iterator, callback);
+ };
+
+ var _mapLimit = function(limit) {
+ return doParallelLimit(limit, _asyncMap);
+ };
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachSeries(arr, function (x, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+ // inject alias
+ async.inject = async.reduce;
+ // foldl alias
+ async.foldl = async.reduce;
+
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, function (x) {
+ return x;
+ }).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+ // foldr alias
+ async.foldr = async.reduceRight;
+
+ var _filter = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.filter = doParallel(_filter);
+ async.filterSeries = doSeries(_filter);
+ // select alias
+ async.select = async.filter;
+ async.selectSeries = async.filterSeries;
+
+ var _reject = function (eachfn, arr, iterator, callback) {
+ var results = [];
+ arr = _map(arr, function (x, i) {
+ return {index: i, value: x};
+ });
+ eachfn(arr, function (x, callback) {
+ iterator(x.value, function (v) {
+ if (!v) {
+ results.push(x);
+ }
+ callback();
+ });
+ }, function (err) {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ };
+ async.reject = doParallel(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ var _detect = function (eachfn, arr, iterator, main_callback) {
+ eachfn(arr, function (x, callback) {
+ iterator(x, function (result) {
+ if (result) {
+ main_callback(x);
+ main_callback = function () {};
+ }
+ else {
+ callback();
+ }
+ });
+ }, function (err) {
+ main_callback();
+ });
+ };
+ async.detect = doParallel(_detect);
+ async.detectSeries = doSeries(_detect);
+
+ async.some = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ main_callback(true);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(false);
+ });
+ };
+ // any alias
+ async.any = async.some;
+
+ async.every = function (arr, iterator, main_callback) {
+ async.each(arr, function (x, callback) {
+ iterator(x, function (v) {
+ if (!v) {
+ main_callback(false);
+ main_callback = function () {};
+ }
+ callback();
+ });
+ }, function (err) {
+ main_callback(true);
+ });
+ };
+ // all alias
+ async.all = async.every;
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ var fn = function (left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ };
+ callback(null, _map(results.sort(fn), function (x) {
+ return x.value;
+ }));
+ }
+ });
+ };
+
+ async.auto = function (tasks, callback) {
+ callback = callback || function () {};
+ var keys = _keys(tasks);
+ if (!keys.length) {
+ return callback(null);
+ }
+
+ var results = {};
+
+ var listeners = [];
+ var addListener = function (fn) {
+ listeners.unshift(fn);
+ };
+ var removeListener = function (fn) {
+ for (var i = 0; i < listeners.length; i += 1) {
+ if (listeners[i] === fn) {
+ listeners.splice(i, 1);
+ return;
+ }
+ }
+ };
+ var taskComplete = function () {
+ _each(listeners.slice(0), function (fn) {
+ fn();
+ });
+ };
+
+ addListener(function () {
+ if (_keys(results).length === keys.length) {
+ callback(null, results);
+ callback = function () {};
+ }
+ });
+
+ _each(keys, function (k) {
+ var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
+ var taskCallback = function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _each(_keys(results), function(rkey) {
+ safeResults[rkey] = results[rkey];
+ });
+ safeResults[k] = args;
+ callback(err, safeResults);
+ // stop subsequent errors hitting callback multiple times
+ callback = function () {};
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ };
+ var requires = task.slice(0, Math.abs(task.length - 1)) || [];
+ var ready = function () {
+ return _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ };
+ if (ready()) {
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ var listener = function () {
+ if (ready()) {
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ };
+ addListener(listener);
+ }
+ });
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor !== Array) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ var wrapIterator = function (iterator) {
+ return function (err) {
+ if (err) {
+ callback.apply(null, arguments);
+ callback = function () {};
+ }
+ else {
+ var args = Array.prototype.slice.call(arguments, 1);
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ async.setImmediate(function () {
+ iterator.apply(null, args);
+ });
+ }
+ };
+ };
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ var _parallel = function(eachfn, tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ eachfn.map(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ eachfn.each(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.parallel = function (tasks, callback) {
+ _parallel({ map: async.map, each: async.each }, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
+ };
+
+ async.series = function (tasks, callback) {
+ callback = callback || function () {};
+ if (tasks.constructor === Array) {
+ async.mapSeries(tasks, function (fn, callback) {
+ if (fn) {
+ fn(function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ callback.call(null, err, args);
+ });
+ }
+ }, callback);
+ }
+ else {
+ var results = {};
+ async.eachSeries(_keys(tasks), function (k, callback) {
+ tasks[k](function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[k] = args;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+ };
+
+ async.iterator = function (tasks) {
+ var makeCallback = function (index) {
+ var fn = function () {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ };
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ };
+ return makeCallback(0);
+ };
+
+ async.apply = function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ return function () {
+ return fn.apply(
+ null, args.concat(Array.prototype.slice.call(arguments))
+ );
+ };
+ };
+
+ var _concat = function (eachfn, arr, fn, callback) {
+ var r = [];
+ eachfn(arr, function (x, cb) {
+ fn(x, function (err, y) {
+ r = r.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, r);
+ });
+ };
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ if (test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.whilst(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ if (test()) {
+ async.doWhilst(iterator, test, callback);
+ }
+ else {
+ callback();
+ }
+ });
+ };
+
+ async.until = function (test, iterator, callback) {
+ if (!test()) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ async.until(test, iterator, callback);
+ });
+ }
+ else {
+ callback();
+ }
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ iterator(function (err) {
+ if (err) {
+ return callback(err);
+ }
+ if (!test()) {
+ async.doUntil(iterator, test, callback);
+ }
+ else {
+ callback();
+ }
+ });
+ };
+
+ async.queue = function (worker, concurrency) {
+ if (concurrency === undefined) {
+ concurrency = 1;
+ }
+ function _insert(q, data, pos, callback) {
+ if(data.constructor !== Array) {
+ data = [data];
+ }
+ _each(data, function(task) {
+ var item = {
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.saturated && q.tasks.length === concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ var workers = 0;
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ saturated: null,
+ empty: null,
+ drain: null,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ if (workers < q.concurrency && q.tasks.length) {
+ var task = q.tasks.shift();
+ if (q.empty && q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ var next = function () {
+ workers -= 1;
+ if (task.callback) {
+ task.callback.apply(task, arguments);
+ }
+ if (q.drain && q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ var cb = only_once(next);
+ worker(task.data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ }
+ };
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ var working = false,
+ tasks = [];
+
+ var cargo = {
+ tasks: tasks,
+ payload: payload,
+ saturated: null,
+ empty: null,
+ drain: null,
+ push: function (data, callback) {
+ if(data.constructor !== Array) {
+ data = [data];
+ }
+ _each(data, function(task) {
+ tasks.push({
+ data: task,
+ callback: typeof callback === 'function' ? callback : null
+ });
+ if (cargo.saturated && tasks.length === payload) {
+ cargo.saturated();
+ }
+ });
+ async.setImmediate(cargo.process);
+ },
+ process: function process() {
+ if (working) return;
+ if (tasks.length === 0) {
+ if(cargo.drain) cargo.drain();
+ return;
+ }
+
+ var ts = typeof payload === 'number'
+ ? tasks.splice(0, payload)
+ : tasks.splice(0);
+
+ var ds = _map(ts, function (task) {
+ return task.data;
+ });
+
+ if(cargo.empty) cargo.empty();
+ working = true;
+ worker(ds, function () {
+ working = false;
+
+ var args = arguments;
+ _each(ts, function (data) {
+ if (data.callback) {
+ data.callback.apply(null, args);
+ }
+ });
+
+ process();
+ });
+ },
+ length: function () {
+ return tasks.length;
+ },
+ running: function () {
+ return working;
+ }
+ };
+ return cargo;
+ };
+
+ var _console_fn = function (name) {
+ return function (fn) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ fn.apply(null, args.concat([function (err) {
+ var args = Array.prototype.slice.call(arguments, 1);
+ if (typeof console !== 'undefined') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _each(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ }]));
+ };
+ };
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ hasher = hasher || function (x) {
+ return x;
+ };
+ var memoized = function () {
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (key in memo) {
+ callback.apply(null, memo[key]);
+ }
+ else if (key in queues) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([function () {
+ memo[key] = arguments;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, arguments);
+ }
+ }]));
+ }
+ };
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ async.times = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i < count; i++) {
+ counter.push(i);
+ }
+ return async.map(counter, iterator, callback);
+ };
+
+ async.timesSeries = function (count, iterator, callback) {
+ var counter = [];
+ for (var i = 0; i < count; i++) {
+ counter.push(i);
+ }
+ return async.mapSeries(counter, iterator, callback);
+ };
+
+ async.compose = function (/* functions... */) {
+ var fns = Array.prototype.reverse.call(arguments);
+ return function () {
+ var that = this;
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([function () {
+ var err = arguments[0];
+ var nextargs = Array.prototype.slice.call(arguments, 1);
+ cb(err, nextargs);
+ }]))
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ };
+ };
+
+ var _applyEach = function (eachfn, fns /*args...*/) {
+ var go = function () {
+ var that = this;
+ var args = Array.prototype.slice.call(arguments);
+ var callback = args.pop();
+ return eachfn(fns, function (fn, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ };
+ if (arguments.length > 2) {
+ var args = Array.prototype.slice.call(arguments, 2);
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ };
+ async.applyEach = doParallel(_applyEach);
+ async.applyEachSeries = doSeries(_applyEach);
+
+ async.forever = function (fn, callback) {
+ function next(err) {
+ if (err) {
+ if (callback) {
+ return callback(err);
+ }
+ throw err;
+ }
+ fn(next);
+ }
+ next();
+ };
+
+ // AMD / RequireJS
+ if (typeof define !== 'undefined' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // Node.js
+ else if (typeof module !== 'undefined' && module.exports) {
+ module.exports = async;
+ }
+ // included directly via \n\n```\n\n## Documentation\n\n### Collections\n\n* [each](#each)\n* [eachSeries](#eachSeries)\n* [eachLimit](#eachLimit)\n* [map](#map)\n* [mapSeries](#mapSeries)\n* [mapLimit](#mapLimit)\n* [filter](#filter)\n* [filterSeries](#filterSeries)\n* [reject](#reject)\n* [rejectSeries](#rejectSeries)\n* [reduce](#reduce)\n* [reduceRight](#reduceRight)\n* [detect](#detect)\n* [detectSeries](#detectSeries)\n* [sortBy](#sortBy)\n* [some](#some)\n* [every](#every)\n* [concat](#concat)\n* [concatSeries](#concatSeries)\n\n### Control Flow\n\n* [series](#series)\n* [parallel](#parallel)\n* [parallelLimit](#parallellimittasks-limit-callback)\n* [whilst](#whilst)\n* [doWhilst](#doWhilst)\n* [until](#until)\n* [doUntil](#doUntil)\n* [forever](#forever)\n* [waterfall](#waterfall)\n* [compose](#compose)\n* [applyEach](#applyEach)\n* [applyEachSeries](#applyEachSeries)\n* [queue](#queue)\n* [cargo](#cargo)\n* [auto](#auto)\n* [iterator](#iterator)\n* [apply](#apply)\n* [nextTick](#nextTick)\n* [times](#times)\n* [timesSeries](#timesSeries)\n\n### Utils\n\n* [memoize](#memoize)\n* [unmemoize](#unmemoize)\n* [log](#log)\n* [dir](#dir)\n* [noConflict](#noConflict)\n\n\n## Collections\n\n\n\n### each(arr, iterator, callback)\n\nApplies an iterator function to each item in an array, in parallel.\nThe iterator is called with an item from the list and a callback for when it\nhas finished. If the iterator passes an error to this callback, the main\ncallback for the each function is immediately called with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n\n### eachSeries(arr, iterator, callback)\n\nThe same as each only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. This means the iterator functions will complete in order.\n\n\n---------------------------------------\n\n\n\n### eachLimit(arr, limit, iterator, callback)\n\nThe same as each only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err) which must be called once it has \n completed. If no error has occured, the callback should be run without \n arguments or with an explicit null argument.\n* callback(err) - A callback which is called after all the iterator functions\n have finished, or an error has occurred.\n\n__Example__\n\n```js\n// Assume documents is an array of JSON objects and requestApi is a\n// function that interacts with a rate-limited REST api.\n\nasync.eachLimit(documents, 20, requestApi, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n---------------------------------------\n\n\n### map(arr, iterator, callback)\n\nProduces a new array of values by mapping each value in the given array through\nthe iterator function. The iterator is called with an item from the array and a\ncallback for when it has finished processing. The callback takes 2 arguments, \nan error and the transformed item from the array. If the iterator passes an\nerror to this callback, the main callback for the map function is immediately\ncalled with the error.\n\nNote, that since this function applies the iterator to each item in parallel\nthere is no guarantee that the iterator functions will complete in order, however\nthe results array will be in the same order as the original array.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### mapSeries(arr, iterator, callback)\n\nThe same as map only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n---------------------------------------\n\n\n### mapLimit(arr, limit, iterator, callback)\n\nThe same as map only no more than \"limit\" iterators will be simultaneously \nrunning at any time.\n\nNote that the items are not processed in batches, so there is no guarantee that\n the first \"limit\" iterator functions will complete before any others are \nstarted.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* limit - The maximum number of iterators to run at any time.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, transformed) which must be called once \n it has completed with an error (which can be null) and a transformed item.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array of the\n transformed items from the original array.\n\n__Example__\n\n```js\nasync.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n---------------------------------------\n\n\n### filter(arr, iterator, callback)\n\n__Alias:__ select\n\nReturns a new array of all the values which pass an async truth test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(results) - A callback which is called after all the iterator\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n---------------------------------------\n\n\n### filterSeries(arr, iterator, callback)\n\n__alias:__ selectSeries\n\nThe same as filter only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n---------------------------------------\n\n\n### reject(arr, iterator, callback)\n\nThe opposite of filter. Removes values that pass an async truth test.\n\n---------------------------------------\n\n\n### rejectSeries(arr, iterator, callback)\n\nThe same as reject, only the iterator is applied to each item in the array\nin series.\n\n\n---------------------------------------\n\n\n### reduce(arr, memo, iterator, callback)\n\n__aliases:__ inject, foldl\n\nReduces a list of values into a single value using an async iterator to return\neach successive step. Memo is the initial state of the reduction. This\nfunction only operates in series. For performance reasons, it may make sense to\nsplit a call to this function into a parallel map, then use the normal\nArray.prototype.reduce on the results. This function is for situations where\neach step in the reduction needs to be async, if you can get the data before\nreducing it then it's probably a good idea to do so.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* memo - The initial state of the reduction.\n* iterator(memo, item, callback) - A function applied to each item in the\n array to produce the next step in the reduction. The iterator is passed a\n callback(err, reduction) which accepts an optional error as its first \n argument, and the state of the reduction as the second. If an error is \n passed to the callback, the reduction is stopped and the main callback is \n immediately called with the error.\n* callback(err, result) - A callback which is called after all the iterator\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n\n### reduceRight(arr, memo, iterator, callback)\n\n__Alias:__ foldr\n\nSame as reduce, only operates on the items in the array in reverse order.\n\n\n---------------------------------------\n\n\n### detect(arr, iterator, callback)\n\nReturns the first value in a list that passes an async truth test. The\niterator is applied in parallel, meaning the first iterator to return true will\nfire the detect callback with that result. That means the result might not be\nthe first item in the original array (in terms of order) that passes the test.\n\nIf order within the original array is important then look at detectSeries.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value undefined if none passed.\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n---------------------------------------\n\n\n### detectSeries(arr, iterator, callback)\n\nThe same as detect, only the iterator is applied to each item in the array\nin series. This means the result is always the first in the original array (in\nterms of array order) that passes the truth test.\n\n\n---------------------------------------\n\n\n### sortBy(arr, iterator, callback)\n\nSorts a list by the results of running each value through an async iterator.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, sortValue) which must be called once it\n has completed with an error (which can be null) and a value to use as the sort\n criteria.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is the items from\n the original array sorted by the values returned by the iterator calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n---------------------------------------\n\n\n### some(arr, iterator, callback)\n\n__Alias:__ any\n\nReturns true if at least one element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists. Once any iterator\ncall returns true, the main callback is immediately called.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called as soon as any iterator returns\n true, or after all the iterator functions have finished. Result will be\n either true or false depending on the values of the async tests.\n\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n---------------------------------------\n\n\n### every(arr, iterator, callback)\n\n__Alias:__ all\n\nReturns true if every element in the array satisfies an async test.\n_The callback for each iterator call only accepts a single argument of true or\nfalse, it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like fs.exists.\n\n__Arguments__\n\n* arr - An array to iterate over.\n* iterator(item, callback) - A truth test to apply to each item in the array.\n The iterator is passed a callback(truthValue) which must be called with a \n boolean argument once it has completed.\n* callback(result) - A callback which is called after all the iterator\n functions have finished. Result will be either true or false depending on\n the values of the async tests.\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n---------------------------------------\n\n\n### concat(arr, iterator, callback)\n\nApplies an iterator to each item in a list, concatenating the results. Returns the\nconcatenated list. The iterators are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of the arguments passed to the iterator function.\n\n__Arguments__\n\n* arr - An array to iterate over\n* iterator(item, callback) - A function to apply to each item in the array.\n The iterator is passed a callback(err, results) which must be called once it \n has completed with an error (which can be null) and an array of results.\n* callback(err, results) - A callback which is called after all the iterator\n functions have finished, or an error has occurred. Results is an array containing\n the concatenated results of the iterator function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n---------------------------------------\n\n\n### concatSeries(arr, iterator, callback)\n\nSame as async.concat, but executes in series instead of parallel.\n\n\n## Control Flow\n\n\n### series(tasks, [callback])\n\nRun an array of functions in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run and the callback for the series is\nimmediately called with the value of the error. Once the tasks have completed,\nthe results are passed to the final callback as an array.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.series.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed\n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallel(tasks, [callback])\n\nRun an array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main callback is immediately called with the value of the error.\nOnce the tasks have completed, the results are passed to the final callback as an\narray.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final callback as an object\ninstead of an array. This can be a more readable way of handling results from\nasync.parallel.\n\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n\n### parallelLimit(tasks, limit, [callback])\n\nThe same as parallel only the tasks are executed in parallel with a maximum of \"limit\" \ntasks executing at any time.\n\nNote that the tasks are not executed in batches, so there is no guarantee that \nthe first \"limit\" tasks will complete before any others are started.\n\n__Arguments__\n\n* tasks - An array or object containing functions to run, each function is passed \n a callback(err, result) it must call on completion with an error (which can\n be null) and an optional result value.\n* limit - The maximum number of tasks to run at any time.\n* callback(err, results) - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all \n the result arguments passed to the task callbacks.\n\n---------------------------------------\n\n\n### whilst(test, fn, callback)\n\nRepeatedly call fn, while test returns true. Calls the callback when stopped,\nor an error occurs.\n\n__Arguments__\n\n* test() - synchronous truth test to perform before each execution of fn.\n* fn(callback) - A function to call each time the test passes. The function is\n passed a callback(err) which must be called once it has completed with an \n optional error argument.\n* callback(err) - A callback which is called after the test fails and repeated\n execution of fn has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n\n### doWhilst(fn, test, callback)\n\nThe post check version of whilst. To reflect the difference in the order of operations `test` and `fn` arguments are switched. `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n\n### until(test, fn, callback)\n\nRepeatedly call fn, until test returns true. Calls the callback when stopped,\nor an error occurs.\n\nThe inverse of async.whilst.\n\n---------------------------------------\n\n\n### doUntil(fn, test, callback)\n\nLike doWhilst except the test is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n\n### forever(fn, callback)\n\nCalls the asynchronous function 'fn' repeatedly, in series, indefinitely.\nIf an error is passed to fn's callback then 'callback' is called with the\nerror, otherwise it will never be called.\n\n---------------------------------------\n\n\n### waterfall(tasks, [callback])\n\nRuns an array of functions in series, each passing their results to the next in\nthe array. However, if any of the functions pass an error to the callback, the\nnext function is not executed and the main callback is immediately called with\nthe error.\n\n__Arguments__\n\n* tasks - An array of functions to run, each function is passed a \n callback(err, result1, result2, ...) it must call on completion. The first\n argument is an error (which can be null) and any further arguments will be \n passed as arguments in order to the next task.\n* callback(err, [results]) - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback){\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback){\n callback(null, 'three');\n },\n function(arg1, callback){\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done' \n});\n```\n\n---------------------------------------\n\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions f(), g() and h() would produce the result of\nf(g(h())), only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* functions... - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling the\ncallback after all functions have completed. If you only provide the first\nargument then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* fns - the asynchronous functions to all call with the same arguments\n* args... - any number of separate arguments to pass to the function\n* callback - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n---------------------------------------\n\n\n### applyEachSeries(arr, iterator, callback)\n\nThe same as applyEach only the functions are applied in series.\n\n---------------------------------------\n\n\n### queue(worker, concurrency)\n\nCreates a queue object with the specified concurrency. Tasks added to the\nqueue will be processed in parallel (up to the concurrency limit). If all\nworkers are in progress, the task is queued until one is available. Once\na worker has completed a task, the task's callback is called.\n\n__Arguments__\n\n* worker(task, callback) - An asynchronous function for processing a queued\n task, which must call its callback(err) argument when finished, with an \n optional error as an argument.\n* concurrency - An integer for determining how many worker functions should be\n run in parallel.\n\n__Queue objects__\n\nThe queue object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* concurrency - an integer for determining how many worker functions should be\n run in parallel. This property can be changed after a queue is created to\n alter the concurrency on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* unshift(task, [callback]) - add a new task to the front of the queue.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n---------------------------------------\n\n\n### cargo(worker, [payload])\n\nCreates a cargo object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the payload limit). If the\nworker is in progress, the task is queued until it is available. Once\nthe worker has completed some tasks, each callback of those tasks is called.\n\n__Arguments__\n\n* worker(tasks, callback) - An asynchronous function for processing an array of\n queued tasks, which must call its callback(err) argument when finished, with \n an optional error as an argument.\n* payload - An optional integer for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe cargo object returned by this function has the following properties and\nmethods:\n\n* length() - a function returning the number of items waiting to be processed.\n* payload - an integer for determining how many tasks should be\n process per round. This property can be changed after a cargo is created to\n alter the payload on-the-fly.\n* push(task, [callback]) - add a new task to the queue, the callback is called\n once the worker has finished processing the task.\n instead of a single task, an array of tasks can be submitted. the respective callback is used for every task in the list.\n* saturated - a callback that is called when the queue length hits the concurrency and further tasks will be queued\n* empty - a callback that is called when the last item from the queue is given to a worker\n* drain - a callback that is called when the last item from the queue has returned from the worker\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i\n### auto(tasks, [callback])\n\nDetermines the best order for running functions based on their requirements.\nEach function can optionally depend on other functions being completed first,\nand each function is run as soon as its requirements are satisfied. If any of\nthe functions pass an error to their callback, that function will not complete\n(so any other functions depending on it will not run) and the main callback\nwill be called immediately with the error. Functions also receive an object\ncontaining the results of functions which have completed so far.\n\nNote, all functions are called with a results object as a second argument, \nso it is unsafe to pass functions in the tasks object which cannot handle the\nextra argument. For example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling readFile with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to readFile in a function which does not forward the \nresults object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* tasks - An object literal containing named functions or an array of\n requirements, with the function itself the last item in the array. The key\n used for each function or array is used when specifying requirements. The \n function receives two arguments: (1) a callback(err, result) which must be \n called when finished, passing an error (which can be null) and the result of \n the function's execution, and (2) a results object, containing the results of\n the previously executed functions.\n* callback(err, results) - An optional callback which is called when all the\n tasks have been completed. The callback will receive an error as an argument\n if any tasks pass an error to their callback. Results will always be passed\n\tbut if an error occurred, no other tasks will be performed, and the results\n\tobject will only contain partial results.\n \n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n // async code to get some data\n },\n make_folder: function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n },\n write_file: ['get_data', 'make_folder', function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, filename);\n }],\n email_link: ['write_file', function(callback, results){\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n }]\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n // async code to get some data\n },\n function(callback){\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n },\n function(callback){\n // once the file is written let's email a link to it...\n }\n ]);\n});\n```\n\nFor a complicated series of async tasks using the auto function makes adding\nnew tasks much easier and makes the code more readable.\n\n\n---------------------------------------\n\n\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the array,\nreturning a continuation to call the next one after that. It's also possible to\n'peek' the next iterator by doing iterator.next().\n\nThis function is used internally by the async module but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* tasks - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied, a useful\nshorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n\n### nextTick(callback)\n\nCalls the callback on a later loop around the event loop. In node.js this just\ncalls process.nextTick, in the browser it falls back to setImmediate(callback)\nif available, otherwise setTimeout(callback, 0), which means other higher priority\nevents may precede the execution of the callback.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* callback - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n\n### times(n, callback)\n\nCalls the callback n times and accumulates results in the same manner\nyou would use with async.map.\n\n__Arguments__\n\n* n - The number of times to run the function.\n* callback - The function to call n times.\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n\n### timesSeries(n, callback)\n\nThe same as times only the iterator is applied to each item in the array in\nseries. The next iterator is only called once the current one has completed\nprocessing. The results array will be in the same order as the original.\n\n\n## Utils\n\n\n### memoize(fn, [hasher])\n\nCaches the results of an async function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* fn - the function you to proxy and cache results from.\n* hasher - an optional function for generating a custom hash for storing\n results, it has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n\n### unmemoize(fn)\n\nUndoes a memoized function, reverting it to the original, unmemoized\nform. Comes handy in tests.\n\n__Arguments__\n\n* fn - the memoized function\n\n\n### log(function, arguments)\n\nLogs the result of an async function to the console. Only works in node.js or\nin browsers that support console.log and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.log is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n\n### dir(function, arguments)\n\nLogs the result of an async function to the console using console.dir to\ndisplay the properties of the resulting object. Only works in node.js or\nin browsers that support console.dir and console.error (such as FF and Chrome).\nIf multiple arguments are returned from the async function, console.dir is\ncalled on each argument in order.\n\n__Arguments__\n\n* function - The function you want to eventually apply all arguments to.\n* arguments... - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n\n### noConflict()\n\nChanges the value of async back to its original value, returning a reference to the\nasync object.\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/caolan/async",
+ "_id": "async@0.2.10",
+ "_from": "async@~0.2.9"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.npmignore b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.npmignore
new file mode 100644
index 000000000..9303c347e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.travis.yml b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.travis.yml
new file mode 100644
index 000000000..84fd7ca24
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
+ - 0.9
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/LICENSE b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/LICENSE
new file mode 100644
index 000000000..432d1aeb0
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/examples/pow.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/examples/pow.js
new file mode 100644
index 000000000..e6924212e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/examples/pow.js
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/index.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/index.js
new file mode 100644
index 000000000..fda6de8a2
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/index.js
@@ -0,0 +1,82 @@
+var path = require('path');
+var fs = require('fs');
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, mode, f, made) {
+ if (typeof mode === 'function' || mode === undefined) {
+ f = mode;
+ mode = 0777 & (~process.umask());
+ }
+ if (!made) made = null;
+
+ var cb = f || function () {};
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ fs.mkdir(p, mode, function (er) {
+ if (!er) {
+ made = made || p;
+ return cb(null, made);
+ }
+ switch (er.code) {
+ case 'ENOENT':
+ mkdirP(path.dirname(p), mode, function (er, made) {
+ if (er) cb(er, made);
+ else mkdirP(p, mode, cb, made);
+ });
+ break;
+
+ // In the case of any other error, just see if there's a dir
+ // there already. If so, then hooray! If not, then something
+ // is borked.
+ default:
+ fs.stat(p, function (er2, stat) {
+ // if the stat fails, then that's super weird.
+ // let the original error be the failure reason.
+ if (er2 || !stat.isDirectory()) cb(er, made)
+ else cb(null, made);
+ });
+ break;
+ }
+ });
+}
+
+mkdirP.sync = function sync (p, mode, made) {
+ if (mode === undefined) {
+ mode = 0777 & (~process.umask());
+ }
+ if (!made) made = null;
+
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ try {
+ fs.mkdirSync(p, mode);
+ made = made || p;
+ }
+ catch (err0) {
+ switch (err0.code) {
+ case 'ENOENT' :
+ made = sync(path.dirname(p), mode, made);
+ sync(p, mode, made);
+ break;
+
+ // In the case of any other error, just see if there's a dir
+ // there already. If so, then hooray! If not, then something
+ // is borked.
+ default:
+ var stat;
+ try {
+ stat = fs.statSync(p);
+ }
+ catch (err1) {
+ throw err0;
+ }
+ if (!stat.isDirectory()) throw err0;
+ break;
+ }
+ }
+
+ return made;
+};
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/package.json b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/package.json
new file mode 100644
index 000000000..221a22e3f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "mkdirp",
+ "description": "Recursively mkdir, like `mkdir -p`",
+ "version": "0.3.5",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "main": "./index",
+ "keywords": [
+ "mkdir",
+ "directory"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/substack/node-mkdirp.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "devDependencies": {
+ "tap": "~0.4.0"
+ },
+ "license": "MIT",
+ "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n",
+ "readmeFilename": "readme.markdown",
+ "bugs": {
+ "url": "https://github.com/substack/node-mkdirp/issues"
+ },
+ "homepage": "https://github.com/substack/node-mkdirp",
+ "_id": "mkdirp@0.3.5",
+ "_from": "mkdirp@~0.3.5"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/readme.markdown b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/readme.markdown
new file mode 100644
index 000000000..83b0216ab
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/readme.markdown
@@ -0,0 +1,63 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, mode, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+## mkdirp.sync(dir, mode)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+# license
+
+MIT
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/chmod.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/chmod.js
new file mode 100644
index 000000000..520dcb8e9
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/chmod.js
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+ var mode = 0744
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+ t.end();
+ });
+ });
+});
+
+test('chmod', function (t) {
+ var mode = 0755
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.end();
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/clobber.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/clobber.js
new file mode 100644
index 000000000..0eb709987
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/clobber.js
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+ console.error("about to write to "+itw)
+ fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+ fs.stat(itw, function (er, stat) {
+ t.ifError(er)
+ t.ok(stat && stat.isFile(), 'should be file')
+ t.end()
+ })
+})
+
+test('clobber', function (t) {
+ t.plan(2);
+ mkdirp(file, 0755, function (err) {
+ t.ok(err);
+ t.equal(err.code, 'ENOTDIR');
+ t.end();
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/mkdirp.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/mkdirp.js
new file mode 100644
index 000000000..b07cd70c1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/mkdirp.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('woo', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm.js
new file mode 100644
index 000000000..23a7abbd2
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('async perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
+
+test('async root perm', function (t) {
+ mkdirp('/tmp', 0755, function (err) {
+ if (err) t.fail(err);
+ t.end();
+ });
+ t.end();
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm_sync.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm_sync.js
new file mode 100644
index 000000000..f685f6090
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/perm_sync.js
@@ -0,0 +1,39 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
+
+test('sync root perm', function (t) {
+ t.plan(1);
+
+ var file = '/tmp';
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/race.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/race.js
new file mode 100644
index 000000000..96a044763
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/race.js
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('race', function (t) {
+ t.plan(4);
+ var ps = [ '', 'tmp' ];
+
+ for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+ }
+ var file = ps.join('/');
+
+ var res = 2;
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ function mk (file, cb) {
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ if (cb) cb();
+ }
+ })
+ })
+ });
+ }
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/rel.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/rel.js
new file mode 100644
index 000000000..79858243a
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/rel.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('rel', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var cwd = process.cwd();
+ process.chdir('/tmp');
+
+ var file = [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ process.chdir(cwd);
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return.js
new file mode 100644
index 000000000..bce68e561
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return.js
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+ t.plan(4);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ // should return the first dir created.
+ // By this point, it would be profoundly surprising if /tmp didn't
+ // already exist, since every other test makes things in there.
+ mkdirp(file, function (err, made) {
+ t.ifError(err);
+ t.equal(made, '/tmp/' + x);
+ mkdirp(file, function (err, made) {
+ t.ifError(err);
+ t.equal(made, null);
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return_sync.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return_sync.js
new file mode 100644
index 000000000..7c222d355
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/return_sync.js
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ // should return the first dir created.
+ // By this point, it would be profoundly surprising if /tmp didn't
+ // already exist, since every other test makes things in there.
+ // Note that this will throw on failure, which will fail the test.
+ var made = mkdirp.sync(file);
+ t.equal(made, '/tmp/' + x);
+
+ // making the same file again should have no effect.
+ made = mkdirp.sync(file);
+ t.equal(made, null);
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/root.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/root.js
new file mode 100644
index 000000000..97ad7a2f3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/root.js
@@ -0,0 +1,18 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('root', function (t) {
+ // '/' on unix, 'c:/' on windows.
+ var file = path.resolve('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) throw err
+ fs.stat(file, function (er, stat) {
+ if (er) throw er
+ t.ok(stat.isDirectory(), 'target is a directory');
+ t.end();
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/sync.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/sync.js
new file mode 100644
index 000000000..7530cada8
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ try {
+ mkdirp.sync(file, 0755);
+ } catch (err) {
+ t.fail(err);
+ return t.end();
+ }
+
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask.js
new file mode 100644
index 000000000..64ccafe22
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('implicit mode from umask', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask_sync.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask_sync.js
new file mode 100644
index 000000000..35bd5cbbf
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/mkdirp/test/umask_sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('umask sync modes', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ try {
+ mkdirp.sync(file);
+ } catch (err) {
+ t.fail(err);
+ return t.end();
+ }
+
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/AUTHORS b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/AUTHORS
new file mode 100644
index 000000000..247b75437
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/AUTHORS
@@ -0,0 +1,6 @@
+# Authors sorted by whether or not they're me.
+Isaac Z. Schlueter (http://blog.izs.me)
+Wayne Larsen (http://github.com/wvl)
+ritch
+Marcel Laverdet
+Yosef Dinerstein
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/LICENSE b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/LICENSE
new file mode 100644
index 000000000..05a401094
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/README.md b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/README.md
new file mode 100644
index 000000000..cd123b652
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/README.md
@@ -0,0 +1,30 @@
+`rm -rf` for node.
+
+Install with `npm install rimraf`, or just drop rimraf.js somewhere.
+
+## API
+
+`rimraf(f, callback)`
+
+The callback will be called with an error if there is one. Certain
+errors are handled for you:
+
+* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of
+ `opts.maxBusyTries` times before giving up.
+* `ENOENT` - If the file doesn't exist, rimraf will return
+ successfully, since your desired outcome is already the case.
+
+## rimraf.sync
+
+It can remove stuff synchronously, too. But that's not so good. Use
+the async API. It's better.
+
+## CLI
+
+If installed with `npm install rimraf -g` it can be used as a global
+command `rimraf ` which is useful for cross platform support.
+
+## mkdirp
+
+If you need to create a directory recursively, check out
+[mkdirp](https://github.com/substack/node-mkdirp).
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/bin.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/bin.js
new file mode 100644
index 000000000..29bfa8a63
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/bin.js
@@ -0,0 +1,33 @@
+#!/usr/bin/env node
+
+var rimraf = require('./')
+
+var help = false
+var dashdash = false
+var args = process.argv.slice(2).filter(function(arg) {
+ if (dashdash)
+ return !!arg
+ else if (arg === '--')
+ dashdash = true
+ else if (arg.match(/^(-+|\/)(h(elp)?|\?)$/))
+ help = true
+ else
+ return !!arg
+});
+
+if (help || args.length === 0) {
+ // If they didn't ask for help, then this is not a "success"
+ var log = help ? console.log : console.error
+ log('Usage: rimraf ')
+ log('')
+ log(' Deletes all files and folders at "path" recursively.')
+ log('')
+ log('Options:')
+ log('')
+ log(' -h, --help Display this usage info')
+ process.exit(help ? 0 : 1)
+} else {
+ args.forEach(function(arg) {
+ rimraf.sync(arg)
+ })
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/package.json b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/package.json
new file mode 100644
index 000000000..3737e7805
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/package.json
@@ -0,0 +1,56 @@
+{
+ "name": "rimraf",
+ "version": "2.2.8",
+ "main": "rimraf.js",
+ "description": "A deep deletion module for node (like `rm -rf`)",
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": {
+ "type": "MIT",
+ "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/rimraf.git"
+ },
+ "scripts": {
+ "test": "cd test && bash run.sh"
+ },
+ "bin": {
+ "rimraf": "./bin.js"
+ },
+ "contributors": [
+ {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me"
+ },
+ {
+ "name": "Wayne Larsen",
+ "email": "wayne@larsen.st",
+ "url": "http://github.com/wvl"
+ },
+ {
+ "name": "ritch",
+ "email": "skawful@gmail.com"
+ },
+ {
+ "name": "Marcel Laverdet"
+ },
+ {
+ "name": "Yosef Dinerstein",
+ "email": "yosefd@microsoft.com"
+ }
+ ],
+ "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/rimraf/issues"
+ },
+ "homepage": "https://github.com/isaacs/rimraf",
+ "_id": "rimraf@2.2.8",
+ "_from": "rimraf@~2.2.2"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/rimraf.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/rimraf.js
new file mode 100644
index 000000000..eb96c46af
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/rimraf.js
@@ -0,0 +1,248 @@
+module.exports = rimraf
+rimraf.sync = rimrafSync
+
+var assert = require("assert")
+var path = require("path")
+var fs = require("fs")
+
+// for EMFILE handling
+var timeout = 0
+exports.EMFILE_MAX = 1000
+exports.BUSYTRIES_MAX = 3
+
+var isWindows = (process.platform === "win32")
+
+function defaults (options) {
+ var methods = [
+ 'unlink',
+ 'chmod',
+ 'stat',
+ 'rmdir',
+ 'readdir'
+ ]
+ methods.forEach(function(m) {
+ options[m] = options[m] || fs[m]
+ m = m + 'Sync'
+ options[m] = options[m] || fs[m]
+ })
+}
+
+function rimraf (p, options, cb) {
+ if (typeof options === 'function') {
+ cb = options
+ options = {}
+ }
+ assert(p)
+ assert(options)
+ assert(typeof cb === 'function')
+
+ defaults(options)
+
+ if (!cb) throw new Error("No callback passed to rimraf()")
+
+ var busyTries = 0
+ rimraf_(p, options, function CB (er) {
+ if (er) {
+ if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") &&
+ busyTries < exports.BUSYTRIES_MAX) {
+ busyTries ++
+ var time = busyTries * 100
+ // try again, with the same exact callback as this one.
+ return setTimeout(function () {
+ rimraf_(p, options, CB)
+ }, time)
+ }
+
+ // this one won't happen if graceful-fs is used.
+ if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) {
+ return setTimeout(function () {
+ rimraf_(p, options, CB)
+ }, timeout ++)
+ }
+
+ // already gone
+ if (er.code === "ENOENT") er = null
+ }
+
+ timeout = 0
+ cb(er)
+ })
+}
+
+// Two possible strategies.
+// 1. Assume it's a file. unlink it, then do the dir stuff on EPERM or EISDIR
+// 2. Assume it's a directory. readdir, then do the file stuff on ENOTDIR
+//
+// Both result in an extra syscall when you guess wrong. However, there
+// are likely far more normal files in the world than directories. This
+// is based on the assumption that a the average number of files per
+// directory is >= 1.
+//
+// If anyone ever complains about this, then I guess the strategy could
+// be made configurable somehow. But until then, YAGNI.
+function rimraf_ (p, options, cb) {
+ assert(p)
+ assert(options)
+ assert(typeof cb === 'function')
+
+ options.unlink(p, function (er) {
+ if (er) {
+ if (er.code === "ENOENT")
+ return cb(null)
+ if (er.code === "EPERM")
+ return (isWindows)
+ ? fixWinEPERM(p, options, er, cb)
+ : rmdir(p, options, er, cb)
+ if (er.code === "EISDIR")
+ return rmdir(p, options, er, cb)
+ }
+ return cb(er)
+ })
+}
+
+function fixWinEPERM (p, options, er, cb) {
+ assert(p)
+ assert(options)
+ assert(typeof cb === 'function')
+ if (er)
+ assert(er instanceof Error)
+
+ options.chmod(p, 666, function (er2) {
+ if (er2)
+ cb(er2.code === "ENOENT" ? null : er)
+ else
+ options.stat(p, function(er3, stats) {
+ if (er3)
+ cb(er3.code === "ENOENT" ? null : er)
+ else if (stats.isDirectory())
+ rmdir(p, options, er, cb)
+ else
+ options.unlink(p, cb)
+ })
+ })
+}
+
+function fixWinEPERMSync (p, options, er) {
+ assert(p)
+ assert(options)
+ if (er)
+ assert(er instanceof Error)
+
+ try {
+ options.chmodSync(p, 666)
+ } catch (er2) {
+ if (er2.code === "ENOENT")
+ return
+ else
+ throw er
+ }
+
+ try {
+ var stats = options.statSync(p)
+ } catch (er3) {
+ if (er3.code === "ENOENT")
+ return
+ else
+ throw er
+ }
+
+ if (stats.isDirectory())
+ rmdirSync(p, options, er)
+ else
+ options.unlinkSync(p)
+}
+
+function rmdir (p, options, originalEr, cb) {
+ assert(p)
+ assert(options)
+ if (originalEr)
+ assert(originalEr instanceof Error)
+ assert(typeof cb === 'function')
+
+ // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
+ // if we guessed wrong, and it's not a directory, then
+ // raise the original error.
+ options.rmdir(p, function (er) {
+ if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM"))
+ rmkids(p, options, cb)
+ else if (er && er.code === "ENOTDIR")
+ cb(originalEr)
+ else
+ cb(er)
+ })
+}
+
+function rmkids(p, options, cb) {
+ assert(p)
+ assert(options)
+ assert(typeof cb === 'function')
+
+ options.readdir(p, function (er, files) {
+ if (er)
+ return cb(er)
+ var n = files.length
+ if (n === 0)
+ return options.rmdir(p, cb)
+ var errState
+ files.forEach(function (f) {
+ rimraf(path.join(p, f), options, function (er) {
+ if (errState)
+ return
+ if (er)
+ return cb(errState = er)
+ if (--n === 0)
+ options.rmdir(p, cb)
+ })
+ })
+ })
+}
+
+// this looks simpler, and is strictly *faster*, but will
+// tie up the JavaScript thread and fail on excessively
+// deep directory trees.
+function rimrafSync (p, options) {
+ options = options || {}
+ defaults(options)
+
+ assert(p)
+ assert(options)
+
+ try {
+ options.unlinkSync(p)
+ } catch (er) {
+ if (er.code === "ENOENT")
+ return
+ if (er.code === "EPERM")
+ return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er)
+ if (er.code !== "EISDIR")
+ throw er
+ rmdirSync(p, options, er)
+ }
+}
+
+function rmdirSync (p, options, originalEr) {
+ assert(p)
+ assert(options)
+ if (originalEr)
+ assert(originalEr instanceof Error)
+
+ try {
+ options.rmdirSync(p)
+ } catch (er) {
+ if (er.code === "ENOENT")
+ return
+ if (er.code === "ENOTDIR")
+ throw originalEr
+ if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")
+ rmkidsSync(p, options)
+ }
+}
+
+function rmkidsSync (p, options) {
+ assert(p)
+ assert(options)
+ options.readdirSync(p).forEach(function (f) {
+ rimrafSync(path.join(p, f), options)
+ })
+ options.rmdirSync(p, options)
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/run.sh b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/run.sh
new file mode 100644
index 000000000..653ff9b79
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/run.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+set -e
+code=0
+for i in test-*.js; do
+ echo -n $i ...
+ bash setup.sh
+ node $i
+ if [ -d target ]; then
+ echo "fail"
+ code=1
+ else
+ echo "pass"
+ fi
+done
+rm -rf target
+exit $code
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/setup.sh b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/setup.sh
new file mode 100644
index 000000000..2602e6316
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/setup.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+
+set -e
+
+files=10
+folders=2
+depth=4
+target="$PWD/target"
+
+rm -rf target
+
+fill () {
+ local depth=$1
+ local files=$2
+ local folders=$3
+ local target=$4
+
+ if ! [ -d $target ]; then
+ mkdir -p $target
+ fi
+
+ local f
+
+ f=$files
+ while [ $f -gt 0 ]; do
+ touch "$target/f-$depth-$f"
+ let f--
+ done
+
+ let depth--
+
+ if [ $depth -le 0 ]; then
+ return 0
+ fi
+
+ f=$folders
+ while [ $f -gt 0 ]; do
+ mkdir "$target/folder-$depth-$f"
+ fill $depth $files $folders "$target/d-$depth-$f"
+ let f--
+ done
+}
+
+fill $depth $files $folders $target
+
+# sanity assert
+[ -d $target ]
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-async.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-async.js
new file mode 100644
index 000000000..9c2e0b7be
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-async.js
@@ -0,0 +1,5 @@
+var rimraf = require("../rimraf")
+ , path = require("path")
+rimraf(path.join(__dirname, "target"), function (er) {
+ if (er) throw er
+})
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-sync.js b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-sync.js
new file mode 100644
index 000000000..eb71f1047
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/node_modules/rimraf/test/test-sync.js
@@ -0,0 +1,3 @@
+var rimraf = require("../rimraf")
+ , path = require("path")
+rimraf.sync(path.join(__dirname, "target"))
diff --git a/node_modules/basarat-text-buffer/node_modules/fs-plus/package.json b/node_modules/basarat-text-buffer/node_modules/fs-plus/package.json
new file mode 100644
index 000000000..da2f506ef
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/fs-plus/package.json
@@ -0,0 +1,47 @@
+{
+ "name": "fs-plus",
+ "version": "2.5.0",
+ "description": "node's fs with more helpers",
+ "main": "./lib/fs-plus.js",
+ "scripts": {
+ "prepublish": "grunt prepublish",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/atom/fs-plus.git"
+ },
+ "bugs": {
+ "url": "https://github.com/atom/fs-plus/issues"
+ },
+ "homepage": "http://atom.github.io/fs-plus",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/fs-plus/raw/master/LICENSE.md"
+ }
+ ],
+ "keywords": [
+ "fs",
+ "filesystem"
+ ],
+ "devDependencies": {
+ "jasmine-focused": "1.x",
+ "grunt-contrib-coffee": "~0.9.0",
+ "grunt-cli": "~0.1.8",
+ "grunt": "~0.4.1",
+ "grunt-shell": "~0.2.2",
+ "grunt-coffeelint": "0.0.6",
+ "temp": "~0.6.0"
+ },
+ "dependencies": {
+ "underscore-plus": "1.x",
+ "mkdirp": "~0.3.5",
+ "rimraf": "~2.2.2",
+ "async": "~0.2.9"
+ },
+ "readme": "# fs plus [](https://travis-ci.org/atom/fs-plus)\n\nYet another filesystem helper based on node's [fs](http://nodejs.org/api/fs.html)\nmodule. This library exports everything from node's fs module but with some\nextra helpers.\n\n## Using\n\n```sh\nnpm install fs-plus\n```\n\n```coffee\nfs = require 'fs-plus'\n```\n",
+ "readmeFilename": "README.md",
+ "_id": "fs-plus@2.5.0",
+ "_from": "fs-plus@^2.0.0"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/grim/LICENSE.md
new file mode 100644
index 000000000..4d231b456
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2014 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/README.md b/node_modules/basarat-text-buffer/node_modules/grim/README.md
new file mode 100644
index 000000000..c7a023c2a
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/README.md
@@ -0,0 +1,21 @@
+# Grim [](https://travis-ci.org/atom/grim)
+
+Log deprecate calls
+
+## Installing
+
+```sh
+npm install grim
+```
+
+## Usage
+
+```javascript
+Grim = require('grim')
+
+function someOldMethod() {
+ Grim.deprecate("Use theNewMethod instead.")
+}
+```
+
+To view all calls to deprecated methods use `Grim.logDeprecations()` or get direct access to the deprecated calls by using `Grim.getDeprecations()`
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/lib/deprecation.js b/node_modules/basarat-text-buffer/node_modules/grim/lib/deprecation.js
new file mode 100644
index 000000000..0be0442e9
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/lib/deprecation.js
@@ -0,0 +1,150 @@
+(function() {
+ var Deprecation, SourceMapCache, convertLine;
+
+ convertLine = require('coffeestack').convertLine;
+
+ SourceMapCache = {};
+
+ module.exports = Deprecation = (function() {
+ Deprecation.getFunctionNameFromCallsite = function(callsite) {};
+
+ Deprecation.deserialize = function(_arg) {
+ var deprecation, fileName, lineNumber, message, stack, stacks, _i, _len;
+ message = _arg.message, fileName = _arg.fileName, lineNumber = _arg.lineNumber, stacks = _arg.stacks;
+ deprecation = new Deprecation(message, fileName, lineNumber);
+ for (_i = 0, _len = stacks.length; _i < _len; _i++) {
+ stack = stacks[_i];
+ deprecation.addStack(stack, stack.metadata);
+ }
+ return deprecation;
+ };
+
+ function Deprecation(message, fileName, lineNumber) {
+ this.message = message;
+ this.fileName = fileName;
+ this.lineNumber = lineNumber;
+ this.callCount = 0;
+ this.stacks = {};
+ this.stackCallCounts = {};
+ }
+
+ Deprecation.prototype.getFunctionNameFromCallsite = function(callsite) {
+ var _ref, _ref1, _ref2;
+ if (callsite.functionName != null) {
+ return callsite.functionName;
+ }
+ if (callsite.isToplevel()) {
+ return (_ref = callsite.getFunctionName()) != null ? _ref : '';
+ } else {
+ if (callsite.isConstructor()) {
+ return "new " + (callsite.getFunctionName());
+ } else if (callsite.getMethodName() && !callsite.getFunctionName()) {
+ return callsite.getMethodName();
+ } else {
+ return "" + (callsite.getTypeName()) + "." + ((_ref1 = (_ref2 = callsite.getMethodName()) != null ? _ref2 : callsite.getFunctionName()) != null ? _ref1 : '');
+ }
+ }
+ };
+
+ Deprecation.prototype.getLocationFromCallsite = function(callsite) {
+ var column, converted, fileName, line;
+ if (callsite.location != null) {
+ return callsite.location;
+ }
+ if (callsite.isNative()) {
+ return "native";
+ } else if (callsite.isEval()) {
+ return "eval at " + (this.getLocationFromCallsite(callsite.getEvalOrigin()));
+ } else {
+ fileName = callsite.getFileName();
+ line = callsite.getLineNumber();
+ column = callsite.getColumnNumber();
+ if (/\.coffee$/.test(fileName)) {
+ if (converted = convertLine(fileName, line, column, SourceMapCache)) {
+ line = converted.line, column = converted.column;
+ }
+ }
+ return "" + fileName + ":" + line + ":" + column;
+ }
+ };
+
+ Deprecation.prototype.getFileNameFromCallSite = function(callsite) {
+ var _ref;
+ return (_ref = callsite.fileName) != null ? _ref : callsite.getFileName();
+ };
+
+ Deprecation.prototype.getOriginName = function() {
+ return this.originName;
+ };
+
+ Deprecation.prototype.getMessage = function() {
+ return this.message;
+ };
+
+ Deprecation.prototype.getStacks = function() {
+ var location, parsedStack, parsedStacks, stack, _ref;
+ parsedStacks = [];
+ _ref = this.stacks;
+ for (location in _ref) {
+ stack = _ref[location];
+ parsedStack = this.parseStack(stack);
+ parsedStack.callCount = this.stackCallCounts[location];
+ parsedStack.metadata = stack.metadata;
+ parsedStacks.push(parsedStack);
+ }
+ return parsedStacks;
+ };
+
+ Deprecation.prototype.getCallCount = function() {
+ return this.callCount;
+ };
+
+ Deprecation.prototype.addStack = function(stack, metadata) {
+ var callerLocation, _base, _base1, _base2;
+ if (this.originName == null) {
+ this.originName = this.getFunctionNameFromCallsite(stack[0]);
+ }
+ if (this.fileName == null) {
+ this.fileName = this.getFileNameFromCallSite(stack[0]);
+ }
+ if (this.lineNumber == null) {
+ this.lineNumber = typeof (_base = stack[0]).getLineNumber === "function" ? _base.getLineNumber() : void 0;
+ }
+ this.callCount++;
+ stack.metadata = metadata;
+ callerLocation = this.getLocationFromCallsite(stack[1]);
+ if ((_base1 = this.stacks)[callerLocation] == null) {
+ _base1[callerLocation] = stack;
+ }
+ if ((_base2 = this.stackCallCounts)[callerLocation] == null) {
+ _base2[callerLocation] = 0;
+ }
+ return this.stackCallCounts[callerLocation]++;
+ };
+
+ Deprecation.prototype.parseStack = function(stack) {
+ return stack.map((function(_this) {
+ return function(callsite) {
+ return {
+ functionName: _this.getFunctionNameFromCallsite(callsite),
+ location: _this.getLocationFromCallsite(callsite),
+ fileName: _this.getFileNameFromCallSite(callsite)
+ };
+ };
+ })(this));
+ };
+
+ Deprecation.prototype.serialize = function() {
+ return {
+ message: this.getMessage(),
+ lineNumber: this.lineNumber,
+ fileName: this.fileName,
+ stacks: this.getStacks()
+ };
+ };
+
+ return Deprecation;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/lib/grim.js b/node_modules/basarat-text-buffer/node_modules/grim/lib/grim.js
new file mode 100644
index 000000000..b90fa888c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/lib/grim.js
@@ -0,0 +1,93 @@
+(function() {
+ var Deprecation, Emitter, grim;
+
+ Emitter = require('emissary').Emitter;
+
+ Deprecation = require('./deprecation');
+
+ if (global.__grim__ == null) {
+ grim = global.__grim__ = {
+ deprecations: {},
+ getDeprecations: function() {
+ var deprecation, deprecations, deprecationsByLineNumber, fileName, lineNumber, _ref;
+ deprecations = [];
+ _ref = grim.deprecations;
+ for (fileName in _ref) {
+ deprecationsByLineNumber = _ref[fileName];
+ for (lineNumber in deprecationsByLineNumber) {
+ deprecation = deprecationsByLineNumber[lineNumber];
+ deprecations.push(deprecation);
+ }
+ }
+ return deprecations;
+ },
+ getDeprecationsLength: function() {
+ return this.getDeprecations().length;
+ },
+ clearDeprecations: function() {
+ grim.deprecations = {};
+ },
+ logDeprecations: function() {
+ var deprecation, deprecations, _i, _len;
+ deprecations = this.getDeprecations();
+ deprecations.sort(function(a, b) {
+ return b.getCallCount() - a.getCallCount();
+ });
+ console.warn("\nCalls to deprecated functions\n-----------------------------");
+ for (_i = 0, _len = deprecations.length; _i < _len; _i++) {
+ deprecation = deprecations[_i];
+ console.warn("(" + (deprecation.getCallCount()) + ") " + (deprecation.getOriginName()) + " : " + (deprecation.getMessage()), deprecation);
+ }
+ },
+ deprecate: function(message, metadata) {
+ var deprecation, deprecationSite, error, fileName, lineNumber, originalPrepareStackTrace, originalStackTraceLimit, stack, _base, _base1;
+ originalStackTraceLimit = Error.stackTraceLimit;
+ Error.stackTraceLimit = 3;
+ error = new Error;
+ Error.captureStackTrace(error);
+ Error.stackTraceLimit = originalStackTraceLimit;
+ originalPrepareStackTrace = Error.prepareStackTrace;
+ Error.prepareStackTrace = function(error, stack) {
+ return stack;
+ };
+ stack = error.stack.slice(1);
+ Error.prepareStackTrace = originalPrepareStackTrace;
+ deprecationSite = stack[0];
+ fileName = deprecationSite.getFileName();
+ lineNumber = deprecationSite.getLineNumber();
+ if ((_base = grim.deprecations)[fileName] == null) {
+ _base[fileName] = {};
+ }
+ if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {
+ _base1[lineNumber] = new Deprecation(message);
+ }
+ deprecation = grim.deprecations[fileName][lineNumber];
+ deprecation.addStack(stack, metadata);
+ grim.emit("updated", deprecation);
+ },
+ addSerializedDeprecation: function(serializedDeprecation) {
+ var deprecation, fileName, lineNumber, message, stack, stacks, _base, _base1, _i, _len;
+ deprecation = Deprecation.deserialize(serializedDeprecation);
+ message = deprecation.getMessage();
+ fileName = deprecation.fileName, lineNumber = deprecation.lineNumber;
+ stacks = deprecation.getStacks();
+ if ((_base = grim.deprecations)[fileName] == null) {
+ _base[fileName] = {};
+ }
+ if ((_base1 = grim.deprecations[fileName])[lineNumber] == null) {
+ _base1[lineNumber] = new Deprecation(message, fileName, lineNumber);
+ }
+ deprecation = grim.deprecations[fileName][lineNumber];
+ for (_i = 0, _len = stacks.length; _i < _len; _i++) {
+ stack = stacks[_i];
+ deprecation.addStack(stack, stack.metadata);
+ }
+ grim.emit("updated", deprecation);
+ }
+ };
+ Emitter.extend(grim);
+ }
+
+ module.exports = global.__grim__;
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/README.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/README.md
new file mode 100644
index 000000000..f3f64b708
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/README.md
@@ -0,0 +1,20 @@
+# CoffeeStack [](https://travis-ci.org/kevinsawicki/coffeestack)
+
+Module to convert JavaScript stack traces to CoffeeScript stack traces.
+
+## Installing
+
+```sh
+npm install coffeestack
+```
+
+## Using
+
+```coffeescript
+{convertStackTrace} = require 'coffeestack'
+
+try
+ throw new Error('this is an error')
+catch error
+ console.error(convertStackTrace(error.stack))
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/index.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/index.js
new file mode 100644
index 000000000..299875aba
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/index.js
@@ -0,0 +1,154 @@
+(function() {
+ var CoffeeScript, CoffeeScriptVersion, SourceMapConsumer, cachePath, compileSourceMap, convertLine, convertStackTrace, crypto, fs, getCachePath, getCachedSourceMap, getSourceMapPosition, path, writeSourceMapToCache;
+
+ crypto = require('crypto');
+
+ fs = require('fs-plus');
+
+ path = require('path');
+
+ CoffeeScriptVersion = null;
+
+ CoffeeScript = null;
+
+ SourceMapConsumer = null;
+
+ cachePath = null;
+
+ getCachePath = function(code) {
+ var digest;
+ if (!cachePath) {
+ return;
+ }
+ digest = crypto.createHash('sha1').update(code, 'utf8').digest('hex');
+ if (CoffeeScriptVersion == null) {
+ CoffeeScriptVersion = require('coffee-script/package.json').version;
+ }
+ return path.join(cachePath, CoffeeScriptVersion, "" + digest + ".json");
+ };
+
+ getCachedSourceMap = function(codeCachePath) {
+ if (fs.isFileSync(codeCachePath)) {
+ try {
+ return fs.readFileSync(codeCachePath, 'utf8');
+ } catch (_error) {}
+ }
+ };
+
+ writeSourceMapToCache = function(codeCachePath, sourceMap) {
+ if (codeCachePath) {
+ try {
+ fs.writeFileSync(codeCachePath, sourceMap);
+ } catch (_error) {}
+ }
+ };
+
+ compileSourceMap = function(code, filePath, codeCachePath) {
+ var v3SourceMap;
+ if (CoffeeScript == null) {
+ CoffeeScript = require('coffee-script');
+ }
+ v3SourceMap = CoffeeScript.compile(code, {
+ sourceMap: true,
+ filename: filePath
+ }).v3SourceMap;
+ writeSourceMapToCache(codeCachePath, v3SourceMap);
+ return v3SourceMap;
+ };
+
+ getSourceMapPosition = function(sourceMapContents, line, column) {
+ var sourceMap;
+ if (SourceMapConsumer == null) {
+ SourceMapConsumer = require('source-map').SourceMapConsumer;
+ }
+ sourceMap = new SourceMapConsumer(sourceMapContents);
+ return sourceMap.originalPositionFor({
+ line: line,
+ column: column
+ });
+ };
+
+ convertLine = function(filePath, line, column, sourceMaps) {
+ var code, codeCachePath, position, source, sourceMapContents, sourceMapPath;
+ if (sourceMaps == null) {
+ sourceMaps = {};
+ }
+ try {
+ if (!(sourceMapContents = sourceMaps[filePath])) {
+ if (path.extname(filePath) === '.js') {
+ sourceMapPath = "" + filePath + ".map";
+ sourceMapContents = fs.readFileSync(sourceMapPath, 'utf8');
+ } else {
+ code = fs.readFileSync(filePath, 'utf8');
+ codeCachePath = getCachePath(code);
+ sourceMapContents = getCachedSourceMap(codeCachePath);
+ if (sourceMapContents == null) {
+ sourceMapContents = compileSourceMap(code, filePath, codeCachePath);
+ }
+ }
+ }
+ if (sourceMapContents) {
+ sourceMaps[filePath] = sourceMapContents;
+ position = getSourceMapPosition(sourceMapContents, line, column);
+ if ((position.line != null) && (position.column != null)) {
+ if (position.source && position.source !== '.') {
+ source = path.resolve(filePath, '..', position.source);
+ } else {
+ source = filePath;
+ }
+ return {
+ line: position.line,
+ column: position.column,
+ source: source
+ };
+ }
+ }
+ } catch (_error) {}
+ return null;
+ };
+
+ convertStackTrace = function(stackTrace, sourceMaps) {
+ var atLinePattern, column, convertedLines, filePath, line, mappedLine, match, stackTraceLine, _i, _len, _ref;
+ if (sourceMaps == null) {
+ sourceMaps = {};
+ }
+ if (!stackTrace) {
+ return stackTrace;
+ }
+ convertedLines = [];
+ atLinePattern = /^(\s+at .* )\((.*):(\d+):(\d+)\)/;
+ _ref = stackTrace.split('\n');
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ stackTraceLine = _ref[_i];
+ if (match = atLinePattern.exec(stackTraceLine)) {
+ filePath = match[2];
+ line = match[3];
+ column = match[4];
+ if (path.extname(filePath) === '.js') {
+ mappedLine = convertLine(filePath, line, column, sourceMaps);
+ }
+ if (mappedLine != null) {
+ convertedLines.push("" + match[1] + "(" + mappedLine.source + ":" + mappedLine.line + ":" + mappedLine.column + ")");
+ } else {
+ convertedLines.push(stackTraceLine);
+ }
+ } else {
+ convertedLines.push(stackTraceLine);
+ }
+ }
+ return convertedLines.join('\n');
+ };
+
+ exports.convertLine = convertLine;
+
+ exports.convertStackTrace = convertStackTrace;
+
+ exports.setCacheDirectory = function(newCachePath) {
+ return cachePath = newCachePath;
+ };
+
+ exports.getCacheDirectory = function() {
+ return cachePath;
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake
new file mode 100644
index 000000000..da84bdc66
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=`dirname "$0"`
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../coffee-script/bin/cake" "$@"
+ ret=$?
+else
+ node "$basedir/../coffee-script/bin/cake" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake.cmd b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake.cmd
new file mode 100644
index 000000000..c649f3bee
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/cake.cmd
@@ -0,0 +1,5 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\coffee-script\bin\cake" %*
+) ELSE (
+ node "%~dp0\..\coffee-script\bin\cake" %*
+)
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee
new file mode 100644
index 000000000..04d88bf4e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=`dirname "$0"`
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../coffee-script/bin/coffee" "$@"
+ ret=$?
+else
+ node "$basedir/../coffee-script/bin/coffee" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee.cmd b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee.cmd
new file mode 100644
index 000000000..95ca13aa1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/.bin/coffee.cmd
@@ -0,0 +1,5 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\coffee-script\bin\coffee" %*
+) ELSE (
+ node "%~dp0\..\coffee-script\bin\coffee" %*
+)
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/.npmignore b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/.npmignore
new file mode 100644
index 000000000..21e430d2e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/.npmignore
@@ -0,0 +1,11 @@
+*.coffee
+*.html
+.DS_Store
+.git*
+Cakefile
+documentation/
+examples/
+extras/coffee-script.js
+raw/
+src/
+test/
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CNAME b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CNAME
new file mode 100644
index 000000000..faadabe5f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CNAME
@@ -0,0 +1 @@
+coffeescript.org
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CONTRIBUTING.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CONTRIBUTING.md
new file mode 100644
index 000000000..5ea4c5f3e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/CONTRIBUTING.md
@@ -0,0 +1,9 @@
+## How to contribute to CoffeeScript
+
+* Before you open a ticket or send a pull request, [search](https://github.com/jashkenas/coffeescript/issues) for previous discussions about the same feature or issue. Add to the earlier ticket if you find one.
+
+* Before sending a pull request for a feature, be sure to have [tests](https://github.com/jashkenas/coffeescript/tree/master/test).
+
+* Use the same coding style as the rest of the [codebase](https://github.com/jashkenas/coffeescript/tree/master/src). If you're just getting started with CoffeeScript, there's a nice [style guide](https://github.com/polarmobile/coffeescript-style-guide).
+
+* In your pull request, do not add documentation to `index.html` or re-build the minified `coffee-script.js` file. We'll do those things before cutting a new release.
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/LICENSE b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/LICENSE
new file mode 100644
index 000000000..4d09b4d96
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/LICENSE
@@ -0,0 +1,22 @@
+Copyright (c) 2009-2014 Jeremy Ashkenas
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README
new file mode 100644
index 000000000..37d7bbfe1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README
@@ -0,0 +1,50 @@
+ {
+ } } {
+ { { } }
+ } }{ {
+ { }{ } } _____ __ __
+ { }{ }{ { } / ____| / _|/ _|
+ .- { { } { }} -. | | ___ | |_| |_ ___ ___
+ ( { } { } { } } ) | | / _ \| _| _/ _ \/ _ \
+ |`-..________ ..-'| | |___| (_) | | | || __/ __/
+ | | \_____\___/|_| |_| \___|\___|
+ | ;--.
+ | (__ \ _____ _ _
+ | | ) ) / ____| (_) | |
+ | |/ / | (___ ___ _ __ _ _ __ | |_
+ | ( / \___ \ / __| '__| | '_ \| __|
+ | |/ ____) | (__| | | | |_) | |_
+ | | |_____/ \___|_| |_| .__/ \__|
+ `-.._________..-' | |
+ |_|
+
+
+ CoffeeScript is a little language that compiles into JavaScript.
+
+ If you have the Node Package Manager installed:
+ npm install -g coffee-script
+ (Leave off the -g if you don't wish to install globally.)
+
+ Or, if you don't wish to use npm:
+ sudo bin/cake install
+
+ Execute a script:
+ coffee /path/to/script.coffee
+
+ Compile a script:
+ coffee -c /path/to/script.coffee
+
+ For documentation, usage, and examples, see:
+ http://coffeescript.org/
+
+ To suggest a feature, report a bug, or general discussion:
+ http://github.com/jashkenas/coffeescript/issues/
+
+ If you'd like to chat, drop by #coffeescript on Freenode IRC,
+ or on webchat.freenode.net.
+
+ The source repository:
+ git://github.com/jashkenas/coffeescript.git
+
+ Top 100 contributors are listed here:
+ http://github.com/jashkenas/coffeescript/contributors
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README.md
new file mode 100644
index 000000000..90f6788c6
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/README.md
@@ -0,0 +1,60 @@
+ {
+ } } {
+ { { } }
+ } }{ {
+ { }{ } } _____ __ __
+ { }{ }{ { } / ____| / _|/ _|
+ .- { { } { }} -. | | ___ | |_| |_ ___ ___
+ ( { } { } { } } ) | | / _ \| _| _/ _ \/ _ \
+ |`-..________ ..-'| | |___| (_) | | | || __/ __/
+ | | \_____\___/|_| |_| \___|\___|
+ | ;--.
+ | (__ \ _____ _ _
+ | | ) ) / ____| (_) | |
+ | |/ / | (___ ___ _ __ _ _ __ | |_
+ | ( / \___ \ / __| '__| | '_ \| __|
+ | |/ ____) | (__| | | | |_) | |_
+ | | |_____/ \___|_| |_| .__/ \__|
+ `-.._________..-' | |
+ |_|
+
+CoffeeScript is a little language that compiles into JavaScript.
+
+## Installation
+
+If you have the node package manager, npm, installed:
+
+```shell
+npm install -g coffee-script
+```
+
+Leave off the `-g` if you don't wish to install globally. If you don't wish to use npm:
+
+```shell
+git clone https://github.com/jashkenas/coffeescript.git
+sudo coffeescript/bin/cake install
+```
+
+## Getting Started
+
+Execute a script:
+
+```shell
+coffee /path/to/script.coffee
+```
+
+Compile a script:
+
+```shell
+coffee -c /path/to/script.coffee
+```
+
+For documentation, usage, and examples, see: http://coffeescript.org/
+
+To suggest a feature or report a bug: http://github.com/jashkenas/coffeescript/issues
+
+If you'd like to chat, drop by #coffeescript on Freenode IRC.
+
+The source repository: https://github.com/jashkenas/coffeescript.git
+
+Our lovely and talented contributors are listed here: http://github.com/jashkenas/coffeescript/contributors
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/cake b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/cake
new file mode 100644
index 000000000..5965f4ee5
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/cake
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs = require('fs');
+var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/cake').run();
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/coffee b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/coffee
new file mode 100644
index 000000000..3d1d71c8c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/bin/coffee
@@ -0,0 +1,7 @@
+#!/usr/bin/env node
+
+var path = require('path');
+var fs = require('fs');
+var lib = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
+
+require(lib + '/coffee-script/command').run();
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/browser.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/browser.js
new file mode 100644
index 000000000..da2830d98
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/browser.js
@@ -0,0 +1,134 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var CoffeeScript, compile, runScripts,
+ __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; };
+
+ CoffeeScript = require('./coffee-script');
+
+ CoffeeScript.require = require;
+
+ compile = CoffeeScript.compile;
+
+ CoffeeScript["eval"] = function(code, options) {
+ if (options == null) {
+ options = {};
+ }
+ if (options.bare == null) {
+ options.bare = true;
+ }
+ return eval(compile(code, options));
+ };
+
+ CoffeeScript.run = function(code, options) {
+ if (options == null) {
+ options = {};
+ }
+ options.bare = true;
+ options.shiftLine = true;
+ return Function(compile(code, options))();
+ };
+
+ if (typeof window === "undefined" || window === null) {
+ return;
+ }
+
+ if ((typeof btoa !== "undefined" && btoa !== null) && (typeof JSON !== "undefined" && JSON !== null) && (typeof unescape !== "undefined" && unescape !== null) && (typeof encodeURIComponent !== "undefined" && encodeURIComponent !== null)) {
+ compile = function(code, options) {
+ var js, v3SourceMap, _ref;
+ if (options == null) {
+ options = {};
+ }
+ options.sourceMap = true;
+ options.inline = true;
+ _ref = CoffeeScript.compile(code, options), js = _ref.js, v3SourceMap = _ref.v3SourceMap;
+ return "" + js + "\n//# sourceMappingURL=data:application/json;base64," + (btoa(unescape(encodeURIComponent(v3SourceMap)))) + "\n//# sourceURL=coffeescript";
+ };
+ }
+
+ CoffeeScript.load = function(url, callback, options, hold) {
+ var xhr;
+ if (options == null) {
+ options = {};
+ }
+ if (hold == null) {
+ hold = false;
+ }
+ options.sourceFiles = [url];
+ xhr = window.ActiveXObject ? new window.ActiveXObject('Microsoft.XMLHTTP') : new window.XMLHttpRequest();
+ xhr.open('GET', url, true);
+ if ('overrideMimeType' in xhr) {
+ xhr.overrideMimeType('text/plain');
+ }
+ xhr.onreadystatechange = function() {
+ var param, _ref;
+ if (xhr.readyState === 4) {
+ if ((_ref = xhr.status) === 0 || _ref === 200) {
+ param = [xhr.responseText, options];
+ if (!hold) {
+ CoffeeScript.run.apply(CoffeeScript, param);
+ }
+ } else {
+ throw new Error("Could not load " + url);
+ }
+ if (callback) {
+ return callback(param);
+ }
+ }
+ };
+ return xhr.send(null);
+ };
+
+ runScripts = function() {
+ var coffees, coffeetypes, execute, i, index, s, script, scripts, _fn, _i, _len;
+ scripts = window.document.getElementsByTagName('script');
+ coffeetypes = ['text/coffeescript', 'text/literate-coffeescript'];
+ coffees = (function() {
+ var _i, _len, _ref, _results;
+ _results = [];
+ for (_i = 0, _len = scripts.length; _i < _len; _i++) {
+ s = scripts[_i];
+ if (_ref = s.type, __indexOf.call(coffeetypes, _ref) >= 0) {
+ _results.push(s);
+ }
+ }
+ return _results;
+ })();
+ index = 0;
+ execute = function() {
+ var param;
+ param = coffees[index];
+ if (param instanceof Array) {
+ CoffeeScript.run.apply(CoffeeScript, param);
+ index++;
+ return execute();
+ }
+ };
+ _fn = function(script, i) {
+ var options;
+ options = {
+ literate: script.type === coffeetypes[1]
+ };
+ if (script.src) {
+ return CoffeeScript.load(script.src, function(param) {
+ coffees[i] = param;
+ return execute();
+ }, options, true);
+ } else {
+ options.sourceFiles = ['embedded'];
+ return coffees[i] = [script.innerHTML, options];
+ }
+ };
+ for (i = _i = 0, _len = coffees.length; _i < _len; i = ++_i) {
+ script = coffees[i];
+ _fn(script, i);
+ }
+ return execute();
+ };
+
+ if (window.addEventListener) {
+ window.addEventListener('DOMContentLoaded', runScripts, false);
+ } else {
+ window.attachEvent('onload', runScripts);
+ }
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/cake.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/cake.js
new file mode 100644
index 000000000..94ecd4c82
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/cake.js
@@ -0,0 +1,114 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var CoffeeScript, cakefileDirectory, fatalError, fs, helpers, missingTask, oparse, options, optparse, path, printTasks, switches, tasks;
+
+ fs = require('fs');
+
+ path = require('path');
+
+ helpers = require('./helpers');
+
+ optparse = require('./optparse');
+
+ CoffeeScript = require('./coffee-script');
+
+ CoffeeScript.register();
+
+ tasks = {};
+
+ options = {};
+
+ switches = [];
+
+ oparse = null;
+
+ helpers.extend(global, {
+ task: function(name, description, action) {
+ var _ref;
+ if (!action) {
+ _ref = [description, action], action = _ref[0], description = _ref[1];
+ }
+ return tasks[name] = {
+ name: name,
+ description: description,
+ action: action
+ };
+ },
+ option: function(letter, flag, description) {
+ return switches.push([letter, flag, description]);
+ },
+ invoke: function(name) {
+ if (!tasks[name]) {
+ missingTask(name);
+ }
+ return tasks[name].action(options);
+ }
+ });
+
+ exports.run = function() {
+ var arg, args, e, _i, _len, _ref, _results;
+ global.__originalDirname = fs.realpathSync('.');
+ process.chdir(cakefileDirectory(__originalDirname));
+ args = process.argv.slice(2);
+ CoffeeScript.run(fs.readFileSync('Cakefile').toString(), {
+ filename: 'Cakefile'
+ });
+ oparse = new optparse.OptionParser(switches);
+ if (!args.length) {
+ return printTasks();
+ }
+ try {
+ options = oparse.parse(args);
+ } catch (_error) {
+ e = _error;
+ return fatalError("" + e);
+ }
+ _ref = options["arguments"];
+ _results = [];
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ arg = _ref[_i];
+ _results.push(invoke(arg));
+ }
+ return _results;
+ };
+
+ printTasks = function() {
+ var cakefilePath, desc, name, relative, spaces, task;
+ relative = path.relative || path.resolve;
+ cakefilePath = path.join(relative(__originalDirname, process.cwd()), 'Cakefile');
+ console.log("" + cakefilePath + " defines the following tasks:\n");
+ for (name in tasks) {
+ task = tasks[name];
+ spaces = 20 - name.length;
+ spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
+ desc = task.description ? "# " + task.description : '';
+ console.log("cake " + name + spaces + " " + desc);
+ }
+ if (switches.length) {
+ return console.log(oparse.help());
+ }
+ };
+
+ fatalError = function(message) {
+ console.error(message + '\n');
+ console.log('To see a list of all tasks/options, run "cake"');
+ return process.exit(1);
+ };
+
+ missingTask = function(task) {
+ return fatalError("No such task: " + task);
+ };
+
+ cakefileDirectory = function(dir) {
+ var parent;
+ if (fs.existsSync(path.join(dir, 'Cakefile'))) {
+ return dir;
+ }
+ parent = path.normalize(path.join(dir, '..'));
+ if (parent !== dir) {
+ return cakefileDirectory(parent);
+ }
+ throw new Error("Cakefile not found in " + (process.cwd()));
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/coffee-script.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/coffee-script.js
new file mode 100644
index 000000000..9061c7e81
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/coffee-script.js
@@ -0,0 +1,347 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var Lexer, SourceMap, compile, ext, formatSourcePosition, fs, getSourceMap, helpers, lexer, parser, path, sourceMaps, vm, withPrettyErrors, _base, _i, _len, _ref,
+ __hasProp = {}.hasOwnProperty,
+ __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; };
+
+ fs = require('fs');
+
+ vm = require('vm');
+
+ path = require('path');
+
+ Lexer = require('./lexer').Lexer;
+
+ parser = require('./parser').parser;
+
+ helpers = require('./helpers');
+
+ SourceMap = require('./sourcemap');
+
+ exports.VERSION = '1.8.0';
+
+ exports.FILE_EXTENSIONS = ['.coffee', '.litcoffee', '.coffee.md'];
+
+ exports.helpers = helpers;
+
+ withPrettyErrors = function(fn) {
+ return function(code, options) {
+ var err;
+ if (options == null) {
+ options = {};
+ }
+ try {
+ return fn.call(this, code, options);
+ } catch (_error) {
+ err = _error;
+ throw helpers.updateSyntaxError(err, code, options.filename);
+ }
+ };
+ };
+
+ exports.compile = compile = withPrettyErrors(function(code, options) {
+ var answer, currentColumn, currentLine, extend, fragment, fragments, header, js, map, merge, newLines, _i, _len;
+ merge = helpers.merge, extend = helpers.extend;
+ options = extend({}, options);
+ if (options.sourceMap) {
+ map = new SourceMap;
+ }
+ fragments = parser.parse(lexer.tokenize(code, options)).compileToFragments(options);
+ currentLine = 0;
+ if (options.header) {
+ currentLine += 1;
+ }
+ if (options.shiftLine) {
+ currentLine += 1;
+ }
+ currentColumn = 0;
+ js = "";
+ for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+ fragment = fragments[_i];
+ if (options.sourceMap) {
+ if (fragment.locationData) {
+ map.add([fragment.locationData.first_line, fragment.locationData.first_column], [currentLine, currentColumn], {
+ noReplace: true
+ });
+ }
+ newLines = helpers.count(fragment.code, "\n");
+ currentLine += newLines;
+ if (newLines) {
+ currentColumn = fragment.code.length - (fragment.code.lastIndexOf("\n") + 1);
+ } else {
+ currentColumn += fragment.code.length;
+ }
+ }
+ js += fragment.code;
+ }
+ if (options.header) {
+ header = "Generated by CoffeeScript " + this.VERSION;
+ js = "// " + header + "\n" + js;
+ }
+ if (options.sourceMap) {
+ answer = {
+ js: js
+ };
+ answer.sourceMap = map;
+ answer.v3SourceMap = map.generate(options, code);
+ return answer;
+ } else {
+ return js;
+ }
+ });
+
+ exports.tokens = withPrettyErrors(function(code, options) {
+ return lexer.tokenize(code, options);
+ });
+
+ exports.nodes = withPrettyErrors(function(source, options) {
+ if (typeof source === 'string') {
+ return parser.parse(lexer.tokenize(source, options));
+ } else {
+ return parser.parse(source);
+ }
+ });
+
+ exports.run = function(code, options) {
+ var answer, dir, mainModule, _ref;
+ if (options == null) {
+ options = {};
+ }
+ mainModule = require.main;
+ mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : '.';
+ mainModule.moduleCache && (mainModule.moduleCache = {});
+ dir = options.filename ? path.dirname(fs.realpathSync(options.filename)) : fs.realpathSync('.');
+ mainModule.paths = require('module')._nodeModulePaths(dir);
+ if (!helpers.isCoffee(mainModule.filename) || require.extensions) {
+ answer = compile(code, options);
+ code = (_ref = answer.js) != null ? _ref : answer;
+ }
+ return mainModule._compile(code, mainModule.filename);
+ };
+
+ exports["eval"] = function(code, options) {
+ var Module, Script, js, k, o, r, sandbox, v, _i, _len, _module, _ref, _ref1, _require;
+ if (options == null) {
+ options = {};
+ }
+ if (!(code = code.trim())) {
+ return;
+ }
+ Script = vm.Script;
+ if (Script) {
+ if (options.sandbox != null) {
+ if (options.sandbox instanceof Script.createContext().constructor) {
+ sandbox = options.sandbox;
+ } else {
+ sandbox = Script.createContext();
+ _ref = options.sandbox;
+ for (k in _ref) {
+ if (!__hasProp.call(_ref, k)) continue;
+ v = _ref[k];
+ sandbox[k] = v;
+ }
+ }
+ sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
+ } else {
+ sandbox = global;
+ }
+ sandbox.__filename = options.filename || 'eval';
+ sandbox.__dirname = path.dirname(sandbox.__filename);
+ if (!(sandbox !== global || sandbox.module || sandbox.require)) {
+ Module = require('module');
+ sandbox.module = _module = new Module(options.modulename || 'eval');
+ sandbox.require = _require = function(path) {
+ return Module._load(path, _module, true);
+ };
+ _module.filename = sandbox.__filename;
+ _ref1 = Object.getOwnPropertyNames(require);
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ r = _ref1[_i];
+ if (r !== 'paths') {
+ _require[r] = require[r];
+ }
+ }
+ _require.paths = _module.paths = Module._nodeModulePaths(process.cwd());
+ _require.resolve = function(request) {
+ return Module._resolveFilename(request, _module);
+ };
+ }
+ }
+ o = {};
+ for (k in options) {
+ if (!__hasProp.call(options, k)) continue;
+ v = options[k];
+ o[k] = v;
+ }
+ o.bare = true;
+ js = compile(code, o);
+ if (sandbox === global) {
+ return vm.runInThisContext(js);
+ } else {
+ return vm.runInContext(js, sandbox);
+ }
+ };
+
+ exports.register = function() {
+ return require('./register');
+ };
+
+ if (require.extensions) {
+ _ref = this.FILE_EXTENSIONS;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ ext = _ref[_i];
+ if ((_base = require.extensions)[ext] == null) {
+ _base[ext] = function() {
+ throw new Error("Use CoffeeScript.register() or require the coffee-script/register module to require " + ext + " files.");
+ };
+ }
+ }
+ }
+
+ exports._compileFile = function(filename, sourceMap) {
+ var answer, err, raw, stripped;
+ if (sourceMap == null) {
+ sourceMap = false;
+ }
+ raw = fs.readFileSync(filename, 'utf8');
+ stripped = raw.charCodeAt(0) === 0xFEFF ? raw.substring(1) : raw;
+ try {
+ answer = compile(stripped, {
+ filename: filename,
+ sourceMap: sourceMap,
+ literate: helpers.isLiterate(filename)
+ });
+ } catch (_error) {
+ err = _error;
+ throw helpers.updateSyntaxError(err, stripped, filename);
+ }
+ return answer;
+ };
+
+ lexer = new Lexer;
+
+ parser.lexer = {
+ lex: function() {
+ var tag, token;
+ token = this.tokens[this.pos++];
+ if (token) {
+ tag = token[0], this.yytext = token[1], this.yylloc = token[2];
+ this.errorToken = token.origin || token;
+ this.yylineno = this.yylloc.first_line;
+ } else {
+ tag = '';
+ }
+ return tag;
+ },
+ setInput: function(tokens) {
+ this.tokens = tokens;
+ return this.pos = 0;
+ },
+ upcomingInput: function() {
+ return "";
+ }
+ };
+
+ parser.yy = require('./nodes');
+
+ parser.yy.parseError = function(message, _arg) {
+ var errorLoc, errorTag, errorText, errorToken, token, tokens, _ref1;
+ token = _arg.token;
+ _ref1 = parser.lexer, errorToken = _ref1.errorToken, tokens = _ref1.tokens;
+ errorTag = errorToken[0], errorText = errorToken[1], errorLoc = errorToken[2];
+ errorText = errorToken === tokens[tokens.length - 1] ? 'end of input' : errorTag === 'INDENT' || errorTag === 'OUTDENT' ? 'indentation' : helpers.nameWhitespaceCharacter(errorText);
+ return helpers.throwSyntaxError("unexpected " + errorText, errorLoc);
+ };
+
+ formatSourcePosition = function(frame, getSourceMapping) {
+ var as, column, fileLocation, fileName, functionName, isConstructor, isMethodCall, line, methodName, source, tp, typeName;
+ fileName = void 0;
+ fileLocation = '';
+ if (frame.isNative()) {
+ fileLocation = "native";
+ } else {
+ if (frame.isEval()) {
+ fileName = frame.getScriptNameOrSourceURL();
+ if (!fileName) {
+ fileLocation = "" + (frame.getEvalOrigin()) + ", ";
+ }
+ } else {
+ fileName = frame.getFileName();
+ }
+ fileName || (fileName = "");
+ line = frame.getLineNumber();
+ column = frame.getColumnNumber();
+ source = getSourceMapping(fileName, line, column);
+ fileLocation = source ? "" + fileName + ":" + source[0] + ":" + source[1] : "" + fileName + ":" + line + ":" + column;
+ }
+ functionName = frame.getFunctionName();
+ isConstructor = frame.isConstructor();
+ isMethodCall = !(frame.isToplevel() || isConstructor);
+ if (isMethodCall) {
+ methodName = frame.getMethodName();
+ typeName = frame.getTypeName();
+ if (functionName) {
+ tp = as = '';
+ if (typeName && functionName.indexOf(typeName)) {
+ tp = "" + typeName + ".";
+ }
+ if (methodName && functionName.indexOf("." + methodName) !== functionName.length - methodName.length - 1) {
+ as = " [as " + methodName + "]";
+ }
+ return "" + tp + functionName + as + " (" + fileLocation + ")";
+ } else {
+ return "" + typeName + "." + (methodName || '') + " (" + fileLocation + ")";
+ }
+ } else if (isConstructor) {
+ return "new " + (functionName || '') + " (" + fileLocation + ")";
+ } else if (functionName) {
+ return "" + functionName + " (" + fileLocation + ")";
+ } else {
+ return fileLocation;
+ }
+ };
+
+ sourceMaps = {};
+
+ getSourceMap = function(filename) {
+ var answer, _ref1;
+ if (sourceMaps[filename]) {
+ return sourceMaps[filename];
+ }
+ if (_ref1 = path != null ? path.extname(filename) : void 0, __indexOf.call(exports.FILE_EXTENSIONS, _ref1) < 0) {
+ return;
+ }
+ answer = exports._compileFile(filename, true);
+ return sourceMaps[filename] = answer.sourceMap;
+ };
+
+ Error.prepareStackTrace = function(err, stack) {
+ var frame, frames, getSourceMapping;
+ getSourceMapping = function(filename, line, column) {
+ var answer, sourceMap;
+ sourceMap = getSourceMap(filename);
+ if (sourceMap) {
+ answer = sourceMap.sourceLocation([line - 1, column - 1]);
+ }
+ if (answer) {
+ return [answer[0] + 1, answer[1] + 1];
+ } else {
+ return null;
+ }
+ };
+ frames = (function() {
+ var _j, _len1, _results;
+ _results = [];
+ for (_j = 0, _len1 = stack.length; _j < _len1; _j++) {
+ frame = stack[_j];
+ if (frame.getFunction() === exports.run) {
+ break;
+ }
+ _results.push(" at " + (formatSourcePosition(frame, getSourceMapping)));
+ }
+ return _results;
+ })();
+ return "" + (err.toString()) + "\n" + (frames.join('\n')) + "\n";
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/command.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/command.js
new file mode 100644
index 000000000..357653b74
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/command.js
@@ -0,0 +1,572 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var BANNER, CoffeeScript, EventEmitter, SWITCHES, compileJoin, compileOptions, compilePath, compileScript, compileStdio, exec, findDirectoryIndex, forkNode, fs, helpers, hidden, joinTimeout, mkdirp, notSources, optionParser, optparse, opts, outputPath, parseOptions, path, printLine, printTokens, printWarn, removeSource, removeSourceDir, silentUnlink, sourceCode, sources, spawn, timeLog, usage, useWinPathSep, version, wait, watch, watchDir, watchedDirs, writeJs, _ref,
+ __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; };
+
+ fs = require('fs');
+
+ path = require('path');
+
+ helpers = require('./helpers');
+
+ optparse = require('./optparse');
+
+ CoffeeScript = require('./coffee-script');
+
+ mkdirp = require('mkdirp');
+
+ _ref = require('child_process'), spawn = _ref.spawn, exec = _ref.exec;
+
+ EventEmitter = require('events').EventEmitter;
+
+ useWinPathSep = path.sep === '\\';
+
+ helpers.extend(CoffeeScript, new EventEmitter);
+
+ printLine = function(line) {
+ return process.stdout.write(line + '\n');
+ };
+
+ printWarn = function(line) {
+ return process.stderr.write(line + '\n');
+ };
+
+ hidden = function(file) {
+ return /^\.|~$/.test(file);
+ };
+
+ BANNER = 'Usage: coffee [options] path/to/script.coffee -- [args]\n\nIf called without options, `coffee` will run your script.';
+
+ SWITCHES = [['-b', '--bare', 'compile without a top-level function wrapper'], ['-c', '--compile', 'compile to JavaScript and save as .js files'], ['-e', '--eval', 'pass a string from the command line as input'], ['-h', '--help', 'display this help message'], ['-i', '--interactive', 'run an interactive CoffeeScript REPL'], ['-j', '--join [FILE]', 'concatenate the source CoffeeScript before compiling'], ['-m', '--map', 'generate source map and save as .js.map files'], ['-n', '--nodes', 'print out the parse tree that the parser produces'], ['--nodejs [ARGS]', 'pass options directly to the "node" binary'], ['--no-header', 'suppress the "Generated by" header'], ['-o', '--output [DIR]', 'set the output directory for compiled JavaScript'], ['-p', '--print', 'print out the compiled JavaScript'], ['-s', '--stdio', 'listen for and compile scripts over stdio'], ['-l', '--literate', 'treat stdio as literate style coffee-script'], ['-t', '--tokens', 'print out the tokens that the lexer/rewriter produce'], ['-v', '--version', 'display the version number'], ['-w', '--watch', 'watch scripts for changes and rerun commands']];
+
+ opts = {};
+
+ sources = [];
+
+ sourceCode = [];
+
+ notSources = {};
+
+ watchedDirs = {};
+
+ optionParser = null;
+
+ exports.run = function() {
+ var literals, replCliOpts, source, _i, _len, _ref1, _results;
+ parseOptions();
+ replCliOpts = {
+ useGlobal: true
+ };
+ if (opts.nodejs) {
+ return forkNode();
+ }
+ if (opts.help) {
+ return usage();
+ }
+ if (opts.version) {
+ return version();
+ }
+ if (opts.interactive) {
+ return require('./repl').start(replCliOpts);
+ }
+ if (opts.stdio) {
+ return compileStdio();
+ }
+ if (opts["eval"]) {
+ return compileScript(null, opts["arguments"][0]);
+ }
+ if (!opts["arguments"].length) {
+ return require('./repl').start(replCliOpts);
+ }
+ literals = opts.run ? opts["arguments"].splice(1) : [];
+ process.argv = process.argv.slice(0, 2).concat(literals);
+ process.argv[0] = 'coffee';
+ if (opts.output) {
+ opts.output = path.resolve(opts.output);
+ }
+ if (opts.join) {
+ opts.join = path.resolve(opts.join);
+ console.error('\nThe --join option is deprecated and will be removed in a future version.\n\nIf for some reason it\'s necessary to share local variables between files,\nreplace...\n\n $ coffee --compile --join bundle.js -- a.coffee b.coffee c.coffee\n\nwith...\n\n $ cat a.coffee b.coffee c.coffee | coffee --compile --stdio > bundle.js\n');
+ }
+ _ref1 = opts["arguments"];
+ _results = [];
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ source = _ref1[_i];
+ source = path.resolve(source);
+ _results.push(compilePath(source, true, source));
+ }
+ return _results;
+ };
+
+ compilePath = function(source, topLevel, base) {
+ var code, err, file, files, stats, _i, _len, _results;
+ if (__indexOf.call(sources, source) >= 0 || watchedDirs[source] || !topLevel && (notSources[source] || hidden(source))) {
+ return;
+ }
+ try {
+ stats = fs.statSync(source);
+ } catch (_error) {
+ err = _error;
+ if (err.code === 'ENOENT') {
+ console.error("File not found: " + source);
+ process.exit(1);
+ }
+ throw err;
+ }
+ if (stats.isDirectory()) {
+ if (path.basename(source) === 'node_modules') {
+ notSources[source] = true;
+ return;
+ }
+ if (opts.run) {
+ compilePath(findDirectoryIndex(source), topLevel, base);
+ return;
+ }
+ if (opts.watch) {
+ watchDir(source, base);
+ }
+ try {
+ files = fs.readdirSync(source);
+ } catch (_error) {
+ err = _error;
+ if (err.code === 'ENOENT') {
+ return;
+ } else {
+ throw err;
+ }
+ }
+ _results = [];
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
+ file = files[_i];
+ _results.push(compilePath(path.join(source, file), false, base));
+ }
+ return _results;
+ } else if (topLevel || helpers.isCoffee(source)) {
+ sources.push(source);
+ sourceCode.push(null);
+ delete notSources[source];
+ if (opts.watch) {
+ watch(source, base);
+ }
+ try {
+ code = fs.readFileSync(source);
+ } catch (_error) {
+ err = _error;
+ if (err.code === 'ENOENT') {
+ return;
+ } else {
+ throw err;
+ }
+ }
+ return compileScript(source, code.toString(), base);
+ } else {
+ return notSources[source] = true;
+ }
+ };
+
+ findDirectoryIndex = function(source) {
+ var err, ext, index, _i, _len, _ref1;
+ _ref1 = CoffeeScript.FILE_EXTENSIONS;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ ext = _ref1[_i];
+ index = path.join(source, "index" + ext);
+ try {
+ if ((fs.statSync(index)).isFile()) {
+ return index;
+ }
+ } catch (_error) {
+ err = _error;
+ if (err.code !== 'ENOENT') {
+ throw err;
+ }
+ }
+ }
+ console.error("Missing index.coffee or index.litcoffee in " + source);
+ return process.exit(1);
+ };
+
+ compileScript = function(file, input, base) {
+ var compiled, err, message, o, options, t, task;
+ if (base == null) {
+ base = null;
+ }
+ o = opts;
+ options = compileOptions(file, base);
+ try {
+ t = task = {
+ file: file,
+ input: input,
+ options: options
+ };
+ CoffeeScript.emit('compile', task);
+ if (o.tokens) {
+ return printTokens(CoffeeScript.tokens(t.input, t.options));
+ } else if (o.nodes) {
+ return printLine(CoffeeScript.nodes(t.input, t.options).toString().trim());
+ } else if (o.run) {
+ CoffeeScript.register();
+ return CoffeeScript.run(t.input, t.options);
+ } else if (o.join && t.file !== o.join) {
+ if (helpers.isLiterate(file)) {
+ t.input = helpers.invertLiterate(t.input);
+ }
+ sourceCode[sources.indexOf(t.file)] = t.input;
+ return compileJoin();
+ } else {
+ compiled = CoffeeScript.compile(t.input, t.options);
+ t.output = compiled;
+ if (o.map) {
+ t.output = compiled.js;
+ t.sourceMap = compiled.v3SourceMap;
+ }
+ CoffeeScript.emit('success', task);
+ if (o.print) {
+ return printLine(t.output.trim());
+ } else if (o.compile || o.map) {
+ return writeJs(base, t.file, t.output, options.jsPath, t.sourceMap);
+ }
+ }
+ } catch (_error) {
+ err = _error;
+ CoffeeScript.emit('failure', err, task);
+ if (CoffeeScript.listeners('failure').length) {
+ return;
+ }
+ message = err.stack || ("" + err);
+ if (o.watch) {
+ return printLine(message + '\x07');
+ } else {
+ printWarn(message);
+ return process.exit(1);
+ }
+ }
+ };
+
+ compileStdio = function() {
+ var code, stdin;
+ code = '';
+ stdin = process.openStdin();
+ stdin.on('data', function(buffer) {
+ if (buffer) {
+ return code += buffer.toString();
+ }
+ });
+ return stdin.on('end', function() {
+ return compileScript(null, code);
+ });
+ };
+
+ joinTimeout = null;
+
+ compileJoin = function() {
+ if (!opts.join) {
+ return;
+ }
+ if (!sourceCode.some(function(code) {
+ return code === null;
+ })) {
+ clearTimeout(joinTimeout);
+ return joinTimeout = wait(100, function() {
+ return compileScript(opts.join, sourceCode.join('\n'), opts.join);
+ });
+ }
+ };
+
+ watch = function(source, base) {
+ var compile, compileTimeout, err, prevStats, rewatch, startWatcher, watchErr, watcher;
+ watcher = null;
+ prevStats = null;
+ compileTimeout = null;
+ watchErr = function(err) {
+ if (err.code !== 'ENOENT') {
+ throw err;
+ }
+ if (__indexOf.call(sources, source) < 0) {
+ return;
+ }
+ try {
+ rewatch();
+ return compile();
+ } catch (_error) {
+ removeSource(source, base);
+ return compileJoin();
+ }
+ };
+ compile = function() {
+ clearTimeout(compileTimeout);
+ return compileTimeout = wait(25, function() {
+ return fs.stat(source, function(err, stats) {
+ if (err) {
+ return watchErr(err);
+ }
+ if (prevStats && stats.size === prevStats.size && stats.mtime.getTime() === prevStats.mtime.getTime()) {
+ return rewatch();
+ }
+ prevStats = stats;
+ return fs.readFile(source, function(err, code) {
+ if (err) {
+ return watchErr(err);
+ }
+ compileScript(source, code.toString(), base);
+ return rewatch();
+ });
+ });
+ });
+ };
+ startWatcher = function() {
+ return watcher = fs.watch(source).on('change', compile).on('error', function(err) {
+ if (err.code !== 'EPERM') {
+ throw err;
+ }
+ return removeSource(source, base);
+ });
+ };
+ rewatch = function() {
+ if (watcher != null) {
+ watcher.close();
+ }
+ return startWatcher();
+ };
+ try {
+ return startWatcher();
+ } catch (_error) {
+ err = _error;
+ return watchErr(err);
+ }
+ };
+
+ watchDir = function(source, base) {
+ var err, readdirTimeout, startWatcher, stopWatcher, watcher;
+ watcher = null;
+ readdirTimeout = null;
+ startWatcher = function() {
+ return watcher = fs.watch(source).on('error', function(err) {
+ if (err.code !== 'EPERM') {
+ throw err;
+ }
+ return stopWatcher();
+ }).on('change', function() {
+ clearTimeout(readdirTimeout);
+ return readdirTimeout = wait(25, function() {
+ var err, file, files, _i, _len, _results;
+ try {
+ files = fs.readdirSync(source);
+ } catch (_error) {
+ err = _error;
+ if (err.code !== 'ENOENT') {
+ throw err;
+ }
+ return stopWatcher();
+ }
+ _results = [];
+ for (_i = 0, _len = files.length; _i < _len; _i++) {
+ file = files[_i];
+ _results.push(compilePath(path.join(source, file), false, base));
+ }
+ return _results;
+ });
+ });
+ };
+ stopWatcher = function() {
+ watcher.close();
+ return removeSourceDir(source, base);
+ };
+ watchedDirs[source] = true;
+ try {
+ return startWatcher();
+ } catch (_error) {
+ err = _error;
+ if (err.code !== 'ENOENT') {
+ throw err;
+ }
+ }
+ };
+
+ removeSourceDir = function(source, base) {
+ var file, sourcesChanged, _i, _len;
+ delete watchedDirs[source];
+ sourcesChanged = false;
+ for (_i = 0, _len = sources.length; _i < _len; _i++) {
+ file = sources[_i];
+ if (!(source === path.dirname(file))) {
+ continue;
+ }
+ removeSource(file, base);
+ sourcesChanged = true;
+ }
+ if (sourcesChanged) {
+ return compileJoin();
+ }
+ };
+
+ removeSource = function(source, base) {
+ var index;
+ index = sources.indexOf(source);
+ sources.splice(index, 1);
+ sourceCode.splice(index, 1);
+ if (!opts.join) {
+ silentUnlink(outputPath(source, base));
+ silentUnlink(outputPath(source, base, '.js.map'));
+ return timeLog("removed " + source);
+ }
+ };
+
+ silentUnlink = function(path) {
+ var err, _ref1;
+ try {
+ return fs.unlinkSync(path);
+ } catch (_error) {
+ err = _error;
+ if ((_ref1 = err.code) !== 'ENOENT' && _ref1 !== 'EPERM') {
+ throw err;
+ }
+ }
+ };
+
+ outputPath = function(source, base, extension) {
+ var basename, dir, srcDir;
+ if (extension == null) {
+ extension = ".js";
+ }
+ basename = helpers.baseFileName(source, true, useWinPathSep);
+ srcDir = path.dirname(source);
+ if (!opts.output) {
+ dir = srcDir;
+ } else if (source === base) {
+ dir = opts.output;
+ } else {
+ dir = path.join(opts.output, path.relative(base, srcDir));
+ }
+ return path.join(dir, basename + extension);
+ };
+
+ writeJs = function(base, sourcePath, js, jsPath, generatedSourceMap) {
+ var compile, jsDir, sourceMapPath;
+ if (generatedSourceMap == null) {
+ generatedSourceMap = null;
+ }
+ sourceMapPath = outputPath(sourcePath, base, ".js.map");
+ jsDir = path.dirname(jsPath);
+ compile = function() {
+ if (opts.compile) {
+ if (js.length <= 0) {
+ js = ' ';
+ }
+ if (generatedSourceMap) {
+ js = "" + js + "\n//# sourceMappingURL=" + (helpers.baseFileName(sourceMapPath, false, useWinPathSep)) + "\n";
+ }
+ fs.writeFile(jsPath, js, function(err) {
+ if (err) {
+ printLine(err.message);
+ return process.exit(1);
+ } else if (opts.compile && opts.watch) {
+ return timeLog("compiled " + sourcePath);
+ }
+ });
+ }
+ if (generatedSourceMap) {
+ return fs.writeFile(sourceMapPath, generatedSourceMap, function(err) {
+ if (err) {
+ printLine("Could not write source map: " + err.message);
+ return process.exit(1);
+ }
+ });
+ }
+ };
+ return fs.exists(jsDir, function(itExists) {
+ if (itExists) {
+ return compile();
+ } else {
+ return mkdirp(jsDir, compile);
+ }
+ });
+ };
+
+ wait = function(milliseconds, func) {
+ return setTimeout(func, milliseconds);
+ };
+
+ timeLog = function(message) {
+ return console.log("" + ((new Date).toLocaleTimeString()) + " - " + message);
+ };
+
+ printTokens = function(tokens) {
+ var strings, tag, token, value;
+ strings = (function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = tokens.length; _i < _len; _i++) {
+ token = tokens[_i];
+ tag = token[0];
+ value = token[1].toString().replace(/\n/, '\\n');
+ _results.push("[" + tag + " " + value + "]");
+ }
+ return _results;
+ })();
+ return printLine(strings.join(' '));
+ };
+
+ parseOptions = function() {
+ var o;
+ optionParser = new optparse.OptionParser(SWITCHES, BANNER);
+ o = opts = optionParser.parse(process.argv.slice(2));
+ o.compile || (o.compile = !!o.output);
+ o.run = !(o.compile || o.print || o.map);
+ return o.print = !!(o.print || (o["eval"] || o.stdio && o.compile));
+ };
+
+ compileOptions = function(filename, base) {
+ var answer, cwd, jsDir, jsPath;
+ answer = {
+ filename: filename,
+ literate: opts.literate || helpers.isLiterate(filename),
+ bare: opts.bare,
+ header: opts.compile && !opts['no-header'],
+ sourceMap: opts.map
+ };
+ if (filename) {
+ if (base) {
+ cwd = process.cwd();
+ jsPath = outputPath(filename, base);
+ jsDir = path.dirname(jsPath);
+ answer = helpers.merge(answer, {
+ jsPath: jsPath,
+ sourceRoot: path.relative(jsDir, cwd),
+ sourceFiles: [path.relative(cwd, filename)],
+ generatedFile: helpers.baseFileName(jsPath, false, useWinPathSep)
+ });
+ } else {
+ answer = helpers.merge(answer, {
+ sourceRoot: "",
+ sourceFiles: [helpers.baseFileName(filename, false, useWinPathSep)],
+ generatedFile: helpers.baseFileName(filename, true, useWinPathSep) + ".js"
+ });
+ }
+ }
+ return answer;
+ };
+
+ forkNode = function() {
+ var args, nodeArgs, p;
+ nodeArgs = opts.nodejs.split(/\s+/);
+ args = process.argv.slice(1);
+ args.splice(args.indexOf('--nodejs'), 2);
+ p = spawn(process.execPath, nodeArgs.concat(args), {
+ cwd: process.cwd(),
+ env: process.env,
+ customFds: [0, 1, 2]
+ });
+ return p.on('exit', function(code) {
+ return process.exit(code);
+ });
+ };
+
+ usage = function() {
+ return printLine((new optparse.OptionParser(SWITCHES, BANNER)).help());
+ };
+
+ version = function() {
+ return printLine("CoffeeScript version " + CoffeeScript.VERSION);
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/grammar.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/grammar.js
new file mode 100644
index 000000000..cfcab24cf
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/grammar.js
@@ -0,0 +1,631 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var Parser, alt, alternatives, grammar, name, o, operators, token, tokens, unwrap;
+
+ Parser = require('jison').Parser;
+
+ unwrap = /^function\s*\(\)\s*\{\s*return\s*([\s\S]*);\s*\}/;
+
+ o = function(patternString, action, options) {
+ var addLocationDataFn, match, patternCount;
+ patternString = patternString.replace(/\s{2,}/g, ' ');
+ patternCount = patternString.split(' ').length;
+ if (!action) {
+ return [patternString, '$$ = $1;', options];
+ }
+ action = (match = unwrap.exec(action)) ? match[1] : "(" + action + "())";
+ action = action.replace(/\bnew /g, '$&yy.');
+ action = action.replace(/\b(?:Block\.wrap|extend)\b/g, 'yy.$&');
+ addLocationDataFn = function(first, last) {
+ if (!last) {
+ return "yy.addLocationDataFn(@" + first + ")";
+ } else {
+ return "yy.addLocationDataFn(@" + first + ", @" + last + ")";
+ }
+ };
+ action = action.replace(/LOC\(([0-9]*)\)/g, addLocationDataFn('$1'));
+ action = action.replace(/LOC\(([0-9]*),\s*([0-9]*)\)/g, addLocationDataFn('$1', '$2'));
+ return [patternString, "$$ = " + (addLocationDataFn(1, patternCount)) + "(" + action + ");", options];
+ };
+
+ grammar = {
+ Root: [
+ o('', function() {
+ return new Block;
+ }), o('Body')
+ ],
+ Body: [
+ o('Line', function() {
+ return Block.wrap([$1]);
+ }), o('Body TERMINATOR Line', function() {
+ return $1.push($3);
+ }), o('Body TERMINATOR')
+ ],
+ Line: [o('Expression'), o('Statement')],
+ Statement: [
+ o('Return'), o('Comment'), o('STATEMENT', function() {
+ return new Literal($1);
+ })
+ ],
+ Expression: [o('Value'), o('Invocation'), o('Code'), o('Operation'), o('Assign'), o('If'), o('Try'), o('While'), o('For'), o('Switch'), o('Class'), o('Throw')],
+ Block: [
+ o('INDENT OUTDENT', function() {
+ return new Block;
+ }), o('INDENT Body OUTDENT', function() {
+ return $2;
+ })
+ ],
+ Identifier: [
+ o('IDENTIFIER', function() {
+ return new Literal($1);
+ })
+ ],
+ AlphaNumeric: [
+ o('NUMBER', function() {
+ return new Literal($1);
+ }), o('STRING', function() {
+ return new Literal($1);
+ })
+ ],
+ Literal: [
+ o('AlphaNumeric'), o('JS', function() {
+ return new Literal($1);
+ }), o('REGEX', function() {
+ return new Literal($1);
+ }), o('DEBUGGER', function() {
+ return new Literal($1);
+ }), o('UNDEFINED', function() {
+ return new Undefined;
+ }), o('NULL', function() {
+ return new Null;
+ }), o('BOOL', function() {
+ return new Bool($1);
+ })
+ ],
+ Assign: [
+ o('Assignable = Expression', function() {
+ return new Assign($1, $3);
+ }), o('Assignable = TERMINATOR Expression', function() {
+ return new Assign($1, $4);
+ }), o('Assignable = INDENT Expression OUTDENT', function() {
+ return new Assign($1, $4);
+ })
+ ],
+ AssignObj: [
+ o('ObjAssignable', function() {
+ return new Value($1);
+ }), o('ObjAssignable : Expression', function() {
+ return new Assign(LOC(1)(new Value($1)), $3, 'object');
+ }), o('ObjAssignable : INDENT Expression OUTDENT', function() {
+ return new Assign(LOC(1)(new Value($1)), $4, 'object');
+ }), o('Comment')
+ ],
+ ObjAssignable: [o('Identifier'), o('AlphaNumeric'), o('ThisProperty')],
+ Return: [
+ o('RETURN Expression', function() {
+ return new Return($2);
+ }), o('RETURN', function() {
+ return new Return;
+ })
+ ],
+ Comment: [
+ o('HERECOMMENT', function() {
+ return new Comment($1);
+ })
+ ],
+ Code: [
+ o('PARAM_START ParamList PARAM_END FuncGlyph Block', function() {
+ return new Code($2, $5, $4);
+ }), o('FuncGlyph Block', function() {
+ return new Code([], $2, $1);
+ })
+ ],
+ FuncGlyph: [
+ o('->', function() {
+ return 'func';
+ }), o('=>', function() {
+ return 'boundfunc';
+ })
+ ],
+ OptComma: [o(''), o(',')],
+ ParamList: [
+ o('', function() {
+ return [];
+ }), o('Param', function() {
+ return [$1];
+ }), o('ParamList , Param', function() {
+ return $1.concat($3);
+ }), o('ParamList OptComma TERMINATOR Param', function() {
+ return $1.concat($4);
+ }), o('ParamList OptComma INDENT ParamList OptComma OUTDENT', function() {
+ return $1.concat($4);
+ })
+ ],
+ Param: [
+ o('ParamVar', function() {
+ return new Param($1);
+ }), o('ParamVar ...', function() {
+ return new Param($1, null, true);
+ }), o('ParamVar = Expression', function() {
+ return new Param($1, $3);
+ }), o('...', function() {
+ return new Expansion;
+ })
+ ],
+ ParamVar: [o('Identifier'), o('ThisProperty'), o('Array'), o('Object')],
+ Splat: [
+ o('Expression ...', function() {
+ return new Splat($1);
+ })
+ ],
+ SimpleAssignable: [
+ o('Identifier', function() {
+ return new Value($1);
+ }), o('Value Accessor', function() {
+ return $1.add($2);
+ }), o('Invocation Accessor', function() {
+ return new Value($1, [].concat($2));
+ }), o('ThisProperty')
+ ],
+ Assignable: [
+ o('SimpleAssignable'), o('Array', function() {
+ return new Value($1);
+ }), o('Object', function() {
+ return new Value($1);
+ })
+ ],
+ Value: [
+ o('Assignable'), o('Literal', function() {
+ return new Value($1);
+ }), o('Parenthetical', function() {
+ return new Value($1);
+ }), o('Range', function() {
+ return new Value($1);
+ }), o('This')
+ ],
+ Accessor: [
+ o('. Identifier', function() {
+ return new Access($2);
+ }), o('?. Identifier', function() {
+ return new Access($2, 'soak');
+ }), o(':: Identifier', function() {
+ return [LOC(1)(new Access(new Literal('prototype'))), LOC(2)(new Access($2))];
+ }), o('?:: Identifier', function() {
+ return [LOC(1)(new Access(new Literal('prototype'), 'soak')), LOC(2)(new Access($2))];
+ }), o('::', function() {
+ return new Access(new Literal('prototype'));
+ }), o('Index')
+ ],
+ Index: [
+ o('INDEX_START IndexValue INDEX_END', function() {
+ return $2;
+ }), o('INDEX_SOAK Index', function() {
+ return extend($2, {
+ soak: true
+ });
+ })
+ ],
+ IndexValue: [
+ o('Expression', function() {
+ return new Index($1);
+ }), o('Slice', function() {
+ return new Slice($1);
+ })
+ ],
+ Object: [
+ o('{ AssignList OptComma }', function() {
+ return new Obj($2, $1.generated);
+ })
+ ],
+ AssignList: [
+ o('', function() {
+ return [];
+ }), o('AssignObj', function() {
+ return [$1];
+ }), o('AssignList , AssignObj', function() {
+ return $1.concat($3);
+ }), o('AssignList OptComma TERMINATOR AssignObj', function() {
+ return $1.concat($4);
+ }), o('AssignList OptComma INDENT AssignList OptComma OUTDENT', function() {
+ return $1.concat($4);
+ })
+ ],
+ Class: [
+ o('CLASS', function() {
+ return new Class;
+ }), o('CLASS Block', function() {
+ return new Class(null, null, $2);
+ }), o('CLASS EXTENDS Expression', function() {
+ return new Class(null, $3);
+ }), o('CLASS EXTENDS Expression Block', function() {
+ return new Class(null, $3, $4);
+ }), o('CLASS SimpleAssignable', function() {
+ return new Class($2);
+ }), o('CLASS SimpleAssignable Block', function() {
+ return new Class($2, null, $3);
+ }), o('CLASS SimpleAssignable EXTENDS Expression', function() {
+ return new Class($2, $4);
+ }), o('CLASS SimpleAssignable EXTENDS Expression Block', function() {
+ return new Class($2, $4, $5);
+ })
+ ],
+ Invocation: [
+ o('Value OptFuncExist Arguments', function() {
+ return new Call($1, $3, $2);
+ }), o('Invocation OptFuncExist Arguments', function() {
+ return new Call($1, $3, $2);
+ }), o('SUPER', function() {
+ return new Call('super', [new Splat(new Literal('arguments'))]);
+ }), o('SUPER Arguments', function() {
+ return new Call('super', $2);
+ })
+ ],
+ OptFuncExist: [
+ o('', function() {
+ return false;
+ }), o('FUNC_EXIST', function() {
+ return true;
+ })
+ ],
+ Arguments: [
+ o('CALL_START CALL_END', function() {
+ return [];
+ }), o('CALL_START ArgList OptComma CALL_END', function() {
+ return $2;
+ })
+ ],
+ This: [
+ o('THIS', function() {
+ return new Value(new Literal('this'));
+ }), o('@', function() {
+ return new Value(new Literal('this'));
+ })
+ ],
+ ThisProperty: [
+ o('@ Identifier', function() {
+ return new Value(LOC(1)(new Literal('this')), [LOC(2)(new Access($2))], 'this');
+ })
+ ],
+ Array: [
+ o('[ ]', function() {
+ return new Arr([]);
+ }), o('[ ArgList OptComma ]', function() {
+ return new Arr($2);
+ })
+ ],
+ RangeDots: [
+ o('..', function() {
+ return 'inclusive';
+ }), o('...', function() {
+ return 'exclusive';
+ })
+ ],
+ Range: [
+ o('[ Expression RangeDots Expression ]', function() {
+ return new Range($2, $4, $3);
+ })
+ ],
+ Slice: [
+ o('Expression RangeDots Expression', function() {
+ return new Range($1, $3, $2);
+ }), o('Expression RangeDots', function() {
+ return new Range($1, null, $2);
+ }), o('RangeDots Expression', function() {
+ return new Range(null, $2, $1);
+ }), o('RangeDots', function() {
+ return new Range(null, null, $1);
+ })
+ ],
+ ArgList: [
+ o('Arg', function() {
+ return [$1];
+ }), o('ArgList , Arg', function() {
+ return $1.concat($3);
+ }), o('ArgList OptComma TERMINATOR Arg', function() {
+ return $1.concat($4);
+ }), o('INDENT ArgList OptComma OUTDENT', function() {
+ return $2;
+ }), o('ArgList OptComma INDENT ArgList OptComma OUTDENT', function() {
+ return $1.concat($4);
+ })
+ ],
+ Arg: [
+ o('Expression'), o('Splat'), o('...', function() {
+ return new Expansion;
+ })
+ ],
+ SimpleArgs: [
+ o('Expression'), o('SimpleArgs , Expression', function() {
+ return [].concat($1, $3);
+ })
+ ],
+ Try: [
+ o('TRY Block', function() {
+ return new Try($2);
+ }), o('TRY Block Catch', function() {
+ return new Try($2, $3[0], $3[1]);
+ }), o('TRY Block FINALLY Block', function() {
+ return new Try($2, null, null, $4);
+ }), o('TRY Block Catch FINALLY Block', function() {
+ return new Try($2, $3[0], $3[1], $5);
+ })
+ ],
+ Catch: [
+ o('CATCH Identifier Block', function() {
+ return [$2, $3];
+ }), o('CATCH Object Block', function() {
+ return [LOC(2)(new Value($2)), $3];
+ }), o('CATCH Block', function() {
+ return [null, $2];
+ })
+ ],
+ Throw: [
+ o('THROW Expression', function() {
+ return new Throw($2);
+ })
+ ],
+ Parenthetical: [
+ o('( Body )', function() {
+ return new Parens($2);
+ }), o('( INDENT Body OUTDENT )', function() {
+ return new Parens($3);
+ })
+ ],
+ WhileSource: [
+ o('WHILE Expression', function() {
+ return new While($2);
+ }), o('WHILE Expression WHEN Expression', function() {
+ return new While($2, {
+ guard: $4
+ });
+ }), o('UNTIL Expression', function() {
+ return new While($2, {
+ invert: true
+ });
+ }), o('UNTIL Expression WHEN Expression', function() {
+ return new While($2, {
+ invert: true,
+ guard: $4
+ });
+ })
+ ],
+ While: [
+ o('WhileSource Block', function() {
+ return $1.addBody($2);
+ }), o('Statement WhileSource', function() {
+ return $2.addBody(LOC(1)(Block.wrap([$1])));
+ }), o('Expression WhileSource', function() {
+ return $2.addBody(LOC(1)(Block.wrap([$1])));
+ }), o('Loop', function() {
+ return $1;
+ })
+ ],
+ Loop: [
+ o('LOOP Block', function() {
+ return new While(LOC(1)(new Literal('true'))).addBody($2);
+ }), o('LOOP Expression', function() {
+ return new While(LOC(1)(new Literal('true'))).addBody(LOC(2)(Block.wrap([$2])));
+ })
+ ],
+ For: [
+ o('Statement ForBody', function() {
+ return new For($1, $2);
+ }), o('Expression ForBody', function() {
+ return new For($1, $2);
+ }), o('ForBody Block', function() {
+ return new For($2, $1);
+ })
+ ],
+ ForBody: [
+ o('FOR Range', function() {
+ return {
+ source: LOC(2)(new Value($2))
+ };
+ }), o('ForStart ForSource', function() {
+ $2.own = $1.own;
+ $2.name = $1[0];
+ $2.index = $1[1];
+ return $2;
+ })
+ ],
+ ForStart: [
+ o('FOR ForVariables', function() {
+ return $2;
+ }), o('FOR OWN ForVariables', function() {
+ $3.own = true;
+ return $3;
+ })
+ ],
+ ForValue: [
+ o('Identifier'), o('ThisProperty'), o('Array', function() {
+ return new Value($1);
+ }), o('Object', function() {
+ return new Value($1);
+ })
+ ],
+ ForVariables: [
+ o('ForValue', function() {
+ return [$1];
+ }), o('ForValue , ForValue', function() {
+ return [$1, $3];
+ })
+ ],
+ ForSource: [
+ o('FORIN Expression', function() {
+ return {
+ source: $2
+ };
+ }), o('FOROF Expression', function() {
+ return {
+ source: $2,
+ object: true
+ };
+ }), o('FORIN Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ guard: $4
+ };
+ }), o('FOROF Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ guard: $4,
+ object: true
+ };
+ }), o('FORIN Expression BY Expression', function() {
+ return {
+ source: $2,
+ step: $4
+ };
+ }), o('FORIN Expression WHEN Expression BY Expression', function() {
+ return {
+ source: $2,
+ guard: $4,
+ step: $6
+ };
+ }), o('FORIN Expression BY Expression WHEN Expression', function() {
+ return {
+ source: $2,
+ step: $4,
+ guard: $6
+ };
+ })
+ ],
+ Switch: [
+ o('SWITCH Expression INDENT Whens OUTDENT', function() {
+ return new Switch($2, $4);
+ }), o('SWITCH Expression INDENT Whens ELSE Block OUTDENT', function() {
+ return new Switch($2, $4, $6);
+ }), o('SWITCH INDENT Whens OUTDENT', function() {
+ return new Switch(null, $3);
+ }), o('SWITCH INDENT Whens ELSE Block OUTDENT', function() {
+ return new Switch(null, $3, $5);
+ })
+ ],
+ Whens: [
+ o('When'), o('Whens When', function() {
+ return $1.concat($2);
+ })
+ ],
+ When: [
+ o('LEADING_WHEN SimpleArgs Block', function() {
+ return [[$2, $3]];
+ }), o('LEADING_WHEN SimpleArgs Block TERMINATOR', function() {
+ return [[$2, $3]];
+ })
+ ],
+ IfBlock: [
+ o('IF Expression Block', function() {
+ return new If($2, $3, {
+ type: $1
+ });
+ }), o('IfBlock ELSE IF Expression Block', function() {
+ return $1.addElse(LOC(3, 5)(new If($4, $5, {
+ type: $3
+ })));
+ })
+ ],
+ If: [
+ o('IfBlock'), o('IfBlock ELSE Block', function() {
+ return $1.addElse($3);
+ }), o('Statement POST_IF Expression', function() {
+ return new If($3, LOC(1)(Block.wrap([$1])), {
+ type: $2,
+ statement: true
+ });
+ }), o('Expression POST_IF Expression', function() {
+ return new If($3, LOC(1)(Block.wrap([$1])), {
+ type: $2,
+ statement: true
+ });
+ })
+ ],
+ Operation: [
+ o('UNARY Expression', function() {
+ return new Op($1, $2);
+ }), o('UNARY_MATH Expression', function() {
+ return new Op($1, $2);
+ }), o('- Expression', (function() {
+ return new Op('-', $2);
+ }), {
+ prec: 'UNARY_MATH'
+ }), o('+ Expression', (function() {
+ return new Op('+', $2);
+ }), {
+ prec: 'UNARY_MATH'
+ }), o('-- SimpleAssignable', function() {
+ return new Op('--', $2);
+ }), o('++ SimpleAssignable', function() {
+ return new Op('++', $2);
+ }), o('SimpleAssignable --', function() {
+ return new Op('--', $1, null, true);
+ }), o('SimpleAssignable ++', function() {
+ return new Op('++', $1, null, true);
+ }), o('Expression ?', function() {
+ return new Existence($1);
+ }), o('Expression + Expression', function() {
+ return new Op('+', $1, $3);
+ }), o('Expression - Expression', function() {
+ return new Op('-', $1, $3);
+ }), o('Expression MATH Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression ** Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression SHIFT Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression COMPARE Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression LOGIC Expression', function() {
+ return new Op($2, $1, $3);
+ }), o('Expression RELATION Expression', function() {
+ if ($2.charAt(0) === '!') {
+ return new Op($2.slice(1), $1, $3).invert();
+ } else {
+ return new Op($2, $1, $3);
+ }
+ }), o('SimpleAssignable COMPOUND_ASSIGN Expression', function() {
+ return new Assign($1, $3, $2);
+ }), o('SimpleAssignable COMPOUND_ASSIGN INDENT Expression OUTDENT', function() {
+ return new Assign($1, $4, $2);
+ }), o('SimpleAssignable COMPOUND_ASSIGN TERMINATOR Expression', function() {
+ return new Assign($1, $4, $2);
+ }), o('SimpleAssignable EXTENDS Expression', function() {
+ return new Extends($1, $3);
+ })
+ ]
+ };
+
+ operators = [['left', '.', '?.', '::', '?::'], ['left', 'CALL_START', 'CALL_END'], ['nonassoc', '++', '--'], ['left', '?'], ['right', 'UNARY'], ['right', '**'], ['right', 'UNARY_MATH'], ['left', 'MATH'], ['left', '+', '-'], ['left', 'SHIFT'], ['left', 'RELATION'], ['left', 'COMPARE'], ['left', 'LOGIC'], ['nonassoc', 'INDENT', 'OUTDENT'], ['right', '=', ':', 'COMPOUND_ASSIGN', 'RETURN', 'THROW', 'EXTENDS'], ['right', 'FORIN', 'FOROF', 'BY', 'WHEN'], ['right', 'IF', 'ELSE', 'FOR', 'WHILE', 'UNTIL', 'LOOP', 'SUPER', 'CLASS'], ['left', 'POST_IF']];
+
+ tokens = [];
+
+ for (name in grammar) {
+ alternatives = grammar[name];
+ grammar[name] = (function() {
+ var _i, _j, _len, _len1, _ref, _results;
+ _results = [];
+ for (_i = 0, _len = alternatives.length; _i < _len; _i++) {
+ alt = alternatives[_i];
+ _ref = alt[0].split(' ');
+ for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+ token = _ref[_j];
+ if (!grammar[token]) {
+ tokens.push(token);
+ }
+ }
+ if (name === 'Root') {
+ alt[1] = "return " + alt[1];
+ }
+ _results.push(alt);
+ }
+ return _results;
+ })();
+ }
+
+ exports.parser = new Parser({
+ tokens: tokens.join(' '),
+ bnf: grammar,
+ operators: operators.reverse(),
+ startSymbol: 'Root'
+ });
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/helpers.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/helpers.js
new file mode 100644
index 000000000..049f757f1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/helpers.js
@@ -0,0 +1,252 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var buildLocationData, extend, flatten, last, repeat, syntaxErrorToString, _ref;
+
+ exports.starts = function(string, literal, start) {
+ return literal === string.substr(start, literal.length);
+ };
+
+ exports.ends = function(string, literal, back) {
+ var len;
+ len = literal.length;
+ return literal === string.substr(string.length - len - (back || 0), len);
+ };
+
+ exports.repeat = repeat = function(str, n) {
+ var res;
+ res = '';
+ while (n > 0) {
+ if (n & 1) {
+ res += str;
+ }
+ n >>>= 1;
+ str += str;
+ }
+ return res;
+ };
+
+ exports.compact = function(array) {
+ var item, _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = array.length; _i < _len; _i++) {
+ item = array[_i];
+ if (item) {
+ _results.push(item);
+ }
+ }
+ return _results;
+ };
+
+ exports.count = function(string, substr) {
+ var num, pos;
+ num = pos = 0;
+ if (!substr.length) {
+ return 1 / 0;
+ }
+ while (pos = 1 + string.indexOf(substr, pos)) {
+ num++;
+ }
+ return num;
+ };
+
+ exports.merge = function(options, overrides) {
+ return extend(extend({}, options), overrides);
+ };
+
+ extend = exports.extend = function(object, properties) {
+ var key, val;
+ for (key in properties) {
+ val = properties[key];
+ object[key] = val;
+ }
+ return object;
+ };
+
+ exports.flatten = flatten = function(array) {
+ var element, flattened, _i, _len;
+ flattened = [];
+ for (_i = 0, _len = array.length; _i < _len; _i++) {
+ element = array[_i];
+ if (element instanceof Array) {
+ flattened = flattened.concat(flatten(element));
+ } else {
+ flattened.push(element);
+ }
+ }
+ return flattened;
+ };
+
+ exports.del = function(obj, key) {
+ var val;
+ val = obj[key];
+ delete obj[key];
+ return val;
+ };
+
+ exports.last = last = function(array, back) {
+ return array[array.length - (back || 0) - 1];
+ };
+
+ exports.some = (_ref = Array.prototype.some) != null ? _ref : function(fn) {
+ var e, _i, _len;
+ for (_i = 0, _len = this.length; _i < _len; _i++) {
+ e = this[_i];
+ if (fn(e)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ exports.invertLiterate = function(code) {
+ var line, lines, maybe_code;
+ maybe_code = true;
+ lines = (function() {
+ var _i, _len, _ref1, _results;
+ _ref1 = code.split('\n');
+ _results = [];
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ line = _ref1[_i];
+ if (maybe_code && /^([ ]{4}|[ ]{0,3}\t)/.test(line)) {
+ _results.push(line);
+ } else if (maybe_code = /^\s*$/.test(line)) {
+ _results.push(line);
+ } else {
+ _results.push('# ' + line);
+ }
+ }
+ return _results;
+ })();
+ return lines.join('\n');
+ };
+
+ buildLocationData = function(first, last) {
+ if (!last) {
+ return first;
+ } else {
+ return {
+ first_line: first.first_line,
+ first_column: first.first_column,
+ last_line: last.last_line,
+ last_column: last.last_column
+ };
+ }
+ };
+
+ exports.addLocationDataFn = function(first, last) {
+ return function(obj) {
+ if (((typeof obj) === 'object') && (!!obj['updateLocationDataIfMissing'])) {
+ obj.updateLocationDataIfMissing(buildLocationData(first, last));
+ }
+ return obj;
+ };
+ };
+
+ exports.locationDataToString = function(obj) {
+ var locationData;
+ if (("2" in obj) && ("first_line" in obj[2])) {
+ locationData = obj[2];
+ } else if ("first_line" in obj) {
+ locationData = obj;
+ }
+ if (locationData) {
+ return ("" + (locationData.first_line + 1) + ":" + (locationData.first_column + 1) + "-") + ("" + (locationData.last_line + 1) + ":" + (locationData.last_column + 1));
+ } else {
+ return "No location data";
+ }
+ };
+
+ exports.baseFileName = function(file, stripExt, useWinPathSep) {
+ var parts, pathSep;
+ if (stripExt == null) {
+ stripExt = false;
+ }
+ if (useWinPathSep == null) {
+ useWinPathSep = false;
+ }
+ pathSep = useWinPathSep ? /\\|\// : /\//;
+ parts = file.split(pathSep);
+ file = parts[parts.length - 1];
+ if (!(stripExt && file.indexOf('.') >= 0)) {
+ return file;
+ }
+ parts = file.split('.');
+ parts.pop();
+ if (parts[parts.length - 1] === 'coffee' && parts.length > 1) {
+ parts.pop();
+ }
+ return parts.join('.');
+ };
+
+ exports.isCoffee = function(file) {
+ return /\.((lit)?coffee|coffee\.md)$/.test(file);
+ };
+
+ exports.isLiterate = function(file) {
+ return /\.(litcoffee|coffee\.md)$/.test(file);
+ };
+
+ exports.throwSyntaxError = function(message, location) {
+ var error;
+ error = new SyntaxError(message);
+ error.location = location;
+ error.toString = syntaxErrorToString;
+ error.stack = error.toString();
+ throw error;
+ };
+
+ exports.updateSyntaxError = function(error, code, filename) {
+ if (error.toString === syntaxErrorToString) {
+ error.code || (error.code = code);
+ error.filename || (error.filename = filename);
+ error.stack = error.toString();
+ }
+ return error;
+ };
+
+ syntaxErrorToString = function() {
+ var codeLine, colorize, colorsEnabled, end, filename, first_column, first_line, last_column, last_line, marker, start, _ref1, _ref2;
+ if (!(this.code && this.location)) {
+ return Error.prototype.toString.call(this);
+ }
+ _ref1 = this.location, first_line = _ref1.first_line, first_column = _ref1.first_column, last_line = _ref1.last_line, last_column = _ref1.last_column;
+ if (last_line == null) {
+ last_line = first_line;
+ }
+ if (last_column == null) {
+ last_column = first_column;
+ }
+ filename = this.filename || '[stdin]';
+ codeLine = this.code.split('\n')[first_line];
+ start = first_column;
+ end = first_line === last_line ? last_column + 1 : codeLine.length;
+ marker = codeLine.slice(0, start).replace(/[^\s]/g, ' ') + repeat('^', end - start);
+ if (typeof process !== "undefined" && process !== null) {
+ colorsEnabled = process.stdout.isTTY && !process.env.NODE_DISABLE_COLORS;
+ }
+ if ((_ref2 = this.colorful) != null ? _ref2 : colorsEnabled) {
+ colorize = function(str) {
+ return "\x1B[1;31m" + str + "\x1B[0m";
+ };
+ codeLine = codeLine.slice(0, start) + colorize(codeLine.slice(start, end)) + codeLine.slice(end);
+ marker = colorize(marker);
+ }
+ return "" + filename + ":" + (first_line + 1) + ":" + (first_column + 1) + ": error: " + this.message + "\n" + codeLine + "\n" + marker;
+ };
+
+ exports.nameWhitespaceCharacter = function(string) {
+ switch (string) {
+ case ' ':
+ return 'space';
+ case '\n':
+ return 'newline';
+ case '\r':
+ return 'carriage return';
+ case '\t':
+ return 'tab';
+ default:
+ return string;
+ }
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/index.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/index.js
new file mode 100644
index 000000000..46c97ea5f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/index.js
@@ -0,0 +1,11 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var key, val, _ref;
+
+ _ref = require('./coffee-script');
+ for (key in _ref) {
+ val = _ref[key];
+ exports[key] = val;
+ }
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/lexer.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/lexer.js
new file mode 100644
index 000000000..0f3cef8e1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/lexer.js
@@ -0,0 +1,934 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var BOM, BOOL, CALLABLE, CODE, COFFEE_ALIASES, COFFEE_ALIAS_MAP, COFFEE_KEYWORDS, COMMENT, COMPARE, COMPOUND_ASSIGN, HEREDOC, HEREDOC_ILLEGAL, HEREDOC_INDENT, HEREGEX, HEREGEX_OMIT, IDENTIFIER, INDENTABLE_CLOSERS, 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, UNARY_MATH, WHITESPACE, compact, count, invertLiterate, key, last, locationDataToString, repeat, starts, throwSyntaxError, _ref, _ref1,
+ __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; };
+
+ _ref = require('./rewriter'), Rewriter = _ref.Rewriter, INVERSES = _ref.INVERSES;
+
+ _ref1 = require('./helpers'), count = _ref1.count, starts = _ref1.starts, compact = _ref1.compact, last = _ref1.last, repeat = _ref1.repeat, invertLiterate = _ref1.invertLiterate, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
+
+ exports.Lexer = Lexer = (function() {
+ function Lexer() {}
+
+ Lexer.prototype.tokenize = function(code, opts) {
+ var consumed, i, tag, _ref2;
+ if (opts == null) {
+ opts = {};
+ }
+ this.literate = opts.literate;
+ this.indent = 0;
+ this.baseIndent = 0;
+ this.indebt = 0;
+ this.outdebt = 0;
+ this.indents = [];
+ this.ends = [];
+ this.tokens = [];
+ this.chunkLine = opts.line || 0;
+ this.chunkColumn = opts.column || 0;
+ code = this.clean(code);
+ i = 0;
+ while (this.chunk = code.slice(i)) {
+ consumed = this.identifierToken() || this.commentToken() || this.whitespaceToken() || this.lineToken() || this.heredocToken() || this.stringToken() || this.numberToken() || this.regexToken() || this.jsToken() || this.literalToken();
+ _ref2 = this.getLineAndColumnFromChunk(consumed), this.chunkLine = _ref2[0], this.chunkColumn = _ref2[1];
+ i += consumed;
+ }
+ this.closeIndentation();
+ if (tag = this.ends.pop()) {
+ this.error("missing " + tag);
+ }
+ if (opts.rewrite === false) {
+ return this.tokens;
+ }
+ return (new Rewriter).rewrite(this.tokens);
+ };
+
+ Lexer.prototype.clean = function(code) {
+ if (code.charCodeAt(0) === BOM) {
+ code = code.slice(1);
+ }
+ code = code.replace(/\r/g, '').replace(TRAILING_SPACES, '');
+ if (WHITESPACE.test(code)) {
+ code = "\n" + code;
+ this.chunkLine--;
+ }
+ if (this.literate) {
+ code = invertLiterate(code);
+ }
+ return code;
+ };
+
+ Lexer.prototype.identifierToken = function() {
+ var colon, colonOffset, forcedIdentifier, id, idLength, input, match, poppedToken, prev, tag, tagToken, _ref2, _ref3, _ref4;
+ if (!(match = IDENTIFIER.exec(this.chunk))) {
+ return 0;
+ }
+ input = match[0], id = match[1], colon = match[2];
+ idLength = id.length;
+ poppedToken = void 0;
+ if (id === 'own' && this.tag() === 'FOR') {
+ this.token('OWN', id);
+ return id.length;
+ }
+ forcedIdentifier = colon || (prev = last(this.tokens)) && (((_ref2 = prev[0]) === '.' || _ref2 === '?.' || _ref2 === '::' || _ref2 === '?::') || !prev.spaced && prev[0] === '@');
+ tag = 'IDENTIFIER';
+ if (!forcedIdentifier && (__indexOf.call(JS_KEYWORDS, id) >= 0 || __indexOf.call(COFFEE_KEYWORDS, id) >= 0)) {
+ tag = id.toUpperCase();
+ if (tag === 'WHEN' && (_ref3 = this.tag(), __indexOf.call(LINE_BREAK, _ref3) >= 0)) {
+ tag = 'LEADING_WHEN';
+ } else if (tag === 'FOR') {
+ this.seenFor = true;
+ } else if (tag === 'UNLESS') {
+ tag = 'IF';
+ } else if (__indexOf.call(UNARY, tag) >= 0) {
+ tag = 'UNARY';
+ } else if (__indexOf.call(RELATION, tag) >= 0) {
+ if (tag !== 'INSTANCEOF' && this.seenFor) {
+ tag = 'FOR' + tag;
+ this.seenFor = false;
+ } else {
+ tag = 'RELATION';
+ if (this.value() === '!') {
+ poppedToken = this.tokens.pop();
+ id = '!' + id;
+ }
+ }
+ }
+ }
+ if (__indexOf.call(JS_FORBIDDEN, id) >= 0) {
+ if (forcedIdentifier) {
+ tag = 'IDENTIFIER';
+ id = new String(id);
+ id.reserved = true;
+ } else if (__indexOf.call(RESERVED, id) >= 0) {
+ this.error("reserved word \"" + id + "\"");
+ }
+ }
+ if (!forcedIdentifier) {
+ if (__indexOf.call(COFFEE_ALIASES, id) >= 0) {
+ id = COFFEE_ALIAS_MAP[id];
+ }
+ tag = (function() {
+ switch (id) {
+ case '!':
+ return 'UNARY';
+ case '==':
+ case '!=':
+ return 'COMPARE';
+ case '&&':
+ case '||':
+ return 'LOGIC';
+ case 'true':
+ case 'false':
+ return 'BOOL';
+ case 'break':
+ case 'continue':
+ return 'STATEMENT';
+ default:
+ return tag;
+ }
+ })();
+ }
+ tagToken = this.token(tag, id, 0, idLength);
+ if (poppedToken) {
+ _ref4 = [poppedToken[2].first_line, poppedToken[2].first_column], tagToken[2].first_line = _ref4[0], tagToken[2].first_column = _ref4[1];
+ }
+ if (colon) {
+ colonOffset = input.lastIndexOf(':');
+ this.token(':', ':', colonOffset, colon.length);
+ }
+ return input.length;
+ };
+
+ Lexer.prototype.numberToken = function() {
+ var binaryLiteral, lexedLength, match, number, octalLiteral;
+ if (!(match = NUMBER.exec(this.chunk))) {
+ return 0;
+ }
+ number = match[0];
+ if (/^0[BOX]/.test(number)) {
+ this.error("radix prefix '" + number + "' must be lowercase");
+ } else if (/E/.test(number) && !/^0x/.test(number)) {
+ this.error("exponential notation '" + number + "' must be indicated with a lowercase 'e'");
+ } else if (/^0\d*[89]/.test(number)) {
+ this.error("decimal literal '" + number + "' must not be prefixed with '0'");
+ } else if (/^0\d+/.test(number)) {
+ this.error("octal literal '" + number + "' must be prefixed with '0o'");
+ }
+ lexedLength = number.length;
+ if (octalLiteral = /^0o([0-7]+)/.exec(number)) {
+ number = '0x' + parseInt(octalLiteral[1], 8).toString(16);
+ }
+ if (binaryLiteral = /^0b([01]+)/.exec(number)) {
+ number = '0x' + parseInt(binaryLiteral[1], 2).toString(16);
+ }
+ this.token('NUMBER', number, 0, lexedLength);
+ return lexedLength;
+ };
+
+ Lexer.prototype.stringToken = function() {
+ var inner, innerLen, numBreak, octalEsc, pos, quote, string, trimmed;
+ switch (quote = this.chunk.charAt(0)) {
+ case "'":
+ string = (SIMPLESTR.exec(this.chunk) || [])[0];
+ break;
+ case '"':
+ string = this.balancedString(this.chunk, '"');
+ }
+ if (!string) {
+ return 0;
+ }
+ inner = string.slice(1, -1);
+ trimmed = this.removeNewlines(inner);
+ if (quote === '"' && 0 < string.indexOf('#{', 1)) {
+ numBreak = pos = 0;
+ innerLen = inner.length;
+ while (inner.charAt(pos++) === '\n' && pos < innerLen) {
+ numBreak++;
+ }
+ this.interpolateString(trimmed, {
+ strOffset: 1 + numBreak,
+ lexedLength: string.length
+ });
+ } else {
+ this.token('STRING', quote + this.escapeLines(trimmed) + quote, 0, string.length);
+ }
+ if (octalEsc = /^(?:\\.|[^\\])*\\(?:0[0-7]|[1-7])/.test(string)) {
+ this.error("octal escape sequences " + string + " are not allowed");
+ }
+ return string.length;
+ };
+
+ Lexer.prototype.heredocToken = function() {
+ var doc, heredoc, match, quote, strOffset;
+ if (!(match = HEREDOC.exec(this.chunk))) {
+ return 0;
+ }
+ heredoc = match[0];
+ quote = heredoc.charAt(0);
+ doc = this.sanitizeHeredoc(match[2], {
+ quote: quote,
+ indent: null
+ });
+ if (quote === '"' && 0 <= doc.indexOf('#{')) {
+ strOffset = match[2].charAt(0) === '\n' ? 4 : 3;
+ this.interpolateString(doc, {
+ heredoc: true,
+ strOffset: strOffset,
+ lexedLength: heredoc.length
+ });
+ } else {
+ this.token('STRING', this.makeString(doc, quote, true), 0, heredoc.length);
+ }
+ return heredoc.length;
+ };
+
+ Lexer.prototype.commentToken = function() {
+ var comment, here, match;
+ if (!(match = this.chunk.match(COMMENT))) {
+ return 0;
+ }
+ comment = match[0], here = match[1];
+ if (here) {
+ this.token('HERECOMMENT', this.sanitizeHeredoc(here, {
+ herecomment: true,
+ indent: repeat(' ', this.indent)
+ }), 0, comment.length);
+ }
+ return comment.length;
+ };
+
+ Lexer.prototype.jsToken = function() {
+ var match, script;
+ if (!(this.chunk.charAt(0) === '`' && (match = JSTOKEN.exec(this.chunk)))) {
+ return 0;
+ }
+ this.token('JS', (script = match[0]).slice(1, -1), 0, script.length);
+ return script.length;
+ };
+
+ Lexer.prototype.regexToken = function() {
+ var flags, length, match, prev, regex, _ref2, _ref3;
+ if (this.chunk.charAt(0) !== '/') {
+ return 0;
+ }
+ if (length = this.heregexToken()) {
+ return length;
+ }
+ prev = last(this.tokens);
+ if (prev && (_ref2 = prev[0], __indexOf.call((prev.spaced ? NOT_REGEX : NOT_SPACED_REGEX), _ref2) >= 0)) {
+ return 0;
+ }
+ if (!(match = REGEX.exec(this.chunk))) {
+ return 0;
+ }
+ _ref3 = match, match = _ref3[0], regex = _ref3[1], flags = _ref3[2];
+ if (regex === '//') {
+ return 0;
+ }
+ if (regex.slice(0, 2) === '/*') {
+ this.error('regular expressions cannot begin with `*`');
+ }
+ this.token('REGEX', "" + regex + flags, 0, match.length);
+ return match.length;
+ };
+
+ Lexer.prototype.heregexToken = function() {
+ var body, flags, flagsOffset, heregex, match, plusToken, prev, re, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+ if (!(match = HEREGEX.exec(this.chunk))) {
+ return 0;
+ }
+ heregex = match[0], body = match[1], flags = match[2];
+ if (0 > body.indexOf('#{')) {
+ re = this.escapeLines(body.replace(HEREGEX_OMIT, '$1$2').replace(/\//g, '\\/'), true);
+ if (re.match(/^\*/)) {
+ this.error('regular expressions cannot begin with `*`');
+ }
+ this.token('REGEX', "/" + (re || '(?:)') + "/" + flags, 0, heregex.length);
+ return heregex.length;
+ }
+ this.token('IDENTIFIER', 'RegExp', 0, 0);
+ this.token('CALL_START', '(', 0, 0);
+ tokens = [];
+ _ref2 = this.interpolateString(body, {
+ regex: true,
+ strOffset: 3
+ });
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ token = _ref2[_i];
+ tag = token[0], value = token[1];
+ if (tag === 'TOKENS') {
+ tokens.push.apply(tokens, value);
+ } else if (tag === 'NEOSTRING') {
+ if (!(value = value.replace(HEREGEX_OMIT, '$1$2'))) {
+ continue;
+ }
+ value = value.replace(/\\/g, '\\\\');
+ token[0] = 'STRING';
+ token[1] = this.makeString(value, '"', true);
+ tokens.push(token);
+ } else {
+ this.error("Unexpected " + tag);
+ }
+ prev = last(this.tokens);
+ plusToken = ['+', '+'];
+ plusToken[2] = prev[2];
+ tokens.push(plusToken);
+ }
+ tokens.pop();
+ if (((_ref3 = tokens[0]) != null ? _ref3[0] : void 0) !== 'STRING') {
+ this.token('STRING', '""', 0, 0);
+ this.token('+', '+', 0, 0);
+ }
+ (_ref4 = this.tokens).push.apply(_ref4, tokens);
+ if (flags) {
+ flagsOffset = heregex.lastIndexOf(flags);
+ this.token(',', ',', flagsOffset, 0);
+ this.token('STRING', '"' + flags + '"', flagsOffset, flags.length);
+ }
+ this.token(')', ')', heregex.length - 1, 0);
+ return heregex.length;
+ };
+
+ Lexer.prototype.lineToken = function() {
+ var diff, indent, match, noNewlines, size;
+ if (!(match = MULTI_DENT.exec(this.chunk))) {
+ return 0;
+ }
+ indent = match[0];
+ this.seenFor = false;
+ size = indent.length - 1 - indent.lastIndexOf('\n');
+ noNewlines = this.unfinished();
+ if (size - this.indebt === this.indent) {
+ if (noNewlines) {
+ this.suppressNewlines();
+ } else {
+ this.newlineToken(0);
+ }
+ return indent.length;
+ }
+ if (size > this.indent) {
+ if (noNewlines) {
+ this.indebt = size - this.indent;
+ this.suppressNewlines();
+ return indent.length;
+ }
+ if (!this.tokens.length) {
+ this.baseIndent = this.indent = size;
+ return indent.length;
+ }
+ diff = size - this.indent + this.outdebt;
+ this.token('INDENT', diff, indent.length - size, size);
+ this.indents.push(diff);
+ this.ends.push('OUTDENT');
+ this.outdebt = this.indebt = 0;
+ this.indent = size;
+ } else if (size < this.baseIndent) {
+ this.error('missing indentation', indent.length);
+ } else {
+ this.indebt = 0;
+ this.outdentToken(this.indent - size, noNewlines, indent.length);
+ }
+ return indent.length;
+ };
+
+ Lexer.prototype.outdentToken = function(moveOut, noNewlines, outdentLength) {
+ var decreasedIndent, dent, lastIndent, _ref2;
+ decreasedIndent = this.indent - moveOut;
+ while (moveOut > 0) {
+ lastIndent = this.indents[this.indents.length - 1];
+ if (!lastIndent) {
+ moveOut = 0;
+ } else if (lastIndent === this.outdebt) {
+ moveOut -= this.outdebt;
+ this.outdebt = 0;
+ } else if (lastIndent < this.outdebt) {
+ this.outdebt -= lastIndent;
+ moveOut -= lastIndent;
+ } else {
+ dent = this.indents.pop() + this.outdebt;
+ if (outdentLength && (_ref2 = this.chunk[outdentLength], __indexOf.call(INDENTABLE_CLOSERS, _ref2) >= 0)) {
+ decreasedIndent -= dent - moveOut;
+ moveOut = dent;
+ }
+ this.outdebt = 0;
+ this.pair('OUTDENT');
+ this.token('OUTDENT', moveOut, 0, outdentLength);
+ moveOut -= dent;
+ }
+ }
+ if (dent) {
+ this.outdebt -= moveOut;
+ }
+ while (this.value() === ';') {
+ this.tokens.pop();
+ }
+ if (!(this.tag() === 'TERMINATOR' || noNewlines)) {
+ this.token('TERMINATOR', '\n', outdentLength, 0);
+ }
+ this.indent = decreasedIndent;
+ return this;
+ };
+
+ Lexer.prototype.whitespaceToken = function() {
+ var match, nline, prev;
+ if (!((match = WHITESPACE.exec(this.chunk)) || (nline = this.chunk.charAt(0) === '\n'))) {
+ return 0;
+ }
+ prev = last(this.tokens);
+ if (prev) {
+ prev[match ? 'spaced' : 'newLine'] = true;
+ }
+ if (match) {
+ return match[0].length;
+ } else {
+ return 0;
+ }
+ };
+
+ Lexer.prototype.newlineToken = function(offset) {
+ while (this.value() === ';') {
+ this.tokens.pop();
+ }
+ if (this.tag() !== 'TERMINATOR') {
+ this.token('TERMINATOR', '\n', offset, 0);
+ }
+ return this;
+ };
+
+ Lexer.prototype.suppressNewlines = function() {
+ if (this.value() === '\\') {
+ this.tokens.pop();
+ }
+ return this;
+ };
+
+ Lexer.prototype.literalToken = function() {
+ var match, prev, tag, value, _ref2, _ref3, _ref4, _ref5;
+ if (match = OPERATOR.exec(this.chunk)) {
+ value = match[0];
+ if (CODE.test(value)) {
+ this.tagParameters();
+ }
+ } else {
+ value = this.chunk.charAt(0);
+ }
+ tag = value;
+ prev = last(this.tokens);
+ if (value === '=' && prev) {
+ if (!prev[1].reserved && (_ref2 = prev[1], __indexOf.call(JS_FORBIDDEN, _ref2) >= 0)) {
+ this.error("reserved word \"" + (this.value()) + "\" can't be assigned");
+ }
+ if ((_ref3 = prev[1]) === '||' || _ref3 === '&&') {
+ prev[0] = 'COMPOUND_ASSIGN';
+ prev[1] += '=';
+ return value.length;
+ }
+ }
+ if (value === ';') {
+ this.seenFor = false;
+ tag = 'TERMINATOR';
+ } else if (__indexOf.call(MATH, value) >= 0) {
+ tag = 'MATH';
+ } else if (__indexOf.call(COMPARE, value) >= 0) {
+ tag = 'COMPARE';
+ } else if (__indexOf.call(COMPOUND_ASSIGN, value) >= 0) {
+ tag = 'COMPOUND_ASSIGN';
+ } else if (__indexOf.call(UNARY, value) >= 0) {
+ tag = 'UNARY';
+ } else if (__indexOf.call(UNARY_MATH, value) >= 0) {
+ tag = 'UNARY_MATH';
+ } else if (__indexOf.call(SHIFT, value) >= 0) {
+ tag = 'SHIFT';
+ } else if (__indexOf.call(LOGIC, value) >= 0 || value === '?' && (prev != null ? prev.spaced : void 0)) {
+ tag = 'LOGIC';
+ } else if (prev && !prev.spaced) {
+ if (value === '(' && (_ref4 = prev[0], __indexOf.call(CALLABLE, _ref4) >= 0)) {
+ if (prev[0] === '?') {
+ prev[0] = 'FUNC_EXIST';
+ }
+ tag = 'CALL_START';
+ } else if (value === '[' && (_ref5 = prev[0], __indexOf.call(INDEXABLE, _ref5) >= 0)) {
+ tag = 'INDEX_START';
+ switch (prev[0]) {
+ case '?':
+ prev[0] = 'INDEX_SOAK';
+ }
+ }
+ }
+ switch (value) {
+ case '(':
+ case '{':
+ case '[':
+ this.ends.push(INVERSES[value]);
+ break;
+ case ')':
+ case '}':
+ case ']':
+ this.pair(value);
+ }
+ this.token(tag, value);
+ return value.length;
+ };
+
+ Lexer.prototype.sanitizeHeredoc = function(doc, options) {
+ var attempt, herecomment, indent, match, _ref2;
+ indent = options.indent, herecomment = options.herecomment;
+ if (herecomment) {
+ if (HEREDOC_ILLEGAL.test(doc)) {
+ this.error("block comment cannot contain \"*/\", starting");
+ }
+ if (doc.indexOf('\n') < 0) {
+ return doc;
+ }
+ } else {
+ while (match = HEREDOC_INDENT.exec(doc)) {
+ attempt = match[1];
+ if (indent === null || (0 < (_ref2 = attempt.length) && _ref2 < indent.length)) {
+ indent = attempt;
+ }
+ }
+ }
+ if (indent) {
+ doc = doc.replace(RegExp("\\n" + indent, "g"), '\n');
+ }
+ if (!herecomment) {
+ doc = doc.replace(/^\n/, '');
+ }
+ return doc;
+ };
+
+ Lexer.prototype.tagParameters = function() {
+ var i, stack, tok, tokens;
+ if (this.tag() !== ')') {
+ return this;
+ }
+ stack = [];
+ tokens = this.tokens;
+ i = tokens.length;
+ tokens[--i][0] = 'PARAM_END';
+ while (tok = tokens[--i]) {
+ switch (tok[0]) {
+ case ')':
+ stack.push(tok);
+ break;
+ case '(':
+ case 'CALL_START':
+ if (stack.length) {
+ stack.pop();
+ } else if (tok[0] === '(') {
+ tok[0] = 'PARAM_START';
+ return this;
+ } else {
+ return this;
+ }
+ }
+ }
+ return this;
+ };
+
+ Lexer.prototype.closeIndentation = function() {
+ return this.outdentToken(this.indent);
+ };
+
+ Lexer.prototype.balancedString = function(str, end) {
+ var continueCount, i, letter, match, prev, stack, _i, _ref2;
+ continueCount = 0;
+ stack = [end];
+ for (i = _i = 1, _ref2 = str.length; 1 <= _ref2 ? _i < _ref2 : _i > _ref2; i = 1 <= _ref2 ? ++_i : --_i) {
+ if (continueCount) {
+ --continueCount;
+ continue;
+ }
+ switch (letter = str.charAt(i)) {
+ case '\\':
+ ++continueCount;
+ continue;
+ case end:
+ stack.pop();
+ if (!stack.length) {
+ return str.slice(0, +i + 1 || 9e9);
+ }
+ end = stack[stack.length - 1];
+ continue;
+ }
+ if (end === '}' && (letter === '"' || letter === "'")) {
+ stack.push(end = letter);
+ } else if (end === '}' && letter === '/' && (match = HEREGEX.exec(str.slice(i)) || REGEX.exec(str.slice(i)))) {
+ continueCount += match[0].length - 1;
+ } else if (end === '}' && letter === '{') {
+ stack.push(end = '}');
+ } else if (end === '"' && prev === '#' && letter === '{') {
+ stack.push(end = '}');
+ }
+ prev = letter;
+ }
+ return this.error("missing " + (stack.pop()) + ", starting");
+ };
+
+ Lexer.prototype.interpolateString = function(str, options) {
+ var column, errorToken, expr, heredoc, i, inner, interpolated, len, letter, lexedLength, line, locationToken, nested, offsetInChunk, pi, plusToken, popped, regex, rparen, strOffset, tag, token, tokens, value, _i, _len, _ref2, _ref3, _ref4;
+ if (options == null) {
+ options = {};
+ }
+ heredoc = options.heredoc, regex = options.regex, offsetInChunk = options.offsetInChunk, strOffset = options.strOffset, lexedLength = options.lexedLength;
+ offsetInChunk || (offsetInChunk = 0);
+ strOffset || (strOffset = 0);
+ lexedLength || (lexedLength = str.length);
+ tokens = [];
+ pi = 0;
+ i = -1;
+ while (letter = str.charAt(i += 1)) {
+ if (letter === '\\') {
+ i += 1;
+ continue;
+ }
+ if (!(letter === '#' && str.charAt(i + 1) === '{' && (expr = this.balancedString(str.slice(i + 1), '}')))) {
+ continue;
+ }
+ if (pi < i) {
+ tokens.push(this.makeToken('NEOSTRING', str.slice(pi, i), strOffset + pi));
+ }
+ if (!errorToken) {
+ errorToken = this.makeToken('', 'string interpolation', offsetInChunk + i + 1, 2);
+ }
+ inner = expr.slice(1, -1);
+ if (inner.length) {
+ _ref2 = this.getLineAndColumnFromChunk(strOffset + i + 2), line = _ref2[0], column = _ref2[1];
+ nested = new Lexer().tokenize(inner, {
+ line: line,
+ column: column,
+ rewrite: false
+ });
+ popped = nested.pop();
+ if (((_ref3 = nested[0]) != null ? _ref3[0] : void 0) === 'TERMINATOR') {
+ popped = nested.shift();
+ }
+ if (len = nested.length) {
+ if (len > 1) {
+ nested.unshift(this.makeToken('(', '(', strOffset + i + 1, 0));
+ nested.push(this.makeToken(')', ')', strOffset + i + 1 + inner.length, 0));
+ }
+ tokens.push(['TOKENS', nested]);
+ }
+ }
+ i += expr.length;
+ pi = i + 1;
+ }
+ if ((i > pi && pi < str.length)) {
+ tokens.push(this.makeToken('NEOSTRING', str.slice(pi), strOffset + pi));
+ }
+ if (regex) {
+ return tokens;
+ }
+ if (!tokens.length) {
+ return this.token('STRING', '""', offsetInChunk, lexedLength);
+ }
+ if (tokens[0][0] !== 'NEOSTRING') {
+ tokens.unshift(this.makeToken('NEOSTRING', '', offsetInChunk));
+ }
+ if (interpolated = tokens.length > 1) {
+ this.token('(', '(', offsetInChunk, 0, errorToken);
+ }
+ for (i = _i = 0, _len = tokens.length; _i < _len; i = ++_i) {
+ token = tokens[i];
+ tag = token[0], value = token[1];
+ if (i) {
+ if (i) {
+ plusToken = this.token('+', '+');
+ }
+ locationToken = tag === 'TOKENS' ? value[0] : token;
+ plusToken[2] = {
+ first_line: locationToken[2].first_line,
+ first_column: locationToken[2].first_column,
+ last_line: locationToken[2].first_line,
+ last_column: locationToken[2].first_column
+ };
+ }
+ if (tag === 'TOKENS') {
+ (_ref4 = this.tokens).push.apply(_ref4, value);
+ } else if (tag === 'NEOSTRING') {
+ token[0] = 'STRING';
+ token[1] = this.makeString(value, '"', heredoc);
+ this.tokens.push(token);
+ } else {
+ this.error("Unexpected " + tag);
+ }
+ }
+ if (interpolated) {
+ rparen = this.makeToken(')', ')', offsetInChunk + lexedLength, 0);
+ rparen.stringEnd = true;
+ this.tokens.push(rparen);
+ }
+ return tokens;
+ };
+
+ Lexer.prototype.pair = function(tag) {
+ var wanted;
+ if (tag !== (wanted = last(this.ends))) {
+ if ('OUTDENT' !== wanted) {
+ this.error("unmatched " + tag);
+ }
+ this.outdentToken(last(this.indents), true);
+ return this.pair(tag);
+ }
+ return this.ends.pop();
+ };
+
+ Lexer.prototype.getLineAndColumnFromChunk = function(offset) {
+ var column, lineCount, lines, string;
+ if (offset === 0) {
+ return [this.chunkLine, this.chunkColumn];
+ }
+ if (offset >= this.chunk.length) {
+ string = this.chunk;
+ } else {
+ string = this.chunk.slice(0, +(offset - 1) + 1 || 9e9);
+ }
+ lineCount = count(string, '\n');
+ column = this.chunkColumn;
+ if (lineCount > 0) {
+ lines = string.split('\n');
+ column = last(lines).length;
+ } else {
+ column += string.length;
+ }
+ return [this.chunkLine + lineCount, column];
+ };
+
+ Lexer.prototype.makeToken = function(tag, value, offsetInChunk, length) {
+ var lastCharacter, locationData, token, _ref2, _ref3;
+ if (offsetInChunk == null) {
+ offsetInChunk = 0;
+ }
+ if (length == null) {
+ length = value.length;
+ }
+ locationData = {};
+ _ref2 = this.getLineAndColumnFromChunk(offsetInChunk), locationData.first_line = _ref2[0], locationData.first_column = _ref2[1];
+ lastCharacter = Math.max(0, length - 1);
+ _ref3 = this.getLineAndColumnFromChunk(offsetInChunk + lastCharacter), locationData.last_line = _ref3[0], locationData.last_column = _ref3[1];
+ token = [tag, value, locationData];
+ return token;
+ };
+
+ Lexer.prototype.token = function(tag, value, offsetInChunk, length, origin) {
+ var token;
+ token = this.makeToken(tag, value, offsetInChunk, length);
+ if (origin) {
+ token.origin = origin;
+ }
+ this.tokens.push(token);
+ return token;
+ };
+
+ Lexer.prototype.tag = function(index, tag) {
+ var tok;
+ return (tok = last(this.tokens, index)) && (tag ? tok[0] = tag : tok[0]);
+ };
+
+ Lexer.prototype.value = function(index, val) {
+ var tok;
+ return (tok = last(this.tokens, index)) && (val ? tok[1] = val : tok[1]);
+ };
+
+ Lexer.prototype.unfinished = function() {
+ var _ref2;
+ return LINE_CONTINUER.test(this.chunk) || ((_ref2 = this.tag()) === '\\' || _ref2 === '.' || _ref2 === '?.' || _ref2 === '?::' || _ref2 === 'UNARY' || _ref2 === 'MATH' || _ref2 === 'UNARY_MATH' || _ref2 === '+' || _ref2 === '-' || _ref2 === '**' || _ref2 === 'SHIFT' || _ref2 === 'RELATION' || _ref2 === 'COMPARE' || _ref2 === 'LOGIC' || _ref2 === 'THROW' || _ref2 === 'EXTENDS');
+ };
+
+ Lexer.prototype.removeNewlines = function(str) {
+ return str.replace(/^\s*\n\s*/, '').replace(/([^\\]|\\\\)\s*\n\s*$/, '$1');
+ };
+
+ Lexer.prototype.escapeLines = function(str, heredoc) {
+ str = str.replace(/\\[^\S\n]*(\n|\\)\s*/g, function(escaped, character) {
+ if (character === '\n') {
+ return '';
+ } else {
+ return escaped;
+ }
+ });
+ if (heredoc) {
+ return str.replace(MULTILINER, '\\n');
+ } else {
+ return str.replace(/\s*\n\s*/g, ' ');
+ }
+ };
+
+ Lexer.prototype.makeString = function(body, quote, heredoc) {
+ if (!body) {
+ return quote + quote;
+ }
+ body = body.replace(RegExp("\\\\(" + quote + "|\\\\)", "g"), function(match, contents) {
+ if (contents === quote) {
+ return contents;
+ } else {
+ return match;
+ }
+ });
+ body = body.replace(RegExp("" + quote, "g"), '\\$&');
+ return quote + this.escapeLines(body, heredoc) + quote;
+ };
+
+ Lexer.prototype.error = function(message, offset) {
+ var first_column, first_line, _ref2;
+ if (offset == null) {
+ offset = 0;
+ }
+ _ref2 = this.getLineAndColumnFromChunk(offset), first_line = _ref2[0], first_column = _ref2[1];
+ return throwSyntaxError(message, {
+ first_line: first_line,
+ first_column: first_column
+ });
+ };
+
+ return Lexer;
+
+ })();
+
+ 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'];
+
+ COFFEE_KEYWORDS = ['undefined', 'then', 'unless', 'until', 'loop', 'of', 'by', 'when'];
+
+ COFFEE_ALIAS_MAP = {
+ and: '&&',
+ or: '||',
+ is: '==',
+ isnt: '!=',
+ not: '!',
+ yes: 'true',
+ no: 'false',
+ on: 'true',
+ off: 'false'
+ };
+
+ COFFEE_ALIASES = (function() {
+ var _results;
+ _results = [];
+ for (key in COFFEE_ALIAS_MAP) {
+ _results.push(key);
+ }
+ return _results;
+ })();
+
+ COFFEE_KEYWORDS = COFFEE_KEYWORDS.concat(COFFEE_ALIASES);
+
+ 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'];
+
+ STRICT_PROSCRIBED = ['arguments', 'eval'];
+
+ JS_FORBIDDEN = JS_KEYWORDS.concat(RESERVED).concat(STRICT_PROSCRIBED);
+
+ exports.RESERVED = RESERVED.concat(JS_KEYWORDS).concat(COFFEE_KEYWORDS).concat(STRICT_PROSCRIBED);
+
+ exports.STRICT_PROSCRIBED = STRICT_PROSCRIBED;
+
+ BOM = 65279;
+
+ IDENTIFIER = /^([$A-Za-z_\x7f-\uffff][$\w\x7f-\uffff]*)([^\n\S]*:(?!:))?/;
+
+ NUMBER = /^0b[01]+|^0o[0-7]+|^0x[\da-f]+|^\d*\.?\d+(?:e[+-]?\d+)?/i;
+
+ HEREDOC = /^("""|''')((?:\\[\s\S]|[^\\])*?)(?:\n[^\n\S]*)?\1/;
+
+ OPERATOR = /^(?:[-=]>|[-+*\/%<>&|^!?=]=|>>>=?|([-+:])\1|([&|<>*\/%])\2=?|\?(\.|::)|\.{2,3})/;
+
+ WHITESPACE = /^[^\n\S]+/;
+
+ COMMENT = /^###([^#][\s\S]*?)(?:###[^\n\S]*|###$)|^(?:\s*#(?!##[^#]).*)+/;
+
+ CODE = /^[-=]>/;
+
+ MULTI_DENT = /^(?:\n[^\n\S]*)+/;
+
+ SIMPLESTR = /^'[^\\']*(?:\\[\s\S][^\\']*)*'/;
+
+ JSTOKEN = /^`[^\\`]*(?:\\.[^\\`]*)*`/;
+
+ REGEX = /^(\/(?![\s=])[^[\/\n\\]*(?:(?:\\[\s\S]|\[[^\]\n\\]*(?:\\[\s\S][^\]\n\\]*)*])[^[\/\n\\]*)*\/)([imgy]{0,4})(?!\w)/;
+
+ HEREGEX = /^\/{3}((?:\\?[\s\S])+?)\/{3}([imgy]{0,4})(?!\w)/;
+
+ HEREGEX_OMIT = /((?:\\\\)+)|\\(\s|\/)|\s+(?:#.*)?/g;
+
+ MULTILINER = /\n/g;
+
+ HEREDOC_INDENT = /\n+([^\n\S]*)/g;
+
+ HEREDOC_ILLEGAL = /\*\//;
+
+ LINE_CONTINUER = /^\s*(?:,|\??\.(?![.\d])|::)/;
+
+ TRAILING_SPACES = /\s+$/;
+
+ COMPOUND_ASSIGN = ['-=', '+=', '/=', '*=', '%=', '||=', '&&=', '?=', '<<=', '>>=', '>>>=', '&=', '^=', '|=', '**=', '//=', '%%='];
+
+ UNARY = ['NEW', 'TYPEOF', 'DELETE', 'DO'];
+
+ UNARY_MATH = ['!', '~'];
+
+ LOGIC = ['&&', '||', '&', '|', '^'];
+
+ SHIFT = ['<<', '>>', '>>>'];
+
+ COMPARE = ['==', '!=', '<', '>', '<=', '>='];
+
+ MATH = ['*', '/', '%', '//', '%%'];
+
+ RELATION = ['IN', 'OF', 'INSTANCEOF'];
+
+ BOOL = ['TRUE', 'FALSE'];
+
+ NOT_REGEX = ['NUMBER', 'REGEX', 'BOOL', 'NULL', 'UNDEFINED', '++', '--'];
+
+ NOT_SPACED_REGEX = NOT_REGEX.concat(')', '}', 'THIS', 'IDENTIFIER', 'STRING', ']');
+
+ CALLABLE = ['IDENTIFIER', 'STRING', 'REGEX', ')', ']', '}', '?', '::', '@', 'THIS', 'SUPER'];
+
+ INDEXABLE = CALLABLE.concat('NUMBER', 'BOOL', 'NULL', 'UNDEFINED');
+
+ LINE_BREAK = ['INDENT', 'OUTDENT', 'TERMINATOR'];
+
+ INDENTABLE_CLOSERS = [')', '}', ']'];
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/nodes.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/nodes.js
new file mode 100644
index 000000000..52c99a9f8
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/nodes.js
@@ -0,0 +1,3156 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var Access, Arr, Assign, Base, Block, Call, Class, Code, CodeFragment, Comment, Existence, Expansion, Extends, For, HEXNUM, IDENTIFIER, IDENTIFIER_STR, IS_REGEX, IS_STRING, If, In, Index, LEVEL_ACCESS, LEVEL_COND, LEVEL_LIST, LEVEL_OP, LEVEL_PAREN, LEVEL_TOP, Literal, METHOD_DEF, NEGATE, NO, NUMBER, Obj, Op, Param, Parens, RESERVED, Range, Return, SIMPLENUM, STRICT_PROSCRIBED, Scope, Slice, Splat, Switch, TAB, THIS, Throw, Try, UTILITIES, Value, While, YES, addLocationDataFn, compact, del, ends, extend, flatten, fragmentsToText, isLiteralArguments, isLiteralThis, last, locationDataToString, merge, multident, parseNum, some, starts, throwSyntaxError, unfoldSoak, utility, _ref, _ref1,
+ __hasProp = {}.hasOwnProperty,
+ __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; },
+ __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; },
+ __slice = [].slice;
+
+ Error.stackTraceLimit = Infinity;
+
+ Scope = require('./scope').Scope;
+
+ _ref = require('./lexer'), RESERVED = _ref.RESERVED, STRICT_PROSCRIBED = _ref.STRICT_PROSCRIBED;
+
+ _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, addLocationDataFn = _ref1.addLocationDataFn, locationDataToString = _ref1.locationDataToString, throwSyntaxError = _ref1.throwSyntaxError;
+
+ exports.extend = extend;
+
+ exports.addLocationDataFn = addLocationDataFn;
+
+ YES = function() {
+ return true;
+ };
+
+ NO = function() {
+ return false;
+ };
+
+ THIS = function() {
+ return this;
+ };
+
+ NEGATE = function() {
+ this.negated = !this.negated;
+ return this;
+ };
+
+ exports.CodeFragment = CodeFragment = (function() {
+ function CodeFragment(parent, code) {
+ var _ref2;
+ this.code = "" + code;
+ this.locationData = parent != null ? parent.locationData : void 0;
+ this.type = (parent != null ? (_ref2 = parent.constructor) != null ? _ref2.name : void 0 : void 0) || 'unknown';
+ }
+
+ CodeFragment.prototype.toString = function() {
+ return "" + this.code + (this.locationData ? ": " + locationDataToString(this.locationData) : '');
+ };
+
+ return CodeFragment;
+
+ })();
+
+ fragmentsToText = function(fragments) {
+ var fragment;
+ return ((function() {
+ var _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = fragments.length; _i < _len; _i++) {
+ fragment = fragments[_i];
+ _results.push(fragment.code);
+ }
+ return _results;
+ })()).join('');
+ };
+
+ exports.Base = Base = (function() {
+ function Base() {}
+
+ Base.prototype.compile = function(o, lvl) {
+ return fragmentsToText(this.compileToFragments(o, lvl));
+ };
+
+ Base.prototype.compileToFragments = function(o, lvl) {
+ var node;
+ o = extend({}, o);
+ if (lvl) {
+ o.level = lvl;
+ }
+ node = this.unfoldSoak(o) || this;
+ node.tab = o.indent;
+ if (o.level === LEVEL_TOP || !node.isStatement(o)) {
+ return node.compileNode(o);
+ } else {
+ return node.compileClosure(o);
+ }
+ };
+
+ Base.prototype.compileClosure = function(o) {
+ var args, argumentsNode, func, jumpNode, meth;
+ if (jumpNode = this.jumps()) {
+ jumpNode.error('cannot use a pure statement in an expression');
+ }
+ o.sharedScope = true;
+ func = new Code([], Block.wrap([this]));
+ args = [];
+ if ((argumentsNode = this.contains(isLiteralArguments)) || this.contains(isLiteralThis)) {
+ args = [new Literal('this')];
+ if (argumentsNode) {
+ meth = 'apply';
+ args.push(new Literal('arguments'));
+ } else {
+ meth = 'call';
+ }
+ func = new Value(func, [new Access(new Literal(meth))]);
+ }
+ return (new Call(func, args)).compileNode(o);
+ };
+
+ Base.prototype.cache = function(o, level, reused) {
+ var ref, sub;
+ if (!this.isComplex()) {
+ ref = level ? this.compileToFragments(o, level) : this;
+ return [ref, ref];
+ } else {
+ ref = new Literal(reused || o.scope.freeVariable('ref'));
+ sub = new Assign(ref, this);
+ if (level) {
+ return [sub.compileToFragments(o, level), [this.makeCode(ref.value)]];
+ } else {
+ return [sub, ref];
+ }
+ }
+ };
+
+ Base.prototype.cacheToCodeFragments = function(cacheValues) {
+ return [fragmentsToText(cacheValues[0]), fragmentsToText(cacheValues[1])];
+ };
+
+ Base.prototype.makeReturn = function(res) {
+ var me;
+ me = this.unwrapAll();
+ if (res) {
+ return new Call(new Literal("" + res + ".push"), [me]);
+ } else {
+ return new Return(me);
+ }
+ };
+
+ Base.prototype.contains = function(pred) {
+ var node;
+ node = void 0;
+ this.traverseChildren(false, function(n) {
+ if (pred(n)) {
+ node = n;
+ return false;
+ }
+ });
+ return node;
+ };
+
+ Base.prototype.lastNonComment = function(list) {
+ var i;
+ i = list.length;
+ while (i--) {
+ if (!(list[i] instanceof Comment)) {
+ return list[i];
+ }
+ }
+ return null;
+ };
+
+ Base.prototype.toString = function(idt, name) {
+ var tree;
+ if (idt == null) {
+ idt = '';
+ }
+ if (name == null) {
+ name = this.constructor.name;
+ }
+ tree = '\n' + idt + name;
+ if (this.soak) {
+ tree += '?';
+ }
+ this.eachChild(function(node) {
+ return tree += node.toString(idt + TAB);
+ });
+ return tree;
+ };
+
+ Base.prototype.eachChild = function(func) {
+ var attr, child, _i, _j, _len, _len1, _ref2, _ref3;
+ if (!this.children) {
+ return this;
+ }
+ _ref2 = this.children;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ attr = _ref2[_i];
+ if (this[attr]) {
+ _ref3 = flatten([this[attr]]);
+ for (_j = 0, _len1 = _ref3.length; _j < _len1; _j++) {
+ child = _ref3[_j];
+ if (func(child) === false) {
+ return this;
+ }
+ }
+ }
+ }
+ return this;
+ };
+
+ Base.prototype.traverseChildren = function(crossScope, func) {
+ return this.eachChild(function(child) {
+ var recur;
+ recur = func(child);
+ if (recur !== false) {
+ return child.traverseChildren(crossScope, func);
+ }
+ });
+ };
+
+ Base.prototype.invert = function() {
+ return new Op('!', this);
+ };
+
+ Base.prototype.unwrapAll = function() {
+ var node;
+ node = this;
+ while (node !== (node = node.unwrap())) {
+ continue;
+ }
+ return node;
+ };
+
+ Base.prototype.children = [];
+
+ Base.prototype.isStatement = NO;
+
+ Base.prototype.jumps = NO;
+
+ Base.prototype.isComplex = YES;
+
+ Base.prototype.isChainable = NO;
+
+ Base.prototype.isAssignable = NO;
+
+ Base.prototype.unwrap = THIS;
+
+ Base.prototype.unfoldSoak = NO;
+
+ Base.prototype.assigns = NO;
+
+ Base.prototype.updateLocationDataIfMissing = function(locationData) {
+ if (this.locationData) {
+ return this;
+ }
+ this.locationData = locationData;
+ return this.eachChild(function(child) {
+ return child.updateLocationDataIfMissing(locationData);
+ });
+ };
+
+ Base.prototype.error = function(message) {
+ return throwSyntaxError(message, this.locationData);
+ };
+
+ Base.prototype.makeCode = function(code) {
+ return new CodeFragment(this, code);
+ };
+
+ Base.prototype.wrapInBraces = function(fragments) {
+ return [].concat(this.makeCode('('), fragments, this.makeCode(')'));
+ };
+
+ Base.prototype.joinFragmentArrays = function(fragmentsList, joinStr) {
+ var answer, fragments, i, _i, _len;
+ answer = [];
+ for (i = _i = 0, _len = fragmentsList.length; _i < _len; i = ++_i) {
+ fragments = fragmentsList[i];
+ if (i) {
+ answer.push(this.makeCode(joinStr));
+ }
+ answer = answer.concat(fragments);
+ }
+ return answer;
+ };
+
+ return Base;
+
+ })();
+
+ exports.Block = Block = (function(_super) {
+ __extends(Block, _super);
+
+ function Block(nodes) {
+ this.expressions = compact(flatten(nodes || []));
+ }
+
+ Block.prototype.children = ['expressions'];
+
+ Block.prototype.push = function(node) {
+ this.expressions.push(node);
+ return this;
+ };
+
+ Block.prototype.pop = function() {
+ return this.expressions.pop();
+ };
+
+ Block.prototype.unshift = function(node) {
+ this.expressions.unshift(node);
+ return this;
+ };
+
+ Block.prototype.unwrap = function() {
+ if (this.expressions.length === 1) {
+ return this.expressions[0];
+ } else {
+ return this;
+ }
+ };
+
+ Block.prototype.isEmpty = function() {
+ return !this.expressions.length;
+ };
+
+ Block.prototype.isStatement = function(o) {
+ var exp, _i, _len, _ref2;
+ _ref2 = this.expressions;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ exp = _ref2[_i];
+ if (exp.isStatement(o)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ Block.prototype.jumps = function(o) {
+ var exp, jumpNode, _i, _len, _ref2;
+ _ref2 = this.expressions;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ exp = _ref2[_i];
+ if (jumpNode = exp.jumps(o)) {
+ return jumpNode;
+ }
+ }
+ };
+
+ Block.prototype.makeReturn = function(res) {
+ var expr, len;
+ len = this.expressions.length;
+ while (len--) {
+ expr = this.expressions[len];
+ if (!(expr instanceof Comment)) {
+ this.expressions[len] = expr.makeReturn(res);
+ if (expr instanceof Return && !expr.expression) {
+ this.expressions.splice(len, 1);
+ }
+ break;
+ }
+ }
+ return this;
+ };
+
+ Block.prototype.compileToFragments = function(o, level) {
+ if (o == null) {
+ o = {};
+ }
+ if (o.scope) {
+ return Block.__super__.compileToFragments.call(this, o, level);
+ } else {
+ return this.compileRoot(o);
+ }
+ };
+
+ Block.prototype.compileNode = function(o) {
+ var answer, compiledNodes, fragments, index, node, top, _i, _len, _ref2;
+ this.tab = o.indent;
+ top = o.level === LEVEL_TOP;
+ compiledNodes = [];
+ _ref2 = this.expressions;
+ for (index = _i = 0, _len = _ref2.length; _i < _len; index = ++_i) {
+ node = _ref2[index];
+ node = node.unwrapAll();
+ node = node.unfoldSoak(o) || node;
+ if (node instanceof Block) {
+ compiledNodes.push(node.compileNode(o));
+ } else if (top) {
+ node.front = true;
+ fragments = node.compileToFragments(o);
+ if (!node.isStatement(o)) {
+ fragments.unshift(this.makeCode("" + this.tab));
+ fragments.push(this.makeCode(";"));
+ }
+ compiledNodes.push(fragments);
+ } else {
+ compiledNodes.push(node.compileToFragments(o, LEVEL_LIST));
+ }
+ }
+ if (top) {
+ if (this.spaced) {
+ return [].concat(this.joinFragmentArrays(compiledNodes, '\n\n'), this.makeCode("\n"));
+ } else {
+ return this.joinFragmentArrays(compiledNodes, '\n');
+ }
+ }
+ if (compiledNodes.length) {
+ answer = this.joinFragmentArrays(compiledNodes, ', ');
+ } else {
+ answer = [this.makeCode("void 0")];
+ }
+ if (compiledNodes.length > 1 && o.level >= LEVEL_LIST) {
+ return this.wrapInBraces(answer);
+ } else {
+ return answer;
+ }
+ };
+
+ Block.prototype.compileRoot = function(o) {
+ var exp, fragments, i, name, prelude, preludeExps, rest, _i, _len, _ref2;
+ o.indent = o.bare ? '' : TAB;
+ o.level = LEVEL_TOP;
+ this.spaced = true;
+ o.scope = new Scope(null, this, null);
+ _ref2 = o.locals || [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ name = _ref2[_i];
+ o.scope.parameter(name);
+ }
+ prelude = [];
+ if (!o.bare) {
+ preludeExps = (function() {
+ var _j, _len1, _ref3, _results;
+ _ref3 = this.expressions;
+ _results = [];
+ for (i = _j = 0, _len1 = _ref3.length; _j < _len1; i = ++_j) {
+ exp = _ref3[i];
+ if (!(exp.unwrap() instanceof Comment)) {
+ break;
+ }
+ _results.push(exp);
+ }
+ return _results;
+ }).call(this);
+ rest = this.expressions.slice(preludeExps.length);
+ this.expressions = preludeExps;
+ if (preludeExps.length) {
+ prelude = this.compileNode(merge(o, {
+ indent: ''
+ }));
+ prelude.push(this.makeCode("\n"));
+ }
+ this.expressions = rest;
+ }
+ fragments = this.compileWithDeclarations(o);
+ if (o.bare) {
+ return fragments;
+ }
+ return [].concat(prelude, this.makeCode("(function() {\n"), fragments, this.makeCode("\n}).call(this);\n"));
+ };
+
+ Block.prototype.compileWithDeclarations = function(o) {
+ var assigns, declars, exp, fragments, i, post, rest, scope, spaced, _i, _len, _ref2, _ref3, _ref4;
+ fragments = [];
+ post = [];
+ _ref2 = this.expressions;
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
+ exp = _ref2[i];
+ exp = exp.unwrap();
+ if (!(exp instanceof Comment || exp instanceof Literal)) {
+ break;
+ }
+ }
+ o = merge(o, {
+ level: LEVEL_TOP
+ });
+ if (i) {
+ rest = this.expressions.splice(i, 9e9);
+ _ref3 = [this.spaced, false], spaced = _ref3[0], this.spaced = _ref3[1];
+ _ref4 = [this.compileNode(o), spaced], fragments = _ref4[0], this.spaced = _ref4[1];
+ this.expressions = rest;
+ }
+ post = this.compileNode(o);
+ scope = o.scope;
+ if (scope.expressions === this) {
+ declars = o.scope.hasDeclarations();
+ assigns = scope.hasAssignments;
+ if (declars || assigns) {
+ if (i) {
+ fragments.push(this.makeCode('\n'));
+ }
+ fragments.push(this.makeCode("" + this.tab + "var "));
+ if (declars) {
+ fragments.push(this.makeCode(scope.declaredVariables().join(', ')));
+ }
+ if (assigns) {
+ if (declars) {
+ fragments.push(this.makeCode(",\n" + (this.tab + TAB)));
+ }
+ fragments.push(this.makeCode(scope.assignedVariables().join(",\n" + (this.tab + TAB))));
+ }
+ fragments.push(this.makeCode(";\n" + (this.spaced ? '\n' : '')));
+ } else if (fragments.length && post.length) {
+ fragments.push(this.makeCode("\n"));
+ }
+ }
+ return fragments.concat(post);
+ };
+
+ Block.wrap = function(nodes) {
+ if (nodes.length === 1 && nodes[0] instanceof Block) {
+ return nodes[0];
+ }
+ return new Block(nodes);
+ };
+
+ return Block;
+
+ })(Base);
+
+ exports.Literal = Literal = (function(_super) {
+ __extends(Literal, _super);
+
+ function Literal(value) {
+ this.value = value;
+ }
+
+ Literal.prototype.makeReturn = function() {
+ if (this.isStatement()) {
+ return this;
+ } else {
+ return Literal.__super__.makeReturn.apply(this, arguments);
+ }
+ };
+
+ Literal.prototype.isAssignable = function() {
+ return IDENTIFIER.test(this.value);
+ };
+
+ Literal.prototype.isStatement = function() {
+ var _ref2;
+ return (_ref2 = this.value) === 'break' || _ref2 === 'continue' || _ref2 === 'debugger';
+ };
+
+ Literal.prototype.isComplex = NO;
+
+ Literal.prototype.assigns = function(name) {
+ return name === this.value;
+ };
+
+ Literal.prototype.jumps = function(o) {
+ if (this.value === 'break' && !((o != null ? o.loop : void 0) || (o != null ? o.block : void 0))) {
+ return this;
+ }
+ if (this.value === 'continue' && !(o != null ? o.loop : void 0)) {
+ return this;
+ }
+ };
+
+ Literal.prototype.compileNode = function(o) {
+ var answer, code, _ref2;
+ 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;
+ answer = this.isStatement() ? "" + this.tab + code + ";" : code;
+ return [this.makeCode(answer)];
+ };
+
+ Literal.prototype.toString = function() {
+ return ' "' + this.value + '"';
+ };
+
+ return Literal;
+
+ })(Base);
+
+ exports.Undefined = (function(_super) {
+ __extends(Undefined, _super);
+
+ function Undefined() {
+ return Undefined.__super__.constructor.apply(this, arguments);
+ }
+
+ Undefined.prototype.isAssignable = NO;
+
+ Undefined.prototype.isComplex = NO;
+
+ Undefined.prototype.compileNode = function(o) {
+ return [this.makeCode(o.level >= LEVEL_ACCESS ? '(void 0)' : 'void 0')];
+ };
+
+ return Undefined;
+
+ })(Base);
+
+ exports.Null = (function(_super) {
+ __extends(Null, _super);
+
+ function Null() {
+ return Null.__super__.constructor.apply(this, arguments);
+ }
+
+ Null.prototype.isAssignable = NO;
+
+ Null.prototype.isComplex = NO;
+
+ Null.prototype.compileNode = function() {
+ return [this.makeCode("null")];
+ };
+
+ return Null;
+
+ })(Base);
+
+ exports.Bool = (function(_super) {
+ __extends(Bool, _super);
+
+ Bool.prototype.isAssignable = NO;
+
+ Bool.prototype.isComplex = NO;
+
+ Bool.prototype.compileNode = function() {
+ return [this.makeCode(this.val)];
+ };
+
+ function Bool(val) {
+ this.val = val;
+ }
+
+ return Bool;
+
+ })(Base);
+
+ exports.Return = Return = (function(_super) {
+ __extends(Return, _super);
+
+ function Return(expression) {
+ this.expression = expression;
+ }
+
+ Return.prototype.children = ['expression'];
+
+ Return.prototype.isStatement = YES;
+
+ Return.prototype.makeReturn = THIS;
+
+ Return.prototype.jumps = THIS;
+
+ Return.prototype.compileToFragments = function(o, level) {
+ var expr, _ref2;
+ expr = (_ref2 = this.expression) != null ? _ref2.makeReturn() : void 0;
+ if (expr && !(expr instanceof Return)) {
+ return expr.compileToFragments(o, level);
+ } else {
+ return Return.__super__.compileToFragments.call(this, o, level);
+ }
+ };
+
+ Return.prototype.compileNode = function(o) {
+ var answer;
+ answer = [];
+ answer.push(this.makeCode(this.tab + ("return" + (this.expression ? " " : ""))));
+ if (this.expression) {
+ answer = answer.concat(this.expression.compileToFragments(o, LEVEL_PAREN));
+ }
+ answer.push(this.makeCode(";"));
+ return answer;
+ };
+
+ return Return;
+
+ })(Base);
+
+ exports.Value = Value = (function(_super) {
+ __extends(Value, _super);
+
+ function Value(base, props, tag) {
+ if (!props && base instanceof Value) {
+ return base;
+ }
+ this.base = base;
+ this.properties = props || [];
+ if (tag) {
+ this[tag] = true;
+ }
+ return this;
+ }
+
+ Value.prototype.children = ['base', 'properties'];
+
+ Value.prototype.add = function(props) {
+ this.properties = this.properties.concat(props);
+ return this;
+ };
+
+ Value.prototype.hasProperties = function() {
+ return !!this.properties.length;
+ };
+
+ Value.prototype.bareLiteral = function(type) {
+ return !this.properties.length && this.base instanceof type;
+ };
+
+ Value.prototype.isArray = function() {
+ return this.bareLiteral(Arr);
+ };
+
+ Value.prototype.isRange = function() {
+ return this.bareLiteral(Range);
+ };
+
+ Value.prototype.isComplex = function() {
+ return this.hasProperties() || this.base.isComplex();
+ };
+
+ Value.prototype.isAssignable = function() {
+ return this.hasProperties() || this.base.isAssignable();
+ };
+
+ Value.prototype.isSimpleNumber = function() {
+ return this.bareLiteral(Literal) && SIMPLENUM.test(this.base.value);
+ };
+
+ Value.prototype.isString = function() {
+ return this.bareLiteral(Literal) && IS_STRING.test(this.base.value);
+ };
+
+ Value.prototype.isRegex = function() {
+ return this.bareLiteral(Literal) && IS_REGEX.test(this.base.value);
+ };
+
+ Value.prototype.isAtomic = function() {
+ var node, _i, _len, _ref2;
+ _ref2 = this.properties.concat(this.base);
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ node = _ref2[_i];
+ if (node.soak || node instanceof Call) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ Value.prototype.isNotCallable = function() {
+ return this.isSimpleNumber() || this.isString() || this.isRegex() || this.isArray() || this.isRange() || this.isSplice() || this.isObject();
+ };
+
+ Value.prototype.isStatement = function(o) {
+ return !this.properties.length && this.base.isStatement(o);
+ };
+
+ Value.prototype.assigns = function(name) {
+ return !this.properties.length && this.base.assigns(name);
+ };
+
+ Value.prototype.jumps = function(o) {
+ return !this.properties.length && this.base.jumps(o);
+ };
+
+ Value.prototype.isObject = function(onlyGenerated) {
+ if (this.properties.length) {
+ return false;
+ }
+ return (this.base instanceof Obj) && (!onlyGenerated || this.base.generated);
+ };
+
+ Value.prototype.isSplice = function() {
+ return last(this.properties) instanceof Slice;
+ };
+
+ Value.prototype.looksStatic = function(className) {
+ var _ref2;
+ return this.base.value === className && this.properties.length && ((_ref2 = this.properties[0].name) != null ? _ref2.value : void 0) !== 'prototype';
+ };
+
+ Value.prototype.unwrap = function() {
+ if (this.properties.length) {
+ return this;
+ } else {
+ return this.base;
+ }
+ };
+
+ Value.prototype.cacheReference = function(o) {
+ var base, bref, name, nref;
+ name = last(this.properties);
+ if (this.properties.length < 2 && !this.base.isComplex() && !(name != null ? name.isComplex() : void 0)) {
+ return [this, this];
+ }
+ base = new Value(this.base, this.properties.slice(0, -1));
+ if (base.isComplex()) {
+ bref = new Literal(o.scope.freeVariable('base'));
+ base = new Value(new Parens(new Assign(bref, base)));
+ }
+ if (!name) {
+ return [base, bref];
+ }
+ if (name.isComplex()) {
+ nref = new Literal(o.scope.freeVariable('name'));
+ name = new Index(new Assign(nref, name.index));
+ nref = new Index(nref);
+ }
+ return [base.add(name), new Value(bref || base.base, [nref || name])];
+ };
+
+ Value.prototype.compileNode = function(o) {
+ var fragments, prop, props, _i, _len;
+ this.base.front = this.front;
+ props = this.properties;
+ fragments = this.base.compileToFragments(o, (props.length ? LEVEL_ACCESS : null));
+ if ((this.base instanceof Parens || props.length) && SIMPLENUM.test(fragmentsToText(fragments))) {
+ fragments.push(this.makeCode('.'));
+ }
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
+ prop = props[_i];
+ fragments.push.apply(fragments, prop.compileToFragments(o));
+ }
+ return fragments;
+ };
+
+ Value.prototype.unfoldSoak = function(o) {
+ return this.unfoldedSoak != null ? this.unfoldedSoak : this.unfoldedSoak = (function(_this) {
+ return function() {
+ var fst, i, ifn, prop, ref, snd, _i, _len, _ref2, _ref3;
+ if (ifn = _this.base.unfoldSoak(o)) {
+ (_ref2 = ifn.body.properties).push.apply(_ref2, _this.properties);
+ return ifn;
+ }
+ _ref3 = _this.properties;
+ for (i = _i = 0, _len = _ref3.length; _i < _len; i = ++_i) {
+ prop = _ref3[i];
+ if (!prop.soak) {
+ continue;
+ }
+ prop.soak = false;
+ fst = new Value(_this.base, _this.properties.slice(0, i));
+ snd = new Value(_this.base, _this.properties.slice(i));
+ if (fst.isComplex()) {
+ ref = new Literal(o.scope.freeVariable('ref'));
+ fst = new Parens(new Assign(ref, fst));
+ snd.base = ref;
+ }
+ return new If(new Existence(fst), snd, {
+ soak: true
+ });
+ }
+ return false;
+ };
+ })(this)();
+ };
+
+ return Value;
+
+ })(Base);
+
+ exports.Comment = Comment = (function(_super) {
+ __extends(Comment, _super);
+
+ function Comment(comment) {
+ this.comment = comment;
+ }
+
+ Comment.prototype.isStatement = YES;
+
+ Comment.prototype.makeReturn = THIS;
+
+ Comment.prototype.compileNode = function(o, level) {
+ var code, comment;
+ comment = this.comment.replace(/^(\s*)#/gm, "$1 *");
+ code = "/*" + (multident(comment, this.tab)) + (__indexOf.call(comment, '\n') >= 0 ? "\n" + this.tab : '') + " */";
+ if ((level || o.level) === LEVEL_TOP) {
+ code = o.indent + code;
+ }
+ return [this.makeCode("\n"), this.makeCode(code)];
+ };
+
+ return Comment;
+
+ })(Base);
+
+ exports.Call = Call = (function(_super) {
+ __extends(Call, _super);
+
+ function Call(variable, args, soak) {
+ this.args = args != null ? args : [];
+ this.soak = soak;
+ this.isNew = false;
+ this.isSuper = variable === 'super';
+ this.variable = this.isSuper ? null : variable;
+ if (variable instanceof Value && variable.isNotCallable()) {
+ variable.error("literal is not a function");
+ }
+ }
+
+ Call.prototype.children = ['variable', 'args'];
+
+ Call.prototype.newInstance = function() {
+ var base, _ref2;
+ base = ((_ref2 = this.variable) != null ? _ref2.base : void 0) || this.variable;
+ if (base instanceof Call && !base.isNew) {
+ base.newInstance();
+ } else {
+ this.isNew = true;
+ }
+ return this;
+ };
+
+ Call.prototype.superReference = function(o) {
+ var accesses, method;
+ method = o.scope.namedMethod();
+ if (method != null ? method.klass : void 0) {
+ accesses = [new Access(new Literal('__super__'))];
+ if (method["static"]) {
+ accesses.push(new Access(new Literal('constructor')));
+ }
+ accesses.push(new Access(new Literal(method.name)));
+ return (new Value(new Literal(method.klass), accesses)).compile(o);
+ } else if (method != null ? method.ctor : void 0) {
+ return "" + method.name + ".__super__.constructor";
+ } else {
+ return this.error('cannot call super outside of an instance method.');
+ }
+ };
+
+ Call.prototype.superThis = function(o) {
+ var method;
+ method = o.scope.method;
+ return (method && !method.klass && method.context) || "this";
+ };
+
+ Call.prototype.unfoldSoak = function(o) {
+ var call, ifn, left, list, rite, _i, _len, _ref2, _ref3;
+ if (this.soak) {
+ if (this.variable) {
+ if (ifn = unfoldSoak(o, this, 'variable')) {
+ return ifn;
+ }
+ _ref2 = new Value(this.variable).cacheReference(o), left = _ref2[0], rite = _ref2[1];
+ } else {
+ left = new Literal(this.superReference(o));
+ rite = new Value(left);
+ }
+ rite = new Call(rite, this.args);
+ rite.isNew = this.isNew;
+ left = new Literal("typeof " + (left.compile(o)) + " === \"function\"");
+ return new If(left, new Value(rite), {
+ soak: true
+ });
+ }
+ call = this;
+ list = [];
+ while (true) {
+ if (call.variable instanceof Call) {
+ list.push(call);
+ call = call.variable;
+ continue;
+ }
+ if (!(call.variable instanceof Value)) {
+ break;
+ }
+ list.push(call);
+ if (!((call = call.variable.base) instanceof Call)) {
+ break;
+ }
+ }
+ _ref3 = list.reverse();
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ call = _ref3[_i];
+ if (ifn) {
+ if (call.variable instanceof Call) {
+ call.variable = ifn;
+ } else {
+ call.variable.base = ifn;
+ }
+ }
+ ifn = unfoldSoak(o, call, 'variable');
+ }
+ return ifn;
+ };
+
+ Call.prototype.compileNode = function(o) {
+ var arg, argIndex, compiledArgs, compiledArray, fragments, preface, _i, _len, _ref2, _ref3;
+ if ((_ref2 = this.variable) != null) {
+ _ref2.front = this.front;
+ }
+ compiledArray = Splat.compileSplattedArray(o, this.args, true);
+ if (compiledArray.length) {
+ return this.compileSplat(o, compiledArray);
+ }
+ compiledArgs = [];
+ _ref3 = this.args;
+ for (argIndex = _i = 0, _len = _ref3.length; _i < _len; argIndex = ++_i) {
+ arg = _ref3[argIndex];
+ if (argIndex) {
+ compiledArgs.push(this.makeCode(", "));
+ }
+ compiledArgs.push.apply(compiledArgs, arg.compileToFragments(o, LEVEL_LIST));
+ }
+ fragments = [];
+ if (this.isSuper) {
+ preface = this.superReference(o) + (".call(" + (this.superThis(o)));
+ if (compiledArgs.length) {
+ preface += ", ";
+ }
+ fragments.push(this.makeCode(preface));
+ } else {
+ if (this.isNew) {
+ fragments.push(this.makeCode('new '));
+ }
+ fragments.push.apply(fragments, this.variable.compileToFragments(o, LEVEL_ACCESS));
+ fragments.push(this.makeCode("("));
+ }
+ fragments.push.apply(fragments, compiledArgs);
+ fragments.push(this.makeCode(")"));
+ return fragments;
+ };
+
+ Call.prototype.compileSplat = function(o, splatArgs) {
+ var answer, base, fun, idt, name, ref;
+ if (this.isSuper) {
+ return [].concat(this.makeCode("" + (this.superReference(o)) + ".apply(" + (this.superThis(o)) + ", "), splatArgs, this.makeCode(")"));
+ }
+ if (this.isNew) {
+ idt = this.tab + TAB;
+ return [].concat(this.makeCode("(function(func, args, ctor) {\n" + idt + "ctor.prototype = func.prototype;\n" + idt + "var child = new ctor, result = func.apply(child, args);\n" + idt + "return Object(result) === result ? result : child;\n" + this.tab + "})("), this.variable.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), splatArgs, this.makeCode(", function(){})"));
+ }
+ answer = [];
+ base = new Value(this.variable);
+ if ((name = base.properties.pop()) && base.isComplex()) {
+ ref = o.scope.freeVariable('ref');
+ answer = answer.concat(this.makeCode("(" + ref + " = "), base.compileToFragments(o, LEVEL_LIST), this.makeCode(")"), name.compileToFragments(o));
+ } else {
+ fun = base.compileToFragments(o, LEVEL_ACCESS);
+ if (SIMPLENUM.test(fragmentsToText(fun))) {
+ fun = this.wrapInBraces(fun);
+ }
+ if (name) {
+ ref = fragmentsToText(fun);
+ fun.push.apply(fun, name.compileToFragments(o));
+ } else {
+ ref = 'null';
+ }
+ answer = answer.concat(fun);
+ }
+ return answer = answer.concat(this.makeCode(".apply(" + ref + ", "), splatArgs, this.makeCode(")"));
+ };
+
+ return Call;
+
+ })(Base);
+
+ exports.Extends = Extends = (function(_super) {
+ __extends(Extends, _super);
+
+ function Extends(child, parent) {
+ this.child = child;
+ this.parent = parent;
+ }
+
+ Extends.prototype.children = ['child', 'parent'];
+
+ Extends.prototype.compileToFragments = function(o) {
+ return new Call(new Value(new Literal(utility('extends'))), [this.child, this.parent]).compileToFragments(o);
+ };
+
+ return Extends;
+
+ })(Base);
+
+ exports.Access = Access = (function(_super) {
+ __extends(Access, _super);
+
+ function Access(name, tag) {
+ this.name = name;
+ this.name.asKey = true;
+ this.soak = tag === 'soak';
+ }
+
+ Access.prototype.children = ['name'];
+
+ Access.prototype.compileToFragments = function(o) {
+ var name;
+ name = this.name.compileToFragments(o);
+ if (IDENTIFIER.test(fragmentsToText(name))) {
+ name.unshift(this.makeCode("."));
+ } else {
+ name.unshift(this.makeCode("["));
+ name.push(this.makeCode("]"));
+ }
+ return name;
+ };
+
+ Access.prototype.isComplex = NO;
+
+ return Access;
+
+ })(Base);
+
+ exports.Index = Index = (function(_super) {
+ __extends(Index, _super);
+
+ function Index(index) {
+ this.index = index;
+ }
+
+ Index.prototype.children = ['index'];
+
+ Index.prototype.compileToFragments = function(o) {
+ return [].concat(this.makeCode("["), this.index.compileToFragments(o, LEVEL_PAREN), this.makeCode("]"));
+ };
+
+ Index.prototype.isComplex = function() {
+ return this.index.isComplex();
+ };
+
+ return Index;
+
+ })(Base);
+
+ exports.Range = Range = (function(_super) {
+ __extends(Range, _super);
+
+ Range.prototype.children = ['from', 'to'];
+
+ function Range(from, to, tag) {
+ this.from = from;
+ this.to = to;
+ this.exclusive = tag === 'exclusive';
+ this.equals = this.exclusive ? '' : '=';
+ }
+
+ Range.prototype.compileVariables = function(o) {
+ var step, _ref2, _ref3, _ref4, _ref5;
+ o = merge(o, {
+ top: true
+ });
+ _ref2 = this.cacheToCodeFragments(this.from.cache(o, LEVEL_LIST)), this.fromC = _ref2[0], this.fromVar = _ref2[1];
+ _ref3 = this.cacheToCodeFragments(this.to.cache(o, LEVEL_LIST)), this.toC = _ref3[0], this.toVar = _ref3[1];
+ if (step = del(o, 'step')) {
+ _ref4 = this.cacheToCodeFragments(step.cache(o, LEVEL_LIST)), this.step = _ref4[0], this.stepVar = _ref4[1];
+ }
+ _ref5 = [this.fromVar.match(NUMBER), this.toVar.match(NUMBER)], this.fromNum = _ref5[0], this.toNum = _ref5[1];
+ if (this.stepVar) {
+ return this.stepNum = this.stepVar.match(NUMBER);
+ }
+ };
+
+ Range.prototype.compileNode = function(o) {
+ var cond, condPart, from, gt, idx, idxName, known, lt, namedIndex, stepPart, to, varPart, _ref2, _ref3;
+ if (!this.fromVar) {
+ this.compileVariables(o);
+ }
+ if (!o.index) {
+ return this.compileArray(o);
+ }
+ known = this.fromNum && this.toNum;
+ idx = del(o, 'index');
+ idxName = del(o, 'name');
+ namedIndex = idxName && idxName !== idx;
+ varPart = "" + idx + " = " + this.fromC;
+ if (this.toC !== this.toVar) {
+ varPart += ", " + this.toC;
+ }
+ if (this.step !== this.stepVar) {
+ varPart += ", " + this.step;
+ }
+ _ref2 = ["" + idx + " <" + this.equals, "" + idx + " >" + this.equals], lt = _ref2[0], gt = _ref2[1];
+ condPart = this.stepNum ? parseNum(this.stepNum[0]) > 0 ? "" + lt + " " + this.toVar : "" + gt + " " + this.toVar : known ? ((_ref3 = [parseNum(this.fromNum[0]), parseNum(this.toNum[0])], from = _ref3[0], to = _ref3[1], _ref3), from <= to ? "" + lt + " " + to : "" + gt + " " + to) : (cond = this.stepVar ? "" + this.stepVar + " > 0" : "" + this.fromVar + " <= " + this.toVar, "" + cond + " ? " + lt + " " + this.toVar + " : " + gt + " " + this.toVar);
+ stepPart = this.stepVar ? "" + idx + " += " + this.stepVar : known ? namedIndex ? from <= to ? "++" + idx : "--" + idx : from <= to ? "" + idx + "++" : "" + idx + "--" : namedIndex ? "" + cond + " ? ++" + idx + " : --" + idx : "" + cond + " ? " + idx + "++ : " + idx + "--";
+ if (namedIndex) {
+ varPart = "" + idxName + " = " + varPart;
+ }
+ if (namedIndex) {
+ stepPart = "" + idxName + " = " + stepPart;
+ }
+ return [this.makeCode("" + varPart + "; " + condPart + "; " + stepPart)];
+ };
+
+ Range.prototype.compileArray = function(o) {
+ var args, body, cond, hasArgs, i, idt, post, pre, range, result, vars, _i, _ref2, _ref3, _results;
+ if (this.fromNum && this.toNum && Math.abs(this.fromNum - this.toNum) <= 20) {
+ range = (function() {
+ _results = [];
+ for (var _i = _ref2 = +this.fromNum, _ref3 = +this.toNum; _ref2 <= _ref3 ? _i <= _ref3 : _i >= _ref3; _ref2 <= _ref3 ? _i++ : _i--){ _results.push(_i); }
+ return _results;
+ }).apply(this);
+ if (this.exclusive) {
+ range.pop();
+ }
+ return [this.makeCode("[" + (range.join(', ')) + "]")];
+ }
+ idt = this.tab + TAB;
+ i = o.scope.freeVariable('i');
+ result = o.scope.freeVariable('results');
+ pre = "\n" + idt + result + " = [];";
+ if (this.fromNum && this.toNum) {
+ o.index = i;
+ body = fragmentsToText(this.compileNode(o));
+ } else {
+ vars = ("" + i + " = " + this.fromC) + (this.toC !== this.toVar ? ", " + this.toC : '');
+ cond = "" + this.fromVar + " <= " + this.toVar;
+ body = "var " + vars + "; " + cond + " ? " + i + " <" + this.equals + " " + this.toVar + " : " + i + " >" + this.equals + " " + this.toVar + "; " + cond + " ? " + i + "++ : " + i + "--";
+ }
+ post = "{ " + result + ".push(" + i + "); }\n" + idt + "return " + result + ";\n" + o.indent;
+ hasArgs = function(node) {
+ return node != null ? node.contains(isLiteralArguments) : void 0;
+ };
+ if (hasArgs(this.from) || hasArgs(this.to)) {
+ args = ', arguments';
+ }
+ return [this.makeCode("(function() {" + pre + "\n" + idt + "for (" + body + ")" + post + "}).apply(this" + (args != null ? args : '') + ")")];
+ };
+
+ return Range;
+
+ })(Base);
+
+ exports.Slice = Slice = (function(_super) {
+ __extends(Slice, _super);
+
+ Slice.prototype.children = ['range'];
+
+ function Slice(range) {
+ this.range = range;
+ Slice.__super__.constructor.call(this);
+ }
+
+ Slice.prototype.compileNode = function(o) {
+ var compiled, compiledText, from, fromCompiled, to, toStr, _ref2;
+ _ref2 = this.range, to = _ref2.to, from = _ref2.from;
+ fromCompiled = from && from.compileToFragments(o, LEVEL_PAREN) || [this.makeCode('0')];
+ if (to) {
+ compiled = to.compileToFragments(o, LEVEL_PAREN);
+ compiledText = fragmentsToText(compiled);
+ if (!(!this.range.exclusive && +compiledText === -1)) {
+ toStr = ', ' + (this.range.exclusive ? compiledText : SIMPLENUM.test(compiledText) ? "" + (+compiledText + 1) : (compiled = to.compileToFragments(o, LEVEL_ACCESS), "+" + (fragmentsToText(compiled)) + " + 1 || 9e9"));
+ }
+ }
+ return [this.makeCode(".slice(" + (fragmentsToText(fromCompiled)) + (toStr || '') + ")")];
+ };
+
+ return Slice;
+
+ })(Base);
+
+ exports.Obj = Obj = (function(_super) {
+ __extends(Obj, _super);
+
+ function Obj(props, generated) {
+ this.generated = generated != null ? generated : false;
+ this.objects = this.properties = props || [];
+ }
+
+ Obj.prototype.children = ['properties'];
+
+ Obj.prototype.compileNode = function(o) {
+ var answer, i, idt, indent, join, lastNoncom, node, prop, props, _i, _j, _len, _len1;
+ props = this.properties;
+ if (!props.length) {
+ return [this.makeCode(this.front ? '({})' : '{}')];
+ }
+ if (this.generated) {
+ for (_i = 0, _len = props.length; _i < _len; _i++) {
+ node = props[_i];
+ if (node instanceof Value) {
+ node.error('cannot have an implicit value in an implicit object');
+ }
+ }
+ }
+ idt = o.indent += TAB;
+ lastNoncom = this.lastNonComment(this.properties);
+ answer = [];
+ for (i = _j = 0, _len1 = props.length; _j < _len1; i = ++_j) {
+ prop = props[i];
+ join = i === props.length - 1 ? '' : prop === lastNoncom || prop instanceof Comment ? '\n' : ',\n';
+ indent = prop instanceof Comment ? '' : idt;
+ if (prop instanceof Assign && prop.variable instanceof Value && prop.variable.hasProperties()) {
+ prop.variable.error('Invalid object key');
+ }
+ if (prop instanceof Value && prop["this"]) {
+ prop = new Assign(prop.properties[0].name, prop, 'object');
+ }
+ if (!(prop instanceof Comment)) {
+ if (!(prop instanceof Assign)) {
+ prop = new Assign(prop, prop, 'object');
+ }
+ (prop.variable.base || prop.variable).asKey = true;
+ }
+ if (indent) {
+ answer.push(this.makeCode(indent));
+ }
+ answer.push.apply(answer, prop.compileToFragments(o, LEVEL_TOP));
+ if (join) {
+ answer.push(this.makeCode(join));
+ }
+ }
+ answer.unshift(this.makeCode("{" + (props.length && '\n')));
+ answer.push(this.makeCode("" + (props.length && '\n' + this.tab) + "}"));
+ if (this.front) {
+ return this.wrapInBraces(answer);
+ } else {
+ return answer;
+ }
+ };
+
+ Obj.prototype.assigns = function(name) {
+ var prop, _i, _len, _ref2;
+ _ref2 = this.properties;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ prop = _ref2[_i];
+ if (prop.assigns(name)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ return Obj;
+
+ })(Base);
+
+ exports.Arr = Arr = (function(_super) {
+ __extends(Arr, _super);
+
+ function Arr(objs) {
+ this.objects = objs || [];
+ }
+
+ Arr.prototype.children = ['objects'];
+
+ Arr.prototype.compileNode = function(o) {
+ var answer, compiledObjs, fragments, index, obj, _i, _len;
+ if (!this.objects.length) {
+ return [this.makeCode('[]')];
+ }
+ o.indent += TAB;
+ answer = Splat.compileSplattedArray(o, this.objects);
+ if (answer.length) {
+ return answer;
+ }
+ answer = [];
+ compiledObjs = (function() {
+ var _i, _len, _ref2, _results;
+ _ref2 = this.objects;
+ _results = [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ _results.push(obj.compileToFragments(o, LEVEL_LIST));
+ }
+ return _results;
+ }).call(this);
+ for (index = _i = 0, _len = compiledObjs.length; _i < _len; index = ++_i) {
+ fragments = compiledObjs[index];
+ if (index) {
+ answer.push(this.makeCode(", "));
+ }
+ answer.push.apply(answer, fragments);
+ }
+ if (fragmentsToText(answer).indexOf('\n') >= 0) {
+ answer.unshift(this.makeCode("[\n" + o.indent));
+ answer.push(this.makeCode("\n" + this.tab + "]"));
+ } else {
+ answer.unshift(this.makeCode("["));
+ answer.push(this.makeCode("]"));
+ }
+ return answer;
+ };
+
+ Arr.prototype.assigns = function(name) {
+ var obj, _i, _len, _ref2;
+ _ref2 = this.objects;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ if (obj.assigns(name)) {
+ return true;
+ }
+ }
+ return false;
+ };
+
+ return Arr;
+
+ })(Base);
+
+ exports.Class = Class = (function(_super) {
+ __extends(Class, _super);
+
+ function Class(variable, parent, body) {
+ this.variable = variable;
+ this.parent = parent;
+ this.body = body != null ? body : new Block;
+ this.boundFuncs = [];
+ this.body.classBody = true;
+ }
+
+ Class.prototype.children = ['variable', 'parent', 'body'];
+
+ Class.prototype.determineName = function() {
+ var decl, tail;
+ if (!this.variable) {
+ return null;
+ }
+ decl = (tail = last(this.variable.properties)) ? tail instanceof Access && tail.name.value : this.variable.base.value;
+ if (__indexOf.call(STRICT_PROSCRIBED, decl) >= 0) {
+ this.variable.error("class variable name may not be " + decl);
+ }
+ return decl && (decl = IDENTIFIER.test(decl) && decl);
+ };
+
+ Class.prototype.setContext = function(name) {
+ return this.body.traverseChildren(false, function(node) {
+ if (node.classBody) {
+ return false;
+ }
+ if (node instanceof Literal && node.value === 'this') {
+ return node.value = name;
+ } else if (node instanceof Code) {
+ node.klass = name;
+ if (node.bound) {
+ return node.context = name;
+ }
+ }
+ });
+ };
+
+ Class.prototype.addBoundFunctions = function(o) {
+ var bvar, lhs, _i, _len, _ref2;
+ _ref2 = this.boundFuncs;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ bvar = _ref2[_i];
+ lhs = (new Value(new Literal("this"), [new Access(bvar)])).compile(o);
+ this.ctor.body.unshift(new Literal("" + lhs + " = " + (utility('bind')) + "(" + lhs + ", this)"));
+ }
+ };
+
+ Class.prototype.addProperties = function(node, name, o) {
+ var assign, base, exprs, func, props;
+ props = node.base.properties.slice(0);
+ exprs = (function() {
+ var _results;
+ _results = [];
+ while (assign = props.shift()) {
+ if (assign instanceof Assign) {
+ base = assign.variable.base;
+ delete assign.context;
+ func = assign.value;
+ if (base.value === 'constructor') {
+ if (this.ctor) {
+ assign.error('cannot define more than one constructor in a class');
+ }
+ if (func.bound) {
+ assign.error('cannot define a constructor as a bound function');
+ }
+ if (func instanceof Code) {
+ assign = this.ctor = func;
+ } else {
+ this.externalCtor = o.classScope.freeVariable('class');
+ assign = new Assign(new Literal(this.externalCtor), func);
+ }
+ } else {
+ if (assign.variable["this"]) {
+ func["static"] = true;
+ } else {
+ assign.variable = new Value(new Literal(name), [new Access(new Literal('prototype')), new Access(base)]);
+ if (func instanceof Code && func.bound) {
+ this.boundFuncs.push(base);
+ func.bound = false;
+ }
+ }
+ }
+ }
+ _results.push(assign);
+ }
+ return _results;
+ }).call(this);
+ return compact(exprs);
+ };
+
+ Class.prototype.walkBody = function(name, o) {
+ return this.traverseChildren(false, (function(_this) {
+ return function(child) {
+ var cont, exps, i, node, _i, _len, _ref2;
+ cont = true;
+ if (child instanceof Class) {
+ return false;
+ }
+ if (child instanceof Block) {
+ _ref2 = exps = child.expressions;
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
+ node = _ref2[i];
+ if (node instanceof Assign && node.variable.looksStatic(name)) {
+ node.value["static"] = true;
+ } else if (node instanceof Value && node.isObject(true)) {
+ cont = false;
+ exps[i] = _this.addProperties(node, name, o);
+ }
+ }
+ child.expressions = exps = flatten(exps);
+ }
+ return cont && !(child instanceof Class);
+ };
+ })(this));
+ };
+
+ Class.prototype.hoistDirectivePrologue = function() {
+ var expressions, index, node;
+ index = 0;
+ expressions = this.body.expressions;
+ while ((node = expressions[index]) && node instanceof Comment || node instanceof Value && node.isString()) {
+ ++index;
+ }
+ return this.directives = expressions.splice(0, index);
+ };
+
+ Class.prototype.ensureConstructor = function(name) {
+ if (!this.ctor) {
+ this.ctor = new Code;
+ if (this.externalCtor) {
+ this.ctor.body.push(new Literal("" + this.externalCtor + ".apply(this, arguments)"));
+ } else if (this.parent) {
+ this.ctor.body.push(new Literal("" + name + ".__super__.constructor.apply(this, arguments)"));
+ }
+ this.ctor.body.makeReturn();
+ this.body.expressions.unshift(this.ctor);
+ }
+ this.ctor.ctor = this.ctor.name = name;
+ this.ctor.klass = null;
+ return this.ctor.noReturn = true;
+ };
+
+ Class.prototype.compileNode = function(o) {
+ var args, argumentsNode, func, jumpNode, klass, lname, name, superClass, _ref2;
+ if (jumpNode = this.body.jumps()) {
+ jumpNode.error('Class bodies cannot contain pure statements');
+ }
+ if (argumentsNode = this.body.contains(isLiteralArguments)) {
+ argumentsNode.error("Class bodies shouldn't reference arguments");
+ }
+ name = this.determineName() || '_Class';
+ if (name.reserved) {
+ name = "_" + name;
+ }
+ lname = new Literal(name);
+ func = new Code([], Block.wrap([this.body]));
+ args = [];
+ o.classScope = func.makeScope(o.scope);
+ this.hoistDirectivePrologue();
+ this.setContext(name);
+ this.walkBody(name, o);
+ this.ensureConstructor(name);
+ this.addBoundFunctions(o);
+ this.body.spaced = true;
+ this.body.expressions.push(lname);
+ if (this.parent) {
+ superClass = new Literal(o.classScope.freeVariable('super', false));
+ this.body.expressions.unshift(new Extends(lname, superClass));
+ func.params.push(new Param(superClass));
+ args.push(this.parent);
+ }
+ (_ref2 = this.body.expressions).unshift.apply(_ref2, this.directives);
+ klass = new Parens(new Call(func, args));
+ if (this.variable) {
+ klass = new Assign(this.variable, klass);
+ }
+ return klass.compileToFragments(o);
+ };
+
+ return Class;
+
+ })(Base);
+
+ exports.Assign = Assign = (function(_super) {
+ __extends(Assign, _super);
+
+ function Assign(variable, value, context, options) {
+ var forbidden, name, _ref2;
+ this.variable = variable;
+ this.value = value;
+ this.context = context;
+ this.param = options && options.param;
+ this.subpattern = options && options.subpattern;
+ forbidden = (_ref2 = (name = this.variable.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0);
+ if (forbidden && this.context !== 'object') {
+ this.variable.error("variable name may not be \"" + name + "\"");
+ }
+ }
+
+ Assign.prototype.children = ['variable', 'value'];
+
+ Assign.prototype.isStatement = function(o) {
+ return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
+ };
+
+ Assign.prototype.assigns = function(name) {
+ return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
+ };
+
+ Assign.prototype.unfoldSoak = function(o) {
+ return unfoldSoak(o, this, 'variable');
+ };
+
+ Assign.prototype.compileNode = function(o) {
+ var answer, compiledName, isValue, match, name, val, varBase, _ref2, _ref3, _ref4, _ref5;
+ if (isValue = this.variable instanceof Value) {
+ if (this.variable.isArray() || this.variable.isObject()) {
+ return this.compilePatternMatch(o);
+ }
+ if (this.variable.isSplice()) {
+ return this.compileSplice(o);
+ }
+ if ((_ref2 = this.context) === '||=' || _ref2 === '&&=' || _ref2 === '?=') {
+ return this.compileConditional(o);
+ }
+ if ((_ref3 = this.context) === '**=' || _ref3 === '//=' || _ref3 === '%%=') {
+ return this.compileSpecialMath(o);
+ }
+ }
+ compiledName = this.variable.compileToFragments(o, LEVEL_LIST);
+ name = fragmentsToText(compiledName);
+ if (!this.context) {
+ varBase = this.variable.unwrapAll();
+ if (!varBase.isAssignable()) {
+ this.variable.error("\"" + (this.variable.compile(o)) + "\" cannot be assigned");
+ }
+ if (!(typeof varBase.hasProperties === "function" ? varBase.hasProperties() : void 0)) {
+ if (this.param) {
+ o.scope.add(name, 'var');
+ } else {
+ o.scope.find(name);
+ }
+ }
+ }
+ if (this.value instanceof Code && (match = METHOD_DEF.exec(name))) {
+ if (match[2]) {
+ this.value.klass = match[1];
+ }
+ this.value.name = (_ref4 = (_ref5 = match[3]) != null ? _ref5 : match[4]) != null ? _ref4 : match[5];
+ }
+ val = this.value.compileToFragments(o, LEVEL_LIST);
+ if (this.context === 'object') {
+ return compiledName.concat(this.makeCode(": "), val);
+ }
+ answer = compiledName.concat(this.makeCode(" " + (this.context || '=') + " "), val);
+ if (o.level <= LEVEL_LIST) {
+ return answer;
+ } else {
+ return this.wrapInBraces(answer);
+ }
+ };
+
+ Assign.prototype.compilePatternMatch = function(o) {
+ var acc, assigns, code, expandedIdx, fragments, i, idx, isObject, ivar, name, obj, objects, olen, ref, rest, top, val, value, vvar, vvarText, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ top = o.level === LEVEL_TOP;
+ value = this.value;
+ objects = this.variable.base.objects;
+ if (!(olen = objects.length)) {
+ code = value.compileToFragments(o);
+ if (o.level >= LEVEL_OP) {
+ return this.wrapInBraces(code);
+ } else {
+ return code;
+ }
+ }
+ isObject = this.variable.isObject();
+ if (top && olen === 1 && !((obj = objects[0]) instanceof Splat)) {
+ if (obj instanceof Assign) {
+ _ref2 = obj, (_ref3 = _ref2.variable, idx = _ref3.base), obj = _ref2.value;
+ } else {
+ idx = isObject ? obj["this"] ? obj.properties[0].name : obj : new Literal(0);
+ }
+ acc = IDENTIFIER.test(idx.unwrap().value || 0);
+ value = new Value(value);
+ value.properties.push(new (acc ? Access : Index)(idx));
+ if (_ref4 = obj.unwrap().value, __indexOf.call(RESERVED, _ref4) >= 0) {
+ obj.error("assignment to a reserved word: " + (obj.compile(o)));
+ }
+ return new Assign(obj, value, null, {
+ param: this.param
+ }).compileToFragments(o, LEVEL_TOP);
+ }
+ vvar = value.compileToFragments(o, LEVEL_LIST);
+ vvarText = fragmentsToText(vvar);
+ assigns = [];
+ expandedIdx = false;
+ if (!IDENTIFIER.test(vvarText) || this.variable.assigns(vvarText)) {
+ assigns.push([this.makeCode("" + (ref = o.scope.freeVariable('ref')) + " = ")].concat(__slice.call(vvar)));
+ vvar = [this.makeCode(ref)];
+ vvarText = ref;
+ }
+ for (i = _i = 0, _len = objects.length; _i < _len; i = ++_i) {
+ obj = objects[i];
+ idx = i;
+ if (isObject) {
+ if (obj instanceof Assign) {
+ _ref5 = obj, (_ref6 = _ref5.variable, idx = _ref6.base), obj = _ref5.value;
+ } else {
+ if (obj.base instanceof Parens) {
+ _ref7 = new Value(obj.unwrapAll()).cacheReference(o), obj = _ref7[0], idx = _ref7[1];
+ } else {
+ idx = obj["this"] ? obj.properties[0].name : obj;
+ }
+ }
+ }
+ if (!expandedIdx && obj instanceof Splat) {
+ name = obj.name.unwrap().value;
+ obj = obj.unwrap();
+ val = "" + olen + " <= " + vvarText + ".length ? " + (utility('slice')) + ".call(" + vvarText + ", " + i;
+ if (rest = olen - i - 1) {
+ ivar = o.scope.freeVariable('i');
+ val += ", " + ivar + " = " + vvarText + ".length - " + rest + ") : (" + ivar + " = " + i + ", [])";
+ } else {
+ val += ") : []";
+ }
+ val = new Literal(val);
+ expandedIdx = "" + ivar + "++";
+ } else if (!expandedIdx && obj instanceof Expansion) {
+ if (rest = olen - i - 1) {
+ if (rest === 1) {
+ expandedIdx = "" + vvarText + ".length - 1";
+ } else {
+ ivar = o.scope.freeVariable('i');
+ val = new Literal("" + ivar + " = " + vvarText + ".length - " + rest);
+ expandedIdx = "" + ivar + "++";
+ assigns.push(val.compileToFragments(o, LEVEL_LIST));
+ }
+ }
+ continue;
+ } else {
+ name = obj.unwrap().value;
+ if (obj instanceof Splat || obj instanceof Expansion) {
+ obj.error("multiple splats/expansions are disallowed in an assignment");
+ }
+ if (typeof idx === 'number') {
+ idx = new Literal(expandedIdx || idx);
+ acc = false;
+ } else {
+ acc = isObject && IDENTIFIER.test(idx.unwrap().value || 0);
+ }
+ val = new Value(new Literal(vvarText), [new (acc ? Access : Index)(idx)]);
+ }
+ if ((name != null) && __indexOf.call(RESERVED, name) >= 0) {
+ obj.error("assignment to a reserved word: " + (obj.compile(o)));
+ }
+ assigns.push(new Assign(obj, val, null, {
+ param: this.param,
+ subpattern: true
+ }).compileToFragments(o, LEVEL_LIST));
+ }
+ if (!(top || this.subpattern)) {
+ assigns.push(vvar);
+ }
+ fragments = this.joinFragmentArrays(assigns, ', ');
+ if (o.level < LEVEL_LIST) {
+ return fragments;
+ } else {
+ return this.wrapInBraces(fragments);
+ }
+ };
+
+ Assign.prototype.compileConditional = function(o) {
+ var fragments, left, right, _ref2;
+ _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
+ if (!left.properties.length && left.base instanceof Literal && left.base.value !== "this" && !o.scope.check(left.base.value)) {
+ this.variable.error("the variable \"" + left.base.value + "\" can't be assigned with " + this.context + " because it has not been declared before");
+ }
+ if (__indexOf.call(this.context, "?") >= 0) {
+ o.isExistentialEquals = true;
+ return new If(new Existence(left), right, {
+ type: 'if'
+ }).addElse(new Assign(right, this.value, '=')).compileToFragments(o);
+ } else {
+ fragments = new Op(this.context.slice(0, -1), left, new Assign(right, this.value, '=')).compileToFragments(o);
+ if (o.level <= LEVEL_LIST) {
+ return fragments;
+ } else {
+ return this.wrapInBraces(fragments);
+ }
+ }
+ };
+
+ Assign.prototype.compileSpecialMath = function(o) {
+ var left, right, _ref2;
+ _ref2 = this.variable.cacheReference(o), left = _ref2[0], right = _ref2[1];
+ return new Assign(left, new Op(this.context.slice(0, -1), right, this.value)).compileToFragments(o);
+ };
+
+ Assign.prototype.compileSplice = function(o) {
+ var answer, exclusive, from, fromDecl, fromRef, name, to, valDef, valRef, _ref2, _ref3, _ref4;
+ _ref2 = this.variable.properties.pop().range, from = _ref2.from, to = _ref2.to, exclusive = _ref2.exclusive;
+ name = this.variable.compile(o);
+ if (from) {
+ _ref3 = this.cacheToCodeFragments(from.cache(o, LEVEL_OP)), fromDecl = _ref3[0], fromRef = _ref3[1];
+ } else {
+ fromDecl = fromRef = '0';
+ }
+ if (to) {
+ if (from instanceof Value && from.isSimpleNumber() && to instanceof Value && to.isSimpleNumber()) {
+ to = to.compile(o) - fromRef;
+ if (!exclusive) {
+ to += 1;
+ }
+ } else {
+ to = to.compile(o, LEVEL_ACCESS) + ' - ' + fromRef;
+ if (!exclusive) {
+ to += ' + 1';
+ }
+ }
+ } else {
+ to = "9e9";
+ }
+ _ref4 = this.value.cache(o, LEVEL_LIST), valDef = _ref4[0], valRef = _ref4[1];
+ answer = [].concat(this.makeCode("[].splice.apply(" + name + ", [" + fromDecl + ", " + to + "].concat("), valDef, this.makeCode(")), "), valRef);
+ if (o.level > LEVEL_TOP) {
+ return this.wrapInBraces(answer);
+ } else {
+ return answer;
+ }
+ };
+
+ return Assign;
+
+ })(Base);
+
+ exports.Code = Code = (function(_super) {
+ __extends(Code, _super);
+
+ function Code(params, body, tag) {
+ this.params = params || [];
+ this.body = body || new Block;
+ this.bound = tag === 'boundfunc';
+ }
+
+ Code.prototype.children = ['params', 'body'];
+
+ Code.prototype.isStatement = function() {
+ return !!this.ctor;
+ };
+
+ Code.prototype.jumps = NO;
+
+ Code.prototype.makeScope = function(parentScope) {
+ return new Scope(parentScope, this.body, this);
+ };
+
+ Code.prototype.compileNode = function(o) {
+ var answer, boundfunc, code, exprs, i, lit, p, param, params, ref, splats, uniqs, val, wasEmpty, wrapper, _i, _j, _k, _l, _len, _len1, _len2, _len3, _len4, _len5, _m, _n, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7;
+ if (this.bound && ((_ref2 = o.scope.method) != null ? _ref2.bound : void 0)) {
+ this.context = o.scope.method.context;
+ }
+ if (this.bound && !this.context) {
+ this.context = '_this';
+ wrapper = new Code([new Param(new Literal(this.context))], new Block([this]));
+ boundfunc = new Call(wrapper, [new Literal('this')]);
+ boundfunc.updateLocationDataIfMissing(this.locationData);
+ return boundfunc.compileNode(o);
+ }
+ o.scope = del(o, 'classScope') || this.makeScope(o.scope);
+ o.scope.shared = del(o, 'sharedScope');
+ o.indent += TAB;
+ delete o.bare;
+ delete o.isExistentialEquals;
+ params = [];
+ exprs = [];
+ _ref3 = this.params;
+ for (_i = 0, _len = _ref3.length; _i < _len; _i++) {
+ param = _ref3[_i];
+ if (!(param instanceof Expansion)) {
+ o.scope.parameter(param.asReference(o));
+ }
+ }
+ _ref4 = this.params;
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
+ param = _ref4[_j];
+ if (!(param.splat || param instanceof Expansion)) {
+ continue;
+ }
+ _ref5 = this.params;
+ for (_k = 0, _len2 = _ref5.length; _k < _len2; _k++) {
+ p = _ref5[_k].name;
+ if (!(!(param instanceof Expansion))) {
+ continue;
+ }
+ if (p["this"]) {
+ p = p.properties[0].name;
+ }
+ if (p.value) {
+ o.scope.add(p.value, 'var', true);
+ }
+ }
+ splats = new Assign(new Value(new Arr((function() {
+ var _l, _len3, _ref6, _results;
+ _ref6 = this.params;
+ _results = [];
+ for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
+ p = _ref6[_l];
+ _results.push(p.asReference(o));
+ }
+ return _results;
+ }).call(this))), new Value(new Literal('arguments')));
+ break;
+ }
+ _ref6 = this.params;
+ for (_l = 0, _len3 = _ref6.length; _l < _len3; _l++) {
+ param = _ref6[_l];
+ if (param.isComplex()) {
+ val = ref = param.asReference(o);
+ if (param.value) {
+ val = new Op('?', ref, param.value);
+ }
+ exprs.push(new Assign(new Value(param.name), val, '=', {
+ param: true
+ }));
+ } else {
+ ref = param;
+ if (param.value) {
+ lit = new Literal(ref.name.value + ' == null');
+ val = new Assign(new Value(param.name), param.value, '=');
+ exprs.push(new If(lit, val));
+ }
+ }
+ if (!splats) {
+ params.push(ref);
+ }
+ }
+ wasEmpty = this.body.isEmpty();
+ if (splats) {
+ exprs.unshift(splats);
+ }
+ if (exprs.length) {
+ (_ref7 = this.body.expressions).unshift.apply(_ref7, exprs);
+ }
+ for (i = _m = 0, _len4 = params.length; _m < _len4; i = ++_m) {
+ p = params[i];
+ params[i] = p.compileToFragments(o);
+ o.scope.parameter(fragmentsToText(params[i]));
+ }
+ uniqs = [];
+ this.eachParamName(function(name, node) {
+ if (__indexOf.call(uniqs, name) >= 0) {
+ node.error("multiple parameters named '" + name + "'");
+ }
+ return uniqs.push(name);
+ });
+ if (!(wasEmpty || this.noReturn)) {
+ this.body.makeReturn();
+ }
+ code = 'function';
+ if (this.ctor) {
+ code += ' ' + this.name;
+ }
+ code += '(';
+ answer = [this.makeCode(code)];
+ for (i = _n = 0, _len5 = params.length; _n < _len5; i = ++_n) {
+ p = params[i];
+ if (i) {
+ answer.push(this.makeCode(", "));
+ }
+ answer.push.apply(answer, p);
+ }
+ answer.push(this.makeCode(') {'));
+ if (!this.body.isEmpty()) {
+ answer = answer.concat(this.makeCode("\n"), this.body.compileWithDeclarations(o), this.makeCode("\n" + this.tab));
+ }
+ answer.push(this.makeCode('}'));
+ if (this.ctor) {
+ return [this.makeCode(this.tab)].concat(__slice.call(answer));
+ }
+ if (this.front || (o.level >= LEVEL_ACCESS)) {
+ return this.wrapInBraces(answer);
+ } else {
+ return answer;
+ }
+ };
+
+ Code.prototype.eachParamName = function(iterator) {
+ var param, _i, _len, _ref2, _results;
+ _ref2 = this.params;
+ _results = [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ param = _ref2[_i];
+ _results.push(param.eachName(iterator));
+ }
+ return _results;
+ };
+
+ Code.prototype.traverseChildren = function(crossScope, func) {
+ if (crossScope) {
+ return Code.__super__.traverseChildren.call(this, crossScope, func);
+ }
+ };
+
+ return Code;
+
+ })(Base);
+
+ exports.Param = Param = (function(_super) {
+ __extends(Param, _super);
+
+ function Param(name, value, splat) {
+ var _ref2;
+ this.name = name;
+ this.value = value;
+ this.splat = splat;
+ if (_ref2 = (name = this.name.unwrapAll().value), __indexOf.call(STRICT_PROSCRIBED, _ref2) >= 0) {
+ this.name.error("parameter name \"" + name + "\" is not allowed");
+ }
+ }
+
+ Param.prototype.children = ['name', 'value'];
+
+ Param.prototype.compileToFragments = function(o) {
+ return this.name.compileToFragments(o, LEVEL_LIST);
+ };
+
+ Param.prototype.asReference = function(o) {
+ var node;
+ if (this.reference) {
+ return this.reference;
+ }
+ node = this.name;
+ if (node["this"]) {
+ node = node.properties[0].name;
+ if (node.value.reserved) {
+ node = new Literal(o.scope.freeVariable(node.value));
+ }
+ } else if (node.isComplex()) {
+ node = new Literal(o.scope.freeVariable('arg'));
+ }
+ node = new Value(node);
+ if (this.splat) {
+ node = new Splat(node);
+ }
+ node.updateLocationDataIfMissing(this.locationData);
+ return this.reference = node;
+ };
+
+ Param.prototype.isComplex = function() {
+ return this.name.isComplex();
+ };
+
+ Param.prototype.eachName = function(iterator, name) {
+ var atParam, node, obj, _i, _len, _ref2;
+ if (name == null) {
+ name = this.name;
+ }
+ atParam = function(obj) {
+ var node;
+ node = obj.properties[0].name;
+ if (!node.value.reserved) {
+ return iterator(node.value, node);
+ }
+ };
+ if (name instanceof Literal) {
+ return iterator(name.value, name);
+ }
+ if (name instanceof Value) {
+ return atParam(name);
+ }
+ _ref2 = name.objects;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ if (obj instanceof Assign) {
+ this.eachName(iterator, obj.value.unwrap());
+ } else if (obj instanceof Splat) {
+ node = obj.name.unwrap();
+ iterator(node.value, node);
+ } else if (obj instanceof Value) {
+ if (obj.isArray() || obj.isObject()) {
+ this.eachName(iterator, obj.base);
+ } else if (obj["this"]) {
+ atParam(obj);
+ } else {
+ iterator(obj.base.value, obj.base);
+ }
+ } else if (!(obj instanceof Expansion)) {
+ obj.error("illegal parameter " + (obj.compile()));
+ }
+ }
+ };
+
+ return Param;
+
+ })(Base);
+
+ exports.Splat = Splat = (function(_super) {
+ __extends(Splat, _super);
+
+ Splat.prototype.children = ['name'];
+
+ Splat.prototype.isAssignable = YES;
+
+ function Splat(name) {
+ this.name = name.compile ? name : new Literal(name);
+ }
+
+ Splat.prototype.assigns = function(name) {
+ return this.name.assigns(name);
+ };
+
+ Splat.prototype.compileToFragments = function(o) {
+ return this.name.compileToFragments(o);
+ };
+
+ Splat.prototype.unwrap = function() {
+ return this.name;
+ };
+
+ Splat.compileSplattedArray = function(o, list, apply) {
+ var args, base, compiledNode, concatPart, fragments, i, index, node, _i, _len;
+ index = -1;
+ while ((node = list[++index]) && !(node instanceof Splat)) {
+ continue;
+ }
+ if (index >= list.length) {
+ return [];
+ }
+ if (list.length === 1) {
+ node = list[0];
+ fragments = node.compileToFragments(o, LEVEL_LIST);
+ if (apply) {
+ return fragments;
+ }
+ return [].concat(node.makeCode("" + (utility('slice')) + ".call("), fragments, node.makeCode(")"));
+ }
+ args = list.slice(index);
+ for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
+ node = args[i];
+ compiledNode = node.compileToFragments(o, LEVEL_LIST);
+ args[i] = node instanceof Splat ? [].concat(node.makeCode("" + (utility('slice')) + ".call("), compiledNode, node.makeCode(")")) : [].concat(node.makeCode("["), compiledNode, node.makeCode("]"));
+ }
+ if (index === 0) {
+ node = list[0];
+ concatPart = node.joinFragmentArrays(args.slice(1), ', ');
+ return args[0].concat(node.makeCode(".concat("), concatPart, node.makeCode(")"));
+ }
+ base = (function() {
+ var _j, _len1, _ref2, _results;
+ _ref2 = list.slice(0, index);
+ _results = [];
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ node = _ref2[_j];
+ _results.push(node.compileToFragments(o, LEVEL_LIST));
+ }
+ return _results;
+ })();
+ base = list[0].joinFragmentArrays(base, ', ');
+ concatPart = list[index].joinFragmentArrays(args, ', ');
+ return [].concat(list[0].makeCode("["), base, list[index].makeCode("].concat("), concatPart, (last(list)).makeCode(")"));
+ };
+
+ return Splat;
+
+ })(Base);
+
+ exports.Expansion = Expansion = (function(_super) {
+ __extends(Expansion, _super);
+
+ function Expansion() {
+ return Expansion.__super__.constructor.apply(this, arguments);
+ }
+
+ Expansion.prototype.isComplex = NO;
+
+ Expansion.prototype.compileNode = function(o) {
+ return this.error('Expansion must be used inside a destructuring assignment or parameter list');
+ };
+
+ Expansion.prototype.asReference = function(o) {
+ return this;
+ };
+
+ Expansion.prototype.eachName = function(iterator) {};
+
+ return Expansion;
+
+ })(Base);
+
+ exports.While = While = (function(_super) {
+ __extends(While, _super);
+
+ function While(condition, options) {
+ this.condition = (options != null ? options.invert : void 0) ? condition.invert() : condition;
+ this.guard = options != null ? options.guard : void 0;
+ }
+
+ While.prototype.children = ['condition', 'guard', 'body'];
+
+ While.prototype.isStatement = YES;
+
+ While.prototype.makeReturn = function(res) {
+ if (res) {
+ return While.__super__.makeReturn.apply(this, arguments);
+ } else {
+ this.returns = !this.jumps({
+ loop: true
+ });
+ return this;
+ }
+ };
+
+ While.prototype.addBody = function(body) {
+ this.body = body;
+ return this;
+ };
+
+ While.prototype.jumps = function() {
+ var expressions, jumpNode, node, _i, _len;
+ expressions = this.body.expressions;
+ if (!expressions.length) {
+ return false;
+ }
+ for (_i = 0, _len = expressions.length; _i < _len; _i++) {
+ node = expressions[_i];
+ if (jumpNode = node.jumps({
+ loop: true
+ })) {
+ return jumpNode;
+ }
+ }
+ return false;
+ };
+
+ While.prototype.compileNode = function(o) {
+ var answer, body, rvar, set;
+ o.indent += TAB;
+ set = '';
+ body = this.body;
+ if (body.isEmpty()) {
+ body = this.makeCode('');
+ } else {
+ if (this.returns) {
+ body.makeReturn(rvar = o.scope.freeVariable('results'));
+ set = "" + this.tab + rvar + " = [];\n";
+ }
+ if (this.guard) {
+ if (body.expressions.length > 1) {
+ body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
+ } else {
+ if (this.guard) {
+ body = Block.wrap([new If(this.guard, body)]);
+ }
+ }
+ }
+ body = [].concat(this.makeCode("\n"), body.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab));
+ }
+ answer = [].concat(this.makeCode(set + this.tab + "while ("), this.condition.compileToFragments(o, LEVEL_PAREN), this.makeCode(") {"), body, this.makeCode("}"));
+ if (this.returns) {
+ answer.push(this.makeCode("\n" + this.tab + "return " + rvar + ";"));
+ }
+ return answer;
+ };
+
+ return While;
+
+ })(Base);
+
+ exports.Op = Op = (function(_super) {
+ var CONVERSIONS, INVERSIONS;
+
+ __extends(Op, _super);
+
+ function Op(op, first, second, flip) {
+ if (op === 'in') {
+ return new In(first, second);
+ }
+ if (op === 'do') {
+ return this.generateDo(first);
+ }
+ if (op === 'new') {
+ if (first instanceof Call && !first["do"] && !first.isNew) {
+ return first.newInstance();
+ }
+ if (first instanceof Code && first.bound || first["do"]) {
+ first = new Parens(first);
+ }
+ }
+ this.operator = CONVERSIONS[op] || op;
+ this.first = first;
+ this.second = second;
+ this.flip = !!flip;
+ return this;
+ }
+
+ CONVERSIONS = {
+ '==': '===',
+ '!=': '!==',
+ 'of': 'in'
+ };
+
+ INVERSIONS = {
+ '!==': '===',
+ '===': '!=='
+ };
+
+ Op.prototype.children = ['first', 'second'];
+
+ Op.prototype.isSimpleNumber = NO;
+
+ Op.prototype.isUnary = function() {
+ return !this.second;
+ };
+
+ Op.prototype.isComplex = function() {
+ var _ref2;
+ return !(this.isUnary() && ((_ref2 = this.operator) === '+' || _ref2 === '-')) || this.first.isComplex();
+ };
+
+ Op.prototype.isChainable = function() {
+ var _ref2;
+ return (_ref2 = this.operator) === '<' || _ref2 === '>' || _ref2 === '>=' || _ref2 === '<=' || _ref2 === '===' || _ref2 === '!==';
+ };
+
+ Op.prototype.invert = function() {
+ var allInvertable, curr, fst, op, _ref2;
+ if (this.isChainable() && this.first.isChainable()) {
+ allInvertable = true;
+ curr = this;
+ while (curr && curr.operator) {
+ allInvertable && (allInvertable = curr.operator in INVERSIONS);
+ curr = curr.first;
+ }
+ if (!allInvertable) {
+ return new Parens(this).invert();
+ }
+ curr = this;
+ while (curr && curr.operator) {
+ curr.invert = !curr.invert;
+ curr.operator = INVERSIONS[curr.operator];
+ curr = curr.first;
+ }
+ return this;
+ } else if (op = INVERSIONS[this.operator]) {
+ this.operator = op;
+ if (this.first.unwrap() instanceof Op) {
+ this.first.invert();
+ }
+ return this;
+ } else if (this.second) {
+ return new Parens(this).invert();
+ } else if (this.operator === '!' && (fst = this.first.unwrap()) instanceof Op && ((_ref2 = fst.operator) === '!' || _ref2 === 'in' || _ref2 === 'instanceof')) {
+ return fst;
+ } else {
+ return new Op('!', this);
+ }
+ };
+
+ Op.prototype.unfoldSoak = function(o) {
+ var _ref2;
+ return ((_ref2 = this.operator) === '++' || _ref2 === '--' || _ref2 === 'delete') && unfoldSoak(o, this, 'first');
+ };
+
+ Op.prototype.generateDo = function(exp) {
+ var call, func, param, passedParams, ref, _i, _len, _ref2;
+ passedParams = [];
+ func = exp instanceof Assign && (ref = exp.value.unwrap()) instanceof Code ? ref : exp;
+ _ref2 = func.params || [];
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ param = _ref2[_i];
+ if (param.value) {
+ passedParams.push(param.value);
+ delete param.value;
+ } else {
+ passedParams.push(param);
+ }
+ }
+ call = new Call(exp, passedParams);
+ call["do"] = true;
+ return call;
+ };
+
+ Op.prototype.compileNode = function(o) {
+ var answer, isChain, lhs, rhs, _ref2, _ref3;
+ isChain = this.isChainable() && this.first.isChainable();
+ if (!isChain) {
+ this.first.front = this.front;
+ }
+ if (this.operator === 'delete' && o.scope.check(this.first.unwrapAll().value)) {
+ this.error('delete operand may not be argument or var');
+ }
+ if (((_ref2 = this.operator) === '--' || _ref2 === '++') && (_ref3 = this.first.unwrapAll().value, __indexOf.call(STRICT_PROSCRIBED, _ref3) >= 0)) {
+ this.error("cannot increment/decrement \"" + (this.first.unwrapAll().value) + "\"");
+ }
+ if (this.isUnary()) {
+ return this.compileUnary(o);
+ }
+ if (isChain) {
+ return this.compileChain(o);
+ }
+ switch (this.operator) {
+ case '?':
+ return this.compileExistence(o);
+ case '**':
+ return this.compilePower(o);
+ case '//':
+ return this.compileFloorDivision(o);
+ case '%%':
+ return this.compileModulo(o);
+ default:
+ lhs = this.first.compileToFragments(o, LEVEL_OP);
+ rhs = this.second.compileToFragments(o, LEVEL_OP);
+ answer = [].concat(lhs, this.makeCode(" " + this.operator + " "), rhs);
+ if (o.level <= LEVEL_OP) {
+ return answer;
+ } else {
+ return this.wrapInBraces(answer);
+ }
+ }
+ };
+
+ Op.prototype.compileChain = function(o) {
+ var fragments, fst, shared, _ref2;
+ _ref2 = this.first.second.cache(o), this.first.second = _ref2[0], shared = _ref2[1];
+ fst = this.first.compileToFragments(o, LEVEL_OP);
+ fragments = fst.concat(this.makeCode(" " + (this.invert ? '&&' : '||') + " "), shared.compileToFragments(o), this.makeCode(" " + this.operator + " "), this.second.compileToFragments(o, LEVEL_OP));
+ return this.wrapInBraces(fragments);
+ };
+
+ Op.prototype.compileExistence = function(o) {
+ var fst, ref;
+ if (this.first.isComplex()) {
+ ref = new Literal(o.scope.freeVariable('ref'));
+ fst = new Parens(new Assign(ref, this.first));
+ } else {
+ fst = this.first;
+ ref = fst;
+ }
+ return new If(new Existence(fst), ref, {
+ type: 'if'
+ }).addElse(this.second).compileToFragments(o);
+ };
+
+ Op.prototype.compileUnary = function(o) {
+ var op, parts, plusMinus;
+ parts = [];
+ op = this.operator;
+ parts.push([this.makeCode(op)]);
+ if (op === '!' && this.first instanceof Existence) {
+ this.first.negated = !this.first.negated;
+ return this.first.compileToFragments(o);
+ }
+ if (o.level >= LEVEL_ACCESS) {
+ return (new Parens(this)).compileToFragments(o);
+ }
+ plusMinus = op === '+' || op === '-';
+ if ((op === 'new' || op === 'typeof' || op === 'delete') || plusMinus && this.first instanceof Op && this.first.operator === op) {
+ parts.push([this.makeCode(' ')]);
+ }
+ if ((plusMinus && this.first instanceof Op) || (op === 'new' && this.first.isStatement(o))) {
+ this.first = new Parens(this.first);
+ }
+ parts.push(this.first.compileToFragments(o, LEVEL_OP));
+ if (this.flip) {
+ parts.reverse();
+ }
+ return this.joinFragmentArrays(parts, '');
+ };
+
+ Op.prototype.compilePower = function(o) {
+ var pow;
+ pow = new Value(new Literal('Math'), [new Access(new Literal('pow'))]);
+ return new Call(pow, [this.first, this.second]).compileToFragments(o);
+ };
+
+ Op.prototype.compileFloorDivision = function(o) {
+ var div, floor;
+ floor = new Value(new Literal('Math'), [new Access(new Literal('floor'))]);
+ div = new Op('/', this.first, this.second);
+ return new Call(floor, [div]).compileToFragments(o);
+ };
+
+ Op.prototype.compileModulo = function(o) {
+ var mod;
+ mod = new Value(new Literal(utility('modulo')));
+ return new Call(mod, [this.first, this.second]).compileToFragments(o);
+ };
+
+ Op.prototype.toString = function(idt) {
+ return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
+ };
+
+ return Op;
+
+ })(Base);
+
+ exports.In = In = (function(_super) {
+ __extends(In, _super);
+
+ function In(object, array) {
+ this.object = object;
+ this.array = array;
+ }
+
+ In.prototype.children = ['object', 'array'];
+
+ In.prototype.invert = NEGATE;
+
+ In.prototype.compileNode = function(o) {
+ var hasSplat, obj, _i, _len, _ref2;
+ if (this.array instanceof Value && this.array.isArray() && this.array.base.objects.length) {
+ _ref2 = this.array.base.objects;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ obj = _ref2[_i];
+ if (!(obj instanceof Splat)) {
+ continue;
+ }
+ hasSplat = true;
+ break;
+ }
+ if (!hasSplat) {
+ return this.compileOrTest(o);
+ }
+ }
+ return this.compileLoopTest(o);
+ };
+
+ In.prototype.compileOrTest = function(o) {
+ var cmp, cnj, i, item, ref, sub, tests, _i, _len, _ref2, _ref3, _ref4;
+ _ref2 = this.object.cache(o, LEVEL_OP), sub = _ref2[0], ref = _ref2[1];
+ _ref3 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref3[0], cnj = _ref3[1];
+ tests = [];
+ _ref4 = this.array.base.objects;
+ for (i = _i = 0, _len = _ref4.length; _i < _len; i = ++_i) {
+ item = _ref4[i];
+ if (i) {
+ tests.push(this.makeCode(cnj));
+ }
+ tests = tests.concat((i ? ref : sub), this.makeCode(cmp), item.compileToFragments(o, LEVEL_ACCESS));
+ }
+ if (o.level < LEVEL_OP) {
+ return tests;
+ } else {
+ return this.wrapInBraces(tests);
+ }
+ };
+
+ In.prototype.compileLoopTest = function(o) {
+ var fragments, ref, sub, _ref2;
+ _ref2 = this.object.cache(o, LEVEL_LIST), sub = _ref2[0], ref = _ref2[1];
+ fragments = [].concat(this.makeCode(utility('indexOf') + ".call("), this.array.compileToFragments(o, LEVEL_LIST), this.makeCode(", "), ref, this.makeCode(") " + (this.negated ? '< 0' : '>= 0')));
+ if (fragmentsToText(sub) === fragmentsToText(ref)) {
+ return fragments;
+ }
+ fragments = sub.concat(this.makeCode(', '), fragments);
+ if (o.level < LEVEL_LIST) {
+ return fragments;
+ } else {
+ return this.wrapInBraces(fragments);
+ }
+ };
+
+ In.prototype.toString = function(idt) {
+ return In.__super__.toString.call(this, idt, this.constructor.name + (this.negated ? '!' : ''));
+ };
+
+ return In;
+
+ })(Base);
+
+ exports.Try = Try = (function(_super) {
+ __extends(Try, _super);
+
+ function Try(attempt, errorVariable, recovery, ensure) {
+ this.attempt = attempt;
+ this.errorVariable = errorVariable;
+ this.recovery = recovery;
+ this.ensure = ensure;
+ }
+
+ Try.prototype.children = ['attempt', 'recovery', 'ensure'];
+
+ Try.prototype.isStatement = YES;
+
+ Try.prototype.jumps = function(o) {
+ var _ref2;
+ return this.attempt.jumps(o) || ((_ref2 = this.recovery) != null ? _ref2.jumps(o) : void 0);
+ };
+
+ Try.prototype.makeReturn = function(res) {
+ if (this.attempt) {
+ this.attempt = this.attempt.makeReturn(res);
+ }
+ if (this.recovery) {
+ this.recovery = this.recovery.makeReturn(res);
+ }
+ return this;
+ };
+
+ Try.prototype.compileNode = function(o) {
+ var catchPart, ensurePart, placeholder, tryPart;
+ o.indent += TAB;
+ tryPart = this.attempt.compileToFragments(o, LEVEL_TOP);
+ catchPart = this.recovery ? (placeholder = new Literal('_error'), this.errorVariable ? this.recovery.unshift(new Assign(this.errorVariable, placeholder)) : void 0, [].concat(this.makeCode(" catch ("), placeholder.compileToFragments(o), this.makeCode(") {\n"), this.recovery.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}"))) : !(this.ensure || this.recovery) ? [this.makeCode(' catch (_error) {}')] : [];
+ ensurePart = this.ensure ? [].concat(this.makeCode(" finally {\n"), this.ensure.compileToFragments(o, LEVEL_TOP), this.makeCode("\n" + this.tab + "}")) : [];
+ return [].concat(this.makeCode("" + this.tab + "try {\n"), tryPart, this.makeCode("\n" + this.tab + "}"), catchPart, ensurePart);
+ };
+
+ return Try;
+
+ })(Base);
+
+ exports.Throw = Throw = (function(_super) {
+ __extends(Throw, _super);
+
+ function Throw(expression) {
+ this.expression = expression;
+ }
+
+ Throw.prototype.children = ['expression'];
+
+ Throw.prototype.isStatement = YES;
+
+ Throw.prototype.jumps = NO;
+
+ Throw.prototype.makeReturn = THIS;
+
+ Throw.prototype.compileNode = function(o) {
+ return [].concat(this.makeCode(this.tab + "throw "), this.expression.compileToFragments(o), this.makeCode(";"));
+ };
+
+ return Throw;
+
+ })(Base);
+
+ exports.Existence = Existence = (function(_super) {
+ __extends(Existence, _super);
+
+ function Existence(expression) {
+ this.expression = expression;
+ }
+
+ Existence.prototype.children = ['expression'];
+
+ Existence.prototype.invert = NEGATE;
+
+ Existence.prototype.compileNode = function(o) {
+ var cmp, cnj, code, _ref2;
+ this.expression.front = this.front;
+ code = this.expression.compile(o, LEVEL_OP);
+ if (IDENTIFIER.test(code) && !o.scope.check(code)) {
+ _ref2 = this.negated ? ['===', '||'] : ['!==', '&&'], cmp = _ref2[0], cnj = _ref2[1];
+ code = "typeof " + code + " " + cmp + " \"undefined\" " + cnj + " " + code + " " + cmp + " null";
+ } else {
+ code = "" + code + " " + (this.negated ? '==' : '!=') + " null";
+ }
+ return [this.makeCode(o.level <= LEVEL_COND ? code : "(" + code + ")")];
+ };
+
+ return Existence;
+
+ })(Base);
+
+ exports.Parens = Parens = (function(_super) {
+ __extends(Parens, _super);
+
+ function Parens(body) {
+ this.body = body;
+ }
+
+ Parens.prototype.children = ['body'];
+
+ Parens.prototype.unwrap = function() {
+ return this.body;
+ };
+
+ Parens.prototype.isComplex = function() {
+ return this.body.isComplex();
+ };
+
+ Parens.prototype.compileNode = function(o) {
+ var bare, expr, fragments;
+ expr = this.body.unwrap();
+ if (expr instanceof Value && expr.isAtomic()) {
+ expr.front = this.front;
+ return expr.compileToFragments(o);
+ }
+ fragments = expr.compileToFragments(o, LEVEL_PAREN);
+ bare = o.level < LEVEL_OP && (expr instanceof Op || expr instanceof Call || (expr instanceof For && expr.returns));
+ if (bare) {
+ return fragments;
+ } else {
+ return this.wrapInBraces(fragments);
+ }
+ };
+
+ return Parens;
+
+ })(Base);
+
+ exports.For = For = (function(_super) {
+ __extends(For, _super);
+
+ function For(body, source) {
+ var _ref2;
+ this.source = source.source, this.guard = source.guard, this.step = source.step, this.name = source.name, this.index = source.index;
+ this.body = Block.wrap([body]);
+ this.own = !!source.own;
+ this.object = !!source.object;
+ if (this.object) {
+ _ref2 = [this.index, this.name], this.name = _ref2[0], this.index = _ref2[1];
+ }
+ if (this.index instanceof Value) {
+ this.index.error('index cannot be a pattern matching expression');
+ }
+ this.range = this.source instanceof Value && this.source.base instanceof Range && !this.source.properties.length;
+ this.pattern = this.name instanceof Value;
+ if (this.range && this.index) {
+ this.index.error('indexes do not apply to range loops');
+ }
+ if (this.range && this.pattern) {
+ this.name.error('cannot pattern match over range loops');
+ }
+ if (this.own && !this.object) {
+ this.name.error('cannot use own with for-in');
+ }
+ this.returns = false;
+ }
+
+ For.prototype.children = ['body', 'source', 'guard', 'step'];
+
+ For.prototype.compileNode = function(o) {
+ var body, bodyFragments, compare, compareDown, declare, declareDown, defPart, defPartFragments, down, forPartFragments, guardPart, idt1, increment, index, ivar, kvar, kvarAssign, lastJumps, lvar, name, namePart, ref, resultPart, returnResult, rvar, scope, source, step, stepNum, stepVar, svar, varPart, _ref2, _ref3;
+ body = Block.wrap([this.body]);
+ lastJumps = (_ref2 = last(body.expressions)) != null ? _ref2.jumps() : void 0;
+ if (lastJumps && lastJumps instanceof Return) {
+ this.returns = false;
+ }
+ source = this.range ? this.source.base : this.source;
+ scope = o.scope;
+ if (!this.pattern) {
+ name = this.name && (this.name.compile(o, LEVEL_LIST));
+ }
+ index = this.index && (this.index.compile(o, LEVEL_LIST));
+ if (name && !this.pattern) {
+ scope.find(name);
+ }
+ if (index) {
+ scope.find(index);
+ }
+ if (this.returns) {
+ rvar = scope.freeVariable('results');
+ }
+ ivar = (this.object && index) || scope.freeVariable('i');
+ kvar = (this.range && name) || index || ivar;
+ kvarAssign = kvar !== ivar ? "" + kvar + " = " : "";
+ if (this.step && !this.range) {
+ _ref3 = this.cacheToCodeFragments(this.step.cache(o, LEVEL_LIST)), step = _ref3[0], stepVar = _ref3[1];
+ stepNum = stepVar.match(NUMBER);
+ }
+ if (this.pattern) {
+ name = ivar;
+ }
+ varPart = '';
+ guardPart = '';
+ defPart = '';
+ idt1 = this.tab + TAB;
+ if (this.range) {
+ forPartFragments = source.compileToFragments(merge(o, {
+ index: ivar,
+ name: name,
+ step: this.step
+ }));
+ } else {
+ svar = this.source.compile(o, LEVEL_LIST);
+ if ((name || this.own) && !IDENTIFIER.test(svar)) {
+ defPart += "" + this.tab + (ref = scope.freeVariable('ref')) + " = " + svar + ";\n";
+ svar = ref;
+ }
+ if (name && !this.pattern) {
+ namePart = "" + name + " = " + svar + "[" + kvar + "]";
+ }
+ if (!this.object) {
+ if (step !== stepVar) {
+ defPart += "" + this.tab + step + ";\n";
+ }
+ if (!(this.step && stepNum && (down = parseNum(stepNum[0]) < 0))) {
+ lvar = scope.freeVariable('len');
+ }
+ declare = "" + kvarAssign + ivar + " = 0, " + lvar + " = " + svar + ".length";
+ declareDown = "" + kvarAssign + ivar + " = " + svar + ".length - 1";
+ compare = "" + ivar + " < " + lvar;
+ compareDown = "" + ivar + " >= 0";
+ if (this.step) {
+ if (stepNum) {
+ if (down) {
+ compare = compareDown;
+ declare = declareDown;
+ }
+ } else {
+ compare = "" + stepVar + " > 0 ? " + compare + " : " + compareDown;
+ declare = "(" + stepVar + " > 0 ? (" + declare + ") : " + declareDown + ")";
+ }
+ increment = "" + ivar + " += " + stepVar;
+ } else {
+ increment = "" + (kvar !== ivar ? "++" + ivar : "" + ivar + "++");
+ }
+ forPartFragments = [this.makeCode("" + declare + "; " + compare + "; " + kvarAssign + increment)];
+ }
+ }
+ if (this.returns) {
+ resultPart = "" + this.tab + rvar + " = [];\n";
+ returnResult = "\n" + this.tab + "return " + rvar + ";";
+ body.makeReturn(rvar);
+ }
+ if (this.guard) {
+ if (body.expressions.length > 1) {
+ body.expressions.unshift(new If((new Parens(this.guard)).invert(), new Literal("continue")));
+ } else {
+ if (this.guard) {
+ body = Block.wrap([new If(this.guard, body)]);
+ }
+ }
+ }
+ if (this.pattern) {
+ body.expressions.unshift(new Assign(this.name, new Literal("" + svar + "[" + kvar + "]")));
+ }
+ defPartFragments = [].concat(this.makeCode(defPart), this.pluckDirectCall(o, body));
+ if (namePart) {
+ varPart = "\n" + idt1 + namePart + ";";
+ }
+ if (this.object) {
+ forPartFragments = [this.makeCode("" + kvar + " in " + svar)];
+ if (this.own) {
+ guardPart = "\n" + idt1 + "if (!" + (utility('hasProp')) + ".call(" + svar + ", " + kvar + ")) continue;";
+ }
+ }
+ bodyFragments = body.compileToFragments(merge(o, {
+ indent: idt1
+ }), LEVEL_TOP);
+ if (bodyFragments && (bodyFragments.length > 0)) {
+ bodyFragments = [].concat(this.makeCode("\n"), bodyFragments, this.makeCode("\n"));
+ }
+ return [].concat(defPartFragments, this.makeCode("" + (resultPart || '') + this.tab + "for ("), forPartFragments, this.makeCode(") {" + guardPart + varPart), bodyFragments, this.makeCode("" + this.tab + "}" + (returnResult || '')));
+ };
+
+ For.prototype.pluckDirectCall = function(o, body) {
+ var base, defs, expr, fn, idx, ref, val, _i, _len, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8;
+ defs = [];
+ _ref2 = body.expressions;
+ for (idx = _i = 0, _len = _ref2.length; _i < _len; idx = ++_i) {
+ expr = _ref2[idx];
+ expr = expr.unwrapAll();
+ if (!(expr instanceof Call)) {
+ continue;
+ }
+ val = (_ref3 = expr.variable) != null ? _ref3.unwrapAll() : void 0;
+ if (!((val instanceof Code) || (val instanceof Value && ((_ref4 = val.base) != null ? _ref4.unwrapAll() : void 0) instanceof Code && val.properties.length === 1 && ((_ref5 = (_ref6 = val.properties[0].name) != null ? _ref6.value : void 0) === 'call' || _ref5 === 'apply')))) {
+ continue;
+ }
+ fn = ((_ref7 = val.base) != null ? _ref7.unwrapAll() : void 0) || val;
+ ref = new Literal(o.scope.freeVariable('fn'));
+ base = new Value(ref);
+ if (val.base) {
+ _ref8 = [base, val], val.base = _ref8[0], base = _ref8[1];
+ }
+ body.expressions[idx] = new Call(base, expr.args);
+ defs = defs.concat(this.makeCode(this.tab), new Assign(ref, fn).compileToFragments(o, LEVEL_TOP), this.makeCode(';\n'));
+ }
+ return defs;
+ };
+
+ return For;
+
+ })(While);
+
+ exports.Switch = Switch = (function(_super) {
+ __extends(Switch, _super);
+
+ function Switch(subject, cases, otherwise) {
+ this.subject = subject;
+ this.cases = cases;
+ this.otherwise = otherwise;
+ }
+
+ Switch.prototype.children = ['subject', 'cases', 'otherwise'];
+
+ Switch.prototype.isStatement = YES;
+
+ Switch.prototype.jumps = function(o) {
+ var block, conds, jumpNode, _i, _len, _ref2, _ref3, _ref4;
+ if (o == null) {
+ o = {
+ block: true
+ };
+ }
+ _ref2 = this.cases;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ _ref3 = _ref2[_i], conds = _ref3[0], block = _ref3[1];
+ if (jumpNode = block.jumps(o)) {
+ return jumpNode;
+ }
+ }
+ return (_ref4 = this.otherwise) != null ? _ref4.jumps(o) : void 0;
+ };
+
+ Switch.prototype.makeReturn = function(res) {
+ var pair, _i, _len, _ref2, _ref3;
+ _ref2 = this.cases;
+ for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
+ pair = _ref2[_i];
+ pair[1].makeReturn(res);
+ }
+ if (res) {
+ this.otherwise || (this.otherwise = new Block([new Literal('void 0')]));
+ }
+ if ((_ref3 = this.otherwise) != null) {
+ _ref3.makeReturn(res);
+ }
+ return this;
+ };
+
+ Switch.prototype.compileNode = function(o) {
+ var block, body, cond, conditions, expr, fragments, i, idt1, idt2, _i, _j, _len, _len1, _ref2, _ref3, _ref4;
+ idt1 = o.indent + TAB;
+ idt2 = o.indent = idt1 + TAB;
+ fragments = [].concat(this.makeCode(this.tab + "switch ("), (this.subject ? this.subject.compileToFragments(o, LEVEL_PAREN) : this.makeCode("false")), this.makeCode(") {\n"));
+ _ref2 = this.cases;
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
+ _ref3 = _ref2[i], conditions = _ref3[0], block = _ref3[1];
+ _ref4 = flatten([conditions]);
+ for (_j = 0, _len1 = _ref4.length; _j < _len1; _j++) {
+ cond = _ref4[_j];
+ if (!this.subject) {
+ cond = cond.invert();
+ }
+ fragments = fragments.concat(this.makeCode(idt1 + "case "), cond.compileToFragments(o, LEVEL_PAREN), this.makeCode(":\n"));
+ }
+ if ((body = block.compileToFragments(o, LEVEL_TOP)).length > 0) {
+ fragments = fragments.concat(body, this.makeCode('\n'));
+ }
+ if (i === this.cases.length - 1 && !this.otherwise) {
+ break;
+ }
+ expr = this.lastNonComment(block.expressions);
+ if (expr instanceof Return || (expr instanceof Literal && expr.jumps() && expr.value !== 'debugger')) {
+ continue;
+ }
+ fragments.push(cond.makeCode(idt2 + 'break;\n'));
+ }
+ if (this.otherwise && this.otherwise.expressions.length) {
+ fragments.push.apply(fragments, [this.makeCode(idt1 + "default:\n")].concat(__slice.call(this.otherwise.compileToFragments(o, LEVEL_TOP)), [this.makeCode("\n")]));
+ }
+ fragments.push(this.makeCode(this.tab + '}'));
+ return fragments;
+ };
+
+ return Switch;
+
+ })(Base);
+
+ exports.If = If = (function(_super) {
+ __extends(If, _super);
+
+ function If(condition, body, options) {
+ this.body = body;
+ if (options == null) {
+ options = {};
+ }
+ this.condition = options.type === 'unless' ? condition.invert() : condition;
+ this.elseBody = null;
+ this.isChain = false;
+ this.soak = options.soak;
+ }
+
+ If.prototype.children = ['condition', 'body', 'elseBody'];
+
+ If.prototype.bodyNode = function() {
+ var _ref2;
+ return (_ref2 = this.body) != null ? _ref2.unwrap() : void 0;
+ };
+
+ If.prototype.elseBodyNode = function() {
+ var _ref2;
+ return (_ref2 = this.elseBody) != null ? _ref2.unwrap() : void 0;
+ };
+
+ If.prototype.addElse = function(elseBody) {
+ if (this.isChain) {
+ this.elseBodyNode().addElse(elseBody);
+ } else {
+ this.isChain = elseBody instanceof If;
+ this.elseBody = this.ensureBlock(elseBody);
+ this.elseBody.updateLocationDataIfMissing(elseBody.locationData);
+ }
+ return this;
+ };
+
+ If.prototype.isStatement = function(o) {
+ var _ref2;
+ return (o != null ? o.level : void 0) === LEVEL_TOP || this.bodyNode().isStatement(o) || ((_ref2 = this.elseBodyNode()) != null ? _ref2.isStatement(o) : void 0);
+ };
+
+ If.prototype.jumps = function(o) {
+ var _ref2;
+ return this.body.jumps(o) || ((_ref2 = this.elseBody) != null ? _ref2.jumps(o) : void 0);
+ };
+
+ If.prototype.compileNode = function(o) {
+ if (this.isStatement(o)) {
+ return this.compileStatement(o);
+ } else {
+ return this.compileExpression(o);
+ }
+ };
+
+ If.prototype.makeReturn = function(res) {
+ if (res) {
+ this.elseBody || (this.elseBody = new Block([new Literal('void 0')]));
+ }
+ this.body && (this.body = new Block([this.body.makeReturn(res)]));
+ this.elseBody && (this.elseBody = new Block([this.elseBody.makeReturn(res)]));
+ return this;
+ };
+
+ If.prototype.ensureBlock = function(node) {
+ if (node instanceof Block) {
+ return node;
+ } else {
+ return new Block([node]);
+ }
+ };
+
+ If.prototype.compileStatement = function(o) {
+ var answer, body, child, cond, exeq, ifPart, indent;
+ child = del(o, 'chainChild');
+ exeq = del(o, 'isExistentialEquals');
+ if (exeq) {
+ return new If(this.condition.invert(), this.elseBodyNode(), {
+ type: 'if'
+ }).compileToFragments(o);
+ }
+ indent = o.indent + TAB;
+ cond = this.condition.compileToFragments(o, LEVEL_PAREN);
+ body = this.ensureBlock(this.body).compileToFragments(merge(o, {
+ indent: indent
+ }));
+ ifPart = [].concat(this.makeCode("if ("), cond, this.makeCode(") {\n"), body, this.makeCode("\n" + this.tab + "}"));
+ if (!child) {
+ ifPart.unshift(this.makeCode(this.tab));
+ }
+ if (!this.elseBody) {
+ return ifPart;
+ }
+ answer = ifPart.concat(this.makeCode(' else '));
+ if (this.isChain) {
+ o.chainChild = true;
+ answer = answer.concat(this.elseBody.unwrap().compileToFragments(o, LEVEL_TOP));
+ } else {
+ answer = answer.concat(this.makeCode("{\n"), this.elseBody.compileToFragments(merge(o, {
+ indent: indent
+ }), LEVEL_TOP), this.makeCode("\n" + this.tab + "}"));
+ }
+ return answer;
+ };
+
+ If.prototype.compileExpression = function(o) {
+ var alt, body, cond, fragments;
+ cond = this.condition.compileToFragments(o, LEVEL_COND);
+ body = this.bodyNode().compileToFragments(o, LEVEL_LIST);
+ alt = this.elseBodyNode() ? this.elseBodyNode().compileToFragments(o, LEVEL_LIST) : [this.makeCode('void 0')];
+ fragments = cond.concat(this.makeCode(" ? "), body, this.makeCode(" : "), alt);
+ if (o.level >= LEVEL_COND) {
+ return this.wrapInBraces(fragments);
+ } else {
+ return fragments;
+ }
+ };
+
+ If.prototype.unfoldSoak = function() {
+ return this.soak && this;
+ };
+
+ return If;
+
+ })(Base);
+
+ UTILITIES = {
+ "extends": function() {
+ 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; }";
+ },
+ bind: function() {
+ return 'function(fn, me){ return function(){ return fn.apply(me, arguments); }; }';
+ },
+ indexOf: function() {
+ 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; }";
+ },
+ modulo: function() {
+ return "function(a, b) { return (+a % (b = +b) + b) % b; }";
+ },
+ hasProp: function() {
+ return '{}.hasOwnProperty';
+ },
+ slice: function() {
+ return '[].slice';
+ }
+ };
+
+ LEVEL_TOP = 1;
+
+ LEVEL_PAREN = 2;
+
+ LEVEL_LIST = 3;
+
+ LEVEL_COND = 4;
+
+ LEVEL_OP = 5;
+
+ LEVEL_ACCESS = 6;
+
+ TAB = ' ';
+
+ IDENTIFIER_STR = "[$A-Za-z_\\x7f-\\uffff][$\\w\\x7f-\\uffff]*";
+
+ IDENTIFIER = RegExp("^" + IDENTIFIER_STR + "$");
+
+ SIMPLENUM = /^[+-]?\d+$/;
+
+ HEXNUM = /^[+-]?0x[\da-f]+/i;
+
+ NUMBER = /^[+-]?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)$/i;
+
+ METHOD_DEF = RegExp("^(" + IDENTIFIER_STR + ")(\\.prototype)?(?:\\.(" + IDENTIFIER_STR + ")|\\[(\"(?:[^\\\\\"\\r\\n]|\\\\.)*\"|'(?:[^\\\\'\\r\\n]|\\\\.)*')\\]|\\[(0x[\\da-fA-F]+|\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\])$");
+
+ IS_STRING = /^['"]/;
+
+ IS_REGEX = /^\//;
+
+ utility = function(name) {
+ var ref;
+ ref = "__" + name;
+ Scope.root.assign(ref, UTILITIES[name]());
+ return ref;
+ };
+
+ multident = function(code, tab) {
+ code = code.replace(/\n/g, '$&' + tab);
+ return code.replace(/\s+$/, '');
+ };
+
+ parseNum = function(x) {
+ if (x == null) {
+ return 0;
+ } else if (x.match(HEXNUM)) {
+ return parseInt(x, 16);
+ } else {
+ return parseFloat(x);
+ }
+ };
+
+ isLiteralArguments = function(node) {
+ return node instanceof Literal && node.value === 'arguments' && !node.asKey;
+ };
+
+ isLiteralThis = function(node) {
+ return (node instanceof Literal && node.value === 'this' && !node.asKey) || (node instanceof Code && node.bound) || (node instanceof Call && node.isSuper);
+ };
+
+ unfoldSoak = function(o, parent, name) {
+ var ifn;
+ if (!(ifn = parent[name].unfoldSoak(o))) {
+ return;
+ }
+ parent[name] = ifn.body;
+ ifn.body = new Value(parent);
+ return ifn;
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/optparse.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/optparse.js
new file mode 100644
index 000000000..6ec360452
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/optparse.js
@@ -0,0 +1,139 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var LONG_FLAG, MULTI_FLAG, OPTIONAL, OptionParser, SHORT_FLAG, buildRule, buildRules, normalizeArguments, repeat;
+
+ repeat = require('./helpers').repeat;
+
+ exports.OptionParser = OptionParser = (function() {
+ function OptionParser(rules, banner) {
+ this.banner = banner;
+ this.rules = buildRules(rules);
+ }
+
+ OptionParser.prototype.parse = function(args) {
+ var arg, i, isOption, matchedRule, options, originalArgs, pos, rule, seenNonOptionArg, skippingArgument, value, _i, _j, _len, _len1, _ref;
+ options = {
+ "arguments": []
+ };
+ skippingArgument = false;
+ originalArgs = args;
+ args = normalizeArguments(args);
+ for (i = _i = 0, _len = args.length; _i < _len; i = ++_i) {
+ arg = args[i];
+ if (skippingArgument) {
+ skippingArgument = false;
+ continue;
+ }
+ if (arg === '--') {
+ pos = originalArgs.indexOf('--');
+ options["arguments"] = options["arguments"].concat(originalArgs.slice(pos + 1));
+ break;
+ }
+ isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG));
+ seenNonOptionArg = options["arguments"].length > 0;
+ if (!seenNonOptionArg) {
+ matchedRule = false;
+ _ref = this.rules;
+ for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+ rule = _ref[_j];
+ if (rule.shortFlag === arg || rule.longFlag === arg) {
+ value = true;
+ if (rule.hasArgument) {
+ skippingArgument = true;
+ value = args[i + 1];
+ }
+ options[rule.name] = rule.isList ? (options[rule.name] || []).concat(value) : value;
+ matchedRule = true;
+ break;
+ }
+ }
+ if (isOption && !matchedRule) {
+ throw new Error("unrecognized option: " + arg);
+ }
+ }
+ if (seenNonOptionArg || !isOption) {
+ options["arguments"].push(arg);
+ }
+ }
+ return options;
+ };
+
+ OptionParser.prototype.help = function() {
+ var letPart, lines, rule, spaces, _i, _len, _ref;
+ lines = [];
+ if (this.banner) {
+ lines.unshift("" + this.banner + "\n");
+ }
+ _ref = this.rules;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ rule = _ref[_i];
+ spaces = 15 - rule.longFlag.length;
+ spaces = spaces > 0 ? repeat(' ', spaces) : '';
+ letPart = rule.shortFlag ? rule.shortFlag + ', ' : ' ';
+ lines.push(' ' + letPart + rule.longFlag + spaces + rule.description);
+ }
+ return "\n" + (lines.join('\n')) + "\n";
+ };
+
+ return OptionParser;
+
+ })();
+
+ LONG_FLAG = /^(--\w[\w\-]*)/;
+
+ SHORT_FLAG = /^(-\w)$/;
+
+ MULTI_FLAG = /^-(\w{2,})/;
+
+ OPTIONAL = /\[(\w+(\*?))\]/;
+
+ buildRules = function(rules) {
+ var tuple, _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = rules.length; _i < _len; _i++) {
+ tuple = rules[_i];
+ if (tuple.length < 3) {
+ tuple.unshift(null);
+ }
+ _results.push(buildRule.apply(null, tuple));
+ }
+ return _results;
+ };
+
+ buildRule = function(shortFlag, longFlag, description, options) {
+ var match;
+ if (options == null) {
+ options = {};
+ }
+ match = longFlag.match(OPTIONAL);
+ longFlag = longFlag.match(LONG_FLAG)[1];
+ return {
+ name: longFlag.substr(2),
+ shortFlag: shortFlag,
+ longFlag: longFlag,
+ description: description,
+ hasArgument: !!(match && match[1]),
+ isList: !!(match && match[2])
+ };
+ };
+
+ normalizeArguments = function(args) {
+ var arg, l, match, result, _i, _j, _len, _len1, _ref;
+ args = args.slice(0);
+ result = [];
+ for (_i = 0, _len = args.length; _i < _len; _i++) {
+ arg = args[_i];
+ if (match = arg.match(MULTI_FLAG)) {
+ _ref = match[1].split('');
+ for (_j = 0, _len1 = _ref.length; _j < _len1; _j++) {
+ l = _ref[_j];
+ result.push('-' + l);
+ }
+ } else {
+ result.push(arg);
+ }
+ }
+ return result;
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/parser.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/parser.js
new file mode 100644
index 000000000..724636b5a
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/parser.js
@@ -0,0 +1,724 @@
+/* parser generated by jison 0.4.13 */
+/*
+ Returns a Parser object of the following structure:
+
+ Parser: {
+ yy: {}
+ }
+
+ Parser.prototype: {
+ yy: {},
+ trace: function(),
+ symbols_: {associative list: name ==> number},
+ terminals_: {associative list: number ==> name},
+ productions_: [...],
+ performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate, $$, _$),
+ table: [...],
+ defaultActions: {...},
+ parseError: function(str, hash),
+ parse: function(input),
+
+ lexer: {
+ EOF: 1,
+ parseError: function(str, hash),
+ setInput: function(input),
+ input: function(),
+ unput: function(str),
+ more: function(),
+ less: function(n),
+ pastInput: function(),
+ upcomingInput: function(),
+ showPosition: function(),
+ test_match: function(regex_match_array, rule_index),
+ next: function(),
+ lex: function(),
+ begin: function(condition),
+ popState: function(),
+ _currentRules: function(),
+ topState: function(),
+ pushState: function(condition),
+
+ options: {
+ ranges: boolean (optional: true ==> token location info will include a .range[] member)
+ flex: boolean (optional: true ==> flex-like lexing behaviour where the rules are tested exhaustively to find the longest match)
+ backtrack_lexer: boolean (optional: true ==> lexer regexes are tested in order and for each matching regex the action code is invoked; the lexer terminates the scan when a token is returned by the action code)
+ },
+
+ performAction: function(yy, yy_, $avoiding_name_collisions, YY_START),
+ rules: [...],
+ conditions: {associative list: name ==> set},
+ }
+ }
+
+
+ token location info (@$, _$, etc.): {
+ first_line: n,
+ last_line: n,
+ first_column: n,
+ last_column: n,
+ range: [start_number, end_number] (where the numbers are indexes into the input string, regular zero-based)
+ }
+
+
+ the parseError function receives a 'hash' object with these members for lexer and parser errors: {
+ text: (matched text)
+ token: (the produced terminal token, if any)
+ line: (yylineno)
+ }
+ while parser (grammar) errors will also provide these members, i.e. parser errors deliver a superset of attributes: {
+ loc: (yylloc)
+ expected: (string describing the set of expected tokens)
+ recoverable: (boolean: TRUE when the parser has a error recovery rule available for this particular error)
+ }
+*/
+var parser = (function(){
+var parser = {trace: function trace() { },
+yy: {},
+symbols_: {"error":2,"Root":3,"Body":4,"Line":5,"TERMINATOR":6,"Expression":7,"Statement":8,"Return":9,"Comment":10,"STATEMENT":11,"Value":12,"Invocation":13,"Code":14,"Operation":15,"Assign":16,"If":17,"Try":18,"While":19,"For":20,"Switch":21,"Class":22,"Throw":23,"Block":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,"?::":69,"Index":70,"INDEX_START":71,"IndexValue":72,"INDEX_END":73,"INDEX_SOAK":74,"Slice":75,"{":76,"AssignList":77,"}":78,"CLASS":79,"EXTENDS":80,"OptFuncExist":81,"Arguments":82,"SUPER":83,"FUNC_EXIST":84,"CALL_START":85,"CALL_END":86,"ArgList":87,"THIS":88,"@":89,"[":90,"]":91,"RangeDots":92,"..":93,"Arg":94,"SimpleArgs":95,"TRY":96,"Catch":97,"FINALLY":98,"CATCH":99,"THROW":100,"(":101,")":102,"WhileSource":103,"WHILE":104,"WHEN":105,"UNTIL":106,"Loop":107,"LOOP":108,"ForBody":109,"FOR":110,"ForStart":111,"ForSource":112,"ForVariables":113,"OWN":114,"ForValue":115,"FORIN":116,"FOROF":117,"BY":118,"SWITCH":119,"Whens":120,"ELSE":121,"When":122,"LEADING_WHEN":123,"IfBlock":124,"IF":125,"POST_IF":126,"UNARY":127,"UNARY_MATH":128,"-":129,"+":130,"--":131,"++":132,"?":133,"MATH":134,"**":135,"SHIFT":136,"COMPARE":137,"LOGIC":138,"RELATION":139,"COMPOUND_ASSIGN":140,"$accept":0,"$end":1},
+terminals_: {2:"error",6:"TERMINATOR",11:"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:"::",69:"?::",71:"INDEX_START",73:"INDEX_END",74:"INDEX_SOAK",76:"{",78:"}",79:"CLASS",80:"EXTENDS",83:"SUPER",84:"FUNC_EXIST",85:"CALL_START",86:"CALL_END",88:"THIS",89:"@",90:"[",91:"]",93:"..",96:"TRY",98:"FINALLY",99:"CATCH",100:"THROW",101:"(",102:")",104:"WHILE",105:"WHEN",106:"UNTIL",108:"LOOP",110:"FOR",114:"OWN",116:"FORIN",117:"FOROF",118:"BY",119:"SWITCH",121:"ELSE",123:"LEADING_WHEN",125:"IF",126:"POST_IF",127:"UNARY",128:"UNARY_MATH",129:"-",130:"+",131:"--",132:"++",133:"?",134:"MATH",135:"**",136:"SHIFT",137:"COMPARE",138:"LOGIC",139:"RELATION",140:"COMPOUND_ASSIGN"},
+productions_: [0,[3,0],[3,1],[4,1],[4,3],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[24,2],[24,3],[27,1],[29,1],[29,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[32,1],[16,3],[16,4],[16,5],[41,1],[41,3],[41,5],[41,1],[42,1],[42,1],[42,1],[9,2],[9,1],[10,1],[14,5],[14,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],[55,1],[56,1],[56,1],[56,1],[56,1],[60,2],[61,1],[61,2],[61,2],[61,1],[39,1],[39,1],[39,1],[12,1],[12,1],[12,1],[12,1],[12,1],[62,2],[62,2],[62,2],[62,2],[62,1],[62,1],[70,3],[70,2],[72,1],[72,1],[59,4],[77,0],[77,1],[77,3],[77,4],[77,6],[22,1],[22,2],[22,3],[22,4],[22,2],[22,3],[22,4],[22,5],[13,3],[13,3],[13,1],[13,2],[81,0],[81,1],[82,2],[82,4],[65,1],[65,1],[44,2],[58,2],[58,4],[92,1],[92,1],[64,5],[75,3],[75,2],[75,2],[75,1],[87,1],[87,3],[87,4],[87,4],[87,6],[94,1],[94,1],[94,1],[95,1],[95,3],[18,2],[18,3],[18,4],[18,5],[97,3],[97,3],[97,2],[23,2],[63,3],[63,5],[103,2],[103,4],[103,2],[103,4],[19,2],[19,2],[19,2],[19,1],[107,2],[107,2],[20,2],[20,2],[20,2],[109,2],[109,2],[111,2],[111,3],[115,1],[115,1],[115,1],[115,1],[113,1],[113,3],[112,2],[112,2],[112,4],[112,4],[112,4],[112,6],[112,6],[21,5],[21,7],[21,4],[21,6],[120,1],[120,2],[122,3],[122,4],[124,3],[124,5],[17,1],[17,3],[17,3],[17,3],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,2],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,3],[15,5],[15,4],[15,3]],
+performAction: function anonymous(yytext, yyleng, yylineno, yy, yystate /* action[1] */, $$ /* vstack */, _$ /* lstack */) {
+/* this == yyval */
+
+var $0 = $$.length - 1;
+switch (yystate) {
+case 1:return this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Block);
+break;
+case 2:return this.$ = $$[$0];
+break;
+case 3:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(yy.Block.wrap([$$[$0]]));
+break;
+case 4:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].push($$[$0]));
+break;
+case 5:this.$ = $$[$0-1];
+break;
+case 6:this.$ = $$[$0];
+break;
+case 7:this.$ = $$[$0];
+break;
+case 8:this.$ = $$[$0];
+break;
+case 9:this.$ = $$[$0];
+break;
+case 10:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 11:this.$ = $$[$0];
+break;
+case 12:this.$ = $$[$0];
+break;
+case 13:this.$ = $$[$0];
+break;
+case 14:this.$ = $$[$0];
+break;
+case 15:this.$ = $$[$0];
+break;
+case 16:this.$ = $$[$0];
+break;
+case 17:this.$ = $$[$0];
+break;
+case 18:this.$ = $$[$0];
+break;
+case 19:this.$ = $$[$0];
+break;
+case 20:this.$ = $$[$0];
+break;
+case 21:this.$ = $$[$0];
+break;
+case 22:this.$ = $$[$0];
+break;
+case 23:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Block);
+break;
+case 24:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]);
+break;
+case 25:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 26:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 27:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 28:this.$ = $$[$0];
+break;
+case 29:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 30:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 31:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Literal($$[$0]));
+break;
+case 32:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Undefined);
+break;
+case 33:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Null);
+break;
+case 34:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Bool($$[$0]));
+break;
+case 35:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0]));
+break;
+case 36:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0]));
+break;
+case 37:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1]));
+break;
+case 38:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 39:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-2])(new yy.Value($$[$0-2])), $$[$0], 'object'));
+break;
+case 40:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign(yy.addLocationDataFn(_$[$0-4])(new yy.Value($$[$0-4])), $$[$0-1], 'object'));
+break;
+case 41:this.$ = $$[$0];
+break;
+case 42:this.$ = $$[$0];
+break;
+case 43:this.$ = $$[$0];
+break;
+case 44:this.$ = $$[$0];
+break;
+case 45:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Return($$[$0]));
+break;
+case 46:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Return);
+break;
+case 47:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Comment($$[$0]));
+break;
+case 48:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Code($$[$0-3], $$[$0], $$[$0-1]));
+break;
+case 49:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Code([], $$[$0], $$[$0-1]));
+break;
+case 50:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('func');
+break;
+case 51:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('boundfunc');
+break;
+case 52:this.$ = $$[$0];
+break;
+case 53:this.$ = $$[$0];
+break;
+case 54:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]);
+break;
+case 55:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
+break;
+case 56:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
+break;
+case 57:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
+break;
+case 58:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
+break;
+case 59:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Param($$[$0]));
+break;
+case 60:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Param($$[$0-1], null, true));
+break;
+case 61:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Param($$[$0-2], $$[$0]));
+break;
+case 62:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Expansion);
+break;
+case 63:this.$ = $$[$0];
+break;
+case 64:this.$ = $$[$0];
+break;
+case 65:this.$ = $$[$0];
+break;
+case 66:this.$ = $$[$0];
+break;
+case 67:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Splat($$[$0-1]));
+break;
+case 68:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 69:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].add($$[$0]));
+break;
+case 70:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value($$[$0-1], [].concat($$[$0])));
+break;
+case 71:this.$ = $$[$0];
+break;
+case 72:this.$ = $$[$0];
+break;
+case 73:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 74:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 75:this.$ = $$[$0];
+break;
+case 76:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 77:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 78:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 79:this.$ = $$[$0];
+break;
+case 80:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0]));
+break;
+case 81:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Access($$[$0], 'soak'));
+break;
+case 82:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'))), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]);
+break;
+case 83:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Access(new yy.Literal('prototype'), 'soak')), yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))]);
+break;
+case 84:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Access(new yy.Literal('prototype')));
+break;
+case 85:this.$ = $$[$0];
+break;
+case 86:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-1]);
+break;
+case 87:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(yy.extend($$[$0], {
+ soak: true
+ }));
+break;
+case 88:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Index($$[$0]));
+break;
+case 89:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Slice($$[$0]));
+break;
+case 90:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Obj($$[$0-2], $$[$0-3].generated));
+break;
+case 91:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([]);
+break;
+case 92:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
+break;
+case 93:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
+break;
+case 94:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
+break;
+case 95:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
+break;
+case 96:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Class);
+break;
+case 97:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class(null, null, $$[$0]));
+break;
+case 98:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class(null, $$[$0]));
+break;
+case 99:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class(null, $$[$0-1], $$[$0]));
+break;
+case 100:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Class($$[$0]));
+break;
+case 101:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Class($$[$0-1], null, $$[$0]));
+break;
+case 102:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Class($$[$0-2], $$[$0]));
+break;
+case 103:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Class($$[$0-3], $$[$0-1], $$[$0]));
+break;
+case 104:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1]));
+break;
+case 105:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Call($$[$0-2], $$[$0], $$[$0-1]));
+break;
+case 106:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Call('super', [new yy.Splat(new yy.Literal('arguments'))]));
+break;
+case 107:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Call('super', $$[$0]));
+break;
+case 108:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(false);
+break;
+case 109:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(true);
+break;
+case 110:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([]);
+break;
+case 111:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]);
+break;
+case 112:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this')));
+break;
+case 113:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value(new yy.Literal('this')));
+break;
+case 114:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Value(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('this')), [yy.addLocationDataFn(_$[$0])(new yy.Access($$[$0]))], 'this'));
+break;
+case 115:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Arr([]));
+break;
+case 116:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Arr($$[$0-2]));
+break;
+case 117:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('inclusive');
+break;
+case 118:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])('exclusive');
+break;
+case 119:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Range($$[$0-3], $$[$0-1], $$[$0-2]));
+break;
+case 120:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Range($$[$0-2], $$[$0], $$[$0-1]));
+break;
+case 121:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range($$[$0-1], null, $$[$0]));
+break;
+case 122:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Range(null, $$[$0], $$[$0-1]));
+break;
+case 123:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Range(null, null, $$[$0]));
+break;
+case 124:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
+break;
+case 125:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].concat($$[$0]));
+break;
+case 126:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-3].concat($$[$0]));
+break;
+case 127:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])($$[$0-2]);
+break;
+case 128:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])($$[$0-5].concat($$[$0-2]));
+break;
+case 129:this.$ = $$[$0];
+break;
+case 130:this.$ = $$[$0];
+break;
+case 131:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Expansion);
+break;
+case 132:this.$ = $$[$0];
+break;
+case 133:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([].concat($$[$0-2], $$[$0]));
+break;
+case 134:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Try($$[$0]));
+break;
+case 135:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Try($$[$0-1], $$[$0][0], $$[$0][1]));
+break;
+case 136:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Try($$[$0-2], null, null, $$[$0]));
+break;
+case 137:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Try($$[$0-3], $$[$0-2][0], $$[$0-2][1], $$[$0]));
+break;
+case 138:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-1], $$[$0]]);
+break;
+case 139:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([yy.addLocationDataFn(_$[$0-1])(new yy.Value($$[$0-1])), $$[$0]]);
+break;
+case 140:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])([null, $$[$0]]);
+break;
+case 141:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Throw($$[$0]));
+break;
+case 142:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Parens($$[$0-1]));
+break;
+case 143:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Parens($$[$0-2]));
+break;
+case 144:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0]));
+break;
+case 145:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], {
+ guard: $$[$0]
+ }));
+break;
+case 146:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While($$[$0], {
+ invert: true
+ }));
+break;
+case 147:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.While($$[$0-2], {
+ invert: true,
+ guard: $$[$0]
+ }));
+break;
+case 148:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].addBody($$[$0]));
+break;
+case 149:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]]))));
+break;
+case 150:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0].addBody(yy.addLocationDataFn(_$[$0-1])(yy.Block.wrap([$$[$0-1]]))));
+break;
+case 151:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])($$[$0]);
+break;
+case 152:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody($$[$0]));
+break;
+case 153:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.While(yy.addLocationDataFn(_$[$0-1])(new yy.Literal('true'))).addBody(yy.addLocationDataFn(_$[$0])(yy.Block.wrap([$$[$0]]))));
+break;
+case 154:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0]));
+break;
+case 155:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0-1], $$[$0]));
+break;
+case 156:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.For($$[$0], $$[$0-1]));
+break;
+case 157:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
+ source: yy.addLocationDataFn(_$[$0])(new yy.Value($$[$0]))
+ });
+break;
+case 158:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])((function () {
+ $$[$0].own = $$[$0-1].own;
+ $$[$0].name = $$[$0-1][0];
+ $$[$0].index = $$[$0-1][1];
+ return $$[$0];
+ }()));
+break;
+case 159:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0]);
+break;
+case 160:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () {
+ $$[$0].own = true;
+ return $$[$0];
+ }()));
+break;
+case 161:this.$ = $$[$0];
+break;
+case 162:this.$ = $$[$0];
+break;
+case 163:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 164:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])(new yy.Value($$[$0]));
+break;
+case 165:this.$ = yy.addLocationDataFn(_$[$0], _$[$0])([$$[$0]]);
+break;
+case 166:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([$$[$0-2], $$[$0]]);
+break;
+case 167:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
+ source: $$[$0]
+ });
+break;
+case 168:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])({
+ source: $$[$0],
+ object: true
+ });
+break;
+case 169:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
+ source: $$[$0-2],
+ guard: $$[$0]
+ });
+break;
+case 170:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
+ source: $$[$0-2],
+ guard: $$[$0],
+ object: true
+ });
+break;
+case 171:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])({
+ source: $$[$0-2],
+ step: $$[$0]
+ });
+break;
+case 172:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({
+ source: $$[$0-4],
+ guard: $$[$0-2],
+ step: $$[$0]
+ });
+break;
+case 173:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])({
+ source: $$[$0-4],
+ step: $$[$0-2],
+ guard: $$[$0]
+ });
+break;
+case 174:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Switch($$[$0-3], $$[$0-1]));
+break;
+case 175:this.$ = yy.addLocationDataFn(_$[$0-6], _$[$0])(new yy.Switch($$[$0-5], $$[$0-3], $$[$0-1]));
+break;
+case 176:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Switch(null, $$[$0-1]));
+break;
+case 177:this.$ = yy.addLocationDataFn(_$[$0-5], _$[$0])(new yy.Switch(null, $$[$0-3], $$[$0-1]));
+break;
+case 178:this.$ = $$[$0];
+break;
+case 179:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])($$[$0-1].concat($$[$0]));
+break;
+case 180:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])([[$$[$0-1], $$[$0]]]);
+break;
+case 181:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])([[$$[$0-2], $$[$0-1]]]);
+break;
+case 182:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ }));
+break;
+case 183:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])($$[$0-4].addElse(yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0-1], $$[$0], {
+ type: $$[$0-2]
+ }))));
+break;
+case 184:this.$ = $$[$0];
+break;
+case 185:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])($$[$0-2].addElse($$[$0]));
+break;
+case 186:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), {
+ type: $$[$0-1],
+ statement: true
+ }));
+break;
+case 187:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.If($$[$0], yy.addLocationDataFn(_$[$0-2])(yy.Block.wrap([$$[$0-2]])), {
+ type: $$[$0-1],
+ statement: true
+ }));
+break;
+case 188:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0]));
+break;
+case 189:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op($$[$0-1], $$[$0]));
+break;
+case 190:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('-', $$[$0]));
+break;
+case 191:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('+', $$[$0]));
+break;
+case 192:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0]));
+break;
+case 193:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0]));
+break;
+case 194:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('--', $$[$0-1], null, true));
+break;
+case 195:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Op('++', $$[$0-1], null, true));
+break;
+case 196:this.$ = yy.addLocationDataFn(_$[$0-1], _$[$0])(new yy.Existence($$[$0-1]));
+break;
+case 197:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('+', $$[$0-2], $$[$0]));
+break;
+case 198:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op('-', $$[$0-2], $$[$0]));
+break;
+case 199:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
+break;
+case 200:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
+break;
+case 201:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
+break;
+case 202:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
+break;
+case 203:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Op($$[$0-1], $$[$0-2], $$[$0]));
+break;
+case 204:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])((function () {
+ if ($$[$0-1].charAt(0) === '!') {
+ return new yy.Op($$[$0-1].slice(1), $$[$0-2], $$[$0]).invert();
+ } else {
+ return new yy.Op($$[$0-1], $$[$0-2], $$[$0]);
+ }
+ }()));
+break;
+case 205:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Assign($$[$0-2], $$[$0], $$[$0-1]));
+break;
+case 206:this.$ = yy.addLocationDataFn(_$[$0-4], _$[$0])(new yy.Assign($$[$0-4], $$[$0-1], $$[$0-3]));
+break;
+case 207:this.$ = yy.addLocationDataFn(_$[$0-3], _$[$0])(new yy.Assign($$[$0-3], $$[$0], $$[$0-2]));
+break;
+case 208:this.$ = yy.addLocationDataFn(_$[$0-2], _$[$0])(new yy.Extends($$[$0-2], $$[$0]));
+break;
+}
+},
+table: [{1:[2,1],3:1,4:2,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[3]},{1:[2,2],6:[1,73]},{1:[2,3],6:[2,3],26:[2,3],102:[2,3]},{1:[2,6],6:[2,6],26:[2,6],102:[2,6],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,7],6:[2,7],26:[2,7],102:[2,7],103:87,104:[1,64],106:[1,65],109:88,110:[1,67],111:68,126:[1,86]},{1:[2,11],6:[2,11],25:[2,11],26:[2,11],49:[2,11],54:[2,11],57:[2,11],62:90,66:[1,92],67:[1,93],68:[1,94],69:[1,95],70:96,71:[1,97],73:[2,11],74:[1,98],78:[2,11],81:89,84:[1,91],85:[2,108],86:[2,11],91:[2,11],93:[2,11],102:[2,11],104:[2,11],105:[2,11],106:[2,11],110:[2,11],118:[2,11],126:[2,11],129:[2,11],130:[2,11],133:[2,11],134:[2,11],135:[2,11],136:[2,11],137:[2,11],138:[2,11],139:[2,11]},{1:[2,12],6:[2,12],25:[2,12],26:[2,12],49:[2,12],54:[2,12],57:[2,12],62:100,66:[1,92],67:[1,93],68:[1,94],69:[1,95],70:96,71:[1,97],73:[2,12],74:[1,98],78:[2,12],81:99,84:[1,91],85:[2,108],86:[2,12],91:[2,12],93:[2,12],102:[2,12],104:[2,12],105:[2,12],106:[2,12],110:[2,12],118:[2,12],126:[2,12],129:[2,12],130:[2,12],133:[2,12],134:[2,12],135:[2,12],136:[2,12],137:[2,12],138:[2,12],139:[2,12]},{1:[2,13],6:[2,13],25:[2,13],26:[2,13],49:[2,13],54:[2,13],57:[2,13],73:[2,13],78:[2,13],86:[2,13],91:[2,13],93:[2,13],102:[2,13],104:[2,13],105:[2,13],106:[2,13],110:[2,13],118:[2,13],126:[2,13],129:[2,13],130:[2,13],133:[2,13],134:[2,13],135:[2,13],136:[2,13],137:[2,13],138:[2,13],139:[2,13]},{1:[2,14],6:[2,14],25:[2,14],26:[2,14],49:[2,14],54:[2,14],57:[2,14],73:[2,14],78:[2,14],86:[2,14],91:[2,14],93:[2,14],102:[2,14],104:[2,14],105:[2,14],106:[2,14],110:[2,14],118:[2,14],126:[2,14],129:[2,14],130:[2,14],133:[2,14],134:[2,14],135:[2,14],136:[2,14],137:[2,14],138:[2,14],139:[2,14]},{1:[2,15],6:[2,15],25:[2,15],26:[2,15],49:[2,15],54:[2,15],57:[2,15],73:[2,15],78:[2,15],86:[2,15],91:[2,15],93:[2,15],102:[2,15],104:[2,15],105:[2,15],106:[2,15],110:[2,15],118:[2,15],126:[2,15],129:[2,15],130:[2,15],133:[2,15],134:[2,15],135:[2,15],136:[2,15],137:[2,15],138:[2,15],139:[2,15]},{1:[2,16],6:[2,16],25:[2,16],26:[2,16],49:[2,16],54:[2,16],57:[2,16],73:[2,16],78:[2,16],86:[2,16],91:[2,16],93:[2,16],102:[2,16],104:[2,16],105:[2,16],106:[2,16],110:[2,16],118:[2,16],126:[2,16],129:[2,16],130:[2,16],133:[2,16],134:[2,16],135:[2,16],136:[2,16],137:[2,16],138:[2,16],139:[2,16]},{1:[2,17],6:[2,17],25:[2,17],26:[2,17],49:[2,17],54:[2,17],57:[2,17],73:[2,17],78:[2,17],86:[2,17],91:[2,17],93:[2,17],102:[2,17],104:[2,17],105:[2,17],106:[2,17],110:[2,17],118:[2,17],126:[2,17],129:[2,17],130:[2,17],133:[2,17],134:[2,17],135:[2,17],136:[2,17],137:[2,17],138:[2,17],139:[2,17]},{1:[2,18],6:[2,18],25:[2,18],26:[2,18],49:[2,18],54:[2,18],57:[2,18],73:[2,18],78:[2,18],86:[2,18],91:[2,18],93:[2,18],102:[2,18],104:[2,18],105:[2,18],106:[2,18],110:[2,18],118:[2,18],126:[2,18],129:[2,18],130:[2,18],133:[2,18],134:[2,18],135:[2,18],136:[2,18],137:[2,18],138:[2,18],139:[2,18]},{1:[2,19],6:[2,19],25:[2,19],26:[2,19],49:[2,19],54:[2,19],57:[2,19],73:[2,19],78:[2,19],86:[2,19],91:[2,19],93:[2,19],102:[2,19],104:[2,19],105:[2,19],106:[2,19],110:[2,19],118:[2,19],126:[2,19],129:[2,19],130:[2,19],133:[2,19],134:[2,19],135:[2,19],136:[2,19],137:[2,19],138:[2,19],139:[2,19]},{1:[2,20],6:[2,20],25:[2,20],26:[2,20],49:[2,20],54:[2,20],57:[2,20],73:[2,20],78:[2,20],86:[2,20],91:[2,20],93:[2,20],102:[2,20],104:[2,20],105:[2,20],106:[2,20],110:[2,20],118:[2,20],126:[2,20],129:[2,20],130:[2,20],133:[2,20],134:[2,20],135:[2,20],136:[2,20],137:[2,20],138:[2,20],139:[2,20]},{1:[2,21],6:[2,21],25:[2,21],26:[2,21],49:[2,21],54:[2,21],57:[2,21],73:[2,21],78:[2,21],86:[2,21],91:[2,21],93:[2,21],102:[2,21],104:[2,21],105:[2,21],106:[2,21],110:[2,21],118:[2,21],126:[2,21],129:[2,21],130:[2,21],133:[2,21],134:[2,21],135:[2,21],136:[2,21],137:[2,21],138:[2,21],139:[2,21]},{1:[2,22],6:[2,22],25:[2,22],26:[2,22],49:[2,22],54:[2,22],57:[2,22],73:[2,22],78:[2,22],86:[2,22],91:[2,22],93:[2,22],102:[2,22],104:[2,22],105:[2,22],106:[2,22],110:[2,22],118:[2,22],126:[2,22],129:[2,22],130:[2,22],133:[2,22],134:[2,22],135:[2,22],136:[2,22],137:[2,22],138:[2,22],139:[2,22]},{1:[2,8],6:[2,8],26:[2,8],102:[2,8],104:[2,8],106:[2,8],110:[2,8],126:[2,8]},{1:[2,9],6:[2,9],26:[2,9],102:[2,9],104:[2,9],106:[2,9],110:[2,9],126:[2,9]},{1:[2,10],6:[2,10],26:[2,10],102:[2,10],104:[2,10],106:[2,10],110:[2,10],126:[2,10]},{1:[2,75],6:[2,75],25:[2,75],26:[2,75],40:[1,101],49:[2,75],54:[2,75],57:[2,75],66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],73:[2,75],74:[2,75],78:[2,75],84:[2,75],85:[2,75],86:[2,75],91:[2,75],93:[2,75],102:[2,75],104:[2,75],105:[2,75],106:[2,75],110:[2,75],118:[2,75],126:[2,75],129:[2,75],130:[2,75],133:[2,75],134:[2,75],135:[2,75],136:[2,75],137:[2,75],138:[2,75],139:[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],69:[2,76],71:[2,76],73:[2,76],74:[2,76],78:[2,76],84:[2,76],85:[2,76],86:[2,76],91:[2,76],93:[2,76],102:[2,76],104:[2,76],105:[2,76],106:[2,76],110:[2,76],118:[2,76],126:[2,76],129:[2,76],130:[2,76],133:[2,76],134:[2,76],135:[2,76],136:[2,76],137:[2,76],138:[2,76],139:[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],69:[2,77],71:[2,77],73:[2,77],74:[2,77],78:[2,77],84:[2,77],85:[2,77],86:[2,77],91:[2,77],93:[2,77],102:[2,77],104:[2,77],105:[2,77],106:[2,77],110:[2,77],118:[2,77],126:[2,77],129:[2,77],130:[2,77],133:[2,77],134:[2,77],135:[2,77],136:[2,77],137:[2,77],138:[2,77],139:[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],69:[2,78],71:[2,78],73:[2,78],74:[2,78],78:[2,78],84:[2,78],85:[2,78],86:[2,78],91:[2,78],93:[2,78],102:[2,78],104:[2,78],105:[2,78],106:[2,78],110:[2,78],118:[2,78],126:[2,78],129:[2,78],130:[2,78],133:[2,78],134:[2,78],135:[2,78],136:[2,78],137:[2,78],138:[2,78],139:[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],69:[2,79],71:[2,79],73:[2,79],74:[2,79],78:[2,79],84:[2,79],85:[2,79],86:[2,79],91:[2,79],93:[2,79],102:[2,79],104:[2,79],105:[2,79],106:[2,79],110:[2,79],118:[2,79],126:[2,79],129:[2,79],130:[2,79],133:[2,79],134:[2,79],135:[2,79],136:[2,79],137:[2,79],138:[2,79],139:[2,79]},{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],69:[2,106],71:[2,106],73:[2,106],74:[2,106],78:[2,106],82:102,84:[2,106],85:[1,103],86:[2,106],91:[2,106],93:[2,106],102:[2,106],104:[2,106],105:[2,106],106:[2,106],110:[2,106],118:[2,106],126:[2,106],129:[2,106],130:[2,106],133:[2,106],134:[2,106],135:[2,106],136:[2,106],137:[2,106],138:[2,106],139:[2,106]},{6:[2,54],25:[2,54],27:108,28:[1,72],44:109,48:104,49:[2,54],54:[2,54],55:105,56:106,57:[1,107],58:110,59:111,76:[1,69],89:[1,112],90:[1,113]},{24:114,25:[1,115]},{7:116,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:118,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:119,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:120,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{12:122,13:123,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:124,44:62,58:46,59:47,61:121,63:23,64:24,65:25,76:[1,69],83:[1,26],88:[1,57],89:[1,58],90:[1,56],101:[1,55]},{12:122,13:123,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:124,44:62,58:46,59:47,61:125,63:23,64:24,65:25,76:[1,69],83:[1,26],88:[1,57],89:[1,58],90:[1,56],101:[1,55]},{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],69:[2,72],71:[2,72],73:[2,72],74:[2,72],78:[2,72],80:[1,129],84:[2,72],85:[2,72],86:[2,72],91:[2,72],93:[2,72],102:[2,72],104:[2,72],105:[2,72],106:[2,72],110:[2,72],118:[2,72],126:[2,72],129:[2,72],130:[2,72],131:[1,126],132:[1,127],133:[2,72],134:[2,72],135:[2,72],136:[2,72],137:[2,72],138:[2,72],139:[2,72],140:[1,128]},{1:[2,184],6:[2,184],25:[2,184],26:[2,184],49:[2,184],54:[2,184],57:[2,184],73:[2,184],78:[2,184],86:[2,184],91:[2,184],93:[2,184],102:[2,184],104:[2,184],105:[2,184],106:[2,184],110:[2,184],118:[2,184],121:[1,130],126:[2,184],129:[2,184],130:[2,184],133:[2,184],134:[2,184],135:[2,184],136:[2,184],137:[2,184],138:[2,184],139:[2,184]},{24:131,25:[1,115]},{24:132,25:[1,115]},{1:[2,151],6:[2,151],25:[2,151],26:[2,151],49:[2,151],54:[2,151],57:[2,151],73:[2,151],78:[2,151],86:[2,151],91:[2,151],93:[2,151],102:[2,151],104:[2,151],105:[2,151],106:[2,151],110:[2,151],118:[2,151],126:[2,151],129:[2,151],130:[2,151],133:[2,151],134:[2,151],135:[2,151],136:[2,151],137:[2,151],138:[2,151],139:[2,151]},{24:133,25:[1,115]},{7:134,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,135],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,96],6:[2,96],12:122,13:123,24:136,25:[1,115],26:[2,96],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:124,44:62,49:[2,96],54:[2,96],57:[2,96],58:46,59:47,61:138,63:23,64:24,65:25,73:[2,96],76:[1,69],78:[2,96],80:[1,137],83:[1,26],86:[2,96],88:[1,57],89:[1,58],90:[1,56],91:[2,96],93:[2,96],101:[1,55],102:[2,96],104:[2,96],105:[2,96],106:[2,96],110:[2,96],118:[2,96],126:[2,96],129:[2,96],130:[2,96],133:[2,96],134:[2,96],135:[2,96],136:[2,96],137:[2,96],138:[2,96],139:[2,96]},{7:139,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,46],6:[2,46],7:140,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,46],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],102:[2,46],103:38,104:[2,46],106:[2,46],107:39,108:[1,66],109:40,110:[2,46],111:68,119:[1,41],124:36,125:[1,63],126:[2,46],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,47],6:[2,47],25:[2,47],26:[2,47],54:[2,47],78:[2,47],102:[2,47],104:[2,47],106:[2,47],110:[2,47],126:[2,47]},{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],69:[2,73],71:[2,73],73:[2,73],74:[2,73],78:[2,73],84:[2,73],85:[2,73],86:[2,73],91:[2,73],93:[2,73],102:[2,73],104:[2,73],105:[2,73],106:[2,73],110:[2,73],118:[2,73],126:[2,73],129:[2,73],130:[2,73],133:[2,73],134:[2,73],135:[2,73],136:[2,73],137:[2,73],138:[2,73],139:[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],69:[2,74],71:[2,74],73:[2,74],74:[2,74],78:[2,74],84:[2,74],85:[2,74],86:[2,74],91:[2,74],93:[2,74],102:[2,74],104:[2,74],105:[2,74],106:[2,74],110:[2,74],118:[2,74],126:[2,74],129:[2,74],130:[2,74],133:[2,74],134:[2,74],135:[2,74],136:[2,74],137:[2,74],138:[2,74],139:[2,74]},{1:[2,28],6:[2,28],25:[2,28],26:[2,28],49:[2,28],54:[2,28],57:[2,28],66:[2,28],67:[2,28],68:[2,28],69:[2,28],71:[2,28],73:[2,28],74:[2,28],78:[2,28],84:[2,28],85:[2,28],86:[2,28],91:[2,28],93:[2,28],102:[2,28],104:[2,28],105:[2,28],106:[2,28],110:[2,28],118:[2,28],126:[2,28],129:[2,28],130:[2,28],133:[2,28],134:[2,28],135:[2,28],136:[2,28],137:[2,28],138:[2,28],139:[2,28]},{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],69:[2,29],71:[2,29],73:[2,29],74:[2,29],78:[2,29],84:[2,29],85:[2,29],86:[2,29],91:[2,29],93:[2,29],102:[2,29],104:[2,29],105:[2,29],106:[2,29],110:[2,29],118:[2,29],126:[2,29],129:[2,29],130:[2,29],133:[2,29],134:[2,29],135:[2,29],136:[2,29],137:[2,29],138:[2,29],139:[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],69:[2,30],71:[2,30],73:[2,30],74:[2,30],78:[2,30],84:[2,30],85:[2,30],86:[2,30],91:[2,30],93:[2,30],102:[2,30],104:[2,30],105:[2,30],106:[2,30],110:[2,30],118:[2,30],126:[2,30],129:[2,30],130:[2,30],133:[2,30],134:[2,30],135:[2,30],136:[2,30],137:[2,30],138:[2,30],139:[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],69:[2,31],71:[2,31],73:[2,31],74:[2,31],78:[2,31],84:[2,31],85:[2,31],86:[2,31],91:[2,31],93:[2,31],102:[2,31],104:[2,31],105:[2,31],106:[2,31],110:[2,31],118:[2,31],126:[2,31],129:[2,31],130:[2,31],133:[2,31],134:[2,31],135:[2,31],136:[2,31],137:[2,31],138:[2,31],139:[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],69:[2,32],71:[2,32],73:[2,32],74:[2,32],78:[2,32],84:[2,32],85:[2,32],86:[2,32],91:[2,32],93:[2,32],102:[2,32],104:[2,32],105:[2,32],106:[2,32],110:[2,32],118:[2,32],126:[2,32],129:[2,32],130:[2,32],133:[2,32],134:[2,32],135:[2,32],136:[2,32],137:[2,32],138:[2,32],139:[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],69:[2,33],71:[2,33],73:[2,33],74:[2,33],78:[2,33],84:[2,33],85:[2,33],86:[2,33],91:[2,33],93:[2,33],102:[2,33],104:[2,33],105:[2,33],106:[2,33],110:[2,33],118:[2,33],126:[2,33],129:[2,33],130:[2,33],133:[2,33],134:[2,33],135:[2,33],136:[2,33],137:[2,33],138:[2,33],139:[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],69:[2,34],71:[2,34],73:[2,34],74:[2,34],78:[2,34],84:[2,34],85:[2,34],86:[2,34],91:[2,34],93:[2,34],102:[2,34],104:[2,34],105:[2,34],106:[2,34],110:[2,34],118:[2,34],126:[2,34],129:[2,34],130:[2,34],133:[2,34],134:[2,34],135:[2,34],136:[2,34],137:[2,34],138:[2,34],139:[2,34]},{4:141,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,142],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:143,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,147],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],87:145,88:[1,57],89:[1,58],90:[1,56],91:[1,144],94:146,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,112],6:[2,112],25:[2,112],26:[2,112],49:[2,112],54:[2,112],57:[2,112],66:[2,112],67:[2,112],68:[2,112],69:[2,112],71:[2,112],73:[2,112],74:[2,112],78:[2,112],84:[2,112],85:[2,112],86:[2,112],91:[2,112],93:[2,112],102:[2,112],104:[2,112],105:[2,112],106:[2,112],110:[2,112],118:[2,112],126:[2,112],129:[2,112],130:[2,112],133:[2,112],134:[2,112],135:[2,112],136:[2,112],137:[2,112],138:[2,112],139:[2,112]},{1:[2,113],6:[2,113],25:[2,113],26:[2,113],27:150,28:[1,72],49:[2,113],54:[2,113],57:[2,113],66:[2,113],67:[2,113],68:[2,113],69:[2,113],71:[2,113],73:[2,113],74:[2,113],78:[2,113],84:[2,113],85:[2,113],86:[2,113],91:[2,113],93:[2,113],102:[2,113],104:[2,113],105:[2,113],106:[2,113],110:[2,113],118:[2,113],126:[2,113],129:[2,113],130:[2,113],133:[2,113],134:[2,113],135:[2,113],136:[2,113],137:[2,113],138:[2,113],139:[2,113]},{25:[2,50]},{25:[2,51]},{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],69:[2,68],71:[2,68],73:[2,68],74:[2,68],78:[2,68],80:[2,68],84:[2,68],85:[2,68],86:[2,68],91:[2,68],93:[2,68],102:[2,68],104:[2,68],105:[2,68],106:[2,68],110:[2,68],118:[2,68],126:[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],138:[2,68],139:[2,68],140:[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],69:[2,71],71:[2,71],73:[2,71],74:[2,71],78:[2,71],80:[2,71],84:[2,71],85:[2,71],86:[2,71],91:[2,71],93:[2,71],102:[2,71],104:[2,71],105:[2,71],106:[2,71],110:[2,71],118:[2,71],126:[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],138:[2,71],139:[2,71],140:[2,71]},{7:151,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:152,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:153,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:155,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,24:154,25:[1,115],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{27:160,28:[1,72],44:161,58:162,59:163,64:156,76:[1,69],89:[1,112],90:[1,56],113:157,114:[1,158],115:159},{112:164,116:[1,165],117:[1,166]},{6:[2,91],10:170,25:[2,91],27:171,28:[1,72],29:172,30:[1,70],31:[1,71],41:168,42:169,44:173,46:[1,45],54:[2,91],77:167,78:[2,91],89:[1,112]},{1:[2,26],6:[2,26],25:[2,26],26:[2,26],43:[2,26],49:[2,26],54:[2,26],57:[2,26],66:[2,26],67:[2,26],68:[2,26],69:[2,26],71:[2,26],73:[2,26],74:[2,26],78:[2,26],84:[2,26],85:[2,26],86:[2,26],91:[2,26],93:[2,26],102:[2,26],104:[2,26],105:[2,26],106:[2,26],110:[2,26],118:[2,26],126:[2,26],129:[2,26],130:[2,26],133:[2,26],134:[2,26],135:[2,26],136:[2,26],137:[2,26],138:[2,26],139:[2,26]},{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],69:[2,27],71:[2,27],73:[2,27],74:[2,27],78:[2,27],84:[2,27],85:[2,27],86:[2,27],91:[2,27],93:[2,27],102:[2,27],104:[2,27],105:[2,27],106:[2,27],110:[2,27],118:[2,27],126:[2,27],129:[2,27],130:[2,27],133:[2,27],134:[2,27],135:[2,27],136:[2,27],137:[2,27],138:[2,27],139:[2,27]},{1:[2,25],6:[2,25],25:[2,25],26:[2,25],40:[2,25],43:[2,25],49:[2,25],54:[2,25],57:[2,25],66:[2,25],67:[2,25],68:[2,25],69:[2,25],71:[2,25],73:[2,25],74:[2,25],78:[2,25],80:[2,25],84:[2,25],85:[2,25],86:[2,25],91:[2,25],93:[2,25],102:[2,25],104:[2,25],105:[2,25],106:[2,25],110:[2,25],116:[2,25],117:[2,25],118:[2,25],126:[2,25],129:[2,25],130:[2,25],131:[2,25],132:[2,25],133:[2,25],134:[2,25],135:[2,25],136:[2,25],137:[2,25],138:[2,25],139:[2,25],140:[2,25]},{1:[2,5],5:174,6:[2,5],7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[2,5],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],102:[2,5],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,196],6:[2,196],25:[2,196],26:[2,196],49:[2,196],54:[2,196],57:[2,196],73:[2,196],78:[2,196],86:[2,196],91:[2,196],93:[2,196],102:[2,196],104:[2,196],105:[2,196],106:[2,196],110:[2,196],118:[2,196],126:[2,196],129:[2,196],130:[2,196],133:[2,196],134:[2,196],135:[2,196],136:[2,196],137:[2,196],138:[2,196],139:[2,196]},{7:175,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:176,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:177,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:178,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:179,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:180,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:181,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:182,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:183,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,150],6:[2,150],25:[2,150],26:[2,150],49:[2,150],54:[2,150],57:[2,150],73:[2,150],78:[2,150],86:[2,150],91:[2,150],93:[2,150],102:[2,150],104:[2,150],105:[2,150],106:[2,150],110:[2,150],118:[2,150],126:[2,150],129:[2,150],130:[2,150],133:[2,150],134:[2,150],135:[2,150],136:[2,150],137:[2,150],138:[2,150],139:[2,150]},{1:[2,155],6:[2,155],25:[2,155],26:[2,155],49:[2,155],54:[2,155],57:[2,155],73:[2,155],78:[2,155],86:[2,155],91:[2,155],93:[2,155],102:[2,155],104:[2,155],105:[2,155],106:[2,155],110:[2,155],118:[2,155],126:[2,155],129:[2,155],130:[2,155],133:[2,155],134:[2,155],135:[2,155],136:[2,155],137:[2,155],138:[2,155],139:[2,155]},{7:184,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,149],6:[2,149],25:[2,149],26:[2,149],49:[2,149],54:[2,149],57:[2,149],73:[2,149],78:[2,149],86:[2,149],91:[2,149],93:[2,149],102:[2,149],104:[2,149],105:[2,149],106:[2,149],110:[2,149],118:[2,149],126:[2,149],129:[2,149],130:[2,149],133:[2,149],134:[2,149],135:[2,149],136:[2,149],137:[2,149],138:[2,149],139:[2,149]},{1:[2,154],6:[2,154],25:[2,154],26:[2,154],49:[2,154],54:[2,154],57:[2,154],73:[2,154],78:[2,154],86:[2,154],91:[2,154],93:[2,154],102:[2,154],104:[2,154],105:[2,154],106:[2,154],110:[2,154],118:[2,154],126:[2,154],129:[2,154],130:[2,154],133:[2,154],134:[2,154],135:[2,154],136:[2,154],137:[2,154],138:[2,154],139:[2,154]},{82:185,85:[1,103]},{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],69:[2,69],71:[2,69],73:[2,69],74:[2,69],78:[2,69],80:[2,69],84:[2,69],85:[2,69],86:[2,69],91:[2,69],93:[2,69],102:[2,69],104:[2,69],105:[2,69],106:[2,69],110:[2,69],118:[2,69],126:[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],138:[2,69],139:[2,69],140:[2,69]},{85:[2,109]},{27:186,28:[1,72]},{27:187,28:[1,72]},{1:[2,84],6:[2,84],25:[2,84],26:[2,84],27:188,28:[1,72],40:[2,84],49:[2,84],54:[2,84],57:[2,84],66:[2,84],67:[2,84],68:[2,84],69:[2,84],71:[2,84],73:[2,84],74:[2,84],78:[2,84],80:[2,84],84:[2,84],85:[2,84],86:[2,84],91:[2,84],93:[2,84],102:[2,84],104:[2,84],105:[2,84],106:[2,84],110:[2,84],118:[2,84],126:[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],138:[2,84],139:[2,84],140:[2,84]},{27:189,28:[1,72]},{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],69:[2,85],71:[2,85],73:[2,85],74:[2,85],78:[2,85],80:[2,85],84:[2,85],85:[2,85],86:[2,85],91:[2,85],93:[2,85],102:[2,85],104:[2,85],105:[2,85],106:[2,85],110:[2,85],118:[2,85],126:[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],138:[2,85],139:[2,85],140:[2,85]},{7:191,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,195],58:46,59:47,61:35,63:23,64:24,65:25,72:190,75:192,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],92:193,93:[1,194],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{70:196,71:[1,97],74:[1,98]},{82:197,85:[1,103]},{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],69:[2,70],71:[2,70],73:[2,70],74:[2,70],78:[2,70],80:[2,70],84:[2,70],85:[2,70],86:[2,70],91:[2,70],93:[2,70],102:[2,70],104:[2,70],105:[2,70],106:[2,70],110:[2,70],118:[2,70],126:[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],138:[2,70],139:[2,70],140:[2,70]},{6:[1,199],7:198,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,200],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,107],6:[2,107],25:[2,107],26:[2,107],49:[2,107],54:[2,107],57:[2,107],66:[2,107],67:[2,107],68:[2,107],69:[2,107],71:[2,107],73:[2,107],74:[2,107],78:[2,107],84:[2,107],85:[2,107],86:[2,107],91:[2,107],93:[2,107],102:[2,107],104:[2,107],105:[2,107],106:[2,107],110:[2,107],118:[2,107],126:[2,107],129:[2,107],130:[2,107],133:[2,107],134:[2,107],135:[2,107],136:[2,107],137:[2,107],138:[2,107],139:[2,107]},{7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,147],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],86:[1,201],87:202,88:[1,57],89:[1,58],90:[1,56],94:146,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,52],25:[2,52],49:[1,204],53:206,54:[1,205]},{6:[2,55],25:[2,55],26:[2,55],49:[2,55],54:[2,55]},{6:[2,59],25:[2,59],26:[2,59],40:[1,208],49:[2,59],54:[2,59],57:[1,207]},{6:[2,62],25:[2,62],26:[2,62],49:[2,62],54:[2,62]},{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:150,28:[1,72]},{7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,147],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],87:145,88:[1,57],89:[1,58],90:[1,56],91:[1,144],94:146,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,49],6:[2,49],25:[2,49],26:[2,49],49:[2,49],54:[2,49],57:[2,49],73:[2,49],78:[2,49],86:[2,49],91:[2,49],93:[2,49],102:[2,49],104:[2,49],105:[2,49],106:[2,49],110:[2,49],118:[2,49],126:[2,49],129:[2,49],130:[2,49],133:[2,49],134:[2,49],135:[2,49],136:[2,49],137:[2,49],138:[2,49],139:[2,49]},{4:210,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,26:[1,209],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,188],6:[2,188],25:[2,188],26:[2,188],49:[2,188],54:[2,188],57:[2,188],73:[2,188],78:[2,188],86:[2,188],91:[2,188],93:[2,188],102:[2,188],103:84,104:[2,188],105:[2,188],106:[2,188],109:85,110:[2,188],111:68,118:[2,188],126:[2,188],129:[2,188],130:[2,188],133:[1,74],134:[2,188],135:[2,188],136:[2,188],137:[2,188],138:[2,188],139:[2,188]},{103:87,104:[1,64],106:[1,65],109:88,110:[1,67],111:68,126:[1,86]},{1:[2,189],6:[2,189],25:[2,189],26:[2,189],49:[2,189],54:[2,189],57:[2,189],73:[2,189],78:[2,189],86:[2,189],91:[2,189],93:[2,189],102:[2,189],103:84,104:[2,189],105:[2,189],106:[2,189],109:85,110:[2,189],111:68,118:[2,189],126:[2,189],129:[2,189],130:[2,189],133:[1,74],134:[2,189],135:[1,78],136:[2,189],137:[2,189],138:[2,189],139:[2,189]},{1:[2,190],6:[2,190],25:[2,190],26:[2,190],49:[2,190],54:[2,190],57:[2,190],73:[2,190],78:[2,190],86:[2,190],91:[2,190],93:[2,190],102:[2,190],103:84,104:[2,190],105:[2,190],106:[2,190],109:85,110:[2,190],111:68,118:[2,190],126:[2,190],129:[2,190],130:[2,190],133:[1,74],134:[2,190],135:[1,78],136:[2,190],137:[2,190],138:[2,190],139:[2,190]},{1:[2,191],6:[2,191],25:[2,191],26:[2,191],49:[2,191],54:[2,191],57:[2,191],73:[2,191],78:[2,191],86:[2,191],91:[2,191],93:[2,191],102:[2,191],103:84,104:[2,191],105:[2,191],106:[2,191],109:85,110:[2,191],111:68,118:[2,191],126:[2,191],129:[2,191],130:[2,191],133:[1,74],134:[2,191],135:[1,78],136:[2,191],137:[2,191],138:[2,191],139:[2,191]},{1:[2,192],6:[2,192],25:[2,192],26:[2,192],49:[2,192],54:[2,192],57:[2,192],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,192],74:[2,72],78:[2,192],84:[2,72],85:[2,72],86:[2,192],91:[2,192],93:[2,192],102:[2,192],104:[2,192],105:[2,192],106:[2,192],110:[2,192],118:[2,192],126:[2,192],129:[2,192],130:[2,192],133:[2,192],134:[2,192],135:[2,192],136:[2,192],137:[2,192],138:[2,192],139:[2,192]},{62:90,66:[1,92],67:[1,93],68:[1,94],69:[1,95],70:96,71:[1,97],74:[1,98],81:89,84:[1,91],85:[2,108]},{62:100,66:[1,92],67:[1,93],68:[1,94],69:[1,95],70:96,71:[1,97],74:[1,98],81:99,84:[1,91],85:[2,108]},{66:[2,75],67:[2,75],68:[2,75],69:[2,75],71:[2,75],74:[2,75],84:[2,75],85:[2,75]},{1:[2,193],6:[2,193],25:[2,193],26:[2,193],49:[2,193],54:[2,193],57:[2,193],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,193],74:[2,72],78:[2,193],84:[2,72],85:[2,72],86:[2,193],91:[2,193],93:[2,193],102:[2,193],104:[2,193],105:[2,193],106:[2,193],110:[2,193],118:[2,193],126:[2,193],129:[2,193],130:[2,193],133:[2,193],134:[2,193],135:[2,193],136:[2,193],137:[2,193],138:[2,193],139:[2,193]},{1:[2,194],6:[2,194],25:[2,194],26:[2,194],49:[2,194],54:[2,194],57:[2,194],73:[2,194],78:[2,194],86:[2,194],91:[2,194],93:[2,194],102:[2,194],104:[2,194],105:[2,194],106:[2,194],110:[2,194],118:[2,194],126:[2,194],129:[2,194],130:[2,194],133:[2,194],134:[2,194],135:[2,194],136:[2,194],137:[2,194],138:[2,194],139:[2,194]},{1:[2,195],6:[2,195],25:[2,195],26:[2,195],49:[2,195],54:[2,195],57:[2,195],73:[2,195],78:[2,195],86:[2,195],91:[2,195],93:[2,195],102:[2,195],104:[2,195],105:[2,195],106:[2,195],110:[2,195],118:[2,195],126:[2,195],129:[2,195],130:[2,195],133:[2,195],134:[2,195],135:[2,195],136:[2,195],137:[2,195],138:[2,195],139:[2,195]},{6:[1,213],7:211,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,212],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:214,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{24:215,25:[1,115],125:[1,216]},{1:[2,134],6:[2,134],25:[2,134],26:[2,134],49:[2,134],54:[2,134],57:[2,134],73:[2,134],78:[2,134],86:[2,134],91:[2,134],93:[2,134],97:217,98:[1,218],99:[1,219],102:[2,134],104:[2,134],105:[2,134],106:[2,134],110:[2,134],118:[2,134],126:[2,134],129:[2,134],130:[2,134],133:[2,134],134:[2,134],135:[2,134],136:[2,134],137:[2,134],138:[2,134],139:[2,134]},{1:[2,148],6:[2,148],25:[2,148],26:[2,148],49:[2,148],54:[2,148],57:[2,148],73:[2,148],78:[2,148],86:[2,148],91:[2,148],93:[2,148],102:[2,148],104:[2,148],105:[2,148],106:[2,148],110:[2,148],118:[2,148],126:[2,148],129:[2,148],130:[2,148],133:[2,148],134:[2,148],135:[2,148],136:[2,148],137:[2,148],138:[2,148],139:[2,148]},{1:[2,156],6:[2,156],25:[2,156],26:[2,156],49:[2,156],54:[2,156],57:[2,156],73:[2,156],78:[2,156],86:[2,156],91:[2,156],93:[2,156],102:[2,156],104:[2,156],105:[2,156],106:[2,156],110:[2,156],118:[2,156],126:[2,156],129:[2,156],130:[2,156],133:[2,156],134:[2,156],135:[2,156],136:[2,156],137:[2,156],138:[2,156],139:[2,156]},{25:[1,220],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{120:221,122:222,123:[1,223]},{1:[2,97],6:[2,97],25:[2,97],26:[2,97],49:[2,97],54:[2,97],57:[2,97],73:[2,97],78:[2,97],86:[2,97],91:[2,97],93:[2,97],102:[2,97],104:[2,97],105:[2,97],106:[2,97],110:[2,97],118:[2,97],126:[2,97],129:[2,97],130:[2,97],133:[2,97],134:[2,97],135:[2,97],136:[2,97],137:[2,97],138:[2,97],139:[2,97]},{7:224,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,100],6:[2,100],24:225,25:[1,115],26:[2,100],49:[2,100],54:[2,100],57:[2,100],66:[2,72],67:[2,72],68:[2,72],69:[2,72],71:[2,72],73:[2,100],74:[2,72],78:[2,100],80:[1,226],84:[2,72],85:[2,72],86:[2,100],91:[2,100],93:[2,100],102:[2,100],104:[2,100],105:[2,100],106:[2,100],110:[2,100],118:[2,100],126:[2,100],129:[2,100],130:[2,100],133:[2,100],134:[2,100],135:[2,100],136:[2,100],137:[2,100],138:[2,100],139:[2,100]},{1:[2,141],6:[2,141],25:[2,141],26:[2,141],49:[2,141],54:[2,141],57:[2,141],73:[2,141],78:[2,141],86:[2,141],91:[2,141],93:[2,141],102:[2,141],103:84,104:[2,141],105:[2,141],106:[2,141],109:85,110:[2,141],111:68,118:[2,141],126:[2,141],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,45],6:[2,45],26:[2,45],102:[2,45],103:84,104:[2,45],106:[2,45],109:85,110:[2,45],111:68,126:[2,45],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[1,73],102:[1,227]},{4:228,5:3,7:4,8:5,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,129],25:[2,129],54:[2,129],57:[1,230],91:[2,129],92:229,93:[1,194],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{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],69:[2,115],71:[2,115],73:[2,115],74:[2,115],78:[2,115],84:[2,115],85:[2,115],86:[2,115],91:[2,115],93:[2,115],102:[2,115],104:[2,115],105:[2,115],106:[2,115],110:[2,115],116:[2,115],117:[2,115],118:[2,115],126:[2,115],129:[2,115],130:[2,115],133:[2,115],134:[2,115],135:[2,115],136:[2,115],137:[2,115],138:[2,115],139:[2,115]},{6:[2,52],25:[2,52],53:231,54:[1,232],91:[2,52]},{6:[2,124],25:[2,124],26:[2,124],54:[2,124],86:[2,124],91:[2,124]},{7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,147],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],87:233,88:[1,57],89:[1,58],90:[1,56],94:146,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,130],25:[2,130],26:[2,130],54:[2,130],86:[2,130],91:[2,130]},{6:[2,131],25:[2,131],26:[2,131],54:[2,131],86:[2,131],91:[2,131]},{1:[2,114],6:[2,114],25:[2,114],26:[2,114],40:[2,114],43:[2,114],49:[2,114],54:[2,114],57:[2,114],66:[2,114],67:[2,114],68:[2,114],69:[2,114],71:[2,114],73:[2,114],74:[2,114],78:[2,114],80:[2,114],84:[2,114],85:[2,114],86:[2,114],91:[2,114],93:[2,114],102:[2,114],104:[2,114],105:[2,114],106:[2,114],110:[2,114],116:[2,114],117:[2,114],118:[2,114],126:[2,114],129:[2,114],130:[2,114],131:[2,114],132:[2,114],133:[2,114],134:[2,114],135:[2,114],136:[2,114],137:[2,114],138:[2,114],139:[2,114],140:[2,114]},{24:234,25:[1,115],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,144],6:[2,144],25:[2,144],26:[2,144],49:[2,144],54:[2,144],57:[2,144],73:[2,144],78:[2,144],86:[2,144],91:[2,144],93:[2,144],102:[2,144],103:84,104:[1,64],105:[1,235],106:[1,65],109:85,110:[1,67],111:68,118:[2,144],126:[2,144],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,146],6:[2,146],25:[2,146],26:[2,146],49:[2,146],54:[2,146],57:[2,146],73:[2,146],78:[2,146],86:[2,146],91:[2,146],93:[2,146],102:[2,146],103:84,104:[1,64],105:[1,236],106:[1,65],109:85,110:[1,67],111:68,118:[2,146],126:[2,146],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,152],6:[2,152],25:[2,152],26:[2,152],49:[2,152],54:[2,152],57:[2,152],73:[2,152],78:[2,152],86:[2,152],91:[2,152],93:[2,152],102:[2,152],104:[2,152],105:[2,152],106:[2,152],110:[2,152],118:[2,152],126:[2,152],129:[2,152],130:[2,152],133:[2,152],134:[2,152],135:[2,152],136:[2,152],137:[2,152],138:[2,152],139:[2,152]},{1:[2,153],6:[2,153],25:[2,153],26:[2,153],49:[2,153],54:[2,153],57:[2,153],73:[2,153],78:[2,153],86:[2,153],91:[2,153],93:[2,153],102:[2,153],103:84,104:[1,64],105:[2,153],106:[1,65],109:85,110:[1,67],111:68,118:[2,153],126:[2,153],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,157],6:[2,157],25:[2,157],26:[2,157],49:[2,157],54:[2,157],57:[2,157],73:[2,157],78:[2,157],86:[2,157],91:[2,157],93:[2,157],102:[2,157],104:[2,157],105:[2,157],106:[2,157],110:[2,157],118:[2,157],126:[2,157],129:[2,157],130:[2,157],133:[2,157],134:[2,157],135:[2,157],136:[2,157],137:[2,157],138:[2,157],139:[2,157]},{116:[2,159],117:[2,159]},{27:160,28:[1,72],44:161,58:162,59:163,76:[1,69],89:[1,112],90:[1,113],113:237,115:159},{54:[1,238],116:[2,165],117:[2,165]},{54:[2,161],116:[2,161],117:[2,161]},{54:[2,162],116:[2,162],117:[2,162]},{54:[2,163],116:[2,163],117:[2,163]},{54:[2,164],116:[2,164],117:[2,164]},{1:[2,158],6:[2,158],25:[2,158],26:[2,158],49:[2,158],54:[2,158],57:[2,158],73:[2,158],78:[2,158],86:[2,158],91:[2,158],93:[2,158],102:[2,158],104:[2,158],105:[2,158],106:[2,158],110:[2,158],118:[2,158],126:[2,158],129:[2,158],130:[2,158],133:[2,158],134:[2,158],135:[2,158],136:[2,158],137:[2,158],138:[2,158],139:[2,158]},{7:239,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:240,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,52],25:[2,52],53:241,54:[1,242],78:[2,52]},{6:[2,92],25:[2,92],26:[2,92],54:[2,92],78:[2,92]},{6:[2,38],25:[2,38],26:[2,38],43:[1,243],54:[2,38],78:[2,38]},{6:[2,41],25:[2,41],26:[2,41],54:[2,41],78:[2,41]},{6:[2,42],25:[2,42],26:[2,42],43:[2,42],54:[2,42],78:[2,42]},{6:[2,43],25:[2,43],26:[2,43],43:[2,43],54:[2,43],78:[2,43]},{6:[2,44],25:[2,44],26:[2,44],43:[2,44],54:[2,44],78:[2,44]},{1:[2,4],6:[2,4],26:[2,4],102:[2,4]},{1:[2,197],6:[2,197],25:[2,197],26:[2,197],49:[2,197],54:[2,197],57:[2,197],73:[2,197],78:[2,197],86:[2,197],91:[2,197],93:[2,197],102:[2,197],103:84,104:[2,197],105:[2,197],106:[2,197],109:85,110:[2,197],111:68,118:[2,197],126:[2,197],129:[2,197],130:[2,197],133:[1,74],134:[1,77],135:[1,78],136:[2,197],137:[2,197],138:[2,197],139:[2,197]},{1:[2,198],6:[2,198],25:[2,198],26:[2,198],49:[2,198],54:[2,198],57:[2,198],73:[2,198],78:[2,198],86:[2,198],91:[2,198],93:[2,198],102:[2,198],103:84,104:[2,198],105:[2,198],106:[2,198],109:85,110:[2,198],111:68,118:[2,198],126:[2,198],129:[2,198],130:[2,198],133:[1,74],134:[1,77],135:[1,78],136:[2,198],137:[2,198],138:[2,198],139:[2,198]},{1:[2,199],6:[2,199],25:[2,199],26:[2,199],49:[2,199],54:[2,199],57:[2,199],73:[2,199],78:[2,199],86:[2,199],91:[2,199],93:[2,199],102:[2,199],103:84,104:[2,199],105:[2,199],106:[2,199],109:85,110:[2,199],111:68,118:[2,199],126:[2,199],129:[2,199],130:[2,199],133:[1,74],134:[2,199],135:[1,78],136:[2,199],137:[2,199],138:[2,199],139:[2,199]},{1:[2,200],6:[2,200],25:[2,200],26:[2,200],49:[2,200],54:[2,200],57:[2,200],73:[2,200],78:[2,200],86:[2,200],91:[2,200],93:[2,200],102:[2,200],103:84,104:[2,200],105:[2,200],106:[2,200],109:85,110:[2,200],111:68,118:[2,200],126:[2,200],129:[2,200],130:[2,200],133:[1,74],134:[2,200],135:[1,78],136:[2,200],137:[2,200],138:[2,200],139:[2,200]},{1:[2,201],6:[2,201],25:[2,201],26:[2,201],49:[2,201],54:[2,201],57:[2,201],73:[2,201],78:[2,201],86:[2,201],91:[2,201],93:[2,201],102:[2,201],103:84,104:[2,201],105:[2,201],106:[2,201],109:85,110:[2,201],111:68,118:[2,201],126:[2,201],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[2,201],137:[2,201],138:[2,201],139:[2,201]},{1:[2,202],6:[2,202],25:[2,202],26:[2,202],49:[2,202],54:[2,202],57:[2,202],73:[2,202],78:[2,202],86:[2,202],91:[2,202],93:[2,202],102:[2,202],103:84,104:[2,202],105:[2,202],106:[2,202],109:85,110:[2,202],111:68,118:[2,202],126:[2,202],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[2,202],138:[2,202],139:[1,82]},{1:[2,203],6:[2,203],25:[2,203],26:[2,203],49:[2,203],54:[2,203],57:[2,203],73:[2,203],78:[2,203],86:[2,203],91:[2,203],93:[2,203],102:[2,203],103:84,104:[2,203],105:[2,203],106:[2,203],109:85,110:[2,203],111:68,118:[2,203],126:[2,203],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[2,203],139:[1,82]},{1:[2,204],6:[2,204],25:[2,204],26:[2,204],49:[2,204],54:[2,204],57:[2,204],73:[2,204],78:[2,204],86:[2,204],91:[2,204],93:[2,204],102:[2,204],103:84,104:[2,204],105:[2,204],106:[2,204],109:85,110:[2,204],111:68,118:[2,204],126:[2,204],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[2,204],138:[2,204],139:[2,204]},{1:[2,187],6:[2,187],25:[2,187],26:[2,187],49:[2,187],54:[2,187],57:[2,187],73:[2,187],78:[2,187],86:[2,187],91:[2,187],93:[2,187],102:[2,187],103:84,104:[1,64],105:[2,187],106:[1,65],109:85,110:[1,67],111:68,118:[2,187],126:[2,187],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,186],6:[2,186],25:[2,186],26:[2,186],49:[2,186],54:[2,186],57:[2,186],73:[2,186],78:[2,186],86:[2,186],91:[2,186],93:[2,186],102:[2,186],103:84,104:[1,64],105:[2,186],106:[1,65],109:85,110:[1,67],111:68,118:[2,186],126:[2,186],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{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],69:[2,104],71:[2,104],73:[2,104],74:[2,104],78:[2,104],84:[2,104],85:[2,104],86:[2,104],91:[2,104],93:[2,104],102:[2,104],104:[2,104],105:[2,104],106:[2,104],110:[2,104],118:[2,104],126:[2,104],129:[2,104],130:[2,104],133:[2,104],134:[2,104],135:[2,104],136:[2,104],137:[2,104],138:[2,104],139:[2,104]},{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],69:[2,80],71:[2,80],73:[2,80],74:[2,80],78:[2,80],80:[2,80],84:[2,80],85:[2,80],86:[2,80],91:[2,80],93:[2,80],102:[2,80],104:[2,80],105:[2,80],106:[2,80],110:[2,80],118:[2,80],126:[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],138:[2,80],139:[2,80],140:[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],69:[2,81],71:[2,81],73:[2,81],74:[2,81],78:[2,81],80:[2,81],84:[2,81],85:[2,81],86:[2,81],91:[2,81],93:[2,81],102:[2,81],104:[2,81],105:[2,81],106:[2,81],110:[2,81],118:[2,81],126:[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],138:[2,81],139:[2,81],140:[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],69:[2,82],71:[2,82],73:[2,82],74:[2,82],78:[2,82],80:[2,82],84:[2,82],85:[2,82],86:[2,82],91:[2,82],93:[2,82],102:[2,82],104:[2,82],105:[2,82],106:[2,82],110:[2,82],118:[2,82],126:[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],138:[2,82],139:[2,82],140:[2,82]},{1:[2,83],6:[2,83],25:[2,83],26:[2,83],40:[2,83],49:[2,83],54:[2,83],57:[2,83],66:[2,83],67:[2,83],68:[2,83],69:[2,83],71:[2,83],73:[2,83],74:[2,83],78:[2,83],80:[2,83],84:[2,83],85:[2,83],86:[2,83],91:[2,83],93:[2,83],102:[2,83],104:[2,83],105:[2,83],106:[2,83],110:[2,83],118:[2,83],126:[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],138:[2,83],139:[2,83],140:[2,83]},{73:[1,244]},{57:[1,195],73:[2,88],92:245,93:[1,194],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{73:[2,89]},{7:246,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,73:[2,123],76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{11:[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],73:[2,117],76:[2,117],79:[2,117],83:[2,117],88:[2,117],89:[2,117],90:[2,117],96:[2,117],100:[2,117],101:[2,117],104:[2,117],106:[2,117],108:[2,117],110:[2,117],119:[2,117],125:[2,117],127:[2,117],128:[2,117],129:[2,117],130:[2,117],131:[2,117],132:[2,117]},{11:[2,118],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],73:[2,118],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118],132:[2,118]},{1:[2,87],6:[2,87],25:[2,87],26:[2,87],40:[2,87],49:[2,87],54:[2,87],57:[2,87],66:[2,87],67:[2,87],68:[2,87],69:[2,87],71:[2,87],73:[2,87],74:[2,87],78:[2,87],80:[2,87],84:[2,87],85:[2,87],86:[2,87],91:[2,87],93:[2,87],102:[2,87],104:[2,87],105:[2,87],106:[2,87],110:[2,87],118:[2,87],126:[2,87],129:[2,87],130:[2,87],131:[2,87],132:[2,87],133:[2,87],134:[2,87],135:[2,87],136:[2,87],137:[2,87],138:[2,87],139:[2,87],140:[2,87]},{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],69:[2,105],71:[2,105],73:[2,105],74:[2,105],78:[2,105],84:[2,105],85:[2,105],86:[2,105],91:[2,105],93:[2,105],102:[2,105],104:[2,105],105:[2,105],106:[2,105],110:[2,105],118:[2,105],126:[2,105],129:[2,105],130:[2,105],133:[2,105],134:[2,105],135:[2,105],136:[2,105],137:[2,105],138:[2,105],139:[2,105]},{1:[2,35],6:[2,35],25:[2,35],26:[2,35],49:[2,35],54:[2,35],57:[2,35],73:[2,35],78:[2,35],86:[2,35],91:[2,35],93:[2,35],102:[2,35],103:84,104:[2,35],105:[2,35],106:[2,35],109:85,110:[2,35],111:68,118:[2,35],126:[2,35],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{7:247,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:248,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{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],69:[2,110],71:[2,110],73:[2,110],74:[2,110],78:[2,110],84:[2,110],85:[2,110],86:[2,110],91:[2,110],93:[2,110],102:[2,110],104:[2,110],105:[2,110],106:[2,110],110:[2,110],118:[2,110],126:[2,110],129:[2,110],130:[2,110],133:[2,110],134:[2,110],135:[2,110],136:[2,110],137:[2,110],138:[2,110],139:[2,110]},{6:[2,52],25:[2,52],53:249,54:[1,232],86:[2,52]},{6:[2,129],25:[2,129],26:[2,129],54:[2,129],57:[1,250],86:[2,129],91:[2,129],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{50:251,51:[1,59],52:[1,60]},{6:[2,53],25:[2,53],26:[2,53],27:108,28:[1,72],44:109,55:252,56:106,57:[1,107],58:110,59:111,76:[1,69],89:[1,112],90:[1,113]},{6:[1,253],25:[1,254]},{6:[2,60],25:[2,60],26:[2,60],49:[2,60],54:[2,60]},{7:255,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,23],6:[2,23],25:[2,23],26:[2,23],49:[2,23],54:[2,23],57:[2,23],73:[2,23],78:[2,23],86:[2,23],91:[2,23],93:[2,23],98:[2,23],99:[2,23],102:[2,23],104:[2,23],105:[2,23],106:[2,23],110:[2,23],118:[2,23],121:[2,23],123:[2,23],126:[2,23],129:[2,23],130:[2,23],133:[2,23],134:[2,23],135:[2,23],136:[2,23],137:[2,23],138:[2,23],139:[2,23]},{6:[1,73],26:[1,256]},{1:[2,205],6:[2,205],25:[2,205],26:[2,205],49:[2,205],54:[2,205],57:[2,205],73:[2,205],78:[2,205],86:[2,205],91:[2,205],93:[2,205],102:[2,205],103:84,104:[2,205],105:[2,205],106:[2,205],109:85,110:[2,205],111:68,118:[2,205],126:[2,205],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{7:257,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:258,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,208],6:[2,208],25:[2,208],26:[2,208],49:[2,208],54:[2,208],57:[2,208],73:[2,208],78:[2,208],86:[2,208],91:[2,208],93:[2,208],102:[2,208],103:84,104:[2,208],105:[2,208],106:[2,208],109:85,110:[2,208],111:68,118:[2,208],126:[2,208],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,185],6:[2,185],25:[2,185],26:[2,185],49:[2,185],54:[2,185],57:[2,185],73:[2,185],78:[2,185],86:[2,185],91:[2,185],93:[2,185],102:[2,185],104:[2,185],105:[2,185],106:[2,185],110:[2,185],118:[2,185],126:[2,185],129:[2,185],130:[2,185],133:[2,185],134:[2,185],135:[2,185],136:[2,185],137:[2,185],138:[2,185],139:[2,185]},{7:259,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,135],6:[2,135],25:[2,135],26:[2,135],49:[2,135],54:[2,135],57:[2,135],73:[2,135],78:[2,135],86:[2,135],91:[2,135],93:[2,135],98:[1,260],102:[2,135],104:[2,135],105:[2,135],106:[2,135],110:[2,135],118:[2,135],126:[2,135],129:[2,135],130:[2,135],133:[2,135],134:[2,135],135:[2,135],136:[2,135],137:[2,135],138:[2,135],139:[2,135]},{24:261,25:[1,115]},{24:264,25:[1,115],27:262,28:[1,72],59:263,76:[1,69]},{120:265,122:222,123:[1,223]},{26:[1,266],121:[1,267],122:268,123:[1,223]},{26:[2,178],121:[2,178],123:[2,178]},{7:270,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],95:269,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,98],6:[2,98],24:271,25:[1,115],26:[2,98],49:[2,98],54:[2,98],57:[2,98],73:[2,98],78:[2,98],86:[2,98],91:[2,98],93:[2,98],102:[2,98],103:84,104:[1,64],105:[2,98],106:[1,65],109:85,110:[1,67],111:68,118:[2,98],126:[2,98],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,101],6:[2,101],25:[2,101],26:[2,101],49:[2,101],54:[2,101],57:[2,101],73:[2,101],78:[2,101],86:[2,101],91:[2,101],93:[2,101],102:[2,101],104:[2,101],105:[2,101],106:[2,101],110:[2,101],118:[2,101],126:[2,101],129:[2,101],130:[2,101],133:[2,101],134:[2,101],135:[2,101],136:[2,101],137:[2,101],138:[2,101],139:[2,101]},{7:272,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,142],6:[2,142],25:[2,142],26:[2,142],49:[2,142],54:[2,142],57:[2,142],66:[2,142],67:[2,142],68:[2,142],69:[2,142],71:[2,142],73:[2,142],74:[2,142],78:[2,142],84:[2,142],85:[2,142],86:[2,142],91:[2,142],93:[2,142],102:[2,142],104:[2,142],105:[2,142],106:[2,142],110:[2,142],118:[2,142],126:[2,142],129:[2,142],130:[2,142],133:[2,142],134:[2,142],135:[2,142],136:[2,142],137:[2,142],138:[2,142],139:[2,142]},{6:[1,73],26:[1,273]},{7:274,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,67],11:[2,118],25:[2,67],28:[2,118],30:[2,118],31:[2,118],33:[2,118],34:[2,118],35:[2,118],36:[2,118],37:[2,118],38:[2,118],45:[2,118],46:[2,118],47:[2,118],51:[2,118],52:[2,118],54:[2,67],76:[2,118],79:[2,118],83:[2,118],88:[2,118],89:[2,118],90:[2,118],91:[2,67],96:[2,118],100:[2,118],101:[2,118],104:[2,118],106:[2,118],108:[2,118],110:[2,118],119:[2,118],125:[2,118],127:[2,118],128:[2,118],129:[2,118],130:[2,118],131:[2,118],132:[2,118]},{6:[1,276],25:[1,277],91:[1,275]},{6:[2,53],7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[2,53],26:[2,53],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],86:[2,53],88:[1,57],89:[1,58],90:[1,56],91:[2,53],94:278,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,52],25:[2,52],26:[2,52],53:279,54:[1,232]},{1:[2,182],6:[2,182],25:[2,182],26:[2,182],49:[2,182],54:[2,182],57:[2,182],73:[2,182],78:[2,182],86:[2,182],91:[2,182],93:[2,182],102:[2,182],104:[2,182],105:[2,182],106:[2,182],110:[2,182],118:[2,182],121:[2,182],126:[2,182],129:[2,182],130:[2,182],133:[2,182],134:[2,182],135:[2,182],136:[2,182],137:[2,182],138:[2,182],139:[2,182]},{7:280,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:281,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{116:[2,160],117:[2,160]},{27:160,28:[1,72],44:161,58:162,59:163,76:[1,69],89:[1,112],90:[1,113],115:282},{1:[2,167],6:[2,167],25:[2,167],26:[2,167],49:[2,167],54:[2,167],57:[2,167],73:[2,167],78:[2,167],86:[2,167],91:[2,167],93:[2,167],102:[2,167],103:84,104:[2,167],105:[1,283],106:[2,167],109:85,110:[2,167],111:68,118:[1,284],126:[2,167],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,168],6:[2,168],25:[2,168],26:[2,168],49:[2,168],54:[2,168],57:[2,168],73:[2,168],78:[2,168],86:[2,168],91:[2,168],93:[2,168],102:[2,168],103:84,104:[2,168],105:[1,285],106:[2,168],109:85,110:[2,168],111:68,118:[2,168],126:[2,168],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[1,287],25:[1,288],78:[1,286]},{6:[2,53],10:170,25:[2,53],26:[2,53],27:171,28:[1,72],29:172,30:[1,70],31:[1,71],41:289,42:169,44:173,46:[1,45],78:[2,53],89:[1,112]},{7:290,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,291],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{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],69:[2,86],71:[2,86],73:[2,86],74:[2,86],78:[2,86],80:[2,86],84:[2,86],85:[2,86],86:[2,86],91:[2,86],93:[2,86],102:[2,86],104:[2,86],105:[2,86],106:[2,86],110:[2,86],118:[2,86],126:[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],138:[2,86],139:[2,86],140:[2,86]},{7:292,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,73:[2,121],76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{73:[2,122],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,36],6:[2,36],25:[2,36],26:[2,36],49:[2,36],54:[2,36],57:[2,36],73:[2,36],78:[2,36],86:[2,36],91:[2,36],93:[2,36],102:[2,36],103:84,104:[2,36],105:[2,36],106:[2,36],109:85,110:[2,36],111:68,118:[2,36],126:[2,36],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{26:[1,293],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[1,276],25:[1,277],86:[1,294]},{6:[2,67],25:[2,67],26:[2,67],54:[2,67],86:[2,67],91:[2,67]},{24:295,25:[1,115]},{6:[2,56],25:[2,56],26:[2,56],49:[2,56],54:[2,56]},{27:108,28:[1,72],44:109,55:296,56:106,57:[1,107],58:110,59:111,76:[1,69],89:[1,112],90:[1,113]},{6:[2,54],25:[2,54],26:[2,54],27:108,28:[1,72],44:109,48:297,54:[2,54],55:105,56:106,57:[1,107],58:110,59:111,76:[1,69],89:[1,112],90:[1,113]},{6:[2,61],25:[2,61],26:[2,61],49:[2,61],54:[2,61],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,24],6:[2,24],25:[2,24],26:[2,24],49:[2,24],54:[2,24],57:[2,24],73:[2,24],78:[2,24],86:[2,24],91:[2,24],93:[2,24],98:[2,24],99:[2,24],102:[2,24],104:[2,24],105:[2,24],106:[2,24],110:[2,24],118:[2,24],121:[2,24],123:[2,24],126:[2,24],129:[2,24],130:[2,24],133:[2,24],134:[2,24],135:[2,24],136:[2,24],137:[2,24],138:[2,24],139:[2,24]},{26:[1,298],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,207],6:[2,207],25:[2,207],26:[2,207],49:[2,207],54:[2,207],57:[2,207],73:[2,207],78:[2,207],86:[2,207],91:[2,207],93:[2,207],102:[2,207],103:84,104:[2,207],105:[2,207],106:[2,207],109:85,110:[2,207],111:68,118:[2,207],126:[2,207],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{24:299,25:[1,115],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{24:300,25:[1,115]},{1:[2,136],6:[2,136],25:[2,136],26:[2,136],49:[2,136],54:[2,136],57:[2,136],73:[2,136],78:[2,136],86:[2,136],91:[2,136],93:[2,136],102:[2,136],104:[2,136],105:[2,136],106:[2,136],110:[2,136],118:[2,136],126:[2,136],129:[2,136],130:[2,136],133:[2,136],134:[2,136],135:[2,136],136:[2,136],137:[2,136],138:[2,136],139:[2,136]},{24:301,25:[1,115]},{24:302,25:[1,115]},{1:[2,140],6:[2,140],25:[2,140],26:[2,140],49:[2,140],54:[2,140],57:[2,140],73:[2,140],78:[2,140],86:[2,140],91:[2,140],93:[2,140],98:[2,140],102:[2,140],104:[2,140],105:[2,140],106:[2,140],110:[2,140],118:[2,140],126:[2,140],129:[2,140],130:[2,140],133:[2,140],134:[2,140],135:[2,140],136:[2,140],137:[2,140],138:[2,140],139:[2,140]},{26:[1,303],121:[1,304],122:268,123:[1,223]},{1:[2,176],6:[2,176],25:[2,176],26:[2,176],49:[2,176],54:[2,176],57:[2,176],73:[2,176],78:[2,176],86:[2,176],91:[2,176],93:[2,176],102:[2,176],104:[2,176],105:[2,176],106:[2,176],110:[2,176],118:[2,176],126:[2,176],129:[2,176],130:[2,176],133:[2,176],134:[2,176],135:[2,176],136:[2,176],137:[2,176],138:[2,176],139:[2,176]},{24:305,25:[1,115]},{26:[2,179],121:[2,179],123:[2,179]},{24:306,25:[1,115],54:[1,307]},{25:[2,132],54:[2,132],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,99],6:[2,99],25:[2,99],26:[2,99],49:[2,99],54:[2,99],57:[2,99],73:[2,99],78:[2,99],86:[2,99],91:[2,99],93:[2,99],102:[2,99],104:[2,99],105:[2,99],106:[2,99],110:[2,99],118:[2,99],126:[2,99],129:[2,99],130:[2,99],133:[2,99],134:[2,99],135:[2,99],136:[2,99],137:[2,99],138:[2,99],139:[2,99]},{1:[2,102],6:[2,102],24:308,25:[1,115],26:[2,102],49:[2,102],54:[2,102],57:[2,102],73:[2,102],78:[2,102],86:[2,102],91:[2,102],93:[2,102],102:[2,102],103:84,104:[1,64],105:[2,102],106:[1,65],109:85,110:[1,67],111:68,118:[2,102],126:[2,102],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{102:[1,309]},{91:[1,310],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,116],6:[2,116],25:[2,116],26:[2,116],40:[2,116],49:[2,116],54:[2,116],57:[2,116],66:[2,116],67:[2,116],68:[2,116],69:[2,116],71:[2,116],73:[2,116],74:[2,116],78:[2,116],84:[2,116],85:[2,116],86:[2,116],91:[2,116],93:[2,116],102:[2,116],104:[2,116],105:[2,116],106:[2,116],110:[2,116],116:[2,116],117:[2,116],118:[2,116],126:[2,116],129:[2,116],130:[2,116],133:[2,116],134:[2,116],135:[2,116],136:[2,116],137:[2,116],138:[2,116],139:[2,116]},{7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],94:311,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:203,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,25:[1,147],27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],57:[1,149],58:46,59:47,60:148,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],87:312,88:[1,57],89:[1,58],90:[1,56],94:146,96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[2,125],25:[2,125],26:[2,125],54:[2,125],86:[2,125],91:[2,125]},{6:[1,276],25:[1,277],26:[1,313]},{1:[2,145],6:[2,145],25:[2,145],26:[2,145],49:[2,145],54:[2,145],57:[2,145],73:[2,145],78:[2,145],86:[2,145],91:[2,145],93:[2,145],102:[2,145],103:84,104:[1,64],105:[2,145],106:[1,65],109:85,110:[1,67],111:68,118:[2,145],126:[2,145],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,147],6:[2,147],25:[2,147],26:[2,147],49:[2,147],54:[2,147],57:[2,147],73:[2,147],78:[2,147],86:[2,147],91:[2,147],93:[2,147],102:[2,147],103:84,104:[1,64],105:[2,147],106:[1,65],109:85,110:[1,67],111:68,118:[2,147],126:[2,147],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{116:[2,166],117:[2,166]},{7:314,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:315,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:316,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,90],6:[2,90],25:[2,90],26:[2,90],40:[2,90],49:[2,90],54:[2,90],57:[2,90],66:[2,90],67:[2,90],68:[2,90],69:[2,90],71:[2,90],73:[2,90],74:[2,90],78:[2,90],84:[2,90],85:[2,90],86:[2,90],91:[2,90],93:[2,90],102:[2,90],104:[2,90],105:[2,90],106:[2,90],110:[2,90],116:[2,90],117:[2,90],118:[2,90],126:[2,90],129:[2,90],130:[2,90],133:[2,90],134:[2,90],135:[2,90],136:[2,90],137:[2,90],138:[2,90],139:[2,90]},{10:170,27:171,28:[1,72],29:172,30:[1,70],31:[1,71],41:317,42:169,44:173,46:[1,45],89:[1,112]},{6:[2,91],10:170,25:[2,91],26:[2,91],27:171,28:[1,72],29:172,30:[1,70],31:[1,71],41:168,42:169,44:173,46:[1,45],54:[2,91],77:318,89:[1,112]},{6:[2,93],25:[2,93],26:[2,93],54:[2,93],78:[2,93]},{6:[2,39],25:[2,39],26:[2,39],54:[2,39],78:[2,39],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{7:319,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{73:[2,120],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,37],6:[2,37],25:[2,37],26:[2,37],49:[2,37],54:[2,37],57:[2,37],73:[2,37],78:[2,37],86:[2,37],91:[2,37],93:[2,37],102:[2,37],104:[2,37],105:[2,37],106:[2,37],110:[2,37],118:[2,37],126:[2,37],129:[2,37],130:[2,37],133:[2,37],134:[2,37],135:[2,37],136:[2,37],137:[2,37],138:[2,37],139:[2,37]},{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],69:[2,111],71:[2,111],73:[2,111],74:[2,111],78:[2,111],84:[2,111],85:[2,111],86:[2,111],91:[2,111],93:[2,111],102:[2,111],104:[2,111],105:[2,111],106:[2,111],110:[2,111],118:[2,111],126:[2,111],129:[2,111],130:[2,111],133:[2,111],134:[2,111],135:[2,111],136:[2,111],137:[2,111],138:[2,111],139:[2,111]},{1:[2,48],6:[2,48],25:[2,48],26:[2,48],49:[2,48],54:[2,48],57:[2,48],73:[2,48],78:[2,48],86:[2,48],91:[2,48],93:[2,48],102:[2,48],104:[2,48],105:[2,48],106:[2,48],110:[2,48],118:[2,48],126:[2,48],129:[2,48],130:[2,48],133:[2,48],134:[2,48],135:[2,48],136:[2,48],137:[2,48],138:[2,48],139:[2,48]},{6:[2,57],25:[2,57],26:[2,57],49:[2,57],54:[2,57]},{6:[2,52],25:[2,52],26:[2,52],53:320,54:[1,205]},{1:[2,206],6:[2,206],25:[2,206],26:[2,206],49:[2,206],54:[2,206],57:[2,206],73:[2,206],78:[2,206],86:[2,206],91:[2,206],93:[2,206],102:[2,206],104:[2,206],105:[2,206],106:[2,206],110:[2,206],118:[2,206],126:[2,206],129:[2,206],130:[2,206],133:[2,206],134:[2,206],135:[2,206],136:[2,206],137:[2,206],138:[2,206],139:[2,206]},{1:[2,183],6:[2,183],25:[2,183],26:[2,183],49:[2,183],54:[2,183],57:[2,183],73:[2,183],78:[2,183],86:[2,183],91:[2,183],93:[2,183],102:[2,183],104:[2,183],105:[2,183],106:[2,183],110:[2,183],118:[2,183],121:[2,183],126:[2,183],129:[2,183],130:[2,183],133:[2,183],134:[2,183],135:[2,183],136:[2,183],137:[2,183],138:[2,183],139:[2,183]},{1:[2,137],6:[2,137],25:[2,137],26:[2,137],49:[2,137],54:[2,137],57:[2,137],73:[2,137],78:[2,137],86:[2,137],91:[2,137],93:[2,137],102:[2,137],104:[2,137],105:[2,137],106:[2,137],110:[2,137],118:[2,137],126:[2,137],129:[2,137],130:[2,137],133:[2,137],134:[2,137],135:[2,137],136:[2,137],137:[2,137],138:[2,137],139:[2,137]},{1:[2,138],6:[2,138],25:[2,138],26:[2,138],49:[2,138],54:[2,138],57:[2,138],73:[2,138],78:[2,138],86:[2,138],91:[2,138],93:[2,138],98:[2,138],102:[2,138],104:[2,138],105:[2,138],106:[2,138],110:[2,138],118:[2,138],126:[2,138],129:[2,138],130:[2,138],133:[2,138],134:[2,138],135:[2,138],136:[2,138],137:[2,138],138:[2,138],139:[2,138]},{1:[2,139],6:[2,139],25:[2,139],26:[2,139],49:[2,139],54:[2,139],57:[2,139],73:[2,139],78:[2,139],86:[2,139],91:[2,139],93:[2,139],98:[2,139],102:[2,139],104:[2,139],105:[2,139],106:[2,139],110:[2,139],118:[2,139],126:[2,139],129:[2,139],130:[2,139],133:[2,139],134:[2,139],135:[2,139],136:[2,139],137:[2,139],138:[2,139],139:[2,139]},{1:[2,174],6:[2,174],25:[2,174],26:[2,174],49:[2,174],54:[2,174],57:[2,174],73:[2,174],78:[2,174],86:[2,174],91:[2,174],93:[2,174],102:[2,174],104:[2,174],105:[2,174],106:[2,174],110:[2,174],118:[2,174],126:[2,174],129:[2,174],130:[2,174],133:[2,174],134:[2,174],135:[2,174],136:[2,174],137:[2,174],138:[2,174],139:[2,174]},{24:321,25:[1,115]},{26:[1,322]},{6:[1,323],26:[2,180],121:[2,180],123:[2,180]},{7:324,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{1:[2,103],6:[2,103],25:[2,103],26:[2,103],49:[2,103],54:[2,103],57:[2,103],73:[2,103],78:[2,103],86:[2,103],91:[2,103],93:[2,103],102:[2,103],104:[2,103],105:[2,103],106:[2,103],110:[2,103],118:[2,103],126:[2,103],129:[2,103],130:[2,103],133:[2,103],134:[2,103],135:[2,103],136:[2,103],137:[2,103],138:[2,103],139:[2,103]},{1:[2,143],6:[2,143],25:[2,143],26:[2,143],49:[2,143],54:[2,143],57:[2,143],66:[2,143],67:[2,143],68:[2,143],69:[2,143],71:[2,143],73:[2,143],74:[2,143],78:[2,143],84:[2,143],85:[2,143],86:[2,143],91:[2,143],93:[2,143],102:[2,143],104:[2,143],105:[2,143],106:[2,143],110:[2,143],118:[2,143],126:[2,143],129:[2,143],130:[2,143],133:[2,143],134:[2,143],135:[2,143],136:[2,143],137:[2,143],138:[2,143],139:[2,143]},{1:[2,119],6:[2,119],25:[2,119],26:[2,119],49:[2,119],54:[2,119],57:[2,119],66:[2,119],67:[2,119],68:[2,119],69:[2,119],71:[2,119],73:[2,119],74:[2,119],78:[2,119],84:[2,119],85:[2,119],86:[2,119],91:[2,119],93:[2,119],102:[2,119],104:[2,119],105:[2,119],106:[2,119],110:[2,119],118:[2,119],126:[2,119],129:[2,119],130:[2,119],133:[2,119],134:[2,119],135:[2,119],136:[2,119],137:[2,119],138:[2,119],139:[2,119]},{6:[2,126],25:[2,126],26:[2,126],54:[2,126],86:[2,126],91:[2,126]},{6:[2,52],25:[2,52],26:[2,52],53:325,54:[1,232]},{6:[2,127],25:[2,127],26:[2,127],54:[2,127],86:[2,127],91:[2,127]},{1:[2,169],6:[2,169],25:[2,169],26:[2,169],49:[2,169],54:[2,169],57:[2,169],73:[2,169],78:[2,169],86:[2,169],91:[2,169],93:[2,169],102:[2,169],103:84,104:[2,169],105:[2,169],106:[2,169],109:85,110:[2,169],111:68,118:[1,326],126:[2,169],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,171],6:[2,171],25:[2,171],26:[2,171],49:[2,171],54:[2,171],57:[2,171],73:[2,171],78:[2,171],86:[2,171],91:[2,171],93:[2,171],102:[2,171],103:84,104:[2,171],105:[1,327],106:[2,171],109:85,110:[2,171],111:68,118:[2,171],126:[2,171],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,170],6:[2,170],25:[2,170],26:[2,170],49:[2,170],54:[2,170],57:[2,170],73:[2,170],78:[2,170],86:[2,170],91:[2,170],93:[2,170],102:[2,170],103:84,104:[2,170],105:[2,170],106:[2,170],109:85,110:[2,170],111:68,118:[2,170],126:[2,170],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[2,94],25:[2,94],26:[2,94],54:[2,94],78:[2,94]},{6:[2,52],25:[2,52],26:[2,52],53:328,54:[1,242]},{26:[1,329],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[1,253],25:[1,254],26:[1,330]},{26:[1,331]},{1:[2,177],6:[2,177],25:[2,177],26:[2,177],49:[2,177],54:[2,177],57:[2,177],73:[2,177],78:[2,177],86:[2,177],91:[2,177],93:[2,177],102:[2,177],104:[2,177],105:[2,177],106:[2,177],110:[2,177],118:[2,177],126:[2,177],129:[2,177],130:[2,177],133:[2,177],134:[2,177],135:[2,177],136:[2,177],137:[2,177],138:[2,177],139:[2,177]},{26:[2,181],121:[2,181],123:[2,181]},{25:[2,133],54:[2,133],103:84,104:[1,64],106:[1,65],109:85,110:[1,67],111:68,126:[1,83],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[1,276],25:[1,277],26:[1,332]},{7:333,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{7:334,8:117,9:18,10:19,11:[1,20],12:6,13:7,14:8,15:9,16:10,17:11,18:12,19:13,20:14,21:15,22:16,23:17,27:61,28:[1,72],29:48,30:[1,70],31:[1,71],32:22,33:[1,49],34:[1,50],35:[1,51],36:[1,52],37:[1,53],38:[1,54],39:21,44:62,45:[1,44],46:[1,45],47:[1,27],50:28,51:[1,59],52:[1,60],58:46,59:47,61:35,63:23,64:24,65:25,76:[1,69],79:[1,42],83:[1,26],88:[1,57],89:[1,58],90:[1,56],96:[1,37],100:[1,43],101:[1,55],103:38,104:[1,64],106:[1,65],107:39,108:[1,66],109:40,110:[1,67],111:68,119:[1,41],124:36,125:[1,63],127:[1,29],128:[1,30],129:[1,31],130:[1,32],131:[1,33],132:[1,34]},{6:[1,287],25:[1,288],26:[1,335]},{6:[2,40],25:[2,40],26:[2,40],54:[2,40],78:[2,40]},{6:[2,58],25:[2,58],26:[2,58],49:[2,58],54:[2,58]},{1:[2,175],6:[2,175],25:[2,175],26:[2,175],49:[2,175],54:[2,175],57:[2,175],73:[2,175],78:[2,175],86:[2,175],91:[2,175],93:[2,175],102:[2,175],104:[2,175],105:[2,175],106:[2,175],110:[2,175],118:[2,175],126:[2,175],129:[2,175],130:[2,175],133:[2,175],134:[2,175],135:[2,175],136:[2,175],137:[2,175],138:[2,175],139:[2,175]},{6:[2,128],25:[2,128],26:[2,128],54:[2,128],86:[2,128],91:[2,128]},{1:[2,172],6:[2,172],25:[2,172],26:[2,172],49:[2,172],54:[2,172],57:[2,172],73:[2,172],78:[2,172],86:[2,172],91:[2,172],93:[2,172],102:[2,172],103:84,104:[2,172],105:[2,172],106:[2,172],109:85,110:[2,172],111:68,118:[2,172],126:[2,172],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{1:[2,173],6:[2,173],25:[2,173],26:[2,173],49:[2,173],54:[2,173],57:[2,173],73:[2,173],78:[2,173],86:[2,173],91:[2,173],93:[2,173],102:[2,173],103:84,104:[2,173],105:[2,173],106:[2,173],109:85,110:[2,173],111:68,118:[2,173],126:[2,173],129:[1,76],130:[1,75],133:[1,74],134:[1,77],135:[1,78],136:[1,79],137:[1,80],138:[1,81],139:[1,82]},{6:[2,95],25:[2,95],26:[2,95],54:[2,95],78:[2,95]}],
+defaultActions: {59:[2,50],60:[2,51],91:[2,109],192:[2,89]},
+parseError: function parseError(str, hash) {
+ if (hash.recoverable) {
+ this.trace(str);
+ } else {
+ throw new Error(str);
+ }
+},
+parse: function parse(input) {
+ var self = this, stack = [0], vstack = [null], lstack = [], table = this.table, yytext = '', yylineno = 0, yyleng = 0, recovering = 0, TERROR = 2, EOF = 1;
+ var args = lstack.slice.call(arguments, 1);
+ this.lexer.setInput(input);
+ this.lexer.yy = this.yy;
+ this.yy.lexer = this.lexer;
+ this.yy.parser = this;
+ if (typeof this.lexer.yylloc == 'undefined') {
+ this.lexer.yylloc = {};
+ }
+ var yyloc = this.lexer.yylloc;
+ lstack.push(yyloc);
+ var ranges = this.lexer.options && this.lexer.options.ranges;
+ if (typeof this.yy.parseError === 'function') {
+ this.parseError = this.yy.parseError;
+ } else {
+ this.parseError = Object.getPrototypeOf(this).parseError;
+ }
+ function popStack(n) {
+ stack.length = stack.length - 2 * n;
+ vstack.length = vstack.length - n;
+ lstack.length = lstack.length - n;
+ }
+ function lex() {
+ var token;
+ token = self.lexer.lex() || EOF;
+ if (typeof token !== 'number') {
+ token = self.symbols_[token] || token;
+ }
+ return token;
+ }
+ var symbol, preErrorSymbol, state, action, a, r, yyval = {}, p, len, newState, expected;
+ while (true) {
+ state = stack[stack.length - 1];
+ if (this.defaultActions[state]) {
+ action = this.defaultActions[state];
+ } else {
+ if (symbol === null || typeof symbol == 'undefined') {
+ symbol = lex();
+ }
+ action = table[state] && table[state][symbol];
+ }
+ if (typeof action === 'undefined' || !action.length || !action[0]) {
+ var errStr = '';
+ expected = [];
+ for (p in table[state]) {
+ if (this.terminals_[p] && p > TERROR) {
+ expected.push('\'' + this.terminals_[p] + '\'');
+ }
+ }
+ if (this.lexer.showPosition) {
+ errStr = 'Parse error on line ' + (yylineno + 1) + ':\n' + this.lexer.showPosition() + '\nExpecting ' + expected.join(', ') + ', got \'' + (this.terminals_[symbol] || symbol) + '\'';
+ } else {
+ errStr = 'Parse error on line ' + (yylineno + 1) + ': Unexpected ' + (symbol == EOF ? 'end of input' : '\'' + (this.terminals_[symbol] || symbol) + '\'');
+ }
+ this.parseError(errStr, {
+ text: this.lexer.match,
+ token: this.terminals_[symbol] || symbol,
+ line: this.lexer.yylineno,
+ loc: yyloc,
+ expected: expected
+ });
+ }
+ if (action[0] instanceof Array && action.length > 1) {
+ throw new Error('Parse Error: multiple actions possible at state: ' + state + ', token: ' + symbol);
+ }
+ switch (action[0]) {
+ case 1:
+ stack.push(symbol);
+ vstack.push(this.lexer.yytext);
+ lstack.push(this.lexer.yylloc);
+ stack.push(action[1]);
+ symbol = null;
+ if (!preErrorSymbol) {
+ yyleng = this.lexer.yyleng;
+ yytext = this.lexer.yytext;
+ yylineno = this.lexer.yylineno;
+ yyloc = this.lexer.yylloc;
+ if (recovering > 0) {
+ recovering--;
+ }
+ } else {
+ symbol = preErrorSymbol;
+ preErrorSymbol = null;
+ }
+ break;
+ case 2:
+ len = this.productions_[action[1]][1];
+ yyval.$ = vstack[vstack.length - len];
+ yyval._$ = {
+ first_line: lstack[lstack.length - (len || 1)].first_line,
+ last_line: lstack[lstack.length - 1].last_line,
+ first_column: lstack[lstack.length - (len || 1)].first_column,
+ last_column: lstack[lstack.length - 1].last_column
+ };
+ if (ranges) {
+ yyval._$.range = [
+ lstack[lstack.length - (len || 1)].range[0],
+ lstack[lstack.length - 1].range[1]
+ ];
+ }
+ r = this.performAction.apply(yyval, [
+ yytext,
+ yyleng,
+ yylineno,
+ this.yy,
+ action[1],
+ vstack,
+ lstack
+ ].concat(args));
+ if (typeof r !== 'undefined') {
+ return r;
+ }
+ if (len) {
+ stack = stack.slice(0, -1 * len * 2);
+ vstack = vstack.slice(0, -1 * len);
+ lstack = lstack.slice(0, -1 * len);
+ }
+ stack.push(this.productions_[action[1]][0]);
+ vstack.push(yyval.$);
+ lstack.push(yyval._$);
+ newState = table[stack[stack.length - 2]][stack[stack.length - 1]];
+ stack.push(newState);
+ break;
+ case 3:
+ return true;
+ }
+ }
+ return true;
+}};
+
+function Parser () {
+ this.yy = {};
+}
+Parser.prototype = parser;parser.Parser = Parser;
+return new Parser;
+})();
+
+
+if (typeof require !== 'undefined' && typeof exports !== 'undefined') {
+exports.parser = parser;
+exports.Parser = parser.Parser;
+exports.parse = function () { return parser.parse.apply(parser, arguments); };
+exports.main = function commonjsMain(args) {
+ if (!args[1]) {
+ console.log('Usage: '+args[0]+' FILE');
+ process.exit(1);
+ }
+ var source = require('fs').readFileSync(require('path').normalize(args[1]), "utf8");
+ return exports.parser.parse(source);
+};
+if (typeof module !== 'undefined' && require.main === module) {
+ exports.main(process.argv.slice(1));
+}
+}
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/register.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/register.js
new file mode 100644
index 000000000..b1d75ca41
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/register.js
@@ -0,0 +1,66 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var CoffeeScript, Module, binary, child_process, ext, findExtension, fork, helpers, loadFile, path, _i, _len, _ref;
+
+ CoffeeScript = require('./coffee-script');
+
+ child_process = require('child_process');
+
+ helpers = require('./helpers');
+
+ path = require('path');
+
+ loadFile = function(module, filename) {
+ var answer;
+ answer = CoffeeScript._compileFile(filename, false);
+ return module._compile(answer, filename);
+ };
+
+ if (require.extensions) {
+ _ref = CoffeeScript.FILE_EXTENSIONS;
+ for (_i = 0, _len = _ref.length; _i < _len; _i++) {
+ ext = _ref[_i];
+ require.extensions[ext] = loadFile;
+ }
+ Module = require('module');
+ findExtension = function(filename) {
+ var curExtension, extensions;
+ extensions = path.basename(filename).split('.');
+ if (extensions[0] === '') {
+ extensions.shift();
+ }
+ while (extensions.shift()) {
+ curExtension = '.' + extensions.join('.');
+ if (Module._extensions[curExtension]) {
+ return curExtension;
+ }
+ }
+ return '.js';
+ };
+ Module.prototype.load = function(filename) {
+ var extension;
+ this.filename = filename;
+ this.paths = Module._nodeModulePaths(path.dirname(filename));
+ extension = findExtension(filename);
+ Module._extensions[extension](this, filename);
+ return this.loaded = true;
+ };
+ }
+
+ if (child_process) {
+ fork = child_process.fork;
+ binary = require.resolve('../../bin/coffee');
+ child_process.fork = function(path, args, options) {
+ if (helpers.isCoffee(path)) {
+ if (!Array.isArray(args)) {
+ options = args || {};
+ args = [];
+ }
+ args = [path].concat(args);
+ path = binary;
+ }
+ return fork(path, args, options);
+ };
+ }
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/repl.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/repl.js
new file mode 100644
index 000000000..9f0697750
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/repl.js
@@ -0,0 +1,176 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var CoffeeScript, addHistory, addMultilineHandler, fs, getCommandId, merge, nodeREPL, path, replDefaults, updateSyntaxError, vm, _ref;
+
+ fs = require('fs');
+
+ path = require('path');
+
+ vm = require('vm');
+
+ nodeREPL = require('repl');
+
+ CoffeeScript = require('./coffee-script');
+
+ _ref = require('./helpers'), merge = _ref.merge, updateSyntaxError = _ref.updateSyntaxError;
+
+ replDefaults = {
+ prompt: 'coffee> ',
+ historyFile: process.env.HOME ? path.join(process.env.HOME, '.coffee_history') : void 0,
+ historyMaxInputSize: 10240,
+ "eval": function(input, context, filename, cb) {
+ var Assign, Block, Literal, Value, ast, err, js, result, _ref1;
+ input = input.replace(/\uFF00/g, '\n');
+ input = input.replace(/^\(([\s\S]*)\n\)$/m, '$1');
+ _ref1 = require('./nodes'), Block = _ref1.Block, Assign = _ref1.Assign, Value = _ref1.Value, Literal = _ref1.Literal;
+ try {
+ ast = CoffeeScript.nodes(input);
+ ast = new Block([new Assign(new Value(new Literal('_')), ast, '=')]);
+ js = ast.compile({
+ bare: true,
+ locals: Object.keys(context)
+ });
+ result = context === global ? vm.runInThisContext(js, filename) : vm.runInContext(js, context, filename);
+ return cb(null, result);
+ } catch (_error) {
+ err = _error;
+ updateSyntaxError(err, input);
+ return cb(err);
+ }
+ }
+ };
+
+ addMultilineHandler = function(repl) {
+ var inputStream, multiline, nodeLineListener, origPrompt, outputStream, rli, _ref1;
+ rli = repl.rli, inputStream = repl.inputStream, outputStream = repl.outputStream;
+ origPrompt = (_ref1 = repl._prompt) != null ? _ref1 : repl.prompt;
+ multiline = {
+ enabled: false,
+ initialPrompt: origPrompt.replace(/^[^> ]*/, function(x) {
+ return x.replace(/./g, '-');
+ }),
+ prompt: origPrompt.replace(/^[^> ]*>?/, function(x) {
+ return x.replace(/./g, '.');
+ }),
+ buffer: ''
+ };
+ nodeLineListener = rli.listeners('line')[0];
+ rli.removeListener('line', nodeLineListener);
+ rli.on('line', function(cmd) {
+ if (multiline.enabled) {
+ multiline.buffer += "" + cmd + "\n";
+ rli.setPrompt(multiline.prompt);
+ rli.prompt(true);
+ } else {
+ rli.setPrompt(origPrompt);
+ nodeLineListener(cmd);
+ }
+ });
+ return inputStream.on('keypress', function(char, key) {
+ if (!(key && key.ctrl && !key.meta && !key.shift && key.name === 'v')) {
+ return;
+ }
+ if (multiline.enabled) {
+ if (!multiline.buffer.match(/\n/)) {
+ multiline.enabled = !multiline.enabled;
+ rli.setPrompt(origPrompt);
+ rli.prompt(true);
+ return;
+ }
+ if ((rli.line != null) && !rli.line.match(/^\s*$/)) {
+ return;
+ }
+ multiline.enabled = !multiline.enabled;
+ rli.line = '';
+ rli.cursor = 0;
+ rli.output.cursorTo(0);
+ rli.output.clearLine(1);
+ multiline.buffer = multiline.buffer.replace(/\n/g, '\uFF00');
+ rli.emit('line', multiline.buffer);
+ multiline.buffer = '';
+ } else {
+ multiline.enabled = !multiline.enabled;
+ rli.setPrompt(multiline.initialPrompt);
+ rli.prompt(true);
+ }
+ });
+ };
+
+ addHistory = function(repl, filename, maxSize) {
+ var buffer, fd, lastLine, readFd, size, stat;
+ lastLine = null;
+ try {
+ stat = fs.statSync(filename);
+ size = Math.min(maxSize, stat.size);
+ readFd = fs.openSync(filename, 'r');
+ buffer = new Buffer(size);
+ fs.readSync(readFd, buffer, 0, size, stat.size - size);
+ repl.rli.history = buffer.toString().split('\n').reverse();
+ if (stat.size > maxSize) {
+ repl.rli.history.pop();
+ }
+ if (repl.rli.history[0] === '') {
+ repl.rli.history.shift();
+ }
+ repl.rli.historyIndex = -1;
+ lastLine = repl.rli.history[0];
+ } catch (_error) {}
+ fd = fs.openSync(filename, 'a');
+ repl.rli.addListener('line', function(code) {
+ if (code && code.length && code !== '.history' && lastLine !== code) {
+ fs.write(fd, "" + code + "\n");
+ return lastLine = code;
+ }
+ });
+ repl.rli.on('exit', function() {
+ return fs.close(fd);
+ });
+ return repl.commands[getCommandId(repl, 'history')] = {
+ help: 'Show command history',
+ action: function() {
+ repl.outputStream.write("" + (repl.rli.history.slice(0).reverse().join('\n')) + "\n");
+ return repl.displayPrompt();
+ }
+ };
+ };
+
+ getCommandId = function(repl, commandName) {
+ var commandsHaveLeadingDot;
+ commandsHaveLeadingDot = repl.commands['.help'] != null;
+ if (commandsHaveLeadingDot) {
+ return "." + commandName;
+ } else {
+ return commandName;
+ }
+ };
+
+ module.exports = {
+ start: function(opts) {
+ var build, major, minor, repl, _ref1;
+ if (opts == null) {
+ opts = {};
+ }
+ _ref1 = process.versions.node.split('.').map(function(n) {
+ return parseInt(n);
+ }), major = _ref1[0], minor = _ref1[1], build = _ref1[2];
+ if (major === 0 && minor < 8) {
+ console.warn("Node 0.8.0+ required for CoffeeScript REPL");
+ process.exit(1);
+ }
+ CoffeeScript.register();
+ process.argv = ['coffee'].concat(process.argv.slice(2));
+ opts = merge(replDefaults, opts);
+ repl = nodeREPL.start(opts);
+ repl.on('exit', function() {
+ return repl.outputStream.write('\n');
+ });
+ addMultilineHandler(repl);
+ if (opts.historyFile) {
+ addHistory(repl, opts.historyFile, opts.historyMaxInputSize);
+ }
+ repl.commands[getCommandId(repl, 'load')].help = 'Load code from a file into this REPL session';
+ return repl;
+ }
+ };
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/rewriter.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/rewriter.js
new file mode 100644
index 000000000..c5f228ad3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/rewriter.js
@@ -0,0 +1,475 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var BALANCED_PAIRS, CALL_CLOSERS, EXPRESSION_CLOSE, EXPRESSION_END, EXPRESSION_START, IMPLICIT_CALL, IMPLICIT_END, IMPLICIT_FUNC, IMPLICIT_UNSPACED_CALL, INVERSES, LINEBREAKS, SINGLE_CLOSERS, SINGLE_LINERS, generate, left, rite, _i, _len, _ref,
+ __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; },
+ __slice = [].slice;
+
+ generate = function(tag, value, origin) {
+ var tok;
+ tok = [tag, value];
+ tok.generated = true;
+ if (origin) {
+ tok.origin = origin;
+ }
+ return tok;
+ };
+
+ exports.Rewriter = (function() {
+ function Rewriter() {}
+
+ Rewriter.prototype.rewrite = function(tokens) {
+ this.tokens = tokens;
+ this.removeLeadingNewlines();
+ this.closeOpenCalls();
+ this.closeOpenIndexes();
+ this.normalizeLines();
+ this.tagPostfixConditionals();
+ this.addImplicitBracesAndParens();
+ this.addLocationDataToGeneratedTokens();
+ return this.tokens;
+ };
+
+ Rewriter.prototype.scanTokens = function(block) {
+ var i, token, tokens;
+ tokens = this.tokens;
+ i = 0;
+ while (token = tokens[i]) {
+ i += block.call(this, token, i, tokens);
+ }
+ return true;
+ };
+
+ Rewriter.prototype.detectEnd = function(i, condition, action) {
+ var levels, token, tokens, _ref, _ref1;
+ tokens = this.tokens;
+ levels = 0;
+ while (token = tokens[i]) {
+ if (levels === 0 && condition.call(this, token, i)) {
+ return action.call(this, token, i);
+ }
+ if (!token || levels < 0) {
+ return action.call(this, token, i - 1);
+ }
+ if (_ref = token[0], __indexOf.call(EXPRESSION_START, _ref) >= 0) {
+ levels += 1;
+ } else if (_ref1 = token[0], __indexOf.call(EXPRESSION_END, _ref1) >= 0) {
+ levels -= 1;
+ }
+ i += 1;
+ }
+ return i - 1;
+ };
+
+ Rewriter.prototype.removeLeadingNewlines = function() {
+ var i, tag, _i, _len, _ref;
+ _ref = this.tokens;
+ for (i = _i = 0, _len = _ref.length; _i < _len; i = ++_i) {
+ tag = _ref[i][0];
+ if (tag !== 'TERMINATOR') {
+ break;
+ }
+ }
+ if (i) {
+ return this.tokens.splice(0, i);
+ }
+ };
+
+ Rewriter.prototype.closeOpenCalls = function() {
+ var action, condition;
+ condition = function(token, i) {
+ var _ref;
+ return ((_ref = token[0]) === ')' || _ref === 'CALL_END') || token[0] === 'OUTDENT' && this.tag(i - 1) === ')';
+ };
+ action = function(token, i) {
+ return this.tokens[token[0] === 'OUTDENT' ? i - 1 : i][0] = 'CALL_END';
+ };
+ return this.scanTokens(function(token, i) {
+ if (token[0] === 'CALL_START') {
+ this.detectEnd(i + 1, condition, action);
+ }
+ return 1;
+ });
+ };
+
+ Rewriter.prototype.closeOpenIndexes = function() {
+ var action, condition;
+ condition = function(token, i) {
+ var _ref;
+ return (_ref = token[0]) === ']' || _ref === 'INDEX_END';
+ };
+ action = function(token, i) {
+ return token[0] = 'INDEX_END';
+ };
+ return this.scanTokens(function(token, i) {
+ if (token[0] === 'INDEX_START') {
+ this.detectEnd(i + 1, condition, action);
+ }
+ return 1;
+ });
+ };
+
+ Rewriter.prototype.matchTags = function() {
+ var fuzz, i, j, pattern, _i, _ref, _ref1;
+ i = arguments[0], pattern = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+ fuzz = 0;
+ for (j = _i = 0, _ref = pattern.length; 0 <= _ref ? _i < _ref : _i > _ref; j = 0 <= _ref ? ++_i : --_i) {
+ while (this.tag(i + j + fuzz) === 'HERECOMMENT') {
+ fuzz += 2;
+ }
+ if (pattern[j] == null) {
+ continue;
+ }
+ if (typeof pattern[j] === 'string') {
+ pattern[j] = [pattern[j]];
+ }
+ if (_ref1 = this.tag(i + j + fuzz), __indexOf.call(pattern[j], _ref1) < 0) {
+ return false;
+ }
+ }
+ return true;
+ };
+
+ Rewriter.prototype.looksObjectish = function(j) {
+ return this.matchTags(j, '@', null, ':') || this.matchTags(j, null, ':');
+ };
+
+ Rewriter.prototype.findTagsBackwards = function(i, tags) {
+ var backStack, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ backStack = [];
+ while (i >= 0 && (backStack.length || (_ref2 = this.tag(i), __indexOf.call(tags, _ref2) < 0) && ((_ref3 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref3) < 0) || this.tokens[i].generated) && (_ref4 = this.tag(i), __indexOf.call(LINEBREAKS, _ref4) < 0))) {
+ if (_ref = this.tag(i), __indexOf.call(EXPRESSION_END, _ref) >= 0) {
+ backStack.push(this.tag(i));
+ }
+ if ((_ref1 = this.tag(i), __indexOf.call(EXPRESSION_START, _ref1) >= 0) && backStack.length) {
+ backStack.pop();
+ }
+ i -= 1;
+ }
+ return _ref5 = this.tag(i), __indexOf.call(tags, _ref5) >= 0;
+ };
+
+ Rewriter.prototype.addImplicitBracesAndParens = function() {
+ var stack;
+ stack = [];
+ return this.scanTokens(function(token, i, tokens) {
+ var endImplicitCall, endImplicitObject, forward, inImplicit, inImplicitCall, inImplicitControl, inImplicitObject, newLine, nextTag, offset, prevTag, prevToken, s, sameLine, stackIdx, stackTag, stackTop, startIdx, startImplicitCall, startImplicitObject, startsLine, tag, _ref, _ref1, _ref2, _ref3, _ref4, _ref5;
+ tag = token[0];
+ prevTag = (prevToken = i > 0 ? tokens[i - 1] : [])[0];
+ nextTag = (i < tokens.length - 1 ? tokens[i + 1] : [])[0];
+ stackTop = function() {
+ return stack[stack.length - 1];
+ };
+ startIdx = i;
+ forward = function(n) {
+ return i - startIdx + n;
+ };
+ inImplicit = function() {
+ var _ref, _ref1;
+ return (_ref = stackTop()) != null ? (_ref1 = _ref[2]) != null ? _ref1.ours : void 0 : void 0;
+ };
+ inImplicitCall = function() {
+ var _ref;
+ return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '(';
+ };
+ inImplicitObject = function() {
+ var _ref;
+ return inImplicit() && ((_ref = stackTop()) != null ? _ref[0] : void 0) === '{';
+ };
+ inImplicitControl = function() {
+ var _ref;
+ return inImplicit && ((_ref = stackTop()) != null ? _ref[0] : void 0) === 'CONTROL';
+ };
+ startImplicitCall = function(j) {
+ var idx;
+ idx = j != null ? j : i;
+ stack.push([
+ '(', idx, {
+ ours: true
+ }
+ ]);
+ tokens.splice(idx, 0, generate('CALL_START', '('));
+ if (j == null) {
+ return i += 1;
+ }
+ };
+ endImplicitCall = function() {
+ stack.pop();
+ tokens.splice(i, 0, generate('CALL_END', ')'));
+ return i += 1;
+ };
+ startImplicitObject = function(j, startsLine) {
+ var idx;
+ if (startsLine == null) {
+ startsLine = true;
+ }
+ idx = j != null ? j : i;
+ stack.push([
+ '{', idx, {
+ sameLine: true,
+ startsLine: startsLine,
+ ours: true
+ }
+ ]);
+ tokens.splice(idx, 0, generate('{', generate(new String('{')), token));
+ if (j == null) {
+ return i += 1;
+ }
+ };
+ endImplicitObject = function(j) {
+ j = j != null ? j : i;
+ stack.pop();
+ tokens.splice(j, 0, generate('}', '}', token));
+ return i += 1;
+ };
+ if (inImplicitCall() && (tag === 'IF' || tag === 'TRY' || tag === 'FINALLY' || tag === 'CATCH' || tag === 'CLASS' || tag === 'SWITCH')) {
+ stack.push([
+ 'CONTROL', i, {
+ ours: true
+ }
+ ]);
+ return forward(1);
+ }
+ if (tag === 'INDENT' && inImplicit()) {
+ if (prevTag !== '=>' && prevTag !== '->' && prevTag !== '[' && prevTag !== '(' && prevTag !== ',' && prevTag !== '{' && prevTag !== 'TRY' && prevTag !== 'ELSE' && prevTag !== '=') {
+ while (inImplicitCall()) {
+ endImplicitCall();
+ }
+ }
+ if (inImplicitControl()) {
+ stack.pop();
+ }
+ stack.push([tag, i]);
+ return forward(1);
+ }
+ if (__indexOf.call(EXPRESSION_START, tag) >= 0) {
+ stack.push([tag, i]);
+ return forward(1);
+ }
+ if (__indexOf.call(EXPRESSION_END, tag) >= 0) {
+ while (inImplicit()) {
+ if (inImplicitCall()) {
+ endImplicitCall();
+ } else if (inImplicitObject()) {
+ endImplicitObject();
+ } else {
+ stack.pop();
+ }
+ }
+ stack.pop();
+ }
+ if ((__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && token.spaced && !token.stringEnd || tag === '?' && i > 0 && !tokens[i - 1].spaced) && (__indexOf.call(IMPLICIT_CALL, nextTag) >= 0 || __indexOf.call(IMPLICIT_UNSPACED_CALL, nextTag) >= 0 && !((_ref = tokens[i + 1]) != null ? _ref.spaced : void 0) && !((_ref1 = tokens[i + 1]) != null ? _ref1.newLine : void 0))) {
+ if (tag === '?') {
+ tag = token[0] = 'FUNC_EXIST';
+ }
+ startImplicitCall(i + 1);
+ return forward(2);
+ }
+ if (__indexOf.call(IMPLICIT_FUNC, tag) >= 0 && this.matchTags(i + 1, 'INDENT', null, ':') && !this.findTagsBackwards(i, ['CLASS', 'EXTENDS', 'IF', 'CATCH', 'SWITCH', 'LEADING_WHEN', 'FOR', 'WHILE', 'UNTIL'])) {
+ startImplicitCall(i + 1);
+ stack.push(['INDENT', i + 2]);
+ return forward(3);
+ }
+ if (tag === ':') {
+ if (this.tag(i - 2) === '@') {
+ s = i - 2;
+ } else {
+ s = i - 1;
+ }
+ while (this.tag(s - 2) === 'HERECOMMENT') {
+ s -= 2;
+ }
+ this.insideForDeclaration = nextTag === 'FOR';
+ startsLine = s === 0 || (_ref2 = this.tag(s - 1), __indexOf.call(LINEBREAKS, _ref2) >= 0) || tokens[s - 1].newLine;
+ if (stackTop()) {
+ _ref3 = stackTop(), stackTag = _ref3[0], stackIdx = _ref3[1];
+ if ((stackTag === '{' || stackTag === 'INDENT' && this.tag(stackIdx - 1) === '{') && (startsLine || this.tag(s - 1) === ',' || this.tag(s - 1) === '{')) {
+ return forward(1);
+ }
+ }
+ startImplicitObject(s, !!startsLine);
+ return forward(2);
+ }
+ if (inImplicitObject() && __indexOf.call(LINEBREAKS, tag) >= 0) {
+ stackTop()[2].sameLine = false;
+ }
+ newLine = prevTag === 'OUTDENT' || prevToken.newLine;
+ if (__indexOf.call(IMPLICIT_END, tag) >= 0 || __indexOf.call(CALL_CLOSERS, tag) >= 0 && newLine) {
+ while (inImplicit()) {
+ _ref4 = stackTop(), stackTag = _ref4[0], stackIdx = _ref4[1], (_ref5 = _ref4[2], sameLine = _ref5.sameLine, startsLine = _ref5.startsLine);
+ if (inImplicitCall() && prevTag !== ',') {
+ endImplicitCall();
+ } else if (inImplicitObject() && !this.insideForDeclaration && sameLine && tag !== 'TERMINATOR' && prevTag !== ':' && endImplicitObject()) {
+
+ } else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
+ endImplicitObject();
+ } else {
+ break;
+ }
+ }
+ }
+ if (tag === ',' && !this.looksObjectish(i + 1) && inImplicitObject() && !this.insideForDeclaration && (nextTag !== 'TERMINATOR' || !this.looksObjectish(i + 2))) {
+ offset = nextTag === 'OUTDENT' ? 1 : 0;
+ while (inImplicitObject()) {
+ endImplicitObject(i + offset);
+ }
+ }
+ return forward(1);
+ });
+ };
+
+ Rewriter.prototype.addLocationDataToGeneratedTokens = function() {
+ return this.scanTokens(function(token, i, tokens) {
+ var column, line, nextLocation, prevLocation, _ref, _ref1;
+ if (token[2]) {
+ return 1;
+ }
+ if (!(token.generated || token.explicit)) {
+ return 1;
+ }
+ if (token[0] === '{' && (nextLocation = (_ref = tokens[i + 1]) != null ? _ref[2] : void 0)) {
+ line = nextLocation.first_line, column = nextLocation.first_column;
+ } else if (prevLocation = (_ref1 = tokens[i - 1]) != null ? _ref1[2] : void 0) {
+ line = prevLocation.last_line, column = prevLocation.last_column;
+ } else {
+ line = column = 0;
+ }
+ token[2] = {
+ first_line: line,
+ first_column: column,
+ last_line: line,
+ last_column: column
+ };
+ return 1;
+ });
+ };
+
+ Rewriter.prototype.normalizeLines = function() {
+ var action, condition, indent, outdent, starter;
+ starter = indent = outdent = null;
+ condition = function(token, i) {
+ var _ref, _ref1, _ref2, _ref3;
+ return token[1] !== ';' && (_ref = token[0], __indexOf.call(SINGLE_CLOSERS, _ref) >= 0) && !(token[0] === 'TERMINATOR' && (_ref1 = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref1) >= 0)) && !(token[0] === 'ELSE' && starter !== 'THEN') && !(((_ref2 = token[0]) === 'CATCH' || _ref2 === 'FINALLY') && (starter === '->' || starter === '=>')) || (_ref3 = token[0], __indexOf.call(CALL_CLOSERS, _ref3) >= 0) && this.tokens[i - 1].newLine;
+ };
+ action = function(token, i) {
+ return this.tokens.splice((this.tag(i - 1) === ',' ? i - 1 : i), 0, outdent);
+ };
+ return this.scanTokens(function(token, i, tokens) {
+ var j, tag, _i, _ref, _ref1, _ref2;
+ tag = token[0];
+ if (tag === 'TERMINATOR') {
+ if (this.tag(i + 1) === 'ELSE' && this.tag(i - 1) !== 'OUTDENT') {
+ tokens.splice.apply(tokens, [i, 1].concat(__slice.call(this.indentation())));
+ return 1;
+ }
+ if (_ref = this.tag(i + 1), __indexOf.call(EXPRESSION_CLOSE, _ref) >= 0) {
+ tokens.splice(i, 1);
+ return 0;
+ }
+ }
+ if (tag === 'CATCH') {
+ for (j = _i = 1; _i <= 2; j = ++_i) {
+ if (!((_ref1 = this.tag(i + j)) === 'OUTDENT' || _ref1 === 'TERMINATOR' || _ref1 === 'FINALLY')) {
+ continue;
+ }
+ tokens.splice.apply(tokens, [i + j, 0].concat(__slice.call(this.indentation())));
+ return 2 + j;
+ }
+ }
+ if (__indexOf.call(SINGLE_LINERS, tag) >= 0 && this.tag(i + 1) !== 'INDENT' && !(tag === 'ELSE' && this.tag(i + 1) === 'IF')) {
+ starter = tag;
+ _ref2 = this.indentation(tokens[i]), indent = _ref2[0], outdent = _ref2[1];
+ if (starter === 'THEN') {
+ indent.fromThen = true;
+ }
+ tokens.splice(i + 1, 0, indent);
+ this.detectEnd(i + 2, condition, action);
+ if (tag === 'THEN') {
+ tokens.splice(i, 1);
+ }
+ return 1;
+ }
+ return 1;
+ });
+ };
+
+ Rewriter.prototype.tagPostfixConditionals = function() {
+ var action, condition, original;
+ original = null;
+ condition = function(token, i) {
+ var prevTag, tag;
+ tag = token[0];
+ prevTag = this.tokens[i - 1][0];
+ return tag === 'TERMINATOR' || (tag === 'INDENT' && __indexOf.call(SINGLE_LINERS, prevTag) < 0);
+ };
+ action = function(token, i) {
+ if (token[0] !== 'INDENT' || (token.generated && !token.fromThen)) {
+ return original[0] = 'POST_' + original[0];
+ }
+ };
+ return this.scanTokens(function(token, i) {
+ if (token[0] !== 'IF') {
+ return 1;
+ }
+ original = token;
+ this.detectEnd(i + 1, condition, action);
+ return 1;
+ });
+ };
+
+ Rewriter.prototype.indentation = function(origin) {
+ var indent, outdent;
+ indent = ['INDENT', 2];
+ outdent = ['OUTDENT', 2];
+ if (origin) {
+ indent.generated = outdent.generated = true;
+ indent.origin = outdent.origin = origin;
+ } else {
+ indent.explicit = outdent.explicit = true;
+ }
+ return [indent, outdent];
+ };
+
+ Rewriter.prototype.generate = generate;
+
+ Rewriter.prototype.tag = function(i) {
+ var _ref;
+ return (_ref = this.tokens[i]) != null ? _ref[0] : void 0;
+ };
+
+ return Rewriter;
+
+ })();
+
+ BALANCED_PAIRS = [['(', ')'], ['[', ']'], ['{', '}'], ['INDENT', 'OUTDENT'], ['CALL_START', 'CALL_END'], ['PARAM_START', 'PARAM_END'], ['INDEX_START', 'INDEX_END']];
+
+ exports.INVERSES = INVERSES = {};
+
+ EXPRESSION_START = [];
+
+ EXPRESSION_END = [];
+
+ for (_i = 0, _len = BALANCED_PAIRS.length; _i < _len; _i++) {
+ _ref = BALANCED_PAIRS[_i], left = _ref[0], rite = _ref[1];
+ EXPRESSION_START.push(INVERSES[rite] = left);
+ EXPRESSION_END.push(INVERSES[left] = rite);
+ }
+
+ EXPRESSION_CLOSE = ['CATCH', 'THEN', 'ELSE', 'FINALLY'].concat(EXPRESSION_END);
+
+ IMPLICIT_FUNC = ['IDENTIFIER', 'SUPER', ')', 'CALL_END', ']', 'INDEX_END', '@', 'THIS'];
+
+ IMPLICIT_CALL = ['IDENTIFIER', 'NUMBER', 'STRING', 'JS', 'REGEX', 'NEW', 'PARAM_START', 'CLASS', 'IF', 'TRY', 'SWITCH', 'THIS', 'BOOL', 'NULL', 'UNDEFINED', 'UNARY', 'UNARY_MATH', 'SUPER', 'THROW', '@', '->', '=>', '[', '(', '{', '--', '++'];
+
+ IMPLICIT_UNSPACED_CALL = ['+', '-'];
+
+ IMPLICIT_END = ['POST_IF', 'FOR', 'WHILE', 'UNTIL', 'WHEN', 'BY', 'LOOP', 'TERMINATOR'];
+
+ SINGLE_LINERS = ['ELSE', '->', '=>', 'TRY', 'FINALLY', 'THEN'];
+
+ SINGLE_CLOSERS = ['TERMINATOR', 'CATCH', 'FINALLY', 'ELSE', 'OUTDENT', 'LEADING_WHEN'];
+
+ LINEBREAKS = ['TERMINATOR', 'INDENT', 'OUTDENT'];
+
+ CALL_CLOSERS = ['.', '?.', '::', '?::'];
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/scope.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/scope.js
new file mode 100644
index 000000000..cb43b024f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/scope.js
@@ -0,0 +1,146 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var Scope, extend, last, _ref;
+
+ _ref = require('./helpers'), extend = _ref.extend, last = _ref.last;
+
+ exports.Scope = Scope = (function() {
+ Scope.root = null;
+
+ function Scope(parent, expressions, method) {
+ this.parent = parent;
+ this.expressions = expressions;
+ this.method = method;
+ this.variables = [
+ {
+ name: 'arguments',
+ type: 'arguments'
+ }
+ ];
+ this.positions = {};
+ if (!this.parent) {
+ Scope.root = this;
+ }
+ }
+
+ Scope.prototype.add = function(name, type, immediate) {
+ if (this.shared && !immediate) {
+ return this.parent.add(name, type, immediate);
+ }
+ if (Object.prototype.hasOwnProperty.call(this.positions, name)) {
+ return this.variables[this.positions[name]].type = type;
+ } else {
+ return this.positions[name] = this.variables.push({
+ name: name,
+ type: type
+ }) - 1;
+ }
+ };
+
+ Scope.prototype.namedMethod = function() {
+ var _ref1;
+ if (((_ref1 = this.method) != null ? _ref1.name : void 0) || !this.parent) {
+ return this.method;
+ }
+ return this.parent.namedMethod();
+ };
+
+ Scope.prototype.find = function(name) {
+ if (this.check(name)) {
+ return true;
+ }
+ this.add(name, 'var');
+ return false;
+ };
+
+ Scope.prototype.parameter = function(name) {
+ if (this.shared && this.parent.check(name, true)) {
+ return;
+ }
+ return this.add(name, 'param');
+ };
+
+ Scope.prototype.check = function(name) {
+ var _ref1;
+ return !!(this.type(name) || ((_ref1 = this.parent) != null ? _ref1.check(name) : void 0));
+ };
+
+ Scope.prototype.temporary = function(name, index) {
+ if (name.length > 1) {
+ return '_' + name + (index > 1 ? index - 1 : '');
+ } else {
+ return '_' + (index + parseInt(name, 36)).toString(36).replace(/\d/g, 'a');
+ }
+ };
+
+ Scope.prototype.type = function(name) {
+ var v, _i, _len, _ref1;
+ _ref1 = this.variables;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ v = _ref1[_i];
+ if (v.name === name) {
+ return v.type;
+ }
+ }
+ return null;
+ };
+
+ Scope.prototype.freeVariable = function(name, reserve) {
+ var index, temp;
+ if (reserve == null) {
+ reserve = true;
+ }
+ index = 0;
+ while (this.check((temp = this.temporary(name, index)))) {
+ index++;
+ }
+ if (reserve) {
+ this.add(temp, 'var', true);
+ }
+ return temp;
+ };
+
+ Scope.prototype.assign = function(name, value) {
+ this.add(name, {
+ value: value,
+ assigned: true
+ }, true);
+ return this.hasAssignments = true;
+ };
+
+ Scope.prototype.hasDeclarations = function() {
+ return !!this.declaredVariables().length;
+ };
+
+ Scope.prototype.declaredVariables = function() {
+ var realVars, tempVars, v, _i, _len, _ref1;
+ realVars = [];
+ tempVars = [];
+ _ref1 = this.variables;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ v = _ref1[_i];
+ if (v.type === 'var') {
+ (v.name.charAt(0) === '_' ? tempVars : realVars).push(v.name);
+ }
+ }
+ return realVars.sort().concat(tempVars.sort());
+ };
+
+ Scope.prototype.assignedVariables = function() {
+ var v, _i, _len, _ref1, _results;
+ _ref1 = this.variables;
+ _results = [];
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ v = _ref1[_i];
+ if (v.type.assigned) {
+ _results.push("" + v.name + " = " + v.type.value);
+ }
+ }
+ return _results;
+ };
+
+ return Scope;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/sourcemap.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/sourcemap.js
new file mode 100644
index 000000000..c94ebd170
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/lib/coffee-script/sourcemap.js
@@ -0,0 +1,161 @@
+// Generated by CoffeeScript 1.8.0
+(function() {
+ var LineMap, SourceMap;
+
+ LineMap = (function() {
+ function LineMap(line) {
+ this.line = line;
+ this.columns = [];
+ }
+
+ LineMap.prototype.add = function(column, _arg, options) {
+ var sourceColumn, sourceLine;
+ sourceLine = _arg[0], sourceColumn = _arg[1];
+ if (options == null) {
+ options = {};
+ }
+ if (this.columns[column] && options.noReplace) {
+ return;
+ }
+ return this.columns[column] = {
+ line: this.line,
+ column: column,
+ sourceLine: sourceLine,
+ sourceColumn: sourceColumn
+ };
+ };
+
+ LineMap.prototype.sourceLocation = function(column) {
+ var mapping;
+ while (!((mapping = this.columns[column]) || (column <= 0))) {
+ column--;
+ }
+ return mapping && [mapping.sourceLine, mapping.sourceColumn];
+ };
+
+ return LineMap;
+
+ })();
+
+ SourceMap = (function() {
+ var BASE64_CHARS, VLQ_CONTINUATION_BIT, VLQ_SHIFT, VLQ_VALUE_MASK;
+
+ function SourceMap() {
+ this.lines = [];
+ }
+
+ SourceMap.prototype.add = function(sourceLocation, generatedLocation, options) {
+ var column, line, lineMap, _base;
+ if (options == null) {
+ options = {};
+ }
+ line = generatedLocation[0], column = generatedLocation[1];
+ lineMap = ((_base = this.lines)[line] || (_base[line] = new LineMap(line)));
+ return lineMap.add(column, sourceLocation, options);
+ };
+
+ SourceMap.prototype.sourceLocation = function(_arg) {
+ var column, line, lineMap;
+ line = _arg[0], column = _arg[1];
+ while (!((lineMap = this.lines[line]) || (line <= 0))) {
+ line--;
+ }
+ return lineMap && lineMap.sourceLocation(column);
+ };
+
+ SourceMap.prototype.generate = function(options, code) {
+ var buffer, lastColumn, lastSourceColumn, lastSourceLine, lineMap, lineNumber, mapping, needComma, v3, writingline, _i, _j, _len, _len1, _ref, _ref1;
+ if (options == null) {
+ options = {};
+ }
+ if (code == null) {
+ code = null;
+ }
+ writingline = 0;
+ lastColumn = 0;
+ lastSourceLine = 0;
+ lastSourceColumn = 0;
+ needComma = false;
+ buffer = "";
+ _ref = this.lines;
+ for (lineNumber = _i = 0, _len = _ref.length; _i < _len; lineNumber = ++_i) {
+ lineMap = _ref[lineNumber];
+ if (lineMap) {
+ _ref1 = lineMap.columns;
+ for (_j = 0, _len1 = _ref1.length; _j < _len1; _j++) {
+ mapping = _ref1[_j];
+ if (!(mapping)) {
+ continue;
+ }
+ while (writingline < mapping.line) {
+ lastColumn = 0;
+ needComma = false;
+ buffer += ";";
+ writingline++;
+ }
+ if (needComma) {
+ buffer += ",";
+ needComma = false;
+ }
+ buffer += this.encodeVlq(mapping.column - lastColumn);
+ lastColumn = mapping.column;
+ buffer += this.encodeVlq(0);
+ buffer += this.encodeVlq(mapping.sourceLine - lastSourceLine);
+ lastSourceLine = mapping.sourceLine;
+ buffer += this.encodeVlq(mapping.sourceColumn - lastSourceColumn);
+ lastSourceColumn = mapping.sourceColumn;
+ needComma = true;
+ }
+ }
+ }
+ v3 = {
+ version: 3,
+ file: options.generatedFile || '',
+ sourceRoot: options.sourceRoot || '',
+ sources: options.sourceFiles || [''],
+ names: [],
+ mappings: buffer
+ };
+ if (options.inline) {
+ v3.sourcesContent = [code];
+ }
+ return JSON.stringify(v3, null, 2);
+ };
+
+ VLQ_SHIFT = 5;
+
+ VLQ_CONTINUATION_BIT = 1 << VLQ_SHIFT;
+
+ VLQ_VALUE_MASK = VLQ_CONTINUATION_BIT - 1;
+
+ SourceMap.prototype.encodeVlq = function(value) {
+ var answer, nextChunk, signBit, valueToEncode;
+ answer = '';
+ signBit = value < 0 ? 1 : 0;
+ valueToEncode = (Math.abs(value) << 1) + signBit;
+ while (valueToEncode || !answer) {
+ nextChunk = valueToEncode & VLQ_VALUE_MASK;
+ valueToEncode = valueToEncode >> VLQ_SHIFT;
+ if (valueToEncode) {
+ nextChunk |= VLQ_CONTINUATION_BIT;
+ }
+ answer += this.encodeBase64(nextChunk);
+ }
+ return answer;
+ };
+
+ BASE64_CHARS = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
+
+ SourceMap.prototype.encodeBase64 = function(value) {
+ return BASE64_CHARS[value] || (function() {
+ throw new Error("Cannot Base64 encode value: " + value);
+ })();
+ };
+
+ return SourceMap;
+
+ })();
+
+ module.exports = SourceMap;
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.npmignore b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.npmignore
new file mode 100644
index 000000000..9303c347e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.npmignore
@@ -0,0 +1,2 @@
+node_modules/
+npm-debug.log
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.travis.yml b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.travis.yml
new file mode 100644
index 000000000..84fd7ca24
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/.travis.yml
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.6
+ - 0.8
+ - 0.9
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/LICENSE b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/LICENSE
new file mode 100644
index 000000000..432d1aeb0
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/LICENSE
@@ -0,0 +1,21 @@
+Copyright 2010 James Halliday (mail@substack.net)
+
+This project is free software released under the MIT/X11 license:
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js
new file mode 100644
index 000000000..e6924212e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/examples/pow.js
@@ -0,0 +1,6 @@
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/index.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/index.js
new file mode 100644
index 000000000..fda6de8a2
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/index.js
@@ -0,0 +1,82 @@
+var path = require('path');
+var fs = require('fs');
+
+module.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;
+
+function mkdirP (p, mode, f, made) {
+ if (typeof mode === 'function' || mode === undefined) {
+ f = mode;
+ mode = 0777 & (~process.umask());
+ }
+ if (!made) made = null;
+
+ var cb = f || function () {};
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ fs.mkdir(p, mode, function (er) {
+ if (!er) {
+ made = made || p;
+ return cb(null, made);
+ }
+ switch (er.code) {
+ case 'ENOENT':
+ mkdirP(path.dirname(p), mode, function (er, made) {
+ if (er) cb(er, made);
+ else mkdirP(p, mode, cb, made);
+ });
+ break;
+
+ // In the case of any other error, just see if there's a dir
+ // there already. If so, then hooray! If not, then something
+ // is borked.
+ default:
+ fs.stat(p, function (er2, stat) {
+ // if the stat fails, then that's super weird.
+ // let the original error be the failure reason.
+ if (er2 || !stat.isDirectory()) cb(er, made)
+ else cb(null, made);
+ });
+ break;
+ }
+ });
+}
+
+mkdirP.sync = function sync (p, mode, made) {
+ if (mode === undefined) {
+ mode = 0777 & (~process.umask());
+ }
+ if (!made) made = null;
+
+ if (typeof mode === 'string') mode = parseInt(mode, 8);
+ p = path.resolve(p);
+
+ try {
+ fs.mkdirSync(p, mode);
+ made = made || p;
+ }
+ catch (err0) {
+ switch (err0.code) {
+ case 'ENOENT' :
+ made = sync(path.dirname(p), mode, made);
+ sync(p, mode, made);
+ break;
+
+ // In the case of any other error, just see if there's a dir
+ // there already. If so, then hooray! If not, then something
+ // is borked.
+ default:
+ var stat;
+ try {
+ stat = fs.statSync(p);
+ }
+ catch (err1) {
+ throw err0;
+ }
+ if (!stat.isDirectory()) throw err0;
+ break;
+ }
+ }
+
+ return made;
+};
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/package.json b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/package.json
new file mode 100644
index 000000000..221a22e3f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/package.json
@@ -0,0 +1,34 @@
+{
+ "name": "mkdirp",
+ "description": "Recursively mkdir, like `mkdir -p`",
+ "version": "0.3.5",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "main": "./index",
+ "keywords": [
+ "mkdir",
+ "directory"
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/substack/node-mkdirp.git"
+ },
+ "scripts": {
+ "test": "tap test/*.js"
+ },
+ "devDependencies": {
+ "tap": "~0.4.0"
+ },
+ "license": "MIT",
+ "readme": "# mkdirp\n\nLike `mkdir -p`, but in node.js!\n\n[](http://travis-ci.org/substack/node-mkdirp)\n\n# example\n\n## pow.js\n\n```js\nvar mkdirp = require('mkdirp');\n \nmkdirp('/tmp/foo/bar/baz', function (err) {\n if (err) console.error(err)\n else console.log('pow!')\n});\n```\n\nOutput\n\n```\npow!\n```\n\nAnd now /tmp/foo/bar/baz exists, huzzah!\n\n# methods\n\n```js\nvar mkdirp = require('mkdirp');\n```\n\n## mkdirp(dir, mode, cb)\n\nCreate a new directory and any necessary subdirectories at `dir` with octal\npermission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\n`cb(err, made)` fires with the error or the first directory `made`\nthat had to be created, if any.\n\n## mkdirp.sync(dir, mode)\n\nSynchronously create a new directory and any necessary subdirectories at `dir`\nwith octal permission string `mode`.\n\nIf `mode` isn't specified, it defaults to `0777 & (~process.umask())`.\n\nReturns the first directory that had to be created, if any.\n\n# install\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install mkdirp\n```\n\n# license\n\nMIT\n",
+ "readmeFilename": "readme.markdown",
+ "bugs": {
+ "url": "https://github.com/substack/node-mkdirp/issues"
+ },
+ "homepage": "https://github.com/substack/node-mkdirp",
+ "_id": "mkdirp@0.3.5",
+ "_from": "mkdirp@~0.3.5"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/readme.markdown b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
new file mode 100644
index 000000000..83b0216ab
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/readme.markdown
@@ -0,0 +1,63 @@
+# mkdirp
+
+Like `mkdir -p`, but in node.js!
+
+[](http://travis-ci.org/substack/node-mkdirp)
+
+# example
+
+## pow.js
+
+```js
+var mkdirp = require('mkdirp');
+
+mkdirp('/tmp/foo/bar/baz', function (err) {
+ if (err) console.error(err)
+ else console.log('pow!')
+});
+```
+
+Output
+
+```
+pow!
+```
+
+And now /tmp/foo/bar/baz exists, huzzah!
+
+# methods
+
+```js
+var mkdirp = require('mkdirp');
+```
+
+## mkdirp(dir, mode, cb)
+
+Create a new directory and any necessary subdirectories at `dir` with octal
+permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+`cb(err, made)` fires with the error or the first directory `made`
+that had to be created, if any.
+
+## mkdirp.sync(dir, mode)
+
+Synchronously create a new directory and any necessary subdirectories at `dir`
+with octal permission string `mode`.
+
+If `mode` isn't specified, it defaults to `0777 & (~process.umask())`.
+
+Returns the first directory that had to be created, if any.
+
+# install
+
+With [npm](http://npmjs.org) do:
+
+```
+npm install mkdirp
+```
+
+# license
+
+MIT
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js
new file mode 100644
index 000000000..520dcb8e9
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/chmod.js
@@ -0,0 +1,38 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+test('chmod-pre', function (t) {
+ var mode = 0744
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
+ t.end();
+ });
+ });
+});
+
+test('chmod', function (t) {
+ var mode = 0755
+ mkdirp(file, mode, function (er) {
+ t.ifError(er, 'should not error');
+ fs.stat(file, function (er, stat) {
+ t.ifError(er, 'should exist');
+ t.ok(stat && stat.isDirectory(), 'should be directory');
+ t.end();
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js
new file mode 100644
index 000000000..0eb709987
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/clobber.js
@@ -0,0 +1,37 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+var ps = [ '', 'tmp' ];
+
+for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+}
+
+var file = ps.join('/');
+
+// a file in the way
+var itw = ps.slice(0, 3).join('/');
+
+
+test('clobber-pre', function (t) {
+ console.error("about to write to "+itw)
+ fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
+
+ fs.stat(itw, function (er, stat) {
+ t.ifError(er)
+ t.ok(stat && stat.isFile(), 'should be file')
+ t.end()
+ })
+})
+
+test('clobber', function (t) {
+ t.plan(2);
+ mkdirp(file, 0755, function (err) {
+ t.ok(err);
+ t.equal(err.code, 'ENOTDIR');
+ t.end();
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js
new file mode 100644
index 000000000..b07cd70c1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/mkdirp.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('woo', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm.js
new file mode 100644
index 000000000..23a7abbd2
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('async perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16);
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
+
+test('async root perm', function (t) {
+ mkdirp('/tmp', 0755, function (err) {
+ if (err) t.fail(err);
+ t.end();
+ });
+ t.end();
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js
new file mode 100644
index 000000000..f685f6090
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/perm_sync.js
@@ -0,0 +1,39 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync perm', function (t) {
+ t.plan(2);
+ var file = '/tmp/' + (Math.random() * (1<<30)).toString(16) + '.json';
+
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
+
+test('sync root perm', function (t) {
+ t.plan(1);
+
+ var file = '/tmp';
+ mkdirp.sync(file, 0755);
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/race.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/race.js
new file mode 100644
index 000000000..96a044763
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/race.js
@@ -0,0 +1,41 @@
+var mkdirp = require('../').mkdirp;
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('race', function (t) {
+ t.plan(4);
+ var ps = [ '', 'tmp' ];
+
+ for (var i = 0; i < 25; i++) {
+ var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ ps.push(dir);
+ }
+ var file = ps.join('/');
+
+ var res = 2;
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ mk(file, function () {
+ if (--res === 0) t.end();
+ });
+
+ function mk (file, cb) {
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ if (cb) cb();
+ }
+ })
+ })
+ });
+ }
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/rel.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/rel.js
new file mode 100644
index 000000000..79858243a
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/rel.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('rel', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var cwd = process.cwd();
+ process.chdir('/tmp');
+
+ var file = [x,y,z].join('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ process.chdir(cwd);
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return.js
new file mode 100644
index 000000000..bce68e561
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return.js
@@ -0,0 +1,25 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+ t.plan(4);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ // should return the first dir created.
+ // By this point, it would be profoundly surprising if /tmp didn't
+ // already exist, since every other test makes things in there.
+ mkdirp(file, function (err, made) {
+ t.ifError(err);
+ t.equal(made, '/tmp/' + x);
+ mkdirp(file, function (err, made) {
+ t.ifError(err);
+ t.equal(made, null);
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js
new file mode 100644
index 000000000..7c222d355
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/return_sync.js
@@ -0,0 +1,24 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('return value', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ // should return the first dir created.
+ // By this point, it would be profoundly surprising if /tmp didn't
+ // already exist, since every other test makes things in there.
+ // Note that this will throw on failure, which will fail the test.
+ var made = mkdirp.sync(file);
+ t.equal(made, '/tmp/' + x);
+
+ // making the same file again should have no effect.
+ made = mkdirp.sync(file);
+ t.equal(made, null);
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/root.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/root.js
new file mode 100644
index 000000000..97ad7a2f3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/root.js
@@ -0,0 +1,18 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('root', function (t) {
+ // '/' on unix, 'c:/' on windows.
+ var file = path.resolve('/');
+
+ mkdirp(file, 0755, function (err) {
+ if (err) throw err
+ fs.stat(file, function (er, stat) {
+ if (er) throw er
+ t.ok(stat.isDirectory(), 'target is a directory');
+ t.end();
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/sync.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/sync.js
new file mode 100644
index 000000000..7530cada8
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('sync', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ try {
+ mkdirp.sync(file, 0755);
+ } catch (err) {
+ t.fail(err);
+ return t.end();
+ }
+
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0755);
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask.js
new file mode 100644
index 000000000..64ccafe22
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask.js
@@ -0,0 +1,28 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('implicit mode from umask', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ mkdirp(file, function (err) {
+ if (err) t.fail(err);
+ else path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, 0777 & (~process.umask()));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ })
+ })
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js
new file mode 100644
index 000000000..35bd5cbbf
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/node_modules/mkdirp/test/umask_sync.js
@@ -0,0 +1,32 @@
+var mkdirp = require('../');
+var path = require('path');
+var fs = require('fs');
+var test = require('tap').test;
+
+test('umask sync modes', function (t) {
+ t.plan(2);
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
+
+ var file = '/tmp/' + [x,y,z].join('/');
+
+ try {
+ mkdirp.sync(file);
+ } catch (err) {
+ t.fail(err);
+ return t.end();
+ }
+
+ path.exists(file, function (ex) {
+ if (!ex) t.fail('file not created')
+ else fs.stat(file, function (err, stat) {
+ if (err) t.fail(err)
+ else {
+ t.equal(stat.mode & 0777, (0777 & (~process.umask())));
+ t.ok(stat.isDirectory(), 'target not a directory');
+ t.end();
+ }
+ });
+ });
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/package.json b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/package.json
new file mode 100644
index 000000000..b9cbf8d08
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/package.json
@@ -0,0 +1,52 @@
+{
+ "name": "coffee-script",
+ "description": "Unfancy JavaScript",
+ "keywords": [
+ "javascript",
+ "language",
+ "coffeescript",
+ "compiler"
+ ],
+ "author": {
+ "name": "Jeremy Ashkenas"
+ },
+ "version": "1.8.0",
+ "license": "MIT",
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "directories": {
+ "lib": "./lib/coffee-script"
+ },
+ "main": "./lib/coffee-script/coffee-script",
+ "bin": {
+ "coffee": "./bin/coffee",
+ "cake": "./bin/cake"
+ },
+ "preferGlobal": true,
+ "scripts": {
+ "test": "node ./bin/cake test"
+ },
+ "homepage": "http://coffeescript.org",
+ "bugs": {
+ "url": "https://github.com/jashkenas/coffeescript/issues"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/jashkenas/coffeescript.git"
+ },
+ "devDependencies": {
+ "uglify-js": "~2.2",
+ "jison": ">=0.2.0",
+ "highlight.js": "~8.0.0",
+ "underscore": "~1.5.2",
+ "docco": "~0.6.2"
+ },
+ "dependencies": {
+ "mkdirp": "~0.3.5"
+ },
+ "readme": " {\n } } {\n { { } }\n } }{ {\n { }{ } } _____ __ __\n { }{ }{ { } / ____| / _|/ _|\n .- { { } { }} -. | | ___ | |_| |_ ___ ___\n ( { } { } { } } ) | | / _ \\| _| _/ _ \\/ _ \\\n |`-..________ ..-'| | |___| (_) | | | || __/ __/\n | | \\_____\\___/|_| |_| \\___|\\___|\n | ;--.\n | (__ \\ _____ _ _\n | | ) ) / ____| (_) | |\n | |/ / | (___ ___ _ __ _ _ __ | |_\n | ( / \\___ \\ / __| '__| | '_ \\| __|\n | |/ ____) | (__| | | | |_) | |_\n | | |_____/ \\___|_| |_| .__/ \\__|\n `-.._________..-' | |\n |_|\n\n\n CoffeeScript is a little language that compiles into JavaScript.\n\n If you have the Node Package Manager installed:\n npm install -g coffee-script\n (Leave off the -g if you don't wish to install globally.)\n\n Or, if you don't wish to use npm:\n sudo bin/cake install\n\n Execute a script:\n coffee /path/to/script.coffee\n\n Compile a script:\n coffee -c /path/to/script.coffee\n\n For documentation, usage, and examples, see:\n http://coffeescript.org/\n\n To suggest a feature, report a bug, or general discussion:\n http://github.com/jashkenas/coffeescript/issues/\n\n If you'd like to chat, drop by #coffeescript on Freenode IRC,\n or on webchat.freenode.net.\n\n The source repository:\n git://github.com/jashkenas/coffeescript.git\n\n Top 100 contributors are listed here:\n http://github.com/jashkenas/coffeescript/contributors\n",
+ "readmeFilename": "README",
+ "_id": "coffee-script@1.8.0",
+ "_from": "coffee-script@~1.8.0"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/register.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/register.js
new file mode 100644
index 000000000..97b33d729
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/register.js
@@ -0,0 +1 @@
+require('./lib/coffee-script/register');
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/repl.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/repl.js
new file mode 100644
index 000000000..d2706a7a3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/coffee-script/repl.js
@@ -0,0 +1 @@
+module.exports = require('./lib/coffee-script/repl');
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.npmignore b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.npmignore
new file mode 100644
index 000000000..3dddf3f67
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.npmignore
@@ -0,0 +1,2 @@
+dist/*
+node_modules/*
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.travis.yml b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.travis.yml
new file mode 100644
index 000000000..ddc9c4f98
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.8
+ - "0.10"
\ No newline at end of file
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/CHANGELOG.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/CHANGELOG.md
new file mode 100644
index 000000000..2e7ca5d27
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/CHANGELOG.md
@@ -0,0 +1,194 @@
+# Change Log
+
+## 0.1.43
+
+* Performance improvements for `SourceMapGenerator` and `SourceNode`. See issue
+ #148 for some discussion and issues #150, #151, and #152 for implementations.
+
+## 0.1.42
+
+* Fix an issue where `SourceNode`s from different versions of the source-map
+ library couldn't be used in conjunction with each other. See issue #142.
+
+## 0.1.41
+
+* Fix a bug with getting the source content of relative sources with a "./"
+ prefix. See issue #145 and [Bug 1090768](bugzil.la/1090768).
+
+* Add the `SourceMapConsumer.prototype.computeColumnSpans` method to compute the
+ column span of each mapping.
+
+* Add the `SourceMapConsumer.prototype.allGeneratedPositionsFor` method to find
+ all generated positions associated with a given original source and line.
+
+## 0.1.40
+
+* Performance improvements for parsing source maps in SourceMapConsumer.
+
+## 0.1.39
+
+* Fix a bug where setting a source's contents to null before any source content
+ had been set before threw a TypeError. See issue #131.
+
+## 0.1.38
+
+* Fix a bug where finding relative paths from an empty path were creating
+ absolute paths. See issue #129.
+
+## 0.1.37
+
+* Fix a bug where if the source root was an empty string, relative source paths
+ would turn into absolute source paths. Issue #124.
+
+## 0.1.36
+
+* Allow the `names` mapping property to be an empty string. Issue #121.
+
+## 0.1.35
+
+* A third optional parameter was added to `SourceNode.fromStringWithSourceMap`
+ to specify a path that relative sources in the second parameter should be
+ relative to. Issue #105.
+
+* If no file property is given to a `SourceMapGenerator`, then the resulting
+ source map will no longer have a `null` file property. The property will
+ simply not exist. Issue #104.
+
+* Fixed a bug where consecutive newlines were ignored in `SourceNode`s.
+ Issue #116.
+
+## 0.1.34
+
+* Make `SourceNode` work with windows style ("\r\n") newlines. Issue #103.
+
+* Fix bug involving source contents and the
+ `SourceMapGenerator.prototype.applySourceMap`. Issue #100.
+
+## 0.1.33
+
+* Fix some edge cases surrounding path joining and URL resolution.
+
+* Add a third parameter for relative path to
+ `SourceMapGenerator.prototype.applySourceMap`.
+
+* Fix issues with mappings and EOLs.
+
+## 0.1.32
+
+* Fixed a bug where SourceMapConsumer couldn't handle negative relative columns
+ (issue 92).
+
+* Fixed test runner to actually report number of failed tests as its process
+ exit code.
+
+* Fixed a typo when reporting bad mappings (issue 87).
+
+## 0.1.31
+
+* Delay parsing the mappings in SourceMapConsumer until queried for a source
+ location.
+
+* Support Sass source maps (which at the time of writing deviate from the spec
+ in small ways) in SourceMapConsumer.
+
+## 0.1.30
+
+* Do not join source root with a source, when the source is a data URI.
+
+* Extend the test runner to allow running single specific test files at a time.
+
+* Performance improvements in `SourceNode.prototype.walk` and
+ `SourceMapConsumer.prototype.eachMapping`.
+
+* Source map browser builds will now work inside Workers.
+
+* Better error messages when attempting to add an invalid mapping to a
+ `SourceMapGenerator`.
+
+## 0.1.29
+
+* Allow duplicate entries in the `names` and `sources` arrays of source maps
+ (usually from TypeScript) we are parsing. Fixes github issue 72.
+
+## 0.1.28
+
+* Skip duplicate mappings when creating source maps from SourceNode; github
+ issue 75.
+
+## 0.1.27
+
+* Don't throw an error when the `file` property is missing in SourceMapConsumer,
+ we don't use it anyway.
+
+## 0.1.26
+
+* Fix SourceNode.fromStringWithSourceMap for empty maps. Fixes github issue 70.
+
+## 0.1.25
+
+* Make compatible with browserify
+
+## 0.1.24
+
+* Fix issue with absolute paths and `file://` URIs. See
+ https://bugzilla.mozilla.org/show_bug.cgi?id=885597
+
+## 0.1.23
+
+* Fix issue with absolute paths and sourcesContent, github issue 64.
+
+## 0.1.22
+
+* Ignore duplicate mappings in SourceMapGenerator. Fixes github issue 21.
+
+## 0.1.21
+
+* Fixed handling of sources that start with a slash so that they are relative to
+ the source root's host.
+
+## 0.1.20
+
+* Fixed github issue #43: absolute URLs aren't joined with the source root
+ anymore.
+
+## 0.1.19
+
+* Using Travis CI to run tests.
+
+## 0.1.18
+
+* Fixed a bug in the handling of sourceRoot.
+
+## 0.1.17
+
+* Added SourceNode.fromStringWithSourceMap.
+
+## 0.1.16
+
+* Added missing documentation.
+
+* Fixed the generating of empty mappings in SourceNode.
+
+## 0.1.15
+
+* Added SourceMapGenerator.applySourceMap.
+
+## 0.1.14
+
+* The sourceRoot is now handled consistently.
+
+## 0.1.13
+
+* Added SourceMapGenerator.fromSourceMap.
+
+## 0.1.12
+
+* SourceNode now generates empty mappings too.
+
+## 0.1.11
+
+* Added name support to SourceNode.
+
+## 0.1.10
+
+* Added sourcesContent support to the customer and generator.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/LICENSE b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/LICENSE
new file mode 100644
index 000000000..ed1b7cf27
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/LICENSE
@@ -0,0 +1,28 @@
+
+Copyright (c) 2009-2011, Mozilla Foundation and contributors
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+
+* Neither the names of the Mozilla Foundation nor the names of project
+ contributors may be used to endorse or promote products derived from this
+ software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/Makefile.dryice.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/Makefile.dryice.js
new file mode 100644
index 000000000..d6fc26a79
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/Makefile.dryice.js
@@ -0,0 +1,166 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+var path = require('path');
+var fs = require('fs');
+var copy = require('dryice').copy;
+
+function removeAmdefine(src) {
+ src = String(src).replace(
+ /if\s*\(typeof\s*define\s*!==\s*'function'\)\s*{\s*var\s*define\s*=\s*require\('amdefine'\)\(module,\s*require\);\s*}\s*/g,
+ '');
+ src = src.replace(
+ /\b(define\(.*)('amdefine',?)/gm,
+ '$1');
+ return src;
+}
+removeAmdefine.onRead = true;
+
+function makeNonRelative(src) {
+ return src
+ .replace(/require\('.\//g, 'require(\'source-map/')
+ .replace(/\.\.\/\.\.\/lib\//g, '');
+}
+makeNonRelative.onRead = true;
+
+function buildBrowser() {
+ console.log('\nCreating dist/source-map.js');
+
+ var project = copy.createCommonJsProject({
+ roots: [ path.join(__dirname, 'lib') ]
+ });
+
+ copy({
+ source: [
+ 'build/mini-require.js',
+ {
+ project: project,
+ require: [ 'source-map/source-map-generator',
+ 'source-map/source-map-consumer',
+ 'source-map/source-node']
+ },
+ 'build/suffix-browser.js'
+ ],
+ filter: [
+ copy.filter.moduleDefines,
+ removeAmdefine
+ ],
+ dest: 'dist/source-map.js'
+ });
+}
+
+function buildBrowserMin() {
+ console.log('\nCreating dist/source-map.min.js');
+
+ copy({
+ source: 'dist/source-map.js',
+ filter: copy.filter.uglifyjs,
+ dest: 'dist/source-map.min.js'
+ });
+}
+
+function buildFirefox() {
+ console.log('\nCreating dist/SourceMap.jsm');
+
+ var project = copy.createCommonJsProject({
+ roots: [ path.join(__dirname, 'lib') ]
+ });
+
+ copy({
+ source: [
+ 'build/prefix-source-map.jsm',
+ {
+ project: project,
+ require: [ 'source-map/source-map-consumer',
+ 'source-map/source-map-generator',
+ 'source-map/source-node' ]
+ },
+ 'build/suffix-source-map.jsm'
+ ],
+ filter: [
+ copy.filter.moduleDefines,
+ removeAmdefine,
+ makeNonRelative
+ ],
+ dest: 'dist/SourceMap.jsm'
+ });
+
+ // Create dist/test/Utils.jsm
+ console.log('\nCreating dist/test/Utils.jsm');
+
+ project = copy.createCommonJsProject({
+ roots: [ __dirname, path.join(__dirname, 'lib') ]
+ });
+
+ copy({
+ source: [
+ 'build/prefix-utils.jsm',
+ 'build/assert-shim.js',
+ {
+ project: project,
+ require: [ 'test/source-map/util' ]
+ },
+ 'build/suffix-utils.jsm'
+ ],
+ filter: [
+ copy.filter.moduleDefines,
+ removeAmdefine,
+ makeNonRelative
+ ],
+ dest: 'dist/test/Utils.jsm'
+ });
+
+ function isTestFile(f) {
+ return /^test\-.*?\.js/.test(f);
+ }
+
+ var testFiles = fs.readdirSync(path.join(__dirname, 'test', 'source-map')).filter(isTestFile);
+
+ testFiles.forEach(function (testFile) {
+ console.log('\nCreating', path.join('dist', 'test', testFile.replace(/\-/g, '_')));
+
+ copy({
+ source: [
+ 'build/test-prefix.js',
+ path.join('test', 'source-map', testFile),
+ 'build/test-suffix.js'
+ ],
+ filter: [
+ removeAmdefine,
+ makeNonRelative,
+ function (input, source) {
+ return input.replace('define(',
+ 'define("'
+ + path.join('test', 'source-map', testFile.replace(/\.js$/, ''))
+ + '", ["require", "exports", "module"], ');
+ },
+ function (input, source) {
+ return input.replace('{THIS_MODULE}', function () {
+ return "test/source-map/" + testFile.replace(/\.js$/, '');
+ });
+ }
+ ],
+ dest: path.join('dist', 'test', testFile.replace(/\-/g, '_'))
+ });
+ });
+}
+
+function ensureDir(name) {
+ var dirExists = false;
+ try {
+ dirExists = fs.statSync(name).isDirectory();
+ } catch (err) {}
+
+ if (!dirExists) {
+ fs.mkdirSync(name, 0777);
+ }
+}
+
+ensureDir("dist");
+ensureDir("dist/test");
+buildFirefox();
+buildBrowser();
+buildBrowserMin();
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/README.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/README.md
new file mode 100644
index 000000000..59767aa39
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/README.md
@@ -0,0 +1,475 @@
+# Source Map
+
+This is a library to generate and consume the source map format
+[described here][format].
+
+This library is written in the Asynchronous Module Definition format, and works
+in the following environments:
+
+* Modern Browsers supporting ECMAScript 5 (either after the build, or with an
+ AMD loader such as RequireJS)
+
+* Inside Firefox (as a JSM file, after the build)
+
+* With NodeJS versions 0.8.X and higher
+
+## Node
+
+ $ npm install source-map
+
+## Building from Source (for everywhere else)
+
+Install Node and then run
+
+ $ git clone https://fitzgen@github.com/mozilla/source-map.git
+ $ cd source-map
+ $ npm link .
+
+Next, run
+
+ $ node Makefile.dryice.js
+
+This should spew a bunch of stuff to stdout, and create the following files:
+
+* `dist/source-map.js` - The unminified browser version.
+
+* `dist/source-map.min.js` - The minified browser version.
+
+* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.
+
+## Examples
+
+### Consuming a source map
+
+ var rawSourceMap = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourceRoot: 'http://example.com/www/js/',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+
+ var smc = new SourceMapConsumer(rawSourceMap);
+
+ console.log(smc.sources);
+ // [ 'http://example.com/www/js/one.js',
+ // 'http://example.com/www/js/two.js' ]
+
+ console.log(smc.originalPositionFor({
+ line: 2,
+ column: 28
+ }));
+ // { source: 'http://example.com/www/js/two.js',
+ // line: 2,
+ // column: 10,
+ // name: 'n' }
+
+ console.log(smc.generatedPositionFor({
+ source: 'http://example.com/www/js/two.js',
+ line: 2,
+ column: 10
+ }));
+ // { line: 2, column: 28 }
+
+ smc.eachMapping(function (m) {
+ // ...
+ });
+
+### Generating a source map
+
+In depth guide:
+[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)
+
+#### With SourceNode (high level API)
+
+ function compile(ast) {
+ switch (ast.type) {
+ case 'BinaryExpression':
+ return new SourceNode(
+ ast.location.line,
+ ast.location.column,
+ ast.location.source,
+ [compile(ast.left), " + ", compile(ast.right)]
+ );
+ case 'Literal':
+ return new SourceNode(
+ ast.location.line,
+ ast.location.column,
+ ast.location.source,
+ String(ast.value)
+ );
+ // ...
+ default:
+ throw new Error("Bad AST");
+ }
+ }
+
+ var ast = parse("40 + 2", "add.js");
+ console.log(compile(ast).toStringWithSourceMap({
+ file: 'add.js'
+ }));
+ // { code: '40 + 2',
+ // map: [object SourceMapGenerator] }
+
+#### With SourceMapGenerator (low level API)
+
+ var map = new SourceMapGenerator({
+ file: "source-mapped.js"
+ });
+
+ map.addMapping({
+ generated: {
+ line: 10,
+ column: 35
+ },
+ source: "foo.js",
+ original: {
+ line: 33,
+ column: 2
+ },
+ name: "christopher"
+ });
+
+ console.log(map.toString());
+ // '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
+
+## API
+
+Get a reference to the module:
+
+ // NodeJS
+ var sourceMap = require('source-map');
+
+ // Browser builds
+ var sourceMap = window.sourceMap;
+
+ // Inside Firefox
+ let sourceMap = {};
+ Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);
+
+### SourceMapConsumer
+
+A SourceMapConsumer instance represents a parsed source map which we can query
+for information about the original file positions by giving it a file position
+in the generated source.
+
+#### new SourceMapConsumer(rawSourceMap)
+
+The only parameter is the raw source map (either as a string which can be
+`JSON.parse`'d, or an object). According to the spec, source maps have the
+following attributes:
+
+* `version`: Which version of the source map spec this map is following.
+
+* `sources`: An array of URLs to the original source files.
+
+* `names`: An array of identifiers which can be referrenced by individual
+ mappings.
+
+* `sourceRoot`: Optional. The URL root from which all sources are relative.
+
+* `sourcesContent`: Optional. An array of contents of the original source files.
+
+* `mappings`: A string of base64 VLQs which contain the actual mappings.
+
+* `file`: Optional. The generated filename this source map is associated with.
+
+#### SourceMapConsumer.prototype.computeColumnSpans()
+
+Compute the last column for each generated mapping. The last column is
+inclusive.
+
+#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)
+
+Returns the original source, line, and column information for the generated
+source's line and column positions provided. The only argument is an object with
+the following properties:
+
+* `line`: The line number in the generated source.
+
+* `column`: The column number in the generated source.
+
+and an object is returned with the following properties:
+
+* `source`: The original source file, or null if this information is not
+ available.
+
+* `line`: The line number in the original source, or null if this information is
+ not available.
+
+* `column`: The column number in the original source, or null or null if this
+ information is not available.
+
+* `name`: The original identifier, or null if this information is not available.
+
+#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)
+
+Returns the generated line and column information for the original source,
+line, and column positions provided. The only argument is an object with
+the following properties:
+
+* `source`: The filename of the original source.
+
+* `line`: The line number in the original source.
+
+* `column`: The column number in the original source.
+
+and an object is returned with the following properties:
+
+* `line`: The line number in the generated source, or null.
+
+* `column`: The column number in the generated source, or null.
+
+#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)
+
+Returns all generated line and column information for the original source
+and line provided. The only argument is an object with the following
+properties:
+
+* `source`: The filename of the original source.
+
+* `line`: The line number in the original source.
+
+and an array of objects is returned, each with the following properties:
+
+* `line`: The line number in the generated source, or null.
+
+* `column`: The column number in the generated source, or null.
+
+#### SourceMapConsumer.prototype.sourceContentFor(source)
+
+Returns the original source content for the source provided. The only
+argument is the URL of the original source file.
+
+#### SourceMapConsumer.prototype.eachMapping(callback, context, order)
+
+Iterate over each mapping between an original source/line/column and a
+generated line/column in this source map.
+
+* `callback`: The function that is called with each mapping. Mappings have the
+ form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
+ name }`
+
+* `context`: Optional. If specified, this object will be the value of `this`
+ every time that `callback` is called.
+
+* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
+ `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
+ the mappings sorted by the generated file's line/column order or the
+ original's source/line/column order, respectively. Defaults to
+ `SourceMapConsumer.GENERATED_ORDER`.
+
+### SourceMapGenerator
+
+An instance of the SourceMapGenerator represents a source map which is being
+built incrementally.
+
+#### new SourceMapGenerator([startOfSourceMap])
+
+You may pass an object with the following properties:
+
+* `file`: The filename of the generated source that this source map is
+ associated with.
+
+* `sourceRoot`: A root for all relative URLs in this source map.
+
+* `skipValidation`: Optional. When `true`, disables validation of mappings as
+ they are added. This can improve performance but should be used with
+ discretion, as a last resort. Even then, one should avoid using this flag when
+ running tests, if possible.
+
+#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)
+
+Creates a new SourceMapGenerator based on a SourceMapConsumer
+
+* `sourceMapConsumer` The SourceMap.
+
+#### SourceMapGenerator.prototype.addMapping(mapping)
+
+Add a single mapping from original source line and column to the generated
+source's line and column for this source map being created. The mapping object
+should have the following properties:
+
+* `generated`: An object with the generated line and column positions.
+
+* `original`: An object with the original line and column positions.
+
+* `source`: The original source file (relative to the sourceRoot).
+
+* `name`: An optional original token name for this mapping.
+
+#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)
+
+Set the source content for an original source file.
+
+* `sourceFile` the URL of the original source file.
+
+* `sourceContent` the content of the source file.
+
+#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])
+
+Applies a SourceMap for a source file to the SourceMap.
+Each mapping to the supplied source file is rewritten using the
+supplied SourceMap. Note: The resolution for the resulting mappings
+is the minimium of this map and the supplied map.
+
+* `sourceMapConsumer`: The SourceMap to be applied.
+
+* `sourceFile`: Optional. The filename of the source file.
+ If omitted, sourceMapConsumer.file will be used, if it exists.
+ Otherwise an error will be thrown.
+
+* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
+ to be applied. If relative, it is relative to the SourceMap.
+
+ This parameter is needed when the two SourceMaps aren't in the same
+ directory, and the SourceMap to be applied contains relative source
+ paths. If so, those relative source paths need to be rewritten
+ relative to the SourceMap.
+
+ If omitted, it is assumed that both SourceMaps are in the same directory,
+ thus not needing any rewriting. (Supplying `'.'` has the same effect.)
+
+#### SourceMapGenerator.prototype.toString()
+
+Renders the source map being generated to a string.
+
+### SourceNode
+
+SourceNodes provide a way to abstract over interpolating and/or concatenating
+snippets of generated JavaScript source code, while maintaining the line and
+column information associated between those snippets and the original source
+code. This is useful as the final intermediate representation a compiler might
+use before outputting the generated JS and source map.
+
+#### new SourceNode([line, column, source[, chunk[, name]]])
+
+* `line`: The original line number associated with this source node, or null if
+ it isn't associated with an original line.
+
+* `column`: The original column number associated with this source node, or null
+ if it isn't associated with an original column.
+
+* `source`: The original source's filename; null if no filename is provided.
+
+* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
+ below.
+
+* `name`: Optional. The original identifier.
+
+#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])
+
+Creates a SourceNode from generated code and a SourceMapConsumer.
+
+* `code`: The generated code
+
+* `sourceMapConsumer` The SourceMap for the generated code
+
+* `relativePath` The optional path that relative sources in `sourceMapConsumer`
+ should be relative to.
+
+#### SourceNode.prototype.add(chunk)
+
+Add a chunk of generated JS to this source node.
+
+* `chunk`: A string snippet of generated JS code, another instance of
+ `SourceNode`, or an array where each member is one of those things.
+
+#### SourceNode.prototype.prepend(chunk)
+
+Prepend a chunk of generated JS to this source node.
+
+* `chunk`: A string snippet of generated JS code, another instance of
+ `SourceNode`, or an array where each member is one of those things.
+
+#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)
+
+Set the source content for a source file. This will be added to the
+`SourceMap` in the `sourcesContent` field.
+
+* `sourceFile`: The filename of the source file
+
+* `sourceContent`: The content of the source file
+
+#### SourceNode.prototype.walk(fn)
+
+Walk over the tree of JS snippets in this node and its children. The walking
+function is called once for each snippet of JS and is passed that snippet and
+the its original associated source's line/column location.
+
+* `fn`: The traversal function.
+
+#### SourceNode.prototype.walkSourceContents(fn)
+
+Walk over the tree of SourceNodes. The walking function is called for each
+source file content and is passed the filename and source content.
+
+* `fn`: The traversal function.
+
+#### SourceNode.prototype.join(sep)
+
+Like `Array.prototype.join` except for SourceNodes. Inserts the separator
+between each of this source node's children.
+
+* `sep`: The separator.
+
+#### SourceNode.prototype.replaceRight(pattern, replacement)
+
+Call `String.prototype.replace` on the very right-most source snippet. Useful
+for trimming whitespace from the end of a source node, etc.
+
+* `pattern`: The pattern to replace.
+
+* `replacement`: The thing to replace the pattern with.
+
+#### SourceNode.prototype.toString()
+
+Return the string representation of this source node. Walks over the tree and
+concatenates all the various snippets together to one string.
+
+#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])
+
+Returns the string representation of this tree of source nodes, plus a
+SourceMapGenerator which contains all the mappings between the generated and
+original sources.
+
+The arguments are the same as those to `new SourceMapGenerator`.
+
+## Tests
+
+[](https://travis-ci.org/mozilla/source-map)
+
+Install NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.
+
+To add new tests, create a new file named `test/test-.js`
+and export your test functions with names that start with "test", for example
+
+ exports["test doing the foo bar"] = function (assert, util) {
+ ...
+ };
+
+The new test will be located automatically when you run the suite.
+
+The `util` argument is the test utility module located at `test/source-map/util`.
+
+The `assert` argument is a cut down version of node's assert module. You have
+access to the following assertion functions:
+
+* `doesNotThrow`
+
+* `equal`
+
+* `ok`
+
+* `strictEqual`
+
+* `throws`
+
+(The reason for the restricted set of test functions is because we need the
+tests to run inside Firefox's test suite as well and so the assert module is
+shimmed in that environment. See `build/assert-shim.js`.)
+
+[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
+[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap
+[Dryice]: https://github.com/mozilla/dryice
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/assert-shim.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/assert-shim.js
new file mode 100644
index 000000000..daa1a623c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/assert-shim.js
@@ -0,0 +1,56 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+define('test/source-map/assert', ['exports'], function (exports) {
+
+ let do_throw = function (msg) {
+ throw new Error(msg);
+ };
+
+ exports.init = function (throw_fn) {
+ do_throw = throw_fn;
+ };
+
+ exports.doesNotThrow = function (fn) {
+ try {
+ fn();
+ }
+ catch (e) {
+ do_throw(e.message);
+ }
+ };
+
+ exports.equal = function (actual, expected, msg) {
+ msg = msg || String(actual) + ' != ' + String(expected);
+ if (actual != expected) {
+ do_throw(msg);
+ }
+ };
+
+ exports.ok = function (val, msg) {
+ msg = msg || String(val) + ' is falsey';
+ if (!Boolean(val)) {
+ do_throw(msg);
+ }
+ };
+
+ exports.strictEqual = function (actual, expected, msg) {
+ msg = msg || String(actual) + ' !== ' + String(expected);
+ if (actual !== expected) {
+ do_throw(msg);
+ }
+ };
+
+ exports.throws = function (fn) {
+ try {
+ fn();
+ do_throw('Expected an error to be thrown, but it wasn\'t.');
+ }
+ catch (e) {
+ }
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/mini-require.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/mini-require.js
new file mode 100644
index 000000000..0daf45377
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/mini-require.js
@@ -0,0 +1,152 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/**
+ * Define a module along with a payload.
+ * @param {string} moduleName Name for the payload
+ * @param {ignored} deps Ignored. For compatibility with CommonJS AMD Spec
+ * @param {function} payload Function with (require, exports, module) params
+ */
+function define(moduleName, deps, payload) {
+ if (typeof moduleName != "string") {
+ throw new TypeError('Expected string, got: ' + moduleName);
+ }
+
+ if (arguments.length == 2) {
+ payload = deps;
+ }
+
+ if (moduleName in define.modules) {
+ throw new Error("Module already defined: " + moduleName);
+ }
+ define.modules[moduleName] = payload;
+};
+
+/**
+ * The global store of un-instantiated modules
+ */
+define.modules = {};
+
+
+/**
+ * We invoke require() in the context of a Domain so we can have multiple
+ * sets of modules running separate from each other.
+ * This contrasts with JSMs which are singletons, Domains allows us to
+ * optionally load a CommonJS module twice with separate data each time.
+ * Perhaps you want 2 command lines with a different set of commands in each,
+ * for example.
+ */
+function Domain() {
+ this.modules = {};
+ this._currentModule = null;
+}
+
+(function () {
+
+ /**
+ * Lookup module names and resolve them by calling the definition function if
+ * needed.
+ * There are 2 ways to call this, either with an array of dependencies and a
+ * callback to call when the dependencies are found (which can happen
+ * asynchronously in an in-page context) or with a single string an no callback
+ * where the dependency is resolved synchronously and returned.
+ * The API is designed to be compatible with the CommonJS AMD spec and
+ * RequireJS.
+ * @param {string[]|string} deps A name, or names for the payload
+ * @param {function|undefined} callback Function to call when the dependencies
+ * are resolved
+ * @return {undefined|object} The module required or undefined for
+ * array/callback method
+ */
+ Domain.prototype.require = function(deps, callback) {
+ if (Array.isArray(deps)) {
+ var params = deps.map(function(dep) {
+ return this.lookup(dep);
+ }, this);
+ if (callback) {
+ callback.apply(null, params);
+ }
+ return undefined;
+ }
+ else {
+ return this.lookup(deps);
+ }
+ };
+
+ function normalize(path) {
+ var bits = path.split('/');
+ var i = 1;
+ while (i < bits.length) {
+ if (bits[i] === '..') {
+ bits.splice(i-1, 1);
+ } else if (bits[i] === '.') {
+ bits.splice(i, 1);
+ } else {
+ i++;
+ }
+ }
+ return bits.join('/');
+ }
+
+ function join(a, b) {
+ a = a.trim();
+ b = b.trim();
+ if (/^\//.test(b)) {
+ return b;
+ } else {
+ return a.replace(/\/*$/, '/') + b;
+ }
+ }
+
+ function dirname(path) {
+ var bits = path.split('/');
+ bits.pop();
+ return bits.join('/');
+ }
+
+ /**
+ * Lookup module names and resolve them by calling the definition function if
+ * needed.
+ * @param {string} moduleName A name for the payload to lookup
+ * @return {object} The module specified by aModuleName or null if not found.
+ */
+ Domain.prototype.lookup = function(moduleName) {
+ if (/^\./.test(moduleName)) {
+ moduleName = normalize(join(dirname(this._currentModule), moduleName));
+ }
+
+ if (moduleName in this.modules) {
+ var module = this.modules[moduleName];
+ return module;
+ }
+
+ if (!(moduleName in define.modules)) {
+ throw new Error("Module not defined: " + moduleName);
+ }
+
+ var module = define.modules[moduleName];
+
+ if (typeof module == "function") {
+ var exports = {};
+ var previousModule = this._currentModule;
+ this._currentModule = moduleName;
+ module(this.require.bind(this), exports, { id: moduleName, uri: "" });
+ this._currentModule = previousModule;
+ module = exports;
+ }
+
+ // cache the resulting module object for next time
+ this.modules[moduleName] = module;
+
+ return module;
+ };
+
+}());
+
+define.Domain = Domain;
+define.globalDomain = new Domain();
+var require = define.globalDomain.require.bind(define.globalDomain);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-source-map.jsm b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-source-map.jsm
new file mode 100644
index 000000000..ee2539d81
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-source-map.jsm
@@ -0,0 +1,20 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/*
+ * WARNING!
+ *
+ * Do not edit this file directly, it is built from the sources at
+ * https://github.com/mozilla/source-map/
+ */
+
+///////////////////////////////////////////////////////////////////////////////
+
+
+this.EXPORTED_SYMBOLS = [ "SourceMapConsumer", "SourceMapGenerator", "SourceNode" ];
+
+Components.utils.import('resource://gre/modules/devtools/Require.jsm');
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-utils.jsm b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-utils.jsm
new file mode 100644
index 000000000..80341d452
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/prefix-utils.jsm
@@ -0,0 +1,18 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+
+/*
+ * WARNING!
+ *
+ * Do not edit this file directly, it is built from the sources at
+ * https://github.com/mozilla/source-map/
+ */
+
+Components.utils.import('resource://gre/modules/devtools/Require.jsm');
+Components.utils.import('resource://gre/modules/devtools/SourceMap.jsm');
+
+this.EXPORTED_SYMBOLS = [ "define", "runSourceMapTests" ];
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-browser.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-browser.js
new file mode 100644
index 000000000..fb29ff5fd
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-browser.js
@@ -0,0 +1,8 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+///////////////////////////////////////////////////////////////////////////////
+
+this.sourceMap = {
+ SourceMapConsumer: require('source-map/source-map-consumer').SourceMapConsumer,
+ SourceMapGenerator: require('source-map/source-map-generator').SourceMapGenerator,
+ SourceNode: require('source-map/source-node').SourceNode
+};
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-source-map.jsm b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-source-map.jsm
new file mode 100644
index 000000000..cf3c2d8d3
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-source-map.jsm
@@ -0,0 +1,6 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+///////////////////////////////////////////////////////////////////////////////
+
+this.SourceMapConsumer = require('source-map/source-map-consumer').SourceMapConsumer;
+this.SourceMapGenerator = require('source-map/source-map-generator').SourceMapGenerator;
+this.SourceNode = require('source-map/source-node').SourceNode;
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-utils.jsm b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-utils.jsm
new file mode 100644
index 000000000..b31b84cb6
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/suffix-utils.jsm
@@ -0,0 +1,21 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+function runSourceMapTests(modName, do_throw) {
+ let mod = require(modName);
+ let assert = require('test/source-map/assert');
+ let util = require('test/source-map/util');
+
+ assert.init(do_throw);
+
+ for (let k in mod) {
+ if (/^test/.test(k)) {
+ mod[k](assert, util);
+ }
+ }
+
+}
+this.runSourceMapTests = runSourceMapTests;
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-prefix.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-prefix.js
new file mode 100644
index 000000000..1b13f300e
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-prefix.js
@@ -0,0 +1,8 @@
+/*
+ * WARNING!
+ *
+ * Do not edit this file directly, it is built from the sources at
+ * https://github.com/mozilla/source-map/
+ */
+
+Components.utils.import('resource://test/Utils.jsm');
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-suffix.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-suffix.js
new file mode 100644
index 000000000..bec2de3f2
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/build/test-suffix.js
@@ -0,0 +1,3 @@
+function run_test() {
+ runSourceMapTests('{THIS_MODULE}', do_throw);
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map.js
new file mode 100644
index 000000000..121ad2416
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map.js
@@ -0,0 +1,8 @@
+/*
+ * Copyright 2009-2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE.txt or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+exports.SourceMapGenerator = require('./source-map/source-map-generator').SourceMapGenerator;
+exports.SourceMapConsumer = require('./source-map/source-map-consumer').SourceMapConsumer;
+exports.SourceNode = require('./source-map/source-node').SourceNode;
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/array-set.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/array-set.js
new file mode 100644
index 000000000..40f9a18b1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/array-set.js
@@ -0,0 +1,97 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var util = require('./util');
+
+ /**
+ * A data structure which is a combination of an array and a set. Adding a new
+ * member is O(1), testing for membership is O(1), and finding the index of an
+ * element is O(1). Removing elements from the set is not supported. Only
+ * strings are supported for membership.
+ */
+ function ArraySet() {
+ this._array = [];
+ this._set = {};
+ }
+
+ /**
+ * Static method for creating ArraySet instances from an existing array.
+ */
+ ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
+ var set = new ArraySet();
+ for (var i = 0, len = aArray.length; i < len; i++) {
+ set.add(aArray[i], aAllowDuplicates);
+ }
+ return set;
+ };
+
+ /**
+ * Add the given string to this set.
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
+ var isDuplicate = this.has(aStr);
+ var idx = this._array.length;
+ if (!isDuplicate || aAllowDuplicates) {
+ this._array.push(aStr);
+ }
+ if (!isDuplicate) {
+ this._set[util.toSetString(aStr)] = idx;
+ }
+ };
+
+ /**
+ * Is the given string a member of this set?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.has = function ArraySet_has(aStr) {
+ return Object.prototype.hasOwnProperty.call(this._set,
+ util.toSetString(aStr));
+ };
+
+ /**
+ * What is the index of the given string in the array?
+ *
+ * @param String aStr
+ */
+ ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
+ if (this.has(aStr)) {
+ return this._set[util.toSetString(aStr)];
+ }
+ throw new Error('"' + aStr + '" is not in the set.');
+ };
+
+ /**
+ * What is the element at the given index?
+ *
+ * @param Number aIdx
+ */
+ ArraySet.prototype.at = function ArraySet_at(aIdx) {
+ if (aIdx >= 0 && aIdx < this._array.length) {
+ return this._array[aIdx];
+ }
+ throw new Error('No element indexed by ' + aIdx);
+ };
+
+ /**
+ * Returns the array representation of this set (which has the proper indices
+ * indicated by indexOf). Note that this is a copy of the internal array used
+ * for storing the members so that no one can mess with internal state.
+ */
+ ArraySet.prototype.toArray = function ArraySet_toArray() {
+ return this._array.slice();
+ };
+
+ exports.ArraySet = ArraySet;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64-vlq.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64-vlq.js
new file mode 100644
index 000000000..e22dcaeee
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64-vlq.js
@@ -0,0 +1,142 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ *
+ * Based on the Base 64 VLQ implementation in Closure Compiler:
+ * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
+ *
+ * Copyright 2011 The Closure Compiler Authors. All rights reserved.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following
+ * disclaimer in the documentation and/or other materials provided
+ * with the distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var base64 = require('./base64');
+
+ // A single base 64 digit can contain 6 bits of data. For the base 64 variable
+ // length quantities we use in the source map spec, the first bit is the sign,
+ // the next four bits are the actual value, and the 6th bit is the
+ // continuation bit. The continuation bit tells us whether there are more
+ // digits in this value following this digit.
+ //
+ // Continuation
+ // | Sign
+ // | |
+ // V V
+ // 101011
+
+ var VLQ_BASE_SHIFT = 5;
+
+ // binary: 100000
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
+
+ // binary: 011111
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
+
+ // binary: 100000
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
+
+ /**
+ * Converts from a two-complement value to a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
+ */
+ function toVLQSigned(aValue) {
+ return aValue < 0
+ ? ((-aValue) << 1) + 1
+ : (aValue << 1) + 0;
+ }
+
+ /**
+ * Converts to a two-complement value from a value where the sign bit is
+ * placed in the least significant bit. For example, as decimals:
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
+ */
+ function fromVLQSigned(aValue) {
+ var isNegative = (aValue & 1) === 1;
+ var shifted = aValue >> 1;
+ return isNegative
+ ? -shifted
+ : shifted;
+ }
+
+ /**
+ * Returns the base 64 VLQ encoded value.
+ */
+ exports.encode = function base64VLQ_encode(aValue) {
+ var encoded = "";
+ var digit;
+
+ var vlq = toVLQSigned(aValue);
+
+ do {
+ digit = vlq & VLQ_BASE_MASK;
+ vlq >>>= VLQ_BASE_SHIFT;
+ if (vlq > 0) {
+ // There are still more digits in this value, so we must make sure the
+ // continuation bit is marked.
+ digit |= VLQ_CONTINUATION_BIT;
+ }
+ encoded += base64.encode(digit);
+ } while (vlq > 0);
+
+ return encoded;
+ };
+
+ /**
+ * Decodes the next base 64 VLQ value from the given string and returns the
+ * value and the rest of the string via the out parameter.
+ */
+ exports.decode = function base64VLQ_decode(aStr, aOutParam) {
+ var i = 0;
+ var strLen = aStr.length;
+ var result = 0;
+ var shift = 0;
+ var continuation, digit;
+
+ do {
+ if (i >= strLen) {
+ throw new Error("Expected more digits in base 64 VLQ value.");
+ }
+ digit = base64.decode(aStr.charAt(i++));
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
+ digit &= VLQ_BASE_MASK;
+ result = result + (digit << shift);
+ shift += VLQ_BASE_SHIFT;
+ } while (continuation);
+
+ aOutParam.value = fromVLQSigned(result);
+ aOutParam.rest = aStr.slice(i);
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64.js
new file mode 100644
index 000000000..863cc4650
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/base64.js
@@ -0,0 +1,42 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var charToIntMap = {};
+ var intToCharMap = {};
+
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
+ .split('')
+ .forEach(function (ch, index) {
+ charToIntMap[ch] = index;
+ intToCharMap[index] = ch;
+ });
+
+ /**
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
+ */
+ exports.encode = function base64_encode(aNumber) {
+ if (aNumber in intToCharMap) {
+ return intToCharMap[aNumber];
+ }
+ throw new TypeError("Must be between 0 and 63: " + aNumber);
+ };
+
+ /**
+ * Decode a single base 64 digit to an integer.
+ */
+ exports.decode = function base64_decode(aChar) {
+ if (aChar in charToIntMap) {
+ return charToIntMap[aChar];
+ }
+ throw new TypeError("Not a valid base 64 digit: " + aChar);
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/binary-search.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/binary-search.js
new file mode 100644
index 000000000..e085f8100
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/binary-search.js
@@ -0,0 +1,80 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ /**
+ * Recursive implementation of binary search.
+ *
+ * @param aLow Indices here and lower do not contain the needle.
+ * @param aHigh Indices here and higher do not contain the needle.
+ * @param aNeedle The element being searched for.
+ * @param aHaystack The non-empty array being searched.
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
+ */
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare) {
+ // This function terminates when one of the following is true:
+ //
+ // 1. We find the exact element we are looking for.
+ //
+ // 2. We did not find the exact element, but we can return the index of
+ // the next closest element that is less than that element.
+ //
+ // 3. We did not find the exact element, and there is no next-closest
+ // element which is less than the one we are searching for, so we
+ // return -1.
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
+ if (cmp === 0) {
+ // Found the element we are looking for.
+ return mid;
+ }
+ else if (cmp > 0) {
+ // aHaystack[mid] is greater than our needle.
+ if (aHigh - mid > 1) {
+ // The element is in the upper half.
+ return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare);
+ }
+ // We did not find an exact match, return the next closest one
+ // (termination case 2).
+ return mid;
+ }
+ else {
+ // aHaystack[mid] is less than our needle.
+ if (mid - aLow > 1) {
+ // The element is in the lower half.
+ return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare);
+ }
+ // The exact needle element was not found in this haystack. Determine if
+ // we are in termination case (2) or (3) and return the appropriate thing.
+ return aLow < 0 ? -1 : aLow;
+ }
+ }
+
+ /**
+ * This is an implementation of binary search which will always try and return
+ * the index of next lowest value checked if there is no exact hit. This is
+ * because mappings between original and generated line/col pairs are single
+ * points, and there is an implicit region between each of them, so a miss
+ * just means that you aren't on the very start of a region.
+ *
+ * @param aNeedle The element you are looking for.
+ * @param aHaystack The array that is being searched.
+ * @param aCompare A function which takes the needle and an element in the
+ * array and returns -1, 0, or 1 depending on whether the needle is less
+ * than, equal to, or greater than the element, respectively.
+ */
+ exports.search = function search(aNeedle, aHaystack, aCompare) {
+ if (aHaystack.length === 0) {
+ return -1;
+ }
+ return recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare)
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/mapping-list.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/mapping-list.js
new file mode 100644
index 000000000..2a4eb6186
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/mapping-list.js
@@ -0,0 +1,86 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var util = require('./util');
+
+ /**
+ * Determine whether mappingB is after mappingA with respect to generated
+ * position.
+ */
+ function generatedPositionAfter(mappingA, mappingB) {
+ // Optimized for most common case
+ var lineA = mappingA.generatedLine;
+ var lineB = mappingB.generatedLine;
+ var columnA = mappingA.generatedColumn;
+ var columnB = mappingB.generatedColumn;
+ return lineB > lineA || lineB == lineA && columnB >= columnA ||
+ util.compareByGeneratedPositions(mappingA, mappingB) <= 0;
+ }
+
+ /**
+ * A data structure to provide a sorted view of accumulated mappings in a
+ * performance conscious manner. It trades a neglibable overhead in general
+ * case for a large speedup in case of mappings being added in order.
+ */
+ function MappingList() {
+ this._array = [];
+ this._sorted = true;
+ // Serves as infimum
+ this._last = {generatedLine: -1, generatedColumn: 0};
+ }
+
+ /**
+ * Iterate through internal items. This method takes the same arguments that
+ * `Array.prototype.forEach` takes.
+ *
+ * NOTE: The order of the mappings is NOT guaranteed.
+ */
+ MappingList.prototype.unsortedForEach =
+ function MappingList_forEach(aCallback, aThisArg) {
+ this._array.forEach(aCallback, aThisArg);
+ };
+
+ /**
+ * Add the given source mapping.
+ *
+ * @param Object aMapping
+ */
+ MappingList.prototype.add = function MappingList_add(aMapping) {
+ var mapping;
+ if (generatedPositionAfter(this._last, aMapping)) {
+ this._last = aMapping;
+ this._array.push(aMapping);
+ } else {
+ this._sorted = false;
+ this._array.push(aMapping);
+ }
+ };
+
+ /**
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
+ * generated position.
+ *
+ * WARNING: This method returns internal data without copying, for
+ * performance. The return value must NOT be mutated, and should be treated as
+ * an immutable borrow. If you want to take ownership, you must make your own
+ * copy.
+ */
+ MappingList.prototype.toArray = function MappingList_toArray() {
+ if (!this._sorted) {
+ this._array.sort(util.compareByGeneratedPositions);
+ this._sorted = true;
+ }
+ return this._array;
+ };
+
+ exports.MappingList = MappingList;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-consumer.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-consumer.js
new file mode 100644
index 000000000..cfaa299a5
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-consumer.js
@@ -0,0 +1,575 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var util = require('./util');
+ var binarySearch = require('./binary-search');
+ var ArraySet = require('./array-set').ArraySet;
+ var base64VLQ = require('./base64-vlq');
+
+ /**
+ * A SourceMapConsumer instance represents a parsed source map which we can
+ * query for information about the original file positions by giving it a file
+ * position in the generated source.
+ *
+ * The only parameter is the raw source map (either as a JSON string, or
+ * already parsed to an object). According to the spec, source maps have the
+ * following attributes:
+ *
+ * - version: Which version of the source map spec this map is following.
+ * - sources: An array of URLs to the original source files.
+ * - names: An array of identifiers which can be referrenced by individual mappings.
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
+ * - sourcesContent: Optional. An array of contents of the original source files.
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
+ * - file: Optional. The generated file this source map is associated with.
+ *
+ * Here is an example source map, taken from the source map spec[0]:
+ *
+ * {
+ * version : 3,
+ * file: "out.js",
+ * sourceRoot : "",
+ * sources: ["foo.js", "bar.js"],
+ * names: ["src", "maps", "are", "fun"],
+ * mappings: "AA,AB;;ABCDE;"
+ * }
+ *
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
+ */
+ function SourceMapConsumer(aSourceMap) {
+ var sourceMap = aSourceMap;
+ if (typeof aSourceMap === 'string') {
+ sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, ''));
+ }
+
+ var version = util.getArg(sourceMap, 'version');
+ var sources = util.getArg(sourceMap, 'sources');
+ // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
+ // requires the array) to play nice here.
+ var names = util.getArg(sourceMap, 'names', []);
+ var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
+ var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
+ var mappings = util.getArg(sourceMap, 'mappings');
+ var file = util.getArg(sourceMap, 'file', null);
+
+ // Once again, Sass deviates from the spec and supplies the version as a
+ // string rather than a number, so we use loose equality checking here.
+ if (version != this._version) {
+ throw new Error('Unsupported version: ' + version);
+ }
+
+ // Some source maps produce relative source paths like "./foo.js" instead of
+ // "foo.js". Normalize these first so that future comparisons will succeed.
+ // See bugzil.la/1090768.
+ sources = sources.map(util.normalize);
+
+ // Pass `true` below to allow duplicate names and sources. While source maps
+ // are intended to be compressed and deduplicated, the TypeScript compiler
+ // sometimes generates source maps with duplicates in them. See Github issue
+ // #72 and bugzil.la/889492.
+ this._names = ArraySet.fromArray(names, true);
+ this._sources = ArraySet.fromArray(sources, true);
+
+ this.sourceRoot = sourceRoot;
+ this.sourcesContent = sourcesContent;
+ this._mappings = mappings;
+ this.file = file;
+ }
+
+ /**
+ * Create a SourceMapConsumer from a SourceMapGenerator.
+ *
+ * @param SourceMapGenerator aSourceMap
+ * The source map that will be consumed.
+ * @returns SourceMapConsumer
+ */
+ SourceMapConsumer.fromSourceMap =
+ function SourceMapConsumer_fromSourceMap(aSourceMap) {
+ var smc = Object.create(SourceMapConsumer.prototype);
+
+ smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
+ smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
+ smc.sourceRoot = aSourceMap._sourceRoot;
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
+ smc.sourceRoot);
+ smc.file = aSourceMap._file;
+
+ smc.__generatedMappings = aSourceMap._mappings.toArray().slice();
+ smc.__originalMappings = aSourceMap._mappings.toArray().slice()
+ .sort(util.compareByOriginalPositions);
+
+ return smc;
+ };
+
+ /**
+ * The version of the source mapping spec that we are consuming.
+ */
+ SourceMapConsumer.prototype._version = 3;
+
+ /**
+ * The list of original sources.
+ */
+ Object.defineProperty(SourceMapConsumer.prototype, 'sources', {
+ get: function () {
+ return this._sources.toArray().map(function (s) {
+ return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s;
+ }, this);
+ }
+ });
+
+ // `__generatedMappings` and `__originalMappings` are arrays that hold the
+ // parsed mapping coordinates from the source map's "mappings" attribute. They
+ // are lazily instantiated, accessed via the `_generatedMappings` and
+ // `_originalMappings` getters respectively, and we only parse the mappings
+ // and create these arrays once queried for a source location. We jump through
+ // these hoops because there can be many thousands of mappings, and parsing
+ // them is expensive, so we only want to do it if we must.
+ //
+ // Each object in the arrays is of the form:
+ //
+ // {
+ // generatedLine: The line number in the generated code,
+ // generatedColumn: The column number in the generated code,
+ // source: The path to the original source file that generated this
+ // chunk of code,
+ // originalLine: The line number in the original source that
+ // corresponds to this chunk of generated code,
+ // originalColumn: The column number in the original source that
+ // corresponds to this chunk of generated code,
+ // name: The name of the original symbol which generated this chunk of
+ // code.
+ // }
+ //
+ // All properties except for `generatedLine` and `generatedColumn` can be
+ // `null`.
+ //
+ // `_generatedMappings` is ordered by the generated positions.
+ //
+ // `_originalMappings` is ordered by the original positions.
+
+ SourceMapConsumer.prototype.__generatedMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
+ get: function () {
+ if (!this.__generatedMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__generatedMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype.__originalMappings = null;
+ Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
+ get: function () {
+ if (!this.__originalMappings) {
+ this.__generatedMappings = [];
+ this.__originalMappings = [];
+ this._parseMappings(this._mappings, this.sourceRoot);
+ }
+
+ return this.__originalMappings;
+ }
+ });
+
+ SourceMapConsumer.prototype._nextCharIsMappingSeparator =
+ function SourceMapConsumer_nextCharIsMappingSeparator(aStr) {
+ var c = aStr.charAt(0);
+ return c === ";" || c === ",";
+ };
+
+ /**
+ * Parse the mappings in a string in to a data structure which we can easily
+ * query (the ordered arrays in the `this.__generatedMappings` and
+ * `this.__originalMappings` properties).
+ */
+ SourceMapConsumer.prototype._parseMappings =
+ function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
+ var generatedLine = 1;
+ var previousGeneratedColumn = 0;
+ var previousOriginalLine = 0;
+ var previousOriginalColumn = 0;
+ var previousSource = 0;
+ var previousName = 0;
+ var str = aStr;
+ var temp = {};
+ var mapping;
+
+ while (str.length > 0) {
+ if (str.charAt(0) === ';') {
+ generatedLine++;
+ str = str.slice(1);
+ previousGeneratedColumn = 0;
+ }
+ else if (str.charAt(0) === ',') {
+ str = str.slice(1);
+ }
+ else {
+ mapping = {};
+ mapping.generatedLine = generatedLine;
+
+ // Generated column.
+ base64VLQ.decode(str, temp);
+ mapping.generatedColumn = previousGeneratedColumn + temp.value;
+ previousGeneratedColumn = mapping.generatedColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !this._nextCharIsMappingSeparator(str)) {
+ // Original source.
+ base64VLQ.decode(str, temp);
+ mapping.source = this._sources.at(previousSource + temp.value);
+ previousSource += temp.value;
+ str = temp.rest;
+ if (str.length === 0 || this._nextCharIsMappingSeparator(str)) {
+ throw new Error('Found a source, but no line and column');
+ }
+
+ // Original line.
+ base64VLQ.decode(str, temp);
+ mapping.originalLine = previousOriginalLine + temp.value;
+ previousOriginalLine = mapping.originalLine;
+ // Lines are stored 0-based
+ mapping.originalLine += 1;
+ str = temp.rest;
+ if (str.length === 0 || this._nextCharIsMappingSeparator(str)) {
+ throw new Error('Found a source and line, but no column');
+ }
+
+ // Original column.
+ base64VLQ.decode(str, temp);
+ mapping.originalColumn = previousOriginalColumn + temp.value;
+ previousOriginalColumn = mapping.originalColumn;
+ str = temp.rest;
+
+ if (str.length > 0 && !this._nextCharIsMappingSeparator(str)) {
+ // Original name.
+ base64VLQ.decode(str, temp);
+ mapping.name = this._names.at(previousName + temp.value);
+ previousName += temp.value;
+ str = temp.rest;
+ }
+ }
+
+ this.__generatedMappings.push(mapping);
+ if (typeof mapping.originalLine === 'number') {
+ this.__originalMappings.push(mapping);
+ }
+ }
+ }
+
+ this.__generatedMappings.sort(util.compareByGeneratedPositions);
+ this.__originalMappings.sort(util.compareByOriginalPositions);
+ };
+
+ /**
+ * Find the mapping that best matches the hypothetical "needle" mapping that
+ * we are searching for in the given "haystack" of mappings.
+ */
+ SourceMapConsumer.prototype._findMapping =
+ function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
+ aColumnName, aComparator) {
+ // To return the position we are searching for, we must first find the
+ // mapping for the given position and then return the opposite position it
+ // points to. Because the mappings are sorted, we can use binary search to
+ // find the best mapping.
+
+ if (aNeedle[aLineName] <= 0) {
+ throw new TypeError('Line must be greater than or equal to 1, got '
+ + aNeedle[aLineName]);
+ }
+ if (aNeedle[aColumnName] < 0) {
+ throw new TypeError('Column must be greater than or equal to 0, got '
+ + aNeedle[aColumnName]);
+ }
+
+ return binarySearch.search(aNeedle, aMappings, aComparator);
+ };
+
+ /**
+ * Compute the last column for each generated mapping. The last column is
+ * inclusive.
+ */
+ SourceMapConsumer.prototype.computeColumnSpans =
+ function SourceMapConsumer_computeColumnSpans() {
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
+ var mapping = this._generatedMappings[index];
+
+ // Mappings do not contain a field for the last generated columnt. We
+ // can come up with an optimistic estimate, however, by assuming that
+ // mappings are contiguous (i.e. given two consecutive mappings, the
+ // first mapping ends where the second one starts).
+ if (index + 1 < this._generatedMappings.length) {
+ var nextMapping = this._generatedMappings[index + 1];
+
+ if (mapping.generatedLine === nextMapping.generatedLine) {
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
+ continue;
+ }
+ }
+
+ // The last mapping for each line spans the entire line.
+ mapping.lastGeneratedColumn = Infinity;
+ }
+ };
+
+ /**
+ * Returns the original source, line, and column information for the generated
+ * source's line and column positions provided. The only argument is an object
+ * with the following properties:
+ *
+ * - line: The line number in the generated source.
+ * - column: The column number in the generated source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - source: The original source file, or null.
+ * - line: The line number in the original source, or null.
+ * - column: The column number in the original source, or null.
+ * - name: The original identifier, or null.
+ */
+ SourceMapConsumer.prototype.originalPositionFor =
+ function SourceMapConsumer_originalPositionFor(aArgs) {
+ var needle = {
+ generatedLine: util.getArg(aArgs, 'line'),
+ generatedColumn: util.getArg(aArgs, 'column')
+ };
+
+ var index = this._findMapping(needle,
+ this._generatedMappings,
+ "generatedLine",
+ "generatedColumn",
+ util.compareByGeneratedPositions);
+
+ if (index >= 0) {
+ var mapping = this._generatedMappings[index];
+
+ if (mapping.generatedLine === needle.generatedLine) {
+ var source = util.getArg(mapping, 'source', null);
+ if (source != null && this.sourceRoot != null) {
+ source = util.join(this.sourceRoot, source);
+ }
+ return {
+ source: source,
+ line: util.getArg(mapping, 'originalLine', null),
+ column: util.getArg(mapping, 'originalColumn', null),
+ name: util.getArg(mapping, 'name', null)
+ };
+ }
+ }
+
+ return {
+ source: null,
+ line: null,
+ column: null,
+ name: null
+ };
+ };
+
+ /**
+ * Returns the original source content. The only argument is the url of the
+ * original source file. Returns null if no original source content is
+ * availible.
+ */
+ SourceMapConsumer.prototype.sourceContentFor =
+ function SourceMapConsumer_sourceContentFor(aSource) {
+ if (!this.sourcesContent) {
+ return null;
+ }
+
+ if (this.sourceRoot != null) {
+ aSource = util.relative(this.sourceRoot, aSource);
+ }
+
+ if (this._sources.has(aSource)) {
+ return this.sourcesContent[this._sources.indexOf(aSource)];
+ }
+
+ var url;
+ if (this.sourceRoot != null
+ && (url = util.urlParse(this.sourceRoot))) {
+ // XXX: file:// URIs and absolute paths lead to unexpected behavior for
+ // many users. We can help them out when they expect file:// URIs to
+ // behave like it would if they were running a local HTTP server. See
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
+ var fileUriAbsPath = aSource.replace(/^file:\/\//, "");
+ if (url.scheme == "file"
+ && this._sources.has(fileUriAbsPath)) {
+ return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
+ }
+
+ if ((!url.path || url.path == "/")
+ && this._sources.has("/" + aSource)) {
+ return this.sourcesContent[this._sources.indexOf("/" + aSource)];
+ }
+ }
+
+ throw new Error('"' + aSource + '" is not in the SourceMap.');
+ };
+
+ /**
+ * Returns the generated line and column information for the original source,
+ * line, and column positions provided. The only argument is an object with
+ * the following properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ * - column: The column number in the original source.
+ *
+ * and an object is returned with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ SourceMapConsumer.prototype.generatedPositionFor =
+ function SourceMapConsumer_generatedPositionFor(aArgs) {
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: util.getArg(aArgs, 'column')
+ };
+
+ if (this.sourceRoot != null) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions);
+
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ return {
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ };
+ }
+
+ return {
+ line: null,
+ column: null,
+ lastColumn: null
+ };
+ };
+
+ /**
+ * Returns all generated line and column information for the original source
+ * and line provided. The only argument is an object with the following
+ * properties:
+ *
+ * - source: The filename of the original source.
+ * - line: The line number in the original source.
+ *
+ * and an array of objects is returned, each with the following properties:
+ *
+ * - line: The line number in the generated source, or null.
+ * - column: The column number in the generated source, or null.
+ */
+ SourceMapConsumer.prototype.allGeneratedPositionsFor =
+ function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
+ // When there is no exact match, SourceMapConsumer.prototype._findMapping
+ // returns the index of the closest mapping less than the needle. By
+ // setting needle.originalColumn to Infinity, we thus find the last
+ // mapping for the given line, provided such a mapping exists.
+ var needle = {
+ source: util.getArg(aArgs, 'source'),
+ originalLine: util.getArg(aArgs, 'line'),
+ originalColumn: Infinity
+ };
+
+ if (this.sourceRoot != null) {
+ needle.source = util.relative(this.sourceRoot, needle.source);
+ }
+
+ var mappings = [];
+
+ var index = this._findMapping(needle,
+ this._originalMappings,
+ "originalLine",
+ "originalColumn",
+ util.compareByOriginalPositions);
+ if (index >= 0) {
+ var mapping = this._originalMappings[index];
+
+ while (mapping && mapping.originalLine === needle.originalLine) {
+ mappings.push({
+ line: util.getArg(mapping, 'generatedLine', null),
+ column: util.getArg(mapping, 'generatedColumn', null),
+ lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
+ });
+
+ mapping = this._originalMappings[--index];
+ }
+ }
+
+ return mappings.reverse();
+ };
+
+ SourceMapConsumer.GENERATED_ORDER = 1;
+ SourceMapConsumer.ORIGINAL_ORDER = 2;
+
+ /**
+ * Iterate over each mapping between an original source/line/column and a
+ * generated line/column in this source map.
+ *
+ * @param Function aCallback
+ * The function that is called with each mapping.
+ * @param Object aContext
+ * Optional. If specified, this object will be the value of `this` every
+ * time that `aCallback` is called.
+ * @param aOrder
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
+ * iterate over the mappings sorted by the generated file's line/column
+ * order or the original's source/line/column order, respectively. Defaults to
+ * `SourceMapConsumer.GENERATED_ORDER`.
+ */
+ SourceMapConsumer.prototype.eachMapping =
+ function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
+ var context = aContext || null;
+ var order = aOrder || SourceMapConsumer.GENERATED_ORDER;
+
+ var mappings;
+ switch (order) {
+ case SourceMapConsumer.GENERATED_ORDER:
+ mappings = this._generatedMappings;
+ break;
+ case SourceMapConsumer.ORIGINAL_ORDER:
+ mappings = this._originalMappings;
+ break;
+ default:
+ throw new Error("Unknown order of iteration.");
+ }
+
+ var sourceRoot = this.sourceRoot;
+ mappings.map(function (mapping) {
+ var source = mapping.source;
+ if (source != null && sourceRoot != null) {
+ source = util.join(sourceRoot, source);
+ }
+ return {
+ source: source,
+ generatedLine: mapping.generatedLine,
+ generatedColumn: mapping.generatedColumn,
+ originalLine: mapping.originalLine,
+ originalColumn: mapping.originalColumn,
+ name: mapping.name
+ };
+ }).forEach(aCallback, context);
+ };
+
+ exports.SourceMapConsumer = SourceMapConsumer;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-generator.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-generator.js
new file mode 100644
index 000000000..1ab7a47de
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-map-generator.js
@@ -0,0 +1,400 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var base64VLQ = require('./base64-vlq');
+ var util = require('./util');
+ var ArraySet = require('./array-set').ArraySet;
+ var MappingList = require('./mapping-list').MappingList;
+
+ /**
+ * An instance of the SourceMapGenerator represents a source map which is
+ * being built incrementally. You may pass an object with the following
+ * properties:
+ *
+ * - file: The filename of the generated source.
+ * - sourceRoot: A root for all relative URLs in this source map.
+ */
+ function SourceMapGenerator(aArgs) {
+ if (!aArgs) {
+ aArgs = {};
+ }
+ this._file = util.getArg(aArgs, 'file', null);
+ this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
+ this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
+ this._sources = new ArraySet();
+ this._names = new ArraySet();
+ this._mappings = new MappingList();
+ this._sourcesContents = null;
+ }
+
+ SourceMapGenerator.prototype._version = 3;
+
+ /**
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
+ *
+ * @param aSourceMapConsumer The SourceMap.
+ */
+ SourceMapGenerator.fromSourceMap =
+ function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
+ var generator = new SourceMapGenerator({
+ file: aSourceMapConsumer.file,
+ sourceRoot: sourceRoot
+ });
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ var newMapping = {
+ generated: {
+ line: mapping.generatedLine,
+ column: mapping.generatedColumn
+ }
+ };
+
+ if (mapping.source != null) {
+ newMapping.source = mapping.source;
+ if (sourceRoot != null) {
+ newMapping.source = util.relative(sourceRoot, newMapping.source);
+ }
+
+ newMapping.original = {
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ };
+
+ if (mapping.name != null) {
+ newMapping.name = mapping.name;
+ }
+ }
+
+ generator.addMapping(newMapping);
+ });
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ generator.setSourceContent(sourceFile, content);
+ }
+ });
+ return generator;
+ };
+
+ /**
+ * Add a single mapping from original source line and column to the generated
+ * source's line and column for this source map being created. The mapping
+ * object should have the following properties:
+ *
+ * - generated: An object with the generated line and column positions.
+ * - original: An object with the original line and column positions.
+ * - source: The original source file (relative to the sourceRoot).
+ * - name: An optional original token name for this mapping.
+ */
+ SourceMapGenerator.prototype.addMapping =
+ function SourceMapGenerator_addMapping(aArgs) {
+ var generated = util.getArg(aArgs, 'generated');
+ var original = util.getArg(aArgs, 'original', null);
+ var source = util.getArg(aArgs, 'source', null);
+ var name = util.getArg(aArgs, 'name', null);
+
+ if (!this._skipValidation) {
+ this._validateMapping(generated, original, source, name);
+ }
+
+ if (source != null && !this._sources.has(source)) {
+ this._sources.add(source);
+ }
+
+ if (name != null && !this._names.has(name)) {
+ this._names.add(name);
+ }
+
+ this._mappings.add({
+ generatedLine: generated.line,
+ generatedColumn: generated.column,
+ originalLine: original != null && original.line,
+ originalColumn: original != null && original.column,
+ source: source,
+ name: name
+ });
+ };
+
+ /**
+ * Set the source content for a source file.
+ */
+ SourceMapGenerator.prototype.setSourceContent =
+ function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
+ var source = aSourceFile;
+ if (this._sourceRoot != null) {
+ source = util.relative(this._sourceRoot, source);
+ }
+
+ if (aSourceContent != null) {
+ // Add the source content to the _sourcesContents map.
+ // Create a new _sourcesContents map if the property is null.
+ if (!this._sourcesContents) {
+ this._sourcesContents = {};
+ }
+ this._sourcesContents[util.toSetString(source)] = aSourceContent;
+ } else if (this._sourcesContents) {
+ // Remove the source file from the _sourcesContents map.
+ // If the _sourcesContents map is empty, set the property to null.
+ delete this._sourcesContents[util.toSetString(source)];
+ if (Object.keys(this._sourcesContents).length === 0) {
+ this._sourcesContents = null;
+ }
+ }
+ };
+
+ /**
+ * Applies the mappings of a sub-source-map for a specific source file to the
+ * source map being generated. Each mapping to the supplied source file is
+ * rewritten using the supplied source map. Note: The resolution for the
+ * resulting mappings is the minimium of this map and the supplied map.
+ *
+ * @param aSourceMapConsumer The source map to be applied.
+ * @param aSourceFile Optional. The filename of the source file.
+ * If omitted, SourceMapConsumer's file property will be used.
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
+ * This parameter is needed when the two source maps aren't in the same
+ * directory, and the source map to be applied contains relative source
+ * paths. If so, those relative source paths need to be rewritten
+ * relative to the SourceMapGenerator.
+ */
+ SourceMapGenerator.prototype.applySourceMap =
+ function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
+ var sourceFile = aSourceFile;
+ // If aSourceFile is omitted, we will use the file property of the SourceMap
+ if (aSourceFile == null) {
+ if (aSourceMapConsumer.file == null) {
+ throw new Error(
+ 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
+ 'or the source map\'s "file" property. Both were omitted.'
+ );
+ }
+ sourceFile = aSourceMapConsumer.file;
+ }
+ var sourceRoot = this._sourceRoot;
+ // Make "sourceFile" relative if an absolute Url is passed.
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ // Applying the SourceMap can add and remove items from the sources and
+ // the names array.
+ var newSources = new ArraySet();
+ var newNames = new ArraySet();
+
+ // Find mappings for the "sourceFile"
+ this._mappings.unsortedForEach(function (mapping) {
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
+ // Check if it can be mapped by the source map, then update the mapping.
+ var original = aSourceMapConsumer.originalPositionFor({
+ line: mapping.originalLine,
+ column: mapping.originalColumn
+ });
+ if (original.source != null) {
+ // Copy mapping
+ mapping.source = original.source;
+ if (aSourceMapPath != null) {
+ mapping.source = util.join(aSourceMapPath, mapping.source)
+ }
+ if (sourceRoot != null) {
+ mapping.source = util.relative(sourceRoot, mapping.source);
+ }
+ mapping.originalLine = original.line;
+ mapping.originalColumn = original.column;
+ if (original.name != null) {
+ mapping.name = original.name;
+ }
+ }
+ }
+
+ var source = mapping.source;
+ if (source != null && !newSources.has(source)) {
+ newSources.add(source);
+ }
+
+ var name = mapping.name;
+ if (name != null && !newNames.has(name)) {
+ newNames.add(name);
+ }
+
+ }, this);
+ this._sources = newSources;
+ this._names = newNames;
+
+ // Copy sourcesContents of applied map.
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aSourceMapPath != null) {
+ sourceFile = util.join(aSourceMapPath, sourceFile);
+ }
+ if (sourceRoot != null) {
+ sourceFile = util.relative(sourceRoot, sourceFile);
+ }
+ this.setSourceContent(sourceFile, content);
+ }
+ }, this);
+ };
+
+ /**
+ * A mapping can have one of the three levels of data:
+ *
+ * 1. Just the generated position.
+ * 2. The Generated position, original position, and original source.
+ * 3. Generated and original position, original source, as well as a name
+ * token.
+ *
+ * To maintain consistency, we validate that any new mapping being added falls
+ * in to one of these categories.
+ */
+ SourceMapGenerator.prototype._validateMapping =
+ function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
+ aName) {
+ if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && !aOriginal && !aSource && !aName) {
+ // Case 1.
+ return;
+ }
+ else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
+ && aOriginal && 'line' in aOriginal && 'column' in aOriginal
+ && aGenerated.line > 0 && aGenerated.column >= 0
+ && aOriginal.line > 0 && aOriginal.column >= 0
+ && aSource) {
+ // Cases 2 and 3.
+ return;
+ }
+ else {
+ throw new Error('Invalid mapping: ' + JSON.stringify({
+ generated: aGenerated,
+ source: aSource,
+ original: aOriginal,
+ name: aName
+ }));
+ }
+ };
+
+ /**
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
+ * specified by the source map format.
+ */
+ SourceMapGenerator.prototype._serializeMappings =
+ function SourceMapGenerator_serializeMappings() {
+ var previousGeneratedColumn = 0;
+ var previousGeneratedLine = 1;
+ var previousOriginalColumn = 0;
+ var previousOriginalLine = 0;
+ var previousName = 0;
+ var previousSource = 0;
+ var result = '';
+ var mapping;
+
+ var mappings = this._mappings.toArray();
+
+ for (var i = 0, len = mappings.length; i < len; i++) {
+ mapping = mappings[i];
+
+ if (mapping.generatedLine !== previousGeneratedLine) {
+ previousGeneratedColumn = 0;
+ while (mapping.generatedLine !== previousGeneratedLine) {
+ result += ';';
+ previousGeneratedLine++;
+ }
+ }
+ else {
+ if (i > 0) {
+ if (!util.compareByGeneratedPositions(mapping, mappings[i - 1])) {
+ continue;
+ }
+ result += ',';
+ }
+ }
+
+ result += base64VLQ.encode(mapping.generatedColumn
+ - previousGeneratedColumn);
+ previousGeneratedColumn = mapping.generatedColumn;
+
+ if (mapping.source != null) {
+ result += base64VLQ.encode(this._sources.indexOf(mapping.source)
+ - previousSource);
+ previousSource = this._sources.indexOf(mapping.source);
+
+ // lines are stored 0-based in SourceMap spec version 3
+ result += base64VLQ.encode(mapping.originalLine - 1
+ - previousOriginalLine);
+ previousOriginalLine = mapping.originalLine - 1;
+
+ result += base64VLQ.encode(mapping.originalColumn
+ - previousOriginalColumn);
+ previousOriginalColumn = mapping.originalColumn;
+
+ if (mapping.name != null) {
+ result += base64VLQ.encode(this._names.indexOf(mapping.name)
+ - previousName);
+ previousName = this._names.indexOf(mapping.name);
+ }
+ }
+ }
+
+ return result;
+ };
+
+ SourceMapGenerator.prototype._generateSourcesContent =
+ function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
+ return aSources.map(function (source) {
+ if (!this._sourcesContents) {
+ return null;
+ }
+ if (aSourceRoot != null) {
+ source = util.relative(aSourceRoot, source);
+ }
+ var key = util.toSetString(source);
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents,
+ key)
+ ? this._sourcesContents[key]
+ : null;
+ }, this);
+ };
+
+ /**
+ * Externalize the source map.
+ */
+ SourceMapGenerator.prototype.toJSON =
+ function SourceMapGenerator_toJSON() {
+ var map = {
+ version: this._version,
+ sources: this._sources.toArray(),
+ names: this._names.toArray(),
+ mappings: this._serializeMappings()
+ };
+ if (this._file != null) {
+ map.file = this._file;
+ }
+ if (this._sourceRoot != null) {
+ map.sourceRoot = this._sourceRoot;
+ }
+ if (this._sourcesContents) {
+ map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
+ }
+
+ return map;
+ };
+
+ /**
+ * Render the source map being generated to a string.
+ */
+ SourceMapGenerator.prototype.toString =
+ function SourceMapGenerator_toString() {
+ return JSON.stringify(this);
+ };
+
+ exports.SourceMapGenerator = SourceMapGenerator;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-node.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-node.js
new file mode 100644
index 000000000..9ee90bd56
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/source-node.js
@@ -0,0 +1,414 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
+ var util = require('./util');
+
+ // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
+ // operating systems these days (capturing the result).
+ var REGEX_NEWLINE = /(\r?\n)/;
+
+ // Newline character code for charCodeAt() comparisons
+ var NEWLINE_CODE = 10;
+
+ // Private symbol for identifying `SourceNode`s when multiple versions of
+ // the source-map library are loaded. This MUST NOT CHANGE across
+ // versions!
+ var isSourceNode = "$$$isSourceNode$$$";
+
+ /**
+ * SourceNodes provide a way to abstract over interpolating/concatenating
+ * snippets of generated JavaScript source code while maintaining the line and
+ * column information associated with the original source code.
+ *
+ * @param aLine The original line number.
+ * @param aColumn The original column number.
+ * @param aSource The original source's filename.
+ * @param aChunks Optional. An array of strings which are snippets of
+ * generated JS, or other SourceNodes.
+ * @param aName The original identifier.
+ */
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
+ this.children = [];
+ this.sourceContents = {};
+ this.line = aLine == null ? null : aLine;
+ this.column = aColumn == null ? null : aColumn;
+ this.source = aSource == null ? null : aSource;
+ this.name = aName == null ? null : aName;
+ this[isSourceNode] = true;
+ if (aChunks != null) this.add(aChunks);
+ }
+
+ /**
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
+ *
+ * @param aGeneratedCode The generated code
+ * @param aSourceMapConsumer The SourceMap for the generated code
+ * @param aRelativePath Optional. The path that relative sources in the
+ * SourceMapConsumer should be relative to.
+ */
+ SourceNode.fromStringWithSourceMap =
+ function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
+ // The SourceNode we want to fill with the generated code
+ // and the SourceMap
+ var node = new SourceNode();
+
+ // All even indices of this array are one line of the generated code,
+ // while all odd indices are the newlines between two adjacent lines
+ // (since `REGEX_NEWLINE` captures its match).
+ // Processed fragments are removed from this array, by calling `shiftNextLine`.
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
+ var shiftNextLine = function() {
+ var lineContents = remainingLines.shift();
+ // The last line of a file might not have a newline.
+ var newLine = remainingLines.shift() || "";
+ return lineContents + newLine;
+ };
+
+ // We need to remember the position of "remainingLines"
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
+
+ // The generate SourceNodes we need a code range.
+ // To extract it current and last mapping is used.
+ // Here we store the last mapping.
+ var lastMapping = null;
+
+ aSourceMapConsumer.eachMapping(function (mapping) {
+ if (lastMapping !== null) {
+ // We add the code from "lastMapping" to "mapping":
+ // First check if there is a new line in between.
+ if (lastGeneratedLine < mapping.generatedLine) {
+ var code = "";
+ // Associate first line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ lastGeneratedLine++;
+ lastGeneratedColumn = 0;
+ // The remaining code is added without mapping
+ } else {
+ // There is no new line in between.
+ // Associate the code between "lastGeneratedColumn" and
+ // "mapping.generatedColumn" with "lastMapping"
+ var nextLine = remainingLines[0];
+ var code = nextLine.substr(0, mapping.generatedColumn -
+ lastGeneratedColumn);
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn -
+ lastGeneratedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ addMappingWithCode(lastMapping, code);
+ // No more remaining code, continue
+ lastMapping = mapping;
+ return;
+ }
+ }
+ // We add the generated code until the first mapping
+ // to the SourceNode without any mapping.
+ // Each line is added as separate string.
+ while (lastGeneratedLine < mapping.generatedLine) {
+ node.add(shiftNextLine());
+ lastGeneratedLine++;
+ }
+ if (lastGeneratedColumn < mapping.generatedColumn) {
+ var nextLine = remainingLines[0];
+ node.add(nextLine.substr(0, mapping.generatedColumn));
+ remainingLines[0] = nextLine.substr(mapping.generatedColumn);
+ lastGeneratedColumn = mapping.generatedColumn;
+ }
+ lastMapping = mapping;
+ }, this);
+ // We have processed all mappings.
+ if (remainingLines.length > 0) {
+ if (lastMapping) {
+ // Associate the remaining code in the current line with "lastMapping"
+ addMappingWithCode(lastMapping, shiftNextLine());
+ }
+ // and add the remaining lines without any mapping
+ node.add(remainingLines.join(""));
+ }
+
+ // Copy sourcesContent into SourceNode
+ aSourceMapConsumer.sources.forEach(function (sourceFile) {
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
+ if (content != null) {
+ if (aRelativePath != null) {
+ sourceFile = util.join(aRelativePath, sourceFile);
+ }
+ node.setSourceContent(sourceFile, content);
+ }
+ });
+
+ return node;
+
+ function addMappingWithCode(mapping, code) {
+ if (mapping === null || mapping.source === undefined) {
+ node.add(code);
+ } else {
+ var source = aRelativePath
+ ? util.join(aRelativePath, mapping.source)
+ : mapping.source;
+ node.add(new SourceNode(mapping.originalLine,
+ mapping.originalColumn,
+ source,
+ code,
+ mapping.name));
+ }
+ }
+ };
+
+ /**
+ * Add a chunk of generated JS to this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
+ if (Array.isArray(aChunk)) {
+ aChunk.forEach(function (chunk) {
+ this.add(chunk);
+ }, this);
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ if (aChunk) {
+ this.children.push(aChunk);
+ }
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Add a chunk of generated JS to the beginning of this source node.
+ *
+ * @param aChunk A string snippet of generated JS code, another instance of
+ * SourceNode, or an array where each member is one of those things.
+ */
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
+ if (Array.isArray(aChunk)) {
+ for (var i = aChunk.length-1; i >= 0; i--) {
+ this.prepend(aChunk[i]);
+ }
+ }
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
+ this.children.unshift(aChunk);
+ }
+ else {
+ throw new TypeError(
+ "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
+ );
+ }
+ return this;
+ };
+
+ /**
+ * Walk over the tree of JS snippets in this node and its children. The
+ * walking function is called once for each snippet of JS and is passed that
+ * snippet and the its original associated source's line/column location.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
+ var chunk;
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ chunk = this.children[i];
+ if (chunk[isSourceNode]) {
+ chunk.walk(aFn);
+ }
+ else {
+ if (chunk !== '') {
+ aFn(chunk, { source: this.source,
+ line: this.line,
+ column: this.column,
+ name: this.name });
+ }
+ }
+ }
+ };
+
+ /**
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
+ * each of `this.children`.
+ *
+ * @param aSep The separator.
+ */
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
+ var newChildren;
+ var i;
+ var len = this.children.length;
+ if (len > 0) {
+ newChildren = [];
+ for (i = 0; i < len-1; i++) {
+ newChildren.push(this.children[i]);
+ newChildren.push(aSep);
+ }
+ newChildren.push(this.children[i]);
+ this.children = newChildren;
+ }
+ return this;
+ };
+
+ /**
+ * Call String.prototype.replace on the very right-most source snippet. Useful
+ * for trimming whitespace from the end of a source node, etc.
+ *
+ * @param aPattern The pattern to replace.
+ * @param aReplacement The thing to replace the pattern with.
+ */
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
+ var lastChild = this.children[this.children.length - 1];
+ if (lastChild[isSourceNode]) {
+ lastChild.replaceRight(aPattern, aReplacement);
+ }
+ else if (typeof lastChild === 'string') {
+ this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
+ }
+ else {
+ this.children.push(''.replace(aPattern, aReplacement));
+ }
+ return this;
+ };
+
+ /**
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
+ * in the sourcesContent field.
+ *
+ * @param aSourceFile The filename of the source file
+ * @param aSourceContent The content of the source file
+ */
+ SourceNode.prototype.setSourceContent =
+ function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
+ };
+
+ /**
+ * Walk over the tree of SourceNodes. The walking function is called for each
+ * source file content and is passed the filename and source content.
+ *
+ * @param aFn The traversal function.
+ */
+ SourceNode.prototype.walkSourceContents =
+ function SourceNode_walkSourceContents(aFn) {
+ for (var i = 0, len = this.children.length; i < len; i++) {
+ if (this.children[i][isSourceNode]) {
+ this.children[i].walkSourceContents(aFn);
+ }
+ }
+
+ var sources = Object.keys(this.sourceContents);
+ for (var i = 0, len = sources.length; i < len; i++) {
+ aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
+ }
+ };
+
+ /**
+ * Return the string representation of this source node. Walks over the tree
+ * and concatenates all the various snippets together to one string.
+ */
+ SourceNode.prototype.toString = function SourceNode_toString() {
+ var str = "";
+ this.walk(function (chunk) {
+ str += chunk;
+ });
+ return str;
+ };
+
+ /**
+ * Returns the string representation of this source node along with a source
+ * map.
+ */
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
+ var generated = {
+ code: "",
+ line: 1,
+ column: 0
+ };
+ var map = new SourceMapGenerator(aArgs);
+ var sourceMappingActive = false;
+ var lastOriginalSource = null;
+ var lastOriginalLine = null;
+ var lastOriginalColumn = null;
+ var lastOriginalName = null;
+ this.walk(function (chunk, original) {
+ generated.code += chunk;
+ if (original.source !== null
+ && original.line !== null
+ && original.column !== null) {
+ if(lastOriginalSource !== original.source
+ || lastOriginalLine !== original.line
+ || lastOriginalColumn !== original.column
+ || lastOriginalName !== original.name) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ lastOriginalSource = original.source;
+ lastOriginalLine = original.line;
+ lastOriginalColumn = original.column;
+ lastOriginalName = original.name;
+ sourceMappingActive = true;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ generated: {
+ line: generated.line,
+ column: generated.column
+ }
+ });
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ }
+ for (var idx = 0, length = chunk.length; idx < length; idx++) {
+ if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
+ generated.line++;
+ generated.column = 0;
+ // Mappings end at eol
+ if (idx + 1 === length) {
+ lastOriginalSource = null;
+ sourceMappingActive = false;
+ } else if (sourceMappingActive) {
+ map.addMapping({
+ source: original.source,
+ original: {
+ line: original.line,
+ column: original.column
+ },
+ generated: {
+ line: generated.line,
+ column: generated.column
+ },
+ name: original.name
+ });
+ }
+ } else {
+ generated.column++;
+ }
+ }
+ });
+ this.walkSourceContents(function (sourceFile, sourceContent) {
+ map.setSourceContent(sourceFile, sourceContent);
+ });
+
+ return { code: generated.code, map: map };
+ };
+
+ exports.SourceNode = SourceNode;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/util.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/util.js
new file mode 100644
index 000000000..976f6cabb
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/lib/source-map/util.js
@@ -0,0 +1,319 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ /**
+ * This is a helper function for getting values from parameter/options
+ * objects.
+ *
+ * @param args The object we are extracting values from
+ * @param name The name of the property we are getting.
+ * @param defaultValue An optional value to return if the property is missing
+ * from the object. If this is not specified and the property is missing, an
+ * error will be thrown.
+ */
+ function getArg(aArgs, aName, aDefaultValue) {
+ if (aName in aArgs) {
+ return aArgs[aName];
+ } else if (arguments.length === 3) {
+ return aDefaultValue;
+ } else {
+ throw new Error('"' + aName + '" is a required argument.');
+ }
+ }
+ exports.getArg = getArg;
+
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/;
+ var dataUrlRegexp = /^data:.+\,.+$/;
+
+ function urlParse(aUrl) {
+ var match = aUrl.match(urlRegexp);
+ if (!match) {
+ return null;
+ }
+ return {
+ scheme: match[1],
+ auth: match[2],
+ host: match[3],
+ port: match[4],
+ path: match[5]
+ };
+ }
+ exports.urlParse = urlParse;
+
+ function urlGenerate(aParsedUrl) {
+ var url = '';
+ if (aParsedUrl.scheme) {
+ url += aParsedUrl.scheme + ':';
+ }
+ url += '//';
+ if (aParsedUrl.auth) {
+ url += aParsedUrl.auth + '@';
+ }
+ if (aParsedUrl.host) {
+ url += aParsedUrl.host;
+ }
+ if (aParsedUrl.port) {
+ url += ":" + aParsedUrl.port
+ }
+ if (aParsedUrl.path) {
+ url += aParsedUrl.path;
+ }
+ return url;
+ }
+ exports.urlGenerate = urlGenerate;
+
+ /**
+ * Normalizes a path, or the path portion of a URL:
+ *
+ * - Replaces consequtive slashes with one slash.
+ * - Removes unnecessary '.' parts.
+ * - Removes unnecessary '/..' parts.
+ *
+ * Based on code in the Node.js 'path' core module.
+ *
+ * @param aPath The path or url to normalize.
+ */
+ function normalize(aPath) {
+ var path = aPath;
+ var url = urlParse(aPath);
+ if (url) {
+ if (!url.path) {
+ return aPath;
+ }
+ path = url.path;
+ }
+ var isAbsolute = (path.charAt(0) === '/');
+
+ var parts = path.split(/\/+/);
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
+ part = parts[i];
+ if (part === '.') {
+ parts.splice(i, 1);
+ } else if (part === '..') {
+ up++;
+ } else if (up > 0) {
+ if (part === '') {
+ // The first part is blank if the path is absolute. Trying to go
+ // above the root is a no-op. Therefore we can remove all '..' parts
+ // directly after the root.
+ parts.splice(i + 1, up);
+ up = 0;
+ } else {
+ parts.splice(i, 2);
+ up--;
+ }
+ }
+ }
+ path = parts.join('/');
+
+ if (path === '') {
+ path = isAbsolute ? '/' : '.';
+ }
+
+ if (url) {
+ url.path = path;
+ return urlGenerate(url);
+ }
+ return path;
+ }
+ exports.normalize = normalize;
+
+ /**
+ * Joins two paths/URLs.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be joined with the root.
+ *
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
+ * first.
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
+ * is updated with the result and aRoot is returned. Otherwise the result
+ * is returned.
+ * - If aPath is absolute, the result is aPath.
+ * - Otherwise the two paths are joined with a slash.
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
+ */
+ function join(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+ if (aPath === "") {
+ aPath = ".";
+ }
+ var aPathUrl = urlParse(aPath);
+ var aRootUrl = urlParse(aRoot);
+ if (aRootUrl) {
+ aRoot = aRootUrl.path || '/';
+ }
+
+ // `join(foo, '//www.example.org')`
+ if (aPathUrl && !aPathUrl.scheme) {
+ if (aRootUrl) {
+ aPathUrl.scheme = aRootUrl.scheme;
+ }
+ return urlGenerate(aPathUrl);
+ }
+
+ if (aPathUrl || aPath.match(dataUrlRegexp)) {
+ return aPath;
+ }
+
+ // `join('http://', 'www.example.com')`
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
+ aRootUrl.host = aPath;
+ return urlGenerate(aRootUrl);
+ }
+
+ var joined = aPath.charAt(0) === '/'
+ ? aPath
+ : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);
+
+ if (aRootUrl) {
+ aRootUrl.path = joined;
+ return urlGenerate(aRootUrl);
+ }
+ return joined;
+ }
+ exports.join = join;
+
+ /**
+ * Make a path relative to a URL or another path.
+ *
+ * @param aRoot The root path or URL.
+ * @param aPath The path or URL to be made relative to aRoot.
+ */
+ function relative(aRoot, aPath) {
+ if (aRoot === "") {
+ aRoot = ".";
+ }
+
+ aRoot = aRoot.replace(/\/$/, '');
+
+ // XXX: It is possible to remove this block, and the tests still pass!
+ var url = urlParse(aRoot);
+ if (aPath.charAt(0) == "/" && url && url.path == "/") {
+ return aPath.slice(1);
+ }
+
+ return aPath.indexOf(aRoot + '/') === 0
+ ? aPath.substr(aRoot.length + 1)
+ : aPath;
+ }
+ exports.relative = relative;
+
+ /**
+ * Because behavior goes wacky when you set `__proto__` on objects, we
+ * have to prefix all the strings in our set with an arbitrary character.
+ *
+ * See https://github.com/mozilla/source-map/pull/31 and
+ * https://github.com/mozilla/source-map/issues/30
+ *
+ * @param String aStr
+ */
+ function toSetString(aStr) {
+ return '$' + aStr;
+ }
+ exports.toSetString = toSetString;
+
+ function fromSetString(aStr) {
+ return aStr.substr(1);
+ }
+ exports.fromSetString = fromSetString;
+
+ function strcmp(aStr1, aStr2) {
+ var s1 = aStr1 || "";
+ var s2 = aStr2 || "";
+ return (s1 > s2) - (s1 < s2);
+ }
+
+ /**
+ * Comparator between two mappings where the original positions are compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same original source/line/column, but different generated
+ * line and column the same. Useful when searching for a mapping with a
+ * stubbed out mapping.
+ */
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
+ var cmp;
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp || onlyCompareOriginal) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.name, mappingB.name);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ return mappingA.generatedColumn - mappingB.generatedColumn;
+ };
+ exports.compareByOriginalPositions = compareByOriginalPositions;
+
+ /**
+ * Comparator between two mappings where the generated positions are
+ * compared.
+ *
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
+ * mappings with the same generated line and column, but different
+ * source/name/original line and column the same. Useful when searching for a
+ * mapping with a stubbed out mapping.
+ */
+ function compareByGeneratedPositions(mappingA, mappingB, onlyCompareGenerated) {
+ var cmp;
+
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
+ if (cmp || onlyCompareGenerated) {
+ return cmp;
+ }
+
+ cmp = strcmp(mappingA.source, mappingB.source);
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalLine - mappingB.originalLine;
+ if (cmp) {
+ return cmp;
+ }
+
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
+ if (cmp) {
+ return cmp;
+ }
+
+ return strcmp(mappingA.name, mappingB.name);
+ };
+ exports.compareByGeneratedPositions = compareByGeneratedPositions;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/LICENSE b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/LICENSE
new file mode 100644
index 000000000..f33d665de
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/LICENSE
@@ -0,0 +1,58 @@
+amdefine is released under two licenses: new BSD, and MIT. You may pick the
+license that best suits your development needs. The text of both licenses are
+provided below.
+
+
+The "New" BSD License:
+----------------------
+
+Copyright (c) 2011, The Dojo Foundation
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice, this
+ list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of the Dojo Foundation nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
+FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+
+MIT License
+-----------
+
+Copyright (c) 2011, The Dojo Foundation
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/README.md b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/README.md
new file mode 100644
index 000000000..c6995c072
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/README.md
@@ -0,0 +1,171 @@
+# amdefine
+
+A module that can be used to implement AMD's define() in Node. This allows you
+to code to the AMD API and have the module work in node programs without
+requiring those other programs to use AMD.
+
+## Usage
+
+**1)** Update your package.json to indicate amdefine as a dependency:
+
+```javascript
+ "dependencies": {
+ "amdefine": ">=0.1.0"
+ }
+```
+
+Then run `npm install` to get amdefine into your project.
+
+**2)** At the top of each module that uses define(), place this code:
+
+```javascript
+if (typeof define !== 'function') { var define = require('amdefine')(module) }
+```
+
+**Only use these snippets** when loading amdefine. If you preserve the basic structure,
+with the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).
+
+You can add spaces, line breaks and even require amdefine with a local path, but
+keep the rest of the structure to get the stripping behavior.
+
+As you may know, because `if` statements in JavaScript don't have their own scope, the var
+declaration in the above snippet is made whether the `if` expression is truthy or not. If
+RequireJS is loaded then the declaration is superfluous because `define` is already already
+declared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`
+declarations of the same variable in the same scope gracefully.
+
+If you want to deliver amdefine.js with your code rather than specifying it as a dependency
+with npm, then just download the latest release and refer to it using a relative path:
+
+[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)
+
+### amdefine/intercept
+
+Consider this very experimental.
+
+Instead of pasting the piece of text for the amdefine setup of a `define`
+variable in each module you create or consume, you can use `amdefine/intercept`
+instead. It will automatically insert the above snippet in each .js file loaded
+by Node.
+
+**Warning**: you should only use this if you are creating an application that
+is consuming AMD style defined()'d modules that are distributed via npm and want
+to run that code in Node.
+
+For library code where you are not sure if it will be used by others in Node or
+in the browser, then explicitly depending on amdefine and placing the code
+snippet above is suggested path, instead of using `amdefine/intercept`. The
+intercept module affects all .js files loaded in the Node app, and it is
+inconsiderate to modify global state like that unless you are also controlling
+the top level app.
+
+#### Why distribute AMD-style nodes via npm?
+
+npm has a lot of weaknesses for front-end use (installed layout is not great,
+should have better support for the `baseUrl + moduleID + '.js' style of loading,
+single file JS installs), but some people want a JS package manager and are
+willing to live with those constraints. If that is you, but still want to author
+in AMD style modules to get dynamic require([]), better direct source usage and
+powerful loader plugin support in the browser, then this tool can help.
+
+#### amdefine/intercept usage
+
+Just require it in your top level app module (for example index.js, server.js):
+
+```javascript
+require('amdefine/intercept');
+```
+
+The module does not return a value, so no need to assign the result to a local
+variable.
+
+Then just require() code as you normally would with Node's require(). Any .js
+loaded after the intercept require will have the amdefine check injected in
+the .js source as it is loaded. It does not modify the source on disk, just
+prepends some content to the text of the module as it is loaded by Node.
+
+#### How amdefine/intercept works
+
+It overrides the `Module._extensions['.js']` in Node to automatically prepend
+the amdefine snippet above. So, it will affect any .js file loaded by your
+app.
+
+## define() usage
+
+It is best if you use the anonymous forms of define() in your module:
+
+```javascript
+define(function (require) {
+ var dependency = require('dependency');
+});
+```
+
+or
+
+```javascript
+define(['dependency'], function (dependency) {
+
+});
+```
+
+## RequireJS optimizer integration.
+
+Version 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)
+will have support for stripping the `if (typeof define !== 'function')` check
+mentioned above, so you can include this snippet for code that runs in the
+browser, but avoid taking the cost of the if() statement once the code is
+optimized for deployment.
+
+## Node 0.4 Support
+
+If you want to support Node 0.4, then add `require` as the second parameter to amdefine:
+
+```javascript
+//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.
+if (typeof define !== 'function') { var define = require('amdefine')(module, require) }
+```
+
+## Limitations
+
+### Synchronous vs Asynchronous
+
+amdefine creates a define() function that is callable by your code. It will
+execute and trace dependencies and call the factory function *synchronously*,
+to keep the behavior in line with Node's synchronous dependency tracing.
+
+The exception: calling AMD's callback-style require() from inside a factory
+function. The require callback is called on process.nextTick():
+
+```javascript
+define(function (require) {
+ require(['a'], function(a) {
+ //'a' is loaded synchronously, but
+ //this callback is called on process.nextTick().
+ });
+});
+```
+
+### Loader Plugins
+
+Loader plugins are supported as long as they call their load() callbacks
+synchronously. So ones that do network requests will not work. However plugins
+like [text](http://requirejs.org/docs/api.html#text) can load text files locally.
+
+The plugin API's `load.fromText()` is **not supported** in amdefine, so this means
+transpiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)
+will not work. This may be fixable, but it is a bit complex, and I do not have
+enough node-fu to figure it out yet. See the source for amdefine.js if you want
+to get an idea of the issues involved.
+
+## Tests
+
+To run the tests, cd to **tests** and run:
+
+```
+node all.js
+node all-intercept.js
+```
+
+## License
+
+New BSD and MIT. Check the LICENSE file for all the details.
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/amdefine.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/amdefine.js
new file mode 100644
index 000000000..53bf5a686
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/amdefine.js
@@ -0,0 +1,299 @@
+/** vim: et:ts=4:sw=4:sts=4
+ * @license amdefine 0.1.0 Copyright (c) 2011, The Dojo Foundation All Rights Reserved.
+ * Available via the MIT or new BSD license.
+ * see: http://github.com/jrburke/amdefine for details
+ */
+
+/*jslint node: true */
+/*global module, process */
+'use strict';
+
+/**
+ * Creates a define for node.
+ * @param {Object} module the "module" object that is defined by Node for the
+ * current module.
+ * @param {Function} [requireFn]. Node's require function for the current module.
+ * It only needs to be passed in Node versions before 0.5, when module.require
+ * did not exist.
+ * @returns {Function} a define function that is usable for the current node
+ * module.
+ */
+function amdefine(module, requireFn) {
+ 'use strict';
+ var defineCache = {},
+ loaderCache = {},
+ alreadyCalled = false,
+ path = require('path'),
+ makeRequire, stringRequire;
+
+ /**
+ * Trims the . and .. from an array of path segments.
+ * It will keep a leading path segment if a .. will become
+ * the first path segment, to help with module name lookups,
+ * which act like paths, but can be remapped. But the end result,
+ * all paths that use this function should look normalized.
+ * NOTE: this method MODIFIES the input array.
+ * @param {Array} ary the array of path segments.
+ */
+ function trimDots(ary) {
+ var i, part;
+ for (i = 0; ary[i]; i+= 1) {
+ part = ary[i];
+ if (part === '.') {
+ ary.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ if (i === 1 && (ary[2] === '..' || ary[0] === '..')) {
+ //End of the line. Keep at least one non-dot
+ //path segment at the front so it can be mapped
+ //correctly to disk. Otherwise, there is likely
+ //no path mapping for a path starting with '..'.
+ //This can still fail, but catches the most reasonable
+ //uses of ..
+ break;
+ } else if (i > 0) {
+ ary.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ }
+
+ function normalize(name, baseName) {
+ var baseParts;
+
+ //Adjust any relative paths.
+ if (name && name.charAt(0) === '.') {
+ //If have a base name, try to normalize against it,
+ //otherwise, assume it is a top-level require that will
+ //be relative to baseUrl in the end.
+ if (baseName) {
+ baseParts = baseName.split('/');
+ baseParts = baseParts.slice(0, baseParts.length - 1);
+ baseParts = baseParts.concat(name.split('/'));
+ trimDots(baseParts);
+ name = baseParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ /**
+ * Create the normalize() function passed to a loader plugin's
+ * normalize method.
+ */
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(id) {
+ function load(value) {
+ loaderCache[id] = value;
+ }
+
+ load.fromText = function (id, text) {
+ //This one is difficult because the text can/probably uses
+ //define, and any relative paths and requires should be relative
+ //to that id was it would be found on disk. But this would require
+ //bootstrapping a module/require fairly deeply from node core.
+ //Not sure how best to go about that yet.
+ throw new Error('amdefine does not implement load.fromText');
+ };
+
+ return load;
+ }
+
+ makeRequire = function (systemRequire, exports, module, relId) {
+ function amdRequire(deps, callback) {
+ if (typeof deps === 'string') {
+ //Synchronous, single module require('')
+ return stringRequire(systemRequire, exports, module, deps, relId);
+ } else {
+ //Array of dependencies with a callback.
+
+ //Convert the dependencies to modules.
+ deps = deps.map(function (depName) {
+ return stringRequire(systemRequire, exports, module, depName, relId);
+ });
+
+ //Wait for next tick to call back the require call.
+ process.nextTick(function () {
+ callback.apply(null, deps);
+ });
+ }
+ }
+
+ amdRequire.toUrl = function (filePath) {
+ if (filePath.indexOf('.') === 0) {
+ return normalize(filePath, path.dirname(module.filename));
+ } else {
+ return filePath;
+ }
+ };
+
+ return amdRequire;
+ };
+
+ //Favor explicit value, passed in if the module wants to support Node 0.4.
+ requireFn = requireFn || function req() {
+ return module.require.apply(module, arguments);
+ };
+
+ function runFactory(id, deps, factory) {
+ var r, e, m, result;
+
+ if (id) {
+ e = loaderCache[id] = {};
+ m = {
+ id: id,
+ uri: __filename,
+ exports: e
+ };
+ r = makeRequire(requireFn, e, m, id);
+ } else {
+ //Only support one define call per file
+ if (alreadyCalled) {
+ throw new Error('amdefine with no module ID cannot be called more than once per file.');
+ }
+ alreadyCalled = true;
+
+ //Use the real variables from node
+ //Use module.exports for exports, since
+ //the exports in here is amdefine exports.
+ e = module.exports;
+ m = module;
+ r = makeRequire(requireFn, e, m, module.id);
+ }
+
+ //If there are dependencies, they are strings, so need
+ //to convert them to dependency values.
+ if (deps) {
+ deps = deps.map(function (depName) {
+ return r(depName);
+ });
+ }
+
+ //Call the factory with the right dependencies.
+ if (typeof factory === 'function') {
+ result = factory.apply(m.exports, deps);
+ } else {
+ result = factory;
+ }
+
+ if (result !== undefined) {
+ m.exports = result;
+ if (id) {
+ loaderCache[id] = m.exports;
+ }
+ }
+ }
+
+ stringRequire = function (systemRequire, exports, module, id, relId) {
+ //Split the ID by a ! so that
+ var index = id.indexOf('!'),
+ originalId = id,
+ prefix, plugin;
+
+ if (index === -1) {
+ id = normalize(id, relId);
+
+ //Straight module lookup. If it is one of the special dependencies,
+ //deal with it, otherwise, delegate to node.
+ if (id === 'require') {
+ return makeRequire(systemRequire, exports, module, relId);
+ } else if (id === 'exports') {
+ return exports;
+ } else if (id === 'module') {
+ return module;
+ } else if (loaderCache.hasOwnProperty(id)) {
+ return loaderCache[id];
+ } else if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ } else {
+ if(systemRequire) {
+ return systemRequire(originalId);
+ } else {
+ throw new Error('No module with ID: ' + id);
+ }
+ }
+ } else {
+ //There is a plugin in play.
+ prefix = id.substring(0, index);
+ id = id.substring(index + 1, id.length);
+
+ plugin = stringRequire(systemRequire, exports, module, prefix, relId);
+
+ if (plugin.normalize) {
+ id = plugin.normalize(id, makeNormalize(relId));
+ } else {
+ //Normalize the ID normally.
+ id = normalize(id, relId);
+ }
+
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ } else {
+ plugin.load(id, makeRequire(systemRequire, exports, module, relId), makeLoad(id), {});
+
+ return loaderCache[id];
+ }
+ }
+ };
+
+ //Create a define function specific to the module asking for amdefine.
+ function define(id, deps, factory) {
+ if (Array.isArray(id)) {
+ factory = deps;
+ deps = id;
+ id = undefined;
+ } else if (typeof id !== 'string') {
+ factory = id;
+ id = deps = undefined;
+ }
+
+ if (deps && !Array.isArray(deps)) {
+ factory = deps;
+ deps = undefined;
+ }
+
+ if (!deps) {
+ deps = ['require', 'exports', 'module'];
+ }
+
+ //Set up properties for this module. If an ID, then use
+ //internal cache. If no ID, then use the external variables
+ //for this node module.
+ if (id) {
+ //Put the module in deep freeze until there is a
+ //require call for it.
+ defineCache[id] = [id, deps, factory];
+ } else {
+ runFactory(id, deps, factory);
+ }
+ }
+
+ //define.require, which has access to all the values in the
+ //cache. Useful for AMD modules that all have IDs in the file,
+ //but need to finally export a value to node based on one of those
+ //IDs.
+ define.require = function (id) {
+ if (loaderCache[id]) {
+ return loaderCache[id];
+ }
+
+ if (defineCache[id]) {
+ runFactory.apply(null, defineCache[id]);
+ return loaderCache[id];
+ }
+ };
+
+ define.amd = {};
+
+ return define;
+}
+
+module.exports = amdefine;
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/intercept.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/intercept.js
new file mode 100644
index 000000000..771a98301
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/intercept.js
@@ -0,0 +1,36 @@
+/*jshint node: true */
+var inserted,
+ Module = require('module'),
+ fs = require('fs'),
+ existingExtFn = Module._extensions['.js'],
+ amdefineRegExp = /amdefine\.js/;
+
+inserted = "if (typeof define !== 'function') {var define = require('amdefine')(module)}";
+
+//From the node/lib/module.js source:
+function stripBOM(content) {
+ // Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)
+ // because the buffer-to-string conversion in `fs.readFileSync()`
+ // translates it to FEFF, the UTF-16 BOM.
+ if (content.charCodeAt(0) === 0xFEFF) {
+ content = content.slice(1);
+ }
+ return content;
+}
+
+//Also adapted from the node/lib/module.js source:
+function intercept(module, filename) {
+ var content = stripBOM(fs.readFileSync(filename, 'utf8'));
+
+ if (!amdefineRegExp.test(module.id)) {
+ content = inserted + content;
+ }
+
+ module._compile(content, filename);
+}
+
+intercept._id = 'amdefine/intercept';
+
+if (!existingExtFn._id || existingExtFn._id !== intercept._id) {
+ Module._extensions['.js'] = intercept;
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/package.json b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/package.json
new file mode 100644
index 000000000..8caf15c5a
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/node_modules/amdefine/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "amdefine",
+ "description": "Provide AMD's define() API for declaring modules in the AMD format",
+ "version": "0.1.0",
+ "homepage": "http://github.com/jrburke/amdefine",
+ "author": {
+ "name": "James Burke",
+ "email": "jrburke@gmail.com",
+ "url": "http://github.com/jrburke"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
+ },
+ {
+ "type": "MIT",
+ "url": "https://github.com/jrburke/amdefine/blob/master/LICENSE"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/jrburke/amdefine.git"
+ },
+ "main": "./amdefine.js",
+ "engines": {
+ "node": ">=0.4.2"
+ },
+ "readme": "# amdefine\n\nA module that can be used to implement AMD's define() in Node. This allows you\nto code to the AMD API and have the module work in node programs without\nrequiring those other programs to use AMD.\n\n## Usage\n\n**1)** Update your package.json to indicate amdefine as a dependency:\n\n```javascript\n \"dependencies\": {\n \"amdefine\": \">=0.1.0\"\n }\n```\n\nThen run `npm install` to get amdefine into your project.\n\n**2)** At the top of each module that uses define(), place this code:\n\n```javascript\nif (typeof define !== 'function') { var define = require('amdefine')(module) }\n```\n\n**Only use these snippets** when loading amdefine. If you preserve the basic structure,\nwith the braces, it will be stripped out when using the [RequireJS optimizer](#optimizer).\n\nYou can add spaces, line breaks and even require amdefine with a local path, but\nkeep the rest of the structure to get the stripping behavior.\n\nAs you may know, because `if` statements in JavaScript don't have their own scope, the var\ndeclaration in the above snippet is made whether the `if` expression is truthy or not. If\nRequireJS is loaded then the declaration is superfluous because `define` is already already\ndeclared in the same scope in RequireJS. Fortunately JavaScript handles multiple `var`\ndeclarations of the same variable in the same scope gracefully.\n\nIf you want to deliver amdefine.js with your code rather than specifying it as a dependency\nwith npm, then just download the latest release and refer to it using a relative path:\n\n[Latest Version](https://github.com/jrburke/amdefine/raw/latest/amdefine.js)\n\n### amdefine/intercept\n\nConsider this very experimental.\n\nInstead of pasting the piece of text for the amdefine setup of a `define`\nvariable in each module you create or consume, you can use `amdefine/intercept`\ninstead. It will automatically insert the above snippet in each .js file loaded\nby Node.\n\n**Warning**: you should only use this if you are creating an application that\nis consuming AMD style defined()'d modules that are distributed via npm and want\nto run that code in Node.\n\nFor library code where you are not sure if it will be used by others in Node or\nin the browser, then explicitly depending on amdefine and placing the code\nsnippet above is suggested path, instead of using `amdefine/intercept`. The\nintercept module affects all .js files loaded in the Node app, and it is\ninconsiderate to modify global state like that unless you are also controlling\nthe top level app.\n\n#### Why distribute AMD-style nodes via npm?\n\nnpm has a lot of weaknesses for front-end use (installed layout is not great,\nshould have better support for the `baseUrl + moduleID + '.js' style of loading,\nsingle file JS installs), but some people want a JS package manager and are\nwilling to live with those constraints. If that is you, but still want to author\nin AMD style modules to get dynamic require([]), better direct source usage and\npowerful loader plugin support in the browser, then this tool can help.\n\n#### amdefine/intercept usage\n\nJust require it in your top level app module (for example index.js, server.js):\n\n```javascript\nrequire('amdefine/intercept');\n```\n\nThe module does not return a value, so no need to assign the result to a local\nvariable.\n\nThen just require() code as you normally would with Node's require(). Any .js\nloaded after the intercept require will have the amdefine check injected in\nthe .js source as it is loaded. It does not modify the source on disk, just\nprepends some content to the text of the module as it is loaded by Node.\n\n#### How amdefine/intercept works\n\nIt overrides the `Module._extensions['.js']` in Node to automatically prepend\nthe amdefine snippet above. So, it will affect any .js file loaded by your\napp.\n\n## define() usage\n\nIt is best if you use the anonymous forms of define() in your module:\n\n```javascript\ndefine(function (require) {\n var dependency = require('dependency');\n});\n```\n\nor\n\n```javascript\ndefine(['dependency'], function (dependency) {\n\n});\n```\n\n## RequireJS optimizer integration. \n\nVersion 1.0.3 of the [RequireJS optimizer](http://requirejs.org/docs/optimization.html)\nwill have support for stripping the `if (typeof define !== 'function')` check\nmentioned above, so you can include this snippet for code that runs in the\nbrowser, but avoid taking the cost of the if() statement once the code is\noptimized for deployment.\n\n## Node 0.4 Support\n\nIf you want to support Node 0.4, then add `require` as the second parameter to amdefine:\n\n```javascript\n//Only if you want Node 0.4. If using 0.5 or later, use the above snippet.\nif (typeof define !== 'function') { var define = require('amdefine')(module, require) }\n```\n\n## Limitations\n\n### Synchronous vs Asynchronous\n\namdefine creates a define() function that is callable by your code. It will\nexecute and trace dependencies and call the factory function *synchronously*,\nto keep the behavior in line with Node's synchronous dependency tracing.\n\nThe exception: calling AMD's callback-style require() from inside a factory\nfunction. The require callback is called on process.nextTick():\n\n```javascript\ndefine(function (require) {\n require(['a'], function(a) {\n //'a' is loaded synchronously, but\n //this callback is called on process.nextTick().\n });\n});\n```\n\n### Loader Plugins\n\nLoader plugins are supported as long as they call their load() callbacks\nsynchronously. So ones that do network requests will not work. However plugins\nlike [text](http://requirejs.org/docs/api.html#text) can load text files locally.\n\nThe plugin API's `load.fromText()` is **not supported** in amdefine, so this means\ntranspiler plugins like the [CoffeeScript loader plugin](https://github.com/jrburke/require-cs)\nwill not work. This may be fixable, but it is a bit complex, and I do not have\nenough node-fu to figure it out yet. See the source for amdefine.js if you want\nto get an idea of the issues involved.\n\n## Tests\n\nTo run the tests, cd to **tests** and run:\n\n```\nnode all.js\nnode all-intercept.js\n```\n\n## License\n\nNew BSD and MIT. Check the LICENSE file for all the details.\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/jrburke/amdefine/issues"
+ },
+ "_id": "amdefine@0.1.0",
+ "_from": "amdefine@>=0.0.4"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/package.json b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/package.json
new file mode 100644
index 000000000..c84dc5f33
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/package.json
@@ -0,0 +1,162 @@
+{
+ "name": "source-map",
+ "description": "Generates and consumes source maps",
+ "version": "0.1.43",
+ "homepage": "https://github.com/mozilla/source-map",
+ "author": {
+ "name": "Nick Fitzgerald",
+ "email": "nfitzgerald@mozilla.com"
+ },
+ "contributors": [
+ {
+ "name": "Tobias Koppers",
+ "email": "tobias.koppers@googlemail.com"
+ },
+ {
+ "name": "Duncan Beevers",
+ "email": "duncan@dweebd.com"
+ },
+ {
+ "name": "Stephen Crane",
+ "email": "scrane@mozilla.com"
+ },
+ {
+ "name": "Ryan Seddon",
+ "email": "seddon.ryan@gmail.com"
+ },
+ {
+ "name": "Miles Elam",
+ "email": "miles.elam@deem.com"
+ },
+ {
+ "name": "Mihai Bazon",
+ "email": "mihai.bazon@gmail.com"
+ },
+ {
+ "name": "Michael Ficarra",
+ "email": "github.public.email@michael.ficarra.me"
+ },
+ {
+ "name": "Todd Wolfson",
+ "email": "todd@twolfson.com"
+ },
+ {
+ "name": "Alexander Solovyov",
+ "email": "alexander@solovyov.net"
+ },
+ {
+ "name": "Felix Gnass",
+ "email": "fgnass@gmail.com"
+ },
+ {
+ "name": "Conrad Irwin",
+ "email": "conrad.irwin@gmail.com"
+ },
+ {
+ "name": "usrbincc",
+ "email": "usrbincc@yahoo.com"
+ },
+ {
+ "name": "David Glasser",
+ "email": "glasser@davidglasser.net"
+ },
+ {
+ "name": "Chase Douglas",
+ "email": "chase@newrelic.com"
+ },
+ {
+ "name": "Evan Wallace",
+ "email": "evan.exe@gmail.com"
+ },
+ {
+ "name": "Heather Arthur",
+ "email": "fayearthur@gmail.com"
+ },
+ {
+ "name": "Hugh Kennedy",
+ "email": "hughskennedy@gmail.com"
+ },
+ {
+ "name": "David Glasser",
+ "email": "glasser@davidglasser.net"
+ },
+ {
+ "name": "Simon Lydell",
+ "email": "simon.lydell@gmail.com"
+ },
+ {
+ "name": "Jmeas Smith",
+ "email": "jellyes2@gmail.com"
+ },
+ {
+ "name": "Michael Z Goddard",
+ "email": "mzgoddard@gmail.com"
+ },
+ {
+ "name": "azu",
+ "email": "azu@users.noreply.github.com"
+ },
+ {
+ "name": "John Gozde",
+ "email": "john@gozde.ca"
+ },
+ {
+ "name": "Adam Kirkton",
+ "email": "akirkton@truefitinnovation.com"
+ },
+ {
+ "name": "Chris Montgomery",
+ "email": "christopher.montgomery@dowjones.com"
+ },
+ {
+ "name": "J. Ryan Stinnett",
+ "email": "jryans@gmail.com"
+ },
+ {
+ "name": "Jack Herrington",
+ "email": "jherrington@walmartlabs.com"
+ },
+ {
+ "name": "Chris Truter",
+ "email": "jeffpalentine@gmail.com"
+ },
+ {
+ "name": "Daniel Espeset",
+ "email": "daniel@danielespeset.com"
+ }
+ ],
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/mozilla/source-map.git"
+ },
+ "directories": {
+ "lib": "./lib"
+ },
+ "main": "./lib/source-map.js",
+ "engines": {
+ "node": ">=0.8.0"
+ },
+ "licenses": [
+ {
+ "type": "BSD",
+ "url": "http://opensource.org/licenses/BSD-3-Clause"
+ }
+ ],
+ "dependencies": {
+ "amdefine": ">=0.0.4"
+ },
+ "devDependencies": {
+ "dryice": ">=0.4.8"
+ },
+ "scripts": {
+ "test": "node test/run-tests.js",
+ "build": "node Makefile.dryice.js"
+ },
+ "readme": "# Source Map\n\nThis is a library to generate and consume the source map format\n[described here][format].\n\nThis library is written in the Asynchronous Module Definition format, and works\nin the following environments:\n\n* Modern Browsers supporting ECMAScript 5 (either after the build, or with an\n AMD loader such as RequireJS)\n\n* Inside Firefox (as a JSM file, after the build)\n\n* With NodeJS versions 0.8.X and higher\n\n## Node\n\n $ npm install source-map\n\n## Building from Source (for everywhere else)\n\nInstall Node and then run\n\n $ git clone https://fitzgen@github.com/mozilla/source-map.git\n $ cd source-map\n $ npm link .\n\nNext, run\n\n $ node Makefile.dryice.js\n\nThis should spew a bunch of stuff to stdout, and create the following files:\n\n* `dist/source-map.js` - The unminified browser version.\n\n* `dist/source-map.min.js` - The minified browser version.\n\n* `dist/SourceMap.jsm` - The JavaScript Module for inclusion in Firefox source.\n\n## Examples\n\n### Consuming a source map\n\n var rawSourceMap = {\n version: 3,\n file: 'min.js',\n names: ['bar', 'baz', 'n'],\n sources: ['one.js', 'two.js'],\n sourceRoot: 'http://example.com/www/js/',\n mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'\n };\n\n var smc = new SourceMapConsumer(rawSourceMap);\n\n console.log(smc.sources);\n // [ 'http://example.com/www/js/one.js',\n // 'http://example.com/www/js/two.js' ]\n\n console.log(smc.originalPositionFor({\n line: 2,\n column: 28\n }));\n // { source: 'http://example.com/www/js/two.js',\n // line: 2,\n // column: 10,\n // name: 'n' }\n\n console.log(smc.generatedPositionFor({\n source: 'http://example.com/www/js/two.js',\n line: 2,\n column: 10\n }));\n // { line: 2, column: 28 }\n\n smc.eachMapping(function (m) {\n // ...\n });\n\n### Generating a source map\n\nIn depth guide:\n[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)\n\n#### With SourceNode (high level API)\n\n function compile(ast) {\n switch (ast.type) {\n case 'BinaryExpression':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n [compile(ast.left), \" + \", compile(ast.right)]\n );\n case 'Literal':\n return new SourceNode(\n ast.location.line,\n ast.location.column,\n ast.location.source,\n String(ast.value)\n );\n // ...\n default:\n throw new Error(\"Bad AST\");\n }\n }\n\n var ast = parse(\"40 + 2\", \"add.js\");\n console.log(compile(ast).toStringWithSourceMap({\n file: 'add.js'\n }));\n // { code: '40 + 2',\n // map: [object SourceMapGenerator] }\n\n#### With SourceMapGenerator (low level API)\n\n var map = new SourceMapGenerator({\n file: \"source-mapped.js\"\n });\n\n map.addMapping({\n generated: {\n line: 10,\n column: 35\n },\n source: \"foo.js\",\n original: {\n line: 33,\n column: 2\n },\n name: \"christopher\"\n });\n\n console.log(map.toString());\n // '{\"version\":3,\"file\":\"source-mapped.js\",\"sources\":[\"foo.js\"],\"names\":[\"christopher\"],\"mappings\":\";;;;;;;;;mCAgCEA\"}'\n\n## API\n\nGet a reference to the module:\n\n // NodeJS\n var sourceMap = require('source-map');\n\n // Browser builds\n var sourceMap = window.sourceMap;\n\n // Inside Firefox\n let sourceMap = {};\n Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);\n\n### SourceMapConsumer\n\nA SourceMapConsumer instance represents a parsed source map which we can query\nfor information about the original file positions by giving it a file position\nin the generated source.\n\n#### new SourceMapConsumer(rawSourceMap)\n\nThe only parameter is the raw source map (either as a string which can be\n`JSON.parse`'d, or an object). According to the spec, source maps have the\nfollowing attributes:\n\n* `version`: Which version of the source map spec this map is following.\n\n* `sources`: An array of URLs to the original source files.\n\n* `names`: An array of identifiers which can be referrenced by individual\n mappings.\n\n* `sourceRoot`: Optional. The URL root from which all sources are relative.\n\n* `sourcesContent`: Optional. An array of contents of the original source files.\n\n* `mappings`: A string of base64 VLQs which contain the actual mappings.\n\n* `file`: Optional. The generated filename this source map is associated with.\n\n#### SourceMapConsumer.prototype.computeColumnSpans()\n\nCompute the last column for each generated mapping. The last column is\ninclusive.\n\n#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)\n\nReturns the original source, line, and column information for the generated\nsource's line and column positions provided. The only argument is an object with\nthe following properties:\n\n* `line`: The line number in the generated source.\n\n* `column`: The column number in the generated source.\n\nand an object is returned with the following properties:\n\n* `source`: The original source file, or null if this information is not\n available.\n\n* `line`: The line number in the original source, or null if this information is\n not available.\n\n* `column`: The column number in the original source, or null or null if this\n information is not available.\n\n* `name`: The original identifier, or null if this information is not available.\n\n#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)\n\nReturns the generated line and column information for the original source,\nline, and column positions provided. The only argument is an object with\nthe following properties:\n\n* `source`: The filename of the original source.\n\n* `line`: The line number in the original source.\n\n* `column`: The column number in the original source.\n\nand an object is returned with the following properties:\n\n* `line`: The line number in the generated source, or null.\n\n* `column`: The column number in the generated source, or null.\n\n#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)\n\nReturns all generated line and column information for the original source\nand line provided. The only argument is an object with the following\nproperties:\n\n* `source`: The filename of the original source.\n\n* `line`: The line number in the original source.\n\nand an array of objects is returned, each with the following properties:\n\n* `line`: The line number in the generated source, or null.\n\n* `column`: The column number in the generated source, or null.\n\n#### SourceMapConsumer.prototype.sourceContentFor(source)\n\nReturns the original source content for the source provided. The only\nargument is the URL of the original source file.\n\n#### SourceMapConsumer.prototype.eachMapping(callback, context, order)\n\nIterate over each mapping between an original source/line/column and a\ngenerated line/column in this source map.\n\n* `callback`: The function that is called with each mapping. Mappings have the\n form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,\n name }`\n\n* `context`: Optional. If specified, this object will be the value of `this`\n every time that `callback` is called.\n\n* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or\n `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over\n the mappings sorted by the generated file's line/column order or the\n original's source/line/column order, respectively. Defaults to\n `SourceMapConsumer.GENERATED_ORDER`.\n\n### SourceMapGenerator\n\nAn instance of the SourceMapGenerator represents a source map which is being\nbuilt incrementally.\n\n#### new SourceMapGenerator([startOfSourceMap])\n\nYou may pass an object with the following properties:\n\n* `file`: The filename of the generated source that this source map is\n associated with.\n\n* `sourceRoot`: A root for all relative URLs in this source map.\n\n* `skipValidation`: Optional. When `true`, disables validation of mappings as\n they are added. This can improve performance but should be used with\n discretion, as a last resort. Even then, one should avoid using this flag when\n running tests, if possible.\n\n#### SourceMapGenerator.fromSourceMap(sourceMapConsumer)\n\nCreates a new SourceMapGenerator based on a SourceMapConsumer\n\n* `sourceMapConsumer` The SourceMap.\n\n#### SourceMapGenerator.prototype.addMapping(mapping)\n\nAdd a single mapping from original source line and column to the generated\nsource's line and column for this source map being created. The mapping object\nshould have the following properties:\n\n* `generated`: An object with the generated line and column positions.\n\n* `original`: An object with the original line and column positions.\n\n* `source`: The original source file (relative to the sourceRoot).\n\n* `name`: An optional original token name for this mapping.\n\n#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for an original source file.\n\n* `sourceFile` the URL of the original source file.\n\n* `sourceContent` the content of the source file.\n\n#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])\n\nApplies a SourceMap for a source file to the SourceMap.\nEach mapping to the supplied source file is rewritten using the\nsupplied SourceMap. Note: The resolution for the resulting mappings\nis the minimium of this map and the supplied map.\n\n* `sourceMapConsumer`: The SourceMap to be applied.\n\n* `sourceFile`: Optional. The filename of the source file.\n If omitted, sourceMapConsumer.file will be used, if it exists.\n Otherwise an error will be thrown.\n\n* `sourceMapPath`: Optional. The dirname of the path to the SourceMap\n to be applied. If relative, it is relative to the SourceMap.\n\n This parameter is needed when the two SourceMaps aren't in the same\n directory, and the SourceMap to be applied contains relative source\n paths. If so, those relative source paths need to be rewritten\n relative to the SourceMap.\n\n If omitted, it is assumed that both SourceMaps are in the same directory,\n thus not needing any rewriting. (Supplying `'.'` has the same effect.)\n\n#### SourceMapGenerator.prototype.toString()\n\nRenders the source map being generated to a string.\n\n### SourceNode\n\nSourceNodes provide a way to abstract over interpolating and/or concatenating\nsnippets of generated JavaScript source code, while maintaining the line and\ncolumn information associated between those snippets and the original source\ncode. This is useful as the final intermediate representation a compiler might\nuse before outputting the generated JS and source map.\n\n#### new SourceNode([line, column, source[, chunk[, name]]])\n\n* `line`: The original line number associated with this source node, or null if\n it isn't associated with an original line.\n\n* `column`: The original column number associated with this source node, or null\n if it isn't associated with an original column.\n\n* `source`: The original source's filename; null if no filename is provided.\n\n* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see\n below.\n\n* `name`: Optional. The original identifier.\n\n#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])\n\nCreates a SourceNode from generated code and a SourceMapConsumer.\n\n* `code`: The generated code\n\n* `sourceMapConsumer` The SourceMap for the generated code\n\n* `relativePath` The optional path that relative sources in `sourceMapConsumer`\n should be relative to.\n\n#### SourceNode.prototype.add(chunk)\n\nAdd a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.prepend(chunk)\n\nPrepend a chunk of generated JS to this source node.\n\n* `chunk`: A string snippet of generated JS code, another instance of\n `SourceNode`, or an array where each member is one of those things.\n\n#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)\n\nSet the source content for a source file. This will be added to the\n`SourceMap` in the `sourcesContent` field.\n\n* `sourceFile`: The filename of the source file\n\n* `sourceContent`: The content of the source file\n\n#### SourceNode.prototype.walk(fn)\n\nWalk over the tree of JS snippets in this node and its children. The walking\nfunction is called once for each snippet of JS and is passed that snippet and\nthe its original associated source's line/column location.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.walkSourceContents(fn)\n\nWalk over the tree of SourceNodes. The walking function is called for each\nsource file content and is passed the filename and source content.\n\n* `fn`: The traversal function.\n\n#### SourceNode.prototype.join(sep)\n\nLike `Array.prototype.join` except for SourceNodes. Inserts the separator\nbetween each of this source node's children.\n\n* `sep`: The separator.\n\n#### SourceNode.prototype.replaceRight(pattern, replacement)\n\nCall `String.prototype.replace` on the very right-most source snippet. Useful\nfor trimming whitespace from the end of a source node, etc.\n\n* `pattern`: The pattern to replace.\n\n* `replacement`: The thing to replace the pattern with.\n\n#### SourceNode.prototype.toString()\n\nReturn the string representation of this source node. Walks over the tree and\nconcatenates all the various snippets together to one string.\n\n#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])\n\nReturns the string representation of this tree of source nodes, plus a\nSourceMapGenerator which contains all the mappings between the generated and\noriginal sources.\n\nThe arguments are the same as those to `new SourceMapGenerator`.\n\n## Tests\n\n[](https://travis-ci.org/mozilla/source-map)\n\nInstall NodeJS version 0.8.0 or greater, then run `node test/run-tests.js`.\n\nTo add new tests, create a new file named `test/test-.js`\nand export your test functions with names that start with \"test\", for example\n\n exports[\"test doing the foo bar\"] = function (assert, util) {\n ...\n };\n\nThe new test will be located automatically when you run the suite.\n\nThe `util` argument is the test utility module located at `test/source-map/util`.\n\nThe `assert` argument is a cut down version of node's assert module. You have\naccess to the following assertion functions:\n\n* `doesNotThrow`\n\n* `equal`\n\n* `ok`\n\n* `strictEqual`\n\n* `throws`\n\n(The reason for the restricted set of test functions is because we need the\ntests to run inside Firefox's test suite as well and so the assert module is\nshimmed in that environment. See `build/assert-shim.js`.)\n\n[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit\n[feature]: https://wiki.mozilla.org/DevTools/Features/SourceMap\n[Dryice]: https://github.com/mozilla/dryice\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/mozilla/source-map/issues"
+ },
+ "_id": "source-map@0.1.43",
+ "_from": "source-map@~0.1.43"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/run-tests.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/run-tests.js
new file mode 100644
index 000000000..64a7c3a3d
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/run-tests.js
@@ -0,0 +1,62 @@
+#!/usr/bin/env node
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+var assert = require('assert');
+var fs = require('fs');
+var path = require('path');
+var util = require('./source-map/util');
+
+function run(tests) {
+ var total = 0;
+ var passed = 0;
+
+ for (var i = 0; i < tests.length; i++) {
+ for (var k in tests[i].testCase) {
+ if (/^test/.test(k)) {
+ total++;
+ try {
+ tests[i].testCase[k](assert, util);
+ passed++;
+ }
+ catch (e) {
+ console.log('FAILED ' + tests[i].name + ': ' + k + '!');
+ console.log(e.stack);
+ }
+ }
+ }
+ }
+
+ console.log('');
+ console.log(passed + ' / ' + total + ' tests passed.');
+ console.log('');
+
+ return total - passed;
+}
+
+function isTestFile(f) {
+ var testToRun = process.argv[2];
+ return testToRun
+ ? path.basename(testToRun) === f
+ : /^test\-.*?\.js/.test(f);
+}
+
+function toModule(f) {
+ return './source-map/' + f.replace(/\.js$/, '');
+}
+
+var requires = fs.readdirSync(path.join(__dirname, 'source-map'))
+ .filter(isTestFile)
+ .map(toModule);
+
+var code = run(requires.map(require).map(function (mod, i) {
+ return {
+ name: requires[i],
+ testCase: mod
+ };
+}));
+
+process.exit(code);
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-api.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-api.js
new file mode 100644
index 000000000..3801233c0
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-api.js
@@ -0,0 +1,26 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2012 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var sourceMap;
+ try {
+ sourceMap = require('../../lib/source-map');
+ } catch (e) {
+ sourceMap = {};
+ Components.utils.import('resource:///modules/devtools/SourceMap.jsm', sourceMap);
+ }
+
+ exports['test that the api is properly exposed in the top level'] = function (assert, util) {
+ assert.equal(typeof sourceMap.SourceMapGenerator, "function");
+ assert.equal(typeof sourceMap.SourceMapConsumer, "function");
+ assert.equal(typeof sourceMap.SourceNode, "function");
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-array-set.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-array-set.js
new file mode 100644
index 000000000..b5797edd5
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-array-set.js
@@ -0,0 +1,104 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var ArraySet = require('../../lib/source-map/array-set').ArraySet;
+
+ function makeTestSet() {
+ var set = new ArraySet();
+ for (var i = 0; i < 100; i++) {
+ set.add(String(i));
+ }
+ return set;
+ }
+
+ exports['test .has() membership'] = function (assert, util) {
+ var set = makeTestSet();
+ for (var i = 0; i < 100; i++) {
+ assert.ok(set.has(String(i)));
+ }
+ };
+
+ exports['test .indexOf() elements'] = function (assert, util) {
+ var set = makeTestSet();
+ for (var i = 0; i < 100; i++) {
+ assert.strictEqual(set.indexOf(String(i)), i);
+ }
+ };
+
+ exports['test .at() indexing'] = function (assert, util) {
+ var set = makeTestSet();
+ for (var i = 0; i < 100; i++) {
+ assert.strictEqual(set.at(i), String(i));
+ }
+ };
+
+ exports['test creating from an array'] = function (assert, util) {
+ var set = ArraySet.fromArray(['foo', 'bar', 'baz', 'quux', 'hasOwnProperty']);
+
+ assert.ok(set.has('foo'));
+ assert.ok(set.has('bar'));
+ assert.ok(set.has('baz'));
+ assert.ok(set.has('quux'));
+ assert.ok(set.has('hasOwnProperty'));
+
+ assert.strictEqual(set.indexOf('foo'), 0);
+ assert.strictEqual(set.indexOf('bar'), 1);
+ assert.strictEqual(set.indexOf('baz'), 2);
+ assert.strictEqual(set.indexOf('quux'), 3);
+
+ assert.strictEqual(set.at(0), 'foo');
+ assert.strictEqual(set.at(1), 'bar');
+ assert.strictEqual(set.at(2), 'baz');
+ assert.strictEqual(set.at(3), 'quux');
+ };
+
+ exports['test that you can add __proto__; see github issue #30'] = function (assert, util) {
+ var set = new ArraySet();
+ set.add('__proto__');
+ assert.ok(set.has('__proto__'));
+ assert.strictEqual(set.at(0), '__proto__');
+ assert.strictEqual(set.indexOf('__proto__'), 0);
+ };
+
+ exports['test .fromArray() with duplicates'] = function (assert, util) {
+ var set = ArraySet.fromArray(['foo', 'foo']);
+ assert.ok(set.has('foo'));
+ assert.strictEqual(set.at(0), 'foo');
+ assert.strictEqual(set.indexOf('foo'), 0);
+ assert.strictEqual(set.toArray().length, 1);
+
+ set = ArraySet.fromArray(['foo', 'foo'], true);
+ assert.ok(set.has('foo'));
+ assert.strictEqual(set.at(0), 'foo');
+ assert.strictEqual(set.at(1), 'foo');
+ assert.strictEqual(set.indexOf('foo'), 0);
+ assert.strictEqual(set.toArray().length, 2);
+ };
+
+ exports['test .add() with duplicates'] = function (assert, util) {
+ var set = new ArraySet();
+ set.add('foo');
+
+ set.add('foo');
+ assert.ok(set.has('foo'));
+ assert.strictEqual(set.at(0), 'foo');
+ assert.strictEqual(set.indexOf('foo'), 0);
+ assert.strictEqual(set.toArray().length, 1);
+
+ set.add('foo', true);
+ assert.ok(set.has('foo'));
+ assert.strictEqual(set.at(0), 'foo');
+ assert.strictEqual(set.at(1), 'foo');
+ assert.strictEqual(set.indexOf('foo'), 0);
+ assert.strictEqual(set.toArray().length, 2);
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64-vlq.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64-vlq.js
new file mode 100644
index 000000000..6fd0d99f4
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64-vlq.js
@@ -0,0 +1,23 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var base64VLQ = require('../../lib/source-map/base64-vlq');
+
+ exports['test normal encoding and decoding'] = function (assert, util) {
+ var result = {};
+ for (var i = -255; i < 256; i++) {
+ base64VLQ.decode(base64VLQ.encode(i), result);
+ assert.equal(result.value, i);
+ assert.equal(result.rest, "");
+ }
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64.js
new file mode 100644
index 000000000..ff3a24456
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-base64.js
@@ -0,0 +1,35 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var base64 = require('../../lib/source-map/base64');
+
+ exports['test out of range encoding'] = function (assert, util) {
+ assert.throws(function () {
+ base64.encode(-1);
+ });
+ assert.throws(function () {
+ base64.encode(64);
+ });
+ };
+
+ exports['test out of range decoding'] = function (assert, util) {
+ assert.throws(function () {
+ base64.decode('=');
+ });
+ };
+
+ exports['test normal encoding and decoding'] = function (assert, util) {
+ for (var i = 0; i < 64; i++) {
+ assert.equal(base64.decode(base64.encode(i)), i);
+ }
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-binary-search.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-binary-search.js
new file mode 100644
index 000000000..f1c9e0fc5
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-binary-search.js
@@ -0,0 +1,54 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var binarySearch = require('../../lib/source-map/binary-search');
+
+ function numberCompare(a, b) {
+ return a - b;
+ }
+
+ exports['test too high'] = function (assert, util) {
+ var needle = 30;
+ var haystack = [2,4,6,8,10,12,14,16,18,20];
+
+ assert.doesNotThrow(function () {
+ binarySearch.search(needle, haystack, numberCompare);
+ });
+
+ assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 20);
+ };
+
+ exports['test too low'] = function (assert, util) {
+ var needle = 1;
+ var haystack = [2,4,6,8,10,12,14,16,18,20];
+
+ assert.doesNotThrow(function () {
+ binarySearch.search(needle, haystack, numberCompare);
+ });
+
+ assert.equal(binarySearch.search(needle, haystack, numberCompare), -1);
+ };
+
+ exports['test exact search'] = function (assert, util) {
+ var needle = 4;
+ var haystack = [2,4,6,8,10,12,14,16,18,20];
+
+ assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 4);
+ };
+
+ exports['test fuzzy search'] = function (assert, util) {
+ var needle = 19;
+ var haystack = [2,4,6,8,10,12,14,16,18,20];
+
+ assert.equal(haystack[binarySearch.search(needle, haystack, numberCompare)], 18);
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-dog-fooding.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-dog-fooding.js
new file mode 100644
index 000000000..26757b2d1
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-dog-fooding.js
@@ -0,0 +1,84 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
+ var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
+
+ exports['test eating our own dog food'] = function (assert, util) {
+ var smg = new SourceMapGenerator({
+ file: 'testing.js',
+ sourceRoot: '/wu/tang'
+ });
+
+ smg.addMapping({
+ source: 'gza.coffee',
+ original: { line: 1, column: 0 },
+ generated: { line: 2, column: 2 }
+ });
+
+ smg.addMapping({
+ source: 'gza.coffee',
+ original: { line: 2, column: 0 },
+ generated: { line: 3, column: 2 }
+ });
+
+ smg.addMapping({
+ source: 'gza.coffee',
+ original: { line: 3, column: 0 },
+ generated: { line: 4, column: 2 }
+ });
+
+ smg.addMapping({
+ source: 'gza.coffee',
+ original: { line: 4, column: 0 },
+ generated: { line: 5, column: 2 }
+ });
+
+ smg.addMapping({
+ source: 'gza.coffee',
+ original: { line: 5, column: 10 },
+ generated: { line: 6, column: 12 }
+ });
+
+ var smc = new SourceMapConsumer(smg.toString());
+
+ // Exact
+ util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 0, null, smc, assert);
+ util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 0, null, smc, assert);
+ util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 0, null, smc, assert);
+ util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 0, null, smc, assert);
+ util.assertMapping(6, 12, '/wu/tang/gza.coffee', 5, 10, null, smc, assert);
+
+ // Fuzzy
+
+ // Generated to original
+ util.assertMapping(2, 0, null, null, null, null, smc, assert, true);
+ util.assertMapping(2, 9, '/wu/tang/gza.coffee', 1, 0, null, smc, assert, true);
+ util.assertMapping(3, 0, null, null, null, null, smc, assert, true);
+ util.assertMapping(3, 9, '/wu/tang/gza.coffee', 2, 0, null, smc, assert, true);
+ util.assertMapping(4, 0, null, null, null, null, smc, assert, true);
+ util.assertMapping(4, 9, '/wu/tang/gza.coffee', 3, 0, null, smc, assert, true);
+ util.assertMapping(5, 0, null, null, null, null, smc, assert, true);
+ util.assertMapping(5, 9, '/wu/tang/gza.coffee', 4, 0, null, smc, assert, true);
+ util.assertMapping(6, 0, null, null, null, null, smc, assert, true);
+ util.assertMapping(6, 9, null, null, null, null, smc, assert, true);
+ util.assertMapping(6, 13, '/wu/tang/gza.coffee', 5, 10, null, smc, assert, true);
+
+ // Original to generated
+ util.assertMapping(2, 2, '/wu/tang/gza.coffee', 1, 1, null, smc, assert, null, true);
+ util.assertMapping(3, 2, '/wu/tang/gza.coffee', 2, 3, null, smc, assert, null, true);
+ util.assertMapping(4, 2, '/wu/tang/gza.coffee', 3, 6, null, smc, assert, null, true);
+ util.assertMapping(5, 2, '/wu/tang/gza.coffee', 4, 9, null, smc, assert, null, true);
+ util.assertMapping(5, 2, '/wu/tang/gza.coffee', 5, 9, null, smc, assert, null, true);
+ util.assertMapping(6, 12, '/wu/tang/gza.coffee', 6, 19, null, smc, assert, null, true);
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-consumer.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-consumer.js
new file mode 100644
index 000000000..c71494348
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-consumer.js
@@ -0,0 +1,702 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
+ var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
+
+ exports['test that we can instantiate with a string or an object'] = function (assert, util) {
+ assert.doesNotThrow(function () {
+ var map = new SourceMapConsumer(util.testMap);
+ });
+ assert.doesNotThrow(function () {
+ var map = new SourceMapConsumer(JSON.stringify(util.testMap));
+ });
+ };
+
+ exports['test that the `sources` field has the original sources'] = function (assert, util) {
+ var map;
+ var sources;
+
+ map = new SourceMapConsumer(util.testMap);
+ sources = map.sources;
+ assert.equal(sources[0], '/the/root/one.js');
+ assert.equal(sources[1], '/the/root/two.js');
+ assert.equal(sources.length, 2);
+
+ map = new SourceMapConsumer(util.testMapNoSourceRoot);
+ sources = map.sources;
+ assert.equal(sources[0], 'one.js');
+ assert.equal(sources[1], 'two.js');
+ assert.equal(sources.length, 2);
+
+ map = new SourceMapConsumer(util.testMapEmptySourceRoot);
+ sources = map.sources;
+ assert.equal(sources[0], 'one.js');
+ assert.equal(sources[1], 'two.js');
+ assert.equal(sources.length, 2);
+ };
+
+ exports['test that the source root is reflected in a mapping\'s source field'] = function (assert, util) {
+ var map;
+ var mapping;
+
+ map = new SourceMapConsumer(util.testMap);
+
+ mapping = map.originalPositionFor({
+ line: 2,
+ column: 1
+ });
+ assert.equal(mapping.source, '/the/root/two.js');
+
+ mapping = map.originalPositionFor({
+ line: 1,
+ column: 1
+ });
+ assert.equal(mapping.source, '/the/root/one.js');
+
+
+ map = new SourceMapConsumer(util.testMapNoSourceRoot);
+
+ mapping = map.originalPositionFor({
+ line: 2,
+ column: 1
+ });
+ assert.equal(mapping.source, 'two.js');
+
+ mapping = map.originalPositionFor({
+ line: 1,
+ column: 1
+ });
+ assert.equal(mapping.source, 'one.js');
+
+
+ map = new SourceMapConsumer(util.testMapEmptySourceRoot);
+
+ mapping = map.originalPositionFor({
+ line: 2,
+ column: 1
+ });
+ assert.equal(mapping.source, 'two.js');
+
+ mapping = map.originalPositionFor({
+ line: 1,
+ column: 1
+ });
+ assert.equal(mapping.source, 'one.js');
+ };
+
+ exports['test mapping tokens back exactly'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMap);
+
+ util.assertMapping(1, 1, '/the/root/one.js', 1, 1, null, map, assert);
+ util.assertMapping(1, 5, '/the/root/one.js', 1, 5, null, map, assert);
+ util.assertMapping(1, 9, '/the/root/one.js', 1, 11, null, map, assert);
+ util.assertMapping(1, 18, '/the/root/one.js', 1, 21, 'bar', map, assert);
+ util.assertMapping(1, 21, '/the/root/one.js', 2, 3, null, map, assert);
+ util.assertMapping(1, 28, '/the/root/one.js', 2, 10, 'baz', map, assert);
+ util.assertMapping(1, 32, '/the/root/one.js', 2, 14, 'bar', map, assert);
+
+ util.assertMapping(2, 1, '/the/root/two.js', 1, 1, null, map, assert);
+ util.assertMapping(2, 5, '/the/root/two.js', 1, 5, null, map, assert);
+ util.assertMapping(2, 9, '/the/root/two.js', 1, 11, null, map, assert);
+ util.assertMapping(2, 18, '/the/root/two.js', 1, 21, 'n', map, assert);
+ util.assertMapping(2, 21, '/the/root/two.js', 2, 3, null, map, assert);
+ util.assertMapping(2, 28, '/the/root/two.js', 2, 10, 'n', map, assert);
+ };
+
+ exports['test mapping tokens fuzzy'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMap);
+
+ // Finding original positions
+ util.assertMapping(1, 20, '/the/root/one.js', 1, 21, 'bar', map, assert, true);
+ util.assertMapping(1, 30, '/the/root/one.js', 2, 10, 'baz', map, assert, true);
+ util.assertMapping(2, 12, '/the/root/two.js', 1, 11, null, map, assert, true);
+
+ // Finding generated positions
+ util.assertMapping(1, 18, '/the/root/one.js', 1, 22, 'bar', map, assert, null, true);
+ util.assertMapping(1, 28, '/the/root/one.js', 2, 13, 'baz', map, assert, null, true);
+ util.assertMapping(2, 9, '/the/root/two.js', 1, 16, null, map, assert, null, true);
+ };
+
+ exports['test mappings and end of lines'] = function (assert, util) {
+ var smg = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ smg.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 1, column: 1 },
+ source: 'bar.js'
+ });
+ smg.addMapping({
+ original: { line: 2, column: 2 },
+ generated: { line: 2, column: 2 },
+ source: 'bar.js'
+ });
+
+ var map = SourceMapConsumer.fromSourceMap(smg);
+
+ // When finding original positions, mappings end at the end of the line.
+ util.assertMapping(2, 1, null, null, null, null, map, assert, true)
+
+ // When finding generated positions, mappings do not end at the end of the line.
+ util.assertMapping(1, 1, 'bar.js', 2, 1, null, map, assert, null, true);
+ };
+
+ exports['test creating source map consumers with )]}\' prefix'] = function (assert, util) {
+ assert.doesNotThrow(function () {
+ var map = new SourceMapConsumer(")]}'" + JSON.stringify(util.testMap));
+ });
+ };
+
+ exports['test eachMapping'] = function (assert, util) {
+ var map;
+
+ map = new SourceMapConsumer(util.testMap);
+ var previousLine = -Infinity;
+ var previousColumn = -Infinity;
+ map.eachMapping(function (mapping) {
+ assert.ok(mapping.generatedLine >= previousLine);
+
+ assert.ok(mapping.source === '/the/root/one.js' || mapping.source === '/the/root/two.js');
+
+ if (mapping.generatedLine === previousLine) {
+ assert.ok(mapping.generatedColumn >= previousColumn);
+ previousColumn = mapping.generatedColumn;
+ }
+ else {
+ previousLine = mapping.generatedLine;
+ previousColumn = -Infinity;
+ }
+ });
+
+ map = new SourceMapConsumer(util.testMapNoSourceRoot);
+ map.eachMapping(function (mapping) {
+ assert.ok(mapping.source === 'one.js' || mapping.source === 'two.js');
+ });
+
+ map = new SourceMapConsumer(util.testMapEmptySourceRoot);
+ map.eachMapping(function (mapping) {
+ assert.ok(mapping.source === 'one.js' || mapping.source === 'two.js');
+ });
+ };
+
+ exports['test iterating over mappings in a different order'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMap);
+ var previousLine = -Infinity;
+ var previousColumn = -Infinity;
+ var previousSource = "";
+ map.eachMapping(function (mapping) {
+ assert.ok(mapping.source >= previousSource);
+
+ if (mapping.source === previousSource) {
+ assert.ok(mapping.originalLine >= previousLine);
+
+ if (mapping.originalLine === previousLine) {
+ assert.ok(mapping.originalColumn >= previousColumn);
+ previousColumn = mapping.originalColumn;
+ }
+ else {
+ previousLine = mapping.originalLine;
+ previousColumn = -Infinity;
+ }
+ }
+ else {
+ previousSource = mapping.source;
+ previousLine = -Infinity;
+ previousColumn = -Infinity;
+ }
+ }, null, SourceMapConsumer.ORIGINAL_ORDER);
+ };
+
+ exports['test that we can set the context for `this` in eachMapping'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMap);
+ var context = {};
+ map.eachMapping(function () {
+ assert.equal(this, context);
+ }, context);
+ };
+
+ exports['test that the `sourcesContent` field has the original sources'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMapWithSourcesContent);
+ var sourcesContent = map.sourcesContent;
+
+ assert.equal(sourcesContent[0], ' ONE.foo = function (bar) {\n return baz(bar);\n };');
+ assert.equal(sourcesContent[1], ' TWO.inc = function (n) {\n return n + 1;\n };');
+ assert.equal(sourcesContent.length, 2);
+ };
+
+ exports['test that we can get the original sources for the sources'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMapWithSourcesContent);
+ var sources = map.sources;
+
+ assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
+ assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };');
+ assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
+ assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };');
+ assert.throws(function () {
+ map.sourceContentFor("");
+ }, Error);
+ assert.throws(function () {
+ map.sourceContentFor("/the/root/three.js");
+ }, Error);
+ assert.throws(function () {
+ map.sourceContentFor("three.js");
+ }, Error);
+ };
+
+ exports['test that we can get the original source content with relative source paths'] = function (assert, util) {
+ var map = new SourceMapConsumer(util.testMapRelativeSources);
+ var sources = map.sources;
+
+ assert.equal(map.sourceContentFor(sources[0]), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
+ assert.equal(map.sourceContentFor(sources[1]), ' TWO.inc = function (n) {\n return n + 1;\n };');
+ assert.equal(map.sourceContentFor("one.js"), ' ONE.foo = function (bar) {\n return baz(bar);\n };');
+ assert.equal(map.sourceContentFor("two.js"), ' TWO.inc = function (n) {\n return n + 1;\n };');
+ assert.throws(function () {
+ map.sourceContentFor("");
+ }, Error);
+ assert.throws(function () {
+ map.sourceContentFor("/the/root/three.js");
+ }, Error);
+ assert.throws(function () {
+ map.sourceContentFor("three.js");
+ }, Error);
+ };
+
+ exports['test sourceRoot + generatedPositionFor'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ sourceRoot: 'foo/bar',
+ file: 'baz.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'bang.coffee'
+ });
+ map.addMapping({
+ original: { line: 5, column: 5 },
+ generated: { line: 6, column: 6 },
+ source: 'bang.coffee'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ // Should handle without sourceRoot.
+ var pos = map.generatedPositionFor({
+ line: 1,
+ column: 1,
+ source: 'bang.coffee'
+ });
+
+ assert.equal(pos.line, 2);
+ assert.equal(pos.column, 2);
+
+ // Should handle with sourceRoot.
+ var pos = map.generatedPositionFor({
+ line: 1,
+ column: 1,
+ source: 'foo/bar/bang.coffee'
+ });
+
+ assert.equal(pos.line, 2);
+ assert.equal(pos.column, 2);
+ };
+
+ exports['test allGeneratedPositionsFor'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'bar.coffee'
+ });
+ map.addMapping({
+ original: { line: 2, column: 1 },
+ generated: { line: 3, column: 2 },
+ source: 'bar.coffee'
+ });
+ map.addMapping({
+ original: { line: 2, column: 2 },
+ generated: { line: 3, column: 3 },
+ source: 'bar.coffee'
+ });
+ map.addMapping({
+ original: { line: 3, column: 1 },
+ generated: { line: 4, column: 2 },
+ source: 'bar.coffee'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 2,
+ source: 'bar.coffee'
+ });
+
+ assert.equal(mappings.length, 2);
+ assert.equal(mappings[0].line, 3);
+ assert.equal(mappings[0].column, 2);
+ assert.equal(mappings[1].line, 3);
+ assert.equal(mappings[1].column, 3);
+ };
+
+ exports['test allGeneratedPositionsFor for line with no mappings'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'bar.coffee'
+ });
+ map.addMapping({
+ original: { line: 3, column: 1 },
+ generated: { line: 4, column: 2 },
+ source: 'bar.coffee'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 2,
+ source: 'bar.coffee'
+ });
+
+ assert.equal(mappings.length, 0);
+ };
+
+ exports['test allGeneratedPositionsFor source map with no mappings'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated.js'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 2,
+ source: 'bar.coffee'
+ });
+
+ assert.equal(mappings.length, 0);
+ };
+
+ exports['test computeColumnSpans'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 1, column: 1 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 2, column: 1 },
+ generated: { line: 2, column: 1 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 2, column: 2 },
+ generated: { line: 2, column: 10 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 2, column: 3 },
+ generated: { line: 2, column: 20 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 3, column: 1 },
+ generated: { line: 3, column: 1 },
+ source: 'foo.coffee'
+ });
+ map.addMapping({
+ original: { line: 3, column: 2 },
+ generated: { line: 3, column: 2 },
+ source: 'foo.coffee'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ map.computeColumnSpans();
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 1,
+ source: 'foo.coffee'
+ });
+
+ assert.equal(mappings.length, 1);
+ assert.equal(mappings[0].lastColumn, Infinity);
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 2,
+ source: 'foo.coffee'
+ });
+
+ assert.equal(mappings.length, 3);
+ assert.equal(mappings[0].lastColumn, 9);
+ assert.equal(mappings[1].lastColumn, 19);
+ assert.equal(mappings[2].lastColumn, Infinity);
+
+ var mappings = map.allGeneratedPositionsFor({
+ line: 3,
+ source: 'foo.coffee'
+ });
+
+ assert.equal(mappings.length, 2);
+ assert.equal(mappings[0].lastColumn, 1);
+ assert.equal(mappings[1].lastColumn, Infinity);
+ };
+
+ exports['test sourceRoot + originalPositionFor'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ sourceRoot: 'foo/bar',
+ file: 'baz.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'bang.coffee'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var pos = map.originalPositionFor({
+ line: 2,
+ column: 2,
+ });
+
+ // Should always have the prepended source root
+ assert.equal(pos.source, 'foo/bar/bang.coffee');
+ assert.equal(pos.line, 1);
+ assert.equal(pos.column, 1);
+ };
+
+ exports['test github issue #56'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ sourceRoot: 'http://',
+ file: 'www.example.com/foo.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'www.example.com/original.js'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var sources = map.sources;
+ assert.equal(sources.length, 1);
+ assert.equal(sources[0], 'http://www.example.com/original.js');
+ };
+
+ exports['test github issue #43'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ sourceRoot: 'http://example.com',
+ file: 'foo.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'http://cdn.example.com/original.js'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var sources = map.sources;
+ assert.equal(sources.length, 1,
+ 'Should only be one source.');
+ assert.equal(sources[0], 'http://cdn.example.com/original.js',
+ 'Should not be joined with the sourceRoot.');
+ };
+
+ exports['test absolute path, but same host sources'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ sourceRoot: 'http://example.com/foo/bar',
+ file: 'foo.js'
+ });
+ map.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: '/original.js'
+ });
+ map = new SourceMapConsumer(map.toString());
+
+ var sources = map.sources;
+ assert.equal(sources.length, 1,
+ 'Should only be one source.');
+ assert.equal(sources[0], 'http://example.com/original.js',
+ 'Source should be relative the host of the source root.');
+ };
+
+ exports['test github issue #64'] = function (assert, util) {
+ var map = new SourceMapConsumer({
+ "version": 3,
+ "file": "foo.js",
+ "sourceRoot": "http://example.com/",
+ "sources": ["/a"],
+ "names": [],
+ "mappings": "AACA",
+ "sourcesContent": ["foo"]
+ });
+
+ assert.equal(map.sourceContentFor("a"), "foo");
+ assert.equal(map.sourceContentFor("/a"), "foo");
+ };
+
+ exports['test bug 885597'] = function (assert, util) {
+ var map = new SourceMapConsumer({
+ "version": 3,
+ "file": "foo.js",
+ "sourceRoot": "file:///Users/AlGore/Invented/The/Internet/",
+ "sources": ["/a"],
+ "names": [],
+ "mappings": "AACA",
+ "sourcesContent": ["foo"]
+ });
+
+ var s = map.sources[0];
+ assert.equal(map.sourceContentFor(s), "foo");
+ };
+
+ exports['test github issue #72, duplicate sources'] = function (assert, util) {
+ var map = new SourceMapConsumer({
+ "version": 3,
+ "file": "foo.js",
+ "sources": ["source1.js", "source1.js", "source3.js"],
+ "names": [],
+ "mappings": ";EAAC;;IAEE;;MEEE",
+ "sourceRoot": "http://example.com"
+ });
+
+ var pos = map.originalPositionFor({
+ line: 2,
+ column: 2
+ });
+ assert.equal(pos.source, 'http://example.com/source1.js');
+ assert.equal(pos.line, 1);
+ assert.equal(pos.column, 1);
+
+ var pos = map.originalPositionFor({
+ line: 4,
+ column: 4
+ });
+ assert.equal(pos.source, 'http://example.com/source1.js');
+ assert.equal(pos.line, 3);
+ assert.equal(pos.column, 3);
+
+ var pos = map.originalPositionFor({
+ line: 6,
+ column: 6
+ });
+ assert.equal(pos.source, 'http://example.com/source3.js');
+ assert.equal(pos.line, 5);
+ assert.equal(pos.column, 5);
+ };
+
+ exports['test github issue #72, duplicate names'] = function (assert, util) {
+ var map = new SourceMapConsumer({
+ "version": 3,
+ "file": "foo.js",
+ "sources": ["source.js"],
+ "names": ["name1", "name1", "name3"],
+ "mappings": ";EAACA;;IAEEA;;MAEEE",
+ "sourceRoot": "http://example.com"
+ });
+
+ var pos = map.originalPositionFor({
+ line: 2,
+ column: 2
+ });
+ assert.equal(pos.name, 'name1');
+ assert.equal(pos.line, 1);
+ assert.equal(pos.column, 1);
+
+ var pos = map.originalPositionFor({
+ line: 4,
+ column: 4
+ });
+ assert.equal(pos.name, 'name1');
+ assert.equal(pos.line, 3);
+ assert.equal(pos.column, 3);
+
+ var pos = map.originalPositionFor({
+ line: 6,
+ column: 6
+ });
+ assert.equal(pos.name, 'name3');
+ assert.equal(pos.line, 5);
+ assert.equal(pos.column, 5);
+ };
+
+ exports['test SourceMapConsumer.fromSourceMap'] = function (assert, util) {
+ var smg = new SourceMapGenerator({
+ sourceRoot: 'http://example.com/',
+ file: 'foo.js'
+ });
+ smg.addMapping({
+ original: { line: 1, column: 1 },
+ generated: { line: 2, column: 2 },
+ source: 'bar.js'
+ });
+ smg.addMapping({
+ original: { line: 2, column: 2 },
+ generated: { line: 4, column: 4 },
+ source: 'baz.js',
+ name: 'dirtMcGirt'
+ });
+ smg.setSourceContent('baz.js', 'baz.js content');
+
+ var smc = SourceMapConsumer.fromSourceMap(smg);
+ assert.equal(smc.file, 'foo.js');
+ assert.equal(smc.sourceRoot, 'http://example.com/');
+ assert.equal(smc.sources.length, 2);
+ assert.equal(smc.sources[0], 'http://example.com/bar.js');
+ assert.equal(smc.sources[1], 'http://example.com/baz.js');
+ assert.equal(smc.sourceContentFor('baz.js'), 'baz.js content');
+
+ var pos = smc.originalPositionFor({
+ line: 2,
+ column: 2
+ });
+ assert.equal(pos.line, 1);
+ assert.equal(pos.column, 1);
+ assert.equal(pos.source, 'http://example.com/bar.js');
+ assert.equal(pos.name, null);
+
+ pos = smc.generatedPositionFor({
+ line: 1,
+ column: 1,
+ source: 'http://example.com/bar.js'
+ });
+ assert.equal(pos.line, 2);
+ assert.equal(pos.column, 2);
+
+ pos = smc.originalPositionFor({
+ line: 4,
+ column: 4
+ });
+ assert.equal(pos.line, 2);
+ assert.equal(pos.column, 2);
+ assert.equal(pos.source, 'http://example.com/baz.js');
+ assert.equal(pos.name, 'dirtMcGirt');
+
+ pos = smc.generatedPositionFor({
+ line: 2,
+ column: 2,
+ source: 'http://example.com/baz.js'
+ });
+ assert.equal(pos.line, 4);
+ assert.equal(pos.column, 4);
+ };
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-generator.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-generator.js
new file mode 100644
index 000000000..d748bb185
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-map-generator.js
@@ -0,0 +1,679 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
+ var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
+ var SourceNode = require('../../lib/source-map/source-node').SourceNode;
+ var util = require('./util');
+
+ exports['test some simple stuff'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'foo.js',
+ sourceRoot: '.'
+ });
+ assert.ok(true);
+
+ var map = new SourceMapGenerator().toJSON();
+ assert.ok(!('file' in map));
+ assert.ok(!('sourceRoot' in map));
+ };
+
+ exports['test JSON serialization'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'foo.js',
+ sourceRoot: '.'
+ });
+ assert.equal(map.toString(), JSON.stringify(map));
+ };
+
+ exports['test adding mappings (case 1)'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.'
+ });
+
+ assert.doesNotThrow(function () {
+ map.addMapping({
+ generated: { line: 1, column: 1 }
+ });
+ });
+ };
+
+ exports['test adding mappings (case 2)'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.'
+ });
+
+ assert.doesNotThrow(function () {
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ source: 'bar.js',
+ original: { line: 1, column: 1 }
+ });
+ });
+ };
+
+ exports['test adding mappings (case 3)'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.'
+ });
+
+ assert.doesNotThrow(function () {
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ source: 'bar.js',
+ original: { line: 1, column: 1 },
+ name: 'someToken'
+ });
+ });
+ };
+
+ exports['test adding mappings (invalid)'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.'
+ });
+
+ // Not enough info.
+ assert.throws(function () {
+ map.addMapping({});
+ });
+
+ // Original file position, but no source.
+ assert.throws(function () {
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 1, column: 1 }
+ });
+ });
+ };
+
+ exports['test adding mappings with skipValidation'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.',
+ skipValidation: true
+ });
+
+ // Not enough info, caught by `util.getArgs`
+ assert.throws(function () {
+ map.addMapping({});
+ });
+
+ // Original file position, but no source. Not checked.
+ assert.doesNotThrow(function () {
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 1, column: 1 }
+ });
+ });
+ };
+
+ exports['test that the correct mappings are being generated'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'min.js',
+ sourceRoot: '/the/root'
+ });
+
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 1, column: 1 },
+ source: 'one.js'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 5 },
+ original: { line: 1, column: 5 },
+ source: 'one.js'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 9 },
+ original: { line: 1, column: 11 },
+ source: 'one.js'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 18 },
+ original: { line: 1, column: 21 },
+ source: 'one.js',
+ name: 'bar'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 21 },
+ original: { line: 2, column: 3 },
+ source: 'one.js'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 28 },
+ original: { line: 2, column: 10 },
+ source: 'one.js',
+ name: 'baz'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 32 },
+ original: { line: 2, column: 14 },
+ source: 'one.js',
+ name: 'bar'
+ });
+
+ map.addMapping({
+ generated: { line: 2, column: 1 },
+ original: { line: 1, column: 1 },
+ source: 'two.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 5 },
+ original: { line: 1, column: 5 },
+ source: 'two.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 9 },
+ original: { line: 1, column: 11 },
+ source: 'two.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 18 },
+ original: { line: 1, column: 21 },
+ source: 'two.js',
+ name: 'n'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 21 },
+ original: { line: 2, column: 3 },
+ source: 'two.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 28 },
+ original: { line: 2, column: 10 },
+ source: 'two.js',
+ name: 'n'
+ });
+
+ map = JSON.parse(map.toString());
+
+ util.assertEqualMaps(assert, map, util.testMap);
+ };
+
+ exports['test that adding a mapping with an empty string name does not break generation'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'generated-foo.js',
+ sourceRoot: '.'
+ });
+
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ source: 'bar.js',
+ original: { line: 1, column: 1 },
+ name: ''
+ });
+
+ assert.doesNotThrow(function () {
+ JSON.parse(map.toString());
+ });
+ };
+
+ exports['test that source content can be set'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'min.js',
+ sourceRoot: '/the/root'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 1, column: 1 },
+ source: 'one.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 1 },
+ original: { line: 1, column: 1 },
+ source: 'two.js'
+ });
+ map.setSourceContent('one.js', 'one file content');
+
+ map = JSON.parse(map.toString());
+ assert.equal(map.sources[0], 'one.js');
+ assert.equal(map.sources[1], 'two.js');
+ assert.equal(map.sourcesContent[0], 'one file content');
+ assert.equal(map.sourcesContent[1], null);
+ };
+
+ exports['test .fromSourceMap'] = function (assert, util) {
+ var map = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(util.testMap));
+ util.assertEqualMaps(assert, map.toJSON(), util.testMap);
+ };
+
+ exports['test .fromSourceMap with sourcesContent'] = function (assert, util) {
+ var map = SourceMapGenerator.fromSourceMap(
+ new SourceMapConsumer(util.testMapWithSourcesContent));
+ util.assertEqualMaps(assert, map.toJSON(), util.testMapWithSourcesContent);
+ };
+
+ exports['test applySourceMap'] = function (assert, util) {
+ var node = new SourceNode(null, null, null, [
+ new SourceNode(2, 0, 'fileX', 'lineX2\n'),
+ 'genA1\n',
+ new SourceNode(2, 0, 'fileY', 'lineY2\n'),
+ 'genA2\n',
+ new SourceNode(1, 0, 'fileX', 'lineX1\n'),
+ 'genA3\n',
+ new SourceNode(1, 0, 'fileY', 'lineY1\n')
+ ]);
+ var mapStep1 = node.toStringWithSourceMap({
+ file: 'fileA'
+ }).map;
+ mapStep1.setSourceContent('fileX', 'lineX1\nlineX2\n');
+ mapStep1 = mapStep1.toJSON();
+
+ node = new SourceNode(null, null, null, [
+ 'gen1\n',
+ new SourceNode(1, 0, 'fileA', 'lineA1\n'),
+ new SourceNode(2, 0, 'fileA', 'lineA2\n'),
+ new SourceNode(3, 0, 'fileA', 'lineA3\n'),
+ new SourceNode(4, 0, 'fileA', 'lineA4\n'),
+ new SourceNode(1, 0, 'fileB', 'lineB1\n'),
+ new SourceNode(2, 0, 'fileB', 'lineB2\n'),
+ 'gen2\n'
+ ]);
+ var mapStep2 = node.toStringWithSourceMap({
+ file: 'fileGen'
+ }).map;
+ mapStep2.setSourceContent('fileB', 'lineB1\nlineB2\n');
+ mapStep2 = mapStep2.toJSON();
+
+ node = new SourceNode(null, null, null, [
+ 'gen1\n',
+ new SourceNode(2, 0, 'fileX', 'lineA1\n'),
+ new SourceNode(2, 0, 'fileA', 'lineA2\n'),
+ new SourceNode(2, 0, 'fileY', 'lineA3\n'),
+ new SourceNode(4, 0, 'fileA', 'lineA4\n'),
+ new SourceNode(1, 0, 'fileB', 'lineB1\n'),
+ new SourceNode(2, 0, 'fileB', 'lineB2\n'),
+ 'gen2\n'
+ ]);
+ var expectedMap = node.toStringWithSourceMap({
+ file: 'fileGen'
+ }).map;
+ expectedMap.setSourceContent('fileX', 'lineX1\nlineX2\n');
+ expectedMap.setSourceContent('fileB', 'lineB1\nlineB2\n');
+ expectedMap = expectedMap.toJSON();
+
+ // apply source map "mapStep1" to "mapStep2"
+ var generator = SourceMapGenerator.fromSourceMap(new SourceMapConsumer(mapStep2));
+ generator.applySourceMap(new SourceMapConsumer(mapStep1));
+ var actualMap = generator.toJSON();
+
+ util.assertEqualMaps(assert, actualMap, expectedMap);
+ };
+
+ exports['test applySourceMap throws when file is missing'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'test.js'
+ });
+ var map2 = new SourceMapGenerator();
+ assert.throws(function() {
+ map.applySourceMap(new SourceMapConsumer(map2.toJSON()));
+ });
+ };
+
+ exports['test the two additional parameters of applySourceMap'] = function (assert, util) {
+ // Assume the following directory structure:
+ //
+ // http://foo.org/
+ // bar.coffee
+ // app/
+ // coffee/
+ // foo.coffee
+ // temp/
+ // bundle.js
+ // temp_maps/
+ // bundle.js.map
+ // public/
+ // bundle.min.js
+ // bundle.min.js.map
+ //
+ // http://www.example.com/
+ // baz.coffee
+
+ var bundleMap = new SourceMapGenerator({
+ file: 'bundle.js'
+ });
+ bundleMap.addMapping({
+ generated: { line: 3, column: 3 },
+ original: { line: 2, column: 2 },
+ source: '../../coffee/foo.coffee'
+ });
+ bundleMap.setSourceContent('../../coffee/foo.coffee', 'foo coffee');
+ bundleMap.addMapping({
+ generated: { line: 13, column: 13 },
+ original: { line: 12, column: 12 },
+ source: '/bar.coffee'
+ });
+ bundleMap.setSourceContent('/bar.coffee', 'bar coffee');
+ bundleMap.addMapping({
+ generated: { line: 23, column: 23 },
+ original: { line: 22, column: 22 },
+ source: 'http://www.example.com/baz.coffee'
+ });
+ bundleMap.setSourceContent(
+ 'http://www.example.com/baz.coffee',
+ 'baz coffee'
+ );
+ bundleMap = new SourceMapConsumer(bundleMap.toJSON());
+
+ var minifiedMap = new SourceMapGenerator({
+ file: 'bundle.min.js',
+ sourceRoot: '..'
+ });
+ minifiedMap.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 3, column: 3 },
+ source: 'temp/bundle.js'
+ });
+ minifiedMap.addMapping({
+ generated: { line: 11, column: 11 },
+ original: { line: 13, column: 13 },
+ source: 'temp/bundle.js'
+ });
+ minifiedMap.addMapping({
+ generated: { line: 21, column: 21 },
+ original: { line: 23, column: 23 },
+ source: 'temp/bundle.js'
+ });
+ minifiedMap = new SourceMapConsumer(minifiedMap.toJSON());
+
+ var expectedMap = function (sources) {
+ var map = new SourceMapGenerator({
+ file: 'bundle.min.js',
+ sourceRoot: '..'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 2, column: 2 },
+ source: sources[0]
+ });
+ map.setSourceContent(sources[0], 'foo coffee');
+ map.addMapping({
+ generated: { line: 11, column: 11 },
+ original: { line: 12, column: 12 },
+ source: sources[1]
+ });
+ map.setSourceContent(sources[1], 'bar coffee');
+ map.addMapping({
+ generated: { line: 21, column: 21 },
+ original: { line: 22, column: 22 },
+ source: sources[2]
+ });
+ map.setSourceContent(sources[2], 'baz coffee');
+ return map.toJSON();
+ }
+
+ var actualMap = function (aSourceMapPath) {
+ var map = SourceMapGenerator.fromSourceMap(minifiedMap);
+ // Note that relying on `bundleMap.file` (which is simply 'bundle.js')
+ // instead of supplying the second parameter wouldn't work here.
+ map.applySourceMap(bundleMap, '../temp/bundle.js', aSourceMapPath);
+ return map.toJSON();
+ }
+
+ util.assertEqualMaps(assert, actualMap('../temp/temp_maps'), expectedMap([
+ 'coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ util.assertEqualMaps(assert, actualMap('/app/temp/temp_maps'), expectedMap([
+ '/app/coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ util.assertEqualMaps(assert, actualMap('http://foo.org/app/temp/temp_maps'), expectedMap([
+ 'http://foo.org/app/coffee/foo.coffee',
+ 'http://foo.org/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ // If the third parameter is omitted or set to the current working
+ // directory we get incorrect source paths:
+
+ util.assertEqualMaps(assert, actualMap(), expectedMap([
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ util.assertEqualMaps(assert, actualMap(''), expectedMap([
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ util.assertEqualMaps(assert, actualMap('.'), expectedMap([
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+
+ util.assertEqualMaps(assert, actualMap('./'), expectedMap([
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee'
+ ]));
+ };
+
+ exports['test applySourceMap name handling'] = function (assert, util) {
+ // Imagine some CoffeeScript code being compiled into JavaScript and then
+ // minified.
+
+ var assertName = function(coffeeName, jsName, expectedName) {
+ var minifiedMap = new SourceMapGenerator({
+ file: 'test.js.min'
+ });
+ minifiedMap.addMapping({
+ generated: { line: 1, column: 4 },
+ original: { line: 1, column: 4 },
+ source: 'test.js',
+ name: jsName
+ });
+
+ var coffeeMap = new SourceMapGenerator({
+ file: 'test.js'
+ });
+ coffeeMap.addMapping({
+ generated: { line: 1, column: 4 },
+ original: { line: 1, column: 0 },
+ source: 'test.coffee',
+ name: coffeeName
+ });
+
+ minifiedMap.applySourceMap(new SourceMapConsumer(coffeeMap.toJSON()));
+
+ new SourceMapConsumer(minifiedMap.toJSON()).eachMapping(function(mapping) {
+ assert.equal(mapping.name, expectedName);
+ });
+ };
+
+ // `foo = 1` -> `var foo = 1;` -> `var a=1`
+ // CoffeeScript doesn’t rename variables, so there’s no need for it to
+ // provide names in its source maps. Minifiers do rename variables and
+ // therefore do provide names in their source maps. So that name should be
+ // retained if the original map lacks names.
+ assertName(null, 'foo', 'foo');
+
+ // `foo = 1` -> `var coffee$foo = 1;` -> `var a=1`
+ // Imagine that CoffeeScript prefixed all variables with `coffee$`. Even
+ // though the minifier then also provides a name, the original name is
+ // what corresponds to the source.
+ assertName('foo', 'coffee$foo', 'foo');
+
+ // `foo = 1` -> `var coffee$foo = 1;` -> `var coffee$foo=1`
+ // Minifiers can turn off variable mangling. Then there’s no need to
+ // provide names in the source map, but the names from the original map are
+ // still needed.
+ assertName('foo', null, 'foo');
+
+ // `foo = 1` -> `var foo = 1;` -> `var foo=1`
+ // No renaming at all.
+ assertName(null, null, null);
+ };
+
+ exports['test sorting with duplicate generated mappings'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'test.js'
+ });
+ map.addMapping({
+ generated: { line: 3, column: 0 },
+ original: { line: 2, column: 0 },
+ source: 'a.js'
+ });
+ map.addMapping({
+ generated: { line: 2, column: 0 }
+ });
+ map.addMapping({
+ generated: { line: 2, column: 0 }
+ });
+ map.addMapping({
+ generated: { line: 1, column: 0 },
+ original: { line: 1, column: 0 },
+ source: 'a.js'
+ });
+
+ util.assertEqualMaps(assert, map.toJSON(), {
+ version: 3,
+ file: 'test.js',
+ sources: ['a.js'],
+ names: [],
+ mappings: 'AAAA;A;AACA'
+ });
+ };
+
+ exports['test ignore duplicate mappings.'] = function (assert, util) {
+ var init = { file: 'min.js', sourceRoot: '/the/root' };
+ var map1, map2;
+
+ // null original source location
+ var nullMapping1 = {
+ generated: { line: 1, column: 0 }
+ };
+ var nullMapping2 = {
+ generated: { line: 2, column: 2 }
+ };
+
+ map1 = new SourceMapGenerator(init);
+ map2 = new SourceMapGenerator(init);
+
+ map1.addMapping(nullMapping1);
+ map1.addMapping(nullMapping1);
+
+ map2.addMapping(nullMapping1);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+
+ map1.addMapping(nullMapping2);
+ map1.addMapping(nullMapping1);
+
+ map2.addMapping(nullMapping2);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+
+ // original source location
+ var srcMapping1 = {
+ generated: { line: 1, column: 0 },
+ original: { line: 11, column: 0 },
+ source: 'srcMapping1.js'
+ };
+ var srcMapping2 = {
+ generated: { line: 2, column: 2 },
+ original: { line: 11, column: 0 },
+ source: 'srcMapping2.js'
+ };
+
+ map1 = new SourceMapGenerator(init);
+ map2 = new SourceMapGenerator(init);
+
+ map1.addMapping(srcMapping1);
+ map1.addMapping(srcMapping1);
+
+ map2.addMapping(srcMapping1);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+
+ map1.addMapping(srcMapping2);
+ map1.addMapping(srcMapping1);
+
+ map2.addMapping(srcMapping2);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+
+ // full original source and name information
+ var fullMapping1 = {
+ generated: { line: 1, column: 0 },
+ original: { line: 11, column: 0 },
+ source: 'fullMapping1.js',
+ name: 'fullMapping1'
+ };
+ var fullMapping2 = {
+ generated: { line: 2, column: 2 },
+ original: { line: 11, column: 0 },
+ source: 'fullMapping2.js',
+ name: 'fullMapping2'
+ };
+
+ map1 = new SourceMapGenerator(init);
+ map2 = new SourceMapGenerator(init);
+
+ map1.addMapping(fullMapping1);
+ map1.addMapping(fullMapping1);
+
+ map2.addMapping(fullMapping1);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+
+ map1.addMapping(fullMapping2);
+ map1.addMapping(fullMapping1);
+
+ map2.addMapping(fullMapping2);
+
+ util.assertEqualMaps(assert, map1.toJSON(), map2.toJSON());
+ };
+
+ exports['test github issue #72, check for duplicate names or sources'] = function (assert, util) {
+ var map = new SourceMapGenerator({
+ file: 'test.js'
+ });
+ map.addMapping({
+ generated: { line: 1, column: 1 },
+ original: { line: 2, column: 2 },
+ source: 'a.js',
+ name: 'foo'
+ });
+ map.addMapping({
+ generated: { line: 3, column: 3 },
+ original: { line: 4, column: 4 },
+ source: 'a.js',
+ name: 'foo'
+ });
+ util.assertEqualMaps(assert, map.toJSON(), {
+ version: 3,
+ file: 'test.js',
+ sources: ['a.js'],
+ names: ['foo'],
+ mappings: 'CACEA;;GAEEA'
+ });
+ };
+
+ exports['test setting sourcesContent to null when already null'] = function (assert, util) {
+ var smg = new SourceMapGenerator({ file: "foo.js" });
+ assert.doesNotThrow(function() {
+ smg.setSourceContent("bar.js", null);
+ });
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-node.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-node.js
new file mode 100644
index 000000000..139af4e44
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-source-node.js
@@ -0,0 +1,612 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var SourceMapGenerator = require('../../lib/source-map/source-map-generator').SourceMapGenerator;
+ var SourceMapConsumer = require('../../lib/source-map/source-map-consumer').SourceMapConsumer;
+ var SourceNode = require('../../lib/source-map/source-node').SourceNode;
+
+ function forEachNewline(fn) {
+ return function (assert, util) {
+ ['\n', '\r\n'].forEach(fn.bind(null, assert, util));
+ }
+ }
+
+ exports['test .add()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null);
+
+ // Adding a string works.
+ node.add('function noop() {}');
+
+ // Adding another source node works.
+ node.add(new SourceNode(null, null, null));
+
+ // Adding an array works.
+ node.add(['function foo() {',
+ new SourceNode(null, null, null,
+ 'return 10;'),
+ '}']);
+
+ // Adding other stuff doesn't.
+ assert.throws(function () {
+ node.add({});
+ });
+ assert.throws(function () {
+ node.add(function () {});
+ });
+ };
+
+ exports['test .prepend()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null);
+
+ // Prepending a string works.
+ node.prepend('function noop() {}');
+ assert.equal(node.children[0], 'function noop() {}');
+ assert.equal(node.children.length, 1);
+
+ // Prepending another source node works.
+ node.prepend(new SourceNode(null, null, null));
+ assert.equal(node.children[0], '');
+ assert.equal(node.children[1], 'function noop() {}');
+ assert.equal(node.children.length, 2);
+
+ // Prepending an array works.
+ node.prepend(['function foo() {',
+ new SourceNode(null, null, null,
+ 'return 10;'),
+ '}']);
+ assert.equal(node.children[0], 'function foo() {');
+ assert.equal(node.children[1], 'return 10;');
+ assert.equal(node.children[2], '}');
+ assert.equal(node.children[3], '');
+ assert.equal(node.children[4], 'function noop() {}');
+ assert.equal(node.children.length, 5);
+
+ // Prepending other stuff doesn't.
+ assert.throws(function () {
+ node.prepend({});
+ });
+ assert.throws(function () {
+ node.prepend(function () {});
+ });
+ };
+
+ exports['test .toString()'] = function (assert, util) {
+ assert.equal((new SourceNode(null, null, null,
+ ['function foo() {',
+ new SourceNode(null, null, null, 'return 10;'),
+ '}'])).toString(),
+ 'function foo() {return 10;}');
+ };
+
+ exports['test .join()'] = function (assert, util) {
+ assert.equal((new SourceNode(null, null, null,
+ ['a', 'b', 'c', 'd'])).join(', ').toString(),
+ 'a, b, c, d');
+ };
+
+ exports['test .walk()'] = function (assert, util) {
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', new SourceNode(1, 0, 'a.js', ['someCall()']), ';\n',
+ ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';\n',
+ '}());']);
+ var expected = [
+ { str: '(function () {\n', source: null, line: null, column: null },
+ { str: ' ', source: null, line: null, column: null },
+ { str: 'someCall()', source: 'a.js', line: 1, column: 0 },
+ { str: ';\n', source: null, line: null, column: null },
+ { str: ' ', source: null, line: null, column: null },
+ { str: 'if (foo) bar()', source: 'b.js', line: 2, column: 0 },
+ { str: ';\n', source: null, line: null, column: null },
+ { str: '}());', source: null, line: null, column: null },
+ ];
+ var i = 0;
+ node.walk(function (chunk, loc) {
+ assert.equal(expected[i].str, chunk);
+ assert.equal(expected[i].source, loc.source);
+ assert.equal(expected[i].line, loc.line);
+ assert.equal(expected[i].column, loc.column);
+ i++;
+ });
+ };
+
+ exports['test .replaceRight'] = function (assert, util) {
+ var node;
+
+ // Not nested
+ node = new SourceNode(null, null, null, 'hello world');
+ node.replaceRight(/world/, 'universe');
+ assert.equal(node.toString(), 'hello universe');
+
+ // Nested
+ node = new SourceNode(null, null, null,
+ [new SourceNode(null, null, null, 'hey sexy mama, '),
+ new SourceNode(null, null, null, 'want to kill all humans?')]);
+ node.replaceRight(/kill all humans/, 'watch Futurama');
+ assert.equal(node.toString(), 'hey sexy mama, want to watch Futurama?');
+ };
+
+ exports['test .toStringWithSourceMap()'] = forEachNewline(function (assert, util, nl) {
+ var node = new SourceNode(null, null, null,
+ ['(function () {' + nl,
+ ' ',
+ new SourceNode(1, 0, 'a.js', 'someCall', 'originalCall'),
+ new SourceNode(1, 8, 'a.js', '()'),
+ ';' + nl,
+ ' ', new SourceNode(2, 0, 'b.js', ['if (foo) bar()']), ';' + nl,
+ '}());']);
+ var result = node.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(result.code, [
+ '(function () {',
+ ' someCall();',
+ ' if (foo) bar();',
+ '}());'
+ ].join(nl));
+
+ var map = result.map;
+ var mapWithoutOptions = node.toStringWithSourceMap().map;
+
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ assert.ok(mapWithoutOptions instanceof SourceMapGenerator, 'mapWithoutOptions instanceof SourceMapGenerator');
+ assert.ok(!('file' in mapWithoutOptions));
+ mapWithoutOptions._file = 'foo.js';
+ util.assertEqualMaps(assert, map.toJSON(), mapWithoutOptions.toJSON());
+
+ map = new SourceMapConsumer(map.toString());
+
+ var actual;
+
+ actual = map.originalPositionFor({
+ line: 1,
+ column: 4
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+
+ actual = map.originalPositionFor({
+ line: 2,
+ column: 2
+ });
+ assert.equal(actual.source, 'a.js');
+ assert.equal(actual.line, 1);
+ assert.equal(actual.column, 0);
+ assert.equal(actual.name, 'originalCall');
+
+ actual = map.originalPositionFor({
+ line: 3,
+ column: 2
+ });
+ assert.equal(actual.source, 'b.js');
+ assert.equal(actual.line, 2);
+ assert.equal(actual.column, 0);
+
+ actual = map.originalPositionFor({
+ line: 3,
+ column: 16
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+
+ actual = map.originalPositionFor({
+ line: 4,
+ column: 2
+ });
+ assert.equal(actual.source, null);
+ assert.equal(actual.line, null);
+ assert.equal(actual.column, null);
+ });
+
+ exports['test .fromStringWithSourceMap()'] = forEachNewline(function (assert, util, nl) {
+ var testCode = util.testGeneratedCode.replace(/\n/g, nl);
+ var node = SourceNode.fromStringWithSourceMap(
+ testCode,
+ new SourceMapConsumer(util.testMap));
+
+ var result = node.toStringWithSourceMap({
+ file: 'min.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, testCode);
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ assert.equal(map.version, util.testMap.version);
+ assert.equal(map.file, util.testMap.file);
+ assert.equal(map.mappings, util.testMap.mappings);
+ });
+
+ exports['test .fromStringWithSourceMap() empty map'] = forEachNewline(function (assert, util, nl) {
+ var node = SourceNode.fromStringWithSourceMap(
+ util.testGeneratedCode.replace(/\n/g, nl),
+ new SourceMapConsumer(util.emptyMap));
+ var result = node.toStringWithSourceMap({
+ file: 'min.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, util.testGeneratedCode.replace(/\n/g, nl));
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ assert.equal(map.version, util.emptyMap.version);
+ assert.equal(map.file, util.emptyMap.file);
+ assert.equal(map.mappings.length, util.emptyMap.mappings.length);
+ assert.equal(map.mappings, util.emptyMap.mappings);
+ });
+
+ exports['test .fromStringWithSourceMap() complex version'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ "(function() {" + nl,
+ " var Test = {};" + nl,
+ " ", new SourceNode(1, 0, "a.js", "Test.A = { value: 1234 };" + nl),
+ " ", new SourceNode(2, 0, "a.js", "Test.A.x = 'xyz';"), nl,
+ "}());" + nl,
+ "/* Generated Source */"]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ var node = SourceNode.fromStringWithSourceMap(
+ input.code,
+ new SourceMapConsumer(input.map.toString()));
+
+ var result = node.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+ var map = result.map;
+ var code = result.code;
+
+ assert.equal(code, input.code);
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = map.toJSON();
+ var inputMap = input.map.toJSON();
+ util.assertEqualMaps(assert, map, inputMap);
+ });
+
+ exports['test .fromStringWithSourceMap() third argument'] = function (assert, util) {
+ // Assume the following directory structure:
+ //
+ // http://foo.org/
+ // bar.coffee
+ // app/
+ // coffee/
+ // foo.coffee
+ // coffeeBundle.js # Made from {foo,bar,baz}.coffee
+ // maps/
+ // coffeeBundle.js.map
+ // js/
+ // foo.js
+ // public/
+ // app.js # Made from {foo,coffeeBundle}.js
+ // app.js.map
+ //
+ // http://www.example.com/
+ // baz.coffee
+
+ var coffeeBundle = new SourceNode(1, 0, 'foo.coffee', 'foo(coffee);\n');
+ coffeeBundle.setSourceContent('foo.coffee', 'foo coffee');
+ coffeeBundle.add(new SourceNode(2, 0, '/bar.coffee', 'bar(coffee);\n'));
+ coffeeBundle.add(new SourceNode(3, 0, 'http://www.example.com/baz.coffee', 'baz(coffee);'));
+ coffeeBundle = coffeeBundle.toStringWithSourceMap({
+ file: 'foo.js',
+ sourceRoot: '..'
+ });
+
+ var foo = new SourceNode(1, 0, 'foo.js', 'foo(js);');
+
+ var test = function(relativePath, expectedSources) {
+ var app = new SourceNode();
+ app.add(SourceNode.fromStringWithSourceMap(
+ coffeeBundle.code,
+ new SourceMapConsumer(coffeeBundle.map.toString()),
+ relativePath));
+ app.add(foo);
+ var i = 0;
+ app.walk(function (chunk, loc) {
+ assert.equal(loc.source, expectedSources[i]);
+ i++;
+ });
+ app.walkSourceContents(function (sourceFile, sourceContent) {
+ assert.equal(sourceFile, expectedSources[0]);
+ assert.equal(sourceContent, 'foo coffee');
+ })
+ };
+
+ test('../coffee/maps', [
+ '../coffee/foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ // If the third parameter is omitted or set to the current working
+ // directory we get incorrect source paths:
+
+ test(undefined, [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('.', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+
+ test('./', [
+ '../foo.coffee',
+ '/bar.coffee',
+ 'http://www.example.com/baz.coffee',
+ 'foo.js'
+ ]);
+ };
+
+ exports['test .toStringWithSourceMap() merging duplicate mappings'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ new SourceNode(1, 0, "a.js", "(function"),
+ new SourceNode(1, 0, "a.js", "() {" + nl),
+ " ",
+ new SourceNode(1, 0, "a.js", "var Test = "),
+ new SourceNode(1, 0, "b.js", "{};" + nl),
+ new SourceNode(2, 0, "b.js", "Test"),
+ new SourceNode(2, 0, "b.js", ".A", "A"),
+ new SourceNode(2, 20, "b.js", " = { value: ", "A"),
+ "1234",
+ new SourceNode(2, 40, "b.js", " };" + nl, "A"),
+ "}());" + nl,
+ "/* Generated Source */"
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "(function() {",
+ " var Test = {};",
+ "Test.A = { value: 1234 };",
+ "}());",
+ "/* Generated Source */"
+ ].join(nl))
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 1, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ // Here is no need for a empty mapping,
+ // because mappings ends at eol
+ correctMap.addMapping({
+ generated: { line: 2, column: 2 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 2, column: 13 },
+ source: 'b.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 4 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 6 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 20 }
+ });
+ // This empty mapping is required,
+ // because there is a hole in the middle of the line
+ correctMap.addMapping({
+ generated: { line: 3, column: 18 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 22 },
+ source: 'b.js',
+ name: 'A',
+ original: { line: 2, column: 40 }
+ });
+ // Here is no need for a empty mapping,
+ // because mappings ends at eol
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test .toStringWithSourceMap() multi-line SourceNodes'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ new SourceNode(1, 0, "a.js", "(function() {" + nl + "var nextLine = 1;" + nl + "anotherLine();" + nl),
+ new SourceNode(2, 2, "b.js", "Test.call(this, 123);" + nl),
+ new SourceNode(2, 2, "b.js", "this['stuff'] = 'v';" + nl),
+ new SourceNode(2, 2, "b.js", "anotherLine();" + nl),
+ "/*" + nl + "Generated" + nl + "Source" + nl + "*/" + nl,
+ new SourceNode(3, 4, "c.js", "anotherLine();" + nl),
+ "/*" + nl + "Generated" + nl + "Source" + nl + "*/"
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "(function() {",
+ "var nextLine = 1;",
+ "anotherLine();",
+ "Test.call(this, 123);",
+ "this['stuff'] = 'v';",
+ "anotherLine();",
+ "/*",
+ "Generated",
+ "Source",
+ "*/",
+ "anotherLine();",
+ "/*",
+ "Generated",
+ "Source",
+ "*/"
+ ].join(nl));
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 1, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 2, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 4, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 5, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 6, column: 0 },
+ source: 'b.js',
+ original: { line: 2, column: 2 }
+ });
+ correctMap.addMapping({
+ generated: { line: 11, column: 0 },
+ source: 'c.js',
+ original: { line: 3, column: 4 }
+ });
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test .toStringWithSourceMap() with empty string'] = function (assert, util) {
+ var node = new SourceNode(1, 0, 'empty.js', '');
+ var result = node.toStringWithSourceMap();
+ assert.equal(result.code, '');
+ };
+
+ exports['test .toStringWithSourceMap() with consecutive newlines'] = forEachNewline(function (assert, util, nl) {
+ var input = new SourceNode(null, null, null, [
+ "/***/" + nl + nl,
+ new SourceNode(1, 0, "a.js", "'use strict';" + nl),
+ new SourceNode(2, 0, "a.js", "a();"),
+ ]);
+ input = input.toStringWithSourceMap({
+ file: 'foo.js'
+ });
+
+ assert.equal(input.code, [
+ "/***/",
+ "",
+ "'use strict';",
+ "a();",
+ ].join(nl));
+
+ var correctMap = new SourceMapGenerator({
+ file: 'foo.js'
+ });
+ correctMap.addMapping({
+ generated: { line: 3, column: 0 },
+ source: 'a.js',
+ original: { line: 1, column: 0 }
+ });
+ correctMap.addMapping({
+ generated: { line: 4, column: 0 },
+ source: 'a.js',
+ original: { line: 2, column: 0 }
+ });
+
+ var inputMap = input.map.toJSON();
+ correctMap = correctMap.toJSON();
+ util.assertEqualMaps(assert, inputMap, correctMap);
+ });
+
+ exports['test setSourceContent with toStringWithSourceMap'] = function (assert, util) {
+ var aNode = new SourceNode(1, 1, 'a.js', 'a');
+ aNode.setSourceContent('a.js', 'someContent');
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', aNode,
+ ' ', new SourceNode(1, 1, 'b.js', 'b'),
+ '}());']);
+ node.setSourceContent('b.js', 'otherContent');
+ var map = node.toStringWithSourceMap({
+ file: 'foo.js'
+ }).map;
+
+ assert.ok(map instanceof SourceMapGenerator, 'map instanceof SourceMapGenerator');
+ map = new SourceMapConsumer(map.toString());
+
+ assert.equal(map.sources.length, 2);
+ assert.equal(map.sources[0], 'a.js');
+ assert.equal(map.sources[1], 'b.js');
+ assert.equal(map.sourcesContent.length, 2);
+ assert.equal(map.sourcesContent[0], 'someContent');
+ assert.equal(map.sourcesContent[1], 'otherContent');
+ };
+
+ exports['test walkSourceContents'] = function (assert, util) {
+ var aNode = new SourceNode(1, 1, 'a.js', 'a');
+ aNode.setSourceContent('a.js', 'someContent');
+ var node = new SourceNode(null, null, null,
+ ['(function () {\n',
+ ' ', aNode,
+ ' ', new SourceNode(1, 1, 'b.js', 'b'),
+ '}());']);
+ node.setSourceContent('b.js', 'otherContent');
+ var results = [];
+ node.walkSourceContents(function (sourceFile, sourceContent) {
+ results.push([sourceFile, sourceContent]);
+ });
+ assert.equal(results.length, 2);
+ assert.equal(results[0][0], 'a.js');
+ assert.equal(results[0][1], 'someContent');
+ assert.equal(results[1][0], 'b.js');
+ assert.equal(results[1][1], 'otherContent');
+ };
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-util.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-util.js
new file mode 100644
index 000000000..997d1a269
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/test-util.js
@@ -0,0 +1,216 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2014 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var libUtil = require('../../lib/source-map/util');
+
+ exports['test urls'] = function (assert, util) {
+ var assertUrl = function (url) {
+ assert.equal(url, libUtil.urlGenerate(libUtil.urlParse(url)));
+ };
+ assertUrl('http://');
+ assertUrl('http://www.example.com');
+ assertUrl('http://user:pass@www.example.com');
+ assertUrl('http://www.example.com:80');
+ assertUrl('http://www.example.com/');
+ assertUrl('http://www.example.com/foo/bar');
+ assertUrl('http://www.example.com/foo/bar/');
+ assertUrl('http://user:pass@www.example.com:80/foo/bar/');
+
+ assertUrl('//');
+ assertUrl('//www.example.com');
+ assertUrl('file:///www.example.com');
+
+ assert.equal(libUtil.urlParse(''), null);
+ assert.equal(libUtil.urlParse('.'), null);
+ assert.equal(libUtil.urlParse('..'), null);
+ assert.equal(libUtil.urlParse('a'), null);
+ assert.equal(libUtil.urlParse('a/b'), null);
+ assert.equal(libUtil.urlParse('a//b'), null);
+ assert.equal(libUtil.urlParse('/a'), null);
+ assert.equal(libUtil.urlParse('data:foo,bar'), null);
+ };
+
+ exports['test normalize()'] = function (assert, util) {
+ assert.equal(libUtil.normalize('/..'), '/');
+ assert.equal(libUtil.normalize('/../'), '/');
+ assert.equal(libUtil.normalize('/../../../..'), '/');
+ assert.equal(libUtil.normalize('/../../../../a/b/c'), '/a/b/c');
+ assert.equal(libUtil.normalize('/a/b/c/../../../d/../../e'), '/e');
+
+ assert.equal(libUtil.normalize('..'), '..');
+ assert.equal(libUtil.normalize('../'), '../');
+ assert.equal(libUtil.normalize('../../a/'), '../../a/');
+ assert.equal(libUtil.normalize('a/..'), '.');
+ assert.equal(libUtil.normalize('a/../../..'), '../..');
+
+ assert.equal(libUtil.normalize('/.'), '/');
+ assert.equal(libUtil.normalize('/./'), '/');
+ assert.equal(libUtil.normalize('/./././.'), '/');
+ assert.equal(libUtil.normalize('/././././a/b/c'), '/a/b/c');
+ assert.equal(libUtil.normalize('/a/b/c/./././d/././e'), '/a/b/c/d/e');
+
+ assert.equal(libUtil.normalize(''), '.');
+ assert.equal(libUtil.normalize('.'), '.');
+ assert.equal(libUtil.normalize('./'), '.');
+ assert.equal(libUtil.normalize('././a'), 'a');
+ assert.equal(libUtil.normalize('a/./'), 'a/');
+ assert.equal(libUtil.normalize('a/././.'), 'a');
+
+ assert.equal(libUtil.normalize('/a/b//c////d/////'), '/a/b/c/d/');
+ assert.equal(libUtil.normalize('///a/b//c////d/////'), '///a/b/c/d/');
+ assert.equal(libUtil.normalize('a/b//c////d'), 'a/b/c/d');
+
+ assert.equal(libUtil.normalize('.///.././../a/b//./..'), '../../a')
+
+ assert.equal(libUtil.normalize('http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.normalize('http://www.example.com/'), 'http://www.example.com/');
+ assert.equal(libUtil.normalize('http://www.example.com/./..//a/b/c/.././d//'), 'http://www.example.com/a/b/d/');
+ };
+
+ exports['test join()'] = function (assert, util) {
+ assert.equal(libUtil.join('a', 'b'), 'a/b');
+ assert.equal(libUtil.join('a/', 'b'), 'a/b');
+ assert.equal(libUtil.join('a//', 'b'), 'a/b');
+ assert.equal(libUtil.join('a', 'b/'), 'a/b/');
+ assert.equal(libUtil.join('a', 'b//'), 'a/b/');
+ assert.equal(libUtil.join('a/', '/b'), '/b');
+ assert.equal(libUtil.join('a//', '//b'), '//b');
+
+ assert.equal(libUtil.join('a', '..'), '.');
+ assert.equal(libUtil.join('a', '../b'), 'b');
+ assert.equal(libUtil.join('a/b', '../c'), 'a/c');
+
+ assert.equal(libUtil.join('a', '.'), 'a');
+ assert.equal(libUtil.join('a', './b'), 'a/b');
+ assert.equal(libUtil.join('a/b', './c'), 'a/b/c');
+
+ assert.equal(libUtil.join('a', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('a', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('', 'b'), 'b');
+ assert.equal(libUtil.join('.', 'b'), 'b');
+ assert.equal(libUtil.join('', 'b/'), 'b/');
+ assert.equal(libUtil.join('.', 'b/'), 'b/');
+ assert.equal(libUtil.join('', 'b//'), 'b/');
+ assert.equal(libUtil.join('.', 'b//'), 'b/');
+
+ assert.equal(libUtil.join('', '..'), '..');
+ assert.equal(libUtil.join('.', '..'), '..');
+ assert.equal(libUtil.join('', '../b'), '../b');
+ assert.equal(libUtil.join('.', '../b'), '../b');
+
+ assert.equal(libUtil.join('', '.'), '.');
+ assert.equal(libUtil.join('.', '.'), '.');
+ assert.equal(libUtil.join('', './b'), 'b');
+ assert.equal(libUtil.join('.', './b'), 'b');
+
+ assert.equal(libUtil.join('', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('.', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('', 'data:foo,bar'), 'data:foo,bar');
+ assert.equal(libUtil.join('.', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('..', 'b'), '../b');
+ assert.equal(libUtil.join('..', 'b/'), '../b/');
+ assert.equal(libUtil.join('..', 'b//'), '../b/');
+
+ assert.equal(libUtil.join('..', '..'), '../..');
+ assert.equal(libUtil.join('..', '../b'), '../../b');
+
+ assert.equal(libUtil.join('..', '.'), '..');
+ assert.equal(libUtil.join('..', './b'), '../b');
+
+ assert.equal(libUtil.join('..', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('..', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('a', ''), 'a');
+ assert.equal(libUtil.join('a', '.'), 'a');
+ assert.equal(libUtil.join('a/', ''), 'a');
+ assert.equal(libUtil.join('a/', '.'), 'a');
+ assert.equal(libUtil.join('a//', ''), 'a');
+ assert.equal(libUtil.join('a//', '.'), 'a');
+ assert.equal(libUtil.join('/a', ''), '/a');
+ assert.equal(libUtil.join('/a', '.'), '/a');
+ assert.equal(libUtil.join('', ''), '.');
+ assert.equal(libUtil.join('.', ''), '.');
+ assert.equal(libUtil.join('.', ''), '.');
+ assert.equal(libUtil.join('.', '.'), '.');
+ assert.equal(libUtil.join('..', ''), '..');
+ assert.equal(libUtil.join('..', '.'), '..');
+ assert.equal(libUtil.join('http://foo.org/a', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a/', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a/', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a//', ''), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a//', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org//', ''), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org//', '.'), 'http://foo.org/');
+ assert.equal(libUtil.join('//www.example.com', ''), '//www.example.com/');
+ assert.equal(libUtil.join('//www.example.com', '.'), '//www.example.com/');
+
+
+ assert.equal(libUtil.join('http://foo.org/a', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a/', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a//', 'b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a', 'b/'), 'http://foo.org/a/b/');
+ assert.equal(libUtil.join('http://foo.org/a', 'b//'), 'http://foo.org/a/b/');
+ assert.equal(libUtil.join('http://foo.org/a/', '/b'), 'http://foo.org/b');
+ assert.equal(libUtil.join('http://foo.org/a//', '//b'), 'http://b');
+
+ assert.equal(libUtil.join('http://foo.org/a', '..'), 'http://foo.org/');
+ assert.equal(libUtil.join('http://foo.org/a', '../b'), 'http://foo.org/b');
+ assert.equal(libUtil.join('http://foo.org/a/b', '../c'), 'http://foo.org/a/c');
+
+ assert.equal(libUtil.join('http://foo.org/a', '.'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/a', './b'), 'http://foo.org/a/b');
+ assert.equal(libUtil.join('http://foo.org/a/b', './c'), 'http://foo.org/a/b/c');
+
+ assert.equal(libUtil.join('http://foo.org/a', 'http://www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('http://foo.org/a', 'data:foo,bar'), 'data:foo,bar');
+
+
+ assert.equal(libUtil.join('http://foo.org', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org//', 'a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org', '/a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org/', '/a'), 'http://foo.org/a');
+ assert.equal(libUtil.join('http://foo.org//', '/a'), 'http://foo.org/a');
+
+
+ assert.equal(libUtil.join('http://', 'www.example.com'), 'http://www.example.com');
+ assert.equal(libUtil.join('file:///', 'www.example.com'), 'file:///www.example.com');
+ assert.equal(libUtil.join('http://', 'ftp://example.com'), 'ftp://example.com');
+
+ assert.equal(libUtil.join('http://www.example.com', '//foo.org/bar'), 'http://foo.org/bar');
+ assert.equal(libUtil.join('//www.example.com', '//foo.org/bar'), '//foo.org/bar');
+ };
+
+ // TODO Issue #128: Define and test this function properly.
+ exports['test relative()'] = function (assert, util) {
+ assert.equal(libUtil.relative('/the/root', '/the/root/one.js'), 'one.js');
+ assert.equal(libUtil.relative('/the/root', '/the/rootone.js'), '/the/rootone.js');
+
+ assert.equal(libUtil.relative('', '/the/root/one.js'), '/the/root/one.js');
+ assert.equal(libUtil.relative('.', '/the/root/one.js'), '/the/root/one.js');
+ assert.equal(libUtil.relative('', 'the/root/one.js'), 'the/root/one.js');
+ assert.equal(libUtil.relative('.', 'the/root/one.js'), 'the/root/one.js');
+
+ assert.equal(libUtil.relative('/', '/the/root/one.js'), 'the/root/one.js');
+ assert.equal(libUtil.relative('/', 'the/root/one.js'), 'the/root/one.js');
+ };
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/util.js b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/util.js
new file mode 100644
index 000000000..56bbe2c31
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/node_modules/source-map/test/source-map/util.js
@@ -0,0 +1,192 @@
+/* -*- Mode: js; js-indent-level: 2; -*- */
+/*
+ * Copyright 2011 Mozilla Foundation and contributors
+ * Licensed under the New BSD license. See LICENSE or:
+ * http://opensource.org/licenses/BSD-3-Clause
+ */
+if (typeof define !== 'function') {
+ var define = require('amdefine')(module, require);
+}
+define(function (require, exports, module) {
+
+ var util = require('../../lib/source-map/util');
+
+ // This is a test mapping which maps functions from two different files
+ // (one.js and two.js) to a minified generated source.
+ //
+ // Here is one.js:
+ //
+ // ONE.foo = function (bar) {
+ // return baz(bar);
+ // };
+ //
+ // Here is two.js:
+ //
+ // TWO.inc = function (n) {
+ // return n + 1;
+ // };
+ //
+ // And here is the generated code (min.js):
+ //
+ // ONE.foo=function(a){return baz(a);};
+ // TWO.inc=function(a){return a+1;};
+ exports.testGeneratedCode = " ONE.foo=function(a){return baz(a);};\n"+
+ " TWO.inc=function(a){return a+1;};";
+ exports.testMap = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapNoSourceRoot = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapEmptySourceRoot = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourceRoot: '',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapWithSourcesContent = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['one.js', 'two.js'],
+ sourcesContent: [
+ ' ONE.foo = function (bar) {\n' +
+ ' return baz(bar);\n' +
+ ' };',
+ ' TWO.inc = function (n) {\n' +
+ ' return n + 1;\n' +
+ ' };'
+ ],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.testMapRelativeSources = {
+ version: 3,
+ file: 'min.js',
+ names: ['bar', 'baz', 'n'],
+ sources: ['./one.js', './two.js'],
+ sourcesContent: [
+ ' ONE.foo = function (bar) {\n' +
+ ' return baz(bar);\n' +
+ ' };',
+ ' TWO.inc = function (n) {\n' +
+ ' return n + 1;\n' +
+ ' };'
+ ],
+ sourceRoot: '/the/root',
+ mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
+ };
+ exports.emptyMap = {
+ version: 3,
+ file: 'min.js',
+ names: [],
+ sources: [],
+ mappings: ''
+ };
+
+
+ function assertMapping(generatedLine, generatedColumn, originalSource,
+ originalLine, originalColumn, name, map, assert,
+ dontTestGenerated, dontTestOriginal) {
+ if (!dontTestOriginal) {
+ var origMapping = map.originalPositionFor({
+ line: generatedLine,
+ column: generatedColumn
+ });
+ assert.equal(origMapping.name, name,
+ 'Incorrect name, expected ' + JSON.stringify(name)
+ + ', got ' + JSON.stringify(origMapping.name));
+ assert.equal(origMapping.line, originalLine,
+ 'Incorrect line, expected ' + JSON.stringify(originalLine)
+ + ', got ' + JSON.stringify(origMapping.line));
+ assert.equal(origMapping.column, originalColumn,
+ 'Incorrect column, expected ' + JSON.stringify(originalColumn)
+ + ', got ' + JSON.stringify(origMapping.column));
+
+ var expectedSource;
+
+ if (originalSource && map.sourceRoot && originalSource.indexOf(map.sourceRoot) === 0) {
+ expectedSource = originalSource;
+ } else if (originalSource) {
+ expectedSource = map.sourceRoot
+ ? util.join(map.sourceRoot, originalSource)
+ : originalSource;
+ } else {
+ expectedSource = null;
+ }
+
+ assert.equal(origMapping.source, expectedSource,
+ 'Incorrect source, expected ' + JSON.stringify(expectedSource)
+ + ', got ' + JSON.stringify(origMapping.source));
+ }
+
+ if (!dontTestGenerated) {
+ var genMapping = map.generatedPositionFor({
+ source: originalSource,
+ line: originalLine,
+ column: originalColumn
+ });
+ assert.equal(genMapping.line, generatedLine,
+ 'Incorrect line, expected ' + JSON.stringify(generatedLine)
+ + ', got ' + JSON.stringify(genMapping.line));
+ assert.equal(genMapping.column, generatedColumn,
+ 'Incorrect column, expected ' + JSON.stringify(generatedColumn)
+ + ', got ' + JSON.stringify(genMapping.column));
+ }
+ }
+ exports.assertMapping = assertMapping;
+
+ function assertEqualMaps(assert, actualMap, expectedMap) {
+ assert.equal(actualMap.version, expectedMap.version, "version mismatch");
+ assert.equal(actualMap.file, expectedMap.file, "file mismatch");
+ assert.equal(actualMap.names.length,
+ expectedMap.names.length,
+ "names length mismatch: " +
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
+ for (var i = 0; i < actualMap.names.length; i++) {
+ assert.equal(actualMap.names[i],
+ expectedMap.names[i],
+ "names[" + i + "] mismatch: " +
+ actualMap.names.join(", ") + " != " + expectedMap.names.join(", "));
+ }
+ assert.equal(actualMap.sources.length,
+ expectedMap.sources.length,
+ "sources length mismatch: " +
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
+ for (var i = 0; i < actualMap.sources.length; i++) {
+ assert.equal(actualMap.sources[i],
+ expectedMap.sources[i],
+ "sources[" + i + "] length mismatch: " +
+ actualMap.sources.join(", ") + " != " + expectedMap.sources.join(", "));
+ }
+ assert.equal(actualMap.sourceRoot,
+ expectedMap.sourceRoot,
+ "sourceRoot mismatch: " +
+ actualMap.sourceRoot + " != " + expectedMap.sourceRoot);
+ assert.equal(actualMap.mappings, expectedMap.mappings,
+ "mappings mismatch:\nActual: " + actualMap.mappings + "\nExpected: " + expectedMap.mappings);
+ if (actualMap.sourcesContent) {
+ assert.equal(actualMap.sourcesContent.length,
+ expectedMap.sourcesContent.length,
+ "sourcesContent length mismatch");
+ for (var i = 0; i < actualMap.sourcesContent.length; i++) {
+ assert.equal(actualMap.sourcesContent[i],
+ expectedMap.sourcesContent[i],
+ "sourcesContent[" + i + "] mismatch");
+ }
+ }
+ }
+ exports.assertEqualMaps = assertEqualMaps;
+
+});
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/package.json b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/package.json
new file mode 100644
index 000000000..a207d353c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/node_modules/coffeestack/package.json
@@ -0,0 +1,50 @@
+{
+ "name": "coffeestack",
+ "version": "1.1.1",
+ "description": "CoffeeScript stack trace converter",
+ "main": "./index.js",
+ "scripts": {
+ "prepublish": "grunt clean lint coffee",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/kevinsawicki/coffeestack.git"
+ },
+ "keywords": [
+ "CoffeeScript",
+ "JavaScript",
+ "stack",
+ "stacktrace",
+ "trace",
+ "source maps"
+ ],
+ "author": {
+ "name": "Kevin Sawicki",
+ "email": "kevinsawicki@gmail.com"
+ },
+ "license": "BSD",
+ "bugs": {
+ "url": "https://github.com/kevinsawicki/coffeestack/issues"
+ },
+ "dependencies": {
+ "coffee-script": "~1.8.0",
+ "fs-plus": "^2.5.0",
+ "source-map": "~0.1.43"
+ },
+ "devDependencies": {
+ "grunt": "~0.4.1",
+ "grunt-cli": "~0.1.9",
+ "grunt-coffeelint": "0.0.7",
+ "grunt-contrib-coffee": "~0.7.0",
+ "grunt-shell": "~0.3.0",
+ "jasmine-focused": "1.x",
+ "rimraf": "~2.2.0",
+ "temp": "^0.8.1"
+ },
+ "readme": "# CoffeeStack [](https://travis-ci.org/kevinsawicki/coffeestack)\n\nModule to convert JavaScript stack traces to CoffeeScript stack traces.\n\n## Installing\n\n```sh\nnpm install coffeestack\n```\n\n## Using\n\n```coffeescript\n{convertStackTrace} = require 'coffeestack'\n\ntry\n throw new Error('this is an error')\ncatch error\n console.error(convertStackTrace(error.stack))\n```\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/kevinsawicki/coffeestack",
+ "_id": "coffeestack@1.1.1",
+ "_from": "coffeestack@^1"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/grim/package.json b/node_modules/basarat-text-buffer/node_modules/grim/package.json
new file mode 100644
index 000000000..9e924f4b7
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/grim/package.json
@@ -0,0 +1,44 @@
+{
+ "name": "grim",
+ "version": "1.2.0",
+ "description": "Log usage of deprecated methods",
+ "main": "./lib/grim",
+ "scripts": {
+ "prepublish": "grunt clean lint coffee",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "https://github.com/atom/grim.git"
+ },
+ "bugs": {
+ "url": "https://github.com/atom/grim/issues"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/grim/raw/master/LICENSE.md"
+ }
+ ],
+ "dependencies": {
+ "coffeestack": "^1",
+ "emissary": "^1.2.0"
+ },
+ "devDependencies": {
+ "coffee-script": "^1.7.0",
+ "jasmine-focused": "^1.0.4",
+ "grunt-contrib-coffee": "^0.9.0",
+ "grunt-cli": "^0.1.8",
+ "grunt": "^0.4.1",
+ "grunt-shell": "^0.2.2",
+ "grunt-coffeelint": "^0.0.6",
+ "rimraf": "^2.2.2",
+ "coffee-cache": "^0.2.0",
+ "temp": "^0.6.0"
+ },
+ "readme": "# Grim [](https://travis-ci.org/atom/grim)\n\nLog deprecate calls\n\n## Installing\n\n```sh\nnpm install grim\n```\n\n## Usage\n\n```javascript\nGrim = require('grim')\n\nfunction someOldMethod() {\n Grim.deprecate(\"Use theNewMethod instead.\")\n}\n```\n\nTo view all calls to deprecated methods use `Grim.logDeprecations()` or get direct access to the deprecated calls by using `Grim.getDeprecations()`\n",
+ "readmeFilename": "README.md",
+ "homepage": "https://github.com/atom/grim",
+ "_id": "grim@1.2.0",
+ "_from": "grim@^1"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/interval-skip-list/LICENSE.md b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/LICENSE.md
new file mode 100644
index 000000000..493db50ed
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/LICENSE.md
@@ -0,0 +1,20 @@
+Copyright (c) 2013 GitHub Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/interval-skip-list/README.md b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/README.md
new file mode 100644
index 000000000..fbe774fb6
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/README.md
@@ -0,0 +1,90 @@
+# Interval Skip List [](https://travis-ci.org/atom/interval-skip-list)
+
+This data structure maps intervals to values and allows you to find all
+intervals that contain an index in `O(ln(n))`, where `n` is the number of
+intervals stored. This implementation is based on the paper
+[The Interval Skip List](https://www.cise.ufl.edu/tr/DOC/REP-1992-45.pdf) by
+Eric N. Hanson.
+
+## Basic Usage Example
+
+```coffee
+IntervalSkipList = require 'interval-skip-list'
+list = new IntervalSkipList
+
+list.insert('a', 2, 7)
+list.insert('b', 1, 5)
+list.insert('c', 8, 8)
+
+list.findContaining(1) # => ['b']
+list.findContaining(2) # => ['b', 'a']
+list.findContaining(8) # => ['c']
+
+list.remove('b')
+
+list.findContaining(2) # => ['a']
+```
+
+## API
+
+* `::insert(label, startIndex, endIndex)`
+ Adds an interval with the given unique label to the list.
+
+* `::remove(label)`
+ Removes the interval with the given unique label from the list.
+
+* `::update(label, startIndex, endIndex)`
+ Inserts or updates the interval corresponding to the given unique label.
+ Unlike `::insert`, this method allows you to specify a label that's already
+ been inserted in the list.
+
+* `::findContaining(indices...)`
+ Returns the labels of all intervals containing the given indices.
+
+* `::findIntersecting(indices...)`
+ Returns the labels of all intervals intersecting the given set of indices.
+ Unlike `::findContaining`, this method does not require that the intervals
+ contain *all* the given indices.
+
+* `::findStartingAt(index)`
+ Returns the labels of all intervals starting at the given index.
+
+* `::findEndingAt(index)`
+ Returns the labels of all intervals ending at the given index.
+
+* `::findStartingIn(startIndex, endIndex)`
+ Returns the labels of all intervals starting within the interval described by
+ the given start and end indices.
+
+* `::findEndingIn(startIndex, endIndex)`
+ Returns the labels of all intervals ending within the interval described by
+ the given start and end indices.
+
+## Using a Custom Comparator
+
+You can also supply a custom comparator function with corresponding min and max
+index values. The following example uses arrays expressing coordinate pairs
+instead of the default numeric values:
+
+```coffee
+list = new IntervalSkipList
+ minIndex: [-Infinity, -Infinity]
+ maxIndex: [Infinity, Infinity]
+ compare: (a, b) ->
+ if a[0] < b[0]
+ -1
+ else if a[0] > b[0]
+ 1
+ else
+ if a[1] < b[1]
+ -1
+ else if a[1] > b[1]
+ 1
+ else
+ 0
+
+ list.insert("a", [1, 2], [3, 4])
+ list.insert("b", [2, 1], [3, 10])
+ list.findContaining([1, Infinity]) # => ["a"]
+ list.findContaining([2, 20]) # => ["a", "b"]
+```
diff --git a/node_modules/basarat-text-buffer/node_modules/interval-skip-list/lib/interval-skip-list.js b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/lib/interval-skip-list.js
new file mode 100644
index 000000000..77784309f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/lib/interval-skip-list.js
@@ -0,0 +1,585 @@
+(function() {
+ var DefaultComparator, IntervalSkipList, Node, clone, first, include, intersection, last, remove, union, _ref,
+ __slice = [].slice;
+
+ _ref = require('underscore-plus'), clone = _ref.clone, include = _ref.include, first = _ref.first, last = _ref.last, union = _ref.union, intersection = _ref.intersection;
+
+ remove = function(array, element) {
+ var index;
+ index = array.indexOf(element);
+ if (index !== -1) {
+ return array.splice(index, 1);
+ }
+ };
+
+ DefaultComparator = function(a, b) {
+ if (a < b) {
+ return -1;
+ } else if (a > b) {
+ return 1;
+ } else {
+ return 0;
+ }
+ };
+
+ module.exports = IntervalSkipList = (function() {
+ IntervalSkipList.prototype.maxHeight = 8;
+
+ IntervalSkipList.prototype.probability = .25;
+
+ function IntervalSkipList(params) {
+ var i, _i, _ref1;
+ if (params != null) {
+ this.compare = params.compare, this.minIndex = params.minIndex, this.maxIndex = params.maxIndex;
+ }
+ if (this.compare == null) {
+ this.compare = DefaultComparator;
+ }
+ if (this.minIndex == null) {
+ this.minIndex = -Infinity;
+ }
+ if (this.maxIndex == null) {
+ this.maxIndex = Infinity;
+ }
+ this.head = new Node(this.maxHeight, this.minIndex);
+ this.tail = new Node(this.maxHeight, this.maxIndex);
+ for (i = _i = 0, _ref1 = this.maxHeight; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ this.head.next[i] = this.tail;
+ }
+ this.intervalsByMarker = {};
+ }
+
+ IntervalSkipList.prototype.findContaining = function() {
+ var i, markers, node, searchIndex, searchIndices, _i, _ref1;
+ searchIndices = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+ if (searchIndices.length > 1) {
+ searchIndices = this.sortIndices(searchIndices);
+ return intersection(this.findContaining(first(searchIndices)), this.findContaining(last(searchIndices)));
+ }
+ searchIndex = searchIndices[0];
+ markers = [];
+ node = this.head;
+ for (i = _i = _ref1 = this.maxHeight - 1; _ref1 <= 1 ? _i <= 1 : _i >= 1; i = _ref1 <= 1 ? ++_i : --_i) {
+ while (this.compare(node.next[i].index, searchIndex) < 0) {
+ node = node.next[i];
+ }
+ markers.push.apply(markers, node.markers[i]);
+ }
+ while (this.compare(node.next[0].index, searchIndex) < 0) {
+ node = node.next[0];
+ }
+ markers.push.apply(markers, node.markers[0]);
+ node = node.next[0];
+ if (this.compare(node.index, searchIndex) === 0) {
+ return markers.concat(node.startingMarkers);
+ } else {
+ return markers;
+ }
+ };
+
+ IntervalSkipList.prototype.findIntersecting = function(searchStartIndex, searchEndIndex) {
+ var i, markers, node, _i, _ref1;
+ markers = [];
+ node = this.head;
+ for (i = _i = _ref1 = this.maxHeight - 1; _ref1 <= 1 ? _i <= 1 : _i >= 1; i = _ref1 <= 1 ? ++_i : --_i) {
+ while (this.compare(node.next[i].index, searchStartIndex) < 0) {
+ node = node.next[i];
+ }
+ markers.push.apply(markers, node.markers[i]);
+ }
+ while (this.compare(node.next[0].index, searchStartIndex) < 0) {
+ node = node.next[0];
+ }
+ markers.push.apply(markers, node.markers[0]);
+ node = node.next[0];
+ while (this.compare(node.index, searchEndIndex) <= 0) {
+ markers.push.apply(markers, node.startingMarkers);
+ node = node.next[0];
+ }
+ return markers;
+ };
+
+ IntervalSkipList.prototype.findStartingAt = function(searchIndex) {
+ var node;
+ node = this.findClosestNode(searchIndex);
+ if (this.compare(node.index, searchIndex) === 0) {
+ return node.startingMarkers;
+ } else {
+ return [];
+ }
+ };
+
+ IntervalSkipList.prototype.findEndingAt = function(searchIndex) {
+ var node;
+ node = this.findClosestNode(searchIndex);
+ if (this.compare(node.index, searchIndex) === 0) {
+ return node.endingMarkers;
+ } else {
+ return [];
+ }
+ };
+
+ IntervalSkipList.prototype.findStartingIn = function(searchStartIndex, searchEndIndex) {
+ var markers, node;
+ markers = [];
+ node = this.findClosestNode(searchStartIndex);
+ while (this.compare(node.index, searchEndIndex) <= 0) {
+ markers.push.apply(markers, node.startingMarkers);
+ node = node.next[0];
+ }
+ return markers;
+ };
+
+ IntervalSkipList.prototype.findEndingIn = function(searchStartIndex, searchEndIndex) {
+ var markers, node;
+ markers = [];
+ node = this.findClosestNode(searchStartIndex);
+ while (this.compare(node.index, searchEndIndex) <= 0) {
+ markers.push.apply(markers, node.endingMarkers);
+ node = node.next[0];
+ }
+ return markers;
+ };
+
+ IntervalSkipList.prototype.findContainedIn = function(searchStartIndex, searchEndIndex) {
+ var marker, markers, node, startedMarkers, _i, _j, _len, _len1, _ref1, _ref2;
+ startedMarkers = {};
+ markers = [];
+ node = this.findClosestNode(searchStartIndex);
+ while (this.compare(node.index, searchEndIndex) <= 0) {
+ _ref1 = node.startingMarkers;
+ for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
+ marker = _ref1[_i];
+ startedMarkers[marker] = true;
+ }
+ _ref2 = node.endingMarkers;
+ for (_j = 0, _len1 = _ref2.length; _j < _len1; _j++) {
+ marker = _ref2[_j];
+ if (startedMarkers[marker]) {
+ markers.push(marker);
+ }
+ }
+ node = node.next[0];
+ }
+ return markers;
+ };
+
+ IntervalSkipList.prototype.insert = function(marker, startIndex, endIndex) {
+ var endNode, startNode;
+ if (this.intervalsByMarker[marker] != null) {
+ throw new Error("Interval for " + marker + " already exists.");
+ }
+ if (this.compare(startIndex, endIndex) > 0) {
+ throw new Error("Start index " + startIndex + " must be <= end index " + endIndex);
+ }
+ if (this.compare(startIndex, this.minIndex) < 0) {
+ throw new Error("Start index " + startIndex + " must be > min index " + this.minIndex);
+ }
+ if (this.compare(endIndex, this.maxIndex) >= 0) {
+ throw new Error("Start index " + endIndex + " must be < max index " + this.maxIndex);
+ }
+ startNode = this.insertNode(startIndex);
+ endNode = this.insertNode(endIndex);
+ this.placeMarker(marker, startNode, endNode);
+ return this.intervalsByMarker[marker] = [startIndex, endIndex];
+ };
+
+ IntervalSkipList.prototype.remove = function(marker) {
+ var endIndex, endNode, interval, startIndex, startNode;
+ if (!(interval = this.intervalsByMarker[marker])) {
+ return;
+ }
+ startIndex = interval[0], endIndex = interval[1];
+ delete this.intervalsByMarker[marker];
+ startNode = this.findClosestNode(startIndex);
+ endNode = this.findClosestNode(endIndex);
+ this.removeMarker(marker, startNode, endNode);
+ if (startNode.endpointMarkers.length === 0) {
+ this.removeNode(startIndex);
+ }
+ if (endNode.endpointMarkers.length === 0) {
+ return this.removeNode(endIndex);
+ }
+ };
+
+ IntervalSkipList.prototype.update = function(marker, startIndex, endIndex) {
+ this.remove(marker);
+ return this.insert(marker, startIndex, endIndex);
+ };
+
+ IntervalSkipList.prototype.insertNode = function(index) {
+ var closestNode, i, newNode, prevNode, update, _i, _ref1;
+ update = this.buildUpdateArray();
+ closestNode = this.findClosestNode(index, update);
+ if (this.compare(closestNode.index, index) > 0) {
+ newNode = new Node(this.getRandomNodeHeight(), index);
+ for (i = _i = 0, _ref1 = newNode.height; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ prevNode = update[i];
+ newNode.next[i] = prevNode.next[i];
+ prevNode.next[i] = newNode;
+ }
+ this.adjustMarkersOnInsert(newNode, update);
+ return newNode;
+ } else {
+ return closestNode;
+ }
+ };
+
+ IntervalSkipList.prototype.adjustMarkersOnInsert = function(node, updated) {
+ var endIndex, i, marker, newPromoted, promoted, startIndex, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _n, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9;
+ promoted = [];
+ newPromoted = [];
+ for (i = _i = 0, _ref1 = node.height - 1; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ _ref2 = clone(updated[i].markers[i]);
+ for (_j = 0, _len = _ref2.length; _j < _len; _j++) {
+ marker = _ref2[_j];
+ _ref3 = this.intervalsByMarker[marker], startIndex = _ref3[0], endIndex = _ref3[1];
+ if (this.compare(node.next[i + 1].index, endIndex) <= 0) {
+ this.removeMarkerOnPath(marker, node.next[i], node.next[i + 1], i);
+ newPromoted.push(marker);
+ } else {
+ node.addMarkerAtLevel(marker, i);
+ }
+ }
+ _ref4 = clone(promoted);
+ for (_k = 0, _len1 = _ref4.length; _k < _len1; _k++) {
+ marker = _ref4[_k];
+ _ref5 = this.intervalsByMarker[marker], startIndex = _ref5[0], endIndex = _ref5[1];
+ if (this.compare(node.next[i + 1].index, endIndex) <= 0) {
+ this.removeMarkerOnPath(marker, node.next[i], node.next[i + 1], i);
+ } else {
+ node.addMarkerAtLevel(marker, i);
+ remove(promoted, marker);
+ }
+ }
+ promoted = promoted.concat(newPromoted);
+ newPromoted.length = 0;
+ }
+ node.addMarkersAtLevel(updated[i].markers[i].concat(promoted), i);
+ promoted.length = 0;
+ newPromoted.length = 0;
+ for (i = _l = 0, _ref6 = node.height - 1; 0 <= _ref6 ? _l < _ref6 : _l > _ref6; i = 0 <= _ref6 ? ++_l : --_l) {
+ _ref7 = clone(updated[i].markers[i]);
+ for (_m = 0, _len2 = _ref7.length; _m < _len2; _m++) {
+ marker = _ref7[_m];
+ _ref8 = this.intervalsByMarker[marker], startIndex = _ref8[0], endIndex = _ref8[1];
+ if (this.compare(startIndex, updated[i + 1].index) <= 0) {
+ newPromoted.push(marker);
+ this.removeMarkerOnPath(marker, updated[i + 1], node, i);
+ }
+ }
+ _ref9 = clone(promoted);
+ for (_n = 0, _len3 = _ref9.length; _n < _len3; _n++) {
+ marker = _ref9[_n];
+ _ref10 = this.intervalsByMarker[marker], startIndex = _ref10[0], endIndex = _ref10[1];
+ if (this.compare(startIndex, updated[i + 1].index) <= 0) {
+ this.removeMarkerOnPath(marker, updated[i + 1], node, i);
+ } else {
+ updated[i].addMarkerAtLevel(marker, i);
+ remove(promoted, marker);
+ }
+ }
+ promoted = promoted.concat(newPromoted);
+ newPromoted.length = 0;
+ }
+ return updated[i].addMarkersAtLevel(promoted, i);
+ };
+
+ IntervalSkipList.prototype.removeNode = function(index) {
+ var i, node, update, _i, _ref1, _results;
+ update = this.buildUpdateArray();
+ node = this.findClosestNode(index, update);
+ if (this.compare(node.index, index) === 0) {
+ this.adjustMarkersOnRemove(node, update);
+ _results = [];
+ for (i = _i = 0, _ref1 = node.height; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ _results.push(update[i].next[i] = node.next[i]);
+ }
+ return _results;
+ }
+ };
+
+ IntervalSkipList.prototype.adjustMarkersOnRemove = function(node, updated) {
+ var demoted, endIndex, i, marker, newDemoted, startIndex, _i, _j, _k, _l, _len, _len1, _len2, _len3, _m, _n, _ref1, _ref10, _ref2, _ref3, _ref4, _ref5, _ref6, _ref7, _ref8, _ref9, _results;
+ demoted = [];
+ newDemoted = [];
+ for (i = _i = _ref1 = node.height - 1; _ref1 <= 0 ? _i <= 0 : _i >= 0; i = _ref1 <= 0 ? ++_i : --_i) {
+ _ref2 = clone(updated[i].markers[i]);
+ for (_j = 0, _len = _ref2.length; _j < _len; _j++) {
+ marker = _ref2[_j];
+ _ref3 = this.intervalsByMarker[marker], startIndex = _ref3[0], endIndex = _ref3[1];
+ if (this.compare(node.next[i].index, endIndex) > 0) {
+ newDemoted.push(marker);
+ updated[i].removeMarkerAtLevel(marker, i);
+ }
+ }
+ _ref4 = clone(demoted);
+ for (_k = 0, _len1 = _ref4.length; _k < _len1; _k++) {
+ marker = _ref4[_k];
+ this.placeMarkerOnPath(marker, updated[i + 1], updated[i], i);
+ _ref5 = this.intervalsByMarker[marker], startIndex = _ref5[0], endIndex = _ref5[1];
+ if (this.compare(node.next[i].index, endIndex) <= 0) {
+ updated[i].addMarkerAtLevel(marker, i);
+ remove(demoted, marker);
+ }
+ }
+ demoted.push.apply(demoted, newDemoted);
+ newDemoted.length = 0;
+ }
+ demoted.length = 0;
+ newDemoted.length = 0;
+ _results = [];
+ for (i = _l = _ref6 = node.height - 1; _ref6 <= 0 ? _l <= 0 : _l >= 0; i = _ref6 <= 0 ? ++_l : --_l) {
+ _ref7 = node.markers[i];
+ for (_m = 0, _len2 = _ref7.length; _m < _len2; _m++) {
+ marker = _ref7[_m];
+ _ref8 = this.intervalsByMarker[marker], startIndex = _ref8[0], endIndex = _ref8[1];
+ if (this.compare(updated[i].index, startIndex) < 0) {
+ newDemoted.push(marker);
+ }
+ }
+ _ref9 = clone(demoted);
+ for (_n = 0, _len3 = _ref9.length; _n < _len3; _n++) {
+ marker = _ref9[_n];
+ this.placeMarkerOnPath(marker, node.next[i], node.next[i + 1], i);
+ _ref10 = this.intervalsByMarker[marker], startIndex = _ref10[0], endIndex = _ref10[1];
+ if (this.compare(updated[i].index, startIndex) >= 0) {
+ remove(demoted, marker);
+ }
+ }
+ demoted.push.apply(demoted, newDemoted);
+ _results.push(newDemoted.length = 0);
+ }
+ return _results;
+ };
+
+ IntervalSkipList.prototype.placeMarker = function(marker, startNode, endNode) {
+ var endIndex, i, node, startIndex, _results;
+ startNode.addStartingMarker(marker);
+ endNode.addEndingMarker(marker);
+ startIndex = startNode.index;
+ endIndex = endNode.index;
+ node = startNode;
+ i = 0;
+ while (this.compare(node.next[i].index, endIndex) <= 0) {
+ while (i < node.height - 1 && this.compare(node.next[i + 1].index, endIndex) <= 0) {
+ i++;
+ }
+ node.addMarkerAtLevel(marker, i);
+ node = node.next[i];
+ }
+ _results = [];
+ while (node !== endNode) {
+ while (i > 0 && this.compare(node.next[i].index, endIndex) > 0) {
+ i--;
+ }
+ if (node == null) {
+ debugger;
+ }
+ node.addMarkerAtLevel(marker, i);
+ _results.push(node = node.next[i]);
+ }
+ return _results;
+ };
+
+ IntervalSkipList.prototype.removeMarker = function(marker, startNode, endNode) {
+ var endIndex, i, node, startIndex, _results;
+ startNode.removeStartingMarker(marker);
+ endNode.removeEndingMarker(marker);
+ startIndex = startNode.index;
+ endIndex = endNode.index;
+ node = startNode;
+ i = 0;
+ while (this.compare(node.next[i].index, endIndex) <= 0) {
+ while (i < node.height - 1 && this.compare(node.next[i + 1].index, endIndex) <= 0) {
+ i++;
+ }
+ node.removeMarkerAtLevel(marker, i);
+ node = node.next[i];
+ }
+ _results = [];
+ while (node !== endNode) {
+ while (i > 0 && this.compare(node.next[i].index, endIndex) > 0) {
+ i--;
+ }
+ node.removeMarkerAtLevel(marker, i);
+ _results.push(node = node.next[i]);
+ }
+ return _results;
+ };
+
+ IntervalSkipList.prototype.removeMarkerOnPath = function(marker, startNode, endNode, level) {
+ var node, _results;
+ node = startNode;
+ _results = [];
+ while (node !== endNode) {
+ node.removeMarkerAtLevel(marker, level);
+ _results.push(node = node.next[level]);
+ }
+ return _results;
+ };
+
+ IntervalSkipList.prototype.placeMarkerOnPath = function(marker, startNode, endNode, level) {
+ var node, _results;
+ node = startNode;
+ _results = [];
+ while (node !== endNode) {
+ node.addMarkerAtLevel(marker, level);
+ _results.push(node = node.next[level]);
+ }
+ return _results;
+ };
+
+ IntervalSkipList.prototype.buildUpdateArray = function() {
+ var i, path, _i, _ref1;
+ path = new Array(this.maxHeight);
+ for (i = _i = 0, _ref1 = this.maxHeight; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ path[i] = this.head;
+ }
+ return path;
+ };
+
+ IntervalSkipList.prototype.findClosestNode = function(index, update) {
+ var currentNode, i, _i, _ref1;
+ currentNode = this.head;
+ for (i = _i = _ref1 = this.maxHeight - 1; _ref1 <= 0 ? _i <= 0 : _i >= 0; i = _ref1 <= 0 ? ++_i : --_i) {
+ while (this.compare(currentNode.next[i].index, index) < 0) {
+ currentNode = currentNode.next[i];
+ }
+ if (update != null) {
+ update[i] = currentNode;
+ }
+ }
+ return currentNode.next[0];
+ };
+
+ IntervalSkipList.prototype.sortIndices = function(indices) {
+ var _this = this;
+ return clone(indices).sort(function(a, b) {
+ return _this.compare(a, b);
+ });
+ };
+
+ IntervalSkipList.prototype.getRandomNodeHeight = function() {
+ var height;
+ height = 1;
+ while (height < this.maxHeight && Math.random() < this.probability) {
+ height++;
+ }
+ return height;
+ };
+
+ IntervalSkipList.prototype.verifyMarkerInvariant = function() {
+ var endIndex, marker, node, startIndex, _ref1, _ref2, _results;
+ _ref1 = this.intervalsByMarker;
+ _results = [];
+ for (marker in _ref1) {
+ _ref2 = _ref1[marker], startIndex = _ref2[0], endIndex = _ref2[1];
+ node = this.findClosestNode(startIndex);
+ if (this.compare(node.index, startIndex) !== 0) {
+ throw new Error("Could not find node for marker " + marker + " with start index " + startIndex);
+ }
+ _results.push(node.verifyMarkerInvariant(marker, endIndex, this.compare));
+ }
+ return _results;
+ };
+
+ return IntervalSkipList;
+
+ })();
+
+ Node = (function() {
+ function Node(height, index) {
+ var i, _i, _ref1;
+ this.height = height;
+ this.index = index;
+ this.next = new Array(this.height);
+ this.markers = new Array(this.height);
+ for (i = _i = 0, _ref1 = this.height; 0 <= _ref1 ? _i < _ref1 : _i > _ref1; i = 0 <= _ref1 ? ++_i : --_i) {
+ this.markers[i] = [];
+ }
+ this.endpointMarkers = [];
+ this.startingMarkers = [];
+ this.endingMarkers = [];
+ }
+
+ Node.prototype.addStartingMarker = function(marker) {
+ this.startingMarkers.push(marker);
+ return this.endpointMarkers.push(marker);
+ };
+
+ Node.prototype.removeStartingMarker = function(marker) {
+ remove(this.startingMarkers, marker);
+ return remove(this.endpointMarkers, marker);
+ };
+
+ Node.prototype.addEndingMarker = function(marker) {
+ this.endingMarkers.push(marker);
+ return this.endpointMarkers.push(marker);
+ };
+
+ Node.prototype.removeEndingMarker = function(marker) {
+ remove(this.endingMarkers, marker);
+ return remove(this.endpointMarkers, marker);
+ };
+
+ Node.prototype.removeMarkerAtLevel = function(marker, level) {
+ return remove(this.markers[level], marker);
+ };
+
+ Node.prototype.addMarkerAtLevel = function(marker, level) {
+ return this.markers[level].push(marker);
+ };
+
+ Node.prototype.addMarkersAtLevel = function(markers, level) {
+ var marker, _i, _len, _results;
+ _results = [];
+ for (_i = 0, _len = markers.length; _i < _len; _i++) {
+ marker = markers[_i];
+ _results.push(this.addMarkerAtLevel(marker, level));
+ }
+ return _results;
+ };
+
+ Node.prototype.markersAboveLevel = function(level) {
+ return flatten(this.markers.slice(level, this.height));
+ };
+
+ Node.prototype.verifyMarkerInvariant = function(marker, endIndex, compare) {
+ var i, nextIndex, _i, _ref1;
+ if (compare(this.index, endIndex) === 0) {
+ return;
+ }
+ for (i = _i = _ref1 = this.height - 1; _ref1 <= 0 ? _i <= 0 : _i >= 0; i = _ref1 <= 0 ? ++_i : --_i) {
+ nextIndex = this.next[i].index;
+ if (compare(nextIndex, endIndex) <= 0) {
+ if (!include(this.markers[i], marker)) {
+ throw new Error("Node at " + this.index + " should have marker " + marker + " at level " + i + " pointer to node at " + nextIndex + " <= " + endIndex);
+ }
+ if (i > 0) {
+ this.verifyNotMarkedBelowLevel(marker, i, nextIndex, compare);
+ }
+ this.next[i].verifyMarkerInvariant(marker, endIndex, compare);
+ return;
+ }
+ }
+ throw new Error("Node at " + this.index + " should have marker " + marker + " on some forward pointer to an index <= " + endIndex + ", but it doesn't");
+ };
+
+ Node.prototype.verifyNotMarkedBelowLevel = function(marker, level, untilIndex, compare) {
+ var i, _i, _ref1;
+ for (i = _i = _ref1 = level - 1; _ref1 <= 0 ? _i <= 0 : _i >= 0; i = _ref1 <= 0 ? ++_i : --_i) {
+ if (include(this.markers[i], marker)) {
+ throw new Error("Node at " + this.index + " should not have marker " + marker + " at level " + i + " pointer to node at " + this.next[i].index);
+ }
+ }
+ if (compare(this.next[0].index, untilIndex) < 0) {
+ return this.next[0].verifyNotMarkedBelowLevel(marker, level, untilIndex, compare);
+ }
+ };
+
+ return Node;
+
+ })();
+
+}).call(this);
diff --git a/node_modules/basarat-text-buffer/node_modules/interval-skip-list/package.json b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/package.json
new file mode 100644
index 000000000..c9c573182
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/interval-skip-list/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "interval-skip-list",
+ "version": "2.0.1",
+ "description": "A data structure for finding all intervals that overlap a point in O(ln n)",
+ "main": "lib/interval-skip-list.js",
+ "scripts": {
+ "prepublish": "grunt clean lint coffee",
+ "test": "grunt test"
+ },
+ "repository": {
+ "type": "git",
+ "url": "http://github.com/atom/interval-skip-list.git"
+ },
+ "bugs": {
+ "url": "https://github.com/atom/interval-skip-list/issues"
+ },
+ "homepage": "http://atom.github.io/interval-skip-list",
+ "keywords": [
+ "data-structures",
+ "collections",
+ "intervals"
+ ],
+ "author": {
+ "name": "Nathan Sobo"
+ },
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "http://github.com/atom/interval-skip-list/raw/master/LICENSE.md"
+ }
+ ],
+ "dependencies": {
+ "underscore-plus": "^1.6.6"
+ },
+ "devDependencies": {
+ "coffee-script": "~1.6.3",
+ "jasmine-focused": "~0.12.0",
+ "grunt-contrib-coffee": "~0.7.0",
+ "grunt-cli": "~0.1.8",
+ "grunt": "~0.4.1",
+ "grunt-shell": "~0.2.2",
+ "grunt-coffeelint": "0.0.6",
+ "rimraf": "~2.2.2"
+ },
+ "readme": "# Interval Skip List [](https://travis-ci.org/atom/interval-skip-list)\n\nThis data structure maps intervals to values and allows you to find all\nintervals that contain an index in `O(ln(n))`, where `n` is the number of\nintervals stored. This implementation is based on the paper\n[The Interval Skip List](https://www.cise.ufl.edu/tr/DOC/REP-1992-45.pdf) by\nEric N. Hanson.\n\n## Basic Usage Example\n\n```coffee\nIntervalSkipList = require 'interval-skip-list'\nlist = new IntervalSkipList\n\nlist.insert('a', 2, 7)\nlist.insert('b', 1, 5)\nlist.insert('c', 8, 8)\n\nlist.findContaining(1) # => ['b']\nlist.findContaining(2) # => ['b', 'a']\nlist.findContaining(8) # => ['c']\n\nlist.remove('b')\n\nlist.findContaining(2) # => ['a']\n```\n\n## API\n\n* `::insert(label, startIndex, endIndex)`\n Adds an interval with the given unique label to the list.\n\n* `::remove(label)`\n Removes the interval with the given unique label from the list.\n\n* `::update(label, startIndex, endIndex)`\n Inserts or updates the interval corresponding to the given unique label.\n Unlike `::insert`, this method allows you to specify a label that's already\n been inserted in the list.\n\n* `::findContaining(indices...)`\n Returns the labels of all intervals containing the given indices.\n\n* `::findIntersecting(indices...)`\n Returns the labels of all intervals intersecting the given set of indices.\n Unlike `::findContaining`, this method does not require that the intervals\n contain *all* the given indices.\n\n* `::findStartingAt(index)`\n Returns the labels of all intervals starting at the given index.\n\n* `::findEndingAt(index)`\n Returns the labels of all intervals ending at the given index.\n\n* `::findStartingIn(startIndex, endIndex)`\n Returns the labels of all intervals starting within the interval described by\n the given start and end indices.\n\n* `::findEndingIn(startIndex, endIndex)`\n Returns the labels of all intervals ending within the interval described by\n the given start and end indices.\n\n## Using a Custom Comparator\n\nYou can also supply a custom comparator function with corresponding min and max\nindex values. The following example uses arrays expressing coordinate pairs\ninstead of the default numeric values:\n\n```coffee\nlist = new IntervalSkipList\n minIndex: [-Infinity, -Infinity]\n maxIndex: [Infinity, Infinity]\n compare: (a, b) ->\n if a[0] < b[0]\n -1\n else if a[0] > b[0]\n 1\n else\n if a[1] < b[1]\n -1\n else if a[1] > b[1]\n 1\n else\n 0\n\n list.insert(\"a\", [1, 2], [3, 4])\n list.insert(\"b\", [2, 1], [3, 10])\n list.findContaining([1, Infinity]) # => [\"a\"]\n list.findContaining([2, 20]) # => [\"a\", \"b\"]\n```\n",
+ "readmeFilename": "README.md",
+ "_id": "interval-skip-list@2.0.1",
+ "_from": "interval-skip-list@^2.0.1"
+}
diff --git a/node_modules/basarat-text-buffer/node_modules/q/LICENSE b/node_modules/basarat-text-buffer/node_modules/q/LICENSE
new file mode 100644
index 000000000..8a706b59c
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/q/LICENSE
@@ -0,0 +1,18 @@
+Copyright 2009–2014 Kristopher Michael Kowal. All rights reserved.
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to
+deal in the Software without restriction, including without limitation the
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+sell copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+IN THE SOFTWARE.
diff --git a/node_modules/basarat-text-buffer/node_modules/q/README.md b/node_modules/basarat-text-buffer/node_modules/q/README.md
new file mode 100644
index 000000000..9065bfa7f
--- /dev/null
+++ b/node_modules/basarat-text-buffer/node_modules/q/README.md
@@ -0,0 +1,881 @@
+[](http://travis-ci.org/kriskowal/q)
+
+
+
+
+
+*This is Q version 1, from the `v1` branch in Git. This documentation applies to
+the latest of both the version 1 and version 0.9 release trains. These releases
+are stable. There will be no further releases of 0.9 after 0.9.7 which is nearly
+equivalent to version 1.0.0. All further releases of `q@~1.0` will be backward
+compatible. The version 2 release train introduces significant and
+backward-incompatible changes and is experimental at this time.*
+
+If a function cannot return a value or throw an exception without
+blocking, it can return a promise instead. A promise is an object
+that represents the return value or the thrown exception that the
+function may eventually provide. A promise can also be used as a
+proxy for a [remote object][Q-Connection] to overcome latency.
+
+[Q-Connection]: https://github.com/kriskowal/q-connection
+
+On the first pass, promises can mitigate the “[Pyramid of
+Doom][POD]”: the situation where code marches to the right faster
+than it marches forward.
+
+[POD]: http://calculist.org/blog/2011/12/14/why-coroutines-wont-work-on-the-web/
+
+```javascript
+step1(function (value1) {
+ step2(value1, function(value2) {
+ step3(value2, function(value3) {
+ step4(value3, function(value4) {
+ // Do something with value4
+ });
+ });
+ });
+});
+```
+
+With a promise library, you can flatten the pyramid.
+
+```javascript
+Q.fcall(promisedStep1)
+.then(promisedStep2)
+.then(promisedStep3)
+.then(promisedStep4)
+.then(function (value4) {
+ // Do something with value4
+})
+.catch(function (error) {
+ // Handle any error from all above steps
+})
+.done();
+```
+
+With this approach, you also get implicit error propagation, just like `try`,
+`catch`, and `finally`. An error in `promisedStep1` will flow all the way to
+the `catch` function, where it’s caught and handled. (Here `promisedStepN` is
+a version of `stepN` that returns a promise.)
+
+The callback approach is called an “inversion of control”.
+A function that accepts a callback instead of a return value
+is saying, “Don’t call me, I’ll call you.”. Promises
+[un-invert][IOC] the inversion, cleanly separating the input
+arguments from control flow arguments. This simplifies the
+use and creation of API’s, particularly variadic,
+rest and spread arguments.
+
+[IOC]: http://www.slideshare.net/domenicdenicola/callbacks-promises-and-coroutines-oh-my-the-evolution-of-asynchronicity-in-javascript
+
+
+## Getting Started
+
+The Q module can be loaded as:
+
+- A ``