Skip to content

Use case for "Why did you need an JS AST tree?" #2

Open
@ttback

Description

@ttback

The key is I'd need to reference back to Erlang's line and col or indexed [startOf, endOf] information and save it as part of the Mozilla AST data structure to be used in a thrid-party web application. Basically some kind of a source map between erlang to js generated.

It was originally why i was checking on the Luuvscript: http://luvv.ie/toolchain.html

Basically the scenario is that I need to be able to execute the code on the web and notify the user that at line 5 of Erlang code, they made an error. I wonder if there is any way you can preserve the range info. It would need to be a JS range: Erlang range map or just directly translating the Erlang AST to Mozilla JS AST before encoding it to JS.

An example of JS AST here: http://esprima.org/demo/parse.html#

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions