jsxer icon indicating copy to clipboard operation
jsxer copied to clipboard

FeatureRequest: Dump the AST (with a cli flag)

Open psyirius opened this issue 2 years ago • 4 comments

var test = 5;
if (test > 5) {
        doSomething();
}

to

StatementList
    ExprNode
        AssignmentExpr
    IfStatement
        StatementList
            ExprNode
                FunctionCallExpr
                    IdNode
        BinaryExpr
            IdRefExpr

Feature Origin

psyirius avatar Aug 31 '22 16:08 psyirius

I think we should also add line numbering to this. That would be extremely helpful.

AngeloD2022 avatar Sep 01 '22 00:09 AngeloD2022

Generating an EcmaScript like ast (json) with ExtendScript nodes also useful to pass onto codegens like escodegen, astring (modified: with ExtendScript nodes) to generate logically correct code. Codegens do codegeneration the right way.

psyirius avatar Sep 01 '22 07:09 psyirius

@psyirius do you have an email I could contact you at?

AngeloD2022 avatar Sep 01 '22 17:09 AngeloD2022

Sent to your professional email addy.

psyirius avatar Sep 08 '22 13:09 psyirius