I need to split a JavaScript file into single instructions. For example
a = 2; foo() function bar() { b = 5; print(\"spam\"); }
has to
Why not try a javascript beautifier?
For example http://jsbeautifier.org/
Or see Command line JavaScript code beautifier that works on Windows and Linux