-
Notifications
You must be signed in to change notification settings - Fork 113
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
WIP: Annotate expressions with their location #35
Conversation
@expipiplus1 Nice! If this is a work in progress, shouldn't I wait until you're done? |
Yes! Please don't merge now! |
@jwiegley How would you suggest dealing with whitespace in the expression annotations? It's not possible to eat the whitespace before recording the start of the span as some parsers are whitespace sensitive (the tests fail for There isn't any opportunity to record trailing whitespace, as The best option I can think of is to postprocess the source spans to remove leading and trailing whitespace. Another option would be to split the parser and the lexer, but that'd probably be a much larger job. Another option would be to leave it as is, and let the user deal with it :) |
For now we can let the user deal with it, but I like the idea of splitting parser and lexer. |
The annoying thing is that I'm the user at the moment :) If I find a tidy way of stripping whitespace I think I'll do that. |
Another possibility would be to modify the definition of whitespace so that it maintains some kind of |
This is working well enough now for me to have made this little utility to automatically update https://github.com/expipiplus1/update-nix-fetchgit |
@jwiegley aside from some tests and documentation, is there anything major preventing this from being merged |
WIP: Annotate expressions with their location
Some initial work towards fixing #33
This is far from complete, Some functions need implementing, and there's some tidying up to do in the parser.
Annotation.hs
could also use a little more organisation.It typechecks though :)