Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

feature request: output loc or range information #20

Open
ttback opened this issue May 20, 2014 · 3 comments
Open

feature request: output loc or range information #20

ttback opened this issue May 20, 2014 · 3 comments

Comments

@ttback
Copy link

ttback commented May 20, 2014

just bumped into the library. Thinking it's still missing the line:col info and range info like esprima does: http://esprima.org/demo/parse.html

Maybe it is good to add it down the road.

@nightwing
Copy link
Member

you can use node.getPos()

@ttback
Copy link
Author

ttback commented May 20, 2014

could you be more specific? do I have to change the parse.js?

@zefhemel
Copy link
Contributor

After you parse a file or string it will return an AST node (the root node of the program), that node (and any other node) has a getPos() method that gives you location information. If you use the JavaScript parser library, that is.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants