print_tokens should acutally, y'know, print

This commit is contained in:
Jeremy Ashkenas
2010-02-15 20:46:36 -05:00
parent 63c2b2bc64
commit 48c501a7a2
4 changed files with 4 additions and 4 deletions

View File

@@ -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. ----------------

View File

@@ -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