From 835ecac8dbf686f0898b0290233aa658cbefcd79 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sun, 11 Apr 2010 16:57:53 -0400 Subject: [PATCH] simplifying some unecessary interpolated expressions into interpolated values. --- lib/cake.js | 2 +- lib/coffee-script.js | 2 +- lib/command.js | 2 +- lib/optparse.js | 2 +- lib/scope.js | 2 +- src/cake.coffee | 2 +- src/coffee-script.coffee | 2 +- src/command.coffee | 2 +- src/optparse.coffee | 2 +- src/scope.coffee | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/cake.js b/lib/cake.js index 30bd1e0d..635f28ab 100755 --- a/lib/cake.js +++ b/lib/cake.js @@ -91,7 +91,7 @@ } return _b; })().join('') : ''; - desc = task.description ? ("# " + (task.description)) : ''; + desc = task.description ? ("# " + task.description) : ''; puts(("cake " + name + spaces + " " + desc)); }} if (switches.length) { diff --git a/lib/coffee-script.js b/lib/coffee-script.js index 253c3833..931386a2 100644 --- a/lib/coffee-script.js +++ b/lib/coffee-script.js @@ -34,7 +34,7 @@ return (parser.parse(lexer.tokenize(code))).compile(options); } catch (err) { if (options.source) { - err.message = ("In " + (options.source) + ", " + (err.message)); + err.message = ("In " + options.source + ", " + err.message); } throw err; } diff --git a/lib/command.js b/lib/command.js index 7efec3a1..857f9f93 100644 --- a/lib/command.js +++ b/lib/command.js @@ -226,7 +226,7 @@ }; // Print the `--version` message and exit. version = function version() { - puts(("CoffeeScript version " + (CoffeeScript.VERSION))); + puts(("CoffeeScript version " + CoffeeScript.VERSION)); return process.exit(0); }; })(); diff --git a/lib/optparse.js b/lib/optparse.js index 3b263f1f..db54d3e6 100755 --- a/lib/optparse.js +++ b/lib/optparse.js @@ -65,7 +65,7 @@ return _d; })().join('') : ''; let_part = rule.short_flag ? rule.short_flag + ', ' : ' '; - lines.push((" " + let_part + (rule.long_flag) + spaces + (rule.description))); + lines.push((" " + let_part + rule.long_flag + spaces + rule.description)); } return "\n" + (lines.join('\n')) + "\n"; }; diff --git a/lib/scope.js b/lib/scope.js index f95bb335..843ea720 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -120,7 +120,7 @@ _a = []; _b = this.variables; for (key in _b) { if (__hasProp.call(_b, key)) { val = _b[key]; - val.assigned ? _a.push(("" + key + " = " + (val.value))) : null; + val.assigned ? _a.push(("" + key + " = " + val.value)) : null; }} return _a; }; diff --git a/src/cake.coffee b/src/cake.coffee index 65f3b70c..47884994 100644 --- a/src/cake.coffee +++ b/src/cake.coffee @@ -60,7 +60,7 @@ print_tasks: -> for name, task of tasks spaces: 20 - name.length spaces: if spaces > 0 then (' ' for i in [0..spaces]).join('') else '' - desc: if task.description then "# ${task.description}" else '' + desc: if task.description then "# $task.description" else '' puts "cake $name$spaces $desc" puts oparse.help() if switches.length diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index 7c4e4f52..b591ca5f 100644 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -34,7 +34,7 @@ exports.compile: compile: (code, options) -> try (parser.parse lexer.tokenize code).compile options catch err - err.message: "In ${options.source}, ${err.message}" if options.source + err.message: "In $options.source, $err.message" if options.source throw err # Tokenize a string of CoffeeScript code, and return the array of tokens. diff --git a/src/command.coffee b/src/command.coffee index ded44912..3e95c698 100644 --- a/src/command.coffee +++ b/src/command.coffee @@ -159,5 +159,5 @@ usage: -> # Print the `--version` message and exit. version: -> - puts "CoffeeScript version ${CoffeeScript.VERSION}" + puts "CoffeeScript version $CoffeeScript.VERSION" process.exit 0 diff --git a/src/optparse.coffee b/src/optparse.coffee index a740a640..2f177c5f 100644 --- a/src/optparse.coffee +++ b/src/optparse.coffee @@ -43,7 +43,7 @@ exports.OptionParser: class OptionParser spaces: 15 - rule.long_flag.length spaces: if spaces > 0 then (' ' for i in [0..spaces]).join('') else '' let_part: if rule.short_flag then rule.short_flag + ', ' else ' ' - lines.push " $let_part${rule.long_flag}$spaces${rule.description}" + lines.push " $let_part$rule.long_flag$spaces$rule.description" "\n${ lines.join('\n') }\n" # Helpers diff --git a/src/scope.coffee b/src/scope.coffee index 42a3abfb..ec96ac5c 100644 --- a/src/scope.coffee +++ b/src/scope.coffee @@ -80,7 +80,7 @@ exports.Scope: class Scope # Return the list of assignments that are supposed to be made at the top # of this scope. assigned_variables: -> - "$key = ${val.value}" for key, val of @variables when val.assigned + "$key = $val.value" for key, val of @variables when val.assigned # Compile the JavaScript for all of the variable declarations in this scope. compiled_declarations: ->