@@ -51,6 +51,7 @@ SWITCHES = [
5151 [' -s' , ' --stdio' , ' listen for and compile scripts over stdio' ]
5252 [' -l' , ' --literate' , ' treat stdio as literate style coffee-script' ]
5353 [' -t' , ' --tokens' , ' print out the tokens that the lexer/rewriter produce' ]
54+ [' -u' , ' --uniced' , ' print out the uniced parse tree that the parser produces' ]
5455 [' -v' , ' --version' , ' display the version number' ]
5556 [' -w' , ' --watch' , ' watch scripts for changes and rerun commands' ]
5657 [' -I' , ' --runtime [WHICH]' , " how to include the iced runtime, one of #{ runtime_modes_str} ; default is 'node'" ]
@@ -168,8 +169,9 @@ compileScript = (file, input, base = null) ->
168169 CoffeeScript .emit ' compile' , task
169170 if o .tokens
170171 printTokens CoffeeScript .tokens t .input , t .options
171- else if o .nodes
172- printLine CoffeeScript .nodes (t .input , t .options ).toString ().trim ()
172+ else if o .nodes or o .uniced
173+ printLine CoffeeScript .nodes (
174+ t .input , t .options , o .uniced ).toString ().trim ()
173175 else if o .run
174176 CoffeeScript .register ()
175177 CoffeeScript .run t .input , t .options
@@ -403,6 +405,7 @@ compileOptions = (filename, base) ->
403405 sourceMap : opts .map
404406 runtime : opts .runtime
405407 runforce : opts .runforce
408+ uniced : opts .uniced
406409 }
407410 if filename
408411 if base
0 commit comments