done for now

This commit is contained in:
Jeremy Ashkenas
2010-02-11 02:39:57 -05:00
parent 872b36c11d
commit 713f6f32e1
7 changed files with 59 additions and 96 deletions

View File

@@ -47,26 +47,25 @@
// Compiles the source CoffeeScript, returning the desired JavaScript, tokens,
// or JSLint results.
exports.compile_scripts = function compile_scripts() {
var source;
var opts, source;
if (!((source = this.sources.shift()))) {
return null;
}
return posix.cat(source).addCallback((function(__this) {
var __func = function(code) {
var js;
js = coffee.compile(code);
if (this.options.run) {
return eval(js);
}
if (this.options.print) {
return puts(js);
}
return exports.compile_scripts();
};
return (function() {
return __func.apply(__this, arguments);
});
})(this));
opts = this.options;
return posix.cat(source).addCallback(function(code) {
var js;
if (opts.tokens) {
return puts(coffee.tokenize(code).join(' '));
}
js = coffee.compile(code);
if (opts.run) {
return eval(js);
}
if (opts.print) {
return puts(js);
}
return exports.compile_scripts();
});
};
// Use OptionParser for all the options.
exports.parse_options = function parse_options() {