From 5dfd36af6acaf1e526d6cee44ec2efe74d867156 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sun, 21 Nov 2010 19:59:22 -0500 Subject: [PATCH] removing some extra parens. --- lib/command.js | 4 ++-- lib/grammar.js | 4 ++-- lib/lexer.js | 4 ++-- lib/nodes.js | 30 +++++++++++++++--------------- src/nodes.coffee | 2 +- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/command.js b/lib/command.js index 19ec9338..10d6d47c 100644 --- a/lib/command.js +++ b/lib/command.js @@ -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() { diff --git a/lib/grammar.js b/lib/grammar.js index 80169b33..a2f670a7 100644 --- a/lib/grammar.js +++ b/lib/grammar.js @@ -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(' '), diff --git a/lib/lexer.js b/lib/lexer.js index fb5c924c..86ae3a37 100644 --- a/lib/lexer.js +++ b/lib/lexer.js @@ -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) { diff --git a/lib/nodes.js b/lib/nodes.js index edb18536..b73b9bfb 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -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'); diff --git a/src/nodes.coffee b/src/nodes.coffee index e661150e..e31b6b6c 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -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)