-
Notifications
You must be signed in to change notification settings - Fork 42
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
fix printing when source code unavailable #22
Conversation
Ok, tests finally pass. Not sure I like special-casing tests for certain Julia versions, but eh... |
🎉 |
Good to go? |
Yup, unless you know how to make the printing prettier? :) |
Actually, do you know if the |
The code for showing
so perhaps a simple string replacement should work in most case (since we just want to do Another potential way would be to store the original non optimized |
I guess the only problem is if have something like
String replacing However, if we make sure it is not prefixed by |
Hm, if we only ever strip the outermost
|
Yes, I was just thinking about a naive string replacement function. Do you want to make the string parsing a bit more clever or modify the |
A naive regex based string replacement will only strip the outermost I think it's probably fine to merge this as-is -- if the naive string replacement is in fact wrong in certain edge cases someone (e.g. @Keno) will complain. |
I was also playing around with iterating over the expressions in |
Yes, the QuoteNodes do make it look uglier. This seems like a nice solution, thanks! |
This makes the REPL mode usable when we can't retrieve the actual source code by falling back to printing the lowered code:
This kinda breaks the connection between what is printed as line numbers and what
n
steps to, but I don't think we can realistically do anything about that. I'd also love to get rid of all theQuoteNode
clutter and get something more similar tobut I don't know where to get that from.
Probably should be tested, but I'm not quite sure how the current tests work...
Fixes #21.