StringTemplate (from ANTLR) is pretty good for generating code, I would say, and it keeps track of the indentation and keeps the indentation of nested statements at the right level. Not a very beautiful print, but better than nothing. (At the same time, I wonder why you want pretty-typed JavaScript if in the end it will be reduced anyway.)
There is a Scala shell for StringTemplate (at least I seem to remember I saw more): http://software.clapper.org/scalasti/
The virtualized scala does not seem to be the one you need, I would say, since it starts with Scala a Scala AST, and it is not what you have.
However, if you are interested in such things, you can check out http://nescala.org/2013/talks#26 (Alvaro Carrasco) as well.
source share