(function() {
var Language, _, _ref, _ref1, _ref2;
_ = (_ref = (_ref1 = (_ref2 = typeof window !== "undefined" && window !== null ? window._ : void 0) != null ? _ref2 : typeof self !== "undefined" && self !== null ? self._ : void 0) != null ? _ref1 : typeof global !== "undefined" && global !== null ? global._ : void 0) != null ? _ref : require('lodash');
module.exports = Language = (function() {
Language.prototype.name = 'Abstract Language';
Language.prototype.id = 'abstract-language';
Language.prototype.parserID = 'abstract-parser';
Language.prototype.runtimeGlobals = {};
Language.prototype.thisValue = 'this';
Language.prototype.thisValueAccess = 'this.';
Language.prototype.wrappedCodeIndentLen = 0;
function Language() {}
Language.prototype.obviouslyCannotTranspile = function(rawCode) {
return false;
};
Language.prototype.hasChangedASTs = function(a, b) {
return true;
};
Language.prototype.hasChangedLineNumbers = function(a, b) {
if (!String.prototype.trimRight) {
String.prototype.trimRight = function() {
return String(this).replace(/\s\s*$/, '');
};
}
a = a.replace(/^[ \t]+\/\/.*/g, '').trimRight();
b = b.replace(/^[ \t]+\/\/.*/g, '').trimRight();
return a.split('\n').length !== b.split('\n').length;
};
Language.prototype.replaceLoops = function(rawCode) {
console.warn("Simple loop not implemented for " + this.name);
return [rawCode, []];
};
Language.prototype.lint = function(rawCode, aether) {
return [];
};
Language.prototype.beautify = function(rawCode, aether) {
return rawCode;
};
Language.prototype.wrap = function(rawCode, aether) {
if (this.wrappedCodePrefix == null) {
this.wrappedCodePrefix = '';
}
if (this.wrappedCodeSuffix == null) {
this.wrappedCodeSuffix = '';
}
return this.wrappedCodePrefix + rawCode + this.wrappedCodeSuffix;
};
Language.prototype.removeWrappedIndent = function(range) {
return range;
};
Language.prototype.hackCommonMistakes = function(rawCode, aether) {
return rawCode;
};
Language.prototype.parse = function(code, aether) {
throw new Error("parse() not implemented for " + this.id + ".");
};
Language.prototype.convertToNativeType = function(obj) {
return obj;
};
Language.prototype.cloneObj = function(obj, cloneFn) {
var k, result, v;
if (cloneFn == null) {
cloneFn = function(o) {
return o;
};
}
if (_.isArray(obj)) {
result = (function() {
var _i, _len, _results;
_results = [];
for (_i = 0, _len = obj.length; _i < _len; _i++) {
v = obj[_i];
_results.push(cloneFn(v));
}
return _results;
})();
} else if (_.isObject(obj)) {
result = {};
for (k in obj) {
v = obj[k];
result[k] = cloneFn(v);
}
} else {
result = cloneFn(obj);
}
return result;
};
Language.prototype.pryOpenCall = function(call, val, finder) {
return null;
};
Language.prototype.rewriteFunctionID = function(fid) {
return fid;
};
return Language;
})();
}).call(this);
|