mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-02-17 11:01:25 -05:00
subtle bug in the order of the rewriter rules was causing some if/else chains to get confused by implicit indentation
This commit is contained in:
@@ -56,9 +56,19 @@
|
||||
var js;
|
||||
if (opts.tokens) {
|
||||
puts(coffee.tokenize(code).join(' '));
|
||||
} else if (opts.tree) {
|
||||
puts(coffee.tree(code).toString());
|
||||
} else {
|
||||
opts.tree ? puts(coffee.tree(code).toString()) : (js = coffee.compile(code));
|
||||
opts.run ? eval(js) : opts.print ? puts(js) : opts.lint ? exports.lint(js) : exports.write_js(source, coffee.compile(code));
|
||||
js = coffee.compile(code);
|
||||
if (opts.run) {
|
||||
eval(js);
|
||||
} else if (opts.print) {
|
||||
puts(js);
|
||||
} else if (opts.lint) {
|
||||
exports.lint(js);
|
||||
} else {
|
||||
exports.write_js(source, coffee.compile(code));
|
||||
}
|
||||
}
|
||||
return exports.compile_scripts();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user