Parse JavaScript to instrument code

前端 未结 5 1413
醉酒成梦
醉酒成梦 2021-02-09 05:56

I need to split a JavaScript file into single instructions. For example

a = 2;
foo()
function bar() {
    b = 5;
    print(\"spam\");
}

has to

5条回答
  •  野性不改
    2021-02-09 06:47

    Forget my parser. https://bitbucket.org/mvantellingen/pyjsparser is great and complete parser. I've fixed a couple of it's bugs here: https://bitbucket.org/nullie/pyjsparser

提交回复
热议问题