-
-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add files/line/column to run errors like iteratorError? #256
Comments
Looked into goyacc but I don't see an obvious way to pass the offset into Query/AST. |
Hey! that would be nice. jq-lsp uses a modified version of gojq's parser to keep track of token positions, might be a start. To get positions for runtime errors i think you would also have to pass along things while compiling. |
@wader thanks! I'll look into it. |
gojq is executing bytecodes which I didn't know. Adding offset to every bytecode would be a bit much I expect, so I think something like a symbol table should be implemented where we link opcodes to the corresponding symbols and offsets. The @wader do you have any thoughts about how to implement something like that? |
No good ideas really, i would guess some kind of location info needs to be tracked on the stack during execution? maybe @itchyny has some ideas? looking at the codeinfo stuff atm it seems to be debug only, so maybe also needs to consider how much performance impact it would have |
Would it be feasible and wanted to add files/line/column to things like iterator errors?
I had something in mind like:
The text was updated successfully, but these errors were encountered: