From 48c501a7a28b9da3681151fd30eb139ea475f853 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Mon, 15 Feb 2010 20:46:36 -0500 Subject: [PATCH] print_tokens should acutally, y'know, print --- lib/coffee_script/coffee-script.js | 2 +- lib/coffee_script/command_line.js | 2 +- src/coffee-script.coffee | 2 +- src/command_line.coffee | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/coffee_script/coffee-script.js b/lib/coffee_script/coffee-script.js index dfa1ef89..f307fe00 100644 --- a/lib/coffee_script/coffee-script.js +++ b/lib/coffee_script/coffee-script.js @@ -59,7 +59,7 @@ } return __a; }).call(this); - return strings.join(' '); + return puts(strings.join(' ')); }; //---------- Below this line is obsolete, for the Ruby compiler. ---------------- // The path to the CoffeeScript executable. diff --git a/lib/coffee_script/command_line.js b/lib/coffee_script/command_line.js index 9c3a47e1..786b5471 100644 --- a/lib/coffee_script/command_line.js +++ b/lib/coffee_script/command_line.js @@ -69,7 +69,7 @@ return fs.cat(source).addCallback(function(code) { var js; if (opts.tokens) { - puts(coffee.print_tokens(coffee.tokenize(code))); + coffee.print_tokens(coffee.tokenize(code)); } else if (opts.tree) { puts(coffee.tree(code).toString()); } else { diff --git a/src/coffee-script.coffee b/src/coffee-script.coffee index 5297b11c..ee837f7d 100644 --- a/src/coffee-script.coffee +++ b/src/coffee-script.coffee @@ -46,7 +46,7 @@ exports.tree: (code) -> exports.print_tokens: (tokens) -> strings: for token in tokens '[' + token[0] + ' ' + token[1].toString().replace(/\n/, '\\n') + ']' - strings.join(' ') + puts strings.join(' ') #---------- Below this line is obsolete, for the Ruby compiler. ---------------- diff --git a/src/command_line.coffee b/src/command_line.coffee index a0c7f022..cba87fec 100644 --- a/src/command_line.coffee +++ b/src/command_line.coffee @@ -68,7 +68,7 @@ compile_scripts: -> return unless source: sources.shift() opts: options fs.cat(source).addCallback (code) -> - if opts.tokens then puts coffee.print_tokens coffee.tokenize code + if opts.tokens then coffee.print_tokens coffee.tokenize code else if opts.tree then puts coffee.tree(code).toString() else js: coffee.compile code