AST in JSON format

37 views
Skip to first unread message

Paul Sery

unread,
Dec 9, 2024, 5:09:46 PM12/9/24
to v8-users
d8 --print-ast produces AST in tree format. Is there a way to get it as JSON either natively or with an external tool? 

Leszek Swirski

unread,
Dec 10, 2024, 10:39:17 AM12/10/24
to v8-users
No, the AST printing is intended to be debug printing for V8 developers and doesn't have any stability guarantees on the format or functionality. You may want to use a JS-native JS parser, e.g. acorn (https://github.com/acornjs/acorn).

- Leszek

Paul Sery

unread,
Dec 19, 2024, 10:03:36 PM12/19/24
to v8-users
Thank you.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages