mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
removing holmsand's cleanup
This commit is contained in:
commit
5e5c9df5c4
5 changed files with 10 additions and 16 deletions
|
@ -78,15 +78,15 @@
|
|||
};
|
||||
// Display the list of Cake tasks in a format similar to `rake -T`
|
||||
print_tasks = function print_tasks() {
|
||||
var _a, _b, _c, _d, _e, desc, i, name, spaces, task;
|
||||
var _a, _b, _c, _d, desc, i, name, spaces, task;
|
||||
puts('');
|
||||
_a = tasks;
|
||||
for (name in _a) { if (__hasProp.call(_a, name)) {
|
||||
task = _a[name];
|
||||
spaces = 20 - name.length;
|
||||
spaces = spaces > 0 ? (function() {
|
||||
_b = []; _d = 0; _e = spaces;
|
||||
for (_c = 0, i = _d; (_d <= _e ? i <= _e : i >= _e); (_d <= _e ? i += 1 : i -= 1), _c++) {
|
||||
_b = []; _c = 0; _d = spaces;
|
||||
for (i = _c; (_c <= _d ? i <= _d : i >= _d); (_c <= _d ? i += 1 : i -= 1)) {
|
||||
_b.push(' ');
|
||||
}
|
||||
return _b;
|
||||
|
|
|
@ -1498,7 +1498,7 @@
|
|||
// comprehensions. Some of the generated code can be shared in common, and
|
||||
// some cannot.
|
||||
ForNode.prototype.compile_node = function compile_node(o) {
|
||||
var body, body_dent, close, for_part, index, index_var, ivar, lvar, name, range, return_result, rvar, scope, set_result, source, source_part, step_part, svar, top_level, var_part, vars;
|
||||
var body, body_dent, close, for_part, index, ivar, lvar, name, range, return_result, rvar, scope, set_result, source, source_part, step_part, svar, top_level, var_part, vars;
|
||||
top_level = del(o, 'top') && !this.returns;
|
||||
range = this.source instanceof ValueNode && this.source.base instanceof RangeNode && !this.source.properties.length;
|
||||
source = range ? this.source.base : this.source;
|
||||
|
@ -1519,16 +1519,13 @@
|
|||
var_part = '';
|
||||
body = Expressions.wrap([this.body]);
|
||||
if (range) {
|
||||
index_var = scope.free_variable();
|
||||
source_part = source.compile_variables(o);
|
||||
for_part = source.compile(merge(o, {
|
||||
index: ivar,
|
||||
step: this.step
|
||||
}));
|
||||
for_part = ("" + index_var + " = 0, " + for_part + ", " + index_var + "++");
|
||||
} else {
|
||||
svar = scope.free_variable();
|
||||
index_var = null;
|
||||
source_part = ("" + svar + " = " + (this.source.compile(o)) + ";\n" + this.tab);
|
||||
if (this.pattern) {
|
||||
var_part = new AssignNode(this.name, literal(("" + svar + "[" + ivar + "]"))).compile(merge(o, {
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
// Return the help text for this **OptionParser**, listing and describing all
|
||||
// of the valid options, for `--help` and such.
|
||||
OptionParser.prototype.help = function help() {
|
||||
var _a, _b, _c, _d, _e, _f, _g, i, let_part, lines, rule, spaces;
|
||||
var _a, _b, _c, _d, _e, _f, i, let_part, lines, rule, spaces;
|
||||
lines = ['Available options:'];
|
||||
if (this.banner) {
|
||||
lines.unshift(("" + this.banner + "\n"));
|
||||
|
@ -58,8 +58,8 @@
|
|||
rule = _b[_a];
|
||||
spaces = 15 - rule.long_flag.length;
|
||||
spaces = spaces > 0 ? (function() {
|
||||
_d = []; _f = 0; _g = spaces;
|
||||
for (_e = 0, i = _f; (_f <= _g ? i <= _g : i >= _g); (_f <= _g ? i += 1 : i -= 1), _e++) {
|
||||
_d = []; _e = 0; _f = spaces;
|
||||
for (i = _e; (_e <= _f ? i <= _f : i >= _f); (_e <= _f ? i += 1 : i -= 1)) {
|
||||
_d.push(' ');
|
||||
}
|
||||
return _d;
|
||||
|
|
|
@ -146,9 +146,9 @@
|
|||
var close_calls, stack;
|
||||
stack = [0];
|
||||
close_calls = __bind(function(i) {
|
||||
var _c, _d, _e, size, tmp;
|
||||
_d = 0; _e = stack[stack.length - 1];
|
||||
for (_c = 0, tmp = _d; (_d <= _e ? tmp < _e : tmp > _e); (_d <= _e ? tmp += 1 : tmp -= 1), _c++) {
|
||||
var _c, _d, size, tmp;
|
||||
_c = 0; _d = stack[stack.length - 1];
|
||||
for (tmp = _c; (_c <= _d ? tmp < _d : tmp > _d); (_c <= _d ? tmp += 1 : tmp -= 1)) {
|
||||
this.tokens.splice(i, 0, ['CALL_END', ')', this.tokens[i][2]]);
|
||||
}
|
||||
size = stack[stack.length - 1] + 1;
|
||||
|
|
|
@ -1118,13 +1118,10 @@ exports.ForNode: class ForNode extends BaseNode
|
|||
var_part: ''
|
||||
body: Expressions.wrap([@body])
|
||||
if range
|
||||
index_var: scope.free_variable()
|
||||
source_part: source.compile_variables o
|
||||
for_part: source.compile merge o, {index: ivar, step: @step}
|
||||
for_part: "$index_var = 0, $for_part, $index_var++"
|
||||
else
|
||||
svar: scope.free_variable()
|
||||
index_var: null
|
||||
source_part: "$svar = ${ @source.compile(o) };\n$@tab"
|
||||
if @pattern
|
||||
var_part: new AssignNode(@name, literal("$svar[$ivar]")).compile(merge o, {indent: @idt(1), top: true}) + "\n"
|
||||
|
|
Loading…
Add table
Reference in a new issue