1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

removing some extra parens.

This commit is contained in:
Jeremy Ashkenas 2010-11-21 19:59:22 -05:00
parent 1778177195
commit 5dfd36af6a
5 changed files with 22 additions and 22 deletions

View file

@ -206,7 +206,7 @@
};
printTokens = function(tokens) {
var strings, tag, token, value, _i, _len, _ref, _results;
strings = (function() {
strings = function() {
_results = [];
for (_i = 0, _len = tokens.length; _i < _len; _i++) {
token = tokens[_i];
@ -214,7 +214,7 @@
_results.push("[" + tag + " " + value + "]");
}
return _results;
})();
}();
return console.log(strings.join(' '));
};
parseOptions = function() {

View file

@ -560,7 +560,7 @@
tokens = [];
for (name in grammar) {
alternatives = grammar[name];
grammar[name] = (function() {
grammar[name] = function() {
_results = [];
for (_i = 0, _len = alternatives.length; _i < _len; _i++) {
alt = alternatives[_i];
@ -577,7 +577,7 @@
_results.push(alt);
}
return _results;
})();
}();
}
exports.parser = new Parser({
tokens: tokens.join(' '),

View file

@ -77,7 +77,7 @@
if (COFFEE_ALIASES.hasOwnProperty(id)) {
id = COFFEE_ALIASES[id];
}
tag = (function() {
tag = function() {
switch (id) {
case '!':
return 'UNARY';
@ -99,7 +99,7 @@
default:
return tag;
}
})();
}();
}
this.token(tag, id);
if (colon) {

View file

@ -590,7 +590,7 @@
if (code = Splat.compileSplattedArray(o, this.args, true)) {
return this.compileSplat(o, code);
}
args = ((function() {
args = (function() {
_ref2 = this.args;
_results = [];
for (_i = 0, _len = _ref2.length; _i < _len; _i++) {
@ -598,7 +598,7 @@
_results.push(arg.compile(o, LEVEL_LIST));
}
return _results;
}).call(this)).join(', ');
}.call(this)).join(', ');
if (this.isSuper) {
return this.compileSuper(args, o);
} else {
@ -803,7 +803,7 @@
}
}
idt = o.indent += TAB;
nonComments = ((function() {
nonComments = (function() {
_ref = this.properties;
_results = [];
for (_i = 0, _len2 = _ref.length; _i < _len2; _i++) {
@ -813,9 +813,9 @@
}
}
return _results;
}).call(this));
}.call(this));
lastNoncom = last(nonComments);
props = (function() {
props = function() {
_results2 = [];
for (i = 0, _len3 = props.length; i < _len3; i++) {
prop = props[i];
@ -829,7 +829,7 @@
_results2.push(indent + prop.compile(o, LEVEL_TOP) + join);
}
return _results2;
})();
}();
props = props.join('');
obj = "{" + (props && '\n' + props + '\n' + this.tab) + "}";
if (rest) {
@ -899,7 +899,7 @@
if (code = Splat.compileSplattedArray(o, this.objects)) {
return code;
}
code = ((function() {
code = (function() {
_ref = this.objects;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
@ -907,7 +907,7 @@
_results.push(obj.compile(o, LEVEL_LIST));
}
return _results;
}).call(this)).join(', ');
}.call(this)).join(', ');
if (code.indexOf('\n') >= 0) {
return "[\n" + o.indent + code + "\n" + this.tab + "]";
} else {
@ -1233,7 +1233,7 @@
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
param = _ref[_i];
if (param.splat) {
splats = new Assign(new Value(new Arr((function() {
splats = new Assign(new Value(new Arr(function() {
_ref2 = this.params;
_results = [];
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
@ -1241,7 +1241,7 @@
_results.push(p.asReference(o));
}
return _results;
}).call(this))), new Value(new Literal('arguments')));
}.call(this))), new Value(new Literal('arguments')));
break;
}
}
@ -1390,7 +1390,7 @@
if (index === 0) {
return args[0] + (".concat(" + (args.slice(1).join(', ')) + ")");
}
base = ((function() {
base = (function() {
_ref = list.slice(0, index);
_results = [];
for (_i = 0, _len2 = _ref.length; _i < _len2; _i++) {
@ -1398,7 +1398,7 @@
_results.push(node.compile(o, LEVEL_LIST));
}
return _results;
})());
}());
return "[" + (base.join(', ')) + "].concat(" + (args.join(', ')) + ")";
};
return Splat;
@ -1604,7 +1604,7 @@
var cmp, cnj, i, item, ref, sub, tests, _len, _ref, _ref2, _ref3, _results;
_ref = this.object.cache(o, LEVEL_OP), sub = _ref[0], ref = _ref[1];
_ref2 = this.negated ? [' !== ', ' && '] : [' === ', ' || '], cmp = _ref2[0], cnj = _ref2[1];
tests = (function() {
tests = function() {
_ref3 = this.array.base.objects;
_results = [];
for (i = 0, _len = _ref3.length; i < _len; i++) {
@ -1612,7 +1612,7 @@
_results.push((i ? ref : sub) + cmp + item.compile(o, LEVEL_OP));
}
return _results;
}).call(this);
}.call(this);
tests = tests.join(cnj);
if (o.level < LEVEL_OP) {
return tests;
@ -2038,7 +2038,7 @@
if (expressions.containsPureStatement()) {
return expressions;
}
func = new Parens(new Code([], Expressions.wrap([expressions])));
func = new Code([], Expressions.wrap([expressions]));
args = [];
if ((mentionsArgs = expressions.contains(this.literalArgs)) || (expressions.contains(this.literalThis))) {
meth = new Literal(mentionsArgs ? 'apply' : 'call');

View file

@ -1626,7 +1626,7 @@ Closure =
# then make sure that the closure wrapper preserves the original values.
wrap: (expressions, statement, noReturn) ->
return expressions if expressions.containsPureStatement()
func = new Parens new Code [], Expressions.wrap [expressions]
func = new Code [], Expressions.wrap [expressions]
args = []
if (mentionsArgs = expressions.contains @literalArgs) or
( expressions.contains @literalThis)