Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Are node positions available? #3

Open
bmewburn opened this issue Jan 11, 2018 · 1 comment
Open

Are node positions available? #3

bmewburn opened this issue Jan 11, 2018 · 1 comment

Comments

@bmewburn
Copy link

Hello, you've done some nice work here, thanks for your time on this! I wondered if the ast node and attribute positions were available? If not is this something planned or within scope of this parser?

@ichiriac
Copy link
Member

Hi @bmewburn,

The lexer tracks the line, but not the column. Also, the resulting AST node does not provide any informations about location.

Of course this kind of feature would be a must have in this parser but actually I have no time in order to implement it.

If I would have to do it, I would start to calculate the column offset on the lexer first, and next I would implement a sort of function builder in order to build nodes.

This function will track the node start, and return a function. By calling the function later in order to retrieve the node instance, it would also track the node end, so I would provide a start position, and end position.

If you have time I would really grateful, but anyway, if you don't I think this would be part of a later release.

Best Regards,
Ioan

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

No branches or pull requests

2 participants