Change LineNumber nodes to point at definition site #311
Change LineNumber nodes to point at definition site #311oxinabox merged 1 commit intoJuliaDiff:masterfrom
Conversation
|
Yesss, thanks, i have been meeting to do this for ages. It would be good to add this to the Julia docs? |
| # These are some macros (and supporting functions) to make it easier to define rules. | ||
| using Base.Meta | ||
|
|
||
| macro strip_linenos(expr) |
There was a problem hiding this comment.
It operates on the quote itself, rather than the interpolated expression.
There was a problem hiding this comment.
I see, can we add a comment to this effect? or a docstring?
There was a problem hiding this comment.
Sure, feel free to add whatever you think would be helpful.
There was a problem hiding this comment.
Is the following correct?
| macro strip_linenos(expr) | |
| "This should be put before a `quote`, to stop the quote from having line numbers recorded" | |
| macro strip_linenos(expr) |
There was a problem hiding this comment.
Well, that is how to use it, but it's a bit of an odd description of the macro. It just deleted linenumber nodes in whatever block you put it in front of. E.g. if you did:
@strip_linenos function foo(x)
<blah>
end
then that function wouldn't have line numbers either.
oxinabox
left a comment
There was a problem hiding this comment.
Needs rebasing and bumping the verison number then we can merge.
|
BlockDiagonals failure is unrelated. |
|
ChainRules.jl failures are unrelated |
Before:
After:
N.B.:, currently includes the commit from #308, because it touches the same code, but should be automatically rebased once that is in.