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

Statement line number #304

Open
Dzale opened this issue May 29, 2020 · 3 comments
Open

Statement line number #304

Dzale opened this issue May 29, 2020 · 3 comments
Labels

Comments

@Dzale
Copy link

@Dzale Dzale commented May 29, 2020

Hey guys,

is there a way to get the actual line of statement that is currently being processed ?

I need it for logging purposes, when i ignore some statement, i wanna know what line was it in file,
so i can comeback later and check it.

Thanks in advance, and great package!

@williamdes
Copy link
Member

@williamdes williamdes commented May 29, 2020

Hi @Dzale

Good question, maybe @devenbansod would know ?

Thanks in advance, and great package!

Thank you !

@devenbansod
Copy link
Member

@devenbansod devenbansod commented May 31, 2020

@Dzale Unfortunately, we don't have the line number available explicitly while parsing. We do have access to the $token being processed and the $token does have information about the position (i.e. the start byte/char index) of the token in the input statement.

It might be possible to derive the line number given the char index. If you come up with a utility to do that, feel free to contribute it back to the library (possibly under here)

@Dzale
Copy link
Author

@Dzale Dzale commented Jun 1, 2020

Hey @devenbansod,

thanks for quick response, ill check it out and see if i can come up with a solution.

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.